beehole-store-server
Version:
www.bee-hole.com
1 lines • 14.4 kB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d0198ecc","chunk-3c72ad2e","chunk-01f11bd0","chunk-e65593bc"],{"085b":function(t,e,o){"use strict";o.r(e);o("99af");var a=function(){var t=this,e=t._self._c;return e("div",[e("a-card",{staticStyle:{"margin-bottom":"10px"},attrs:{bordered:!1}},[e("div",{staticClass:"table-page-search-wrapper"},[e("a-form",{attrs:{labelCol:t.labelCol,wrapperCol:t.wrapperCol}},[e("a-row",{attrs:{gutter:48}},[e("a-col",{attrs:{md:6,sm:24}},[e("a-form-item",{attrs:{label:"公告标题"}},[e("a-input",{attrs:{placeholder:"请输入","allow-clear":""},model:{value:t.queryParam.title,callback:function(e){t.$set(t.queryParam,"title",e)},expression:"queryParam.title"}})],1)],1),e("a-col",{attrs:{md:6,sm:24}},[e("a-form-item",{attrs:{label:"公告类型"}},[e("a-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择","allow-clear":""},model:{value:t.queryParam.type,callback:function(e){t.$set(t.queryParam,"type",e)},expression:"queryParam.type"}},t._l(t.typeOptions,(function(o,a){return e("a-select-option",{key:a,attrs:{value:o.value}},[t._v(t._s(o.label))])})),1)],1)],1),e("a-col",[e("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"right"}},[e("a-button",{attrs:{type:"primary"},on:{click:t.handleQuery}},[e("a-icon",{attrs:{type:"search"}}),t._v("查询")],1),e("a-button",{staticStyle:{"margin-left":"8px"},on:{click:t.resetQuery}},[e("a-icon",{attrs:{type:"redo"}}),t._v("重置")],1)],1)])],1)],1)],1)]),e("a-card",{staticClass:"table-card",attrs:{bordered:!1}},[t.showAddModal?e("notice-add-form",{ref:"noticeAddForm",attrs:{typeOptions:t.typeOptions,statusOptions:t.statusOptions},on:{ok:t.getList,close:function(e){t.showAddModal=!1}}}):t._e(),t.showEditModal?e("notice-edit-form",{ref:"noticeEditForm",attrs:{typeOptions:t.typeOptions,statusOptions:t.statusOptions},on:{ok:t.getList,close:function(e){t.showEditModal=!1}}}):t._e(),e("advance-table",{attrs:{columns:t.columns,"data-source":t.list,title:"通知公告",loading:t.loading,rowKey:"id",size:"middle",tableKey:"system-notic-NoticIndex-table","format-conditions":!0,"row-selection":{selectedRowKeys:t.selectedRowKeys,onChange:t.onSelectChange},pagination:{current:t.queryParam.page,pageSize:t.queryParam.limit,total:t.total,showSizeChanger:!0,showLessItems:!0,showQuickJumper:!0,showTotal:function(t,e){return"第 ".concat(e[0],"-").concat(e[1]," 条,总计 ").concat(t," 条")},onChange:t.changeSize,onShowSizeChange:t.onSizeChange}},on:{refresh:t.getList},scopedSlots:t._u([{key:"type",fn:function(o){var a=o.text,i=o.record;return e("span",{},[e("a-tag",{attrs:{color:t._f("noticeTypeFilter")(a)}},[t._v(" "+t._s(t.typeFormat(i))+" ")])],1)}},{key:"status",fn:function(o){o.text;var a=o.record;return e("span",{},[e("a-badge",{attrs:{status:"processing",text:t.statusFormat(a)}})],1)}},{key:"created_at",fn:function(o){o.text;var a=o.record;return e("span",{},[t._v(" "+t._s(t.parseTime(a.created_at,"{y}-{m}-{d}"))+" ")])}},{key:"operation",fn:function(o){o.text;var a=o.record;return e("span",{},[e("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:edit"],expression:"['system:notice:edit']"}],on:{click:function(e){return t.handleUpdate(a)}}},[t._v(" 修改 ")]),e("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:remove"],expression:"['system:notice:remove']"}],attrs:{type:"vertical"}}),e("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:remove"],expression:"['system:notice:remove']"}],on:{click:function(e){return t.handleDelete(a)}}},[t._v(" 删除 ")])],1)}}])},[e("div",{staticClass:"table-operations",attrs:{slot:"button"},slot:"button"},[e("a-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:add"],expression:"['system:notice:add']"}],attrs:{type:"primary"},on:{click:t.handleAdd}},[e("a-icon",{attrs:{type:"plus"}}),t._v("新增 ")],1),t.multiple?t._e():e("a-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:remove"],expression:"['system:notice:remove']"}],attrs:{type:"danger",disabled:t.multiple},on:{click:t.handleDelete}},[e("a-icon",{attrs:{type:"delete"}}),t._v("删除 ")],1)],1)])],1)],1)},i=[],n=(o("d81d"),o("8b29")),s=o("5d9e"),r=o("f58c"),l=o("7b1a"),c={name:"Notice",components:{NoticeAddForm:r["default"],AdvanceTable:s["a"],NoticeEditForm:l["default"]},data:function(){return{list:[],selectedRowKeys:[],selectedRows:[],advanced:!1,single:!0,multiple:!0,ids:[],loading:!1,sunloading:!1,total:0,typeOptions:[],statusOptions:[],dateRange:[],labelCol:{span:6},wrapperCol:{span:18},queryParam:{page:1,limit:10,title:void 0,status:void 0},addModalRefName:"addModal",columns:[{title:"公告标题",dataIndex:"title",ellipsis:!0,width:"30%"},{title:"公告类型",dataIndex:"type",scopedSlots:{customRender:"type"},align:"center"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"},align:"center"},{title:"创建时间",dataIndex:"created_at",scopedSlots:{customRender:"created_at"}},{title:"操作",dataIndex:"operation",width:"200",scopedSlots:{customRender:"operation"}}],showAddModal:!1,showEditModal:!1}},filters:{noticeTypeFilter:function(t){var e="blue";return"1"===t&&(e="orange"),e}},created:function(){var t=this;this.getDicts("sys_notice_status").then((function(e){t.statusOptions=e})),this.getDicts("sys_notice_type").then((function(e){t.typeOptions=e})),this.getList()},computed:{},watch:{},methods:{getList:function(){var t=this;this.loading=!0,Object(n["c"])(this.queryParam).then((function(e){t.list=e.list,t.total=e.total_count,t.loading=!1}))},statusFormat:function(t){return this.selectDictLabel(this.statusOptions,t.status)},typeFormat:function(t){return this.selectDictLabel(this.typeOptions,t.type)},handleQuery:function(){this.queryParam.page=1,this.getList()},resetQuery:function(){this.queryParam={page:1,limit:10,title:void 0,status:void 0},this.handleQuery()},onShowSizeChange:function(t,e){this.queryParam.limit=e,this.getList()},onSizeChange:function(t,e){this.queryParam.page=1,this.queryParam.limit=e,this.getList()},changeSize:function(t,e){this.queryParam.page=t,this.queryParam.limit=e,this.getList()},onSelectChange:function(t,e){this.selectedRowKeys=t,this.selectedRows=e,this.ids=this.selectedRows.map((function(t){return t.id})),this.single=1!==t.length,this.multiple=!t.length},toggleAdvanced:function(){this.advanced=!this.advanced},handleAdd:function(){var t=this;this.showAddModal=!0,this.$nextTick((function(){return t.$refs.noticeAddForm.handleAdd()}))},handleUpdate:function(t){var e=this;this.showEditModal=!0,this.$nextTick((function(){return e.$refs.noticeEditForm.handleUpdate(t)}))},handleDelete:function(t){var e=this,o=t.id||this.ids;this.$confirm({title:"确认删除所选中数据?",onOk:function(){return Object(n["a"])(o).then((function(){e.onSelectChange([],[]),e.getList(),e.$message.success("删除成功",3)}))},onCancel:function(){}})}}},d=c,u=o("2877"),m=Object(u["a"])(d,a,i,!1,null,null,null);e["default"]=m.exports},"0c35":function(t,e,o){},"68ed":function(t,e,o){},"6fc0":function(t,e,o){"use strict";o("0c35")},"7b1a":function(t,e,o){"use strict";o.r(e);var a=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,a){return e("a-select-option",{key:a,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,a){return e("a-radio-button",{key:a,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=[],n=o("5530"),s=o("92a2"),r=Object(n["a"])({},s["default"]),l=r,c=(o("816c"),o("2877")),d=Object(c["a"])(l,a,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 n})),o.d(e,"e",(function(){return s})),o.d(e,"a",(function(){return r})),o.d(e,"d",(function(){return l})),o.d(e,"f",(function(){return c}));var a=o("b775");function i(t){return Object(a["b"])({url:"/notice/list",method:"get",params:t})}function n(t){return Object(a["b"])({url:"/notice/view",method:"get",params:{id:t}})}function s(t){return Object(a["b"])({url:"/notice/edit",method:"post",data:t})}function r(t){return Object(a["b"])({url:"/notice/delete",method:"post",params:{id:t}})}function l(t){return Object(a["b"])({url:"/notice/list",method:"get",params:t})}function c(t){return Object(a["b"])({url:"/system/notice/updateNoticeToRead/"+t,method:"put"})}},"92a2":function(t,e,o){"use strict";o.r(e);var a=o("2dd7"),i=o("8b29"),n=o("ff41"),s=o.n(n);o("2f2f");e["default"]={name:"CreateForm",props:{typeOptions:{type:Array,required:!0},statusOptions:{type:Array,required:!0}},components:{AntModal:a["a"],Vditor:s.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 s.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 s.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 a=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,a){return e("a-select-option",{key:a,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=[],n=o("5530"),s=o("92a2"),r=Object(n["a"])({},s["default"]),l=r,c=(o("6fc0"),o("2877")),d=Object(c["a"])(l,a,i,!1,null,null,null);e["default"]=d.exports}}]);