{"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\\RoleManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\RoleManager.vue","mtime":1675071993366},{"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/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.array.from\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.string.ends-with\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/es6.function.name\";\n\nvar _methods;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 uc from \"@/api/uc.js\";\nimport utils from \"@/hotent-ui-util.js\";\nimport req from \"@/request.js\";\nimport eipUserDialog from \"@/components/dialog/EipUserDialog.vue\";\n\nvar userRoleManager = function userRoleManager() {\n  return import(\"@/views/uc/UserRoleManager.vue\");\n};\n\nvar roleMenuAuth = function roleMenuAuth() {\n  return import(\"@/views/uc/RoleMenuAuth.vue\");\n};\n\nvar roleMethodAuth = function roleMethodAuth() {\n  return import(\"@/views/uc/RoleMethodAuth.vue\");\n};\n\nexport default {\n  components: {\n    eipUserDialog: eipUserDialog,\n    userRoleManager: userRoleManager,\n    roleMenuAuth: roleMenuAuth,\n    roleMethodAuth: roleMethodAuth\n  },\n  computed: {\n    roleDeleteUrl: function roleDeleteUrl() {\n      return window.context.uc + \"/api/role/v1/role/deleteRoleByIds\";\n    },\n    saveRoleUrl: function saveRoleUrl() {\n      var preUrl = window.context.uc + \"/api/role/v1/role\";\n\n      if (this.role.id) {\n        preUrl += \"/updateRole\";\n      } else {\n        preUrl += \"/addRole\";\n      }\n\n      return preUrl;\n    },\n    requestMethod: function requestMethod() {\n      return this.role.id ? \"PUT\" : \"POST\";\n    },\n    roleCodesOptions: function roleCodesOptions() {\n      var result = [];\n\n      var _iterator = _createForOfIteratorHelper(this.allowRoles),\n          _step;\n\n      try {\n        for (_iterator.s(); !(_step = _iterator.n()).done;) {\n          var role = _step.value;\n          var obj = {};\n          obj.key = role.code;\n          obj.value = role.name;\n          result.push(obj);\n        }\n      } catch (err) {\n        _iterator.e(err);\n      } finally {\n        _iterator.f();\n      }\n\n      return result;\n    },\n    saveRoleCopy: function saveRoleCopy() {\n      return \"\".concat(window.context.portal, \"/sys/sysRoleAuth/v1/saveCopy?oldCode=\").concat(this.menuPerm.code, \"&newCodes=\").concat(this.menuPerm.newCodes);\n    },\n    importUrl: function importUrl() {\n      return window.context.uc + \"/api/role/v1/roles/import\";\n    },\n    uploadHeaders: function uploadHeaders(mapState) {\n      return {\n        Authorization: 'Bearer ' + this.$store.state.login.currentUser.token\n      };\n    }\n  },\n  data: function data() {\n    return {\n      dialogVisible: false,\n      dialogVisibleMenuPerm: false,\n      dialogImportVisible: false,\n      fullscreenLoading: false,\n      role: {\n        name: \"\",\n        code: \"\",\n        enabled: 1,\n        roleType: 2\n      },\n      isSubmit: false,\n      data: [],\n      pageResult: {\n        page: 1,\n        pageSize: 50,\n        total: 0\n      },\n      loadDataUrl: \"\",\n      menuPerm: {},\n      allowRoles: [],\n      selectArray: [] //用户选中的数据以便判断是否是系统角色\n\n    };\n  },\n  mounted: function mounted() {\n    this.$validator = this.$root.$validator;\n  },\n  methods: (_methods = {\n    rowClick: function rowClick(row, column, event) {\n      this.$refs.roleTable.$refs.htTable.toggleRowSelection(row);\n    },\n    handleClose: function handleClose() {\n      this.dialogVisible = false;\n    },\n    handleCloseMenuPerm: function handleCloseMenuPerm() {\n      this.dialogVisibleMenuPerm = false;\n    },\n    showDialog: function showDialog(row) {\n      this.dialogVisible = true;\n\n      if (row) {\n        // this.role = row;\n        //setTimeout(() => this.$validator.validateAll());\n        this.loadDataUrl = \"/api/role/v1/role/getRole?code=\".concat(row.code);\n      } else {\n        this.role = {\n          name: \"\",\n          code: \"\",\n          enabled: 1,\n          roleType: 2\n        };\n      }\n    },\n    dialogCancle: function dialogCancle(dialogVisible) {\n      this[dialogVisible] = false;\n    },\n    loadData: function loadData(param, cb) {\n      var _this = this;\n\n      uc.getRolePage(param).then(function (response) {\n        _this.data = response.rows;\n        _this.pageResult = {\n          page: response.page,\n          pageSize: response.pageSize,\n          total: response.total\n        };\n      }).finally(function () {\n        return cb();\n      });\n    },\n    handleCommand: function handleCommand(params) {\n      switch (params.command) {\n        // case \"edit\":\n        //   this.showDialog(params.row);\n        //   break;\n        case \"delete\":\n          break;\n\n        case \"assignUser\":\n          this.$refs.userRoleManager.showDialog(params.row.code);\n          break;\n\n        case \"assignMenu\":\n          this.$refs.roleMenuAuth.showDialog(params.row.code);\n          break;\n\n        case \"methodAuth\":\n          this.$refs.roleMethodAuth.showDialog(params.row.code);\n          break;\n\n        case \"copyRoleMenuPerm\":\n          this.menuPerm = params.row;\n          this.dialogVisibleMenuPerm = true;\n          this.loadDataUrl = \"/api/role/v1/roles/getNotCodeAll?code=\".concat(params.row.code);\n          break;\n\n        default:\n          break;\n      }\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                //  提交前可以改变model中的数据\n                // this.role\n                // this.isSubmit 是否提交数据到后台\n                // this.isSubmit = true  提交数据到后天\n                // this.isSubmit = false 不提交\n                // this.isSubmit = false;\n                // console.log(new Date().getTime());\n                // for(let i=0; i<1000000000;i++){\n                // }\n                //  console.log(new Date().getTime());\n                this.isSubmit = true;\n\n              case 1:\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      this.dialogVisible = false;\n      this.$refs.roleTable.load();\n    },\n    afterLoadData: function afterLoadData(data) {\n      var _this2 = this;\n\n      // 菜单权限复制\n      if (this.dialogVisibleMenuPerm) {\n        this.allowRoles = data;\n      } // 编辑角色\n\n\n      if (this.dialogVisible) {\n        this.role = data.value;\n        setTimeout(function () {\n          return _this2.$validator.validateAll(\"editRoleForm\");\n        });\n      }\n    },\n    //导入\n    onExceed: function onExceed(file) {\n      this.$message.warning('只能选择一个Excel文件!');\n    },\n    submitImport: function submitImport() {\n      if (!this.$refs.upload.uploadFiles || this.$refs.upload.uploadFiles.length == 0) {\n        this.$message.warning('请选择要导入的数据文件!');\n        return false;\n      }\n\n      if (!this.importDemCode) {\n        this.$message.warning('请选择要导入的维度!');\n        return false;\n      }\n\n      this.$refs.upload.submit();\n    },\n    beforeUpload: function beforeUpload(file) {\n      if (!file.name.endsWith('.xlsx') && !file.name.endsWith('.xls')) {\n        this.$message.warning('只能导入Excel文件!');\n        return false;\n      }\n\n      this.fullscreenLoading = true;\n    },\n    hadleUploadResult: function hadleUploadResult(response, file, fileList) {\n      this.fullscreenLoading = false;\n\n      if (response.state) {\n        this.$message.success(response.message);\n        this.dialogImportVisible = false;\n        this.$refs.roleTable.load();\n      } else {\n        this.$message.error(response.message + '：' + response.value);\n      }\n    },\n    cancelConfirm: function cancelConfirm() {\n      this.$refs.upload.clearFiles();\n      this.dialogImportVisible = false;\n      this.$refs.upload.uploadFiles = [];\n    },\n    //下载模板\n    downloadTemplate: function downloadTemplate() {// 此方法下载报错，改用a 标签下载\n      // console.log(window.context.manage + \"/static/excel/导出角色模板.xls\", \"/static/excel/导出角色模板.xls\");\n      // window.location.href = 'http://119.3.200.177:8080/mvue/static/excel/导出角色模板.xls';\n    },\n    exportExcel: function exportExcel(data) {\n      var selection = this.$refs.roleTable.$refs.htTable.selection;\n\n      if (!selection || selection.length == 0) {\n        this.$message({\n          type: \"warning\",\n          message: \"请至少选择一条记录\"\n        });\n        return;\n      }\n\n      ;\n      var ids = [];\n\n      for (var i = 0; i < selection.length; i++) {\n        ids.push(selection[i].id);\n      }\n\n      var url = window.context.uc + \"/api/role/v1/roles/export?ids=\" + ids.join(\",\");\n      req.download(url);\n    }\n  }, _defineProperty(_methods, \"submitImport\", function submitImport() {\n    if (!this.$refs.upload.uploadFiles || this.$refs.upload.uploadFiles.length == 0) {\n      this.$message.warning('请选择要导入的数据文件!');\n      return false;\n    }\n\n    this.$refs.upload.submit();\n  }), _defineProperty(_methods, \"handleSelect\", function handleSelect() {\n    this.selectArray = this.$refs.roleTable.selection;\n  }), _defineProperty(_methods, \"roleDeleteByid\", function roleDeleteByid() {\n    var _this3 = this;\n\n    var arr = [];\n    var ids = '';\n    this.selectArray.forEach(function (item) {\n      if (item.roleType === 1) {\n        _this3.$message.error('系统角色无法删除');\n      } else {\n        arr.push(item.id);\n      }\n    });\n    arr.forEach(function (item) {\n      ids += item + ',';\n    });\n\n    if (ids) {\n      //删除普通角色\n      uc.delOrdinaryRole(ids).then(function (res) {\n        //重新获取数据\n        _this3.loadData();\n      });\n    }\n  }), _defineProperty(_methods, \"handleSelectAll\", function handleSelectAll(selection) {\n    // console.log(selection)\n    this.selectArray = selection;\n  }), _methods)\n};",null]}