| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-574e68a5","chunk-59c07794"],{"15fb":function(t,e,s){"use strict";s("8d73")},"231c":function(t,e,s){"use strict";s.r(e);var i=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(s,i){return e("div",{key:i,staticClass:"operate-list"},[e("i",{staticClass:"iconfont iconcaozuojihuo",on:{click:function(e){return e.stopPropagation(),t.listDel(i)}}}),e("div",{staticClass:"btn-text",on:{click:function(e){return t.listClick(s,i)}}},[t._v(t._s(s.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)},a=[],n={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")}}},o=n,r=(s("7ede"),s("1805")),l=Object(r["a"])(o,i,a,!1,null,null,null);e["default"]=l.exports},"4ce9":function(t,e,s){"use strict";s.r(e);var i=function(){var t=this;t._self._c;return t._m(0)},a=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"app-list-content"},[e("div",{staticClass:"content-wrap"})])}],n=(s("b138"),s("8f26"),s("666b"),s("963e"),s("209c"),s("f803"),s("5880")),o=s("231c"),r={name:"set-password",components:{operateLineModule:o["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(n["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=(s("15fb"),s("1805")),h=Object(c["a"])(l,i,a,!1,null,"302dce28",null);e["default"]=h.exports},"7ede":function(t,e,s){"use strict";s("ff4a")},"8d73":function(t,e,s){},ff4a:function(t,e,s){}}]);
|