1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a5fdd53e","chunk-bd2bf1be"],{"0122":function(e,t,a){},5859:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline"}},[t("a-row",{attrs:{gutter:10}},[t("a-col",{attrs:{md:10,sm:12}},[t("a-form-item",{staticStyle:{"margin-left":"8px"},attrs:{label:"用户账号"}},[t("a-input",{attrs:{placeholder:"请输入账号"},model:{value:e.queryParam.username,callback:function(t){e.$set(e.queryParam,"username",t)},expression:"queryParam.username"}})],1)],1),t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left",overflow:"hidden"}},[t("a-col",{attrs:{md:6,sm:24}},[t("a-button",{staticStyle:{"margin-left":"18px"},attrs:{type:"primary",icon:"search"},on:{click:e.searchQuery}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary",icon:"reload"},on:{click:e.searchReset}},[e._v("重置")])],1)],1)],1)],1)],1),t("div",{staticClass:"table-operator",staticStyle:{"margin-top":"-15px"},attrs:{md:24,sm:24}},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleAddUserDepart}},[e._v("添加已有用户")]),t("a-button",{staticStyle:{"margin-top":"16px"},attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新建用户")]),e.selectedRowKeys.length>0?t("a-dropdown",[t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"1",on:{click:e.batchDel}},[t("a-icon",{attrs:{type:"delete"}}),e._v("\n 取消关联\n ")],1)],1),t("a-button",{staticStyle:{"margin-left":"8px"}},[e._v(" 批量操作\n "),t("a-icon",{attrs:{type:"down"}})],1)],1):e._e()],1),t("div",[t("div",{staticClass:"ant-alert ant-alert-info",staticStyle:{"margin-bottom":"16px"}},[t("i",{staticClass:"anticon anticon-info-circle ant-alert-icon"}),e._v(" 已选择 "),t("a",{staticStyle:{"font-weight":"600"}},[e._v(e._s(e.selectedRowKeys.length))]),e._v("项\n "),t("a",{staticStyle:{"margin-left":"24px"},on:{click:e.onClearSelected}},[e._v("清空")])]),t("a-table",{ref:"table",attrs:{size:"middle",bordered:"",rowKey:"id",columns:e.columns,dataSource:e.dataSource,pagination:e.ipagination,loading:e.loading,rowSelection:{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange}},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"action",fn:function(a,s){return t("span",{},[t("a",{on:{click:function(t){return e.handleEdit(s)}}},[e._v("编辑")]),t("a-divider",{attrs:{type:"vertical"}}),t("a-dropdown",[t("a",{staticClass:"ant-dropdown-link"},[e._v("\n 更多 "),t("a-icon",{attrs:{type:"down"}})],1),t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",[t("a",{attrs:{href:"javascript:;"},on:{click:function(t){return e.handleDeptRole(s)}}},[e._v("分配部门角色")])]),t("a-menu-item",[t("a",{attrs:{href:"javascript:;"},on:{click:function(t){return e.handleDetail(s)}}},[e._v("用户详情")])]),t("a-menu-item",[t("a-popconfirm",{attrs:{title:"确定取消与选中部门关联吗?"},on:{confirm:function(){return e.handleDelete(s.id)}}},[t("a",[e._v("取消关联")])])],1)],1)],1)],1)}}])})],1),t("user-modal",{ref:"modalForm",on:{ok:e.modalFormOk}}),t("Select-User-Modal",{ref:"selectUserModal",on:{selectFinished:e.selectOK}}),t("dept-role-user-modal",{ref:"deptRoleUser"})],1)},n=[],i=a("b65a"),r=a("0fea"),o=a("b3c4"),l=a("418f"),c=a("8034"),d={name:"DeptUserInfo",mixins:[i["a"]],components:{DeptRoleUserModal:c["default"],SelectUserModal:o["default"],UserModal:l["default"]},data:function(){return{description:"用户信息",currentDeptId:"",columns:[{title:"用户账号",align:"center",dataIndex:"username"},{title:"用户名称",align:"center",dataIndex:"realname"},{title:"部门",align:"center",dataIndex:"orgCode"},{title:"性别",align:"center",dataIndex:"sex_dictText"},{title:"电话",align:"center",dataIndex:"phone"},{title:"操作",dataIndex:"action",scopedSlots:{customRender:"action"},align:"center",width:150}],url:{list:"/sys/user/departUserList",edit:"/sys/user/editSysDepartWithUser",delete:"/sys/user/deleteUserInDepart",deleteBatch:"/sys/user/deleteUserInDepartBatch"}}},created:function(){},methods:{searchReset:function(){this.queryParam={},this.loadData(1)},loadData:function(e){var t=this;if(this.url.list){1===e&&(this.ipagination.current=1);var a=this.getQueryParams();a.depId=this.currentDeptId,Object(r["c"])(this.url.list,a).then((function(e){e.success&&e.result&&(t.dataSource=e.result.records,t.ipagination.total=e.result.total)}))}else this.$message.error("请设置url.list属性!")},batchDel:function(){if(this.url.deleteBatch)if(this.currentDeptId)if(this.selectedRowKeys.length<=0)this.$message.warning("请选择一条记录!");else{for(var e="",t=0;t<this.selectedRowKeys.length;t++)e+=this.selectedRowKeys[t]+",";var a=this;this.$confirm({title:"确认取消",content:"是否取消用户与选中部门的关联?",onOk:function(){Object(r["a"])(a.url.deleteBatch,{depId:a.currentDeptId,userIds:e}).then((function(e){e.success?(a.$message.success("删除用户与选中部门关系成功!"),a.loadData(),a.onClearSelected()):a.$message.warning(e.message)}))}})}else this.$message.error("未选中任何部门,无法取消部门与用户的关联!");else this.$message.error("请设置url.deleteBatch属性!")},handleDelete:function(e){var t=this;if(this.url.delete)if(this.currentDeptId){var a=this;Object(r["a"])(a.url.delete,{depId:this.currentDeptId,userId:e}).then((function(s){if(s.success){if(a.$message.success("删除用户与选中部门关系成功!"),t.selectedRowKeys.length>0)for(var n=0;n<t.selectedRowKeys.length;n++)if(t.selectedRowKeys[n]==e){t.selectedRowKeys.splice(n,1);break}a.loadData()}else a.$message.warning(s.message)}))}else this.$message.error("未选中任何部门,无法取消部门与用户的关联!");else this.$message.error("请设置url.delete属性!")},open:function(e){this.currentDeptId=e.id,this.loadData(1)},clearList:function(){this.currentDeptId="",this.dataSource=[]},hasSelectDept:function(){return""!=this.currentDeptId||(this.$message.error("请选择一个部门!"),!1)},handleAddUserDepart:function(){""==this.currentDeptId?this.$message.error("请选择一个部门!"):this.$refs.selectUserModal.visible=!0},handleEdit:function(e){this.$refs.modalForm.title="编辑",this.$refs.modalForm.departDisabled=!0,this.$refs.modalForm.disableSubmit=!1,this.$refs.modalForm.edit(e)},handleAdd:function(){""==this.currentDeptId?this.$message.error("请选择一个部门!"):(this.$refs.modalForm.departDisabled=!0,this.$refs.modalForm.userDepartModel.departIdList=[this.currentDeptId],this.$refs.modalForm.add(),this.$refs.modalForm.title="新增")},selectOK:function(e){var t=this,a={};a.depId=this.currentDeptId,a.userIdList=[];for(var s=0;s<e.length;s++)a.userIdList.push(e[s]);Object(r["j"])(this.url.edit,a).then((function(e){e.success?(t.$message.success(e.message),t.loadData()):t.$message.warning(e.message)}))},handleDeptRole:function(e){""!=this.currentDeptId?(this.$refs.deptRoleUser.add(e,this.currentDeptId),this.$refs.deptRoleUser.title="部门角色分配"):this.$message.warning("请先选择一个部门!")}}},u=d,h=(a("9a64"),a("2877")),f=Object(h["a"])(u,s,n,!1,null,"2898dbec",null);t["default"]=f.exports},8034:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("a-drawer",{staticStyle:{height:"calc(100% - 55px)",overflow:"auto","padding-bottom":"53px"},attrs:{title:e.title,maskClosable:!0,width:"600",placement:"right",closable:!0,visible:e.visible},on:{close:e.close}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[e.designNameOption.length>0?t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:""}},[t("a-col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[t("a-card",{style:{marginTop:"12px",height:"auto"}},[t("a-checkbox-group",{staticStyle:{width:"100%"},on:{change:e.designNameChange},model:{value:e.designNameValue,callback:function(t){e.designNameValue=t},expression:"designNameValue"}},[t("a-row",[e._l(e.designNameOption,(function(a){return[t("a-col",{attrs:{span:6}},[t("a-checkbox",{attrs:{value:a.value}},[e._v(e._s(a.text))])],1)]}))],2)],1)],1)],1)],1)],1):t("div",[t("h3",[e._v("无可配置角色!")])])],1),t("div",{staticClass:"drawer-bootom-button"},[t("a-dropdown",{staticStyle:{float:"left"},attrs:{trigger:["click"],placement:"topCenter"}},[t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"1",on:{click:e.checkALL}},[e._v("全部勾选")]),t("a-menu-item",{key:"2",on:{click:e.cancelCheckALL}},[e._v("取消全选")])],1),t("a-button",[e._v("\n 操作 "),t("a-icon",{attrs:{type:"up"}})],1)],1),t("a-popconfirm",{attrs:{title:"确定放弃编辑?",okText:"确定",cancelText:"取消"},on:{confirm:e.close}},[t("a-button",{staticStyle:{"margin-right":".8rem"}},[e._v("取消")])],1),t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleSubmit(!0)}}},[e._v("保存")])],1)],1)},n=[],i=a("0fea"),r=a("d579");a("89f2");function o(e,t){var a="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=l(e))||t&&e&&"number"===typeof e.length){a&&(e=a);var s=0,n=function(){};return{s:n,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,r=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return r=e.done,e},e:function(e){o=!0,i=e},f:function(){try{r||null==a.return||a.return()}finally{if(o)throw i}}}}function l(e,t){if(e){if("string"===typeof e)return c(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}var d={name:"DeptRoleUserModal",components:{JEllipsis:r["default"]},data:function(){return{currentDeptId:"",title:"部门角色分配",visible:!1,model:{},labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,form:this.$form.createForm(this),validatorRules:{},url:{add:"/sys/sysDepartRole/deptRoleUserAdd",getDeptRoleList:"/sys/sysDepartRole/getDeptRoleList",getDeptRoleByUserId:"/sys/sysDepartRole/getDeptRoleByUserId"},designNameOption:[],userId:"",newRoleId:"",oldRoleId:"",designNameValue:[],desformList:[]}},created:function(){},methods:{add:function(e,t){this.userId=e.id,this.currentDeptId=t,this.loadDesformList(),this.edit({})},edit:function(e){var t=this;this.form.resetFields(),this.model=Object.assign({},e),this.visible=!0,Object(i["c"])(this.url.getDeptRoleByUserId,{userId:this.userId}).then((function(e){if(e.success){var a,s=[],n=o(e.result);try{for(n.s();!(a=n.n()).done;){var i=a.value;s.push(i.droleId)}}catch(r){n.e(r)}finally{n.f()}t.oldRoleId=s.join(","),t.designNameValue=s,t.newRoleId=s.join(",")}}))},close:function(){this.$emit("close"),this.visible=!1},handleSubmit:function(){var e=this;e.confirmLoading=!0;var t=this.url.add,a="post",s=Object.assign(this.model,{});s.userId=this.userId,s.newRoleId=this.newRoleId,s.oldRoleId=this.oldRoleId,Object(i["i"])(t,s,a).then((function(t){t.success?(e.$message.success(t.message),e.$emit("reload"),e.$emit("ok")):e.$message.warning(t.message)})).finally((function(){e.confirmLoading=!1,e.close()}))},handleCancel:function(){this.designNameOption=[],this.designNameValue=[],this.close()},designNameChange:function(e){this.newRoleId=e.join(",")},checkALL:function(){var e,t=[],a=o(this.desformList);try{for(a.s();!(e=a.n()).done;){var s=e.value;t.push(s.id)}}catch(n){a.e(n)}finally{a.f()}this.designNameValue=t,this.newRoleId=t.join(",")},cancelCheckALL:function(){this.designNameValue=[],this.newRoleId=""},loadDesformList:function(){var e=this;Object(i["c"])(this.url.getDeptRoleList,{departId:this.currentDeptId,userId:this.userId}).then((function(t){if(t.success){e.desformList=t.result;var a,s=[],n=o(e.desformList);try{for(n.s();!(a=n.n()).done;){var i=a.value;s.push({value:i.id,text:i.roleName})}}catch(r){n.e(r)}finally{n.f()}e.designNameOption=s}}))}}},u=d,h=(a("eaf5"),a("2877")),f=Object(h["a"])(u,s,n,!1,null,"518ec681",null);t["default"]=f.exports},"9a64":function(e,t,a){"use strict";a("f0f8")},a330:function(e,t,a){},a9b1:function(e,t,a){"use strict";a("0122")},b3c4:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("div",[t("a-modal",{attrs:{centered:"",title:e.title,width:1e3,visible:e.visible,cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchQuery.apply(null,arguments)}}},[t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:10}},[t("a-form-item",{attrs:{label:"用户账号"}},[t("a-input",{attrs:{placeholder:"请输入用户账号"},model:{value:e.queryParam.username,callback:function(t){e.$set(e.queryParam,"username",t)},expression:"queryParam.username"}})],1)],1),t("a-col",{attrs:{span:8}},[t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left",overflow:"hidden"}},[t("a-button",{attrs:{type:"primary",icon:"search"},on:{click:e.searchQuery}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary",icon:"reload"},on:{click:e.searchReset}},[e._v("重置")])],1)])],1)],1)],1),t("div",[t("a-table",{attrs:{size:"small",bordered:"",rowKey:"id",columns:e.columns1,dataSource:e.dataSource1,pagination:e.ipagination,loading:e.loading,scroll:{y:240},rowSelection:{selectedRowKeys:e.selectedRowKeys,onSelectAll:e.onSelectAll,onSelect:e.onSelect,onChange:e.onSelectChange}},on:{change:e.handleTableChange}})],1)])],1)},n=[],i=a("ca00"),r=a("0fea"),o={name:"SelectUserModal",data:function(){return{title:"添加已有用户",names:[],visible:!1,placement:"right",description:"",queryParam:{},columns1:[{title:"#",dataIndex:"id",key:"rowIndex",width:50,align:"center"},{title:"用户账号",align:"center",width:100,dataIndex:"name"},{title:"用户名称",align:"center",width:100,dataIndex:"realname"},{title:"电话",align:"center",width:100,dataIndex:"phone"}],columns2:[{title:"用户账号",align:"center",dataIndex:"name"},{title:"用户名称",align:"center",dataIndex:"realname"},{title:"操作",dataIndex:"action",align:"center",width:100,scopedSlots:{customRender:"action"}}],dataSource1:[],dataSource2:[],ipagination:{current:1,pageSize:10,pageSizeOptions:["10","20","30"],showTotal:function(e,t){return t[0]+"-"+t[1]+" 共"+e+"条"},showQuickJumper:!0,showSizeChanger:!0,total:0},isorter:{column:"createTime",order:"desc"},loading:!1,selectedRowKeys:[],selectedRows:[],url:{list:"/sys/user/list"}}},created:function(){this.loadData()},methods:{searchQuery:function(){this.loadData(1)},searchReset:function(){this.queryParam={},this.loadData(1)},handleCancel:function(){this.visible=!1},handleOk:function(){this.dataSource2=this.selectedRowKeys,this.$emit("selectFinished",this.dataSource2),this.visible=!1},add:function(){this.visible=!0},loadData:function(e){var t=this;1===e&&(this.ipagination.current=1);var a=this.getQueryParams();Object(r["c"])(this.url.list,a).then((function(e){e.success&&(t.dataSource1=e.result.records,t.ipagination.total=e.result.total)}))},getQueryParams:function(){var e=Object.assign({},this.queryParam,this.isorter);return e.field=this.getQueryField(),e.pageNo=this.ipagination.current,e.pageSize=this.ipagination.pageSize,Object(i["d"])(e)},getQueryField:function(){},onSelectAll:function(e,t,a){if(!0===e)for(var s=0;s<a.length;s++)this.dataSource2.push(a[s]);else for(var n=0;n<a.length;n++)this.dataSource2.splice(this.dataSource2.indexOf(a[n]),1)},onSelect:function(e,t){if(!0===t)this.dataSource2.push(e);else{var a=this.dataSource2.indexOf(e);a>=0&&this.dataSource2.splice(this.dataSource2.indexOf(e),1)}},onSelectChange:function(e,t){this.selectedRowKeys=e,this.selectionRows=t},onClearSelected:function(){this.selectedRowKeys=[],this.selectionRows=[]},handleDelete:function(e){this.dataSource2.splice(this.dataSource2.indexOf(e),1)},handleTableChange:function(e,t,a){Object.keys(a).length>0&&(this.isorter.column=a.field,this.isorter.order="ascend"==a.order?"asc":"desc"),this.ipagination=e,this.loadData()}}},l=o,c=(a("a9b1"),a("2877")),d=Object(c["a"])(l,s,n,!1,null,"7f4b5f3d",null);t["default"]=d.exports},d579:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("a-tooltip",{attrs:{placement:"topLeft"}},[t("template",{slot:"title"},[t("span",[e._v(e._s(e.value))])]),e._v("\n "+e._s(e._f("ellipsis")(e.value,e.length))+"\n")],2)},n=[],i={name:"JEllipsis",props:{value:{type:String,required:!1},length:{type:Number,required:!1,default:25}}},r=i,o=a("2877"),l=Object(o["a"])(r,s,n,!1,null,"4de15389",null);t["default"]=l.exports},eaf5:function(e,t,a){"use strict";a("a330")},f0f8:function(e,t,a){}}]);
|