1、设备类管理页面完成增删改查功能
2、产品结构树工序及工步层级引入设备类概念由系统参数配置决定是否展示,若设备类存在时则NC文档挂载在设备类下不存在时则按照对应工序或工步层级下
3、产品结构树工序及工步层级的刀具列表实现增删改查功能
4、新增设备类管理页面并完成布局
5、产品结构树接口调整,产品结构树节点实体信息通过点击后调取接口获取
6、产品结构树搜素输入框增加防抖机制,避免每次输入都重新计算消耗性能使页面卡顿
7、新增工序及工步层级的刀具列表并添加系统权限
8、用户管理页面移除新增用户时的密码校验
9、产品结构树各层级属性信息展示由每行3列调整为每行4列
10、产品结构树页面在工序和工步层级实现对设备类的增删改查功能
| | |
| | | // è·å产åç»ææ |
| | | getProductStructureTreeApi: () => getAction('/nc/product/getTree'), |
| | | // è·å产åç»ææ èç¹å®ä½ä¿¡æ¯ |
| | | getProductStructureTreeNodeEntityApi: params => getAction('/nc/product/getTreeById', params), |
| | | getProductStructureTreeNodeEntityApi:params=> getAction('/nc/product/getTreeById',params), |
| | | // è·åææè®¾å¤çå表 |
| | | getAllDeviceListApi: (type) => getAction('/nc/device/list/all'), |
| | | // 导å
¥NCç¨åº/ææ¡£ |
| | |
| | | appointCurrentDocumentVersionApi: fileId => putAction(`/nc/file/assign/version/${fileId}`), |
| | | // ææ¡£æ¯å¯¹ |
| | | fileCompareApi: fileIdArray => getAction(`/nc/file/comparison/${fileIdArray[0]}/${fileIdArray[1]}`), |
| | | // æéé
置弹çªä¸è·åææè½¦é´å表 |
| | | getAllDepartmentsListApi: () => getAction('/mdc/mdcProduction/queryTreeListByConfig'), |
| | | // æéé
置弹çªä¸è·åææç¨æ·å表 |
| | | // è·åææé¨é¨å表 |
| | | getAllDepartmentsListApi: () => getAction('/ucenter/depart/list/all'), |
| | | // è·åææç¨æ·å表 |
| | | getAllUsersListApi: () => getAction('/sys/user/list'), |
| | | // æéé
置弹çªä¸è·åææéçé¨é¨å表 |
| | | // è·åææéçé¨é¨å表 |
| | | getHasPermissionDepartApi: ({ type, id }) => getAction(`/nc/product/get/perm/depart/${type}/${id}`), |
| | | // æéé
置弹çªä¸è·åææéçç¨æ·å表 |
| | | // è·åææéçç¨æ·å表 |
| | | getHasPermissionUserApi: ({ type, id }) => getAction(`/nc/product/get/perm/user/${type}/${id}`), |
| | | // æéé
置弹çªä¸åé
é¨é¨æé |
| | | // åé
é¨é¨æé |
| | | assignPermissionToDepart: ({ treeNodeType, treeNodeId, isAssignSonNode, departIdArray }) => { |
| | | return postAction(`/nc/product/assign/add/department/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, departIdArray) |
| | | }, |
| | | // æéé
置弹çªä¸ç§»é¤é¨é¨æé |
| | | // ç§»é¤é¨é¨æé |
| | | removePermissionFromDepart: ({ treeNodeType, treeNodeId, isAssignSonNode, departIdArray }) => { |
| | | return postAction(`/nc/product/assign/remove/department/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, departIdArray) |
| | | }, |
| | | // æéé
置弹çªä¸åé
ç¨æ¶æé |
| | | // åé
ç¨æ¶æé |
| | | assignPermissionToUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { |
| | | return postAction(`/nc/product/assign/add/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) |
| | | }, |
| | | // æéé
置弹çªä¸ç§»é¤ç¨æ·æé |
| | | // ç§»é¤ç¨æ·æé |
| | | removePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { |
| | | return postAction(`/nc/product/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) |
| | | }, |
| | | // éè¿è½¦é´IDè·å设å¤ç±»å表 |
| | | getDeviceCustomTypeListByProductionIdApi: productionId => getAction('/nc/deviceManagement/getDeviceManagementListByProductionId', { productionId }), |
| | | |
| | | //-------------------------设å¤ç»ææ ------------------------------------------------ |
| | | // è·åè®¾å¤æ |
| | |
| | | // ç§»é¤ç¨æ·æé |
| | | removeDeviceTreePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { |
| | | return postAction(`/nc/device/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) |
| | | }, |
| | | //-------------------------设å¤ç±»ç®¡ç------------------------------------------------ |
| | | // è·åææéçè½¦é´æ å表 |
| | | getHasPermissionWorkshopTreeApi: () => getAction('/nc/deviceManagement/getProductionIdsByUserId') |
| | | } |
| | | } |
| | |
| | | |
| | | <!--导å
¥æä»¶å
Œ
±å¼¹çª--> |
| | | <ImportFileModal/> |
| | | |
| | | <!--æ°å¢æç¼è¾è®¾å¤ç±»å
Œ
±å¼¹çª--> |
| | | <DeviceCustomTypeModal/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProductStructureTree from './modules/ProductStructure/ProductStructureTree' |
| | | import ProductStructureMain from './modules/ProductStructure/ProductStructureMain' |
| | | import ImportFileModal from '../common/ImportFileModal' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | import ProductStructureTree from './modules/ProductStructure/ProductStructureTree' |
| | | import ProductStructureMain from './modules/ProductStructure/ProductStructureMain' |
| | | import ImportFileModal from '../common/ImportFileModal' |
| | | |
| | | export default { |
| | | name: 'ProductStructure', |
| | | components: { |
| | | DeviceCustomTypeModal, |
| | | ProductStructureTree, |
| | | ProductStructureMain, |
| | | ImportFileModal |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | export default { |
| | | name: 'ProductStructure', |
| | | components: { |
| | | ProductStructureTree, |
| | | ProductStructureMain, |
| | | ImportFileModal |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-card-body { |
| | | padding: 8px; |
| | | } |
| | | /deep/ .ant-card-body { |
| | | padding: 8px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div style="height: 100%"> |
| | | <a-tabs style="height: 100%" v-model="activeTabKey" @change="handleTabChange"> |
| | | <div> |
| | | <a-tabs v-model="activeTabKey" @change="handleTabChange"> |
| | | <a-tab-pane :key="1" tab="设å¤å±æ§" v-if="currentTreeNodeInfo.type===2&&!currentDocumentInfo.docId"> |
| | | <DeviceInfo :currentLevelDetails="currentTreeNodeInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | |
| | | getTreeDataByApi() { |
| | | this.loading = true |
| | | this.cardLoading = true |
| | | this.treeDataSource = [] |
| | | dncApi.getDeviceTreeDataApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="åç§°" :span="2">{{currentLevelDetails.componentName}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="åç§°">{{currentLevelDetails.componentName}}</a-descriptions-item> |
| | | <a-descriptions-item label="代å·">{{currentLevelDetails.componentCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="åå· ">{{currentLevelDetails.componentModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç©æç¼ç ">{{currentLevelDetails.materielCode}}</a-descriptions-item> |
| | |
| | | <a-descriptions-item label="ç产类å">{{currentLevelDetails.produceType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å¤çç±»å ">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç»æç±»å ">{{currentLevelDetails.structureType}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" >{{currentLevelDetails.componentWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" :span="2">{{currentLevelDetails.componentWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="åå
·åç§°">{{currentLevelDetails.cutterName}}</a-descriptions-item> |
| | | <a-descriptions-item label="åå
·ç¼å·">{{currentLevelDetails.cutterCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="åå
፱Ȍ">{{currentLevelDetails.cutterType}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¢å®å¯¿å½">{{currentLevelDetails.lifetime}}</a-descriptions-item> |
| | | <a-descriptions-item label="åä½">{{currentLevelDetails.cutterSpacing}}</a-descriptions-item> |
| | | <a-descriptions-item label="æ°é">{{currentLevelDetails.quantity}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'CutterInfo', |
| | | components: {}, |
| | | props: { |
| | | currentLevelDetails: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <div style="flex: 1"> |
| | | <div> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" |
| | | :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> |
| | | |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="é¶ä»¶åç§°" :span="2">{{currentLevelDetails.partsName}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="é¶ä»¶åç§°">{{currentLevelDetails.partsName}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¶ä»¶ä»£å·">{{currentLevelDetails.partsCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¶ä»¶åå· ">{{currentLevelDetails.partsModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç©æç¼ç ">{{currentLevelDetails.materielCode}}</a-descriptions-item> |
| | |
| | | <a-descriptions-item label="ç产类å">{{currentLevelDetails.produceType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å¤çç±»å ">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç»æç±»å ">{{currentLevelDetails.structureType}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé">{{currentLevelDetails.partsWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" :span="2">{{currentLevelDetails.partsWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | </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))) |
| | | }) |
| | | // åªæä¸æ¬¡éåºæ¶å¨è½¦é´åé
tabç颿ä¼è¿å
¥æ¤å¤æ |
| | | // è¥ä¸æ¬¡éåºæ¶å¨ç¨æ·åé
tabçé¢å忬¡è¿å
¥æ¶keyç±2å为1æ¶ä¼è§¦åwatchçæµactiveTabKeyåååä¼å°key: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))) |
| | | }) |
| | | // åªæä¸æ¬¡éåºæ¶å¨è½¦é´åé
tabç颿ä¼è¿å
¥æ¤å¤æ |
| | | // è¥ä¸æ¬¡éåºæ¶å¨ç¨æ·åé
tabçé¢å忬¡è¿å
¥æ¶keyç±2å为1æ¶ä¼è§¦åwatchçæµactiveTabKeyåååä¼å°key: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> |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="å·¥åºåç§°" :span="2">{{currentLevelDetails.processName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºå·" :span="2">{{currentLevelDetails.processCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥èºç¼å·" :span="2">{{currentLevelDetails.craftNo}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="å·¥åºåç§°">{{currentLevelDetails.processName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºå·">{{currentLevelDetails.processCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥èºç¼å· ">{{currentLevelDetails.craftNo}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºç±»å">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤åå·">{{currentLevelDetails.processingEquipmentModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç±»å">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç¼å·">{{currentLevelDetails.processingEquipmentCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
ç¼å·">{{currentLevelDetails.assembleStep}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§°">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§° ">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | this.$bus.$on('sendAllDeviceList', deviceList => this.deviceList = deviceList) |
| | | }, |
| | | methods: { |
| | | add(params) { |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="å·¥æ¥åç§°">{{currentLevelDetails.stepName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥æ¥å·">{{currentLevelDetails.stepCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥æ¥ç±»å">{{currentLevelDetails.stepType}}</a-descriptions-item> |
| | |
| | | <a-descriptions-item label="å 工设å¤ç±»å">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç¼å·">{{currentLevelDetails.deviceNo}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
ç¼å·">{{currentLevelDetails.assembleStep}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§°">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§° " :span="2">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="åç§°" :span="2">{{currentLevelDetails.productName}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="åç§°">{{currentLevelDetails.productName}}</a-descriptions-item> |
| | | <a-descriptions-item label="åå·">{{currentLevelDetails.productModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="代ç ">{{currentLevelDetails.productNo}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | <template> |
| | | <div style="height: 100%;max-height: 748px"> |
| | | <!--产åç»ææ å³ä¾§é¡¶é¨åºå--> |
| | | <div style="height: 55%;overflow: hidden"> |
| | | <div style="height: 45%;overflow: hidden"> |
| | | <ProductStructureMainTop :size="tabContainerSize"/> |
| | | </div> |
| | | |
| | | <!--产åç»ææ å³ä¾§åºé¨åºå--> |
| | | <div style="height: 45%;overflow: hidden"> |
| | | <div style="height: 55%;overflow: hidden"> |
| | | <ProductStructureMainBottom :size="tabContainerSize"/> |
| | | </div> |
| | | </div> |
| | |
| | | <template> |
| | | <div v-if="+currentLevelInfo.type!==4" style="height: 100%"> |
| | | <a-tabs style="height: 100%" v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0" |
| | | @change="handleTabChange"> |
| | | <div v-if="currentLevelInfo.type!==4"> |
| | | <a-tabs v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0" @change="handleTabChange"> |
| | | <a-tab-pane :key="1" tab="屿§ä¿¡æ¯" v-if="+currentLevelInfo.type===1"> |
| | | <ProductInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | |
| | | <ProcessStepInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <!--ç³»ç»åæ°é
ç½®ä¸è¥åæ°ä¸º1æ¶æå±ç¤ºå¯¹åºå±çº§çåå
·å表--> |
| | | <a-tab-pane :key="2" tab="åå
·å表" |
| | | v-if="+currentLevelInfo.type===5&&isProcessHasCutterList||+currentLevelInfo.type===6&&isProcessStepHasCutterList"> |
| | | <CutterTableList ref="cutterTableListRef" :currentLevelInfo="currentLevelInfo" :size="containerSize"/> |
| | | <a-tab-pane :key="2" tab="åå
·ä¿¡æ¯" v-if="+currentLevelInfo.type===5||+currentLevelInfo.type===6"> |
| | | <CutterInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <template v-if="currentLevelInfo.hasOwnProperty('attributionType')"> |
| | |
| | | import ComponentInfo from './Component/ComponentInfo' |
| | | import PartInfo from './Part/PartInfo' |
| | | import ProcessInfo from './Process/ProcessInfo' |
| | | import ProcessStepInfo from './ProcessStep/ProcessStepInfo' |
| | | import CutterTableList from './Cutter/CutterTableList' |
| | | import DocumentInfo from '../../../common/DocumentInfo' |
| | | import DocumentVersionTableList from '../../../common/DocumentVersionTableList' |
| | | import UseDocumentEquipmentTableList from './Document/UseNcDocumentEquipmentTableList' |
| | | import ProcessStepInfo from './ProcessStep/ProcessStepInfo' |
| | | import FilePreview from '../../../common/FilePreview' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import { getAction } from '@/api/manage' |
| | | import CutterInfo from '@views/dnc/base/modules/ProductStructure/Cutter/CutterInfo.vue' |
| | | import dncApi from '@/api/dnc' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMainBottom', |
| | | components: { |
| | | CutterTableList, |
| | | CutterInfo, |
| | | TableContextMenu, |
| | | FilePreview, |
| | | ProcessStepInfo, |
| | |
| | | return { |
| | | activeTabKey: 1, |
| | | containerSize: 'small', |
| | | isProcessHasCutterList: false, |
| | | isProcessStepHasCutterList: false, |
| | | currentLevelInfo: {}, |
| | | currentRightClickedTableRowInfo: {}, |
| | | hasLoadedDataTabKeyArray: [] |
| | |
| | | this.$bus.$on('sendCurrentClickedDocumentInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('reloadMainBottomTableData', this.reloadMainBottomTableData) |
| | | this.getCutterListDisplayPermission('dnc_cutter_process', 'isProcessHasCutterList') |
| | | this.getCutterListDisplayPermission('dnc_cutter_step', 'isProcessStepHasCutterList') |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è·ååå
·å表å¨å·¥åºåå·¥æ¥å±çº§çå±ç¤ºæé |
| | | * @param settingKey åå±çº§å±ç¤ºæékey |
| | | * @param dataProperty ç»ä»¶dataä¸ç屿§å¼ç¨æ¥æ§å¶æ¯å¦å±ç¤º |
| | | */ |
| | | getCutterListDisplayPermission(settingKey, dataProperty) { |
| | | getAction(`/system/sysParams/query/by/settingKey?settingKey=${settingKey}`).then(res => { |
| | | if (res.success) { |
| | | this[dataProperty] = res.result.settingValue === '1' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä»¥åè¡¨æ ¼ä¼ æ¥çå½åé䏿ç¹å»çé¡¹ä¿¡æ¯ |
| | | * @param levelInfo å½åå±çº§ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentLevelInfo(levelInfo) { |
| | | this.currentLevelInfo = levelInfo |
| | | const { id, type } = levelInfo |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | console.log('res-------------', res) |
| | | this.currentLevelInfo = Object.assign(levelInfo, { entity: res.result[0] }) |
| | | } |
| | | }) |
| | | this.activeTabKey = 1 |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | }, |
| | | |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey å½åæ¿æ´»çtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | switch (activeTabKey) { |
| | | case 2: |
| | | if (this.currentLevelInfo.hasOwnProperty('attributionType')) { |
| | | console.log('ref', this.$refs.filePreviewRef) |
| | | this.$nextTick(() => this.$refs.filePreviewRef.getFilePreviewByApi()) |
| | | } else { |
| | | this.$nextTick(() => this.$refs.cutterTableListRef.setQueryParamAndLoadData(1)) |
| | | } |
| | | this.$nextTick(() => this.$refs.filePreviewRef.getFilePreviewByApi()) |
| | | break |
| | | case 3: |
| | | this.$nextTick(() => this.$refs.documentVersionTableRef.loadData()) |
| | |
| | | } |
| | | |
| | | /deep/ .ant-tabs-tabpane { |
| | | overflow: hidden auto; |
| | | overflow: auto; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div v-if="+currentTreeNodeInfo.type!==4"> |
| | | <div v-if="currentTreeNodeInfo.type!==4"> |
| | | <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()" @change="handleTabChange" |
| | | v-if="Object.keys(currentTreeNodeInfo).length!==0"> |
| | | <a-tab-pane :key="1" tab="NC管ç" v-if="+currentTreeNodeInfo.type===5||+currentTreeNodeInfo.type===6"> |
| | | <div style="display: flex;"> |
| | | <!--ç³»ç»åæ°é
ç½®ä¸è¥åæ°ä¸º1æ¶æå±ç¤ºå¯¹åºå±çº§ç设å¤ç±»å表--> |
| | | <DeviceCustomTypeTableList |
| | | v-if="+currentTreeNodeInfo.type===5&&isProcessHasDeviceTypeList||+currentTreeNodeInfo.type===6&&isProcessStepHasDeviceTypeList" |
| | | ref="deviceCustomTypeTableList" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </div> |
| | | <a-tab-pane :key="1" tab="NCææ¡£" v-if="currentTreeNodeInfo.type===5||currentTreeNodeInfo.type===6"> |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="2" tab="å
¶ä»ææ¡£"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import dncApi from '@/api/dnc' |
| | | import NcDocumentTableList from './Document/NcDocumentTableList' |
| | | import OtherDocumentTableList from './Document/OtherDocumentTableList' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' |
| | | import DeviceCustomTypeTableList |
| | | from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeTableList.vue' |
| | | import { getAction } from '@api/manage' |
| | | import dncApi from '@/api/dnc' |
| | | import NcDocumentTableList from './Document/NcDocumentTableList' |
| | | import OtherDocumentTableList from './Document/OtherDocumentTableList' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMainTop', |
| | | components: { |
| | | DeviceCustomTypeTableList, |
| | | DocumentBatchDeleteModal, |
| | | TableContextMenu, |
| | | OtherDocumentTableList, |
| | | NcDocumentTableList |
| | | }, |
| | | data() { |
| | | return { |
| | | activeTabKey: 2, |
| | | tableContainerSize: 'small', |
| | | isProcessHasDeviceTypeList: false, |
| | | isProcessStepHasDeviceTypeList: false, |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList') |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_step', 'isProcessStepHasDeviceTypeList') |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è·å设å¤ç±»åå表å¨å·¥åºåå·¥æ¥å±çº§çå±ç¤ºæé |
| | | * @param settingKey åå±çº§å±ç¤ºæékey |
| | | * @param dataProperty ç»ä»¶dataä¸ç屿§å¼ç¨æ¥æ§å¶æ¯å¦å±ç¤º |
| | | */ |
| | | getDeviceTypeListDisplayPermission(settingKey, dataProperty) { |
| | | getAction(`/system/sysParams/query/by/settingKey?settingKey=${settingKey}`).then(res => { |
| | | if (res.success) { |
| | | this[dataProperty] = res.result.settingValue === '1' |
| | | export default { |
| | | name: 'ProductStructureMainTop', |
| | | components: { DocumentBatchDeleteModal, TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, |
| | | data() { |
| | | return { |
| | | activeTabKey: 2, |
| | | tableContainerSize: 'small', |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleTableContextMenuOpen(record) { |
| | | this.currentRightClickedTableRowInfo = Object.assign({}, record) |
| | | console.log('currentRightClickedTableRowInfo', this.currentRightClickedTableRowInfo) |
| | | this.$refs.tableContextMenuRef.currentMenuLevel = record.param |
| | | this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.tableContextMenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶ |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | // æ¸
空ä¸ä¸èç¹å·²ç»å è½½è¿å¾ææ¡£å表tabKey |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | if (treeNodeInfo.type === 5 || treeNodeInfo.type === 6) { |
| | | this.activeTabKey = 1 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | this.activeTabKey = 2 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | console.log('treeNodeInfo', treeNodeInfo) |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶ |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | // æ¸
空ä¸ä¸èç¹å·²ç»å è½½è¿å¾ææ¡£å表tabKey |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | if (+treeNodeInfo.type === 5 || +treeNodeInfo.type === 6) { |
| | | this.activeTabKey = 1 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.deviceCustomTypeTableList) this.$refs.deviceCustomTypeTableList.setQueryParamAndLoadData() |
| | | else if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | this.activeTabKey = 2 |
| | | this.$nextTick(() => { |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey 忢åçtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | // 黿¢æ¥å£å¨åä¸ææ¡£ä¸æ¬¡ç¹å»å
夿¬¡è§¦å |
| | | this.hasLoadedDataTabKeyArray.push(activeTabKey) |
| | | } |
| | | }, |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åºæåå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionId èç¹Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 妿ä¸ä¼ çææ¡£ä¸æ¯æå±äºå½åæå±ç¤ºèç¹çææ¡£åä¸éæ°è·åææ¡£å表 |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | if (docClassCode === 'NC') { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | } |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleTableContextMenuOpen(record) { |
| | | this.currentRightClickedTableRowInfo = Object.assign({}, record) |
| | | console.log('currentRightClickedTableRowInfo', this.currentRightClickedTableRowInfo) |
| | | this.$refs.tableContextMenuRef.currentMenuLevel = record.param |
| | | this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.tableContextMenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey 忢åçtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | // 黿¢æ¥å£å¨åä¸ææ¡£ä¸æ¬¡ç¹å»å
夿¬¡è§¦å |
| | | this.hasLoadedDataTabKeyArray.push(activeTabKey) |
| | | } |
| | | }, |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åºæåå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionId èç¹Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 妿ä¸ä¼ çææ¡£ä¸æ¯æå±äºå½åæå±ç¤ºèç¹çææ¡£åä¸éæ°è·åææ¡£å表 |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | if (docClassCode === 'NC') { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | } |
| | | }, |
| | | |
| | | // ä¸è½½å½åå³é®éä¸ææ¡£ |
| | | handleDownload() { |
| | | const that = this |
| | | const { docId, docName } = this.currentRightClickedTableRowInfo |
| | | dncApi.downloadDocumentApi({ docId, docName }) |
| | | .then(res => { |
| | | if (res && !res.success) { |
| | | // ä¸è½½å½åå³é®éä¸ææ¡£ |
| | | handleDownload() { |
| | | const that = this |
| | | const { docId, docName } = this.currentRightClickedTableRowInfo |
| | | dncApi.downloadDocumentApi({ docId, docName }) |
| | | .then(res => { |
| | | if (res && !res.success) { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // å é¤å½åå³é®éä¸ææ¡£ |
| | | handleDelete() { |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.deleteDocumentApi(docId) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»æ¹éå é¤ååºç°å¼¹çª |
| | | * @param modalTitle å¼¹çªæ é¢ |
| | | */ |
| | | handleBatchRemove(modalTitle) { |
| | | if (!this.$refs.documentBatchDeleteModalRef) return |
| | | this.$refs.documentBatchDeleteModalRef.title = modalTitle |
| | | this.$refs.documentBatchDeleteModalRef.visible = true |
| | | }, |
| | | |
| | | /** |
| | | * åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentOutboundApi({ docId, docName }) |
| | | .then(res => { |
| | | console.log('res------------------', res) |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `${menuLabel}æå` |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | |
| | | // å é¤å½åå³é®éä¸ææ¡£ |
| | | handleDelete() { |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.deleteDocumentApi(docId) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»æ¹éå é¤ååºç°å¼¹çª |
| | | * @param modalTitle å¼¹çªæ é¢ |
| | | */ |
| | | handleBatchRemove(modalTitle) { |
| | | if (!this.$refs.documentBatchDeleteModalRef) return |
| | | this.$refs.documentBatchDeleteModalRef.title = modalTitle |
| | | this.$refs.documentBatchDeleteModalRef.visible = true |
| | | }, |
| | | |
| | | /** |
| | | * åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentOutboundApi({ docId, docName }) |
| | | .then(res => { |
| | | console.log('res------------------', res) |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `${menuLabel}æå` |
| | | }) |
| | | } else { |
| | | /** |
| | | * åæ¶åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åæ¶åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | /** |
| | | * åå¸å½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åå¸å½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | /** |
| | | * éæ°åå¸å½åå³é®éä¸ææ¡£å¹¶éæ°åå¸éåä¸ä¸ææ¡£çæ¬ |
| | | * @param menuLabel |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * éæ°åå¸å½åå³é®éä¸ææ¡£å¹¶éæ°åå¸éåä¸ä¸ææ¡£çæ¬ |
| | | * @param menuLabel |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | /** |
| | | * é彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `${menuLabel}åä¸å¯åæ¶ï¼ç¡®è®¤${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * é彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `${menuLabel}åä¸å¯åæ¶ï¼ç¡®è®¤${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ§å¶å³é®èåå
³é |
| | | handleMenuClose() { |
| | | this.$refs.tableContextMenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleMenuClose) |
| | | }, |
| | | // æ§å¶å³é®èåå
³é |
| | | handleMenuClose() { |
| | | this.$refs.tableContextMenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /deep/ .ant-table-tbody .ant-table-row { |
| | | cursor: pointer; |
| | | } |
| | | /deep/ .ant-table-tbody .ant-table-row { |
| | | cursor: pointer; |
| | | } |
| | | </style> |
| | |
| | | <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native="e=>e.preventDefault()"> |
| | | <a-spin :spinning="loading"> |
| | | <div style="display: flex;flex-direction: column;height: 100%"> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <div style="display: flex"> |
| | | <a-input placeholder="è¾å
¥å
³é®åè¿è¡æç´¢" allowClear v-model="searchInput" |
| | | @change="handleSearchInputChange"/> |
| | | <a-tooltip title="å·æ°"> |
| | | <a-button icon="reload" @click="getTreeDataByApi" style="width: 18%;margin-left: 8px"></a-button> |
| | | </a-tooltip> |
| | | <a-button type="primary" v-has="'product_add'" icon="plus" style="margin-left: 8px" |
| | | <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="expandedKeys = allTreeKeys">å±å¼ææ</a-menu-item> |
| | | <a-menu-item key="2" @click="expandedKeys = ['-1']">åå¹¶ææ</a-menu-item> |
| | | <a-menu-item key="3" @click="getTreeDataByApi">å·æ°</a-menu-item> |
| | | </a-menu> |
| | | <a-button> |
| | | <a-icon type="bars"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | <a-button type="primary" v-has="'product_add'" |
| | | @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'æ·»å 产å',methodName:'handleProductAdd'})"> |
| | | æ·»å 产å |
| | | <a-icon type="plus"></a-icon> |
| | | 产å |
| | | </a-button> |
| | | <!-- <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px">--> |
| | | <!-- <a-menu slot="overlay">--> |
| | | <!-- <a-menu-item key="1" @click="expandedKeys = allTreeKeys">å±å¼ææ</a-menu-item>--> |
| | | <!-- <a-menu-item key="2" @click="expandedKeys = ['-1']">åå¹¶ææ</a-menu-item>--> |
| | | <!-- <a-menu-item key="3" @click="getTreeDataByApi">å·æ°</a-menu-item>--> |
| | | <!-- </a-menu>--> |
| | | <!-- <a-button>--> |
| | | <!-- <a-icon type="bars"/>--> |
| | | <!-- </a-button>--> |
| | | <!-- </a-dropdown>--> |
| | | </div> |
| | | |
| | | <!--产åç»ææ --> |
| | |
| | | <a-tree blockNode show-icon :expandedKeys.sync="expandedKeys" |
| | | :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent" |
| | | @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick"> |
| | | <template slot="title" slot-scope="{ label, parentId, key:treeKey,type}"> |
| | | <template slot="title" slot-scope="{ label, parentId, entity, key:treeKey,type}"> |
| | | <ProductStructureTreeContextMenu ref="contextMenuRef" |
| | | :treeParams="{label,treeKey,searchValue,type}"/> |
| | | :treeParams="{label,treeKey,searchValue,type,entity}"/> |
| | | </template> |
| | | |
| | | <a-icon slot="switcherIcon" type="down"/> |
| | |
| | | import ProcessModal from './Process/ProcessModal' |
| | | import ProcessStepModal from './ProcessStep/ProcessStepModal' |
| | | import AssignPermissionModal from './Permission/AssignPermissionModal' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | |
| | | export default { |
| | | name: 'ProductStructureTree', |
| | | components: { |
| | | DeviceCustomTypeModal, |
| | | AssignPermissionModal, |
| | | ProcessStepModal, |
| | | ProcessModal, |
| | |
| | | autoExpandParent: true, |
| | | checkStrictly: true, |
| | | allTreeKeys: [], |
| | | currentSelected: {}, |
| | | rightClickSelected: {}, |
| | | url: { |
| | | delete: '/nc/product/delete' |
| | |
| | | getTreeDataByApi() { |
| | | this.loading = true |
| | | this.cardLoading = true |
| | | this.treeDataSource = [] |
| | | dncApi.getProductStructureTreeApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | console.log('res=================', res) |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.treeDataSource = res.result |
| | |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeSelect(selectedKeys, { node }) { |
| | | const that = this |
| | | let record = node.dataRef |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | let currentSelectedNodeInfo |
| | | if (res.result.length > 0) { |
| | | currentSelectedNodeInfo = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | currentSelectedNodeInfo = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | // åå³ä¾§ç¶çº§ç»ä»¶åéå½åé䏿 èç¹ä¿¡æ¯ |
| | | this.$bus.$emit('sendCurrentTreeNodeInfo', currentSelectedNodeInfo) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | this.currentSelected = Object.assign({}, record) |
| | | // åå³ä¾§ç¶çº§ç»ä»¶åéå½åé䏿 èç¹ä¿¡æ¯ |
| | | this.$bus.$emit('sendCurrentTreeNodeInfo', this.currentSelected) |
| | | if (selectedKeys.length === 0) return |
| | | this.selectedKeys = selectedKeys |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å³é®åå»èç¹æ¶è§¦å |
| | | * @param event äºä»¶å¯¹è±¡ |
| | | * @param node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeRightClick({ node }) { |
| | | const that = this |
| | | handleTreeRightClick({ event, node }) { |
| | | const record = node.dataRef |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | if (res.result.length > 0) { |
| | | that.rightClickSelected = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | that.rightClickSelected = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | this.rightClickSelected = Object.assign({}, record) |
| | | }, |
| | | |
| | | // æ èç¹å³é®åå»èåä¸å 餿鮿¶è§¦å |
| | |
| | | this.autoExpandParent = false |
| | | }, |
| | | |
| | | // è¾å
¥æ¥è¯¢å
容ååæ¶è§¦åï¼å¢å 鲿æºå¶ï¼ |
| | | /* è¾å
¥æ¥è¯¢å
容ååæ¶è§¦å */ |
| | | handleSearchInputChange() { |
| | | const that = this |
| | | let timer |
| | | if (timer) clearTimeout(timer) |
| | | timer = setTimeout(function() { |
| | | that.searchAndExpandTreeNode() // å å°æ¬å·è°ç¨å½æ° |
| | | }, 1000) |
| | | }, |
| | | |
| | | // 鲿彿°ä¸è§¦åæç´¢å¹¶å±å¼æ èç¹ |
| | | searchAndExpandTreeNode() { |
| | | let search = this.searchInput |
| | | let expandedKeys |
| | | let autoExpandParent |
| | |
| | | expandedKeys = this.beforeSearchExpandedKeys |
| | | autoExpandParent = false |
| | | } |
| | | |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: search, |
| | |
| | | * @param treeNode |
| | | */ |
| | | setTreeNodeIcon(treeNode) { |
| | | switch (+treeNode.type) { |
| | | switch (treeNode.type) { |
| | | case 1: |
| | | treeNode.slots = { icon: 'product' } |
| | | break |
| | |
| | | <template> |
| | | <a-dropdown :trigger="['contextmenu']"> |
| | | <span v-if="treeParams.label.indexOf(treeParams.searchValue) > -1">{{ |
| | | treeParams.label.substr(0, treeParams.label.indexOf(treeParams.searchValue)) |
| | | }}<span |
| | | class="replaceSearch">{{ |
| | | treeParams.searchValue |
| | | }}</span>{{ |
| | | treeParams.label.substr(treeParams.label.indexOf(treeParams.searchValue) + treeParams.searchValue.length) |
| | | }}</span> |
| | | <span v-if="treeParams.label.indexOf(treeParams.searchValue) > -1">{{ treeParams.label.substr(0, treeParams.label.indexOf(treeParams.searchValue)) }}<span |
| | | class="replaceSearch">{{ treeParams.searchValue }}</span>{{ treeParams.label.substr(treeParams.label.indexOf(treeParams.searchValue) + treeParams.searchValue.length) }}</span> |
| | | <span v-else>{{ treeParams.label }}</span> |
| | | <template #overlay> |
| | | <a-menu @click="({ key: menuKey }) => onContextMenuClick(treeParams.treeKey, menuKey)" |
| | | @contextmenu="event=>event.preventDefault()"> |
| | | <a-menu-item v-for="item in defaultContextMenuList[getCurrentMenuLevel]" :key="item.code" v-has="item.code"> |
| | | <a-icon :type="item.icon"/> |
| | | {{ item.label }} |
| | | {{item.label}} |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ProductStructureTreeContextMenu', |
| | | components: {}, |
| | | props: { |
| | | treeParams: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | defaultContextMenuList: { |
| | | //产å |
| | | product: [ |
| | | { label: 'æ·»å 产å', code: 'product_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¨ä»¶', code: 'product_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾äº§åä¿¡æ¯', code: 'product_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'product_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'product_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'product_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¨ä»¶ |
| | | component: [ |
| | | { label: 'æ·»å åé¨ä»¶', code: 'component_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¶ä»¶', code: 'component_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'component_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¨ä»¶ä¿¡æ¯', code: 'component_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'component_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'component_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'component_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¶ä»¶ |
| | | part: [ |
| | | { label: 'æ·»å é¶ä»¶', code: 'parts_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | // { label: 'å建工åº', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¶ä»¶ä¿¡æ¯', code: 'parts_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'parts_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'parts_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'parts_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥èºè§ç¨çæ¬ |
| | | processSpecVersion: [ |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'version_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'version_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥èºè§ç¨çæ¬ä¿¡æ¯', code: 'version_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'version_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥åº |
| | | process: [ |
| | | { label: 'å建工åº', code: 'process_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工æ¥', code: 'process_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å 设å¤ç±»', code: 'process_add_type', icon: 'plus', isCommonMethod: true }, |
| | | { label: 'ç¼è¾å·¥åºä¿¡æ¯', code: 'process_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'process_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'process_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'process_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥æ¥ |
| | | processStep: [ |
| | | { label: 'å建工æ¥', code: 'processStep_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥æ¥ä¿¡æ¯', code: 'processStep_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'æ·»å 设å¤ç±»', code: 'processStep_add_type', icon: 'plus', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'processStep_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'processStep_export', icon: 'import', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'processStep_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | getCurrentMenuLevel() { |
| | | switch (+this.treeParams.type) { |
| | | case 1: |
| | | return 'product' |
| | | case 2: |
| | | return 'component' |
| | | case 3: |
| | | return 'part' |
| | | case 4: |
| | | return 'processSpecVersion' |
| | | case 5: |
| | | return 'process' |
| | | case 6: |
| | | return 'processStep' |
| | | export default { |
| | | name: 'ProductStructureTreeContextMenu', |
| | | components: {}, |
| | | props: { |
| | | treeParams: { |
| | | type: Object |
| | | } |
| | | }, |
| | | getCurrentDocClassCode() { |
| | | switch (+this.treeParams.type) { |
| | | case 1: |
| | | return 'OTHER' |
| | | case 2: |
| | | return 'OTHER' |
| | | case 3: |
| | | return 'OTHER' |
| | | case 5: |
| | | return 'NC' |
| | | case 6: |
| | | return 'NC' |
| | | data() { |
| | | return { |
| | | defaultContextMenuList: { |
| | | //产å |
| | | product: [ |
| | | { label: 'æ·»å 产å', code: 'product_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¨ä»¶', code: 'product_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾äº§åä¿¡æ¯', code: 'product_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'product_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'product_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'product_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¨ä»¶ |
| | | component: [ |
| | | { label: 'æ·»å åé¨ä»¶', code: 'component_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¶ä»¶', code: 'component_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'component_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¨ä»¶ä¿¡æ¯', code: 'component_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'component_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'component_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'component_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¶ä»¶ |
| | | part: [ |
| | | { label: 'æ·»å é¶ä»¶', code: 'parts_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | // { label: 'å建工åº', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¶ä»¶ä¿¡æ¯', code: 'parts_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'parts_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'parts_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'parts_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥èºè§ç¨çæ¬ |
| | | processSpecVersion: [ |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'version_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'version_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥èºè§ç¨çæ¬ä¿¡æ¯', code: 'version_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'version_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥åº |
| | | process: [ |
| | | { label: 'å建工åº', code: 'process_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工æ¥', code: 'process_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥åºä¿¡æ¯', code: 'process_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'process_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'process_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'process_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥æ¥ |
| | | processStep: [ |
| | | { label: 'å建工æ¥', code: 'processStep_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥æ¥ä¿¡æ¯', code: 'processStep_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'processStep_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'processStep_export', icon: 'import', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'processStep_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | onContextMenuClick(treeKey, menuKey) { |
| | | const level = this.getCurrentMenuLevel |
| | | const param = this.getCurrentDocClassCode |
| | | console.log('level---------------------', level) |
| | | console.log('param---------------------', param) |
| | | const treeNodeInfo = Object.assign({}, this.treeParams, { param }) |
| | | console.log('treeNodeInfo******************', treeNodeInfo) |
| | | const menuKeyArray = menuKey.split('_') |
| | | const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod |
| | | // product_add => handleAdd 触å对åºç»ä»¶äºä»¶ |
| | | let methodName |
| | | // 夿æ¯å¦ä¸ºå
Œ
±æ¹æ³ï¼å¦æä¸ºå
Œ
±æ¹æ³åæªå䏿屿§product/component/part/processçåæ®µ |
| | | if (isCommonMethod) { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('') |
| | | } else { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | }, |
| | | computed: { |
| | | getCurrentMenuLevel() { |
| | | switch (this.treeParams.type) { |
| | | case 1: |
| | | return 'product' |
| | | case 2: |
| | | return 'component' |
| | | case 3: |
| | | return 'part' |
| | | case 4: |
| | | return 'processSpecVersion' |
| | | case 5: |
| | | return 'process' |
| | | case 6: |
| | | return 'processStep' |
| | | } |
| | | }, |
| | | getCurrentDocClassCode() { |
| | | switch (this.treeParams.type) { |
| | | case 1: |
| | | return 'OTHER' |
| | | case 2: |
| | | return 'OTHER' |
| | | case 3: |
| | | return 'OTHER' |
| | | case 5: |
| | | return 'NC' |
| | | case 6: |
| | | return 'NC' |
| | | } |
| | | } |
| | | console.log('methodName', methodName) |
| | | const modalTitle = this.defaultContextMenuList[level].find(item => item.code === menuKey).label |
| | | this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle, treeNodeInfo }) |
| | | }, |
| | | methods: { |
| | | onContextMenuClick(treeKey, menuKey) { |
| | | const level = this.getCurrentMenuLevel |
| | | const param = this.getCurrentDocClassCode |
| | | console.log('level---------------------', level) |
| | | console.log('param---------------------', param) |
| | | const treeNodeInfo = Object.assign({}, this.treeParams, { param }) |
| | | console.log('treeNodeInfo******************', treeNodeInfo) |
| | | const menuKeyArray = menuKey.split('_') |
| | | const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod |
| | | // product_add => handleAdd 触å对åºç»ä»¶äºä»¶ |
| | | let methodName |
| | | // 夿æ¯å¦ä¸ºå
Œ
±æ¹æ³ï¼å¦æä¸ºå
Œ
±æ¹æ³åæªå䏿屿§product/component/part/processçåæ®µ |
| | | if (isCommonMethod) { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('') |
| | | } else { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | } |
| | | const modalTitle = this.defaultContextMenuList[level].find(item => item.code === menuKey).label |
| | | this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle, treeNodeInfo }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | } |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | } |
| | | |
| | | </style> |
| | |
| | | }, |
| | | currentMenuLevel: '', |
| | | defaultContextMenuList: { |
| | | //设å¤ç±» |
| | | deviceCustomType:[ |
| | | { label: 'ç¼è¾è®¾å¤ç±»ä¿¡æ¯', code: 'type_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'type_delete', subMenu: [], icon: 'delete', isCommonMethod: false }, |
| | | { label: '导å
¥NCç¨åº', code: 'type_document_import', subMenu: [], icon: 'import', isCommonMethod: true }, |
| | | ], |
| | | //NCææ¡£ |
| | | NC: [ |
| | | { label: 'ç¼è¾ææ¡£ä¿¡æ¯', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, |
| | |
| | | validatorRules: { |
| | | username: [{ required: true, message: '请è¾å
¥ç¨æ·è´¦å·!' }, |
| | | { validator: this.validateUsername }], |
| | | password: [ |
| | | // { |
| | | // required: true, |
| | | // pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | // message: 'å¯ç ç±8使°åã大å°å忝åç¹æ®ç¬¦å·ç»æ!' |
| | | // }, |
| | | password: [{ |
| | | required: true, |
| | | pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | message: 'å¯ç ç±8使°åã大å°å忝åç¹æ®ç¬¦å·ç»æ!' |
| | | }, |
| | | { validator: this.validateToNextPassword, trigger: 'change' }], |
| | | confirmpassword: [{ required: true, message: 'è¯·éæ°è¾å
¥ç»å½å¯ç !' }, |
| | | { validator: this.compareToFirstPassword }], |