chunk-2d74f1e0.913a469e.js 8.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d74f1e0","chunk-59c07794","chunk-2d230c38","chunk-2d22db4d"],{"231c":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t._self._c;return e("el-popover",{staticClass:"operate-module-line",attrs:{"popper-class":"liu-popover-line",placement:"top",width:"104",trigger:"manual"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[e("div",{staticClass:"operate-wrap"},[t._l(t.data.children,(function(a,s){return e("div",{key:s,staticClass:"operate-list"},[e("i",{staticClass:"iconfont iconcaozuojihuo",on:{click:function(e){return e.stopPropagation(),t.listDel(s)}}}),e("div",{staticClass:"btn-text",on:{click:function(e){return t.listClick(a,s)}}},[t._v(t._s(a.name))])])})),e("div",{staticClass:"operate-list operate-list-add",on:{click:function(e){return t.addFn()}}},[e("i",{staticClass:"iconfont icontupiantianjia icon-add"})])],2),e("el-button",{staticClass:"operate-btn",attrs:{slot:"reference",type:"text",icon:"el-icon-s-fold"},slot:"reference"},[t._v(t._s(t.data.name))])],1)},i=[],o={name:"operate-module",data(){return{}},props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},mounted(){},methods:{showFn(){this.$emit("show",this.data)},listClick(t,e){this.$emit("click",{...t,index:e})},listDel(t){this.$emit("del",t)},addFn(){this.$emit("add")}}},n=o,r=(a("7ede"),a("1805")),l=Object(r["a"])(n,s,i,!1,null,null,null);e["default"]=l.exports},6971:function(t,e,a){},"7c4c":function(t,e,a){"use strict";a("6971")},"7dbd":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"app-list-content"},[e("div",{staticClass:"content-wrap"},[e("div",{staticClass:"wx-wrap"},[e("div",{staticClass:"wx-bar"},[t._m(0),e("div",{staticClass:"bar-text"},[t._v(t._s(t.shopInfo.name))])]),e("div",{staticClass:"wx-content",on:{click:t.closeOptionFn}}),e("div",{staticClass:"wx-btn"},[t._m(1),t._l(t.menuData,(function(a,s){return e("div",{key:s,staticClass:"menu-btn",class:[t.activeIndex==s?"active":""],on:{click:function(e){return t.menuClickFn(a,s)}}},[e("operate-line-module",{attrs:{show:t.operateShow[s],data:a},on:{click:t.operateClickFn,add:function(e){return t.operateAddFn(s)},del:t.operateDelFn}})],1)}))],2)]),t.addDialog?[e("div",{staticClass:"ad-modal-content"},[e("div",{staticClass:"ad-modal-wrap"},[e("el-form",{ref:"form",staticClass:"demo-form",attrs:{model:t.form,rules:t.rule,"label-width":"50px"}},[e("el-form-item",{attrs:{label:"名称",prop:"name"}},[e("el-input",{attrs:{placeholder:"请输入菜单名称",size:"small"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),e("el-form-item",{attrs:{label:"选项",prop:"menuOption"}},[e("el-radio-group",{model:{value:t.form.menuOption,callback:function(e){t.$set(t.form,"menuOption",e)},expression:"form.menuOption"}},[e("el-radio",{attrs:{label:"0"}},[t._v("常用网址")]),e("el-radio",{attrs:{label:"1"}},[t._v("自定义网址")])],1)],1),e("el-form-item",{staticClass:"content-j-wrap",attrs:{label:""}},[0==t.form.menuOption?[e("el-radio-group",{attrs:{size:"mini"},model:{value:t.form.targetId,callback:function(e){t.$set(t.form,"targetId",e)},expression:"form.targetId"}},t._l(t.commonUrlData,(function(a,s){return e("el-radio",{key:s,attrs:{border:"",label:a.id}},[t._v(t._s(a.name))])})),1)]:[e("div",[e("el-input",{attrs:{placeholder:"请填写链接,留空点图片不跳转",size:"small"},model:{value:t.form.replyUrl,callback:function(e){t.$set(t.form,"replyUrl",e)},expression:"form.replyUrl"}})],1)]],2)],1),e("div",{staticClass:"dialog-footer"},[e("el-button",{attrs:{size:"small"},on:{click:t.resetForm}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.confirmForm}},[t._v("提交")])],1)],1)])]:t._e()],2)])},i=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"bar-img"},[e("img",{attrs:{src:a("ee57"),alt:""}})])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"key-btn"},[e("img",{staticClass:"key-btn-img",attrs:{src:a("f948"),alt:"",mode:"widthFix"}})])}],o=(a("b138"),a("8f26"),a("666b"),a("963e"),a("209c"),a("f803"),a("5880")),n=a("231c"),r={name:"wx-menu",components:{operateLineModule:n["default"]},data(){return{form:{name:"",menuOption:"0",replyUrl:"",targetId:0},rule:{},isModifyParents:!1,addDialog:!1,activeIndex:null,subActiveIndex:null,menuData:[],urlIndex:null,commonUrlData:[],operateShow:[],operateData:null,btnData:[]}},computed:{...Object(o["mapGetters"])(["shopInfo","userInfo"])},created(){this.init()},methods:{init(){this._getDet(),this._getUrl()},_getDet(){this.$service.setting.getMenu().then(t=>{this.menuData=t.map(t=>(t.children||(t.children=[]),t)),t.map(()=>{this.operateShow.push(!1)})})},_getUrl(){this.$service.single.commonUrl().then(t=>{this.commonUrlData=t})},async submitFn(){console.log(this.menuData),await this.$service.setting.updateMenu(this.menuData).then(t=>{this.$message.success(t.msg||"提交"),this.resetForm()})},menuClickFn(t,e){this.isModifyParents=!0,this.closeOperate(),this.activeIndex=e,this.operateShow[e]=!0,this.operateData=t.children||[],console.log("江总",t),console.log("江总11",this.commonUrlData),Object.keys(this.form).forEach(e=>{this.form[e]=t[e]}),this.addDialog=!0},operateClickFn(t){this.isModifyParents=!1,this.subActiveIndex=t.index,console.log("item",t),t.targetId=t.targetId?parseInt(t.targetId):0,Object.keys(this.form).forEach(e=>{this.form[e]=t[e]}),this.addDialog=!0},operateAddFn(t){if(this.operateData.length>4)return this.$message.warning("亲,最多只能设置五个子菜单!"),!1;let e={name:"子菜单名",menuOption:"0",replyUrl:"",targetId:0};this.$set(this.operateShow,this.activeIndex,!1),this.operateData.push(e),this.menuData[this.activeIndex].children=JSON.parse(JSON.stringify(this.operateData)),setTimeout(()=>{this.$set(this.operateShow,this.activeIndex,!0)})},operateDelFn(t){console.log("我点击了删除按钮!",t),this.$set(this.operateShow,this.activeIndex,!1),this.operateData.splice(t,1),this.menuData[this.activeIndex].children=JSON.parse(JSON.stringify(this.operateData)),setTimeout(()=>{this.$set(this.operateShow,this.activeIndex,!0)})},closeOperate(){this.activeIndex=null,this.operateShow=this.operateShow.map(t=>!1),this.addDialog=!1},closeOptionFn(){this.closeOperate(),this.resetForm()},confirmForm(){let t=JSON.parse(JSON.stringify(this.form));this.isModifyParents?(Object.keys(t).forEach(e=>{this.menuData[this.activeIndex][e]=t[e]}),console.log("江总22",this.menuData)):(this.operateData[this.subActiveIndex]=t,console.log("this.operateData",this.operateData),this.menuData[this.activeIndex].children=JSON.parse(JSON.stringify(this.operateData))),this.submitFn().then(t=>{console.log("this.activeIndex",this.activeIndex),this.addDialog=!1})},resetForm(){this.form={name:"",menuOption:"0",replyUrl:"",targetId:0},this.$refs["form"].resetFields()}}},l=r,c=(a("7c4c"),a("1805")),d=Object(c["a"])(l,s,i,!1,null,"6bc7b9dd",null);e["default"]=d.exports},"7ede":function(t,e,a){"use strict";a("ff4a")},ee57:function(t,e,a){t.exports=a.p+"img/wx-bar-bg.18045892.png"},f948:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAA6CAMAAADWZboaAAAAPFBMVEX5+fkfHx/k5OQ+Pj79/f0QEBAwMDD39/f///8DAwPKysq5ubnt7e2np6aGhobX19dSUlJnZ2d2dnaUlJQzuMSfAAADdElEQVRIx51WWYLtKghERYNzhv3v9YGZTDrJfd186DnGAkUogOFL8OsjfCPpj1AKs6Y/QSk4P31g4QNprPVTol9DkW1axo6vduEVaawSsZPGX0J13SX9+q64CfzpXb/lDQpI1IzSq114WgeiQYeYlyXnyHclgv9nFWioeTLKehGrzBw1PoB/rhCE2TWQvI4VBdaUygdJ31CgOive7MZ5yTHmXNg+o82i74ZvfwkzW7TjEpL4iVhQx2JkLRB+QDGJSZO1QE5XUy2s0OUrFq7IyXpV9N2jjA78xRbEF2hDughP3qS03LHQcwIjTaDnCCDIytul+9r9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