mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-01-06 04:18:11 +00:00
1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-702a2a9b"],{"15da":function(t,e,n){"use strict";var r=n("7402");n.n(r).a},7402:function(t,e,n){},ffd0:function(t,e,n){"use strict";n.r(e),n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("d9e2"),n("159b"),n("b0c0"),n("131a"),n("fb6a");var r=n("0122"),i=n("c964"),o=n("f3f3"),a=(n("a434"),n("d81d"),n("2f62")),s=n("90e7");function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(e){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var o,a,s,l;e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),r=new k(r||[]);return i(e,"_invoke",{value:(o=t,a=n,s=r,l="suspendedStart",function(t,e){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===t)throw e;return I()}for(s.method=t,s.arg=e;;){var n=s.delegate;if(n&&(n=function t(e,n){var r=n.method,i=e.iterator[r];return void 0===i?(n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h):(r=f(i,e.iterator,n.arg),"throw"===r.type?(n.method="throw",n.arg=r.arg,n.delegate=null,h):(i=r.arg,i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)))}(n,s),n)){if(n===h)continue;return n}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",n=f(o,a,s),"normal"===n.type){if(l=s.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:s.done}}"throw"===n.type&&(l="completed",s.method="throw",s.arg=n.arg)}})}),e}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=d;var h={};function m(){}function p(){}function v(){}o={};var g=(u(o,a,(function(){return this})),Object.getPrototypeOf),b=(g=g&&g(g(L([]))),g&&g!==e&&n.call(g,a)&&(o=g),v.prototype=m.prototype=Object.create(o));function y(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;i(this,"_invoke",{value:function(i,a){function s(){return new e((function(o,s){!function i(o,a,s,l){var c;o=f(t[o],t,a);if("throw"!==o.type)return(a=(c=o.arg).value)&&"object"==Object(r.a)(a)&&n.call(a,"__await")?e.resolve(a.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):e.resolve(a).then((function(t){c.value=t,s(c)}),(function(t){return i("throw",t,s,l)}));l(o.arg)}(i,a,o,s)}))}return o=o?o.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 k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(t){if(t){var e,r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(r=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r}).next=r}return{next:I}}function I(){return{value:void 0,done:!0}}return i(b,"constructor",{value:p.prototype=v,configurable:!0}),i(v,"constructor",{value:p,configurable:!0}),p.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(w.prototype),u(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new w(d(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(b),u(b,c,"Generator"),u(b,a,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)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)&&n.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 r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;0<=i;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var a=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},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),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}o={name:"systemrRole",data:function(){return{spinShow:!1,modals:!1,total:0,grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,formValidate:{status:"",role_name:"",page:1,limit:20},tableList:[],formInline:{role_name:"",status:0,checked_menus:[],id:0},menusList:[],selectIds:[],modelTit:"",ruleValidate:{role_name:[{required:!0,message:"请输入身份昵称",trigger:"blur"}],status:[{required:!0,type:"number",message:"请选择是否开启",trigger:"change"}]},defaultProps:{children:"children",label:"title"}}},computed:Object(o.a)(Object(o.a)({},Object(a.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:"80px"},labelPosition:function(){return this.isMobile?"top":"right"},labelPosition2:function(){return this.isMobile?"top":"right"}}),created:function(){this.getList()},methods:{closed:function(){this.formInline={role_name:"",status:0,checked_menus:[],id:0},this.selectIds=[]},add:function(t){this.formInline.id=0,this.modelTit=t,this.modals=!0,this.getmenusList()},del:function(t,e,n){var r=this;e={title:e,num:n,url:"setting/role/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){r.$message.success(t.msg),r.tableList.splice(n,1)})).catch((function(t){r.$message.error(t.msg)}))},onchangeIsShow:function(t){var e=this;t={id:t.id,status:t.status};Object(s.db)(t).then(function(){var t=Object(i.a)(l().mark((function t(n){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$message.success(n.msg);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.msg)}))},getList:function(){var t=this;this.loading=!0,this.formValidate.status=this.formValidate.status||"",Object(s.cb)(this.formValidate).then(function(){var e=Object(i.a)(l().mark((function e(n){var r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.data,t.tableList=r.list,t.total=n.data.count,t.loading=!1;case 4: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)}))},userSearchs:function(){this.formValidate.page=1,this.getList()},edit:function(t,e){this.modelTit=e,this.formInline.id=t.id,this.modals=!0,this.rows=t,this.getIofo(t)},getmenusList:function(){var t=this;this.spinShow=!0,Object(s.T)().then(function(){var e=Object(i.a)(l().mark((function e(n){var r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.data,t.menusList=r.menus,t.menusList.map((function(t,e){"主页"===t.title&&t.children.length&&t.children.map((function(t){})),t.expand=!1})),t.spinShow=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.spinShow=!1,t.$message.error(e.msg)}))},getIofo:function(t){var e=this;this.spinShow=!0,Object(s.bb)(t.id).then(function(){var t=Object(i.a)(l().mark((function t(n){var r;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,e.formInline=r.role||e.formInline,e.formInline.checked_menus=e.formInline.rules,e.selectIds=e.formInline.rules.split(","),e.$nextTick((function(t){e.tidyRes(r.menus)})),e.spinShow=!1;case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.spinShow=!1,e.$message.error(t.msg)}))},tidyRes:function(t){var e=this,n=[];t.map((function(t){"主页"===t.title?(t.checked=!0,t.children.length&&t.children.map((function(t){})),n.push(t)):n.push(e.initMenu(t))})),this.$set(this,"menusList",n)},initMenu:function(t){var e=this,n={},r=","+this.formInline.checked_menus+",";return n.title=t.title,n.id=t.id,t.children&&0<t.children.length?(n.children=[],t.children.map((function(t){n.children.push(e.initMenu(t))}))):(n.checked=-1!==r.indexOf(String(","+n.id+",")),n.expand=!n.checked),n},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(n){return!!n&&(e.formInline.checked_menus=[],e.$refs.tree.getCheckedNodes().map((function(t){e.formInline.checked_menus.push(t.id)})),0===e.formInline.checked_menus.length?e.$message.warning("请至少选择一个权限"):void Object(s.ab)(e.formInline).then(function(){var n=Object(i.a)(l().mark((function n(r){return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e.$message.success(r.msg),e.modals=!1,e.getList(),e.$refs[t].resetFields(),e.formInline.checked_menus=[];case 5:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.msg)})))}))},onCancel:function(){this.$refs.formInline.resetFields(),this.formInline.checked_menus=[],this.selectIds=[],this.modals=!1}}},n("15da"),a=n("2877"),n=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-card",{staticClass:"ivu-mb-16",attrs:{bordered:!1,shadow:"never","body-style":{padding:0}}},[n("div",{staticClass:"padding-add"},[n("el-form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":t.labelWidth,"label-position":t.labelPosition,inline:""},nativeOn:{submit:function(t){t.preventDefault()}}},[n("el-form-item",{attrs:{label:"状态:","label-for":"status"}},[n("el-select",{staticClass:"form_content_width",attrs:{placeholder:"请选择",clearable:""},on:{change:t.userSearchs},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}},[n("el-option",{attrs:{value:"1",label:"显示"}}),n("el-option",{attrs:{value:"0",label:"不显示"}})],1)],1),n("el-form-item",{attrs:{label:"身份昵称:","label-for":"role_name"}},[n("el-input",{staticClass:"form_content_width",attrs:{clearable:"",placeholder:"请输入身份昵称"},model:{value:t.formValidate.role_name,callback:function(e){t.$set(t.formValidate,"role_name",e)},expression:"formValidate.role_name"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.userSearchs}},[t._v("查询")])],1)],1)],1)]),n("el-card",{directives:[{name:"loading",rawName:"v-loading",value:t.spinShow,expression:"spinShow"}],attrs:{bordered:!1,shadow:"never"}},[n("el-button",{directives:[{name:"auth",rawName:"v-auth",value:["setting-system_role-add"],expression:"['setting-system_role-add']"}],attrs:{type:"primary"},on:{click:function(e){return t.add("添加")}}},[t._v("添加身份")]),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"table",staticClass:"mt14",attrs:{data:t.tableList,"highlight-current-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"}},[n("el-table-column",{attrs:{label:"ID","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.id))])]}}])}),n("el-table-column",{attrs:{label:"身份昵称","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.role_name))])]}}])}),n("el-table-column",{attrs:{label:"状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-switch",{staticClass:"defineSwitch",attrs:{"active-value":1,"inactive-value":0,value:e.row.status,size:"large","active-text":"显示","inactive-text":"隐藏"},on:{change:function(n){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(n){t.$set(e.row,"status",n)},expression:"scope.row.status"}})]}}])}),n("el-table-column",{attrs:{label:"操作",fixed:"right",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("a",{on:{click:function(n){return t.edit(e.row,"编辑")}}},[t._v("编辑")]),n("el-divider",{attrs:{direction:"vertical"}}),n("a",{on:{click:function(n){return t.del(e.row,"删除",e.$index)}}},[t._v("删除")])]}}])})],1),n("div",{staticClass:"acea-row row-right page"},[t.total?n("pagination",{attrs:{total:t.total,page:t.formValidate.page,limit:t.formValidate.limit},on:{"update:page":function(e){return t.$set(t.formValidate,"page",e)},"update:limit":function(e){return t.$set(t.formValidate,"limit",e)},pagination:t.getList}}):t._e()],1)],1),n("el-dialog",{attrs:{visible:t.modals,title:t.modelTit+"身份","close-on-click-modal":!1,"show-close":!0,width:"540px"},on:{"update:visible":function(e){t.modals=e},closed:t.closed}},[n("el-form",{ref:"formInline",attrs:{model:t.formInline,rules:t.ruleValidate,"label-width":"100px","label-position":t.labelPosition2},nativeOn:{submit:function(t){t.preventDefault()}}},[n("el-form-item",{attrs:{label:"身份名称:","label-for":"role_name",prop:"role_name"}},[n("el-input",{attrs:{placeholder:"请输入身份昵称"},model:{value:t.formInline.role_name,callback:function(e){t.$set(t.formInline,"role_name",e)},expression:"formInline.role_name"}})],1),n("el-form-item",{attrs:{label:"是否开启:",prop:"status"}},[n("el-radio-group",{model:{value:t.formInline.status,callback:function(e){t.$set(t.formInline,"status",e)},expression:"formInline.status"}},[n("el-radio",{attrs:{label:1}},[t._v("开启")]),n("el-radio",{attrs:{label:0}},[t._v("关闭")])],1)],1),n("el-form-item",{attrs:{label:"权限:"}},[n("div",{staticClass:"trees-coadd"},[n("div",{staticClass:"scollhide"},[n("div",{staticClass:"iconlist"},[n("el-tree",{ref:"tree",attrs:{data:t.menusList,"node-key":"id","show-checkbox":"","highlight-current":"","default-checked-keys":t.selectIds,props:t.defaultProps}})],1)])])])],1),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:t.onCancel}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formInline")}}},[t._v("提 交")])],1)],1)],1)}),[],!1,null,"2dd0b86f",null),e.default=n.exports}}]); |