| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["menu"],{"0aea":function(e,t,r){var n=r("d666");e.exports=function(e,t,r){for(var i in t)r&&r.unsafe&&e[i]?e[i]=t[i]:n(e,i,t[i],r);return e}},"2cdf":function(e,t,r){},"362a":function(e,t,r){"use strict";var n=r("a5eb"),i=r("7042"),a=r("f354"),o=r("9883"),s=r("b0ea"),l=r("7ef9"),c=r("d666");n({target:"Promise",proto:!0,real:!0},{finally:function(e){var t=s(this,o("Promise")),r="function"==typeof e;return this.then(r?function(r){return l(t,e()).then((function(){return r}))}:e,r?function(r){return l(t,e()).then((function(){throw r}))}:e)}}),i||"function"!=typeof a||a.prototype["finally"]||c(a.prototype,"finally",o("Promise").prototype["finally"])},"378f":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-card",{attrs:{bordered:!1}},[r("content-header",{attrs:{title:"API权限"}}),r("a-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{message:e.warningText,type:"warning","show-icon":""}}),r("div",{staticClass:"table-operator"},[r("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),r("a-table",{attrs:{rowKey:"api_id",columns:e.columns,"data-source":e.list,loading:e.isLoading,pagination:!1},scopedSlots:e._u([{key:"action",fn:function(t,n){return r("span",{},[[r("a",{on:{click:function(t){return e.handleEdit(n)}}},[e._v("编辑")]),r("a-divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(t){return e.handleDelete(n)}}},[e._v("删除")])]],2)}}])}),r("add-form",{ref:"AddForm",attrs:{apiList:e.list},on:{handleSubmit:e.handleRefresh}}),r("edit-form",{ref:"EditForm",attrs:{apiList:e.list},on:{handleSubmit:e.handleRefresh}})],1)},i=[],a=(r("d3b7"),r("db8a")),o=r("2af9"),s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-modal",{attrs:{title:"新增权限",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"权限名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', {rules: [{required: true, min: 2, message: '请输入至少2个字符'}]}]"}]})],1),r("a-form-item",{attrs:{label:"上级权限",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"默认为顶级权限"}},[r("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id"],expression:"['parent_id']"}],attrs:{"tree-data":e.apiListTreeData,"dropdown-style":{maxHeight:"400px",overflow:"auto"},"allow-clear":""}})],1),r("a-form-item",{attrs:{label:"权限url",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"例如:index/index"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["url",{rules:[{required:!0,message:"请输入权限url"}]}],expression:"['url', {rules: [{required: true, message: '请输入权限url'}]}]"}]})],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', {initialValue: 100, rules: [{required: true, message: '请输入至少1个数字'}]}]"}],attrs:{min:0}})],1)],1)],1)],1)},l=[],c=(r("4160"),r("b0c0"),r("159b"),{props:{apiList:{type:Array,required:!0}},data:function(){return{labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),apiListTreeData:[]}},methods:{show:function(){this.visible=!0,this.getAccessList(),this.setFieldsValue()},setFieldsValue:function(){var e=this;this.$nextTick((function(){e.form.resetFields(),e.form.setFieldsValue({parent_id:0})}))},getAccessList:function(){var e=this.apiList,t=this.formatTreeData(e);t.unshift({title:"顶级权限",key:0,value:0}),this.apiListTreeData=t},formatTreeData:function(e){var t=this,r=[];return e.forEach((function(e){var n={title:e.name,key:e.api_id,value:e.api_id};e.children&&e.children.length&&(n["children"]=t.formatTreeData(e["children"])),r.push(n)})),r},handleSubmit:function(){var e=this,t=this.form.validateFields;this.confirmLoading=!0,t((function(t,r){t?e.confirmLoading=!1:e.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1},onFormSubmit:function(e){var t=this;a["a"]({form:e}).then((function(r){t.$message.success(r.message),t.visible=!1,t.form.resetFields(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}}),u=c,d=r("2877"),f=Object(d["a"])(u,s,l,!1,null,null,null),m=f.exports,p=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-modal",{attrs:{title:"编辑权限",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"权限名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', {rules: [{required: true, min: 2, message: '请输入至少2个字符'}]}]"}]})],1),r("a-form-item",{attrs:{label:"上级权限",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"默认为顶级权限"}},[r("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id"],expression:"['parent_id']"}],attrs:{"tree-data":e.apiListTreeData,"dropdown-style":{maxHeight:"400px",overflow:"auto"},"allow-clear":""}})],1),r("a-form-item",{attrs:{label:"权限url",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"例如:index/index"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["url",{rules:[{required:!0,message:"请输入权限url"}]}],expression:"['url', {rules: [{required: true, message: '请输入权限url'}]}]"}]})],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', {initialValue: 100, rules: [{required: true, message: '请输入至少1个数字'}]}]"}],attrs:{min:0}})],1)],1)],1)],1)},h=[],v=(r("caad"),r("2532"),r("88bc")),b=r.n(v),g={props:{apiList:{type:Array,required:!0}},data:function(){return{labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),apiListTreeData:[],record:{}}},methods:{show:function(e){this.visible=!0,this.record=e,this.getAccessList(),this.setFieldsValue()},setFieldsValue:function(){var e=this;this.$nextTick((function(){e.form.setFieldsValue(b()(e.record,["name","url","parent_id","sort"]))}))},getAccessList:function(){var e=this.apiList,t=this.formatTreeData(e);t.unshift({title:"顶级权限",key:0,value:0}),this.apiListTreeData=t},formatTreeData:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return e.forEach((function(e){var i={title:e.name,key:e.api_id,value:e.api_id};([e.api_id,e.parent_id].includes(t.record.api_id)||!0===r)&&(i.disabled=!0),null!=e.children&&(i["children"]=t.formatTreeData(e["children"],i.disabled)),n.push(i)})),n},handleSubmit:function(){var e=this,t=this.form.validateFields;this.confirmLoading=!0,t((function(t,r){t?e.confirmLoading=!1:e.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1},onFormSubmit:function(e){var t=this;a["c"]({apiId:this.record["api_id"],form:e}).then((function(r){t.$message.success(r.message),t.visible=!1,t.form.resetFields(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},w=g,y=Object(d["a"])(w,p,h,!1,null,null,null),x=y.exports,C={components:{ContentHeader:o["a"],STable:o["d"],AddForm:m,EditForm:x},data:function(){return{warningText:"此处用于管理商户后台的服务端API,请勿对本页面数据进行更改",isLoading:!1,columns:[{title:"权限ID",dataIndex:"api_id",scopedSlots:{customRender:"api_id"}},{title:"权限名称",dataIndex:"name",scopedSlots:{customRender:"name"}},{title:"权限url",dataIndex:"url",scopedSlots:{customRender:"url"}},{title:"排序",dataIndex:"sort",scopedSlots:{customRender:"sort"}},{title:"添加时间",dataIndex:"create_time",scopedSlots:{customRender:"create_time"}},{title:"操作",dataIndex:"action",width:"150px",scopedSlots:{customRender:"action"}}],list:[]}},created:function(){this.getListData()},methods:{getListData:function(){var e=this;this.isLoading=!0,a["d"]().then((function(t){e.list=t.data.list})).finally((function(){e.isLoading=!1}))},handleAdd:function(){this.$refs.AddForm.show()},handleEdit:function(e){this.$refs.EditForm.show(e)},handleDelete:function(e){var t=this;t.$confirm({title:"您确定要删除该记录吗?",content:"确认后将无法恢复",onOk:function(){return t.onSubmitDelete(e)}})},onSubmitDelete:function(e){var t=this;return a["b"]({apiId:e["api_id"]}).then((function(e){t.$message.success(e.message),t.handleRefresh()}))},handleRefresh:function(){this.getListData()}}},L=C,_=Object(d["a"])(L,n,i,!1,null,null,null);t["default"]=_.exports},"548c":function(e,t,r){r("84d2")},"5afb":function(e,t,r){var n,i,a,o=r("3ac6"),s=r("06fa"),l=r("fc48"),c=r("194a"),u=r("edbd"),d=r("7a37"),f=r("c4b8"),m=o.location,p=o.setImmediate,h=o.clearImmediate,v=o.process,b=o.MessageChannel,g=o.Dispatch,w=0,y={},x="onreadystatechange",C=function(e){if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},L=function(e){return function(){C(e)}},_=function(e){C(e.data)},F=function(e){o.postMessage(e+"",m.protocol+"//"+m.host)};p&&h||(p=function(e){var t=[],r=1;while(arguments.length>r)t.push(arguments[r++]);return y[++w]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(w),w},h=function(e){delete y[e]},"process"==l(v)?n=function(e){v.nextTick(L(e))}:g&&g.now?n=function(e){g.now(L(e))}:b&&!/(iphone|ipod|ipad).*applewebkit/i.test(f)?(i=new b,a=i.port2,i.port1.onmessage=_,n=c(a.postMessage,a,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||s(F)?n=x in d("script")?function(e){u.appendChild(d("script"))[x]=function(){u.removeChild(this),C(e)}}:function(e){setTimeout(L(e),0)}:(n=F,o.addEventListener("message",_,!1))),e.exports={set:p,clear:h}},"5b57":function(e,t,r){var n=r("6f8d"),i=r("2616"),a=r("6725"),o=r("194a"),s=r("0b7b"),l=r("faaa"),c=function(e,t){this.stopped=e,this.result=t},u=e.exports=function(e,t,r,u,d){var f,m,p,h,v,b,g,w=o(t,r,u?2:1);if(d)f=e;else{if(m=s(e),"function"!=typeof m)throw TypeError("Target is not iterable");if(i(m)){for(p=0,h=a(e.length);h>p;p++)if(v=u?w(n(g=e[p])[0],g[1]):w(e[p]),v&&v instanceof c)return v;return new c(!1)}f=m.call(e)}b=f.next;while(!(g=b.call(f)).done)if(v=l(f,w,g.value,u),"object"==typeof v&&v&&v instanceof c)return v;return new c(!1)};u.stop=function(e){return new c(!0,e)}},"5f7d":function(e,t){e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},"62fc":function(e,t,r){e.exports=r("984c")},6813:function(e,t,r){"use strict";var n,i,a,o,s=r("a5eb"),l=r("7042"),c=r("3ac6"),u=r("764b"),d=r("f354"),f=r("d666"),m=r("0aea"),p=r("2874"),h=r("d383"),v=r("dfdb"),b=r("cc94"),g=r("5f7d"),w=r("fc48"),y=r("5b57"),x=r("7de7"),C=r("b0ea"),L=r("5afb").set,_=r("a0e6"),F=r("7ef9"),j=r("c2f0"),S=r("ad27"),k=r("9b8d"),A=r("c4b8"),O=r("2f5a"),D=r("a0e5"),E=r("0363"),T=E("species"),$="Promise",P=O.get,I=O.set,q=O.getterFor($),R=d,V=c.TypeError,N=c.document,M=c.process,K=c.fetch,H=M&&M.versions,J=H&&H.v8||"",B=S.f,G=B,U="process"==w(M),W=!!(N&&N.createEvent&&c.dispatchEvent),z="unhandledrejection",Q="rejectionhandled",X=0,Y=1,Z=2,ee=1,te=2,re=D($,(function(){var e=R.resolve(1),t=function(){},r=(e.constructor={})[T]=function(e){e(t,t)};return!((U||"function"==typeof PromiseRejectionEvent)&&(!l||e["finally"])&&e.then(t)instanceof r&&0!==J.indexOf("6.6")&&-1===A.indexOf("Chrome/66"))})),ne=re||!x((function(e){R.all(e)["catch"]((function(){}))})),ie=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},ae=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;_((function(){var i=t.value,a=t.state==Y,o=0;while(n.length>o){var s,l,c,u=n[o++],d=a?u.ok:u.fail,f=u.resolve,m=u.reject,p=u.domain;try{d?(a||(t.rejection===te&&ce(e,t),t.rejection=ee),!0===d?s=i:(p&&p.enter(),s=d(i),p&&(p.exit(),c=!0)),s===u.promise?m(V("Promise-chain cycle")):(l=ie(s))?l.call(s,f,m):f(s)):m(i)}catch(h){p&&!c&&p.exit(),m(h)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&se(e,t)}))}},oe=function(e,t,r){var n,i;W?(n=N.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},(i=c["on"+e])?i(n):e===z&&j("Unhandled promise rejection",r)},se=function(e,t){L.call(c,(function(){var r,n=t.value,i=le(t);if(i&&(r=k((function(){U?M.emit("unhandledRejection",n,e):oe(z,e,n)})),t.rejection=U||le(t)?te:ee,r.error))throw r.value}))},le=function(e){return e.rejection!==ee&&!e.parent},ce=function(e,t){L.call(c,(function(){U?M.emit("rejectionHandled",e):oe(Q,e,t.value)}))},ue=function(e,t,r,n){return function(i){e(t,r,i,n)}},de=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=Z,ae(e,t,!0))},fe=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw V("Promise can't be resolved itself");var i=ie(r);i?_((function(){var n={done:!1};try{i.call(r,ue(fe,e,n,t),ue(de,e,n,t))}catch(a){de(e,n,a,t)}})):(t.value=r,t.state=Y,ae(e,t,!1))}catch(a){de(e,{done:!1},a,t)}}};re&&(R=function(e){g(this,R,$),b(e),n.call(this);var t=P(this);try{e(ue(fe,this,t),ue(de,this,t))}catch(r){de(this,t,r)}},n=function(e){I(this,{type:$,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:X,value:void 0})},n.prototype=m(R.prototype,{then:function(e,t){var r=q(this),n=B(C(this,R));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=U?M.domain:void 0,r.parent=!0,r.reactions.push(n),r.state!=X&&ae(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=P(e);this.promise=e,this.resolve=ue(fe,e,t),this.reject=ue(de,e,t)},S.f=B=function(e){return e===R||e===a?new i(e):G(e)},l||"function"!=typeof d||(o=d.prototype.then,f(d.prototype,"then",(function(e,t){var r=this;return new R((function(e,t){o.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof K&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return F(R,K.apply(c,arguments))}}))),s({global:!0,wrap:!0,forced:re},{Promise:R}),p(R,$,!1,!0),h($),a=u[$],s({target:$,stat:!0,forced:re},{reject:function(e){var t=B(this);return t.reject.call(void 0,e),t.promise}}),s({target:$,stat:!0,forced:l||re},{resolve:function(e){return F(l&&this===a?R:this,e)}}),s({target:$,stat:!0,forced:ne},{all:function(e){var t=this,r=B(t),n=r.resolve,i=r.reject,a=k((function(){var r=b(t.resolve),a=[],o=0,s=1;y(e,(function(e){var l=o++,c=!1;a.push(void 0),s++,r.call(t,e).then((function(e){c||(c=!0,a[l]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise},race:function(e){var t=this,r=B(t),n=r.reject,i=k((function(){var i=b(t.resolve);y(e,(function(e){i.call(t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},"716a":function(e,t,r){r("6f89"),r("3e47"),r("5145"),r("6813"),r("84d2"),r("362a");var n=r("764b");e.exports=n.Promise},"7ef9":function(e,t,r){var n=r("6f8d"),i=r("dfdb"),a=r("ad27");e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=a.f(e),o=r.resolve;return o(t),r.promise}},"84d2":function(e,t,r){"use strict";var n=r("a5eb"),i=r("cc94"),a=r("ad27"),o=r("9b8d"),s=r("5b57");n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=a.f(t),n=r.resolve,l=r.reject,c=o((function(){var r=i(t.resolve),a=[],o=0,l=1;s(e,(function(e){var i=o++,s=!1;a.push(void 0),l++,r.call(t,e).then((function(e){s||(s=!0,a[i]={status:"fulfilled",value:e},--l||n(a))}),(function(e){s||(s=!0,a[i]={status:"rejected",reason:e},--l||n(a))}))})),--l||n(a)}));return c.error&&l(c.value),r.promise}})},"88bc":function(e,t,r){(function(t){var r=1/0,n=9007199254740991,i="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")();function d(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function f(e,t){var r=-1,n=e?e.length:0,i=Array(n);while(++r<n)i[r]=t(e[r],r,e);return i}function m(e,t){var r=-1,n=t.length,i=e.length;while(++r<n)e[i+r]=t[r];return e}var p=Object.prototype,h=p.hasOwnProperty,v=p.toString,b=u.Symbol,g=p.propertyIsEnumerable,w=b?b.isConcatSpreadable:void 0,y=Math.max;function x(e,t,r,n,i){var a=-1,o=e.length;r||(r=F),i||(i=[]);while(++a<o){var s=e[a];t>0&&r(s)?t>1?x(s,t-1,r,n,i):m(i,s):n||(i[i.length]=s)}return i}function C(e,t){return e=Object(e),L(e,t,(function(t,r){return r in e}))}function L(e,t,r){var n=-1,i=t.length,a={};while(++n<i){var o=t[n],s=e[o];r(s,o)&&(a[o]=s)}return a}function _(e,t){return t=y(void 0===t?e.length-1:t,0),function(){var r=arguments,n=-1,i=y(r.length-t,0),a=Array(i);while(++n<i)a[n]=r[t+n];n=-1;var o=Array(t+1);while(++n<t)o[n]=r[n];return o[t]=a,d(e,this,o)}}function F(e){return k(e)||S(e)||!!(w&&e&&e[w])}function j(e){if("string"==typeof e||P(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}function S(e){return O(e)&&h.call(e,"callee")&&(!g.call(e,"callee")||v.call(e)==i)}var k=Array.isArray;function A(e){return null!=e&&E(e.length)&&!D(e)}function O(e){return $(e)&&A(e)}function D(e){var t=T(e)?v.call(e):"";return t==a||t==o}function E(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function T(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $(e){return!!e&&"object"==typeof e}function P(e){return"symbol"==typeof e||$(e)&&v.call(e)==s}var I=_((function(e,t){return null==e?{}:C(e,f(x(t,1),j))}));e.exports=I}).call(this,r("c8ba"))},"8b44":function(e,t,r){"use strict";var n=r("a5eb"),i=r("c1b2"),a=r("5779"),o=r("ec62"),s=r("4896"),l=r("4180"),c=r("2c6c"),u=r("5b57"),d=r("0273"),f=r("6f8d"),m=r("2f5a"),p=m.set,h=m.getterFor("AggregateError"),v=function(e,t){var r=this;if(!(r instanceof v))return new v(e,t);o&&(r=o(new Error(t),a(r)));var n=[];return u(e,n.push,n),i?p(r,{errors:n,type:"AggregateError"}):r.errors=n,void 0!==t&&d(r,"message",String(t)),r};v.prototype=s(Error.prototype,{constructor:c(5,v),message:c(5,""),name:c(5,"AggregateError"),toString:c(5,(function(){var e=f(this).name;e=void 0===e?"AggregateError":String(e);var t=this.message;return t=void 0===t?"":String(t),e+": "+t}))}),i&&l.f(v.prototype,"errors",{get:function(){return h(this).errors},configurable:!0}),n({global:!0},{AggregateError:v})},"984c":function(e,t,r){e.exports=r("716a"),r("8b44"),r("548c"),r("c949"),r("a3ad")},"9b8d":function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},a0e6:function(e,t,r){var n,i,a,o,s,l,c,u,d=r("3ac6"),f=r("44ba").f,m=r("fc48"),p=r("5afb").set,h=r("c4b8"),v=d.MutationObserver||d.WebKitMutationObserver,b=d.process,g=d.Promise,w="process"==m(b),y=f(d,"queueMicrotask"),x=y&&y.value;x||(n=function(){var e,t;w&&(e=b.domain)&&e.exit();while(i){t=i.fn,i=i.next;try{t()}catch(r){throw i?o():a=void 0,r}}a=void 0,e&&e.enter()},w?o=function(){b.nextTick(n)}:v&&!/(iphone|ipod|ipad).*applewebkit/i.test(h)?(s=!0,l=document.createTextNode(""),new v(n).observe(l,{characterData:!0}),o=function(){l.data=s=!s}):g&&g.resolve?(c=g.resolve(void 0),u=c.then,o=function(){u.call(c,n)}):o=function(){p.call(d,n)}),e.exports=x||function(e){var t={fn:e,next:void 0};a&&(a.next=t),i||(i=t,o()),a=t}},a3ad:function(e,t,r){"use strict";var n=r("a5eb"),i=r("cc94"),a=r("9883"),o=r("ad27"),s=r("9b8d"),l=r("5b57"),c="No one promise resolved";n({target:"Promise",stat:!0},{any:function(e){var t=this,r=o.f(t),n=r.resolve,u=r.reject,d=s((function(){var r=i(t.resolve),o=[],s=0,d=1,f=!1;l(e,(function(e){var i=s++,l=!1;o.push(void 0),d++,r.call(t,e).then((function(e){l||f||(f=!0,n(e))}),(function(e){l||f||(l=!0,o[i]=e,--d||u(new(a("AggregateError"))(o,c)))}))})),--d||u(new(a("AggregateError"))(o,c))}));return d.error&&u(d.value),r.promise}})},ad27:function(e,t,r){"use strict";var n=r("cc94"),i=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new i(e)}},b0ea:function(e,t,r){var n=r("6f8d"),i=r("cc94"),a=r("0363"),o=a("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||void 0==(r=n(a)[o])?t:i(r)}},c2f0:function(e,t,r){var n=r("3ac6");e.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},c4b8:function(e,t,r){var n=r("9883");e.exports=n("navigator","userAgent")||""},c949:function(e,t,r){"use strict";var n=r("a5eb"),i=r("ad27"),a=r("9b8d");n({target:"Promise",stat:!0},{try:function(e){var t=i.f(this),r=a(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}})},d383:function(e,t,r){"use strict";var n=r("9883"),i=r("4180"),a=r("0363"),o=r("c1b2"),s=a("species");e.exports=function(e){var t=n(e),r=i.f;o&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},db8a:function(e,t,r){"use strict";r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r("f6ae"),i=r("b775");function a(e){return Object(i["b"])({url:n["a"].store.api.list,method:"get",params:e})}function o(e){return Object(i["b"])({url:n["a"].store.api.add,method:"post",data:e})}function s(e){return Object(i["b"])({url:n["a"].store.api.edit,method:"post",data:e})}function l(e){return Object(i["b"])({url:n["a"].store.api.delete,method:"post",data:e})}},e64b:function(e,t,r){"use strict";var n=r("2cdf"),i=r.n(n);i.a},f354:function(e,t,r){var n=r("3ac6");e.exports=n.Promise},f833:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-card",{attrs:{bordered:!1}},[r("content-header",{attrs:{title:"菜单列表"}}),r("a-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{message:e.warningText,type:"warning","show-icon":""}}),r("div",{staticClass:"table-operator"},[r("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),r("a-table",{attrs:{rowKey:"menu_id",columns:e.columns,"data-source":e.list,loading:e.isLoading,pagination:!1},scopedSlots:e._u([{key:"actions",fn:function(t,n){return r("span",{},e._l(n.actions,(function(t,n){return r("a-dropdown",{key:n,attrs:{title:"操作"}},[r("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[r("a-menu-item",{on:{click:function(r){return e.handleActionEdit(t)}}},[e._v("编辑")]),r("a-menu-item",{on:{click:function(r){return e.handleSetApi(t)}}},[e._v("API权限")]),r("a-menu-item",{on:{click:function(r){return e.handleDelete(t)}}},[e._v("删除")])],1),r("a-tag",[e._v(e._s(t.name))])],1)})),1)}},{key:"action",fn:function(t,n){return r("span",{},[[r("a",{on:{click:function(t){return e.handleEdit(n)}}},[e._v("编辑")]),r("a-divider",{attrs:{type:"vertical"}}),r("a-dropdown",[r("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[r("a-menu-item",[r("a",{on:{click:function(t){return e.handleSetApi(n)}}},[e._v("API权限")])]),r("a-menu-item",[r("a",{on:{click:function(t){return e.handleActionAdd(n)}}},[e._v("新增操作")])]),r("a-menu-item",[r("a",{on:{click:function(t){return e.handleDelete(n)}}},[e._v("删除")])])],1),r("a",[e._v(" 更多 "),r("a-icon",{attrs:{type:"down"}})],1)],1)]],2)}}])}),r("add-form",{ref:"AddForm",attrs:{menuList:e.list},on:{handleSubmit:e.handleRefresh}}),r("edit-form",{ref:"EditForm",attrs:{menuList:e.list},on:{handleSubmit:e.handleRefresh}}),r("action-form",{ref:"ActionForm",attrs:{menuList:e.list},on:{handleSubmit:e.handleRefresh}}),r("set-api-form",{ref:"SetApiForm",attrs:{apiList:e.apiList},on:{handleSubmit:e.handleRefresh}})],1)},i=[],a=(r("4de4"),r("4160"),r("d3b7"),r("159b"),r("96cf"),r("62fc")),o=r.n(a);function s(e,t,r,n,i,a,s){try{var l=e[a](s),c=l.value}catch(u){return void r(u)}l.done?t(c):o.a.resolve(c).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new o.a((function(n,i){var a=e.apply(t,r);function o(e){s(a,n,i,o,l,"next",e)}function l(e){s(a,n,i,o,l,"throw",e)}o(void 0)}))}}var c=r("f6ae"),u=r("b775");function d(e){return Object(u["b"])({url:c["a"].store.menu.list,method:"get",params:e})}function f(e){return Object(u["b"])({url:c["a"].store.menu.info,method:"get",params:e})}function m(e){return Object(u["b"])({url:c["a"].store.menu.add,method:"post",data:e})}function p(e){return Object(u["b"])({url:c["a"].store.menu.edit,method:"post",data:e})}function h(e){return Object(u["b"])({url:c["a"].store.menu.setApis,method:"post",data:e})}function v(e){return Object(u["b"])({url:c["a"].store.menu.delete,method:"post",data:e})}var b=r("db8a"),g=r("2af9"),w=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-modal",{attrs:{title:"新增菜单",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"菜单名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', {rules: [{required: true, min: 2, message: '请输入至少2个字符'}]}]"}]})],1),r("a-form-item",{attrs:{label:"上级菜单",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"默认为顶级菜单"}},[r("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id"],expression:"['parent_id']"}],attrs:{"tree-data":e.menuListTreeData,"dropdown-style":{maxHeight:"400px",overflow:"auto"},"allow-clear":""}})],1),r("a-form-item",{attrs:{label:"菜单path",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"指向的页面path"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["path",{rules:[{required:!0,message:"请输入菜单path"}]}],expression:"['path', {rules: [{required: true, message: '请输入菜单path'}]}]"}]})],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', {initialValue: 100, rules: [{required: true, message: '请输入至少1个数字'}]}]"}],attrs:{min:0}})],1)],1)],1)],1)},y=[],x=(r("a4d3"),r("b0c0"),r("e439"),r("dbb4"),r("b64b"),r("2fa7"));function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(r,!0).forEach((function(t){Object(x["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _={props:{menuList:{type:Array,required:!0}},data:function(){return{labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),menuListTreeData:[]}},methods:{show:function(){this.visible=!0,this.getMenuList(),this.setFieldsValue()},setFieldsValue:function(){var e=this;this.$nextTick((function(){e.form.resetFields(),e.form.setFieldsValue({parent_id:0})}))},getMenuList:function(){var e=this.menuList,t=this.formatTreeData(e);t.unshift({title:"顶级菜单",key:0,value:0}),this.menuListTreeData=t},formatTreeData:function(e){var t=this,r=[];return e.forEach((function(e){var n={title:e.name,key:e.menu_id,value:e.menu_id};e.hasOwnProperty("children")&&(n["children"]=t.formatTreeData(e["children"])),r.push(n)})),r},handleSubmit:function(){var e=this,t=this.form.validateFields;t((function(t,r){t||e.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,m({form:L({module:10},e)}).then((function(r){t.$message.success(r.message),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},F=_,j=r("2877"),S=Object(j["a"])(F,w,y,!1,null,null,null),k=S.exports,A=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-modal",{attrs:{title:"编辑菜单",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"菜单名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', {rules: [{required: true, min: 2, message: '请输入至少2个字符'}]}]"}]})],1),r("a-form-item",{attrs:{label:"上级菜单",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"默认为顶级菜单"}},[r("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id"],expression:"['parent_id']"}],attrs:{"tree-data":e.menuListTreeData,"dropdown-style":{maxHeight:"400px",overflow:"auto"},"allow-clear":""}})],1),r("a-form-item",{attrs:{label:"菜单path",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"指向的页面path"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["path",{rules:[{required:!0,message:"请输入菜单path"}]}],expression:"['path', {rules: [{required: true, message: '请输入菜单path'}]}]"}]})],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', {initialValue: 100, rules: [{required: true, message: '请输入至少1个数字'}]}]"}],attrs:{min:0}})],1)],1)],1)],1)},O=[],D=(r("caad"),r("2532"),r("88bc")),E=r.n(D),T={props:{menuList:{type:Array,required:!0}},data:function(){return{labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{},menuListTreeData:[]}},created:function(){},methods:{show:function(){var e=l(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.visible=!0,e.next=3,this.getMenuInfo(t);case 3:this.getMenuList(),this.setFieldsValue();case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),getMenuInfo:function(){var e=l(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.confirmLoading=!0,e.next=3,f({menu_id:t.menu_id}).then((function(e){return e.data.info}));case 3:this.record=e.sent,this.confirmLoading=!1;case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),setFieldsValue:function(){var e=this;this.$nextTick((function(){e.form.setFieldsValue(E()(e.record,["name","path","parent_id","sort"]))}))},getMenuList:function(){var e=this.menuList,t=this.formatTreeDataForMenuList(e);t.unshift({title:"顶级菜单",key:0,value:0}),this.menuListTreeData=t},formatTreeDataForMenuList:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return e.forEach((function(e){var i={title:e.name,key:e.menu_id,value:e.menu_id};([e.menu_id,e.parent_id].includes(t.record.menu_id)||!0===r)&&(i.disabled=!0),e.children&&e.children.length&&(i["children"]=t.formatTreeDataForMenuList(e["children"],i.disabled)),n.push(i)})),n},handleSubmit:function(){var e=this,t=this.form.validateFields;this.confirmLoading=!0,t((function(t,r){t?e.confirmLoading=!1:e.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;p({menuId:this.record["menu_id"],form:e}).then((function(r){t.$message.success(r.message),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},$=T,P=Object(j["a"])($,A,O,!1,null,null,null),I=P.exports,q=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"权限名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', {rules: [{required: true, min: 2, message: '请输入至少2个字符'}]}]"}]})],1),r("a-form-item",{attrs:{label:"权限标识",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["action_mark",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['action_mark', {rules: [{required: true, min: 2, message: '请输入至少2个字符'}]}]"}]})],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', {initialValue: 100, rules: [{required: true, message: '请输入至少1个数字'}]}]"}],attrs:{min:0}})],1)],1)],1)],1)},R=[];function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(r,!0).forEach((function(t){Object(x["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M={props:{menuList:{type:Array,required:!0}},data:function(){return{scene:"add",title:"新增权限",labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),parentId:0,record:{}}},methods:{add:function(e){this.visible=!0,this.scene="add",this.title="新增操作权限",this.parentId=e,this.setFieldsValue()},edit:function(e){this.visible=!0,this.scene="edit",this.title="编辑操作权限",this.record=e,this.setFieldsValue(e)},setFieldsValue:function(e){var t=this;this.$nextTick((function(){t.form.resetFields(),e&&t.form.setFieldsValue(E()(e,["name","action_mark","sort"]))}))},handleSubmit:function(){var e=this,t=this.form.validateFields;t((function(t,r){t?e.confirmLoading=!1:e.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1},onFormSubmit:function(e){var t=this;this.confirmLoading=!0;var r=function(r){t.$message.success(r.message),t.visible=!1,t.form.resetFields(),t.$emit("handleSubmit",e)};"add"===this.scene?(e.parent_id=this.parentId,m({form:N({module:20},e)}).then((function(e){return r(e)})).finally((function(){t.confirmLoading=!1}))):"edit"===this.scene&&p({menuId:this.record["menu_id"],form:e}).then((function(e){return r(e)})).finally((function(){t.confirmLoading=!1}))}}},K=M,H=Object(j["a"])(K,q,R,!1,null,null,null),J=H.exports,B=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{staticStyle:{"margin-bottom":"5px"},attrs:{label:(10===e.record.module?"菜单":"操作")+"名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("span",{staticStyle:{"margin-left":"23px",color:"rgba(0, 0, 0, 0.85)"}},[e._v(e._s(e.record.name))])]),r("a-form-item",{attrs:{label:"API权限",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"设置该菜单或操作使用的API权限"}},[r("a-tree",{ref:"ApiTree",attrs:{checkable:"",multiple:"",treeData:e.apiListTreeData,autoExpandParent:!1},model:{value:e.checkedKeys,callback:function(t){e.checkedKeys=t},expression:"checkedKeys"}})],1)],1)],1)],1)},G=[],U=(r("99af"),r("284c")),W=r("2ef0"),z=r.n(W),Q={props:{apiList:{type:Array,required:!0}},data:function(){return{title:"设置API权限",labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{},apiListTreeData:[],checkedKeys:[]}},methods:{show:function(e){this.visible=!0,this.record=e,this.menuId=e.menu_id,this.getApiList(),this.setApiChecked()},getApiList:function(){var e=this.apiList,t=this.formatTreeDataForApiList(e);this.apiListTreeData=t},setApiChecked:function(){var e=function e(t){var r=[];return t.forEach((function(t){if(t.children&&t.children.length){var n=e(t.children);n.length&&(r=r.concat(n))}else r.push(t.key)})),r},t=this.apiListTreeData,r=this.record,n=e(t);this.checkedKeys=z.a.intersection(r.apiIds,n)},formatTreeDataForApiList:function(e){var t=this,r=[];return e.forEach((function(e){var n={title:e.name,key:e.api_id};e.children&&e.children.length&&(n["children"]=t.formatTreeDataForApiList(e["children"])),r.push(n)})),r},handleSubmit:function(){var e=this.$refs.ApiTree,t={apiIds:[].concat(Object(U["a"])(e.getCheckedKeys()),Object(U["a"])(e.getHalfCheckedKeys()))};this.onFormSubmit(t)},handleCancel:function(){this.visible=!1,this.form.resetFields();var e=this.$refs.ApiTree;e.clearExpandedKeys(),this.checkedKeys=[]},onFormSubmit:function(e){var t=this;this.confirmLoading=!0;var r=function(r){t.$message.success(r.message),t.handleCancel(),t.$emit("handleSubmit",e)};h({menu_id:this.record["menu_id"],form:e}).then((function(e){return r(e)})).finally((function(){t.confirmLoading=!1}))}}},X=Q,Y=Object(j["a"])(X,B,G,!1,null,null,null),Z=Y.exports,ee={components:{ContentHeader:g["a"],STable:g["d"],AddForm:k,EditForm:I,ActionForm:J,SetApiForm:Z},data:function(){return{warningText:"此处用于管理商户后台的菜单,请勿对本页面数据进行更改",isLoading:!1,columns:[{title:"菜单ID",dataIndex:"menu_id"},{title:"菜单名称",dataIndex:"name"},{title:"path",dataIndex:"path"},{title:"可操作权限",dataIndex:"actions",scopedSlots:{customRender:"actions"}},{title:"排序",dataIndex:"sort"},{title:"操作",dataIndex:"action",width:"250px",scopedSlots:{customRender:"action"}}],list:[],apiList:[]}},created:function(){this.getListData()},methods:{getListData:function(){var e=this;this.isLoading=!0,d().then((function(t){e.list=e.onFormatMenuList(t.data.list)})).finally((function(){e.isLoading=!1}))},onFormatMenuList:function(e){var t=this,r=[];return e.forEach((function(e){10===e.module&&(e.children&&(e.actions=e.children.filter((function(e){return 20===e.module})),e.children=t.onFormatMenuList(e.children),!e.children.length&&delete e.children,!e.actions.length&&delete e.actions),r.push(e))})),r},getApiList:function(){var e=l(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.apiList.length){e.next=4;break}return this.isLoading=!0,e.next=4,b["d"]().then((function(e){t.apiList=e.data.list})).finally((function(){t.isLoading=!1}));case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),handleAdd:function(){this.$refs.AddForm.show()},handleEdit:function(e){this.$refs.EditForm.show(e)},handleSetApi:function(){var e=l(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getApiList();case 2:this.$refs.SetApiForm.show(t);case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),handleDelete:function(e){var t=this;t.$confirm({title:"您确定要删除该记录吗?",content:"确认后将无法恢复",onOk:function(){return t.onSubmitDelete(e)}})},onSubmitDelete:function(e){var t=this;return v({menuId:e["menu_id"]}).then((function(e){t.$message.success(e.message),t.handleRefresh()}))},handleRefresh:function(){this.getListData()},handleActionAdd:function(e){this.$refs.ActionForm.add(e.menu_id)},handleActionEdit:function(e){this.$refs.ActionForm.edit(e)}}},te=ee,re=(r("e64b"),Object(j["a"])(te,n,i,!1,null,"d0a4f120",null));t["default"]=re.exports}}]);
|