{"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\\components\\dialog\\DefAuthorizeDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\dialog\\DefAuthorizeDialog.vue","mtime":1675071991710},{"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 \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 req from \"@/request.js\";\nimport { Base64 } from \"js-base64\";\nimport utils from \"@/hotent-ui-util.js\";\n\nvar eipAuthDialog = function eipAuthDialog() {\n  return import(\"@/components/dialog/EipAuthDialog.vue\");\n};\n\nvar eipOrgSelector = function eipOrgSelector() {\n  return import(\"@/components/selector/EipOrgSelector.vue\");\n};\n\nvar eipFlowDialog = function eipFlowDialog() {\n  return import(\"@/components/dialog/EipFlowDialog.vue\");\n};\n\nvar eipSysTypeDialog = function eipSysTypeDialog() {\n  return import(\"@/components/dialog/EipSysTypeDialog.vue\");\n};\n\nexport default {\n  components: {\n    eipAuthDialog: eipAuthDialog,\n    eipOrgSelector: eipOrgSelector,\n    eipFlowDialog: eipFlowDialog,\n    eipSysTypeDialog: eipSysTypeDialog\n  },\n  name: \"def-authorize-dialog\",\n  data: function data() {\n    return {\n      dialogVisible: false,\n      dialogVisibleMenuPerm: false,\n      flowAuth: {\n        authorizeTypes: {\n          start: true\n        },\n        defAllNameJson: [],\n        defNameJson: [],\n        multiple: \"1\"\n      },\n      authorizeTypes_: {\n        start: true\n      },\n      authorizeTypes: {\n        start: \"启动\",\n        management: \"定义\",\n        task: \"任务\",\n        instance: \"实例\"\n      },\n      calOwnerNameJson: [],\n      defAllNameJson: [],\n      defNameJson: [],\n      isSubmit: true,\n      data: [],\n      pageResult: {\n        page: 1,\n        pageSize: 50,\n        total: 0\n      },\n      authId: \"\",\n      checkMap: {},\n      typeCheckMap: {}\n    };\n  },\n  methods: {\n    showDialog: function showDialog(id, defRow) {\n      this.dialogVisible = true;\n      this.initData(id, defRow);\n    },\n    initData: function initData(id, defRow) {\n      this.dialogVisible = true;\n      var me = this;\n\n      if (id) {\n        this.authId = id;\n        this.$refs.htLoadData.loadData(\"${bpmModel}/flow/defAuthorize/v1/defAuthorizeGet?id=\" + id).then(function (data) {\n          me.flowAuth = data;\n          me.authorizeTypes_ = JSON.parse(data.authorizeTypes);\n          me.flowAuth.authorizeTypes = me.authorizeTypes_;\n          me.defNameJson = JSON.parse(data.defNameJson); // right 转为对象\n\n          me.defNameJson.forEach(function (item) {\n            if (item.right && item.right.constructor == String) {\n              item.right = JSON.parse(item.right);\n            }\n          });\n          me.defAllNameJson = JSON.parse(data.defAllNameJson); // right 转为对象\n\n          me.defAllNameJson.forEach(function (item) {\n            if (item.right && item.right.constructor == String) {\n              item.right = JSON.parse(item.right);\n            }\n          });\n          me.calOwnerNameJson = JSON.parse(data.ownerNameJson);\n        });\n      } else {\n        this.authId = \"\";\n        me.flowAuth = {\n          authorizeTypes: {\n            start: true\n          },\n          defAllNameJson: [],\n          defNameJson: [],\n          multiple: \"1\"\n        };\n        me.defNameJson = [];\n        me.defAllNameJson = [];\n        me.calOwnerNameJson = [];\n        me.authorizeTypes_ = {\n          start: true\n        };\n\n        if (defRow && defRow.defKey) {\n          var defaultRight = {\n            m_edit: false,\n            m_del: false,\n            m_start: false,\n            m_set: false,\n            m_clean: false,\n            i_del: false,\n            i_log: false,\n            i_org: false\n          };\n          me.defNameJson.push({\n            defName: defRow.name,\n            defKey: defRow.defKey,\n            right: defaultRight\n          });\n        }\n      }\n    },\n    dialogCancle: function dialogCancle(dialogVisible) {\n      this[dialogVisible] = false;\n      this.$emit(\"onConfirm\", false);\n    },\n    renderLastHeader: function renderLastHeader(h) {\n      var _this2 = this;\n\n      //下拉框选项\n      var managementFilters = [{\n        key: \"m_edit\",\n        value: \"编辑\",\n        falseLabel: \"un_m_edit\"\n      }, {\n        key: \"m_del\",\n        value: \"删除\",\n        falseLabel: \"un_m_del\"\n      }, {\n        key: \"m_start\",\n        value: \"启动\",\n        falseLabel: \"un_m_start\"\n      }];\n\n      if (this.flowAuth.multiple == 2) {\n        managementFilters.push({\n          key: \"m_set\",\n          value: \"设置\",\n          falseLabel: \"un_m_set\"\n        });\n      }\n\n      var managementAllFilters = [{\n        key: \"m_all\",\n        value: \"\",\n        falseLabel: \"un_m_all\"\n      }];\n      managementFilters.push({\n        key: \"m_clean\",\n        value: \"清除数据\",\n        falseLabel: \"un_m_clean\"\n      });\n      var instanceFilters = [{\n        key: \"i_del\",\n        value: \"删除\",\n        falseLabel: \"un_i_del\"\n      }];\n      var instanceOrgFilters = [{\n        key: \"i_org\",\n        value: \"本部门\",\n        falseLabel: \"un_i_org\"\n      }];\n      return h(\"div\", {}, [[managementAllFilters.map(function (item) {\n        if (_this2.authorizeTypes_.management) {\n          return h(\"el-checkbox\", {\n            props: {\n              trueLabel: item.key,\n              falseLabel: item.falseLabel,\n              label: item.value\n            },\n            on: {\n              change: _this2.updateAllSelectedAll // 选中事件\n\n            }\n          });\n        }\n      })], h(\"span\", {\n        //div里面有一个文字提示：多选所属内容\n        style: {}\n      }, this.appendHtml(1)), [managementFilters.map(function (item) {\n        if (_this2.authorizeTypes_.management) {\n          return h(\"el-checkbox\", {\n            props: {\n              trueLabel: item.key,\n              falseLabel: item.falseLabel,\n              label: item.value\n            },\n            on: {\n              change: _this2.updateAllSelected // 选中事件\n\n            }\n          });\n        }\n      })], h(\"span\", {}, this.appendHtml(2)), h(\"div\", {}, \"\"), h(\"span\", {}, this.appendHtml(3)), [instanceFilters.map(function (item) {\n        if (_this2.authorizeTypes_.instance) {\n          return h(\"el-checkbox\", {\n            props: {\n              trueLabel: item.key,\n              falseLabel: item.falseLabel,\n              label: item.value\n            },\n            on: {\n              change: _this2.updateAllSelected // 选中事件\n\n            }\n          });\n        }\n      })], h(\"span\", {}, this.appendHtml(4)), [instanceOrgFilters.map(function (item) {\n        if (_this2.authorizeTypes_.instance) {\n          return h(\"el-checkbox\", {\n            props: {\n              trueLabel: item.key,\n              falseLabel: item.falseLabel,\n              label: item.value\n            },\n            on: {\n              change: _this2.updateAllSelectedAll // 选中事件\n\n            }\n          });\n        }\n      })]]);\n    },\n    appendHtml: function appendHtml(op) {\n      if (op == 1 && this.authorizeTypes_.management) {\n        return \"定义(\";\n      } else if (op == 2 && this.authorizeTypes_.management) {\n        return \")\";\n      } else if (op == 3 && this.authorizeTypes_.instance) {\n        return \"实例(\";\n      } else if (op == 4 && this.authorizeTypes_.instance) {\n        return \")\";\n      }\n\n      return \"\";\n    },\n    updateAllSelectedAll: function updateAllSelectedAll(oValue) {\n      var _this3 = this;\n\n      var res = true;\n\n      if (oValue.indexOf(\"un_\") != -1) {\n        res = false;\n      }\n\n      var jsonName = this.flowAuth.multiple == 1 ? 'defNameJson' : 'defAllNameJson';\n\n      var _this = this;\n\n      var idx = 0;\n      this[jsonName].forEach(function (item) {\n        if (oValue.indexOf(\"i_org\") != -1) {\n          _this.$set(_this[jsonName][idx].right, \"i_org\", res);\n\n          idx++;\n        } else {\n          var map = _this3.flowAuth.multiple == 1 ? _this3.checkMap : _this3.typeCheckMap;\n          map[item.defKey] = res;\n          item.right['m_edit'] = res;\n          item.right['m_del'] = res;\n          item.right['m_start'] = res;\n          item.right['m_clean'] = res;\n\n          if (_this3.flowAuth.multiple != 1) {\n            item.right['m_set'] = res;\n          }\n        }\n      });\n    },\n    updateAllSelected: function updateAllSelected(oValue) {\n      var res = true;\n\n      if (oValue.indexOf(\"un_\") != -1) {\n        res = false;\n      }\n\n      var name = oValue.replace(\"un_\", \"\");\n\n      if (this.flowAuth.multiple == 1) {\n        this.defNameJson.forEach(function (item) {\n          item.right[name] = res;\n        });\n      } else {\n        this.defAllNameJson.forEach(function (item) {\n          item.right[name] = res;\n        });\n      }\n    },\n    showSysTypeDialog: function showSysTypeDialog() {\n      this.$refs.flowTypeDialog.showDialog();\n    },\n    showAuthDialog: function showAuthDialog() {\n      var conf = {\n        right: [],\n        permissionList: [{\n          type: \"everyone\",\n          title: \"所有人\"\n        }, {\n          type: \"user\",\n          title: \"用户\"\n        }, {\n          type: \"org\",\n          title: \"组织\"\n        }, {\n          type: \"pos\",\n          title: \"岗位\"\n        }, {\n          type: \"role\",\n          title: \"角色\"\n        } // ,{ type: \"none\", title: \"无\" }\n        ]\n      };\n\n      if (this.calOwnerNameJson) {\n        conf.right = this.calOwnerNameJson;\n      }\n\n      this.$refs.eipAuthDialog.showDialog(conf);\n    },\n    dialogOnConfirm: function dialogOnConfirm(data, name) {\n      var _this4 = this;\n\n      if (name == \"eipAuthDialog\") {\n        this.calOwnerNameJson = data;\n      }\n\n      if (name == \"eipFlowDialog\") {\n        data.forEach(function (element) {\n          var isEquals = false;\n\n          _this4.defNameJson.forEach(function (item) {\n            if (!isEquals && item.defKey == element.defKey) {\n              isEquals = true;\n            }\n          });\n\n          if (!isEquals) {\n            var defaultRight = {\n              m_edit: false,\n              m_del: false,\n              m_start: false,\n              m_set: false,\n              m_clean: false,\n              i_del: false,\n              i_log: false,\n              i_org: false\n            };\n\n            _this4.defNameJson.push({\n              defName: element.name,\n              defKey: element.defKey,\n              right: defaultRight\n            });\n          }\n        });\n      }\n\n      if (name == \"flowTypeDialog\") {\n        data.forEach(function (element) {\n          if (element.parentId == \"0\") {\n            return;\n          }\n\n          var isEquals = false;\n\n          _this4.defAllNameJson.forEach(function (item) {\n            if (!isEquals && item.defKey == element.id) {\n              isEquals = true;\n            }\n          });\n\n          if (!isEquals) {\n            var defaultRight = {\n              m_edit: false,\n              m_del: false,\n              m_start: false,\n              m_set: false,\n              m_clean: false,\n              i_del: false,\n              i_log: false,\n              i_org: false\n            };\n\n            _this4.defAllNameJson.push({\n              defName: element.name,\n              defKey: element.id,\n              right: defaultRight\n            });\n          }\n        });\n      }\n    },\n    showFlowDialog: function showFlowDialog() {\n      this.$refs.eipFlowDialog.showDialog();\n    },\n    beforeSaveData: function () {\n      var _beforeSaveData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n        var isSelectType, type;\n        return regeneratorRuntime.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                this.isSubmit = true;\n                isSelectType = false;\n\n                for (type in this.authorizeTypes_) {\n                  if (this.authorizeTypes_[type]) {\n                    isSelectType = true;\n                  }\n                }\n\n                if (isSelectType) {\n                  _context.next = 7;\n                  break;\n                }\n\n                this.$message.error(\"请选择权限类型\");\n                this.isSubmit = false;\n                return _context.abrupt(\"return\");\n\n              case 7:\n                if (!(this.calOwnerNameJson.length == 0)) {\n                  _context.next = 11;\n                  break;\n                }\n\n                this.$message.error(\"请选择授权人员\");\n                this.isSubmit = false;\n                return _context.abrupt(\"return\");\n\n              case 11:\n                if (!(this.flowAuth.multiple == \"1\")) {\n                  _context.next = 19;\n                  break;\n                }\n\n                if (!(this.defNameJson.length == 0)) {\n                  _context.next = 16;\n                  break;\n                }\n\n                this.$message.error(\"请选择授权流程\");\n                this.isSubmit = false;\n                return _context.abrupt(\"return\");\n\n              case 16:\n                this.flowAuth.defAllNameJson = [];\n                _context.next = 24;\n                break;\n\n              case 19:\n                if (!(this.defAllNameJson.length == 0)) {\n                  _context.next = 23;\n                  break;\n                }\n\n                this.$message.error(\"请选择授权分类\");\n                this.isSubmit = false;\n                return _context.abrupt(\"return\");\n\n              case 23:\n                this.flowAuth.defNameJson = [];\n\n              case 24:\n                this.flowAuth.ownerNameJson = JSON.stringify(this.calOwnerNameJson);\n                this.flowAuth.defNameJson = JSON.stringify(this.defNameJson);\n                this.flowAuth.defAllNameJson = JSON.stringify(this.defAllNameJson);\n                this.flowAuth.authorizeTypes = JSON.stringify(this.authorizeTypes_);\n\n              case 28:\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.$emit(\"onConfirm\", true);\n    },\n    handleDefauthSelect: function handleDefauthSelect(value, row, type) {\n      if (value) {\n        row.right.m_edit = true;\n        row.right.m_del = true;\n        row.right.m_start = true;\n        row.right.m_clean = true;\n\n        if (type == 'type') {\n          row.right.m_set = true;\n        }\n      } else {\n        row.right.m_edit = false;\n        row.right.m_del = false;\n        row.right.m_start = false;\n        row.right.m_clean = false;\n\n        if (type == 'type') {\n          row.right.m_set = false;\n        }\n      }\n    },\n    handleClose: function handleClose() {\n      this.dialogVisible = false;\n      this.$emit(\"onConfirm\", false);\n    },\n    authorizeTypesChange: function authorizeTypesChange() {\n      if (this.authorizeTypes_.task === true && !this.authorizeTypes_.instance) {\n        this.$set(this.authorizeTypes_, 'instance', true);\n      }\n    }\n  }\n};",null]}