mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 04:52:50 +00:00
1 line
32 KiB
JavaScript
1 line
32 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-f9045a34"],{"0162":function(t,e,r){"use strict";var n=r("f2e7");r.n(n).a},4315:function(t,e,r){"use strict";r.r(e),r("a4d3"),r("e01a"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("d9e2"),r("131a"),r("fb6a");var n=r("0122"),a=r("c964"),i=r("f3f3"),o=(r("caad"),r("2532"),r("c740"),r("a434"),r("b0c0"),r("498a"),r("d3b7"),r("25f0"),r("b64b"),r("d81d"),r("159b"),r("2f62")),s=r("46c4"),l=r("9860"),c=(l=r.n(l),r("ac1f"),r("5319"),r("5b81"),r("841c"),r("5bb2"));function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i,o,s,l;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),n=new L(n||[]);return a(e,"_invoke",{value:(i=t,o=r,s=n,l="suspendedStart",function(t,e){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===t)throw e;return O()}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r&&(r=function t(e,r){var n=r.method,a=e.iterator[n];return void 0===a?(r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f):(n=d(a,e.iterator,r.arg),"throw"===n.type?(r.method="throw",r.arg=n.arg,r.delegate=null,f):(a=n.arg,a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)))}(r,s),r)){if(r===f)continue;return r}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===l)throw l="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(l="executing",r=d(i,o,s),"normal"===r.type){if(l=s.done?"completed":"suspendedYield",r.arg===f)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(l="completed",s.method="throw",s.arg=r.arg)}})}),e}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var f={};function p(){}function m(){}function v(){}i={};var g=(c(i,o,(function(){return this})),Object.getPrototypeOf),y=(g=g&&g(g(k([]))),g&&g!==e&&r.call(g,o)&&(i=g),v.prototype=p.prototype=Object.create(i));function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var i;a(this,"_invoke",{value:function(a,o){function s(){return new e((function(i,s){!function a(i,o,s,l){var c;i=d(t[i],t,o);if("throw"!==i.type)return(o=(c=i.arg).value)&&"object"==Object(n.a)(o)&&r.call(o,"__await")?e.resolve(o.__await).then((function(t){a("next",t,s,l)}),(function(t){a("throw",t,s,l)})):e.resolve(o).then((function(t){c.value=t,s(c)}),(function(t){return a("throw",t,s,l)}));l(i.arg)}(a,o,i,s)}))}return i=i?i.then(s,s):s()}})}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function k(t){if(t){var e,n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(n=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n}).next=n}return{next:O}}function O(){return{value:void 0,done:!0}}return a(y,"constructor",{value:m.prototype=v,configurable:!0}),a(v,"constructor",{value:m,configurable:!0}),m.displayName=c(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),c(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new w(h(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},b(y),c(y,l,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;0<=a;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}var o=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,a=this.tryEntries[e];if(a.tryLoc===t)return"throw"===(r=a.completion).type&&(n=r.arg,x(a)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var h={name:"menusFrom",props:{formValidate:{type:Object,default:null},titleFrom:{type:String,default:""}},data:function(){return{arrs:[],searchRule:"",iconVal:"",grid:{xl:22,lg:22,md:22,sm:22,xs:22},modals:!1,modal12:!1,FromData:[],valids:!1,list2:[],list:c.a,authType:!0,search:c.a,ruleModal:!1,ruleList:[]}},watch:{"formValidate.header":function(t){this.formValidate.is_header=t?1:0},"formValidate.auth_type":function(t){this.authType=1===(t=void 0===t?1:t)},"formValidate.data":function(t){}},computed:{optionsList:function(){var t=[];return this.FromData.map((function(e){"pid"===e.field&&(t=e.options)})),t},headerOptionsList:function(){var t=[];return this.FromData.map((function(e){"header"===e.field&&(t=e.options)})),t},optionsListmodule:function(){var t=[];return this.FromData.map((function(e){"module"===e.field&&(t=e.options)})),t},optionsRadio:function(){var t=[];return this.FromData.map((function(e){"auth_type"===e.field&&(t=e.options)})),t},isheaderRadio:function(){var t=[];return this.FromData.map((function(e){"is_header"===e.field&&(t=e.options)})),t},isShowRadio:function(){var t=[];return this.FromData.map((function(e){"is_show"===e.field&&(t=e.options)})),t},isShowPathRadio:function(){var t=[];return this.FromData.map((function(e){"is_show_path"===e.field&&(t=e.options)})),t},menuList:function(){var t=[];return this.FromData.map((function(e){"menu_list"===e.field&&(t=e.props.data)})),t}},methods:{getRuleList:function(){var t=this;Object(s.d)().then((function(e){t.ruleList=e.data,t.ruleModal=!0}))},modalchange:function(t){t||(this.arrs=[],this.ruleModal="",this.ruleModal=!1)},changeUnique:function(t){t=this.$routeProStr+t.target.value,"/"===t.slice(0,1)&&(t=t.replace("/","")),this.formValidate.unique_auth=t.replaceAll("/","-")},visible:function(t){t||(this.authType=!0)},selectRule:function(t){var e=this;this.$emit("selectRule",t),this.$nextTick((function(t){e.ruleModal=!1}))},changeRadio:function(t){this.authType=1===t},upIcon:function(t){for(var e=[],r=0;r<this.search.length;r++)-1!==this.search[r].type.indexOf(t)&&(e.push(this.search[r]),this.list=e)},searchRules:function(){if(this.searchRule.trim()){this.arrs=[];for(var t=0;t<this.ruleList.length;t++)-1!==this.ruleList[t].real_name.indexOf(this.searchRule)&&this.arrs.push(t)}else this.arrs=[]},init:function(){this.searchRule="",this.arrs=[]},handleCreate1:function(t){this.headerOptionsList.push({value:t,label:t})},getAddFrom:function(){var t=this;Object(s.a)().then(function(){var e=Object(a.a)(u().mark((function e(r){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.FromData=r.data.rules;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg)}))},iconClick:function(){this.modal12=!0},iconChange:function(t){this.formValidate.icon=t,this.modal12=!1},handleSubmit:function(t){var e=this,r=(this.formValidate.path&&(r=this.formValidate.path.length,this.formValidate.pid=this.formValidate.path[r-1]||0),{url:this.formValidate.id?"/setting/menus/".concat(this.formValidate.id):"/setting/menus",method:this.formValidate.id?"put":"post",datas:this.formValidate});if(this.authType){if(!this.formValidate.menu_name)return this.$Message.warning("请填写按钮名称");if(!this.formValidate.menu_path)return this.$Message.warning("请填写路由地址")}else{if(!this.formValidate.menu_name)return this.$Message.warning("请填写接口名称");if(!this.formValidate.methods)return this.$Message.warning("请选择请求方式");if(!this.formValidate.api_url)return this.$Message.warning("请选择接口地址")}this.valids=!0,Object(s.b)(r).then(function(){var t=Object(a.a)(u().mark((function t(r){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.msg),e.modals=!1,e.$emit("changeMenu",e.formValidate),e.getAddFrom();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.valids=!1,e.$Message.error(t.msg)}))},handleReset:function(){this.modals=!1,this.authType=!0,this.$refs.formValidate.resetFields(),this.$emit("clearFrom")}},created:function(){this.list=this.search,this.getAddFrom()}},d=(r("b4d6"),r("2877")),f=(h=Object(d.a)(h,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Modal",{attrs:{width:"500",scrollable:"",closable:"",title:t.titleFrom,"mask-closable":!1,"z-index":1},on:{"on-cancel":t.handleReset,"on-visible-change":t.visible},scopedSlots:t._u([{key:"footer",fn:function(){return[r("Button",{on:{click:function(e){t.modals=!1}}},[t._v("取消")]),r("Button",{attrs:{type:"primary",disabled:t.valids},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("提交")])]},proxy:!0}]),model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[r("Form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":110},nativeOn:{submit:function(t){t.preventDefault()}}},[r("Row",{attrs:{type:"flex",gutter:24}},[r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:t.authType?"按钮名称:":"接口名称:",prop:"menu_name"}},[r("div",{staticClass:"add"},[r("Input",{attrs:{placeholder:t.authType?"请输入按钮名称":"请输入接口名称"},model:{value:t.formValidate.menu_name,callback:function(e){t.$set(t.formValidate,"menu_name",e)},expression:"formValidate.menu_name"}})],1)])],1),r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"父级分类:"}},[r("Cascader",{attrs:{data:t.menuList,"change-on-select":"",filterable:""},model:{value:t.formValidate.path,callback:function(e){t.$set(t.formValidate,"path",e)},expression:"formValidate.path"}})],1)],1),t.authType?r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"图标:"}},[r("Input",{attrs:{placeholder:"请选择图标,点击右面图标",icon:"ios-appstore"},on:{"on-click":t.iconClick},model:{value:t.formValidate.icon,callback:function(e){t.$set(t.formValidate,"icon",e)},expression:"formValidate.icon"}})],1)],1):t._e(),t.authType?r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"排序:"}},[r("Input",{attrs:{type:"number",placeholder:"请输入排序",number:""},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1):t._e(),r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"是否显示:"}},[r("RadioGroup",{model:{value:t.formValidate.is_show_path,callback:function(e){t.$set(t.formValidate,"is_show_path",e)},expression:"formValidate.is_show_path"}},t._l(t.isShowPathRadio,(function(e,n){return r("Radio",{key:n,attrs:{label:e.value}},[r("Icon",{attrs:{type:"social-apple"}}),r("span",[t._v(t._s(e.label))])],1)})),1)],1)],1)],1)],1)],1),r("Modal",{attrs:{scrollable:"",width:"600",title:"图标选择","footer-hide":""},model:{value:t.modal12,callback:function(e){t.modal12=e},expression:"modal12"}},[r("Input",{ref:"search",staticStyle:{width:"300px"},attrs:{placeholder:"输入关键词搜索,注意全是英文",clearable:""},on:{"on-change":function(e){return t.upIcon(t.iconVal)}},model:{value:t.iconVal,callback:function(e){t.iconVal=e},expression:"iconVal"}}),r("div",{staticClass:"trees-coadd"},[r("div",{staticClass:"scollhide"},[r("div",{staticClass:"iconlist"},[r("ul",{staticClass:"list-inline"},t._l(t.list,(function(e,n){return r("li",{key:n,staticClass:"icons-item",attrs:{title:e.type}},[r("Icon",{staticClass:"ivu-icon",attrs:{type:e.type},on:{click:function(r){return t.iconChange(e.type)}}})],1)})),0)])])])],1),r("Modal",{attrs:{scrollable:"",width:"1100",title:"权限列表","footer-hide":""},on:{"on-visible-change":t.modalchange},model:{value:t.ruleModal,callback:function(e){t.ruleModal=e},expression:"ruleModal"}},[r("div",{staticClass:"search-rule"},[r("Input",{ref:"search",staticClass:"mr10",staticStyle:{width:"300px"},attrs:{placeholder:"输入关键词搜索",clearable:""},model:{value:t.searchRule,callback:function(e){t.searchRule=e},expression:"searchRule"}}),r("Button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:t.searchRules}},[t._v("搜索")]),r("Button",{on:{click:t.init}},[t._v("重置")])],1),r("div",{staticClass:"rule"},t._l(t.ruleList,(function(e,n){return r("div",{directives:[{name:"show",rawName:"v-show",value:!t.arrs.length||t.arrs.includes(n),expression:"!arrs.length || arrs.includes(index)"}],key:n,staticClass:"rule-list",class:{"select-rule":t.arrs.includes(n)},on:{click:function(r){return t.selectRule(e)}}},[r("div",[t._v("接口名称:"+t._s(e.real_name))]),r("div",[t._v("请求方式:"+t._s(e.method))]),r("div",[t._v("接口地址:"+t._s(e.rule))])])})),0)])],1)}),[],!1,null,"23399662",null).exports,r("6987"));function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i,o,s,l;e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),n=new L(n||[]);return a(e,"_invoke",{value:(i=t,o=r,s=n,l="suspendedStart",function(t,e){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===t)throw e;return O()}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r&&(r=function t(e,r){var n=r.method,a=e.iterator[n];return void 0===a?(r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d):(n=h(a,e.iterator,r.arg),"throw"===n.type?(r.method="throw",r.arg=n.arg,r.delegate=null,d):(a=n.arg,a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)))}(r,s),r)){if(r===d)continue;return r}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===l)throw l="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(l="executing",r=h(i,o,s),"normal"===r.type){if(l=s.done?"completed":"suspendedYield",r.arg===d)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(l="completed",s.method="throw",s.arg=r.arg)}})}),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function f(){}function m(){}function v(){}i={};var g=(c(i,o,(function(){return this})),Object.getPrototypeOf),y=(g=g&&g(g(k([]))),g&&g!==e&&r.call(g,o)&&(i=g),v.prototype=f.prototype=Object.create(i));function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var i;a(this,"_invoke",{value:function(a,o){function s(){return new e((function(i,s){!function a(i,o,s,l){var c;i=h(t[i],t,o);if("throw"!==i.type)return(o=(c=i.arg).value)&&"object"==Object(n.a)(o)&&r.call(o,"__await")?e.resolve(o.__await).then((function(t){a("next",t,s,l)}),(function(t){a("throw",t,s,l)})):e.resolve(o).then((function(t){c.value=t,s(c)}),(function(t){return a("throw",t,s,l)}));l(i.arg)}(a,o,i,s)}))}return i=i?i.then(s,s):s()}})}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function k(t){if(t){var e,n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(n=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n}).next=n}return{next:O}}function O(){return{value:void 0,done:!0}}return a(y,"constructor",{value:m.prototype=v,configurable:!0}),a(v,"constructor",{value:m,configurable:!0}),m.displayName=c(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),c(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new w(u(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},b(y),c(y,l,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;0<=a;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}var o=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,a=this.tryEntries[e];if(a.tryLoc===t)return"throw"===(r=a.completion).type&&(n=r.arg,x(a)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}h={name:"systemMenus",data:function(){return{children:[],expandedKeys:[],tabconfig:{children:"children",reserve:!0,accordion:!0},spinShow:!1,ruleModal:!1,searchRule:"",grid:{xl:7,lg:7,md:12,sm:24,xs:24},roleData:{is_show:1,keyword:""},defaultProps:{children:"children",label:"name"},ruleCateList:[],loading:!1,tableData:[],FromData:null,icons:"",formValidate:{},titleFrom:"",modalTitleSs:"",routeType:"0",arrs:[],foundationList:[],openList:[],seletRoute:[],seletRouteIds:[],menusId:0,nodeKey:0,openId:""}},components:{menusFrom:h,formCreate:l.a.$form()},computed:Object(i.a)(Object(i.a)({},Object(o.d)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.getData()},methods:{init:function(){this.searchRule="",this.searchRules()},addRouters:function(){var t=this,e={menus:this.seletRoute};Object(s.g)(e).then((function(e){t.getData()})).catch((function(e){t.$Message.error(e.msg)}))},selectRule:function(t){var e;this.seletRouteIds.includes(t.id)?(e=this.seletRouteIds.findIndex((function(e){return e==t.id})),this.seletRouteIds.splice(e,1),this.seletRoute.splice(e,1)):(this.seletRouteIds.push(t.id),this.seletRoute.push({menu_name:t.name,unique_auth:"",api_url:t.path,path:this.menusId,method:t.method}))},changTab:function(t){this.routeType=t,t=parseInt(t),this.children=this.foundationList[t]?this.foundationList[t].children:[],this.searchRules()},searchRules:function(){if(this.searchRule.trim()){this.arrs=[];for(var t=this.foundationList,e=0;e<t.length;e++)-1!==t[e].name.indexOf(this.searchRule)&&this.arrs.push(t[e].id)}else this.arrs=[]},addRoute:function(t){var e=this;this.menusId=t.id,this.routeType="0",Object(s.i)().then((function(t){e.ruleCateList=t.data,e.ruleModal=!0,t.data.length&&e.$nextTick((function(r){e.expandedKeys=Object(f.b)(t.data[0],[]),e.nodeKey=Object(f.a)(t.data).id,e.$refs.treeBox.setCurrentKey(e.nodeKey),e.getRuleList(e.nodeKey)}))}))},handleNodeClick:function(t){this.getRuleList(t.id)},modalchange:function(){this.seletRouteIds=[],this.seletRoute=[]},getRuleList:function(t){var e=this;Object(s.d)(t).then((function(t){e.foundationList=t.data,e.children=t.data,e.searchRules()}))},onchangeIsShow:function(t){var e=this;t={id:t.id,is_show_path:t.is_show_path,is_show:-1};Object(s.f)(t).then(function(){var t=Object(a.a)(p().mark((function t(r){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.msg),e.$store.dispatch("menus/getMenusNavList");case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},getList:function(){this.formValidate=Object.assign({},this.$options.data().formValidate),this.getData()},clearFrom:function(){this.formValidate=Object.assign({},this.$options.data().formValidate)},addE:function(t,e){var r=this,n=(this.formValidate={},t.id.toString());n?Object(s.h)(t.id).then(function(){var i=Object(a.a)(p().mark((function a(i){return p().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:r.formValidate.path=i.data.path,r.formValidate.path.push(t.id),r.formValidate.pid=n,r.$refs.menusFrom.modals=!0,r.$refs.menusFrom.valids=!1,r.titleFrom=e,r.formValidate.auth_type=1,r.formValidate.is_show=0,r.formValidate.is_show_path=0;case 9:case"end":return a.stop()}}),a)})));return function(t){return i.apply(this,arguments)}}()).catch((function(t){r.$Message.error(t.msg)})):(this.formValidate.pid=n,this.$refs.menusFrom.modals=!0,this.$refs.menusFrom.valids=!1,this.titleFrom=e,this.formValidate.auth_type=1,this.formValidate.is_show=0,this.formValidate.is_show_path=0)},del:function(t,e){var r=this;e={title:e,url:"/setting/menus/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){r.$Message.success(t.msg),r.getData(),r.getMenusUnique()})).catch((function(t){r.$Message.error(t.msg)}))},menusDetails:function(t){var e=this;Object(s.h)(t).then(function(){var t=Object(a.a)(p().mark((function t(r){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.formValidate=r.data,e.$refs.menusFrom.modals=!0;case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},edit:function(t,e,r){this.openId=t.id,this.formValidate={},this.menusDetails(t.id),this.titleFrom=e,this.$refs.menusFrom.valids=!1,this.$refs.menusFrom.getAddFrom(t.id)},menusAdd:function(t){this.formValidate={},this.$refs.menusFrom.modals=!0,this.$refs.menusFrom.valids=!1,this.titleFrom=t,this.formValidate.auth_type=1,this.formValidate.is_show=0,this.formValidate.is_show_path=0},getData:function(){var t=this;this.loading=!0,Object(s.e)(this.roleData).then(function(){var e=Object(a.a)(p().mark((function e(r){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.tableData=r.data,t.loading=!1;case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},changeMenu:function(t){this.changeData(this.tableData,t),this.getMenusUnique()},changeData:function(t,e){var r=this,n=Object.keys(e);t.map((function(t){t.id==r.openId?n.map((function(r){t[r]=e[r]})):t.children&&r.changeData(t.children,e)}))},getMenusUnique:function(){var t=this;Object(s.c)().then((function(e){e=e.data;var r=(t.$store.commit("userInfo/uniqueAuth",e.uniqueAuth),t.$store.commit("menus/getmenusNav",e.menus),t.$store.dispatch("routesList/setRoutesList",e.menus),Object(f.c)(t.$router.options.routes));t.formatTwoStageRoutes(r),r=Object(f.c)(e.menus);t.$store.commit("menus/setOneLvRoute",r),t.bus.$emit("routesListChange")}))},formatTwoStageRoutes:function(t){var e,r,n=this;return!(t.length<=0)&&(e=[],r=[],t.forEach((function(t){t&&t.meta&&t.meta.keepAlive&&(e.push(Object(i.a)({},t)),r.push(t.name),n.$store.dispatch("keepAliveNames/setCacheKeepAlive",r))})),e)},cancel:function(){this.$emit("onCancel")}}},r("0162"),l=Object(d.a)(h,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Form",{ref:"roleData",attrs:{model:t.roleData,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[r("Row",{attrs:{type:"flex",gutter:24}},[r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"按钮名称:",prop:"status2","label-for":"status2"}},[r("Input",{attrs:{search:"","enter-button":"",placeholder:"请输入按钮名称"},on:{"on-search":t.getData},model:{value:t.roleData.keyword,callback:function(e){t.$set(t.roleData,"keyword",e)},expression:"roleData.keyword"}})],1)],1)],1)],1),r("vxe-table",{ref:"xTable",staticClass:"vxeTable mt25",attrs:{border:!1,"highlight-hover-row":"","highlight-current-row":"",loading:t.loading,"header-row-class-name":"false","tree-config":t.tabconfig,data:t.tableData,"row-id":"id"}},[r("vxe-table-column",{attrs:{field:"menu_name","tree-node":"",title:"按钮名称","min-width":"100"}}),r("vxe-table-column",{attrs:{field:"menu_path",title:"类型","min-width":"240",tooltip:"true"},scopedSlots:t._u([{key:"default",fn:function(e){return e=e.row,[1==e.auth_type?r("span",[t._v("菜单:"+t._s(e.menu_path))]):t._e(),3==e.auth_type?r("span",[t._v("按钮")]):t._e(),2==e.auth_type?r("span",[t._v("数据权限")]):t._e()]}}])}),r("vxe-table-column",{attrs:{field:"sort",title:"排序",width:"150"}}),r("vxe-table-column",{attrs:{field:"flag",title:"是否显示",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("i-switch",{attrs:{value:n.is_show_path,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.is_show_path,callback:function(e){t.$set(n,"is_show_path",e)},expression:"row.is_show_path"}},[r("span",{attrs:{slot:"open"},slot:"open"},[t._v("显示")]),r("span",{attrs:{slot:"close"},slot:"close"},[t._v("隐藏")])])]}}])}),r("vxe-table-column",{attrs:{field:"date",title:"操作",align:"center",width:"150",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("a",{on:{click:function(e){return t.edit(n,"编辑")}}},[t._v("编辑")])]}}])})],1)],1),r("menus-from",{ref:"menusFrom",attrs:{formValidate:t.formValidate,titleFrom:t.titleFrom},on:{getList:t.getList,changeMenu:t.changeMenu,clearFrom:t.clearFrom}}),r("Modal",{attrs:{scrollable:"",width:"1100",title:"权限列表"},on:{"on-ok":t.addRouters,"on-cancel":function(e){t.ruleModal=!1},"on-visible-change":t.modalchange},model:{value:t.ruleModal,callback:function(e){t.ruleModal=e},expression:"ruleModal"}},[r("div",{staticClass:"search-rule"},[r("Alert",[t._v("基础接口,可多选,并且添加后不会再展示出现;删除权限后才会出现;公共接口,可多选,并且添加后会继续展示;")]),r("Input",{ref:"search",staticClass:"mr10",staticStyle:{width:"300px"},attrs:{placeholder:"输入关键词搜索",clearable:""},on:{"on-enter":t.searchRules,"on-clear":t.searchRules},model:{value:t.searchRule,callback:function(e){t.searchRule=e},expression:"searchRule"}}),r("Button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:t.searchRules}},[t._v("搜索")]),r("Button",{on:{click:t.init}},[t._v("重置")])],1),r("div",{staticClass:"route-list"},[r("div",{staticClass:"tree"},[r("el-tree",{ref:"treeBox",attrs:{data:t.ruleCateList,"highlight-current":!0,props:t.defaultProps,"node-key":"id","default-expanded-keys":t.expandedKeys,"current-node-key":t.nodeKey},on:{"node-click":t.handleNodeClick}})],1),r("div",{staticClass:"rule"},t._l(t.children,(function(e,n){return r("div",{directives:[{name:"show",rawName:"v-show",value:!t.arrs.length||t.arrs.includes(e.id),expression:"!arrs.length || arrs.includes(item.id)"}],key:n,staticClass:"rule-list",class:{"select-rule":t.seletRouteIds.includes(e.id)},on:{click:function(r){return t.selectRule(e)}}},[r("div",[t._v("接口名称:"+t._s(e.name))]),r("div",[t._v("请求方式:"+t._s(e.method))]),r("div",[t._v("接口地址:"+t._s(e.path))])])})),0)])])],1)}),[],!1,null,"714a5c83",null),e.default=l.exports},b4d6:function(t,e,r){"use strict";var n=r("d174");r.n(n).a},d174:function(t,e,r){},f2e7:function(t,e,r){}}]); |