{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\UcManager\\UserManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\UcManager\\UserManager.vue","mtime":1675071993381},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 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: 'UserManager',\n  components: {\n    eipOrgDialog: eipOrgDialog,\n    eipPostDialog: eipPostDialog,\n    eipRoleDialog: eipRoleDialog\n  },\n  computed: {\n    saveUserUrl: function saveUserUrl() {\n      var preUrl = window.context.uc + '/api/user/v1/user';\n\n      if (this.account) {\n        preUrl += '/updateUser';\n      } else {\n        preUrl += '/addUser';\n      }\n\n      return preUrl;\n    },\n    delOrgUser: function delOrgUser() {\n      return window.context.uc + '/api/org/v1/orgUser/delOrgUser';\n    },\n    ElectronicSealSubmitUrl: function ElectronicSealSubmitUrl() {\n      return window.context.uc + '/uc/electronicSeal/v1/save';\n    },\n    electronicSealPicUrl: function electronicSealPicUrl() {\n      return window.context.uc + '/file/v1/preview?fileId=' + this.electronicSeal.fileId;\n    }\n  },\n  data: function data() {\n    return {\n      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      photoUrl: '/img/defaultPhoto.jpg',\n      orgPostPageResult: {\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      //用户角色,\n      userParam: {},\n      //当前用户的用户参数值\n      userParams: [],\n      //系统的所有用户参数\n      account: '',\n      isSubmit: false,\n      currentTabName: 'basic',\n      userParamLoaded: false,\n      userOrgPostLoaded: false,\n      userRoleLoaded: false,\n      pwdValidate: {\n        required: true,\n        min: 6,\n        max: 30\n      },\n      electronicSeal: {\n        fileId: '',\n        password: '',\n        picUrl: ''\n      },\n      // 签章\n      electronicSealPic: '',\n      sealPicShow: false,\n      electronicSealFormSubmit: false\n    };\n  },\n  props: ['userAccount', 'orgCode'],\n  mounted: function mounted() {\n    var _this2 = this;\n\n    this.account = this.userAccount; // 用户参数是否已加载\n\n    this.userParamLoaded = false; // 是否显示用户所属组织岗位\n\n    this.userOrgPostLoaded = false; // 是否显示用户拥有的角色\n\n    this.userRoleLoaded = false;\n\n    if (this.account) {\n      uc.getUser(this.account).then(function (resp) {\n        _this2.user = resp.user;\n\n        if (_this2.user.photo) {\n          _this2.$store.dispatch('menu/downloadImg', _this2.user.photo).then(function (res) {\n            if (res != '') {\n              _this2.photoUrl = res;\n            }\n          });\n        }\n      });\n    } //默认密码策略\n\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    phonoError: function phonoError(e) {// this.user.photo = \"/img/defaultPhoto.jpg\";\n    },\n    addOrg: function addOrg() {\n      if (!this.orgCode || !this.user.account) {\n        return false;\n      } //是否是编辑用户,是编辑用户就不要添加到组织下\n\n\n      if (this.user.id) {\n        return false;\n      }\n\n      var param = [{\n        code: this.orgCode\n      }];\n      this.account = this.user.account;\n      this.addUserOrg(param);\n    },\n    beforeSaveData: function () {\n      var _beforeSaveData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n        return regeneratorRuntime.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                if (this.photo) {\n                  this.user.photo = this.photo;\n                }\n\n                this.isSubmit = true;\n\n              case 2:\n              case \"end\":\n                return _context.stop();\n            }\n          }\n        }, _callee, this);\n      }));\n\n      function beforeSaveData() {\n        return _beforeSaveData.apply(this, arguments);\n      }\n\n      return beforeSaveData;\n    }(),\n    afterSaveData: function afterSaveData() {\n      var _this3 = this;\n\n      this.addOrg();\n      this.$confirm('操作成功，是否退出?', '提示', {\n        confirmButtonText: '退出',\n        cancelButtonText: '不退出',\n        type: 'warning'\n      }).then(function () {\n        //点击取消按钮\n        _this3.$emit('handleCloseUserManager');\n      }).catch(function () {\n        _this3.account = _this3.user.account;\n        _this3.electronicSealFormSubmit = false;\n      });\n    },\n    updateUserImage: function updateUserImage(param) {\n      var _this4 = this;\n\n      var formData = new FormData();\n      formData.append('files', param.file);\n      uc.fileUpload(formData).then(function (response) {\n        _this4.photo = response.fileId;\n        _this4.user.photo = response.fileId;\n\n        _this4.$store.dispatch('menu/downloadImg', response.fileId).then(function (res) {\n          if (res != '') {\n            _this4.photoUrl = res;\n          }\n        });\n\n        param.onSuccess(); // 上传成功的图片会显示绿色的对勾\n      }).catch(function (response) {\n        param.onError();\n      });\n    },\n    updateElectronicSeal: function updateElectronicSeal(param) {\n      var _this5 = this;\n\n      var formData = new FormData();\n      formData.append('files', param.file);\n      uc.fileUpload(formData).then(function (response) {\n        _this5.electronicSeal.fileId = response.fileId;\n\n        _this5.$store.dispatch('menu/downloadImg', response.fileId).then(function (res) {\n          if (res != '') {\n            _this5.electronicSealPic = res;\n            _this5.sealPicShow = true;\n          }\n        });\n\n        _this5.$message.success('上传成功');\n      });\n    },\n    electronicSaveData: function electronicSaveData() {\n      this.electronicSealFormSubmit = true;\n\n      if (!this.electronicSeal.fileId) {\n        this.$message.error('请上传签章！');\n        this.electronicSealFormSubmit = false;\n        return false;\n      }\n\n      if (!this.electronicSeal.password) {\n        this.$message.error('请输入密码！');\n        this.electronicSealFormSubmit = false;\n        return false;\n      } else if (this.electronicSeal.password != this.electronicSeal.confirmPwd) {\n        this.$message.error('两次输入的密码不一致，请重新输入');\n        this.electronicSealFormSubmit = false;\n        return false;\n      }\n\n      this.electronicSeal.userId = this.user.id;\n    },\n    orgPostData: function orgPostData(param, cb) {\n      var _this6 = this;\n\n      uc.getUserOrgPage(param).then(function (response) {\n        _this6.orgPostList = response.rows;\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    setMaster: function setMaster(row) {\n      var _this7 = this;\n\n      var flag = false;\n      var orgName = '';\n      this.orgPostList.forEach(function (item) {\n        if (item.isMaster === 1 && row.orgId !== item.orgId) {\n          orgName = item.orgName;\n          flag = true;\n        }\n      });\n\n      if (flag) {\n        this.$confirm('该用户已设置主组织' + orgName + '，是否重新设置？', '提示', {\n          confirmButtonText: '确定',\n          cancelButtonText: '取消',\n          type: 'success'\n        }).then(function () {\n          uc.setMasterById(row.orgUserId).then(function (resp) {\n            _this7.$refs.orgPostTables.load();\n          });\n        }).catch(function () {});\n      } else {\n        uc.setMasterById(row.orgUserId).then(function (resp) {\n          _this7.$refs.orgPostTables.load();\n        });\n      }\n    },\n    showEipOrgDialog: function showEipOrgDialog() {\n      this.$refs.eipOrgDialog.showDialog();\n    },\n    showEipPostDialog: function showEipPostDialog() {\n      this.$refs.eipPostDialog.showDialog();\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    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    addUserPost: function addUserPost(param) {\n      var _this8 = 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        _this8.$refs.orgPostTables.load();\n      });\n    },\n    getOrg: function getOrg(_param) {\n      org.getOrg(_param.orgCode).then(function (resp) {\n        if (resp.exceedLimitNum === 1 && resp.limitNum != 0) {\n          if (resp.limitNum > resp.nowNum + 1) {\n            return _param.code;\n          } else {\n            isBeyond = true;\n          }\n        } else {\n          return _param.code;\n        }\n      });\n    },\n    showEipRoleDialog: function showEipRoleDialog() {\n      this.$refs.eipRoleDialog.showDialog();\n    },\n    deleteOrgPost: function deleteOrgPost(id) {\n      var _this9 = this;\n\n      uc.delOrgUser(id).then(function () {\n        _this9.$refs.orgPostTables.load();\n      });\n    },\n    userRoleLoad: function userRoleLoad(param, cb) {\n      var _this10 = this;\n\n      uc.userRolePage(param).then(function (response) {\n        if (response) {\n          _this10.userRoleList = response.rows;\n          _this10.rolePageResult = {\n            page: response.page,\n            pageSize: response.pageSize,\n            total: response.total\n          };\n        }\n      }).finally(function () {\n        return cb();\n      });\n    },\n    deleteUserRole: function deleteUserRole(code) {\n      var _this11 = this;\n\n      var params = {\n        account: this.account,\n        codes: code\n      };\n      uc.delUserRole(params).then(function () {\n        _this11.$refs.userRoleTable.load();\n      });\n    },\n    addUserRole: function addUserRole(param) {\n      var _this12 = 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        _this12.$refs.userRoleTable.load();\n      });\n    },\n    userParamSubmit: function userParamSubmit() {\n      var _this13 = this;\n\n      var param = {\n        account: this.user.account\n      };\n      var data = [];\n\n      var _this = this;\n\n      for (var _param in this.userParam) {\n        for (var i = 0; i < _this.userParams.length; i++) {\n          if (_this.userParams[i].ctlType === 'input' && _this.userParam[_param].length > 30) {\n            this.$message({\n              type: 'warning',\n              message: '内容超出输入限制'\n            });\n            return false;\n          }\n        }\n\n        data.push({\n          alias: _param,\n          value: this.userParam[_param]\n        });\n      }\n\n      uc.saveUserParams(data, param).then(function (resp) {\n        _this13.$message({\n          message: resp.message,\n          type: 'success',\n          showClose: true\n        });\n      });\n    },\n    closeUserManager: function closeUserManager() {\n      // 调用父级方法关闭面板\n      this.$emit('closeUserManeger');\n    },\n    // 点击某个tab页签时再加载该页签的数据\n    tabClick: function tabClick() {\n      var _this14 = this;\n\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        case 'param':\n          // 获取用户参数\n          if (!this.userParamLoaded && this.account) {\n            uc.getUserParams().then(function (resp) {\n              _this14.userParamLoaded = true;\n              _this14.userParams = resp;\n              return resp;\n            }).then(function (params) {\n              if (!params || params.constructor != Array || params.length < 1) {\n                return;\n              }\n\n              uc.getUserParamsValue(_this14.account).then(function (response) {\n                if (response && response.constructor == Array) {\n                  response.forEach(function (r) {\n                    _this14.$set(_this14.userParam, r['alias'], r['value']);\n                  });\n                }\n              });\n            });\n          }\n\n          break;\n\n        case 'electronicSeal':\n          uc.getSealByUserId(this.user.id).then(function (resp) {\n            if (resp) {\n              _this14.electronicSeal = resp;\n\n              _this14.$store.dispatch('menu/downloadImg', _this14.electronicSeal.fileId).then(function (res) {\n                if (res != '') {\n                  _this14.electronicSealPic = res;\n                  _this14.sealPicShow = true;\n                }\n              });\n            }\n          });\n          break;\n      }\n    },\n    afterDelOrgUser: function afterDelOrgUser() {\n      this.$refs.orgPostTables.load();\n    },\n    beforeAvatarUpload: function beforeAvatarUpload(file) {\n      var FileExt = file.name.replace(/.+\\./, '');\n\n      if (['png'].indexOf(FileExt.toLowerCase()) === -1) {\n        this.$message({\n          type: 'warning',\n          message: '请上传后缀名为png类型的图片'\n        });\n        return false;\n      }\n    },\n    removeElectronicSealPic: function removeElectronicSealPic() {\n      var _this15 = this;\n\n      this.$http.remove('${uc}/uc/electronicSeal/v1/remove/?ids=' + this.electronicSeal.id).then(function (rep) {\n        if (rep.data.state) {\n          _this15.electronicSealPic = '';\n          _this15.sealPicShow = false;\n          Message.success('删除成功');\n        }\n      });\n    }\n  }\n};",null]}