{"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\\EipAuthDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\dialog\\EipAuthDialog.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 \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 deepmerge from 'deepmerge';\n\nvar eipUserSelector = function eipUserSelector() {\n  return import(\"@/components/selector/EipUserSelector.vue\");\n};\n\nvar eipRoleSelector = function eipRoleSelector() {\n  return import(\"@/components/selector/EipRoleSelector.vue\");\n};\n\nvar eipOrgSelector = function eipOrgSelector() {\n  return import(\"@/components/selector/EipOrgSelector.vue\");\n};\n\nvar eipPostSelector = function eipPostSelector() {\n  return import(\"@/components/selector/EipPostSelector.vue\");\n};\n\nexport default {\n  components: {\n    eipUserSelector: eipUserSelector,\n    eipRoleSelector: eipRoleSelector,\n    eipOrgSelector: eipOrgSelector,\n    eipPostSelector: eipPostSelector\n  },\n  props: {\n    name: name\n  },\n  data: function data() {\n    return {\n      dialogVisible: false,\n      showSelectors: {\n        user: false,\n        org: false,\n        pos: false,\n        role: false\n      },\n      needSetArr: [{\n        type: \"user\",\n        title: \"用户\",\n        id: \"\",\n        name: \"\"\n      }, {\n        type: \"org\",\n        title: \"组织\",\n        id: \"\",\n        name: \"\"\n      }, {\n        type: \"pos\",\n        title: \"岗位\",\n        id: \"\",\n        name: \"\"\n      }, {\n        type: \"role\",\n        title: \"角色\",\n        id: \"\",\n        name: \"\"\n      }],\n      noNeedSetArr: [],\n      right: \"\",\n      permissionList: [],\n      showNeedRight: true,\n      curSelectItem: {},\n      autoClose: true,\n      selectorKey: 1\n    };\n  },\n  methods: {\n    showDialog: function showDialog(param_) {\n      //重新初始化全部的 data数据\n      Object.assign(this.$data, this.$options.data());\n      var param = deepmerge({}, param_, {\n        clone: true\n      });\n\n      if (param.autoClose === false) {\n        this.autoClose = false;\n      }\n\n      this.showNeedRight = true;\n      this.right = \"\";\n\n      if (param.right) {\n        this.right = deepmerge({}, param.right, {\n          clone: true\n        });\n      }\n\n      this.permissionList = param.permissionList || [];\n      var needSetting = []; //不需要配置\n\n      var noNeedSetting = [];\n\n      for (var i = 0; i < this.permissionList.length; i++) {\n        var obj = this.permissionList[i];\n        var type = obj.type;\n        var objRight = this.getRight(this.right, type);\n\n        if (objRight) {\n          objRight.title = obj.title;\n\n          if (objRight.type == \"everyone\" || objRight.type == \"none\") {\n            objRight.checked = true;\n            this.showNeedRight = false;\n            noNeedSetting.push(objRight);\n          } else {\n            Object.assign(this.getRight(this.needSetArr, type), objRight);\n            needSetting.push(objRight);\n            this.showSelectors[objRight.type] = true;\n          }\n        } else {\n          if (obj.type == \"everyone\" || obj.type == \"none\") {\n            obj.checked = false;\n            noNeedSetting.push(obj);\n          } else {\n            obj.id = \"\";\n            obj.name = \"\";\n            needSetting.push(JSON.parse(JSON.stringify(obj)));\n            this.showSelectors[obj.type] = true;\n          }\n        }\n      } // 不能这样赋值  会导致选择器 编辑情况无法删除已选数据\n      //2020-02-19 去掉会导致新增的时候再次打开之前选中的未被清空，先还原\n\n\n      var otherAuth = {\n        checked: false,\n        title: \"其他\",\n        type: \"otherAuth\"\n      };\n      var set = noNeedSetting.filter(function (v) {\n        return v.checked;\n      });\n\n      if (set.length == 0) {\n        otherAuth.checked = true;\n      }\n\n      this.needSetArr = needSetting;\n      this.noNeedSetArr = noNeedSetting;\n      this.noNeedSetArr.push(otherAuth);\n      this.dialogVisible = true;\n    },\n    getRight: function getRight(aryRights, type) {\n      if (!this.right || this.right.size == 0) return null;\n\n      for (var i = 0; i < aryRights.length; i++) {\n        var obj = aryRights[i];\n\n        if (obj.type == type) {\n          return obj;\n        }\n      }\n\n      return null;\n    },\n    closeDialog: function closeDialog() {\n      this.dialogVisible = false;\n    },\n    handleClose: function handleClose() {\n      var rtn = [];\n      var isOtherAuth = false;\n\n      for (var i = 0; i < this.noNeedSetArr.length; i++) {\n        var obj = this.noNeedSetArr[i];\n\n        if (obj.checked && obj.type != \"otherAuth\") {\n          rtn.push(obj);\n          this.$emit(\"onConfirm\", rtn, this.name);\n          this.dialogVisible = false;\n          return rtn;\n        }\n\n        if (obj.checked && obj.type == \"otherAuth\") {\n          isOtherAuth = true;\n        }\n      }\n\n      var setting = this.needSetArr;\n\n      for (var _i = 0; _i < setting.length; _i++) {\n        var _obj = setting[_i]; //设置了值。\n\n        if (_obj.id) {\n          rtn.push(_obj);\n        }\n      }\n\n      if (isOtherAuth && rtn.length < 1) {\n        this.$message({\n          type: \"warning\",\n          message: \"请添加具体权限信息！\"\n        });\n        return false;\n      }\n\n      this.$emit(\"onConfirm\", rtn, this.name);\n\n      if (this.autoClose) {\n        this.dialogVisible = false;\n      }\n    },\n    checkNoSetting: function checkNoSetting(item) {\n      var noNeedChecked = false;\n\n      for (var i = 0; i < this.noNeedSetArr.length; i++) {\n        var obj = this.noNeedSetArr[i];\n\n        if (item.checked) {\n          if (obj != item) {\n            obj.checked = false;\n          }\n\n          if (item.type == 'otherAuth') {\n            noNeedChecked = true;\n          }\n        }\n      }\n\n      this.showNeedRight = noNeedChecked;\n      this.$forceUpdate();\n    },\n    updateNeedSetArr: function updateNeedSetArr(index) {\n      this.needSetArr[index].id = \"\";\n      this.needSetArr[index].name = \"\";\n      ++this.selectorKey;\n    }\n  }\n};",null]}