mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 00:40:30 +08:00
0c56a3e599
Made-with: Cursor Former-commit-id: 571c9a99ee26d90505e550c287eb8ad8d743ff8d
1 line
24 KiB
JavaScript
1 line
24 KiB
JavaScript
(window["webpackJsonp_canoe-account"]=window["webpackJsonp_canoe-account"]||[]).push([["chunk-03c37122"],{"0b91":function(e,t,a){"use strict";var r=a("fcf6"),n=a.n(r);n.a},"0ccb":function(e,t,a){var r=a("50c4"),n=a("1148"),i=a("1d80"),o=Math.ceil,l=function(e){return function(t,a,l){var s,c,u=String(i(t)),d=u.length,f=void 0===l?" ":String(l),p=r(a);return p<=d||""==f?u:(s=p-d,c=n.call(f,o(s/f.length)),c.length>s&&(c=c.slice(0,s)),e?u+c:c+u)}};e.exports={start:l(!1),end:l(!0)}},1148:function(e,t,a){"use strict";var r=a("a691"),n=a("1d80");e.exports="".repeat||function(e){var t=String(n(this)),a="",i=r(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(a+=t);return a}},"1ed8":function(e,t,a){},"330f":function(e,t,a){"use strict";var r=a("1ed8"),n=a.n(r);n.a},"466d":function(e,t,a){"use strict";var r=a("d784"),n=a("825a"),i=a("50c4"),o=a("1d80"),l=a("8aa5"),s=a("14c3");r("match",1,(function(e,t,a){return[function(t){var a=o(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,a):new RegExp(t)[e](String(a))},function(e){var r=a(t,e,this);if(r.done)return r.value;var o=n(e),c=String(this);if(!o.global)return s(o,c);var u=o.unicode;o.lastIndex=0;var d,f=[],p=0;while(null!==(d=s(o,c))){var h=String(d[0]);f[p]=h,""===h&&(o.lastIndex=l(c,i(o.lastIndex),u)),p++}return 0===p?null:f}]}))},"4d90":function(e,t,a){"use strict";var r=a("23e7"),n=a("0ccb").start,i=a("9a0c");r({target:"String",proto:!0,forced:i},{padStart:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(e,t,a){"use strict";var r=a("0366"),n=a("7b0b"),i=a("9bdd"),o=a("e95a"),l=a("50c4"),s=a("8418"),c=a("35a1");e.exports=function(e){var t,a,u,d,f,p,h=n(e),b="function"==typeof this?this:Array,m=arguments.length,v=m>1?arguments[1]:void 0,g=void 0!==v,y=c(h),w=0;if(g&&(v=r(v,m>2?arguments[2]:void 0,2)),void 0==y||b==Array&&o(y))for(t=l(h.length),a=new b(t);t>w;w++)p=g?v(h[w],w):h[w],s(a,w,p);else for(d=y.call(h),f=d.next,a=new b;!(u=f.call(d)).done;w++)p=g?i(d,v,[u.value,w],!0):u.value,s(a,w,p);return a.length=w,a}},"52ce":function(e,t,a){e.exports={elInputWidth:"200px",elInputNumberWidth:"200px",elTextareaWidth:"300px",elSelectWidth:"200px",appHeaderBg:"#014051",appIconBg:"#6758f3",appIconColor:"#fff",appIconSize:"30px",appNameColor:"#fff",appNameSize:"30px"}},"7db0":function(e,t,a){"use strict";var r=a("23e7"),n=a("b727").find,i=a("44d2"),o=a("ae40"),l="find",s=!0,c=o(l);l in[]&&Array(1)[l]((function(){s=!1})),r({target:"Array",proto:!0,forced:s||!c},{find:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),i(l)},"99af":function(e,t,a){"use strict";var r=a("23e7"),n=a("d039"),i=a("e8b5"),o=a("861d"),l=a("7b0b"),s=a("50c4"),c=a("8418"),u=a("65f0"),d=a("1dde"),f=a("b622"),p=a("2d00"),h=f("isConcatSpreadable"),b=9007199254740991,m="Maximum allowed index exceeded",v=p>=51||!n((function(){var e=[];return e[h]=!1,e.concat()[0]!==e})),g=d("concat"),y=function(e){if(!o(e))return!1;var t=e[h];return void 0!==t?!!t:i(e)},w=!v||!g;r({target:"Array",proto:!0,forced:w},{concat:function(e){var t,a,r,n,i,o=l(this),d=u(o,0),f=0;for(t=-1,r=arguments.length;t<r;t++)if(i=-1===t?o:arguments[t],y(i)){if(n=s(i.length),f+n>b)throw TypeError(m);for(a=0;a<n;a++,f++)a in i&&c(d,f,i[a])}else{if(f>=b)throw TypeError(m);c(d,f++,i)}return d.length=f,d}})},"9a0c":function(e,t,a){var r=a("342f");e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)},a630:function(e,t,a){var r=a("23e7"),n=a("4df4"),i=a("1c7e"),o=!i((function(e){Array.from(e)}));r({target:"Array",stat:!0,forced:o},{from:n})},a6a6:function(e,t,a){},e32f:function(e,t,a){"use strict";var r=a("a6a6"),n=a.n(r);n.a},e3f4:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tab-list"},[a("div",{staticClass:"container-body"},[a("div",{staticClass:"search"},[a("div",{staticClass:"condition"},[a("div",{staticClass:"search-label"},[e._v("所属应用")]),a("el-select",{staticClass:"el-width-160",attrs:{placeholder:"所属应用"},on:{change:e.search},model:{value:e.searchForm.serviceCode,callback:function(t){e.$set(e.searchForm,"serviceCode",t)},expression:"searchForm.serviceCode"}},e._l(e.applicationOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),a("div",{staticClass:"search-label"},[e._v("权限名")]),a("el-input",{staticClass:"el-width-160",attrs:{placeholder:"权限名"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search(t)}},model:{value:e.searchForm.name,callback:function(t){e.$set(e.searchForm,"name","string"===typeof t?t.trim():t)},expression:"searchForm.name"}}),a("div",{staticClass:"search-label"},[e._v("英文名")]),a("el-input",{staticClass:"el-width-160",attrs:{placeholder:"英文名",maxlength:30},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search(t)}},model:{value:e.searchForm.enName,callback:function(t){e.$set(e.searchForm,"enName","string"===typeof t?t.trim():t)},expression:"searchForm.enName"}}),a("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"primary"},on:{click:e.search}},[e._v(" 查询 ")]),a("el-button",{on:{click:e.resetSearch}},[e._v(" 重置 ")])],1)]),a("el-divider"),a("div",{staticClass:"operate"},[a("el-button",{attrs:{type:"primary"},on:{click:e.goAdd}},[e._v(" 新增权限 ")])],1),a("div",{staticClass:"table-block"},[a("div",{staticClass:"table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.tableLoading,expression:"tableLoading"}],attrs:{data:e.tableData,stripe:"","row-key":"id",height:"100%"}},[a("el-table-column",{attrs:{prop:"serviceCode",label:"所属应用"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.applicationOptions.find((function(e){return e.value===t.row.serviceCode}))?e.applicationOptions.find((function(e){return e.value===t.row.serviceCode})).label:t.row.serviceCode))])]}}])}),a("el-table-column",{attrs:{prop:"name",label:"权限名称"}}),a("el-table-column",{attrs:{prop:"enName",label:"英文名"}}),a("el-table-column",{attrs:{prop:"createUserName",label:"创建人",width:"200"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.parseTime(t.row.createTime)))])]}}])}),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{style:1===t.row.status?"color:#02B290;":"color:#F56C6C;"},[e._v(e._s(1===t.row.status?"已启用":"已禁用"))])]}}])}),a("el-table-column",{staticClass:"action-list",attrs:{label:"操作",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[1!==t.row.builtIn?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.goEdit(t.row)}}},[e._v("编辑")]):e._e(),1!==t.row.ext2&&2===t.row.status&&1!==t.row.builtIn?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.enable(t.row)}}},[e._v("启用")]):e._e(),1!==t.row.ext2&&1===t.row.status&&1!==t.row.builtIn?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.disable(t.row)}}},[e._v("禁用")]):e._e(),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.goAssign(t.row)}}},[e._v("分配资源")])]}}])})],1)],1)]),e.total>10?a("div",{staticClass:"pagination"},[a("el-pagination",{attrs:{background:"",layout:"total,prev, pager, next, sizes",total:e.total,"current-page":e.searchForm.currentPage,"page-size":e.searchForm.rowsOfPage},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange,"update:currentPage":function(t){return e.$set(e.searchForm,"currentPage",t)},"update:current-page":function(t){return e.$set(e.searchForm,"currentPage",t)},"update:pageSize":function(t){return e.$set(e.searchForm,"rowsOfPage",t)},"update:page-size":function(t){return e.$set(e.searchForm,"rowsOfPage",t)}}})],1):e._e()],1),a("el-dialog",{staticClass:"addOrEditDialog",attrs:{title:e.selectRow?"编辑权限":"新增权限",visible:e.dialogVisible,width:"580px","custom-class":"vertical-center","destroy-on-close":""},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",[a("el-form",{ref:"ruleForm",attrs:{model:e.submitForm,"label-width":"100px",inline:!0}},[a("el-row",[a("el-form-item",{attrs:{label:"权限名称",prop:"name",rules:[e.normalRule("empty","请填写名称"),e.lenRule(0,64)]}},[a("el-input",{staticClass:"width-420",attrs:{placeholder:"请填写名称"},model:{value:e.submitForm.name,callback:function(t){e.$set(e.submitForm,"name","string"===typeof t?t.trim():t)},expression:"submitForm.name"}})],1)],1),a("el-row",[a("el-form-item",{attrs:{label:"所属应用",prop:"serviceCode",rules:[{required:!0,message:"请选择所属应用"}]}},[a("el-select",{staticClass:"width-420",attrs:{disabled:!!e.selectRow,placeholder:"所属应用"},model:{value:e.submitForm.serviceCode,callback:function(t){e.$set(e.submitForm,"serviceCode",t)},expression:"submitForm.serviceCode"}},e._l(e.applicationOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),a("el-row",[a("el-form-item",{attrs:{label:"英文名",prop:"enName"}},[a("el-input",{staticClass:"width-420",attrs:{placeholder:"请填写英文名",maxlength:30},model:{value:e.submitForm.enName,callback:function(t){e.$set(e.submitForm,"enName","string"===typeof t?t.trim():t)},expression:"submitForm.enName"}})],1)],1),a("el-row",[a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{staticClass:"width-420",attrs:{maxlength:255,type:"textarea",autosize:{minRows:5,maxRows:10},placeholder:"请填写备注"},model:{value:e.submitForm.remark,callback:function(t){e.$set(e.submitForm,"remark",t)},expression:"submitForm.remark"}})],1)],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.cancelAdd}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.sureAdd}},[e._v("确 定")])],1)]),a("assignPermission",{attrs:{dialogVisible:e.permissionDialogVisible,query:e.assginSelected},on:{close:function(t){e.permissionDialogVisible=!1}}})],1)},n=[],i=(a("a4d3"),a("4de4"),a("4160"),a("d81d"),a("b0c0"),a("e439"),a("dbb4"),a("b64b"),a("d3b7"),a("159b"),a("ade3")),o=a("d4ec"),l=a("bee2"),s=a("99de"),c=a("7e84"),u=a("262e"),d=a("9ab4"),f=a("60a3"),p=a("103b"),h="/cwos-portal",b={list:function(e){return p["a"].post("".concat(h,"/portal/auth/page"),e)},add:function(e){return p["a"].post("".concat(h,"/res/auth/add"),e)},edit:function(e){return p["a"].post("".concat(h,"/res/auth/edit"),e)},delete:function(e){return p["a"].post("".concat(h,"/res/auth/delete"),e)},enable:function(e){return p["a"].post("".concat(h,"/res/auth/enable"),e)},disable:function(e){return p["a"].post("".concat(h,"/res/auth/disable"),e)},gets:function(e){return p["a"].post("".concat(h,"/res/auth/gets"),e)},resourceTree:function(e){return p["a"].post("".concat(h,"/res/resource/tree"),e)},resourceAdd:function(e){return p["a"].post("".concat(h,"/res/auth/resource/add"),e)},resourceQuery:function(e){return p["a"].post("".concat(h,"/res/auth/resource/query"),e)}};a("99af"),a("4d63"),a("ac1f"),a("25f0");function m(e,t,a){var r=function(a,r,n){e.test(r)?n():n(new Error(t))};return{validator:r,trigger:a||"blur"}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,a="长度在".concat(e,"到").concat(t,"个字符");return 0===e&&(a="最长为".concat(t,"个字符")),{min:e,max:t,message:a,trigger:"blur"}}function g(e,t,a){var r=new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"),n=[/[A-Z]/,/[a-z]/,r,/[0-9]/],i=0;n.map((function(e){e.test(t)&&(i+=1)})),i>=3&&t.length>=8&&t.length<=20?a():(t.length>20&&a(new Error("密码长度不能超过20位")),a(new Error("密码必须满足“大小写字母、数字、特殊字符”三种以上组合,长度大于8位")))}function y(e,t){switch(e){case"pwd":return{validator:g,trigger:"blur"};case"int+":return m(/^[1-9]\d*$/,"请输入正整数");case"phone":return m(/^((\+86)|(86))?(1)\d{10}$/,"手机号格式不正确");case"email":return m(/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,"邮箱格式不正确");case"ycEmail":return m(/@cloudwalk.cn$/,"请输入云从企业邮箱");default:return{required:!0,message:t||"不能为空",trigger:["blur","change"]}}}a("c975"),a("e25e"),a("466d"),a("4d90"),a("5319");var w=a("53ca"),k=function(e,t){if(void 0===e)return null;var a,r=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"===Object(w["a"])(e)?a=e:("string"===typeof e&&/^[0-9]+$/.test(e)&&(e=parseInt(e)),"number"===typeof e&&10===e.toString().length&&(e*=1e3),a=new Date(e));var n={y:a.getFullYear(),m:a.getMonth()+1,d:a.getDate(),h:a.getHours(),i:a.getMinutes(),s:a.getSeconds(),a:a.getDay()},i=r.replace(/{([ymdhisa])+}/g,(function(e,t){var a=n[t];return"a"===t?["日","一","二","三","四","五","六"][a]:a.toString().padStart(2,"0")}));return i},O=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{staticClass:"assignPermissionDialog",attrs:{title:"分配资源",visible:e.dialogVisible,width:"70%","destroy-on-close":"","custom-class":"vertical-center"},on:{"update:visible":function(t){e.dialogVisible=t},close:function(t){return e.$emit("close")}}},[a("div",{staticStyle:{textAlign:"left"}},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.setAllSelect(e.tableData,!0)}}},[e._v("全选")]),a("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:""},on:{click:function(t){return e.setAllSelect(e.tableData,!1)}}},[e._v("反选")])],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.tableLoading,expression:"tableLoading"}],ref:"multipleTable",staticStyle:{"margin-top":"20px",width:"100%"},attrs:{height:"100%",stripe:"",data:e.tableData,"row-key":"id","tooltip-effect":"dark"},on:{select:e.handleSelect,"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"name",label:"资源名称"}}),a("el-table-column",{attrs:{prop:"serviceCode",label:"所属应用"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.applicationOptions.find((function(e){return e.value===t.row.serviceCode}))?e.applicationOptions.find((function(e){return e.value===t.row.serviceCode})).label:t.row.serviceCode))])]}}])}),a("el-table-column",{attrs:{prop:"code",label:"资源编码"}}),a("el-table-column",{attrs:{prop:"type",label:"资源类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(1===t.row.type?"菜单":"按钮"))])]}}])}),a("el-table-column",{attrs:{prop:"url",label:"资源链接"}}),a("el-table-column",{attrs:{prop:"orderBy",label:"优先级"}})],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){return e.$emit("close")}}},[e._v("取 消")]),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.sureLoading,expression:"sureLoading"}],attrs:{type:"primary",disabled:e.tableLoading},on:{click:e.sure}},[e._v("确 定")])],1)],1)},S=[];a("e01a"),a("d28b"),a("7db0"),a("3ca3"),a("ddb0");function x(e){if(Array.isArray(e)){for(var t=0,a=new Array(e.length);t<e.length;t++)a[t]=e[t];return a}}a("a630"),a("e260");function C(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function j(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _(e){return x(e)||C(e)||j()}function F(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function $(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?F(Object(a),!0).forEach((function(t){Object(i["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):F(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var P=function(e){function t(){var e;return Object(o["a"])(this,t),e=Object(s["a"])(this,Object(c["a"])(t).apply(this,arguments)),e.applicationOptions=[],e.tableData=[],e.multipleSelection=[],e.oldAllSelection=[],e.tableLoading=!1,e.sureLoading=!1,e}return Object(u["a"])(t,e),Object(l["a"])(t,[{key:"dialogVisibleChange",value:function(e){e&&this.fetchData(this.query)}},{key:"getList",value:function(e){this.applicationOptions=e.map((function(e){return{label:e.name,value:e.serviceCode}}))}},{key:"mounted",value:function(){}},{key:"handleClose",value:function(){}},{key:"setParentSelect",value:function(e,t){var a=this.$refs.multipleTable;if(a.toggleRowSelection(e,t),e.children&&e.children.length>0){var r=!0,n=!1,i=void 0;try{for(var o,l=e.children[Symbol.iterator]();!(r=(o=l.next()).done);r=!0){var s=o.value;this.setParentSelect(s,t)}}catch(c){n=!0,i=c}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}}}},{key:"setAllSelect",value:function(e,t){var a=!0,r=!1,n=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done);a=!0){var l=i.value,s=this.$refs.multipleTable;if(s.toggleRowSelection(l,t),l.children&&l.children.length>0){var c=!0,u=!1,d=void 0;try{for(var f,p=l.children[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){f.value;this.setAllSelect(l.children,t)}}catch(h){u=!0,d=h}finally{try{c||null==p.return||p.return()}finally{if(u)throw d}}}}}catch(h){r=!0,n=h}finally{try{a||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"handleSelect",value:function(e,t){var a=this,r=e.find((function(e){return e.id===t.id})),n=this.findAllParent(this.tableData,t.id||"");r?this.$nextTick((function(){a.setParentSelect(t,!0);var e=!0,r=!1,i=void 0;try{for(var o,l=n[Symbol.iterator]();!(e=(o=l.next()).done);e=!0){var s=o.value;a.$refs.multipleTable.toggleRowSelection(s,!0)}}catch(c){r=!0,i=c}finally{try{e||null==l.return||l.return()}finally{if(r)throw i}}})):this.$nextTick((function(){a.setParentSelect(t,!1)}))}},{key:"handleSelectionChange",value:function(e){this.multipleSelection=e}},{key:"sure",value:function(){var e=this;this.multipleSelection.length<=0?this.$message.error("请先分配资源"):(this.sureLoading=!0,b.resourceAdd({authorizationId:this.query.id,resourceIds:this.multipleSelection.map((function(e){return e.id}))}).then((function(t){t.success?(e.$message.success("分配成功"),e.$emit("close")):e.$message.error(t.message)})).finally((function(){e.sureLoading=!1})))}},{key:"findAllParent",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=_(a),n=this.findItemById(e,t,"id"),i=this.findItemById(e,n?n.parentId:"","id");return n&&(r=[i||n].concat(_(a)),i&&i.parentId)?this.findAllParent(e,i.id||"",r):r}},{key:"findItemById",value:function(e,t,a){var r=!0,n=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(r=(o=l.next()).done);r=!0){var s=o.value;if(s[a]===t)return s;if(s.children&&s.children.length>0){var c=this.findItemById(s.children,t,a);if(c)return c}}}catch(u){n=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}}},{key:"fetchDetail",value:function(){var e=this;b.resourceQuery({authorizationId:this.query.id}).then((function(t){if(t.success){var a=!0,r=!1,n=void 0;try{for(var i,o=t.data[Symbol.iterator]();!(a=(i=o.next()).done);a=!0){var l=i.value,s=e.findItemById(e.tableData,l.resourceId,"id");s&&e.$refs.multipleTable.toggleRowSelection(s,!0)}}catch(c){r=!0,n=c}finally{try{a||null==o.return||o.return()}finally{if(r)throw n}}}else e.$message.error(t.message)}))}},{key:"fetchData",value:function(e){var t=this;this.tableData=[],this.tableLoading=!0,b.resourceTree($({},e,{status:1})).then((function(e){e.success?e.data&&(t.tableData=e.data,t.fetchDetail()):t.$message.error(e.message)})).finally((function(){t.tableLoading=!1}))}}]),t}(f["d"]);d["a"]([Object(f["c"])({type:Boolean,default:!1})],P.prototype,"dialogVisible",void 0),d["a"]([Object(f["e"])("dialogVisible")],P.prototype,"dialogVisibleChange",null),d["a"]([Object(f["c"])({type:Object,default:{}})],P.prototype,"query",void 0),d["a"]([Object(f["e"])("$store.state.application.list",{immediate:!0,deep:!0})],P.prototype,"getList",null),P=d["a"]([Object(f["a"])({components:{}})],P);var D=P,A=D,I=(a("0b91"),a("330f"),a("2877")),R=Object(I["a"])(A,O,S,!1,null,"a9a3bda2",null),E=R.exports;a("52ce");function L(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function z(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?L(Object(a),!0).forEach((function(t){Object(i["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):L(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var N=function(e){function t(){var e;return Object(o["a"])(this,t),e=Object(s["a"])(this,Object(c["a"])(t).apply(this,arguments)),e.normalRule=y,e.lenRule=v,e.parseTime=k,e.searchForm={rowsOfPage:10,currentPage:1},e.submitForm={},e.total=0,e.dialogVisible=!1,e.tableData=[],e.tableLoading=!1,e.selectRow={},e.permissionDialogVisible=!1,e.assginSelected={},e.applicationOptions=[],e}return Object(u["a"])(t,e),Object(l["a"])(t,[{key:"getList",value:function(e){this.applicationOptions=e.map((function(e){return{label:e.name,value:e.serviceCode}}))}},{key:"search",value:function(){this.searchForm.currentPage=1,this.fetchData()}},{key:"resetSearch",value:function(){var e=this.searchForm,t=e.rowsOfPage,a=e.currentPage;this.searchForm={rowsOfPage:t,currentPage:a},this.fetchData()}},{key:"goAdd",value:function(){this.selectRow=void 0,this.submitForm={},this.dialogVisible=!0}},{key:"goEdit",value:function(e){this.dialogVisible=!0,this.selectRow=e,this.submitForm=z({},e)}},{key:"fetchData",value:function(){var e=this;this.tableLoading=!0,b.list(this.searchForm).then((function(t){t.success?t.data&&t.data.datas&&(e.tableData=t.data.datas,e.total=t.data.totalRows):e.$message.error(t.message)})).finally((function(){e.tableLoading=!1}))}},{key:"enable",value:function(e){var t=this;b.enable({ids:[e.id||""]}).then((function(e){e.success?(t.$message.success("启用成功"),t.fetchData()):t.$message.error(e.message)}))}},{key:"disable",value:function(e){var t=this;b.disable({ids:[e.id||""]}).then((function(e){e.success?(t.$message.success("禁用成功"),t.fetchData()):t.$message.error(e.message)}))}},{key:"goAssign",value:function(e){this.permissionDialogVisible=!0,this.assginSelected=e}},{key:"cancelAdd",value:function(){this.submitForm={},this.selectRow=void 0,this.dialogVisible=!1}},{key:"sureAdd",value:function(){var e=this;this.$refs.ruleForm.validate((function(t){if(t){var a=e.selectRow?b.edit:b.add;a(e.submitForm).then((function(t){t.success?(e.$message({type:"success",message:e.selectRow?"编辑成功":"新增成功"}),e.cancelAdd(),e.fetchData()):e.$message.error(t.message)}))}}))}},{key:"handleSizeChange",value:function(e){this.searchForm.rowsOfPage=e,this.fetchData()}},{key:"handleCurrentChange",value:function(e){this.searchForm.currentPage=e,this.fetchData()}},{key:"created",value:function(){}},{key:"mounted",value:function(){this.fetchData()}}]),t}(f["d"]);d["a"]([Object(f["e"])("$store.state.application.list",{immediate:!0,deep:!0})],N.prototype,"getList",null),N=d["a"]([Object(f["a"])({components:{assignPermission:E}})],N);var T=N,V=T,B=(a("e32f"),Object(I["a"])(V,r,n,!1,null,"7fe488d6",null));t["default"]=B.exports},fcf6:function(e,t,a){e.exports={elInputWidth:"200px",elInputNumberWidth:"200px",elTextareaWidth:"300px",elSelectWidth:"200px",appHeaderBg:"#014051",appIconBg:"#6758f3",appIconColor:"#fff",appIconSize:"30px",appNameColor:"#fff",appNameSize:"30px"}}}]); |