{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\views\\zlMenu\\components\\givePower.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\views\\zlMenu\\components\\givePower.vue","mtime":1669637191969},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.to-string\";\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//\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport SelectOrganize from \"./SelectOrganize.vue\";\nimport SelectUser from \"./SelectUser.vue\";\nimport givePower from '@/api/examination/givePower.js';\nexport default {\n  name: 'givePower',\n  components: {\n    SelectOrganize: SelectOrganize,\n    SelectUser: SelectUser\n  },\n  data: function data() {\n    return {\n      // 操作权限\n      OperationList: [],\n      visible: false,\n      parameter: {\n        accessControlList: [],\n        accessControlType: \"\",\n        authType: \"\",\n        typeId: \"\"\n      },\n      authTypeList: [],\n      accessControlTypeList: [],\n      // 组织列表\n      OrgsLists: [],\n      OrgsListIds: [],\n      // 用户列表\n      UsersListIds: [],\n      UsersList: [],\n      // 验证\n      rules: {\n        OperationList: [{\n          required: true,\n          message: '请选择操作权限',\n          trigger: 'blur'\n        }],\n        accessControlType: [{\n          required: true,\n          message: '请选择授权对象类型',\n          trigger: 'blur'\n        }]\n      }\n    };\n  },\n  created: function created() {\n    // 操作权限\n    this.authTypeList = dictUtils.getDictItemsFromCache('czqx'); // 权限受控类型\n\n    this.accessControlTypeList = dictUtils.getDictItemsFromCache('qxsklx');\n  },\n  mounted: function mounted() {\n    // ref绑定自定义事件\n    this.$refs.OrgsModal.$on('getOrgs', this.getOrg);\n    this.$refs.UsersModal.$on('getUser', this.getUser);\n  },\n  methods: {\n    clearData: function clearData() {\n      if (this.parameter.accessControlType == \"1\") {\n        this.UsersList = [];\n        this.UsersListIds = [];\n        this.UsersList = [];\n        this.UsersListIds = [];\n      }\n\n      if (this.parameter.accessControlType == \"2\") {\n        this.UsersList = [];\n        this.UsersListIds = [];\n      }\n\n      if (this.parameter.accessControlType == \"3\") {\n        this.OrgsLists = [];\n        this.OrgsListIds = [];\n      }\n    },\n    clear: function clear() {\n      this.OrgsListIds = [];\n      this.UsersListIds = [];\n    },\n    getOrg: function getOrg(item) {\n      var _this = this;\n\n      this.OrgsLists = item;\n      this.OrgsLists.forEach(function (item) {\n        _this.OrgsListIds.push(item.id);\n      });\n    },\n    getUser: function getUser(item) {\n      var _this2 = this;\n\n      this.UsersList = item;\n      this.UsersList.forEach(function (item) {\n        _this2.UsersListIds.push(item.id);\n      });\n    },\n    selectOrgs: function selectOrgs() {\n      this.$refs.OrgsModal.handleShow();\n    },\n    selectUsers: function selectUsers() {\n      this.$refs.UsersModal.handleShow();\n    },\n    add: function add(val) {\n      this.visible = true;\n      this.parameter.typeId = val.id;\n      this.getAuthorization();\n    },\n    // 关闭新增人员窗口\n    handleClose: function handleClose() {\n      this.visible = false;\n      this.OperationList = [];\n      this.OrgsLists = [];\n      this.OrgsListIds = [];\n      this.UsersList = [];\n      this.UsersListIds = [];\n      this.parameter = {\n        accessControlList: [],\n        accessControlType: \"\",\n        authType: \"\",\n        typeId: \"\"\n      };\n    },\n    // 授权保存\n    handleSave: function handleSave() {\n      var _this3 = this;\n\n      this.$refs.formInfo.validate(function (valid) {\n        if (valid) {\n          _this3.parameter.authType = _this3.OperationList.toString(); // console.log(this.OrgsLists);\n\n          if (_this3.OrgsLists.length != 0) {\n            _this3.OrgsLists.forEach(function (item) {\n              var obj = {};\n              obj[\"accessControlId\"] = item.id;\n              obj[\"accessControlName\"] = item.name;\n\n              _this3.parameter.accessControlList.push(obj);\n            });\n          }\n\n          if (_this3.UsersList.length != 0) {\n            _this3.UsersList.forEach(function (item) {\n              var obj = {};\n              obj[\"accessControlId\"] = item.id;\n              obj[\"accessControlName\"] = item.fullname;\n\n              _this3.parameter.accessControlList.push(obj);\n            });\n          }\n\n          console.log(_this3.parameter);\n          givePower.saveGivePower(_this3.parameter, function (response) {\n            if (response.state) {\n              _this3.$notify({\n                type: 'success',\n                message: '授权成功',\n                duration: 2000\n              });\n\n              _this3.handleClose();\n            } else {\n              _this3.$message.warning(response.message);\n            }\n          });\n        }\n      });\n    },\n    // 获取已授权数据\n    getAuthorization: function getAuthorization() {\n      var _this4 = this;\n\n      givePower.getAllTypeId(this.parameter.typeId, function (item) {\n        console.log(item);\n\n        if (Object.keys(item.value).length != 0) {\n          _this4.OperationList = item.value.authType.split(',');\n          _this4.parameter.accessControlType = item.value.accessControlType;\n\n          if (_this4.parameter.accessControlType == '2') {\n            item.value.accessControlList.forEach(function (ee) {\n              var obj = {};\n              obj['name'] = ee.accessControlName;\n              obj[\"id\"] = ee.accessControlId;\n\n              _this4.OrgsLists.push(obj);\n\n              _this4.OrgsListIds.push(ee.accessControlId);\n            });\n          }\n\n          if (_this4.parameter.accessControlType == '3') {}\n        }\n      });\n    }\n  }\n};",null]}