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 lines
12 KiB
1 lines
12 KiB
(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=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)})))()},save:function(){var e=this;this.loading=!0,i.saveMenu(this.form).then((function(t){e.loading=!1,0===t.data.code&&e.$message.success("菜单同步成功")}))},getSelected:function(e){var t=[],n=[];e&&e.length&&e.forEach((function(e){e.isSync&&t.push(e.id),n.push(e.id),e.children&&e.children.length&&e.children.forEach((function(e){e.isSync&&t.push(e.id),n.push(e.id)}))})),this.selected=t,this.allKeys=n,t.length===n.length&&(this.checked=!0)},setCheckedNodes:function(){this.selected.length&&this.$refs.merchantTree.setCheckedKeys(this.selected)},checkChange:function(e,t,n,r){e.isSync=t?1:0}}},l=s,d=(n("8e88"),n("2877")),h=Object(d["a"])(l,r,a,!1,null,"3c2d9e1c",null);t["default"]=h.exports},"27ae":function(e,t,n){(function(n){var r,a;(function(t,n){e.exports=n(t)})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n?n:this,(function(n){"use strict";n=n||{};var c,o=n.Base64,u="2.6.4",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e.charAt(n)]=n;return t}(i),l=String.fromCharCode,d=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?l(192|t>>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},h=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(e){return e.replace(h,d)},A=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),r=[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)];return r.join("")},g=n.btoa&&"function"==typeof n.btoa?function(e){return n.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,A)},p=function(e){return g(f(String(e)))},m=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},v=function(e,t){return t?m(p(e)):p(e)},C=function(e){return v(e,!0)};n.Uint8Array&&(c=function(e,t){for(var n="",r=0,a=e.length;r<a;r+=3){var c=e[r],o=e[r+1],u=e[r+2],s=c<<16|o<<8|u;n+=i.charAt(s>>>18)+i.charAt(s>>>12&63)+("undefined"!=typeof o?i.charAt(s>>>6&63):"=")+("undefined"!=typeof u?i.charAt(63&s):"=")}return t?m(n):n});var b,w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,M=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return l(55296+(n>>>10))+l(56320+(1023&n));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},B=function(e){return e.replace(w,M)},y=function(e){var t=e.length,n=t%4,r=(t>0?s[e.charAt(0)]<<18:0)|(t>1?s[e.charAt(1)]<<12:0)|(t>2?s[e.charAt(2)]<<6:0)|(t>3?s[e.charAt(3)]:0),a=[l(r>>>16),l(r>>>8&255),l(255&r)];return a.length-=[0,0,2,1][n],a.join("")},S=n.atob&&"function"==typeof n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/\S{1,4}/g,y)},k=function(e){return S(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},x=function(e){return B(S(e))},T=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},O=function(e){return x(T(e))};n.Uint8Array&&(b=function(e){return Uint8Array.from(k(T(e)),(function(e){return e.charCodeAt(0)}))});var E=function(){var e=n.Base64;return n.Base64=o,e};if(n.Base64={VERSION:u,atob:k,btoa:g,fromBase64:O,toBase64:v,utob:f,encode:v,encodeURI:C,btou:B,decode:O,noConflict:E,fromUint8Array:c,toUint8Array:b},"function"===typeof Object.defineProperty){var R=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",R((function(){return O(this)}))),Object.defineProperty(String.prototype,"toBase64",R((function(e){return v(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",R((function(){return v(this,!0)})))}}return n["Meteor"]&&(Base64=n.Base64),e.exports?e.exports.Base64=n.Base64:(r=[],a=function(){return n.Base64}.apply(t,r),void 0===a||(e.exports=a)),{Base64:n.Base64}}))}).call(this,n("c8ba"))},"401c":function(e,t,n){},"4fad":function(e,t,n){var r=n("23e7"),a=n("6f53").entries;r({target:"Object",stat:!0},{entries:function(e){return a(e)}})},"6f53":function(e,t,n){var r=n("83ab"),a=n("df75"),c=n("fc6a"),o=n("d1e7").f,u=function(e){return function(t){var n,u=c(t),i=a(u),s=i.length,l=0,d=[];while(s>l)n=i[l++],r&&!o.call(u,n)||d.push(e?[n,u[n]]:u[n]);return d}};e.exports={entries:u(!0),values:u(!1)}},8542:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACKUlEQVRoQ+3ZTS8DQRgH8P+zigPVzyGRSLyWOLo4uBDh4C0h2vWBqNcjLl4uvoO2hMQXYesg1e4ji0qjnd2ZfenOJua6u7P/38xsZp6WkPBGCc+Pf0DcMyicgZnc2/A7kXFf6HtUCZnNWfMAdd8dpK9UnvN7b1vA6M7LSMqgLSYYTDgt72XKMi+YzFcWAT4D0AXQarGQvpB5Lsg9LYBGeDClnI7ZYFsG0RS+5ydQvROIFsCk+TLKoG2yyWiMjAxiwqwsEfP59+j/tsgRbZdQkhDCjzgpCNd9IAkIz41Md4QnwPkcdUZIAXRGSAN0RSgBdEQoA0JAOEeNr10+jB3bF0AnhG+ALohAAB0QgQFxI0IBxIkIDRAFgpnXSgcZ54gubKECokAAtFwspC9FgtAB47vWNDGvNRdEIK7ZRtdRea//SRQkm7c2GTj+UxBVmXihtJ+57Qgg/PBYLu0P3HRkCcUR3oGFsoRE4etIHbv9LCNcNsBKqTBw7TbyjWuBAXGGDzwDcYcPBNAhvG+ALuF9AXQKrwzQLbwSQMfw0gBdw0sBdA7vCdA9vCsgCeGFgKSEbwuYyFlTMHhd+TxvWhvMOGk9z3sfiWUObdL1wHS+MlSHbTb+YpIpRpzOs+brnM10TUDvz8uqTNGGFy6hXwQAr0qqeWSaENSJ8K4fcXa3MvhRo9TDYf+zyhSPmW+zBuq9bmWgSn9e9wauB7xeEPX1f0DUI+zVf+Jn4BMdZOBPX7HjHwAAAABJRU5ErkJggg=="},"8e88":function(e,t,n){"use strict";var r=n("401c"),a=n.n(r);a.a},9256:function(e,t,n){"use strict";n("99af"),n("4160"),n("caad"),n("4fad"),n("d3b7"),n("159b");var r=n("5530"),a=n("bc3a"),c=n.n(a),o=n("5c96"),u=n("5657");n("27ae");function i(e,t){"ECONNABORTED"===e.code?Object(o["Message"])({message:"请求超时"}):e.response&&e.response.data?Object(o["Message"])({message:e.response.data}):e.message&&Object(o["Message"])({message:e.message}),t(e)}function s(e,t){e.data.isError&&(4e4===e.data.code||40001===e.data.code||40002===e.data.code||40003===e.data.code||40005===e.data.code||40006===e.data.code||40008===e.data.code?o["MessageBox"].alert(e.data.msg,"提醒",{confirmButtonText:"确定",callback:function(){window.location.hash="/login"}}):o["Message"].error(e.data.msg)),t(e)}c.a.interceptors.request.use((function(e){var t=!1!==e.headers["X-isToken"]||e.headers["X-isToken"],n=u["a"].get("TOKEN","");n&&t&&(e.headers.token="Bearer "+n);var r="ceres_admin_web",a="ceres_admin_web";return e.headers["Authorization"]="Basic ".concat("".concat(r,":").concat(a)),e}),(function(e){return Promise.reject(e)})),c.a.interceptors.response.use((function(e){return e}),(function(e){return Promise.reject(e)}));var l=function(e){console.log(e,"opts");var t={ts:Date.now()},n=e.method.toUpperCase(),a={method:n,url:"".concat("https://pos.admin.api.lotus-wallet.com").concat(e.url),responseType:e.responseType||"",timeout:2e4},o=["PUT","POST","PATCH"];o.includes(n)?a.data=e.data||{}:a.params=Object(r["a"])(Object(r["a"])({},t),e.data||{}),e.formData&&(a.transformRequest=[function(e){var t=new FormData;return e&&Object.entries(e).forEach((function(e){t.append(e[0],e[1])})),t}]);var u=new Promise((function(e,t){c()(a).then((function(t){s(t,e)})).catch((function(e){i(e,t)}))}));return u};t["a"]=l},fa8d:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACHUlEQVRoQ+3YzU7CQBAH8BlQ48EiL2KiUcB30IPRi3g0KuADUTCYmOhFjScPXjwaUz8TExOfA8GDQjtmiRiCbbdbtnSayLU77f83C2SnCAn/YMLzwz8g7h2MdAeWS611AOpY9cylCnSp/LEwTeTc1GdeZHWRAQrl1iYAnQCAA4DFu5pxIQsjruf2mzkk2AYCsh1qPB1kn/3qIgEMhE//PLwTBNEPjw6mRB0h2TKEdoBLeJHFRsAtq2aceXVzOHwPkCIHHDq8r2cfveq0AsYdXqC0AeIIrw0QV3gtAK/whFi8N41z1e88AjXuzOxTkH+skQFxhx8JwCF8aACX8KEAnMIrA7iFVwJwDB8YwDV8IADn8FIA9/C+gCSE9wTkS80iIh4DQP88L9Z2CXFrHMeDoMcIV0Ch3NoAoNMkhHcF5Mvvqwggxr+pgU7YCLBj1TJHXt0Rc2waujtAONFfIwYSQjx+qGZuVbqqstZ1HshX3teQQOyCEiK3355POfbuOBGeA01SEL4TWRIQ0pGSO0IKED8ozohAAM6IwACuCCUAR4QygBsiFIATIjSAC2IkAAfEyIC4EVoAcSK0AeJCaAXEgdAO8EB8IdKaZc5e+Q0rf+YJpG4aUuZtzXj1qosEMISAIOH7AX8RvZnWP7z0tYrKaOe2Nl9prjiQ/nw0Z65V7rW4156bnKCuVTXeZHWR7YDswbqu/wN0dTLsfRK/A9+zuuJPACKo9QAAAABJRU5ErkJggg=="}}]); |