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