mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 04:52:50 +00:00
1 line
35 KiB
JavaScript
1 line
35 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-39dc3d30"],{"6f7a":function(t,e,r){},"7de3":function(t,e,r){"use strict";var n=r("8079");r.n(n).a},8079:function(t,e,r){},cf1c:function(t,e,r){"use strict";var n=r("6f7a");r.n(n).a},ee88: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"),o=r("f3f3"),i=(r("caad"),r("2532"),r("c740"),r("a434"),r("b0c0"),r("498a"),r("d3b7"),r("25f0"),r("159b"),r("2f62")),s=r("46c4"),l=r("9860"),c=(l=r.n(l),r("d81d"),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},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.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 o,i,s,l;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),n=new k(n||[]);return a(e,"_invoke",{value:(o=t,i=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 V()}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(o,i,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(){}o={};var y=(c(o,i,(function(){return this})),Object.getPrototypeOf),g=(y=y&&y(y(L([]))),y&&y!==e&&r.call(y,i)&&(o=y),v.prototype=p.prototype=Object.create(o));function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){var o;a(this,"_invoke",{value:function(a,i){function s(){return new e((function(o,s){!function a(o,i,s,l){var c;o=d(t[o],t,i);if("throw"!==o.type)return(i=(c=o.arg).value)&&"object"==Object(n.a)(i)&&r.call(i,"__await")?e.resolve(i.__await).then((function(t){a("next",t,s,l)}),(function(t){a("throw",t,s,l)})):e.resolve(i).then((function(t){c.value=t,s(c)}),(function(t){return a("throw",t,s,l)}));l(o.arg)}(a,i,o,s)}))}return o=o?o.then(s,s):s()}})}function w(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 k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function L(t){if(t){var e,n=t[i];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:V}}function V(){return{value:void 0,done:!0}}return a(g,"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(g),t},t.awrap=function(t){return{__await:t}},b(_.prototype),c(_.prototype,s,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new _(h(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},b(g),c(g,l,"Generator"),c(g,i,(function(){return this})),c(g,"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=L,k.prototype={constructor:k,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 i.type="throw",i.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 o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.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 o=a;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},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:L(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,search:c.a,ruleModal:!1,ruleList:[],authType:1}},watch:{"formValidate.header":function(t){this.formValidate.is_header=t?1:0},"formValidate.auth_type":function(t){this.authType=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("/","-")},changeAuthType:function(t){this.authType=t},selectRule:function(t){var e=this;this.$emit("selectRule",t),this.$nextTick((function(t){e.ruleModal=!1}))},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});return this.formValidate.menu_name?this.formValidate.menu_path?(this.valids=!0,void 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.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)}))):this.$Message.warning("请填写路由地址"):this.$Message.warning("请填写按钮名称")},handleReset:function(){this.modals=!1,this.$refs.formValidate.resetFields(),this.$emit("clearFrom")}},created:function(){this.list=this.search,this.getAddFrom()}},d=(r("7de3"),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},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:"类型:"}},[r("RadioGroup",{on:{"on-change":t.changeAuthType},model:{value:t.formValidate.auth_type,callback:function(e){t.$set(t.formValidate,"auth_type",e)},expression:"formValidate.auth_type"}},t._l(t.optionsRadio,(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),r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:2==t.authType?"接口名称:":1==t.authType?"菜单名称:":"按钮名称:",prop:"menu_name"}},[r("div",{staticClass:"add"},[r("Input",{attrs:{placeholder:2==t.authType?"请输入接口名称":1==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),2!=t.authType?r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"页面地址:",prop:"menu_path"}},[r("Input",{attrs:{placeholder:"请输入页面地址"},on:{"on-change":t.changeUnique},scopedSlots:t._u([{key:"prepend",fn:function(){return[r("span",[t._v(t._s(t.$routeProStr))])]},proxy:!0}],null,!1,3931479926),model:{value:t.formValidate.menu_path,callback:function(e){t.$set(t.formValidate,"menu_path",e)},expression:"formValidate.menu_path"}})],1)],1):t._e(),2==t.authType?r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"接口地址:",prop:"api_url"}},[r("Input",{attrs:{placeholder:"请输入接口地址"},on:{"on-change":t.changeUnique},scopedSlots:t._u([{key:"prepend",fn:function(){return[r("span",[t._v("adminapi/")])]},proxy:!0}],null,!1,1376925798),model:{value:t.formValidate.api_url,callback:function(e){t.$set(t.formValidate,"api_url",e)},expression:"formValidate.api_url"}})],1)],1):t._e(),r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"权限标识:",prop:"unique_auth"}},[r("Input",{attrs:{placeholder:"请输入权限标识"},model:{value:t.formValidate.unique_auth,callback:function(e){t.$set(t.formValidate,"unique_auth",e)},expression:"formValidate.unique_auth"}})],1)],1),2!=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(),r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"备注:"}},[r("Input",{attrs:{placeholder:"请输入备注",number:""},model:{value:t.formValidate.mark,callback:function(e){t.$set(t.formValidate,"mark",e)},expression:"formValidate.mark"}})],1)],1),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),r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"状态:"}},[r("RadioGroup",{model:{value:t.formValidate.is_show,callback:function(e){t.$set(t.formValidate,"is_show",e)},expression:"formValidate.is_show"}},t._l(t.isShowRadio,(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,"7891a5e9",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},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.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 o,i,s,l;e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),n=new k(n||[]);return a(e,"_invoke",{value:(o=t,i=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 V()}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(o,i,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(){}o={};var y=(c(o,i,(function(){return this})),Object.getPrototypeOf),g=(y=y&&y(y(L([]))),y&&y!==e&&r.call(y,i)&&(o=y),v.prototype=f.prototype=Object.create(o));function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){var o;a(this,"_invoke",{value:function(a,i){function s(){return new e((function(o,s){!function a(o,i,s,l){var c;o=h(t[o],t,i);if("throw"!==o.type)return(i=(c=o.arg).value)&&"object"==Object(n.a)(i)&&r.call(i,"__await")?e.resolve(i.__await).then((function(t){a("next",t,s,l)}),(function(t){a("throw",t,s,l)})):e.resolve(i).then((function(t){c.value=t,s(c)}),(function(t){return a("throw",t,s,l)}));l(o.arg)}(a,i,o,s)}))}return o=o?o.then(s,s):s()}})}function w(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 k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function L(t){if(t){var e,n=t[i];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:V}}function V(){return{value:void 0,done:!0}}return a(g,"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(g),t},t.awrap=function(t){return{__await:t}},b(_.prototype),c(_.prototype,s,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new _(u(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},b(g),c(g,l,"Generator"),c(g,i,(function(){return this})),c(g,"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=L,k.prototype={constructor:k,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 i.type="throw",i.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 o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.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 o=a;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},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:L(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:"",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}},components:{menusFrom:h,formCreate:l.a.$form()},computed:Object(o.a)(Object(o.a)({},Object(i.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:t.is_show};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 o=Object(a.a)(p().mark((function a(o){return p().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:r.formValidate.path=o.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 o.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.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,this.roleData.is_show=this.roleData.is_show||"",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)}))},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(o.a)({},t)),r.push(t.name),n.$store.dispatch("keepAliveNames/setCacheKeepAlive",r))})),e)},cancel:function(){this.$emit("onCancel")}}},r("cf1c"),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:"规则状态:"}},[r("Select",{attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.getData},model:{value:t.roleData.is_show,callback:function(e){t.$set(t.roleData,"is_show",e)},expression:"roleData.is_show"}},[r("Option",{attrs:{value:"1"}},[t._v("显示")]),r("Option",{attrs:{value:"0"}},[t._v("不显示")])],1)],1)],1),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),r("Row",{attrs:{type:"flex"}},[r("Col",t._b({},"Col",t.grid,!1),[r("Button",{attrs:{type:"primary",icon:"md-add"},on:{click:function(e){return t.menusAdd("添加规则")}}},[t._v("添加规则 ")])],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:"unique_auth",title:"前端权限","min-width":"200"}}),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._s(e.methods)+"]"+t._s(e.api_url))]):t._e()]}}])}),r("vxe-table-column",{attrs:{field:"flag",title:"规则状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("i-switch",{attrs:{value:n.is_show,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.is_show,callback:function(e){t.$set(n,"is_show",e)},expression:"row.is_show"}},[r("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),r("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}}])}),r("vxe-table-column",{attrs:{field:"mark",title:"备注","min-width":"120"}}),r("vxe-table-column",{attrs:{field:"date",title:"操作",align:"right",width:"250",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("span",[1===n.auth_type||3===n.auth_type?r("a",{on:{click:function(e){return t.addRoute(n)}}},[t._v("选择权限")]):t._e(),1===n.auth_type||3===n.auth_type?r("Divider",{attrs:{type:"vertical"}}):t._e(),1===n.auth_type?r("a",{on:{click:function(e){return t.addE(n,"添加子菜单")}}},[t._v("添加下级")]):t._e()],1),1===n.auth_type?r("Divider",{attrs:{type:"vertical"}}):t._e(),r("a",{on:{click:function(e){return t.edit(n,"编辑")}}},[t._v("编辑")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.del(n,"删除规则")}}},[t._v("删除")])]}}])})],1)],1),r("menus-from",{ref:"menusFrom",attrs:{formValidate:t.formValidate,titleFrom:t.titleFrom},on:{getList:t.getList,changeMenu:t.getMenusUnique,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("1.接口可多选,可重复添加;"),r("br"),t._v("2.添加路由按照路由规则进行添加,即可在开发工具->接口管理里面点击同步;"),r("br"),t._v("3.同步完成即可在此选择对应的接口;")]),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,"22ee2f93",null),e.default=l.exports}}]); |