{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\views\\main\\organizationPermission\\DataAuthDistribute.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\views\\main\\organizationPermission\\DataAuthDistribute.vue","mtime":1667327529934},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\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//\nvar eipAuthDialog = function eipAuthDialog() {\n return import('@/components/dialog/DataAuthDialog.vue');\n};\n\nvar eipAuthkindDialog = function eipAuthkindDialog() {\n return import('@/components/dialog/DataAuthkindDialog.vue');\n};\n\nimport req from '@/request.js';\nimport portal from '@/api/portal';\nimport { Message } from 'element-ui';\nexport default {\n props: {},\n components: {\n eipAuthDialog: eipAuthDialog,\n eipAuthkindDialog: eipAuthkindDialog\n },\n data: function data() {\n return {\n dialogVisible: false,\n modelParams: {},\n tabHeight: \"\".concat(document.documentElement.clientHeight) - 245,\n displayFields: [],\n multipleSelection: [],\n currentAuthRow: null,\n permissionMap: {},\n rightLab: '',\n permissionList1: [],\n permissionList2: [{\n title: '所有人',\n type: 'everyone'\n }, {\n title: '用户',\n type: 'user'\n }, {\n title: '组织',\n type: 'org'\n }, {\n title: '角色',\n type: 'role'\n }],\n arry: []\n };\n },\n watch: {},\n created: function created() {},\n mounted: function mounted() {\n this.permissionMap = {\n user: '本人',\n userPlus: '本人及直属下级',\n org: '本组织数据',\n orgPlus: '本组织及以下组织数据',\n everyone: '所有',\n orgs: '指定组织',\n users: '指定用户'\n };\n this.arry = ['0', 'user', 'userPlus', 'org', 'orgPlus', 'orgs', 'users', 'everyone'];\n\n for (var key in this.permissionMap) {\n this.permissionList1.push({\n type: key,\n title: this.permissionMap[key]\n });\n }\n\n this.displayFields = [{\n id: '1',\n limits: '[{\"type\":\"user\"}]',\n desc: '测试假数据',\n right: '[{\"type\":\"everyone\"}]',\n memo: '测试假数据'\n }, {\n id: '2',\n limits: '[{\"type\":\"orgs\",\"id\":\"1366653717851541504,1368845159101501440\",\"name\":\"子公司,研发部\"}]',\n desc: '测试假数据',\n right: '[{\"type\":\"everyone\"}]',\n memo: '测试假数据'\n }];\n console.log('this.displayFields', this.displayFields);\n },\n methods: {\n handleClose: function handleClose() {\n this.dialogVisible = false;\n },\n showDialog: function showDialog(modelParams) {\n this.modelParams = modelParams;\n this.dialogVisible = true;\n this.loadTable(modelParams.id);\n },\n loadTable: function loadTable(id) {\n var _this2 = this;\n\n this.displayFields = [];\n var url = '${portal}/uc/DataAccessDefined/v1/queryListDataAccessDefined?interfaceId=' + id;\n req.get(url).then(function (response) {\n for (var i = 0; i < response.data.length; i++) {\n var arryData = {};\n arryData.controlType = response.data[i].type;\n arryData.id = response.data[i].id;\n var arryId = {};\n arryId.type = _this2.arry[response.data[i].accessRangeType];\n response.data[i].accessRangeId ? arryId.id = response.data[i].accessRangeId : null;\n response.data[i].rangeNameList ? arryId.name = response.data[i].rangeNameList : '';\n arryData.limits = JSON.stringify([arryId]);\n\n _this2.displayFields.push(arryData);\n }\n });\n this.multipleSelection = [];\n },\n // 添加列\n addCustomColumn: function addCustomColumn() {\n var newData = {\n desc: '',\n memo: '',\n right: '[]',\n limits: '[{\"type\":\"user\"}]'\n }; // this.displayFields.push(newData)\n\n this.setFieldRightDialog(newData, 1);\n },\n // 删除列\n delCustomColumn: function delCustomColumn() {\n var _this3 = this;\n\n if (!this.multipleSelection.length) {\n this.$message.warning(\"请选择要删除的数据\");\n return;\n } else {\n this.$confirm('是否确定删除选中数据?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n var ids = _this3.multipleSelection.map(function (item) {\n return item.id;\n });\n\n var param = _this3.qs.stringify({\n ids: ids.join(',')\n });\n\n var data = {\n url: '${portal}/uc/DataAccessDefined/v1/deleteDataAccessDefinedByIds',\n data: param,\n method: \"delete\",\n headers: {\n 'Content-type': 'application/x-www-form-urlencoded'\n }\n };\n req.request(data).then(function (response) {\n if (response.data && response.data.state) {\n console.log();\n Message.success({\n duration: 1500,\n message: response.data.message\n });\n\n _this3.loadTable(_this3.modelParams.id);\n } else {\n Message.error(response.data.message || '失败');\n }\n });\n }).catch(function () {\n _this3.$message({\n type: 'info',\n message: \"\\u5DF2\\u53D6\\u6D88\\u5220\\u9664\"\n });\n });\n }\n },\n handleSelectionChange: function handleSelectionChange(val) {\n this.multipleSelection = val;\n },\n //显示权限信息\n rightToDesc: function rightToDesc(right) {\n if (right) {\n right = JSON.parse(right);\n } else {\n return '无';\n }\n\n var desc = '';\n\n var _this = this;\n\n right.forEach(function (r) {\n if (desc) {\n desc += ' 和 ';\n }\n\n var str = _this.permissionMap[r.type];\n\n if (r.name) {\n str += ':' + r.name;\n } else if (r.id) {\n str += ':' + r.id;\n }\n\n desc += str;\n });\n return desc;\n },\n //打开设置权限\n setFieldRightDialog: function () {\n var _setFieldRightDialog = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(row, flag) {\n var conf, right, params, _conf;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n console.log('row', row, this.permissionList2);\n this.currentAuthRow = row;\n\n if (!(flag == 1)) {\n _context.next = 7;\n break;\n }\n\n conf = {\n limits: JSON.parse(row.limits),\n //字符串转成对象\n permissionList: this.permissionList1\n };\n this.$refs.eipAuthDialog.showDialog(conf);\n _context.next = 19;\n break;\n\n case 7:\n if (!(flag == 2)) {\n _context.next = 19;\n break;\n }\n\n right = {\n type: \"none\"\n };\n\n if (!(row.controlType == \"其他\")) {\n _context.next = 16;\n break;\n }\n\n right.type = \"otherAuth\";\n params = {\n accessControlId: row.id\n }; // 查询受控权限类型\n\n _context.next = 14;\n return portal.getDataAuthControlType(params).then(function (res) {\n right.accessControlData = res;\n });\n\n case 14:\n _context.next = 17;\n break;\n\n case 16:\n if (row.controlType == \"所有人\") {\n right.type = \"everyone\";\n }\n\n case 17:\n _conf = {\n right: right,\n //字符串转成对象\n permissionList: this.permissionList2\n };\n this.$refs.eipAuthkindDialog.showDialog(_conf);\n\n case 19:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function setFieldRightDialog(_x, _x2) {\n return _setFieldRightDialog.apply(this, arguments);\n }\n\n return setFieldRightDialog;\n }(),\n //设置权限\n authDialogOnConfirm: function authDialogOnConfirm(data, name, flag) {\n var _this4 = this;\n\n console.log('data11', data, this.currentAuthRow, flag);\n\n if (this.currentAuthRow) {\n if (flag == 1) {\n var param = {\n accessRangeType: 0,\n interfaceId: this.modelParams.id,\n interfaceName: this.modelParams.name // memo: this.currentAuthRow.memo,\n // desc: this.currentAuthRow.desc,\n\n };\n this.currentAuthRow.id ? param.id = this.currentAuthRow.id : null;\n data[0].id ? param.accessRangeId = data[0].id : null;\n param.accessRangeType = data[0].type == 'user' ? 1 : data[0].type == 'userPlus' ? 2 : data[0].type == 'org' ? 3 : data[0].type == 'orgPlus' ? 4 : data[0].type == 'orgs' ? 5 : data[0].type == 'users' ? 6 : data[0].type == 'everyone' ? 7 : null;\n console.log('param', param);\n req.post('${portal}/uc/DataAccessDefined/v1/saveDataAccessDefined', param).then(function (response) {\n if (response.data && response.data.state) {\n Message.success({\n duration: 1500,\n message: response.data.message\n });\n\n _this4.loadTable(_this4.modelParams.id);\n } else {\n Message.error(response.data.message || '失败');\n }\n });\n } else if (flag == 2) {\n var _param = {\n accessControlType: 0,\n accessDefinedId: this.currentAuthRow.id\n };\n\n for (var i = 0; i < data.length; i++) {\n _param.accessControlType = 2;\n\n if (data[i].type == 'user') {\n _param.personList = data[i].id;\n } else if (data[i].type == 'org') {\n _param.orgList = data[i].id;\n } else if (data[i].type == 'role') {\n _param.roleList = data[i].id;\n } else if (data[i].type == 'everyone') {\n _param.accessControlType = 1;\n }\n }\n\n console.log('param', _param);\n req.post('${portal}/uc/DataAccessControl/v1/saveDataAccessDefined', _param).then(function (response) {\n if (response.data && response.data.state) {\n Message.success({\n duration: 1500,\n message: response.data.message\n });\n\n _this4.loadTable(_this4.modelParams.id);\n } else {\n Message.error(response.data.message || '失败');\n }\n });\n }\n }\n }\n }\n};",null]}