{"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\\DataAuthDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\dialog\\DataAuthDialog.vue","mtime":1675071991694},{"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\r\nimport deepmerge from 'deepmerge'\r\n\r\nconst eipUserSelector = () =>\r\n  import('@/components/selector/EipUserSelector.vue')\r\nconst eipRoleSelector = () =>\r\n  import('@/components/selector/EipRoleSelector.vue')\r\nconst eipOrgSelector = () => import('@/components/selector/EipOrgSelector.vue')\r\nconst eipPostSelector = () =>\r\n  import('@/components/selector/EipPostSelector.vue')\r\n\r\nexport default {\r\n  components: {\r\n    eipUserSelector,\r\n    eipRoleSelector,\r\n    eipOrgSelector,\r\n    eipPostSelector,\r\n  },\r\n  props: {name},\r\n  data() {\r\n    return {\r\n      dialogVisible: false,\r\n      noNeedSetArr: [],\r\n      right: '',\r\n      permissionList: [],\r\n      curSelectItem: {},\r\n      autoClose: true,\r\n      selectorKey: 1,\r\n      showNeedRight: '',\r\n    }\r\n  },\r\n  methods: {\r\n    showDialog: function (param_) {\r\n      //重新初始化全部的 data数据\r\n      Object.assign(this.$data, this.$options.data())\r\n      let param = deepmerge({}, param_, {clone: true})\r\n      if (param.autoClose === false) {\r\n        this.autoClose = false\r\n      }\r\n      this.right = ''\r\n      if (param.limits) {\r\n        this.right = deepmerge({}, param.limits, {clone: true})\r\n      }\r\n      this.permissionList = param.permissionList || []\r\n      //   let needSetting = []\r\n      //不需要配置\r\n      let noNeedSetting = []\r\n      for (var i = 0; i < this.permissionList.length; i++) {\r\n        var obj = this.permissionList[i]\r\n        var type = obj.type\r\n        var objRight = this.getRight(this.right, type)\r\n        if (objRight) {\r\n          objRight.title = obj.title\r\n          if (objRight.type == 'users') {\r\n            this.showNeedRight = 'users'\r\n          } else if (objRight.type == 'orgs') {\r\n            this.showNeedRight = 'orgs'\r\n          }\r\n          objRight.checked = true\r\n          noNeedSetting.push(objRight)\r\n          //   }\r\n        } else {\r\n          if (obj.type == 'users' || obj.type == 'orgs') {\r\n            obj.checked = false\r\n            obj.id = ''\r\n            obj.name = ''\r\n            noNeedSetting.push(JSON.parse(JSON.stringify(obj)))\r\n          } else {\r\n            obj.checked = false\r\n            noNeedSetting.push(obj)\r\n          }\r\n        }\r\n      }\r\n      this.noNeedSetArr = noNeedSetting\r\n      this.dialogVisible = true\r\n    },\r\n    getRight: function (aryRights, type) {\r\n      if (!this.right || this.right.size == 0) return null\r\n      for (var i = 0; i < aryRights.length; i++) {\r\n        var obj = aryRights[i]\r\n        if (obj.type == type) {\r\n          return obj\r\n        }\r\n      }\r\n      return null\r\n    },\r\n    closeDialog: function () {\r\n      this.dialogVisible = false\r\n    },\r\n    handleClose: function () {\r\n      let rtn = []\r\n      let isOtherAuth = false\r\n      for (let i = 0; i < this.noNeedSetArr.length; i++) {\r\n        let obj = this.noNeedSetArr[i]\r\n        if (obj.checked && obj.type != 'users' && obj.type != 'orgs') {\r\n          rtn.push(obj)\r\n          this.$emit('onConfirm', rtn, this.name, 1)\r\n          this.dialogVisible = false\r\n          return rtn\r\n        }\r\n        if (obj.checked && obj.type == 'users') {\r\n          isOtherAuth = true\r\n        }\r\n        if (obj.checked && obj.type == 'orgs') {\r\n          isOtherAuth = true\r\n        }\r\n      }\r\n      let setting = this.noNeedSetArr\r\n      for (let i = 5; i < setting.length; i++) {\r\n        let obj = setting[i]\r\n        //设置了值。\r\n        if (obj.id) {\r\n          rtn.push(obj)\r\n        }\r\n      }\r\n      if (isOtherAuth && rtn.length < 1) {\r\n        this.$message({type: 'warning', message: '请添加具体权限信息！'})\r\n        return false\r\n      }\r\n      this.$emit('onConfirm', rtn, this.name, 1)\r\n      if (this.autoClose) {\r\n        this.dialogVisible = false\r\n      }\r\n    },\r\n    checkNoSetting: function (item) {\r\n      var noNeedChecked = false\r\n      for (var i = 0; i < this.noNeedSetArr.length; i++) {\r\n        var obj = this.noNeedSetArr[i]\r\n        if (item.checked) {\r\n          if (obj != item) {\r\n            obj.checked = false\r\n            this.noNeedSetArr[i].id=\"\"\r\n            this.noNeedSetArr[i].name=\"\"\r\n          }\r\n          if (item.type == 'users') {\r\n            this.showNeedRight = 'users'\r\n          } else if (item.type == 'orgs') {\r\n            this.showNeedRight = 'orgs'\r\n          } else {\r\n            this.showNeedRight = ''\r\n          }\r\n        }\r\n      }\r\n      this.$forceUpdate()\r\n    },\r\n    updateNeedSetArr(index) {\r\n      this.noNeedSetArr[index].id = ''\r\n      this.noNeedSetArr[index].name = ''\r\n      ++this.selectorKey\r\n    },\r\n  },\r\n}\r\n",null]}