beehole-store-server
Version:
www.bee-hole.com
1 lines • 5.63 kB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3c72ad2e","chunk-e65593bc"],{"0c35":function(t,e,o){},"6fc0":function(t,e,o){"use strict";o("0c35")},"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 c})),o.d(e,"d",(function(){return s})),o.d(e,"f",(function(){return d}));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 c(t){return Object(n["b"])({url:"/notice/delete",method:"post",params:{id:t}})}function s(t){return Object(n["b"])({url:"/notice/list",method:"get",params:t})}function d(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")}}}},f58c:function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t._self._c;return e("ant-modal",{attrs:{visible:t.open,"modal-title":t.formTitle,"adjust-size":!0,modalWidth:"800",modalHeight:"550"},on:{cancel:t.cancel}},[e("a-form-model",{ref:"form",attrs:{slot:"content",model:t.form,rules:t.rules,layout:"vertical"},slot:"content"},[e("a-row",{staticClass:"form-row",attrs:{gutter:32}},[e("a-col",{attrs:{lg:12,md:12,sm:24}},[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)],1),e("a-col",{attrs:{lg:12,md:12,sm:24}},[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)],1),e("a-col",{attrs:{lg:24,md:24,sm:24}},[e("a-form-model-item",{staticClass:"addModel",attrs:{label:"内容",prop:"content"}},[e("div",{attrs:{id:"vditor",name:"description"}})])],1)],1)],1),e("template",{slot:"footer"},[e("a-button",{attrs:{disabled:t.uploaderButtonStatus},on:{click:t.cancel}},[t._v(" 取消 ")]),e("a-button",{attrs:{type:"primary",loading:t.uploaderButtonStatus},on:{click:t.submitForm}},[t._v(" 发布 ")])],1)],2)},i=[],r=o("5530"),a=o("92a2"),c=Object(r["a"])({},a["default"]),s=c,d=(o("6fc0"),o("2877")),l=Object(d["a"])(s,n,i,!1,null,null,null);e["default"]=l.exports}}]);