You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
12 KiB
1 line
12 KiB
4 years ago
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-27b0fc3e"],{"1f00":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"empower_page"},[n("div",{staticClass:"top_btn"},[e._v(" 菜单赋权 "),n("el-button",{staticClass:"save_btn",attrs:{type:"primary",loading:e.loading},on:{click:e.save}},[e._v("保存")])],1),n("div",{staticClass:"empower_content"},[n("div",{staticClass:"item"},[n("div",{staticClass:"top_box"},[n("el-form",{attrs:{inline:"","label-width":"100px"}},[n("el-form-item",{staticClass:"select_type"},[n("el-select",{attrs:{placeholder:"请选择"},on:{change:e.changeselect},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}},e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e.type?n("el-form-item",{attrs:{label:"账号"}},[n("el-col",{attrs:{span:15}},[n("el-input",{attrs:{placeholder:"请输入账号"},model:{value:e.form.account,callback:function(t){e.$set(e.form,"account",t)},expression:"form.account"}})],1),n("el-col",{attrs:{span:6}},[n("el-button",{on:{click:e.getSpecialMerchantMenu}},[e._v("搜索")])],1)],1):e._e()],1)],1),n("div",{staticClass:"menu_tree"},[n("el-checkbox",{on:{change:e.changeCheck},model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}},[e._v("全选")]),n("el-tree",{ref:"merchantTree",attrs:{data:e.form.menuList,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps},on:{"check-change":e.checkChange}})],1)])])])},a=[],c=(n("c740"),n("4160"),n("d81d"),n("159b"),n("96cf"),n("1da1")),o=(n("99af"),n("9256")),u={getPlatformMenu:"/menu/tree",getAllMerchanMenu:"/menu/getAllTenantMenu",getSpecialMerchantMenu:"/menu/getSpecifiedTenantMenu",saveMenu:"/menu/syncMenu"},i={getPlatformMenu:function(){return Object(o["a"])({method:"GET",url:u.getPlatformMenu})},getAllMerchanMenu:function(){return Object(o["a"])({method:"GET",url:u.getAllMerchanMenu})},getSpecialMerchantMenu:function(e){return Object(o["a"])({method:"GET",url:"".concat(u.getSpecialMerchantMenu,"/").concat(e)})},saveMenu:function(e){return Object(o["a"])({method:"POST",url:u.saveMenu,data:e})}},s={data:function(){return{checked:!1,loading:!1,options:[{label:"同步所有商家",value:0},{label:"同步指定商家",value:1}],type:0,account:"",defaultProps:{children:"children",label:"label"},platFormMenu:[],mechantMenu:[],selected:[],form:{menuList:[],account:null},allKeys:[]}},computed:{left:function(){return n("fa8d")},right:function(){return n("8542")}},created:function(){this.getAllMerchanMenu()},mounted:function(){},methods:{changeCheck:function(e){e?this.$refs.merchantTree.setCheckedKeys(this.allKeys):this.$refs.merchantTree.setCheckedKeys([])},changeselect:function(e){e||this.getAllMerchanMenu()},getPlatformMenu:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i.getPlatformMenu();case 2:n=t.sent,r=n.data,0===r.code&&(e.platFormMenu=r.data);case 5:case"end":return t.stop()}}),t)})))()},getAllMerchanMenu:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i.getAllMerchanMenu();case 2:n=t.sent,r=n.data,0===r.code&&(a=r.data,e.changeTreeData(a),e.form.menuList=a,e.getSelected(a),e.$nextTick((function(){e.setCheckedNodes()})));case 5:case"end":return t.stop()}}),t)})))()},changeTreeData:function(e){e&&e.length&&e.map((function(e){e.children&&e.children.length&&e.children.findIndex((function(e){return 0===e.isSync}))>-1&&(e.isSync=0)}))},getSpecialMerchantMenu:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i.getSpecialMerchantMenu(e.form.account);case 2:n=t.sent,r=n.data,0===r.code&&(a=
|