{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web-prod\\src\\views\\projectManagent\\modules\\dialog\\personInfoDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\src\\views\\projectManagent\\modules\\dialog\\personInfoDialog.vue","mtime":1667333351540},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\babel.config.js","mtime":1667333346259},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/xypm-web-prod/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport utils from '@/hotent-ui-util.js';\nimport uc from '@/api/uc.js';\nimport org from '@/api/org.js';\nimport sys from '@/api/portal.js';\nimport req from '@/request.js';\nimport eipOrgDialog from '@/components/dialog/EipOrgDialog.vue';\nimport eipPostDialog from '@/components/dialog/EipPostDialog.vue';\n\nvar eipRoleDialog = function eipRoleDialog() {\n return import('@/components/dialog/EipRoleDialog.vue');\n};\n\nexport default {\n name: 'userInfo',\n components: {\n eipOrgDialog: eipOrgDialog,\n eipPostDialog: eipPostDialog,\n eipRoleDialog: eipRoleDialog\n },\n props: ['userAccount', 'orgCode'],\n data: function data() {\n var _ref;\n\n return _ref = {\n dialogVisible: false,\n user: {},\n //用户信息\n account: '',\n //当前用户账号\n currentTabName: 'basic',\n orgPageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n rolePageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n orgPostList: [],\n //组织岗位\n userRoleList: []\n }, _defineProperty(_ref, \"currentTabName\", 'basic'), _defineProperty(_ref, \"userOrgPostLoaded\", false), _defineProperty(_ref, \"userRoleLoaded\", false), _defineProperty(_ref, \"pwdValidate\", {\n required: true,\n min: 6,\n max: 30\n }), _ref;\n },\n computed: {\n //保存用户\n saveUserUrl: function saveUserUrl() {\n var preUrl = window.context.uc + '/api/user/v1/user';\n\n if (this.account == this.user.account) {\n preUrl += '/updateUser';\n } else {\n preUrl += '/addUser';\n }\n\n return preUrl;\n },\n // 删除岗位\n delOrgUser: function delOrgUser() {\n return window.context.uc + '/api/org/v1/orgUser/delOrgUser';\n }\n },\n mounted: function mounted() {\n var _this2 = this;\n\n // this.account = this.userAccount\n // 是否显示用户所属组织岗位\n this.userOrgPostLoaded = false; // 是否显示用户拥有的角色\n\n this.userRoleLoaded = false; //默认密码策略\n\n uc.getDefaultPwdStrategy().then(function (data) {\n if (data) {\n var form = data; //默认初始化密码\n\n if (form.initPwd) {\n _this2.user.password = form.initPwd;\n }\n\n if (form.enable == 1) {\n var pwdRule = form.pwdRule;\n var pwdLength = form.pwdLength;\n\n if (pwdRule == 1) {\n _this2.pwdValidate = {\n required: true,\n min: pwdLength\n };\n } else {\n var regex = {};\n\n if (pwdRule == 2) {\n regex = {\n exp: '^(?=.*[0-9])(?=.*[a-zA-Z]).{' + pwdLength + ',30}$',\n message: '密码必须包含字母、数字,至少' + pwdLength + '位'\n };\n } else if (pwdRule == 3) {\n regex = {\n exp: '^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{' + pwdLength + ',30}$',\n message: '密码必须包含数字、字母、特殊字符,至少' + pwdLength + '位'\n };\n } else if (pwdRule == 4) {\n regex = {\n exp: '^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{' + pwdLength + ',30}$',\n message: '密码必须包含数字、大小写字母、特殊字符,至少' + pwdLength + '位'\n };\n }\n\n _this2.pwdValidate = {\n required: true,\n regex: regex\n };\n }\n }\n }\n });\n },\n methods: {\n addUserRole: function addUserRole(param) {\n var _this3 = this;\n\n param = param.map(function (param) {\n return param.code;\n });\n var params = {\n account: this.account,\n codes: param\n };\n uc.saveUserRoles(params).then(function () {\n _this3.$refs.userRoleTable.load();\n });\n },\n //删除角色\n deleteUserRole: function deleteUserRole(code) {\n var _this4 = this;\n\n var params = {\n account: this.account,\n codes: code\n };\n uc.delUserRole(params).then(function () {\n _this4.$refs.userRoleTable.load();\n });\n },\n //\n showEipRoleDialog: function showEipRoleDialog() {\n this.$refs.eipRoleDialog.showDialog();\n },\n //加载角色\n userRoleLoad: function userRoleLoad(param, cb) {\n var _this5 = this;\n\n uc.userRolePage(param).then(function (response) {\n if (response) {\n _this5.userRoleList = response.rows;\n _this5.rolePageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n }\n }).finally(function () {\n return cb();\n });\n },\n //打开岗位\n showEipPostDialog: function showEipPostDialog() {\n this.$refs.eipPostDialog.showDialog();\n },\n //打开添加组织进行选择\n showEipOrgDialog: function showEipOrgDialog() {\n this.$refs.eipOrgDialog.showDialog();\n },\n //删除组织岗位之后做的事\n afterDelOrgUser: function afterDelOrgUser() {\n this.$refs.orgPostTables.load();\n },\n //组织岗位\n orgPostData: function orgPostData(param, cb) {\n var _this6 = this;\n\n uc.getUserOrgPage(param).then(function (response) {\n _this6.orgPostList = response.rows.map(function (item) {\n if (item.isMaster == 0) {\n item.isMaster = 1;\n return item;\n } else {\n item.isMaster = 0;\n return item;\n }\n });\n _this6.orgPostPageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n }).finally(function () {\n return cb();\n });\n },\n //所属组织岗位 -> 选择组织\n addUserOrg: function addUserOrg(param) {\n param = param.map(function (param) {\n return param.code;\n });\n\n var _this = this;\n\n this.checkBeyondOrg(param, function (resp) {\n if (resp.beyond.length > 0) {\n var beyondOrgNames = resp.beyond.map(function (org) {\n return org.name;\n });\n\n _this.$message.error('添加失败:组织【' + beyondOrgNames.join(',') + '】超出限编');\n\n return;\n }\n\n var params = {\n account: _this.account,\n orgCode: resp.normal\n };\n uc.saveUserOrgs(params).then(function (resp) {\n _this.$refs.orgPostTables.load();\n });\n });\n },\n open: function open() {\n this.dialogVisible = true;\n this.currentTabName = 'basic';\n this.userRoleList = [];\n this.orgPostList = [];\n this.account = ''; //初始化加载用户表单\n\n this.user = {\n id: '',\n account: '',\n address: '',\n email: '',\n fullname: '',\n mobile: '',\n password: '',\n photo: '',\n sex: '',\n status: 1,\n userType: 2\n };\n },\n closeUserManager: function closeUserManager() {\n this.dialogVisible = false;\n },\n // 保存添加临时人员personnelId,同时父组件页面重新加载调用查询接口展示\n savePersonnel: function savePersonnel() {\n var _this7 = this;\n\n var param = {\n pageBean: {\n page: 1,\n pageSize: -1\n }\n };\n uc.getUsersByOrgId(param).then(function (res) {\n res.rows.forEach(function (item) {\n if (item.account == _this7.user.account) {\n var _param = {};\n _param.projectId = _this7.$route.params.id;\n _param.personnelId = item.id;\n\n _this7.$http.post('${cqxy}/biz/projectManagement/projectPersonnel/v1/save', _param).then(function (res) {\n if (res.data.state) {\n _this7.$emit('loadPersonnel');\n }\n });\n }\n });\n });\n },\n beforeSaveData: function beforeSaveData() {},\n afterSaveData: function afterSaveData() {\n var _this8 = this;\n\n // 如果初始化添加没有账号,需要走接口添加相应的所属岗位组织\n if (this.account !== this.user.account) {\n this.account = this.user.account;\n var params = {\n account: this.account,\n orgCode: 'dsf'\n }; //同时把账号存入第三方接口中\n\n this.$http.get('${cqxy}/api/org/v1/org/getOrgLimitByCodes?codes=dsf').then(function (res) {\n console.log(res);\n });\n uc.saveUserOrgs(params).then(function (resp) {\n if (resp.state) {\n _this8.savePersonnel();\n\n _this8.$refs.orgPostTables.load();\n\n _this8.$refs.userRoleTable.load();\n }\n });\n }\n },\n // 点击某个tab页签时再加载该页签的数据\n tabClick: function tabClick() {\n switch (this.currentTabName) {\n case 'orgPost':\n this.userOrgPostLoaded = true;\n break;\n\n case 'role':\n this.userRoleLoaded = true;\n break;\n }\n },\n addUserPost: function addUserPost(param) {\n var _this9 = this;\n\n param = param.map(function (param) {\n return param.code;\n });\n var params = {\n account: this.account,\n Code: param\n };\n uc.saveUserPosts(params).then(function (resp) {\n _this9.$refs.orgPostTables.load();\n });\n },\n checkBeyondOrg: function checkBeyondOrg(orgCodes, callback) {\n org.getOrgLimitByCodes(orgCodes.join(',')).then(function (resp) {\n var normalOrgCodes = [];\n var beyondOrgs = [];\n\n if (resp && resp.rows) {\n resp.rows.forEach(function (org) {\n if (org.exceedLimitNum === 1 && org.limitNum != 0) {\n if (org.limitNum > org.nowNum + 1) {\n normalOrgCodes.push(org.code);\n } else {\n beyondOrgs.push(org);\n }\n } else {\n normalOrgCodes.push(org.code);\n }\n });\n }\n\n callback({\n normal: normalOrgCodes,\n beyond: beyondOrgs\n });\n });\n },\n setMaster: function setMaster(row) {\n var _this10 = this;\n\n uc.setMasterById(row.orgUserId).then(function (resp) {\n if (resp.state) {\n _this10.$message.success(resp.message);\n\n _this10.$refs.orgPostTables.load();\n }\n });\n var flag = false;\n var orgName = ''; // this.orgPostList.forEach((item) => {\n // if (item.isMaster === 1 && row.orgId !== item.orgId) {\n // orgName = item.orgName\n // flag = true\n // }\n // })\n // if (flag) {\n // this.$confirm(\n // '该用户已设置主组织' + orgName + ',是否重新设置?',\n // '提示',\n // {\n // confirmButtonText: '确定',\n // cancelButtonText: '取消',\n // type: 'success',\n // }\n // )\n // .then(() => {\n // uc.setMasterById(row.orgUserId).then((resp) => {\n // this.$refs.orgPostTables.load()\n // })\n // })\n // .catch(() => {})\n // } else {\n // uc.setMasterById(row.orgUserId).then((resp) => {\n // this.$refs.orgPostTables.load()\n // })\n // }\n }\n }\n};",null]}