(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4d143c47"],{"110b":function(e,t,s){"use strict";s("8ead")},"1d66":function(e,t,s){},"2feb":function(e,t,s){"use strict";s("c6cf1")},"337f":function(e,t,s){"use strict";s("a5c1")},"5aea":function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"question-bank"},[t("div",{staticClass:"main"},[t("div",{staticClass:"main-left"},[e._m(0),t("a-menu",{attrs:{mode:"inline"},model:{value:e.current,callback:function(t){e.current=t},expression:"current"}},[t("a-menu-item",{key:"UserManage"},[e._v("用户管理")]),t("a-menu-item",{key:"RoleManage"},[e._v("角色管理")])],1)],1),t("div",{staticClass:"main-right"},[t(e.currentTabComponent,{tag:"component",attrs:{bookObj:e.bookObj}})],1)])])},i=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"top-left"},[t("span",{staticClass:"subject-title only-line-1"},[e._v("系统管理类别")])])}],n=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"top-box flex-align"},[t("div",[t("a-button",{staticStyle:{"margin-right":"24px"},attrs:{type:"primary"},on:{click:function(t){return e.showModal("add")}}},[e._v("创建用户")]),t("a-button",{attrs:{type:"primary"},on:{click:e._UserDeleteList}},[e._v("删除")])],1),t("a-input-search",{staticStyle:{width:"400px"},attrs:{placeholder:"搜索用户","enter-button":""},on:{search:e.onSearch}})],1),t("a-table",{attrs:{rowSelection:{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange},columns:e.columns,loading:e.loading,dataSource:e.data,size:"small",rowKey:e=>e.id,pagination:e.pagination},on:{change:e.handleChange},scopedSlots:e._u([{key:"userDisciplines",fn:function(s){return[s.length>0?[e._v(e._s(e.subjectText(s)))]:[t("span",{style:{color:"#ffe58f"}},[e._v("未分配")])]]}},{key:"displayNames",fn:function(t){return[e._v(" "+e._s(t.length>0?t.join(","):"普通用户")+" ")]}},{key:"isActive",fn:function(s){return[t("span",{style:{color:s?"green":"red"}},[e._v(e._s(s?"已启用":"已禁用"))])]}},{key:"action",fn:function(s,a){return[t("a",{staticClass:"m-r8",on:{click:function(t){return e._AssignRoles(a)}}},[e._v("分配角色")]),t("a",{staticClass:"m-r8",on:{click:function(t){return e._UserDiscipline(a)}}},[e._v("分配学科")]),t("a",{staticClass:"m-r8",on:{click:function(t){return e.showModal("edit",a)}}},[e._v("修改")]),a.isActive?e._e():t("a",{staticClass:"m-r8",on:{click:function(t){return e._UserActivate(a,!0)}}},[e._v("启用")]),a.isActive?t("a",{staticClass:"m-r8",on:{click:function(t){return e._UserActivate(a,!1)}}},[e._v("禁用")]):e._e(),t("a",{staticClass:"m-r8",on:{click:function(t){return e._resetPwd(a)}}},[e._v("重置密码")]),t("a",{staticClass:"m-r8",on:{click:function(t){return e._UserDelete(a)}}},[e._v("删除")])]}}])}),t("EditUser",{ref:"EditUser"}),t("ResetPwd",{ref:"ResetPwd"}),t("UserDiscipline",{ref:"UserDiscipline"}),t("AssignRoles",{ref:"AssignRoles"})],1)},o=[],r=(s("14d9"),s("d58c")),l=function(){var e=this,t=e._self._c;return t("div",[t("a-modal",{attrs:{visible:e.visible,confirmLoading:e.confirmLoading,width:"700px",maskClosable:!1,destroyOnClose:!0,width:900},on:{ok:e.handOK,cancel:function(t){e.visible=!1}}},[t("div",{attrs:{slot:"title"},slot:"title"},[e._v(" "+e._s("add"===e.type?"创建":"编辑")+"用户 ")]),t("div",{staticClass:"modal-box"},[t("a-form",{attrs:{form:e.form,layout:"horizontal"},on:{submit:e.handOK}},[t("a-form-item",{attrs:{label:"用户名:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["userName",{rules:[{required:!0,message:"此项为必填!"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/,message:"字母开头,允许5-16字符,允许字母数字下划线!"}],initialValue:e.record.userName}],expression:"[\n 'userName',\n {rules: [{ required: true, message: '此项为必填!' },\n { pattern: /^[a-zA-Z][a-zA-Z0-9_]{4,15}$/, message: '字母开头,允许5-16字符,允许字母数字下划线!' },],\n initialValue:record.userName\n }, \n ]"}],attrs:{placeholder:"请输入"}})],1),t("a-form-item",{attrs:{label:"姓","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["surname",{rules:[{required:!0,message:"此项为必填!"},{pattern:/^[A-Za-z\u4E00-\u9FFF]+$/,message:"只能为中英文!"}],initialValue:e.record.surname}],expression:"[\n 'surname',\n {rules: [{ required: true, message: '此项为必填!' },\n { pattern: /^[A-Za-z\\u4E00-\\u9FFF]+$/, message: '只能为中英文!' },\n ],initialValue:record.surname}\n ]"}],attrs:{placeholder:"请输入"}})],1),t("a-form-item",{attrs:{label:"名:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"此项为必填!"},{pattern:/^[A-Za-z\u4E00-\u9FFF]+$/,message:"只能为中英文!"}],initialValue:e.record.name}],expression:"[\n 'name',\n {rules: [{ required: true, message: '此项为必填!' },\n { pattern: /^[A-Za-z\\u4E00-\\u9FFF]+$/, message: '只能为中英文!' },\n ],initialValue:record.name}\n ]"}],attrs:{placeholder:"请输入"}})],1),t("a-form-item",{attrs:{label:"手机号码:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["phoneNumber",{rules:[{required:!0,message:"此项为必填!"},{pattern:/^1[3456789]\d{9}$/,message:"手机号码不正确!"}],initialValue:e.record.phoneNumber}],expression:"[\n 'phoneNumber',\n {rules: [{ required: true, message: '此项为必填!' },\n { pattern: /^1[3456789]\\d{9}$/, message: '手机号码不正确!' },\n ],\n initialValue:record.phoneNumber}\n ]"}]})],1),t("a-form-item",{attrs:{label:"邮箱地址:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["emailAddress",{rules:[{pattern:/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/,message:"邮箱格式不正确!"}],initialValue:e.record.emailAddress}],expression:"[\n 'emailAddress',\n {rules: [\n { pattern: /^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/, message: '邮箱格式不正确!' },\n ],\n initialValue:record.emailAddress}\n ]"}]})],1),t("a-form-item",{attrs:{label:"是否启用:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["isActive",{initialValue:e.record.isActive||!1}],expression:"[\n 'isActive',\n {initialValue:record.isActive||false}\n ]"}]},[t("a-radio",{attrs:{value:!0}},[e._v("是")]),t("a-radio",{attrs:{value:!1}},[e._v("否")])],1)],1),"add"===e.type?t("a-form-item",{attrs:{label:"密码:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,message:"此项为必填!"},{pattern:/^(?=^.{8,}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s)[0-9a-zA-Z!@#$%^&*()]*$/,message:"密码须包含大小写和数字!"}]}],expression:"[\n 'password',\n {rules: [{ required: true, message: '此项为必填!' },\n { pattern: /^(?=^.{8,}$)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s)[0-9a-zA-Z!@#$%^&*()]*$/, message: '密码须包含大小写和数字!' },\n ],}\n ]"}]})],1):e._e()],1)],1)])],1)},c=[],d=s("ceb0"),u=s("4ec3"),m={components:{Editor:d["a"]},data(){return{confirmLoading:!1,visible:!1,form:this.$form.createForm(this),type:"",record:{},detail:""}},mounted(){},methods:{showModal(e,t){console.log(e,"type"),console.log(t,"record"),this.visible=!0,this.type=e,this.record=t},handOK(e){e.preventDefault(),this.form.validateFields((e,t)=>{if(!e&&(console.log(t),"add"==this.type&&(this.confirmLoading=!0,Object(u["Ub"])(t).then(e=>{this.$message.success("创建成功!"),this.$parent._UserGetAll(),this.confirmLoading=!1,this.visible=!1}).catch(e=>{this.confirmLoading=!1})),"edit"==this.type)){console.log("修改了"),this.confirmLoading=!0;let e={id:this.record.id,...t};Object(u["ec"])(e).then(e=>{this.$message.success("更新成功!"),this.$parent._UserGetAll(),this.confirmLoading=!1,this.visible=!1}).catch(e=>{this.confirmLoading=!1})}})},classChange(e){console.log(e,"value")},filterOption(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0}}},h=m,p=(s("b215"),s("2877")),f=Object(p["a"])(h,l,c,!1,null,"e39f828c",null),g=f.exports,b=function(){var e=this,t=e._self._c;return t("div",[t("a-modal",{attrs:{visible:e.visible,confirmLoading:e.confirmLoading,width:"700px",maskClosable:!1,destroyOnClose:!0,width:900},on:{ok:e.handOK,cancel:function(t){e.visible=!1}}},[t("div",{attrs:{slot:"title"},slot:"title"},[e._v(" "+e._s("add"===e.type?"创建":"编辑")+"用户 ")]),t("div",{staticClass:"modal-box"},[t("a-form",{attrs:{form:e.form,layout:"horizontal"},on:{submit:e.handOK}},[t("a-form-item",{attrs:{label:"管理员密码:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["adminPassword",{rules:[{required:!0,message:"此项为必填!"}]}],expression:"[\n 'adminPassword',\n {rules: [{ required: true, message: '此项为必填!' },\n ],}\n ]"}]})],1),t("a-form-item",{attrs:{label:"新密码:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["newPassword",{rules:[{required:!0,message:"此项为必填!"},{pattern:/^(?=^.{8,}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s)[0-9a-zA-Z!@#$%^&*()]*$/,message:"密码须需包含大小写和数字,且大于八位数字!"}]}],expression:"[\n 'newPassword',\n {rules: [{ required: true, message: '此项为必填!' },\n { pattern: /^(?=^.{8,}$)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s)[0-9a-zA-Z!@#$%^&*()]*$/, message: '密码须需包含大小写和数字,且大于八位数字!' },\n ],}\n ]"}]})],1)],1)],1)])],1)},v=[],y={data(){return{confirmLoading:!1,visible:!1,form:this.$form.createForm(this),type:"",record:{},detail:""}},mounted(){},methods:{showModal(e){console.log(e,"record"),this.visible=!0,this.record=e},handOK(e){e.preventDefault(),this.form.validateFields((e,t)=>{if(!e){this.confirmLoading=!0,console.log(t);let e={userId:this.record.id,...t};Object(u["cc"])(e).then(e=>{this.$message.success("重置成功!"),this.confirmLoading=!1,this.visible=!1}).catch(e=>{this.confirmLoading=!1})}})}}},w=y,_=(s("66f8"),Object(p["a"])(w,b,v,!1,null,"1aa5b8fe",null)),k=_.exports,x=function(){var e=this,t=e._self._c;return t("div",[t("a-modal",{attrs:{visible:e.visible,confirmLoading:e.confirmLoading,width:"700px",maskClosable:!1,destroyOnClose:!0,width:900},on:{ok:e.handOK,cancel:e.handleCancle}},[t("div",{attrs:{slot:"title"},slot:"title"},[e._v(" 分配学科 ")]),t("div",{staticClass:"modal-box"},[t("a-form",{attrs:{form:e.form,layout:"horizontal"},on:{submit:e.handOK}},[t("a-form-item",{attrs:{label:"学科:","label-col":{span:3},"wrapper-col":{span:20}}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["disciplineList",{rules:[{required:!0,message:"此项为必填!"}],initialValue:e.selectedKeys}],expression:"[\n 'disciplineList',\n {rules: [{ required: true, message: '此项为必填!' },\n ],initialValue:selectedKeys}\n ]"}],attrs:{mode:"multiple",placeholder:"请选择"}},e._l(e.$store.state.baseInfo.SubjectsGroup,(function(s,a){return t("a-select-opt-group",{key:a},[t("span",{attrs:{slot:"label"},slot:"label"},[e._v(e._s(a))]),e._l(s,(function(s){return t("a-select-option",{key:s.id,attrs:{value:s.id}},[e._v(" "+e._s(s.name)+" ")])}))],2)})),1)],1)],1)],1)])],1)},A=[],C={data(){return{confirmLoading:!1,visible:!1,form:this.$form.createForm(this),selectedKeys:[],type:"",record:{},detail:""}},mounted(){},methods:{showModal(e){console.log(e,"record"),console.log(this.$store.state.baseInfo.SubjectsGroup,"6666"),this.visible=!0,this.record=e,this.record.userDisciplines.forEach(e=>{this.selectedKeys.push(e.disciplineId)})},handOK(e){e.preventDefault(),this.form.validateFields((e,t)=>{if(!e){this.confirmLoading=!0,console.log(t);let e={userId:this.record.id};Object(u["Zb"])(t,e).then(e=>{this.$message.success("分配成功!"),this.$parent._UserGetAll(),this.confirmLoading=!1,this.visible=!1}).catch(e=>{this.confirmLoading=!1})}})},handleCancle(){this.visible=!1,this.selectedKeys=[]}}},$=C,O=(s("2feb"),Object(p["a"])($,x,A,!1,null,"88ce3894",null)),N=O.exports,R=function(){var e=this,t=e._self._c;return t("div",[t("a-modal",{attrs:{visible:e.visible,confirmLoading:e.confirmLoading,okText:"确认",cancelText:"取消",maskClosable:!1,destroyOnClose:!0,width:"500px"},on:{ok:e.handOK,cancel:e.closeBtn}},[t("span",{attrs:{slot:"title"},slot:"title"},[e._v(" 分配角色 ")]),t("a-form",{attrs:{form:e.form,layout:"horizontal"},on:{submit:e.handOK}},[t("a-form-item",{attrs:{label:"用户姓名:","label-col":{span:4},"wrapper-col":{span:20}}},[e._v(" "+e._s(e.record.fullName)+" ")]),t("a-form-item",{attrs:{label:"手机号码:","label-col":{span:4},"wrapper-col":{span:20}}},[e._v(" "+e._s(e.record.phoneNumber)+" ")]),t("a-form-item",{attrs:{label:"学科:","label-col":{span:4},"wrapper-col":{span:20}}},[e._v(" "+e._s(e.subjectText(e.record.userDisciplines))+" ")]),t("a-form-item",{attrs:{label:"拥有角色:","label-col":{span:4},"wrapper-col":{span:20}}},[t("a-checkbox-group",{attrs:{options:e.plainOptions},on:{change:e.onChange},model:{value:e.checkedList,callback:function(t){e.checkedList=t},expression:"checkedList"}})],1)],1)],1)],1)},L=[],S={data(){return{visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{},plainOptions:[],checkedList:[]}},computed:{subjectText(){return e=>{let t="",s=[];return e&&e.length>0&&null!=e?(e.forEach(e=>{s.push(e.educationCategory+e.discipline)}),t=s.toString(),t):""}}},mounted(){this._RoleGetAll()},methods:{_RoleGetAll(){let e={KeyWord:"",SkipCount:0,MaxResultCount:99999};Object(u["zb"])(e).then(e=>{console.log(e,"角色列表"),e.items.forEach(e=>{e.label=e.displayName,e.value=e.normalizedName}),this.plainOptions=e.items})},showModal(e){console.log(e,"record"),this.visible=!0,this.record=e,this.checkedList=e.roleNames},closeBtn(){this.checkedList=[],this.visible=!1},handOK(e){var t=this;e.preventDefault(),this.form.validateFields((e,s)=>{if(!e){this.confirmLoading=!0;let e=[];this.checkedList.forEach(t=>{this.plainOptions.forEach(s=>{t==s.normalizedName&&e.push(s.name)})}),console.log(e,"params"),Object(u["dc"])(e,{userId:t.record.id}).then(e=>{t.$message.success("重置成功!"),t.closeBtn(),t.$parent._UserGetAll(),this.confirmLoading=!1}).catch(e=>{this.confirmLoading=!1})}})},onChange(e){console.log(e)}},beforeDestroy(){}},K=S,z=(s("b05a"),Object(p["a"])(K,R,L,!1,null,"5a37af02",null)),j=z.exports;const D=[{title:"名称",dataIndex:"fullName",key:"fullName",scopedSlots:{customRender:"fullName"},ellipsis:!0,width:100},{title:"用户名",dataIndex:"userName",key:"userName",scopedSlots:{customRender:"userName"},ellipsis:!0,width:100},{title:"手机号码",dataIndex:"phoneNumber",key:"phoneNumber",scopedSlots:{customRender:"phoneNumber"},ellipsis:!0,width:80},{title:"学科",dataIndex:"userDisciplines",key:"userDisciplines",scopedSlots:{customRender:"userDisciplines"},ellipsis:!0,width:100},{title:"所属角色",dataIndex:"displayNames",key:"displayNames",scopedSlots:{customRender:"displayNames"},ellipsis:!0,width:100},{title:"状态",dataIndex:"isActive",key:"isActive",scopedSlots:{customRender:"isActive"},ellipsis:!0,width:60},{title:"操作",key:"action",dataIndex:"action",scopedSlots:{customRender:"action"},width:160}];var U={mixins:[r["a"]],components:{EditUser:g,ResetPwd:k,UserDiscipline:N,AssignRoles:j},data(){return{columns:D,loading:!1,data:[],selectedRowKeys:[],KeyWord:"",IsActive:""}},computed:{subjectText(){return e=>{let t="",s=[];return e.forEach(e=>{s.push(e.educationCategory+e.discipline)}),t=s.toString(),t}}},mounted(){this._UserGetAll()},methods:{_AssignRoles(e){this.$refs.AssignRoles.showModal(e)},_UserDiscipline(e){this.$refs.UserDiscipline.showModal(e)},_resetPwd(e){console.log(e,"record666"),this.$refs.ResetPwd.showModal(e)},_UserDeleteList(){if(console.log(this.selectedRowKeys,"selectedRowKeys"),0==this.selectedRowKeys.length)return void this.$message.error("请选择需要删除的用户");let e=this;this.$confirm({mask:!1,okText:"确认",cancelText:"取消",title:`您确认要删除"${e.selectedRowKeys.length}"位用户吗?`,onOk(){e.loading=!0;let t={userIdList:e.selectedRowKeys};Object(u["Wb"])(t).then(t=>{e.$message.success("删除成功!"),e._UserGetAll()}).catch(t=>{e.loading=!1})}})},_UserDelete(e){let t=this;this.$confirm({mask:!1,okText:"确认",cancelText:"取消",title:`您确认要删除"${e.fullName}"用户吗?`,onOk(){t.loading=!0;let s={id:e.id};Object(u["Vb"])(s).then(e=>{t.$message.success("删除成功!"),t._UserGetAll()}).catch(e=>{t.loading=!1})}})},_UserActivate(e,t){console.log(e,"record");let s={userId:e.id,isActive:t};Object(u["Sb"])(s).then(e=>{this.$message.success("操作成功!"),this._UserGetAll()})},getStr(e,t){let s="";return e.forEach(e=>{s=s+e[t]+" "}),s},_UserGetAll(){this.loading=!0;let e={IsActive:this.IsActive,KeyWord:this.KeyWord,SkipCount:(this.pagination.current-1)*this.pagination.pageSize,MaxResultCount:this.pagination.pageSize};Object(u["Yb"])(e).then(e=>{console.log(e,"用户列表"),this.data=e.items,this.pagination.total=e.totalCount,this.loading=!1}).catch(e=>{this.loading=!1})},showModal(e,t={}){this.$refs.EditUser.showModal(e,t)},onSearch(e){this.KeyWord=e;const t={...this.pagination};t.current=1,this.pagination=t,this._UserGetAll()},onSelectChange(e){this.selectedRowKeys=e},handleChange(e,t,s){const a={...this.pagination};a.current=e.current,this.pagination=a,this._UserGetAll()}}},G=U,M=(s("6cf8"),Object(p["a"])(G,n,o,!1,null,"f40b1d54",null)),F=M.exports,I=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"top-box flex-align"},[t("div",[t("a-button",{staticStyle:{"margin-right":"24px"},attrs:{type:"primary"},on:{click:function(t){return e.showModal("add")}}},[e._v("创建角色")])],1),t("a-input-search",{staticStyle:{width:"400px"},attrs:{placeholder:"搜索角色","enter-button":""},on:{search:e.onSearch}})],1),t("a-table",{attrs:{columns:e.columns,loading:e.loading,dataSource:e.data,size:"small",rowKey:e=>e.id,pagination:e.pagination},on:{change:e.handleChange},scopedSlots:e._u([{key:"action",fn:function(s,a){return[t("a",{staticClass:"m-r8",on:{click:function(t){return e.showModal("edit",a)}}},[e._v("修改")]),t("a",{staticClass:"m-r8",on:{click:function(t){return e._RoleDelete(a)}}},[e._v("删除")])]}}])}),t("EditRole",{ref:"EditRole"})],1)},q=[],E=function(){var e=this,t=e._self._c;return t("div",[t("a-modal",{attrs:{title:"编辑角色",centered:"",visible:e.visible,confirmLoading:e.confirmLoading,width:"700px",okText:"确认",cancelText:"取消",maskClosable:!1,destroyOnClose:!0},on:{ok:e.handOK,cancel:e.closeBtn}},[t("a-tabs",{staticStyle:{height:"500px","overflow-y":"auto","overflow-x":"hidden"},attrs:{"default-active-key":"1"}},[t("a-tab-pane",{key:"1",attrs:{tab:"角色详情"}},[t("a-form",{attrs:{form:e.form,layout:"horizontal","label-col":{span:5},"wrapper-col":{span:18}}},[t("a-form-item",{attrs:{label:"名称:","label-col":{span:4},"wrapper-col":{span:20}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{initialValue:e.editData.name,rules:[{required:!0,message:"此项为必填!"},{max:32,message:"最大长度不能超过32个字符"}]}],expression:"[\n 'name',\n {\n initialValue:editData.name,\n rules: [{ required: true, message: '此项为必填!' },{max:32,message: '最大长度不能超过32个字符'}],\n },\n ]"}],attrs:{placeholder:"请输入"}})],1),t("a-form-item",{attrs:{label:"显示名称:","label-col":{span:4},"wrapper-col":{span:20}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["displayName",{initialValue:e.editData.displayName,rules:[{required:!0,message:"此项为必填!"},{max:64,message:"最大长度不能超过64个字符"}]}],expression:"[\n 'displayName',\n {\n initialValue:editData.displayName,\n rules: [{ required: true, message: '此项为必填!' },{max:64,message: '最大长度不能超过64个字符'}],\n },\n ]"}],attrs:{placeholder:"请输入"}})],1),t("a-form-item",{attrs:{label:"描述:","label-col":{span:4},"wrapper-col":{span:20}}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["description",{initialValue:e.editData.description}],expression:"[\n 'description',\n {\n initialValue:editData.description\n }\n ]"}],attrs:{placeholder:"请输入",autoSize:{minRows:5}}})],1)],1)],1),t("a-tab-pane",{key:"2",attrs:{tab:"角色权限"}},[t("a-tree",{attrs:{checkable:"","tree-data":e.$parent.permissions,"default-checked-keys":e.defaultArr,"replace-fields":e.replaceFields},on:{check:e.onCheck}})],1)],1)],1)],1)},V=[],T=s("b893"),P={data(){return{defaultArr:[],type:"",editData:{},loading:!1,visible:!1,form:this.$form.createForm(this),confirmLoading:!1,checkedKeys:[],replaceFields:{name:"displayName",title:"displayName",key:"name"}}},mounted(){},methods:{showModal(e,t){console.log(e,"type"),this.type=e,this.editData=t,this.defaultArr=t.grantedPermissions?t.grantedPermissions:[],this.checkedKeys=t.grantedPermissions?t.grantedPermissions:[],this.visible=!0},closeBtn(){this.confirmLoading=!1,this.checkedKeys=[],this.visible=!1},handOK(e){e.preventDefault(),this.form.validateFields((e,t)=>{if(e&&this.$message.error("请完善相关信息!"),!e){if(0==this.checkedKeys.length)return void this.$message.error("请配置角色权限!");this.confirmLoading=!0;let e={name:Object(T["k"])(t.name),displayName:Object(T["k"])(t.displayName),normalizedName:Object(T["k"])(t.normalizedName),grantedPermissions:this.checkedKeys||[]};console.log(e,"params"),"add"===this.type&&Object(u["xb"])(e).then(e=>{this.$parent._RoleGetAll(),this.$message.success("添加成功"),this.closeBtn()}).catch(e=>{this.confirmLoading=!1}),"edit"===this.type&&(e.id=this.editData.id,Object(u["Cb"])(e).then(e=>{this.$parent._RoleGetAll(),this.$message.success("修改成功"),this.closeBtn()}).catch(e=>{this.confirmLoading=!1}))}})},onCheck(e,t){this.checkedKeys=e}},beforeDestroy(){}},Z=P,W=Object(p["a"])(Z,E,V,!1,null,"9d700fea",null),B=W.exports;const J=[{title:"角色名称",dataIndex:"name",key:"name",scopedSlots:{customRender:"name"},ellipsis:!0,width:180},{title:"显示名称",dataIndex:"displayName",key:"displayName",scopedSlots:{customRender:"displayName"},ellipsis:!0,width:100},{title:"操作",key:"action",dataIndex:"action",scopedSlots:{customRender:"action"},width:160}];var Q={mixins:[r["a"]],components:{EditRole:B},data(){return{columns:J,loading:!1,data:[],selectedRowKeys:[],KeyWord:"",IsActive:"",permissions:[]}},mounted(){this.$store.dispatch("GetQuestionTypeList"),this._RoleGetAll(),this._RoleGetAllPermissions()},methods:{_RoleDelete(e){let t=this;this.$confirm({okText:"确认",cancelText:"取消",mask:!1,title:`您确认要删除"${e.name}"角色吗?`,onOk(){let s={Id:e.id};console.log(s),Object(u["yb"])(s).then(e=>{t.$message.success("删除成功!"),t._RoleGetAll()})}})},_RoleGetAllPermissions(){Object(u["Ab"])().then(e=>{console.log(e,"所有权限"),this.permissions=e.items})},getStr(e,t){let s="";return e.forEach(e=>{s=s+e[t]+" "}),s},_RoleGetAll(){this.loading=!0;let e={KeyWord:this.KeyWord,SkipCount:(this.pagination.current-1)*this.pagination.pageSize,MaxResultCount:this.pagination.pageSize};Object(u["zb"])(e).then(e=>{console.log(e,"角色列表"),this.data=e.items,this.pagination.total=e.totalCount,this.loading=!1}).catch(e=>{this.loading=!1})},showModal(e,t={}){this.$refs.EditRole.showModal(e,t)},onSearch(e){this.KeyWord=e;const t={...this.pagination};t.current=1,this.pagination=t,this._RoleGetAll()},onSelectChange(e){this.selectedRowKeys=e},handleChange(e,t,s){const a={...this.pagination};a.current=e.current,this.pagination=a,this._RoleGetAll()}}},Y=Q,H=(s("337f"),Object(p["a"])(Y,I,q,!1,null,"0e046f48",null)),X=H.exports,ee={components:{UserManage:F,RoleManage:X},data(){return{current:["UserManage"],currentTabComponent:"UserManage",bookObj:{}}},watch:{current(e){console.log(e,"nval"),this.currentTabComponent=e[0]}},methods:{}},te=ee,se=(s("110b"),Object(p["a"])(te,a,i,!1,null,"40fa513f",null));t["default"]=se.exports},"63a7":function(e,t,s){},"66f8":function(e,t,s){"use strict";s("1d66")},"6cf8":function(e,t,s){"use strict";s("dbdb")},"6ffc":function(e,t,s){},"8ead":function(e,t,s){},a5c1:function(e,t,s){},b05a:function(e,t,s){"use strict";s("63a7")},b215:function(e,t,s){"use strict";s("6ffc")},c6cf1:function(e,t,s){},d58c:function(e,t,s){"use strict";s.d(t,"a",(function(){return a}));const a={data(){return{pagination:{current:1,total:0,defaultPageSize:15,pageSize:15,showTotal:e=>`共 ${e} 条数据`,showSizeChanger:!0,pageSizeOptions:["15","20","30","50","100"],onShowSizeChange:(e,t)=>{console.log(e,t),this.pagination.pageSize=t,this.pagination.current=e}}}},methods:{TableChange(e){const t={...this.pagination};t.current=e.current,this.pagination=t}}}},dbdb:function(e,t,s){}}]); //# sourceMappingURL=chunk-4d143c47.46a4c6ab.js.map