Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-11cf9a54.9ba3155d.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
12 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-11cf9a54"],{"0ebf":function(e,a,l){},"1fa6":function(e,a,l){"use strict";l.r(a);var t=function(){var e=this,a=e._self._c;return a("div",[a("el-card",{staticClass:"ibox"},[a("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[a("div",[e._v(e._s(e.$t("labelManage.queryTitle")))])]),a("div",{},[a("el-form",{staticClass:"flex justify-start",attrs:{inline:!0,model:e.labelManageInfo.conditions}},[a("el-form-item",[a("el-form-item",[a("el-input",{attrs:{placeholder:e.$t("labelManage.labelNamePlaceholder"),clearable:""},model:{value:e.labelManageInfo.conditions.labelName,callback:function(a){e.$set(e.labelManageInfo.conditions,"labelName",a)},expression:"labelManageInfo.conditions.labelName"}})],1)],1),a("el-form-item",[a("el-form-item",[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("labelManage.domainPlaceholder"),clearable:""},model:{value:e.labelManageInfo.conditions.domain,callback:function(a){e.$set(e.labelManageInfo.conditions,"domain",a)},expression:"labelManageInfo.conditions.domain"}},e._l(e.labelManageInfo.domains,(function(e){return a("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e._queryLabelMethod}},[a("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("common.query"))+" ")]),a("el-button",{on:{click:e._resetLabelMethod}},[a("i",{staticClass:"el-icon-refresh"}),e._v(" "+e._s(e.$t("common.reset"))+" ")])],1)],1)],1)]),a("el-card",{staticClass:"margin-top-sm"},[a("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[a("div",[e._v(e._s(e.$t("labelManage.labelInfoTitle")))]),a("el-button",{attrs:{type:"primary"},on:{click:e._openAddLabelModal}},[a("i",{staticClass:"el-icon-plus"}),e._v(" "+e._s(e.$t("common.add"))+" ")])],1),a("div",{},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.labelManageInfo.labels,border:""}},[a("el-table-column",{attrs:{prop:"labelName",label:e.$t("labelManage.labelName"),align:"center"}}),a("el-table-column",{attrs:{prop:"labelCd",label:e.$t("labelManage.labelCode"),align:"center"}}),a("el-table-column",{attrs:{prop:"domain",label:e.$t("labelManage.domain"),align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[e._v(" "+e._s("PUBLIC"===a.domain?e.$t("labelManage.publicDomain"):e.$t("labelManage.otherDomain"))+" ")]}}])}),a("el-table-column",{attrs:{prop:"labelType",label:e.$t("labelManage.labelType"),align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[e._v(" "+e._s("C"===a.labelType?e.$t("labelManage.customLabel"):e.$t("labelManage.systemLabel"))+" ")]}}])}),a("el-table-column",{attrs:{prop:"createTime",label:e.$t("labelManage.createTime"),align:"center"}}),a("el-table-column",{attrs:{label:e.$t("common.operation"),align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function({row:l}){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e._openEditLabelModel(l)}}},[e._v(" "+e._s(e.$t("common.edit"))+" ")]),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e._openDeleteLabelModel(l)}}},[e._v(" "+e._s(e.$t("common.delete"))+" ")])]}}])})],1),a("el-pagination",{attrs:{"current-page":e.labelManageInfo.conditions.page,"page-sizes":[10,20,30,50],"page-size":e.labelManageInfo.conditions.row,layout:"total, sizes, prev, pager, next, jumper",total:e.labelManageInfo.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)]),a("add-label",{ref:"addLabelRef",on:{refresh:e._queryLabelMethod}}),a("edit-label",{ref:"editLabelRef",on:{refresh:e._queryLabelMethod}}),a("delete-label",{ref:"deleteLabelRef",on:{refresh:e._queryLabelMethod}})],1)},o=[],n=l("7323"),s=l("b775");function i(e){return new Promise((a,l)=>{Object(s["a"])({url:"/label/queryLabel",method:"get",params:e}).then(e=>{const l=e.data;a(l)}).catch(e=>{l(e)})})}function d(e){return new Promise((a,l)=>{Object(s["a"])({url:"/label/saveLabel",method:"post",data:e}).then(e=>{const t=e.data;0===t.code?a(t):l(t.msg)}).catch(e=>{l(e)})})}function r(e){return new Promise((a,l)=>{Object(s["a"])({url:"/label/updateLabel",method:"post",data:e}).then(e=>{const t=e.data;0===t.code?a(t):l(t.msg)}).catch(e=>{l(e)})})}function b(e){return new Promise((a,l)=>{Object(s["a"])({url:"/label/deleteLabel",method:"post",data:e}).then(e=>{const t=e.data;0===t.code?a(t):l(t.msg)}).catch(e=>{l(e)})})}var c=function(){var e=this,a=e._self._c;return a("el-dialog",{attrs:{title:e.$t("labelManage.addTitle"),visible:e.dialogVisible,width:"50%"},on:{"update:visible":function(a){e.dialogVisible=a},close:e.handleClose}},[a("el-form",{ref:"addForm",attrs:{model:e.addLabelInfo,rules:e.rules,"label-width":"120px"}},[a("el-form-item",{attrs:{label:e.$t("labelManage.labelName"),prop:"labelName"}},[a("el-input",{attrs:{placeholder:e.$t("labelManage.labelNamePlaceholder")},model:{value:e.addLabelInfo.labelName,callback:function(a){e.$set(e.addLabelInfo,"labelName",a)},expression:"addLabelInfo.labelName"}})],1),a("el-form-item",{attrs:{label:e.$t("labelManage.domain"),prop:"domain"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("labelManage.domainPlaceholder")},model:{value:e.addLabelInfo.domain,callback:function(a){e.$set(e.addLabelInfo,"domain",a)},expression:"addLabelInfo.domain"}},e._l(e.addLabelInfo.domains,(function(e){return a("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(a){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("common.cancel"))+" ")]),a("el-button",{attrs:{type:"primary"},on:{click:e.saveLabelInfo}},[e._v(" "+e._s(e.$t("common.confirm"))+" ")])],1)],1)},m=[],f={name:"AddLabel",data(){return{dialogVisible:!1,addLabelInfo:{labelName:"",domains:[],domain:"",labelType:"C",shopId:""},rules:{labelName:[{required:!0,message:this.$t("labelManage.labelNameRequired"),trigger:"blur"},{max:30,message:this.$t("labelManage.labelNameMaxLength"),trigger:"blur"}],domain:[{required:!0,message:this.$t("labelManage.domainRequired"),trigger:"change"}]}}},methods:{open(){this.dialogVisible=!0,this.getDomains()},async getDomains(){try{const{data:e}=await Object(n["e"])("s_label","domain");this.addLabelInfo.domains=e}catch(e){console.error("获取字典数据失败:",e)}},handleClose(){this.$refs.addForm.resetFields(),this.addLabelInfo={labelName:"",domains:[],domain:"",labelType:"C",shopId:""}},async saveLabelInfo(){this.$refs.addForm.validate(async e=>{if(e){let e=Object(n["f"])();this.addLabelInfo.shopId=e;try{await d(this.addLabelInfo),this.$message.success(this.$t("common.submitSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(a){this.$message.error(a),console.error("添加标签失败:",a)}}})}}},h=f,u=l("2877"),g=Object(u["a"])(h,c,m,!1,null,null,null),p=g.exports,I=function(){var e=this,a=e._self._c;return a("el-dialog",{attrs:{title:e.$t("labelManage.editTitle"),visible:e.dialogVisible,width:"50%"},on:{"update:visible":function(a){e.dialogVisible=a},close:e.handleClose}},[a("el-form",{ref:"editForm",attrs:{model:e.editLabelInfo,rules:e.rules,"label-width":"120px"}},[a("el-form-item",{attrs:{label:e.$t("labelManage.labelName"),prop:"labelName"}},[a("el-input",{attrs:{placeholder:e.$t("labelManage.labelNamePlaceholder")},model:{value:e.editLabelInfo.labelName,callback:function(a){e.$set(e.editLabelInfo,"labelName",a)},expression:"editLabelInfo.labelName"}})],1),a("el-form-item",{attrs:{label:e.$t("labelManage.domain"),prop:"domain"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("labelManage.domainPlaceholder")},model:{value:e.editLabelInfo.domain,callback:function(a){e.$set(e.editLabelInfo,"domain",a)},expression:"editLabelInfo.domain"}},e._l(e.editLabelInfo.domains,(function(e){return a("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(a){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("common.cancel"))+" ")]),a("el-button",{attrs:{type:"primary"},on:{click:e.editLabel}},[e._v(" "+e._s(e.$t("common.confirm"))+" ")])],1)],1)},L=[],M={name:"EditLabel",data(){return{dialogVisible:!1,editLabelInfo:{labelId:"",labelName:"",domains:[],domain:"",labelType:"C",shopId:""},rules:{labelName:[{required:!0,message:this.$t("labelManage.labelNameRequired"),trigger:"blur"},{max:30,message:this.$t("labelManage.labelNameMaxLength"),trigger:"blur"}],domain:[{required:!0,message:this.$t("labelManage.domainRequired"),trigger:"change"}],labelId:[{required:!0,message:this.$t("labelManage.labelIdRequired"),trigger:"blur"}]}}},methods:{open(e){this.dialogVisible=!0,this.editLabelInfo={...e},this.getDomains()},async getDomains(){try{const{data:e}=await Object(n["e"])("s_label","domain");this.editLabelInfo.domains=e}catch(e){console.error("获取字典数据失败:",e)}},handleClose(){this.$refs.editForm.resetFields(),this.editLabelInfo={labelId:"",labelName:"",domains:[],domain:"",labelType:"C",shopId:""}},editLabel(){this.$refs.editForm.validate(async e=>{if(e){let e=Object(n["f"])();this.editLabelInfo.shopId=e;try{await r(this.editLabelInfo),this.$message.success(this.$t("common.submitSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(a){this.$message.error(a),console.error("修改标签失败:",a)}}})}}},_=M,$=Object(u["a"])(_,I,L,!1,null,null,null),y=$.exports,v=function(){var e=this,a=e._self._c;return a("el-dialog",{attrs:{title:e.$t("labelManage.deleteTitle"),visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(a){e.dialogVisible=a},close:e.handleClose}},[a("div",{staticStyle:{"text-align":"center"}},[a("p",[e._v(e._s(e.$t("labelManage.deleteConfirm")))])]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(a){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("common.cancel"))+" ")]),a("el-button",{attrs:{type:"primary"},on:{click:e.deleteLabel}},[e._v(" "+e._s(e.$t("common.confirm"))+" ")])],1)])},C=[],w={name:"DeleteLabel",data(){return{dialogVisible:!1,deleteLabelInfo:{labelId:"",shopId:""}}},methods:{open(e){this.dialogVisible=!0,this.deleteLabelInfo.labelId=e.labelId},handleClose(){this.deleteLabelInfo={labelId:"",shopId:""}},async deleteLabel(){let e=Object(n["f"])();this.deleteLabelInfo.shopId=e;try{await b(this.deleteLabelInfo),this.$message.success(this.$t("common.submitSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(a){this.$message.error(a),console.error("删除标签失败:",a)}}}},N=w,k=Object(u["a"])(N,v,C,!1,null,null,null),x=k.exports,j={name:"LabelManage",components:{AddLabel:p,EditLabel:y,DeleteLabel:x},data(){return{labelManageInfo:{labels:[],total:0,records:1,domains:[],conditions:{labelName:"",domain:"",labelCd:"C",shopId:"",page:1,row:10}}}},created(){this._initData()},methods:{async _initData(){let e=this.getShopId();this.labelManageInfo.conditions.shopId=e,await this._listLabels(),this._getDomains()},async _getDomains(){try{const{data:e}=await Object(n["e"])("s_label","domain");this.labelManageInfo.domains=e}catch(e){console.error("获取字典数据失败:",e)}},async _listLabels(e=1,a=10){this.labelManageInfo.conditions.page=e,this.labelManageInfo.conditions.row=a;try{const e=await i(this.labelManageInfo.conditions);this.labelManageInfo.labels=e.data,this.labelManageInfo.total=e.total,this.labelManageInfo.records=e.records}catch(l){console.error("获取标签列表失败:",l)}},_queryLabelMethod(){this._listLabels()},_resetLabelMethod(){this.labelManageInfo.conditions.labelName="",this.labelManageInfo.conditions.domain="",this._listLabels()},_openAddLabelModal(){this.$refs.addLabelRef.open()},_openEditLabelModel(e){this.$refs.editLabelRef.open(e)},_openDeleteLabelModel(e){this.$refs.deleteLabelRef.open(e)},handleSizeChange(e){this.labelManageInfo.conditions.row=e,this._listLabels()},handleCurrentChange(e){this._listLabels(e)}}},q=j,V=(l("df77"),Object(u["a"])(q,t,o,!1,null,"7f4da21e",null));a["default"]=V.exports},df77:function(e,a,l){"use strict";l("0ebf")}}]);
//# sourceMappingURL=chunk-11cf9a54.9ba3155d.js.map