| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-15f90847","chunk-768599fe","chunk-2d230c38","chunk-2d22db4d"],{"231c":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("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"}},[a("div",{staticClass:"operate-wrap"},[t._l(t.data.children,(function(e,n){return a("div",{key:n,staticClass:"operate-list"},[a("i",{staticClass:"iconfont iconcaozuojihuo",on:{click:function(e){return e.stopPropagation(),t.listDel(n)}}}),a("div",{staticClass:"btn-text",on:{click:function(a){return t.listClick(e,n)}}},[t._v(t._s(e.name))])])})),a("div",{staticClass:"operate-list operate-list-add",on:{click:function(e){return t.addFn()}}},[a("i",{staticClass:"iconfont icontupiantianjia icon-add"})])],2),a("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=a("6abc"),s={name:"operate-module",data:function(){return{}},props:{show:{type:Boolean,default:!1},data:{type:Object,default:function(){}}},mounted:function(){},methods:{showFn:function(){this.$emit("show",this.data)},listClick:function(t,e){this.$emit("click",Object(o["a"])(Object(o["a"])({},t),{index:e}))},listDel:function(t){this.$emit("del",t)},addFn:function(){this.$emit("add")}}},r=s,l=(a("a3a4"),a("5d22")),c=Object(l["a"])(r,n,i,!1,null,null,null);e["default"]=c.exports},"5b14":function(t,e,a){},"7dbd":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-list-content"},[a("div",{staticClass:"content-wrap"},[a("div",{staticClass:"wx-wrap"},[a("div",{staticClass:"wx-bar"},[t._m(0),a("div",{staticClass:"bar-text"},[t._v(t._s(t.shopInfo.name))])]),a("div",{staticClass:"wx-content",on:{click:t.closeOptionFn}}),a("div",{staticClass:"wx-btn"},[t._m(1),t._l(t.menuData,(function(e,n){return a("div",{key:n,staticClass:"menu-btn",class:[t.activeIndex==n?"active":""],on:{click:function(a){return t.menuClickFn(e,n)}}},[a("operate-line-module",{attrs:{show:t.operateShow[n],data:e},on:{click:t.operateClickFn,add:function(e){return t.operateAddFn(n)},del:t.operateDelFn}})],1)}))],2)]),t.addDialog?[a("div",{staticClass:"ad-modal-content"},[a("div",{staticClass:"ad-modal-wrap"},[a("el-form",{ref:"form",staticClass:"demo-form",attrs:{model:t.form,rules:t.rule,"label-width":"50px"}},[a("el-form-item",{attrs:{label:"名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入菜单名称",size:"small"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"选项",prop:"menuOption"}},[a("el-radio-group",{model:{value:t.form.menuOption,callback:function(e){t.$set(t.form,"menuOption",e)},expression:"form.menuOption"}},[a("el-radio",{attrs:{label:"0"}},[t._v("常用网址")]),a("el-radio",{attrs:{label:"1"}},[t._v("自定义网址")])],1)],1),a("el-form-item",{staticClass:"content-j-wrap",attrs:{label:""}},[0==t.form.menuOption?[a("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(e,n){return a("el-radio",{key:n,attrs:{border:"",label:e.id}},[t._v(t._s(e.name))])})),1)]:[a("div",[a("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),a("div",{staticClass:"dialog-footer"},[a("el-button",{attrs:{size:"small"},on:{click:t.resetForm}},[t._v("取 消")]),a("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.$createElement,n=t._self._c||e;return n("div",{staticClass:"bar-img"},[n("img",{attrs:{src:a("ee57"),alt:""}})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"key-btn"},[n("img",{staticClass:"key-btn-img",attrs:{src:a("f948"),alt:"",mode:"widthFix"}})])}],o=a("60b5"),s=a("6abc"),r=(a("6a61"),a("3337"),a("3bae"),a("62f9"),a("bf2f"),a("5880")),l=a("231c"),c={name:"wx-menu",components:{operateLineModule:l["default"]},data:function(){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(s["a"])({},Object(r["mapGetters"])(["shopInfo","userInfo"])),created:function(){this.init()},methods:{init:function(){this._getDet(),this._getUrl()},_getDet:function(){var t=this;this.$service.setting.getMenu().then((function(e){t.menuData=e.map((function(t){return t.children||(t.children=[]),t})),e.map((function(){t.operateShow.push(!1)}))}))},_getUrl:function(){var t=this;this.$service.single.commonUrl().then((function(e){t.commonUrlData=e}))},submitFn:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return console.log(t.menuData),e.next=3,t.$service.setting.updateMenu(t.menuData).then((function(e){t.$message.success(e.msg||"提交"),t.resetForm()}));case 3:case"end":return e.stop()}}),e)})))()},menuClickFn:function(t,e){var a=this;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((function(e){a.form[e]=t[e]})),this.addDialog=!0},operateClickFn:function(t){var e=this;this.isModifyParents=!1,this.subActiveIndex=t.index,console.log("item",t),t.targetId=t.targetId?parseInt(t.targetId):0,Object.keys(this.form).forEach((function(a){e.form[a]=t[a]})),this.addDialog=!0},operateAddFn:function(t){var e=this;if(this.operateData.length>4)return this.$message.warning("亲,最多只能设置五个子菜单!"),!1;var a={name:"子菜单名",menuOption:"0",replyUrl:"",targetId:0};this.$set(this.operateShow,this.activeIndex,!1),this.operateData.push(a),this.menuData[this.activeIndex].children=JSON.parse(JSON.stringify(this.operateData)),setTimeout((function(){e.$set(e.operateShow,e.activeIndex,!0)}))},operateDelFn:function(t){var e=this;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((function(){e.$set(e.operateShow,e.activeIndex,!0)}))},closeOperate:function(){this.activeIndex=null,this.operateShow=this.operateShow.map((function(t){return!1})),this.addDialog=!1},closeOptionFn:function(){this.closeOperate(),this.resetForm()},confirmForm:function(){var t=this,e=JSON.parse(JSON.stringify(this.form));this.isModifyParents?(Object.keys(e).forEach((function(a){t.menuData[t.activeIndex][a]=e[a]})),console.log("江总22",this.menuData)):(this.operateData[this.subActiveIndex]=e,console.log("this.operateData",this.operateData),this.menuData[this.activeIndex].children=JSON.parse(JSON.stringify(this.operateData))),this.submitFn().then((function(e){console.log("this.activeIndex",t.activeIndex),t.addDialog=!1}))},resetForm:function(){this.form={name:"",menuOption:"0",replyUrl:"",targetId:0},this.$refs["form"].resetFields()}}},u=c,d=(a("e734"),a("5d22")),m=Object(d["a"])(u,n,i,!1,null,"2cdd5aec",null);e["default"]=m.exports},a3a4:function(t,e,a){"use strict";a("5b14")},c574:function(t,e,a){},e734:function(t,e,a){"use strict";a("c574")},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///8DAwPKysq5ubnt7e2np6aGhobX19dSUlJnZ2d2dnaUlJQzuMSfAAADdElEQVRIx51WWYLtKghERYNzhv3v9YGZTDrJfd186DnGAkUog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