Files
tekelanew_acs/acs/nladmin-ui/node_modules/.cache/babel-loader/a8dfd92efbe8e482f073700d7fba776d.json
2024-12-05 09:33:18 +08:00

1 line
25 KiB
JSON

{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\user\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\user\\index.vue","mtime":1732871026807},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\babel.config.js","mtime":1732871025888},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nvar _interopRequireWildcard = require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/interopRequireWildcard.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/defineProperty.js\"));\nrequire(\"core-js/modules/es6.regexp.to-string\");\nrequire(\"core-js/modules/es6.array.find\");\nrequire(\"core-js/modules/es6.function.name\");\nrequire(\"core-js/modules/web.dom.iterable\");\nvar _objectSpread2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/objectSpread2.js\"));\nvar _user = _interopRequireDefault(require(\"@/views/system/user/user\"));\nvar _dept = _interopRequireDefault(require(\"@/api/system/dept\"));\nvar _dataPermission = _interopRequireDefault(require(\"@/views/system/dataPermission/dataPermission\"));\nvar _role = require(\"@/views/system/role/role\");\nvar _crud = _interopRequireWildcard(require(\"@crud/crud\"));\nvar _RR = _interopRequireDefault(require(\"@crud/RR.operation\"));\nvar _CRUD = _interopRequireDefault(require(\"@crud/CRUD.operation\"));\nvar _Pagination = _interopRequireDefault(require(\"@crud/Pagination\"));\nvar _vueTreeselect = _interopRequireWildcard(require(\"@riophae/vue-treeselect\"));\nvar _vuex = require(\"vuex\");\nrequire(\"@riophae/vue-treeselect/dist/vue-treeselect.css\");\nvar _relevanceUserDialog = _interopRequireDefault(require(\"@/views/system/user/dialog/relevanceUserDialog\"));\nvar _relevanceDeptDialog = _interopRequireDefault(require(\"@/views/system/user/dialog/relevanceDeptDialog\"));\nvar _i18n = _interopRequireDefault(require(\"@/i18n\"));\nvar _methods; //\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 userRoles = [];\nvar defaultForm = {\n dept_id: null,\n depts: [],\n username: null,\n person_name: null,\n gender: '男',\n email: null,\n is_used: true,\n roles: [],\n phone: null,\n password: null\n};\nvar _default = exports.default = {\n name: 'User',\n components: {\n RelevanceDeptDialog: _relevanceDeptDialog.default,\n RelevanceUserDialog: _relevanceUserDialog.default,\n Treeselect: _vueTreeselect.default,\n crudOperation: _CRUD.default,\n rrOperation: _RR.default,\n pagination: _Pagination.default\n },\n cruds: function cruds() {\n return (0, _crud.default)({\n title: _i18n.default.t('user.table_value.User'),\n idField: 'user_id',\n url: 'api/users',\n crudMethod: (0, _objectSpread2.default)({}, _user.default)\n });\n },\n mixins: [(0, _crud.presenter)(), (0, _crud.header)(), (0, _crud.form)(defaultForm), (0, _crud.crud)()],\n // 数据字典\n dicts: ['user_status', 'permission_scope_type'],\n data: function data() {\n return {\n height: document.documentElement.clientHeight - 180 + 'px;',\n deptName: '',\n depts: [],\n deptDatas: [],\n level: 3,\n roles: [],\n roleDatas: [],\n // 多选时使用\n defaultProps: {\n children: 'children',\n label: this.$langPre.computedProp('name')\n },\n deptProps: {\n children: 'children',\n label: 'name'\n },\n permission: {\n add: ['admin', 'user:add'],\n edit: ['admin', 'user:edit'],\n del: ['admin', 'user:del']\n },\n enabledTypeOptions: [{\n key: true,\n display_name: _i18n.default.t('user.table_value.activation')\n }, {\n key: false,\n display_name: _i18n.default.t('user.table_value.lock')\n }],\n rules: {\n username: [{\n required: true,\n message: '请输入用户名',\n trigger: 'blur'\n }, {\n min: 2,\n max: 20,\n message: '长度在 2 到 20 个字符',\n trigger: 'blur'\n }],\n person_name: [{\n required: true,\n message: '请输入用户姓名',\n trigger: 'blur'\n }, {\n min: 2,\n max: 20,\n message: '长度在 2 到 20 个字符',\n trigger: 'blur'\n }]\n },\n syncDrawer: false,\n depChecked: [],\n depCheckedId: '',\n deptsDatas: [],\n rolesDatas: [],\n drawerTitle: '',\n flag: true,\n dataPerm: false,\n dataDialog: {},\n permissions: [],\n permission_id: '',\n multipleSelection: [],\n // 选中\n relevanceUser: false,\n // 关联用户\n rowData: {},\n // 当行数据\n relevanceDept: false,\n // 关联部门\n deptIds: [],\n userIds: [],\n showData: false,\n dataPermissions: [],\n dataPermissionTitle: '数据权限'\n };\n },\n computed: (0, _objectSpread2.default)({}, (0, _vuex.mapGetters)(['user'])),\n beforeMount: function beforeMount() {\n this.deptTree();\n },\n created: function created() {\n this.crud.msg.add = '新增成功';\n },\n mounted: function mounted() {\n var that = this;\n window.onresize = function temp() {\n that.height = document.documentElement.clientHeight - 180 + 'px;';\n };\n },\n methods: (_methods = {\n changeRole: function changeRole(value) {\n userRoles = [];\n value.forEach(function (data, index) {\n var role = {\n id: data\n };\n userRoles.push(role);\n });\n },\n deleteTag: function deleteTag(value) {\n userRoles.forEach(function (data, index) {\n if (data.id === value) {\n userRoles.splice(index, value);\n }\n });\n },\n caseStatusColorFilter: function caseStatusColorFilter(is_used) {\n if (is_used === true) {\n return '#378be2';\n }\n return '#F56C6C';\n },\n handdeleted: function handdeleted(datas) {\n var _this2 = this;\n this.$confirm(\"\\u786E\\u8BA4\\u5220\\u9664\\u9009\\u4E2D\\u76841\\u6761\\u6570\\u636E?\", '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n _this2.crud.delAllLoading = true;\n _this2.crud.doDelete(datas);\n }).catch(function () {});\n }\n }, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_methods, _crud.default.HOOK.afterToCU, function (crud, form) {\n this.getRoles();\n if (form.dept_id == null) {\n _dept.default.getDepts();\n } else {\n this.getSupDepts(form.dept_id);\n }\n // this.getRoleLevel() 暂时不用\n // form.is_used = form.enabled.toString()\n }), _crud.default.HOOK.beforeToAdd, function () {\n this.form.password = '123456';\n this.roleDatas = [];\n }), _crud.default.HOOK.beforeToEdit, function (crud, form) {\n crud.status.edit;\n this.roleDatas = [];\n userRoles = [];\n var _this = this;\n if (form.roles !== null && form.roles.length > 0) {\n form.roles.forEach(function (role, index) {\n _this.roleDatas.push(role);\n var rol = {\n id: role\n };\n userRoles.push(rol);\n });\n }\n }), _crud.default.HOOK.afterValidateCU, function (crud) {\n if (!crud.form.depts) {\n this.$message({\n message: '部门不能为空',\n type: 'warning'\n });\n return false;\n } else if (this.roleDatas.length === 0) {\n this.$message({\n message: '角色不能为空',\n type: 'warning'\n });\n return false;\n }\n var roles = [];\n userRoles.forEach(function (data, index) {\n roles.push(data.id);\n });\n crud.form.roles = roles;\n return true;\n }), \"getDeptDatas\", function getDeptDatas(node, resolve) {\n var _this3 = this;\n setTimeout(function () {\n var q = {};\n // eslint-disable-next-line eqeqeq\n if (node != '') {\n q = {\n name: node\n };\n }\n _dept.default.getDeptTree(q).then(function (res) {\n if (resolve) {\n resolve(res.content);\n } else {\n _this3.deptDatas = res.content;\n }\n });\n }, 100);\n }), \"deptTree\", function deptTree() {\n var _this4 = this;\n setTimeout(function () {\n _dept.default.getDeptTree().then(function (res) {\n _this4.deptDatas = res.content;\n });\n }, 100);\n }), \"getDepts\", function getDepts() {\n var _this5 = this;\n _dept.default.getDepts({\n is_used: true\n }).then(function (res) {\n _this5.depts = res.content.map(function (obj) {\n if (obj.hasChildren) {\n obj.children = null;\n }\n return obj;\n });\n });\n }), \"getSupDepts\", function getSupDepts(deptId) {\n var _this6 = this;\n _dept.default.getDeptSuperior(deptId).then(function (res) {\n var date = res.content;\n _this6.buildDepts(date);\n _this6.depts = date;\n });\n }), \"buildDepts\", function buildDepts(depts) {\n var _this7 = this;\n depts.forEach(function (data) {\n if (data.children) {\n _this7.buildDepts(data.children);\n }\n if (data.hasChildren && !data.children) {\n data.children = null;\n }\n });\n }), \"loadDepts\", function loadDepts(_ref) {\n var action = _ref.action,\n parentNode = _ref.parentNode,\n callback = _ref.callback;\n if (action === _vueTreeselect.LOAD_CHILDREN_OPTIONS) {\n _dept.default.getDeptvo({\n is_used: true,\n pid: parentNode.dept_id\n }).then(function (res) {\n parentNode.children = res.content.map(function (obj) {\n obj.children = null;\n return obj;\n });\n setTimeout(function () {\n callback();\n }, 100);\n });\n }\n }), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_methods, \"normalizer\", function normalizer(node) {\n return {\n id: node.dept_id,\n label: node.name,\n children: node.children\n };\n }), \"handleNodeClick\", function handleNodeClick(data) {\n this.query.dept_id = data.dept_id;\n this.query.needAll = true;\n this.crud.toQuery();\n this.query.dept_id = null;\n }), \"changeEnabled\", function changeEnabled(row) {\n var _this8 = this;\n var satus = this.enabledTypeOptions.find(function (item) {\n return item.key !== row.is_used;\n });\n this.$confirm('此操作将' + satus.display_name + '账号:' + row.username + ', 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n row.is_used = satus.key;\n _user.default.edit(row).then(function (res) {\n _this8.crud.toQuery();\n _this8.crud.notify('账号' + row.username + '已' + satus.display_name);\n });\n });\n }), \"getRoles\", function getRoles() {\n var _this9 = this;\n (0, _role.getAll)().then(function (res) {\n _this9.roles = res;\n }).catch(function () {});\n }), \"getRoleLevel\", function getRoleLevel() {\n var _this10 = this;\n (0, _role.getLevel)().then(function (res) {\n _this10.level = res.level;\n }).catch(function () {});\n }), \"checkboxT\", function checkboxT(row, rowIndex) {\n // return row.id !== this.user.id\n return true;\n }), \"resetPassword\", function resetPassword(row) {\n var _this11 = this;\n this.$confirm(\"\\u786E\\u8BA4\\u91CD\\u7F6E\\u5BC6\\u7801\\uFF1F\", '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n row.password = '123456';\n _user.default.edit(row).then(function (res) {\n _this11.crud.toQuery();\n _this11.crud.notify('密码重置成功,密码:123456', _crud.default.NOTIFICATION_TYPE.SUCCESS);\n });\n });\n }), \"openDeptDrawer\", function openDeptDrawer(row) {\n var _this12 = this;\n _dept.default.getDeptTree().then(function (res) {\n _this12.deptsDatas = res.content;\n });\n this.openDrawer(); // 打开抽屉\n this.drawerTitle = '分配部门权限';\n this.flag = true;\n // 默认选中\n var deptIds = [];\n for (var index in row.depts) {\n deptIds.push(row.depts[index].dept_id);\n }\n this.$nextTick(function () {\n _this12.$refs.deptUser.setCheckedKeys(deptIds);\n });\n this.giveValue(row);\n }), \"openRoleDrawer\", function openRoleDrawer(row) {\n var _this13 = this;\n this.rolesDatas = [];\n (0, _role.getAll)().then(function (res) {\n _this13.rolesDatas = res;\n // 回显默认选中\n _this13.$nextTick(function () {\n for (var j = 0; j < row.roles.length; j++) {\n for (var i = 0; i < this.rolesDatas.length; i++) {\n if (this.rolesDatas[i].roleId === row.roles[j].roleId) {\n this.$refs.roleTable.toggleRowSelection(this.rolesDatas[i], true);\n break;\n }\n }\n }\n });\n });\n this.openDrawer();\n this.drawerTitle = '分配角色权限';\n this.flag = false;\n this.giveValue(row);\n }), \"openDataDialog\", function openDataDialog(row) {\n var _this14 = this;\n // 清空数据 应该需要初始化赋值\n this.dataDialog = {};\n this.multipleSelection = [];\n // 获取权限范围\n _dataPermission.default.getDataScopeType().then(function (res) {\n console.log('权限范围', res);\n _this14.dataDialog.dataScopeType = res;\n // permissions\n _dataPermission.default.getDataPermissionOption().then(function (res) {\n console.log('数据权限', res);\n _this14.permissions = res;\n _this14.dataDialog.person_name = row.person_name;\n _this14.dataDialog.username = row.username;\n _this14.dataDialog.user_id = row.user_id;\n _this14.dataPermissionTitle = '[' + row.person_name + '] 数据权限';\n _this14.dataPerm = true;\n // 回显数据\n _dataPermission.default.getDataShow(row.user_id).then(function (res) {\n console.log('要回显的数据', res);\n _this14.$nextTick(function () {\n for (var index = 0; index < res.length; index++) {\n for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {\n if (this.dataDialog.dataScopeType[i].value === res[index].permissionScopeType) {\n this.dataDialog.dataScopeType[i].permission_id = res[index].permission_id;\n if (res[index].users) this.dataDialog.dataScopeType[i].users = res[index].users;\n if (res[index].depts) this.dataDialog.dataScopeType[i].depts = res[index].depts;\n // 选中\n this.$refs.dialogTable.toggleRowSelection(this.dataDialog.dataScopeType[i], true);\n break;\n }\n }\n }\n });\n });\n });\n });\n }), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_methods, \"getRows\", function getRows(val) {\n // 获取行数据\n this.multipleSelection = val;\n }), \"openRelevance\", function openRelevance(row, index) {\n for (var i = 0; i < this.permissions.length; i++) {\n if (this.permissions[i].permission_id !== undefined && this.permissions[i].permission_id && this.permissions[i].permission_id !== row.permission_id) {\n this.$delete(this.dataDialog.dataScopeType[index], this.permissions[i].permission_id.toString());\n }\n }\n this.$set(this.dataDialog.dataScopeType[index], this.dataDialog.dataScopeType[index].permission_id, row.permission_id);\n this.rowData = {};\n this.deptIds = [];\n this.userIds = [];\n if (row.permission_id === '1605129738328870912') {\n // 选择用户\n this.userIds = this.dataDialog.dataScopeType[index].users;\n this.rowData = row;\n this.relevanceUser = true;\n } else if (row.permission_id === '1605129882164137984') {\n // 选择部门\n this.deptIds = this.dataDialog.dataScopeType[index].depts;\n this.rowData = row;\n this.relevanceDept = true;\n } else if (row.permission_id === '1605128919449735168') {\n // 自身\n var param = {\n userId: this.dataDialog.userId\n };\n this.dataDialog.dataScopeType[index].users = [];\n this.dataDialog.dataScopeType[index].users.push(param);\n } else {\n // 其他应该清空\n this.dataDialog.dataScopeType[index].depts = [];\n this.dataDialog.dataScopeType[index].users = [];\n }\n }), \"selectUsers\", function selectUsers(row) {\n // row对话框传来的数据\n for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {\n if (this.dataDialog.dataScopeType[i].dict_id === this.rowData.dict_id) {\n if (this.dataDialog.dataScopeType[i].depts !== undefined && this.dataDialog.dataScopeType[i].depts.length > 0) this.dataDialog.dataScopeType[i].depts = [];\n this.dataDialog.dataScopeType[i].users = row;\n break;\n }\n }\n this.rowData = {};\n }), \"selectDepts\", function selectDepts(row) {\n for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {\n if (this.dataDialog.dataScopeType[i].dict_id === this.rowData.dictId) {\n if (this.dataDialog.dataScopeType[i].users !== undefined && this.dataDialog.dataScopeType[i].users.length > 0) this.dataDialog.dataScopeType[i].users = [];\n this.dataDialog.dataScopeType[i].depts = row;\n break;\n }\n }\n this.rowData = {};\n }), \"cancelDataPerm\", function cancelDataPerm() {\n this.dataPerm = false;\n }), \"savePermise\", function savePermise() {\n var _this15 = this;\n var param = {\n user_id: this.dataDialog.user_id,\n datas: this.multipleSelection\n };\n _dataPermission.default.saveDataPermission(param).then(function (res) {\n _this15.dataPerm = false;\n _this15.crud.notify('添加数据权限成功', _crud.default.NOTIFICATION_TYPE.SUCCESS);\n _this15.crud.toQuery();\n });\n }), \"openDrawer\", function openDrawer() {\n this.syncDrawer = true;\n this.depCheckedId = '';\n this.depChecked = [];\n }), \"giveValue\", function giveValue(row) {\n this.depCheckedId = row.user_id;\n }), \"clearCheck\", function clearCheck() {\n // 清空选中\n if (this.flag) this.$refs.deptUser.setCheckedKeys([]);\n }), \"handleClose\", function handleClose(done) {\n this.$confirm('确认关闭?').then(function (_) {\n done();\n }).catch(function (_) {});\n }), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_methods, \"cancelForm\", function cancelForm() {\n // 关闭\n this.syncDrawer = false;\n if (this.flag) this.clearCheck();\n }), \"saveChecked\", function saveChecked() {\n var _this16 = this;\n var user = {\n user_id: this.depCheckedId\n };\n if (this.flag) {\n user.deptIds = this.$refs.deptUser.getCheckedKeys();\n } else {\n user.rolesIds = this.crud.selections.map(function (item) {\n return item.role_id;\n });\n }\n _user.default.edit(user).then(function (res) {\n _this16.cancelForm();\n _this16.crud.notify('保存成功', _crud.default.NOTIFICATION_TYPE.SUCCESS);\n _this16.crud.toQuery();\n });\n }), \"handCheck\", function handCheck(data, node) {\n this.hanleCheck(data, node, 'deptUser');\n }), \"hanleCheck\", function hanleCheck(data, node, treeName) {\n var _this = this;\n // 获取当前节点是否被选中\n var isChecked = _this.$refs[treeName].getNode(data).checked;\n // 如果当前节点被选中,则遍历下级子节点并选中,如果当前节点取消选中,则遍历下级节点并取消\n if (isChecked) {\n // 判断该节点是否有下级节点,如果有那么遍历设置下级节点为选中\n data.children && data.children.length > 0 && setChildreChecked(data.children, true);\n } else {\n // 如果节点取消选中,则取消该节点下的子节点选中\n data.children && data.children.length > 0 && setChildreChecked(data.children, false);\n }\n function setChildreChecked(node, isChecked) {\n node.forEach(function (item) {\n item.children && item.children.length > 0 && setChildreChecked(item.children, isChecked);\n // 修改勾选状态\n _this.$refs[treeName].setChecked(item.name, isChecked);\n });\n }\n }), \"checkChange\", function checkChange(data, checked, indeterminate) {\n var _this = this;\n // console.log(data, checked, indeterminate);\n // 选中全部子节点,父节点也默认选中,但是子节点再次取消勾选或者全部子节点取消勾选也不会影响父节点勾选状态\n var checkNode = _this.$refs.deptUser.getNode(data); // 获取当前节点\n // 勾选部分子节点,父节点变为半选状态\n if (checkNode.parent && checkNode.parent.childNodes.some(function (ele) {\n return ele.checked;\n })) {\n checkNode.parent.indeterminate = true;\n }\n // 勾选全部子节点,父节点变为全选状态\n if (checkNode.parent && checkNode.parent.childNodes.every(function (ele) {\n return ele.checked;\n })) {\n checkNode.parent.checked = true;\n checkNode.parent.indeterminate = false;\n }\n // 如果取消所有第二节点的勾选状态,则第一层父节点也取消勾选\n if (checkNode.level === 2 && checkNode.parent.childNodes.every(function (ele) {\n return !ele.checked;\n })) {\n checkNode.parent.checked = false;\n checkNode.parent.indeterminate = false;\n }\n }), \"showDatas\", function showDatas(row) {\n var _this17 = this;\n var param = {\n userId: this.dataDialog.userId,\n permissionScopeType: row.value\n };\n _dataPermission.default.getDataDetail(param).then(function (res) {\n _this17.dataPermissions = res;\n });\n this.showData = true;\n }))\n};",null]}