2 lines
8.8 KiB
JavaScript
2 lines
8.8 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b130b9c0"],{"3a93":function(t,e,s){"use strict";s.r(e);var o=function(){var t=this,e=t._self._c;return e("div",[e("el-card",{staticClass:"box-card"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("查询条件")])]),e("div",{},[e("el-form",{staticClass:"flex justify-start",attrs:{inline:!0,model:t.storeMsgManageInfo.conditions}},[e("el-form-item",[e("el-input",{attrs:{placeholder:"请输入通知名称",clearable:""},model:{value:t.storeMsgManageInfo.conditions.title,callback:function(e){t.$set(t.storeMsgManageInfo.conditions,"title",e)},expression:"storeMsgManageInfo.conditions.title"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:t._queryStoreMsgMethod}},[e("i",{staticClass:"el-icon-search"}),t._v(" 查询 ")])],1)],1)],1)]),e("el-card",{staticClass:"margin-top-sm"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("店铺通知")]),e("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:t._openAddStoreMsgModal}},[e("i",{staticClass:"el-icon-plus"}),t._v("发布 ")])],1),e("div",{},[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.storeMsgManageInfo.storeMsgs,border:""}},[e("el-table-column",{attrs:{prop:"msgId",label:"消息ID",align:"center"}}),e("el-table-column",{attrs:{prop:"title",label:"通知名称",align:"center"}}),e("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center"}}),e("el-table-column",{attrs:{label:"操作",align:"center",width:"200"},scopedSlots:t._u([{key:"default",fn:function(s){return[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._openEditStoreMsgModel(s.row)}}},[t._v("修改")]),e("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t._openDeleteStoreMsgModel(s.row)}}},[t._v("删除")])]}}])})],1),e("el-pagination",{staticStyle:{"margin-top":"20px"},attrs:{"current-page":t.currentPage,"page-size":t.pageSize,total:t.storeMsgManageInfo.total,layout:"total, prev, pager, next, jumper"},on:{"current-change":t.handleCurrentChange}})],1)]),e("add-store-msg",{ref:"addStoreMsg",on:{refresh:t._queryStoreMsgMethod}}),e("edit-store-msg",{ref:"editStoreMsg",on:{refresh:t._queryStoreMsgMethod}}),e("delete-store-msg",{ref:"deleteStoreMsg",on:{refresh:t._queryStoreMsgMethod}})],1)},a=[],r=s("b775");function i(t){return new Promise((e,s)=>{Object(r["a"])({url:"/shopMsg.listShopMsg",method:"get",params:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}function l(t){return new Promise((e,s)=>{Object(r["a"])({url:"/shopMsg.saveShopMsg",method:"post",data:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}function n(t){return new Promise((e,s)=>{Object(r["a"])({url:"/shopMsg.updateShopMsg",method:"post",data:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}function c(t){return new Promise((e,s)=>{Object(r["a"])({url:"/shopMsg.deleteShopMsg",method:"post",data:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}var d=s("7323"),g=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"发布通知",visible:t.dialogVisible,width:"50%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.handleClose}},[e("el-form",{ref:"form",attrs:{model:t.formData,"label-width":"100px"}},[e("el-form-item",{attrs:{label:"通知名称",prop:"title",required:""}},[e("el-input",{attrs:{placeholder:"必填,请填写通知名称"},model:{value:t.formData.title,callback:function(e){t.$set(t.formData,"title",e)},expression:"formData.title"}})],1),e("el-form-item",{attrs:{label:"连接地址",prop:"pageUrl",required:""}},[e("el-input",{attrs:{placeholder:"必填,请填写连接地址"},model:{value:t.formData.pageUrl,callback:function(e){t.$set(t.formData,"pageUrl",e)},expression:"formData.pageUrl"}})],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.saveStoreMsgInfo}},[t._v("保 存")])],1)],1)},h=[],f={name:"AddStoreMsg",data(){return{dialogVisible:!1,formData:{msgId:"",title:"",pageUrl:"",shopId:""}}},methods:{open(){this.dialogVisible=!0},handleClose(){this.$refs.form.resetFields()},async saveStoreMsgInfo(){try{await this.$refs.form.validate(),this.formData.shopId=Object(d["f"])();const t=await l(this.formData);0===t.code&&(this.$message.success("发布成功"),this.dialogVisible=!1,this.$emit("refresh"))}catch(t){console.error("保存失败:",t)}}}},p=f,u=s("2877"),m=Object(u["a"])(p,g,h,!1,null,null,null),M=m.exports,b=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"修改通知",visible:t.dialogVisible,width:"50%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.handleClose}},[e("el-form",{ref:"form",attrs:{model:t.formData,"label-width":"100px"}},[e("el-form-item",{attrs:{label:"通知名称",prop:"title",required:""}},[e("el-input",{attrs:{placeholder:"必填,请填写通知名称"},model:{value:t.formData.title,callback:function(e){t.$set(t.formData,"title",e)},expression:"formData.title"}})],1),e("el-form-item",{attrs:{label:"连接地址",prop:"pageUrl",required:""}},[e("el-input",{attrs:{placeholder:"必填,请填写连接地址"},model:{value:t.formData.pageUrl,callback:function(e){t.$set(t.formData,"pageUrl",e)},expression:"formData.pageUrl"}})],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.editStoreMsg}},[t._v("保 存")])],1)],1)},S=[],v={name:"EditStoreMsg",data(){return{dialogVisible:!1,formData:{msgId:"",title:"",pageUrl:"",shopId:""}}},methods:{open(t){this.formData={...t},this.dialogVisible=!0},handleClose(){this.$refs.form.resetFields()},async editStoreMsg(){try{await this.$refs.form.validate(),this.formData.shopId=Object(d["f"])();const t=await n(this.formData);0===t.code&&(this.$message.success("修改成功"),this.dialogVisible=!1,this.$emit("refresh"))}catch(t){console.error("修改失败:",t)}}}},_=v,y=Object(u["a"])(_,b,S,!1,null,null,null),I=y.exports,D=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"请确认您的操作!",visible:t.dialogVisible,width:"30%",center:""},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("div",{staticStyle:{"text-align":"center","margin-bottom":"20px"}},[e("span",[t._v("确定删除店铺通知")])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("点错了")]),e("el-button",{attrs:{type:"primary"},on:{click:t.deleteStoreMsg}},[t._v("确认删除")])],1)])},w=[],C={name:"DeleteStoreMsg",data(){return{dialogVisible:!1,deleteData:{}}},methods:{open(t){this.deleteData={...t},this.dialogVisible=!0},async deleteStoreMsg(){try{this.deleteData.shopId=Object(d["f"])();const t=await c(this.deleteData);0===t.code&&(this.$message.success("删除成功"),this.dialogVisible=!1,this.$emit("refresh"))}catch(t){console.error("删除失败:",t)}}}},k=C,x=Object(u["a"])(k,D,w,!1,null,null,null),V=x.exports,$={name:"StoreMsgManage",components:{AddStoreMsg:M,EditStoreMsg:I,DeleteStoreMsg:V},data(){return{storeMsgManageInfo:{storeMsgs:[],total:0,records:1,moreCondition:!1,msgId:"",msgFlags:[],conditions:{title:"",msgFlag:"",msgId:"",shopId:""}},currentPage:1,pageSize:10}},created(){this._listStoreMsgs(this.currentPage,this.pageSize),this.getDictData()},methods:{async getDictData(){try{const{data:t}=await Object(d["e"])("store_msg","msg_flag");this.storeMsgManageInfo.msgFlags=t}catch(t){console.error("获取字典数据失败:",t)}},async _listStoreMsgs(t,e){this.storeMsgManageInfo.conditions.page=t,this.storeMsgManageInfo.conditions.row=e,this.storeMsgManageInfo.conditions.shopId=Object(d["f"])();try{const t=await i(this.storeMsgManageInfo.conditions);this.storeMsgManageInfo.total=t.total,this.storeMsgManageInfo.records=t.records,this.storeMsgManageInfo.storeMsgs=t.data}catch(s){console.error("请求失败:",s)}},handleCurrentChange(t){this.currentPage=t,this._listStoreMsgs(t,this.pageSize)},_openAddStoreMsgModal(){this.$refs.addStoreMsg.open()},_openEditStoreMsgModel(t){this.$refs.editStoreMsg.open(t)},_openDeleteStoreMsgModel(t){this.$refs.deleteStoreMsg.open(t)},_queryStoreMsgMethod(){this.currentPage=1,this._listStoreMsgs(this.currentPage,this.pageSize)},_resetStoreMsgMethod(){console.log(this.storeMsgManageInfo.moreCondition),this.storeMsgManageInfo.conditions.title="",this.storeMsgManageInfo.conditions.msgFlag="",this.storeMsgManageInfo.conditions.msgId="",this._listStoreMsgs(this.currentPage,this.pageSize)}}},j=$,O=(s("cfb7"),Object(u["a"])(j,o,a,!1,null,"1b83eb3a",null));e["default"]=O.exports},b438:function(t,e,s){},cfb7:function(t,e,s){"use strict";s("b438")}}]);
|
|
//# sourceMappingURL=chunk-b130b9c0.327a118e.js.map
|