From bc55e59f49229ffa77d2b32dd9fd0a9b6049b9b8 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 14 三月 2025 09:44:25 +0800 Subject: [PATCH] 1、设备类管理页面完成增删改查功能 2、产品结构树工序及工步层级引入设备类概念由系统参数配置决定是否展示,若设备类存在时则NC文档挂载在设备类下不存在时则按照对应工序或工步层级下 3、产品结构树工序及工步层级的刀具列表实现增删改查功能 4、新增设备类管理页面并完成布局 5、产品结构树接口调整,产品结构树节点实体信息通过点击后调取接口获取 6、产品结构树搜素输入框增加防抖机制,避免每次输入都重新计算消耗性能使页面卡顿 7、新增工序及工步层级的刀具列表并添加系统权限 8、用户管理页面移除新增用户时的密码校验 9、产品结构树各层级属性信息展示由每行3列调整为每行4列 10、产品结构树页面在工序和工步层级实现对设备类的增删改查功能 --- src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue | 209 ++++++++++++++++++++++++++-------------------------- 1 files changed, 105 insertions(+), 104 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue b/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue index 6491b13..07b8f9e 100644 --- a/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue +++ b/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue @@ -27,123 +27,124 @@ </template> <script> -import dncApi from '@/api/dnc' -import DepartPermissionTransfer from './DepartPermissionTransfer' -import UserPermissionTransfer from './UserPermissionTransfer' + import dncApi from '@/api/dnc' + import DepartPermissionTransfer from './DepartPermissionTransfer' + import UserPermissionTransfer from './UserPermissionTransfer' + import { queryProductionTreeList } from '@/api/api' -export default { - name: 'AssignPermissionModal', - components: { UserPermissionTransfer, DepartPermissionTransfer }, - props: { - currentTreeNodeInfo: { - type: Object - } - }, - data() { - return { - visible: false, - title: '', - isAssignSonNode: true, - activeTabKey: 1, - allDepartmentsList: [], - allUsersList: [], - allTreeKeys: [], - hasLoadedDataTabKeyArray: [] - } - }, - watch: { - visible: { - handler(value) { - if (value) { - this.activeTabKey = 1 - this.isAssignSonNode = true - this.getAllDepartmentsListByApi() + export default { + name: 'AssignPermissionModal', + components: { UserPermissionTransfer, DepartPermissionTransfer }, + props: { + currentTreeNodeInfo: { + type: Object + } + }, + data() { + return { + visible: false, + title: '', + isAssignSonNode: true, + activeTabKey: 1, + allDepartmentsList: [], + allUsersList: [], + allTreeKeys: [], + hasLoadedDataTabKeyArray: [] + } + }, + watch: { + visible: { + handler(value) { + if (value) { + this.activeTabKey = 1 + this.isAssignSonNode = true + this.getAllDepartmentsListByApi() + } + } + }, + activeTabKey: { + handler(value) { + if (this.hasLoadedDataTabKeyArray.includes(value)) return + if (value === 2) this.getAllUsersListByApi() + this.hasLoadedDataTabKeyArray.push(value) } } }, - activeTabKey: { - handler(value) { - if (this.hasLoadedDataTabKeyArray.includes(value)) return - if (value === 2) this.getAllUsersListByApi() - this.hasLoadedDataTabKeyArray.push(value) - } - } - }, - created() { - this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) - }, - methods: { - // 鐐瑰嚮鏍戣妭鐐瑰彸閿彍鍗曟潈闄愰厤缃寜閽悗瑙﹀彂 - handleAssignPermission() { - this.visible = true + created() { + this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) }, + methods: { + // 鐐瑰嚮鏍戣妭鐐瑰彸閿彍鍗曟潈闄愰厤缃寜閽悗瑙﹀彂 + handleAssignPermission() { + this.visible = true + }, - // 璋冪敤鎺ュ彛鑾峰彇鎵�鏈夎溅闂村垪琛� - getAllDepartmentsListByApi() { - this.allTreeKeys = [] - dncApi.getAllDepartmentsListApi() - .then(res => { - if (res.success) { - this.allDepartmentsList = res.result - this.generateList(this.allDepartmentsList) - this.$nextTick(() => { - this.$refs.departPermissionTransferRef.getHasPermissionDepartByApi() - this.$refs.departPermissionTransferRef.expandedKeys = this.allTreeKeys - this.$refs.departPermissionTransferRef.flatten(JSON.parse(JSON.stringify(this.allDepartmentsList))) - }) - // 鍙湁涓婃閫�鍑烘椂鍦ㄨ溅闂村垎閰峵ab鐣岄潰鎵嶄細杩涘叆姝ゅ垽鏂� - // 鑻ヤ笂娆¢��鍑烘椂鍦ㄧ敤鎴峰垎閰峵ab鐣岄潰鍒欏啀娆¤繘鍏ユ椂key鐢�2鍙樹负1鏃朵細瑙﹀彂watch鐩戞祴activeTabKey鍙樺寲鍒欎細灏唊ey:1鍔犲叆hasLoadedDataTabKeyArray锛屽洜姝ゆ棤闇�鍐嶆鍔犲叆key:1 - if (!this.hasLoadedDataTabKeyArray.includes(this.activeTabKey)) this.hasLoadedDataTabKeyArray.push(this.activeTabKey) - } - }) - }, + // 璋冪敤鎺ュ彛鑾峰彇鎵�鏈夎溅闂村垪琛� + getAllDepartmentsListByApi() { + this.allTreeKeys = [] + queryProductionTreeList() + .then(res => { + if (res.success) { + this.allDepartmentsList = res.result + this.generateList(this.allDepartmentsList) + this.$nextTick(() => { + this.$refs.departPermissionTransferRef.getHasPermissionDepartByApi() + this.$refs.departPermissionTransferRef.expandedKeys = this.allTreeKeys + this.$refs.departPermissionTransferRef.flatten(JSON.parse(JSON.stringify(this.allDepartmentsList))) + }) + // 鍙湁涓婃閫�鍑烘椂鍦ㄨ溅闂村垎閰峵ab鐣岄潰鎵嶄細杩涘叆姝ゅ垽鏂� + // 鑻ヤ笂娆¢��鍑烘椂鍦ㄧ敤鎴峰垎閰峵ab鐣岄潰鍒欏啀娆¤繘鍏ユ椂key鐢�2鍙樹负1鏃朵細瑙﹀彂watch鐩戞祴activeTabKey鍙樺寲鍒欎細灏唊ey:1鍔犲叆hasLoadedDataTabKeyArray锛屽洜姝ゆ棤闇�鍐嶆鍔犲叆key:1 + if (!this.hasLoadedDataTabKeyArray.includes(this.activeTabKey)) this.hasLoadedDataTabKeyArray.push(this.activeTabKey) + } + }) + }, - /** - * 閫掑綊鑾峰緱鎵�鏈夋爲鑺傜偣key - * @param data - */ - generateList(data) { - for (let i = 0; i < data.length; i++) { - const node = data[i] - const key = node.key - this.allTreeKeys.push(key) - if (node.children) this.generateList(node.children) - } - }, - - // 璋冪敤鎺ュ彛鑾峰彇鎵�鏈夌敤鎴峰垪琛� - getAllUsersListByApi() { - dncApi.getAllUsersListApi() - .then(res => { - if (res.success) { - this.allUsersList = res.result.records - this.$nextTick(() => this.$refs.userPermissionTransferRef.getHasPermissionUserByApi()) - } - }) - }, - - setAdminDisabled() { - this.allUsersList = this.allUsersList.map(item => { - return { - ...item, - disabled: item.username === 'admin' + /** + * 閫掑綊鑾峰緱鎵�鏈夋爲鑺傜偣key + * @param data + */ + generateList(data) { + for (let i = 0; i < data.length; i++) { + const node = data[i] + const key = node.key + this.allTreeKeys.push(key) + if (node.children) this.generateList(node.children) } - }) - }, + }, - handleModalClose() { - this.visible = false - this.hasLoadedDataTabKeyArray = [] - }, + // 璋冪敤鎺ュ彛鑾峰彇鎵�鏈夌敤鎴峰垪琛� + getAllUsersListByApi() { + dncApi.getAllUsersListApi() + .then(res => { + if (res.success) { + this.allUsersList = res.result.records + this.$nextTick(() => this.$refs.userPermissionTransferRef.getHasPermissionUserByApi()) + } + }) + }, - triggerCorrespondingMethod({ methodName, modalTitle }) { - if (this[methodName]) { - this[methodName]() - this.title = modalTitle + setAdminDisabled() { + this.allUsersList = this.allUsersList.map(item => { + return { + ...item, + disabled: item.username === 'admin' + } + }) + }, + + handleModalClose() { + this.visible = false + this.hasLoadedDataTabKeyArray = [] + }, + + triggerCorrespondingMethod({ methodName, modalTitle }) { + if (this[methodName]) { + this[methodName]() + this.title = modalTitle + } } } } -} </script> <style scoped> -- Gitblit v1.9.3