UNPKG

beehole-store-server

Version:

www.bee-hole.com

1 lines 5.79 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-01f11bd0","chunk-e65593bc"],{"68ed":function(t,e,o){},"7b1a":function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t._self._c;return e("a-drawer",{attrs:{width:"650",title:t.formTitle,"label-col":4,"wrapper-col":14,visible:t.open,"body-style":{height:"calc(100vh - 100px)",overflow:"auto"}},on:{close:t.cancel}},[e("a-form-model",{ref:"form",attrs:{model:t.form,rules:t.rules,layout:"vertical"}},[e("a-form-model-item",{attrs:{label:"公告标题",prop:"title"}},[e("a-input",{attrs:{placeholder:"请输入"},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),e("a-form-model-item",{attrs:{label:"公告类型",prop:"type"}},[e("a-select",{attrs:{placeholder:"请选择"},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},t._l(t.typeOptions,(function(o,n){return e("a-select-option",{key:n,attrs:{value:o.value}},[t._v(t._s(o.label))])})),1)],1),e("a-form-model-item",{attrs:{label:"状态",prop:"status"}},[e("a-radio-group",{attrs:{"button-style":"solid"},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},t._l(t.statusOptions,(function(o,n){return e("a-radio-button",{key:n,attrs:{value:o.value}},[t._v(t._s(o.label))])})),1)],1),e("a-form-model-item",{staticClass:"addModel",attrs:{label:"内容",prop:"content"}},[e("div",{attrs:{id:"vditorEdit",name:"description"}})]),e("div",{staticClass:"bottom-control",staticStyle:{"z-index":"9999"}},[e("a-space",[e("a-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(" 发布 ")]),e("a-button",{on:{click:t.cancel}},[t._v(" 取消 ")])],1)],1)],1)],1)},i=[],r=o("5530"),a=o("92a2"),s=Object(r["a"])({},a["default"]),c=s,l=(o("816c"),o("2877")),d=Object(l["a"])(c,n,i,!1,null,"0eb24455",null);e["default"]=d.exports},"816c":function(t,e,o){"use strict";o("68ed")},"8b29":function(t,e,o){"use strict";o.d(e,"c",(function(){return i})),o.d(e,"b",(function(){return r})),o.d(e,"e",(function(){return a})),o.d(e,"a",(function(){return s})),o.d(e,"d",(function(){return c})),o.d(e,"f",(function(){return l}));var n=o("b775");function i(t){return Object(n["b"])({url:"/notice/list",method:"get",params:t})}function r(t){return Object(n["b"])({url:"/notice/view",method:"get",params:{id:t}})}function a(t){return Object(n["b"])({url:"/notice/edit",method:"post",data:t})}function s(t){return Object(n["b"])({url:"/notice/delete",method:"post",params:{id:t}})}function c(t){return Object(n["b"])({url:"/notice/list",method:"get",params:t})}function l(t){return Object(n["b"])({url:"/system/notice/updateNoticeToRead/"+t,method:"put"})}},"92a2":function(t,e,o){"use strict";o.r(e);var n=o("2dd7"),i=o("8b29"),r=o("ff41"),a=o.n(r);o("2f2f");e["default"]={name:"CreateForm",props:{typeOptions:{type:Array,required:!0},statusOptions:{type:Array,required:!0}},components:{AntModal:n["a"],Vditor:a.a},data:function(){return{open:!1,attachmentRefName:"addUploaderFile",editAttachmentRefName:"editUploaderFile",attachmentUploadStatus:!0,uploaderButtonStatus:!1,formId:"",labelCol:{span:4},wrapperCol:{span:14},loading:!1,total:0,id:void 0,formTitle:"",contentEditorEdit:"",form:{id:void 0,title:void 0,type:void 0,content:"",status:"0"},rules:{title:[{required:!0,message:"公告标题不能为空",trigger:"blur"}],type:[{required:!0,message:"公告类型不能为空",trigger:"change"}]},vditorToolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools"]}]}},filters:{},created:function(){},computed:{},watch:{},mounted:function(){},methods:{cancel:function(){this.open=!1,this.reset(),this.$emit("close")},reset:function(){this.form={id:void 0,title:void 0,type:void 0,content:"",status:"0"},this.formId&&(this.formId="")},handleAdd:function(){var t=this;this.reset(),this.open=!0,this.formTitle="添加公告",this.$nextTick((function(){""===t.contentEditorEdit?t.contentEditorEdit=new a.a("vditor",{height:180,toolbarConfig:{pin:!0},toolbar:t.vditorToolbar,cache:{enable:!1},after:function(){t.contentEditorEdit.setValue(t.form.content)}}):t.contentEditorEdit.setValue(t.form.content)}))},handleUpdate:function(t){var e=this;this.reset();var o=t.id;Object(i["b"])(o).then((function(t){e.open=!0,e.form=t,e.formId=t.id,e.formTitle="修改公告",e.$nextTick((function(){""===e.contentEditorEdit?e.contentEditorEdit=new a.a("vditorEdit",{height:360,toolbarConfig:{pin:!0},toolbar:e.vditorToolbar,cache:{enable:!1},after:function(){e.contentEditorEdit.setValue(t.content)}}):e.contentEditorEdit.setValue(t.content)}))}))},handleView:function(t){var e=this;this.reset();var o=t.id;Object(i["b"])(o).then((function(o){e.open=!0,e.$nextTick((function(){return e.$refs.antModalRef.setMaxDiolog()})),e.form=o,e.formId=o.id,e.formTitle="公告详情",e.$emit("ok"),0!==t.shop_id&&(t.status=0,Object(i["e"])(t).then((function(t){e.$message.success("通知已阅",3),e.$emit("ok")})))}))},submitForm:function(){var t=this,e=this;this.form.content=this.contentEditorEdit.getValue(),this.form.contentHtml=this.contentEditorEdit.getHTML(),this.$refs.form.validate((function(o){if(!o)return!1;t.uploaderButtonStatus=!0,void 0!==t.form.id?Object(i["e"])(t.form).then((function(e){t.$message.success("修改成功",3),t.open=!1,t.$emit("ok"),t.$emit("close")})):Object(i["e"])(t.form).then((function(o){e.$message.success("新增成功",3),e.open=!1,e.$emit("ok"),t.$emit("close")}))}))},back:function(){this.$router.push("/system/notice")}}}}}]);