UNPKG

beehole-store-server

Version:

www.bee-hole.com

1 lines 10.9 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0ac2f1da","chunk-19c55395","chunk-e65593bc"],{"0b97":function(t,e,n){"use strict";n("dcef")},"50d4":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t._self._c;return e("ant-modal",{ref:"antModalRef",attrs:{visible:t.open,"modal-title":t.formTitle,adjustSize:!1,footer:null,dialogClass:"designer-wrapper"},on:{cancel:t.cancel}},[e("div",{attrs:{slot:"content"},slot:"content"},[e("div",{staticClass:"top-box"},[e("h2",{staticClass:"title-h2"},[t._v(t._s(t.form.title)+"("+t._s("1"===t.form.type?"通知":"公告")+")")]),e("h3",{staticClass:"time-h3"},[t._v("发布时间:"+t._s(t.form.created_at))])]),e("div",{staticClass:"weui_article"},[e("div",{staticClass:"vditor-preview",staticStyle:{display:"block"}},[e("div",{staticClass:"vditor-reset",staticStyle:{"max-width":"100%"},domProps:{innerHTML:t._s(t.form.content)}})])])])])},o=[],a=n("5530"),s=n("92a2"),r=Object(a["a"])({},s["default"]),c=r,l=(n("0b97"),n("2877")),d=Object(l["a"])(c,i,o,!1,null,"044f56a8",null);e["default"]=d.exports},"8b29":function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return c})),n.d(e,"f",(function(){return l}));var i=n("b775");function o(t){return Object(i["b"])({url:"/notice/list",method:"get",params:t})}function a(t){return Object(i["b"])({url:"/notice/view",method:"get",params:{id:t}})}function s(t){return Object(i["b"])({url:"/notice/edit",method:"post",data:t})}function r(t){return Object(i["b"])({url:"/notice/delete",method:"post",params:{id:t}})}function c(t){return Object(i["b"])({url:"/notice/list",method:"get",params:t})}function l(t){return Object(i["b"])({url:"/system/notice/updateNoticeToRead/"+t,method:"put"})}},"8c4a":function(t,e,n){"use strict";n.r(e);n("99af");var i=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(n,i){return e("a-select-option",{key:i,attrs:{value:n.value}},[t._v(t._s(n.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.showViewModal?e("notice-view-form",{ref:"noticeViewForm",attrs:{typeOptions:t.typeOptions,statusOptions:t.statusOptions},on:{ok:t.getList,close:function(e){t.showViewModal=!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-NoticReadIndex-table",isTableConfig:!1,isShowSetBtn:!1,"format-conditions":!0,"row-selection":{selectedRowKeys:t.selectedRowKeys,onChange:t.onSelectChange},pagination:{current:t.queryParam.pageNum,pageSize:t.queryParam.pageSize,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(n){var i=n.text,o=n.record;return e("span",{},[e("a-tag",{attrs:{color:t._f("noticeTypeFilter")(i)}},[t._v(" "+t._s(t.typeFormat(o))+" ")])],1)}},{key:"status",fn:function(n){var i=n.text,o=n.record;return e("span",{},[e("a-badge",{attrs:{status:"1"===i?"processing":"error",text:t.isReadFormat(o)}})],1)}},{key:"created_at",fn:function(n){n.text;var i=n.record;return e("span",{},[t._v(" "+t._s(t.parseTime(i.created_at,"{y}-{m}-{d}"))+" ")])}},{key:"operation",fn:function(n){n.text;var i=n.record;return e("span",{},[e("a",{on:{click:function(e){return t.handleView(i)}}},[t._v(" 阅读 ")])])}}])},[e("div",{staticClass:"table-operations",attrs:{slot:"button"},slot:"button"},[e("a-button",{attrs:{type:"primary",disabled:t.multiple},on:{click:t.updateNoticeToRead}},[e("a-icon",{attrs:{type:"pushpin"}}),t._v("标记已读 ")],1)],1)])],1)],1)},o=[],a=(n("d81d"),n("8b29")),s=n("5d9e"),r=n("50d4"),c={name:"Notice",components:{AdvanceTable:s["a"],NoticeViewForm:r["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:{pageNum:1,pageSize:10,type:void 0,createBy:void 0,status:1},addModalRefName:"addModal",columns:[{title:"公告标题",dataIndex:"title",ellipsis:!0,width:"20%"},{title:"公告类型",dataIndex:"type",scopedSlots:{customRender:"type"},align:"center"},{title:"是否已读",dataIndex:"status",scopedSlots:{customRender:"status"},align:"center"},{title:"创建时间",dataIndex:"created_at",scopedSlots:{customRender:"created_at"},align:"center"},{title:"操作",dataIndex:"operation",width:"200",scopedSlots:{customRender:"operation"}}],showViewModal:!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(a["d"])(this.queryParam).then((function(e){t.list=e.list,t.total=e.total_count,t.loading=!1}))},isReadFormat:function(t){return null!==t.isRead&&""!==t.isRead&&"1"===t.isRead?"已读":"未读"},typeFormat:function(t){return this.selectDictLabel(this.typeOptions,t.type)},statusFormat:function(t){return this.selectDictLabel(this.statusOptions,t.status)},handleQuery:function(){this.queryParam.pageNum=1,this.getList()},resetQuery:function(){this.queryParam={pageNum:1,pageSize:10,title:void 0,status:void 0},this.handleQuery()},onShowSizeChange:function(t,e){this.queryParam.pageSize=e,this.getList()},onSizeChange:function(t,e){this.queryParam.pageNum=1,this.queryParam.pageSize=e,this.getList()},changeSize:function(t,e){this.queryParam.pageNum=t,this.queryParam.pageSize=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},handleView:function(t){var e=this;this.showViewModal=!0,this.$nextTick((function(){return e.$refs.noticeViewForm.handleView(t)}))},updateNoticeToRead:function(t){var e=this,n=t.id||this.ids;this.$confirm({title:"确认标记所选中数据?",onOk:function(){return Object(a["f"])(n).then((function(){e.onSelectChange([],[]),e.getList(),e.$message.success("标记成功",3)}))},onCancel:function(){}})}}},l=c,d=n("2877"),u=Object(d["a"])(l,i,o,!1,null,null,null);e["default"]=u.exports},"92a2":function(t,e,n){"use strict";n.r(e);var i=n("2dd7"),o=n("8b29"),a=n("ff41"),s=n.n(a);n("2f2f");e["default"]={name:"CreateForm",props:{typeOptions:{type:Array,required:!0},statusOptions:{type:Array,required:!0}},components:{AntModal:i["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 n=t.id;Object(o["b"])(n).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 n=t.id;Object(o["b"])(n).then((function(n){e.open=!0,e.$nextTick((function(){return e.$refs.antModalRef.setMaxDiolog()})),e.form=n,e.formId=n.id,e.formTitle="公告详情",e.$emit("ok"),0!==t.shop_id&&(t.status=0,Object(o["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(n){if(!n)return!1;t.uploaderButtonStatus=!0,void 0!==t.form.id?Object(o["e"])(t.form).then((function(e){t.$message.success("修改成功",3),t.open=!1,t.$emit("ok"),t.$emit("close")})):Object(o["e"])(t.form).then((function(n){e.$message.success("新增成功",3),e.open=!1,e.$emit("ok"),t.$emit("close")}))}))},back:function(){this.$router.push("/system/notice")}}}},dcef:function(t,e,n){}}]);