1、DNC结构树页面解决因keep-alive标签缓存组件后切换路由无法正常销毁组件从而使组件内事件通过$bus重复调用的问题
2、DNC产品结构树页面工艺规程版本层级下可以导入和挂载其它文档并且展示相关属性信息
3、DNC设备结构树设备的层级由2调整到7并且调整层级影响的相关功能
已添加1个文件
已修改13个文件
838 ■■■■ 文件已修改
src/api/dnc.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureMainTop.vue 715 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/DocumentInfo.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/dnc.js
@@ -28,7 +28,7 @@
  // æŒ‡æ´¾æ–‡æ¡£åˆ°è®¾å¤‡
  assignDocumentToDeviceApi: params => postAction('/nc/activit/assign/file/apply', params),
  // ä¸‹è½½æ–‡æ¡£
  downloadDocumentApi: ({ docId, docName }) => downloadFile(`/nc/doc/download/${docId}`, docName),
  downloadDocumentApi: ({ docId, docName }) => requestGetDownLoad(`/nc/doc/download/${docId}`, docName),
  // åˆ é™¤æ–‡æ¡£
  deleteDocumentApi: docId => deleteAction(`/nc/doc/delete?id=${docId}`),
  // æ–‡æ¡£å‡ºåº“
src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue
@@ -3,12 +3,12 @@
    <template v-if="+currentTreeNodeInfo.type===2">
      <div style="height: 100%;max-height: 748px">
        <!--产品结构树右侧顶部区域-->
        <div style="height: 45%;overflow: hidden">
        <div style="height: 55%;overflow: hidden">
          <DeviceStructureMainTop :size="containerSize" ref="mainTopRef" :currentTreeNodeInfo="currentTreeNodeInfo"/>
        </div>
        <!--产品结构树右侧底部区域-->
        <div style="height: 55%;overflow: hidden">
        <div style="height: 45%;overflow: hidden">
          <DeviceStructureMainBottom :size="containerSize" :currentTreeNodeInfo="currentTreeNodeInfo"/>
        </div>
      </div>
src/views/dnc/base/modules/DeviceStructure/DeviceStructureMainTop.vue
@@ -4,11 +4,13 @@
            v-if="Object.keys(currentTreeNodeInfo).length!==0">
      <a-tab-pane :key="1" tab="发送">
        <HasSentDocumentTableList ref="hasSentDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                                  :currentTypeOfDevice="currentTypeOfDevice"
                                  @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
      </a-tab-pane>
      <a-tab-pane :key="2" tab="接收">
        <HasReceivedDocumentTableList ref="hasReceivedDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                                      :currentTypeOfDevice="currentTypeOfDevice"
                                      @handleTableContextMenuOpen="handleTableContextMenuOpen"
                                      :size="tableContainerSize"/>
      </a-tab-pane>
@@ -22,403 +24,408 @@
</template>
<script>
  import dncApi from '@/api/dnc'
  import TableContextMenu from '../../../common/TableContextMenu'
  import HasSentDocumentTableList from './Document/HasSentDocumentTableList'
  import HasReceivedDocumentTableList from './Document/HasReceivedDocumentTableList'
  import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal'
import dncApi from '@/api/dnc'
import TableContextMenu from '../../../common/TableContextMenu'
import HasSentDocumentTableList from './Document/HasSentDocumentTableList'
import HasReceivedDocumentTableList from './Document/HasReceivedDocumentTableList'
import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal'
  export default {
    name: 'DeviceStructureMainTop',
    components: { DocumentBatchDeleteModal, HasReceivedDocumentTableList, HasSentDocumentTableList, TableContextMenu },
    props: {
      currentTreeNodeInfo: {
        type: Object
      }
export default {
  name: 'DeviceStructureMainTop',
  components: { DocumentBatchDeleteModal, HasReceivedDocumentTableList, HasSentDocumentTableList, TableContextMenu },
  props: {
    currentTreeNodeInfo: {
      type: Object
    }
  },
  data() {
    return {
      activeTabKey: 1,
      tableContainerSize: 'small',
      currentTypeOfDevice: 7,// äº§å“ç»“构树中定义的设备层级type为7
      currentRightClickedTableRowInfo: {},
      hasLoadedDataTabKeyArray: []
    }
  },
  created() {
    this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData)
    this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
  beforeDestroy() {
    this.$bus.$off('reloadDocumentListData', this.reloadDocumentListData)
    this.$bus.$off('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
  methods: {
    /**
     * æŽ§åˆ¶å³é”®èœå•开启
     * @param record å½“前表格行信息
     */
    handleTableContextMenuOpen(record) {
      this.currentRightClickedTableRowInfo = Object.assign({}, record)
      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)
    },
    data() {
      return {
        activeTabKey: 1,
        tableContainerSize: 'small',
        currentRightClickedTableRowInfo: {},
        hasLoadedDataTabKeyArray: []
      }
    },
    created() {
      this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData)
      this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      /**
       * æŽ§åˆ¶å³é”®èœå•开启
       * @param record å½“前表格行信息
       */
      handleTableContextMenuOpen(record) {
        this.currentRightClickedTableRowInfo = Object.assign({}, record)
        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 æ ‘节点信息
       */
      loadHasSentDocumentListData(treeNodeInfo) {
        this.$nextTick(() => {
          if (this.$refs.hasSentDocumentTableListRef) {
            this.$refs.hasSentDocumentTableListRef.loadData(1)
            this.hasLoadedDataTabKeyArray.push(this.activeTabKey)
          }
        })
      },
      /**
       * tab标签切换时触发
       * @param activeTabKey å½“前已激活tab的key
       */
      handleTabChange(activeTabKey) {
        this.$bus.$emit('handleSwitchDeviceDocClassCode', activeTabKey)
        if (activeTabKey && !this.hasLoadedDataTabKeyArray.includes(activeTabKey)) {
          if (activeTabKey === 1) {
            this.$nextTick(() => {
              if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1)
            })
          } else {
            this.$nextTick(() => {
              if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1)
            })
          }
          this.hasLoadedDataTabKeyArray.push(activeTabKey)
    /**
     * å½“树组件选中设备层级节点时触发获取已发送文档列表
     * @param treeNodeInfo æ ‘节点信息
     */
    loadHasSentDocumentListData(treeNodeInfo) {
      this.$nextTick(() => {
        if (this.$refs.hasSentDocumentTableListRef) {
          this.$refs.hasSentDocumentTableListRef.loadData(1)
          this.hasLoadedDataTabKeyArray.push(this.activeTabKey)
        }
      },
      })
    },
      /**
       * æ–‡æ¡£ä»¥åŠNC程序导入/出库/入库/删除成功后触发重新加载文档列表
       * @param docClassCode æ–‡æ¡£ç±»åˆ«
       * @param attributionId èŠ‚ç‚¹Id
       */
      reloadDocumentListData({ docClassCode, attributionId }) {
        // å¦‚果上传的文档不是所属于当前所展示节点的文档则不重新获取文档列表
        if (this.currentTreeNodeInfo.key !== attributionId) return
        if (docClassCode === 'SEND') {
          if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1)
        } else {
          if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1)
        }
      },
      // ä¸‹è½½å½“前右键选中文档
      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
              })
            }
    /**
     * tab标签切换时触发
     * @param activeTabKey å½“前已激活tab的key
     */
    handleTabChange(activeTabKey) {
      this.$bus.$emit('handleSwitchDeviceDocClassCode', activeTabKey)
      if (activeTabKey && !this.hasLoadedDataTabKeyArray.includes(activeTabKey)) {
        if (activeTabKey === 1) {
          this.$nextTick(() => {
            if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1)
          })
          .catch(err => {
        } else {
          this.$nextTick(() => {
            if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1)
          })
        }
        this.hasLoadedDataTabKeyArray.push(activeTabKey)
      }
    },
    /**
     * æ–‡æ¡£ä»¥åŠNC程序导入/出库/入库/删除成功后触发重新加载文档列表
     * @param docClassCode æ–‡æ¡£ç±»åˆ«
     * @param attributionId èŠ‚ç‚¹Id
     */
    reloadDocumentListData({ docClassCode, attributionId }) {
      // å¦‚果上传的文档不是所属于当前所展示节点的文档则不重新获取文档列表
      if (this.currentTreeNodeInfo.key !== attributionId) return
      if (docClassCode === 'SEND') {
        if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1)
      } else {
        if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1)
      }
    },
    // ä¸‹è½½å½“前右键选中文档
    handleDownload() {
      const that = this
      const { docId, docName } = this.currentRightClickedTableRowInfo
      dncApi.downloadDocumentApi({ docId, docName })
        .then(res => {
          if (res && !res.success) {
            that.$notification.error({
              message: '消息',
              description: err.message
              description: res.message
            })
          }
        })
        .catch(err => {
          that.$notification.error({
            message: '消息',
            description: err.message
          })
      },
      // åˆ é™¤å½“前右键选中文档
      handleDelete() {
        const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
        const that = this
        that.$confirm({
          title: '提示',
          content: `删除后不可取消,确认删除吗?`,
          okText: '确认',
          cancelText: '取消',
          onOk: () => {
            dncApi.deleteDeviceRelativeDocumentApi({ docId, attributionId })
              .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
      },
    // åˆ é™¤å½“前右键选中文档
    handleDelete() {
      const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
      const that = this
      that.$confirm({
        title: '提示',
        content: `删除后不可取消,确认删除吗?`,
        okText: '确认',
        cancelText: '取消',
        onOk: () => {
          dncApi.deleteDeviceRelativeDocumentApi({ docId, attributionId })
            .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 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) {
                  this.reloadDocumentListData({ docClassCode: param, attributionId })
                  that.$notification.success({
                    message: '消息',
                    description: `${menuLabel}成功`
                  })
                } else {
                  that.$notification.error({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .catch(err => {
    /**
     * ç‚¹å‡»æ‰¹é‡åˆ é™¤åŽå‡ºçŽ°å¼¹çª—
     * @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) {
                this.reloadDocumentListData({ docClassCode: param, attributionId })
                that.$notification.success({
                  message: '消息',
                  description: `${menuLabel}成功`
                })
              } else {
                that.$notification.error({
                  message: '消息',
                  description: err.message
                  description: res.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 {
                  that.$notification.error({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .catch(err => {
    /**
     * å‘布当前右键选中文档
     * @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: err.message
                  description: res.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 {
                  that.$notification.error({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .catch(err => {
    /**
     * ç‚¹å‡»å‘布时触发当前文档发布
     * @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: err.message
                  description: res.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 {
                  that.$notification.error({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .catch(err => {
    /**
     * é‡æ–°å‘布当前右键选中文档并重新发布退回上一文档版本
     * @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: err.message
                  description: res.message
                })
              }
            })
            .catch(err => {
              that.$notification.error({
                message: '消息',
                description: err.message
              })
              .finally(() => {
                that.$destroyAll()
              })
          },
          onCancel: () => {
            that.$destroyAll()
          }
        })
      },
            })
            .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 => {
    /**
     * é‡å½’档当前右键选中文档且后续无法继续发布或归档
     * @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: err.message
                  description: res.message
                })
              }
            })
            .catch(err => {
              that.$notification.error({
                message: '消息',
                description: err.message
              })
              .finally(() => {
                that.$destroyAll()
              })
          },
          onCancel: () => {
            that.$destroyAll()
          }
        })
      },
            })
            .finally(() => {
              that.$destroyAll()
            })
        },
        onCancel: () => {
          that.$destroyAll()
        }
      })
    },
      // é‡ç½®tabKey并且释放加载文档列表的接口
      releaseLoadDocumentListApi() {
        this.hasLoadedDataTabKeyArray = []
        this.handleTabChange(this.activeTabKey)
      },
    // é‡ç½®tabKey并且释放加载文档列表的接口
    releaseLoadDocumentListApi() {
      this.hasLoadedDataTabKeyArray = []
      this.handleTabChange(this.activeTabKey)
    },
      // æŽ§åˆ¶å³é”®èœå•关闭
      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>
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue
@@ -78,6 +78,10 @@
      this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
      this.$bus.$on('handleSwitchDeviceDocClassCode', this.setCurrentDeviceDocClassCode)
    },
    beforeDestroy() {
      this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
      this.$bus.$off('handleSwitchDeviceDocClassCode', this.setCurrentDeviceDocClassCode)
    },
    methods: {
      getTreeDataByApi() {
        this.loading = true
@@ -119,7 +123,6 @@
        this.$bus.$emit('sendDeviceTreeNodeInfo', this.currentSelected)
        if (selectedKeys.length === 0) return
        this.selectedKeys = selectedKeys
      },
      /**
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue
@@ -51,8 +51,8 @@
        const { param } = this.treeParams
        const treeNodeInfo = Object.assign({}, this.treeParams, { param })
        console.log('treeNodeInfo++++++++++++++++++++++++++++', treeNodeInfo)
        if (treeNodeInfo.type === 2) treeNodeInfo.type = 4
        // è®¾å¤‡ç»“构树节点中的设备层级为2,但在产品结构树中将设备层级的type设置为4,为保证两个结构树共用的方法能正常运行,因此在此处同样设置为4
        if (treeNodeInfo.type === 2) treeNodeInfo.type = 7
        // è®¾å¤‡ç»“构树节点中的设备层级为2,但在产品结构树中将设备层级的type设置为7,因此在此处设置为7
        const menuKeyArray = menuKey.split('_')
        const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod
        // product_add => handleAdd è§¦å‘对应组件事件
src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue
@@ -1,7 +1,7 @@
<template>
  <div>
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination"
             :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
             :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
    </a-table>
@@ -21,6 +21,9 @@
    props: {
      currentTreeNodeInfo: {
        type: Object
      },
      currentTypeOfDevice:{
        type:Number
      },
      size: {
        type: String
@@ -109,7 +112,7 @@
        var params = this.getQueryParams()//查询条件
        console.log('currentTreeNodeInfo', this.currentTreeNodeInfo)
        params.attributionId = this.currentTreeNodeInfo.key
        params.attributionType = 4
        params.attributionType = this.currentTypeOfDevice
        params.docClassCode = 'REC'
        if (!params) return false
        this.dataSource = []
src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue
@@ -1,7 +1,7 @@
<template>
  <div>
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination"
             :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
             :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
    </a-table>
@@ -21,6 +21,9 @@
    props: {
      currentTreeNodeInfo: {
        type: Object
      },
      currentTypeOfDevice:{
        type:Number
      },
      size: {
        type: String
@@ -119,7 +122,7 @@
        var params = this.getQueryParams()//查询条件
        console.log('currentTreeNodeInfo', this.currentTreeNodeInfo)
        params.attributionId = this.currentTreeNodeInfo.key
        params.attributionType = 4
        params.attributionType = this.currentTypeOfDevice
        params.docClassCode = 'SEND'
        if (!params) return false
        this.dataSource = []
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue
@@ -69,8 +69,8 @@
    },
    triggerCorrespondingMethod({ methodName, modalTitle, treeNodeInfo, tableRowInfo }) {
      console.log('触发右键菜单')
      if (this[methodName]) {
        console.log('触发右键菜单')
        this.title = modalTitle
        this[methodName](treeNodeInfo, tableRowInfo)
      }
src/views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
<template>
  <a-descriptions bordered :size="size" :column="4">
    <a-descriptions-item label="工艺规程版本号" :span="2">{{ currentLevelDetails.processSpecVersionCode }}
    </a-descriptions-item>
    <a-descriptions-item label="工艺规程版本名称" :span="2">{{ currentLevelDetails.processSpecVersionName }}
    </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>
</template>
<script>
export default {
  name: 'ProcessSpecVersionInfo',
  components: {},
  props: {
    currentLevelDetails: {
      type: Object
    },
    size: {
      type: String
    }
  },
  data() {
    return {}
  },
  methods: {}
}
</script>
<style scoped>
</style>
src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue
@@ -1,5 +1,5 @@
<template>
  <div v-if="+currentLevelInfo.type!==4" style="height: 100%">
  <div style="height: 100%">
    <a-tabs style="height: 100%" v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0"
            @change="handleTabChange">
      <a-tab-pane :key="1" tab="属性信息" v-if="+currentLevelInfo.type===1">
@@ -12,6 +12,10 @@
      <a-tab-pane :key="1" tab="零件属性" v-if="+currentLevelInfo.type===3">
        <PartInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
      </a-tab-pane>
      <a-tab-pane :key="1" tab="属性信息" v-if="+currentLevelInfo.type===4">
        <ProcessSpecVersionInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
      </a-tab-pane>
      <a-tab-pane :key="1" tab="工序属性" v-if="+currentLevelInfo.type===5">
@@ -72,13 +76,16 @@
import UseDocumentEquipmentTableList from './Document/UseNcDocumentEquipmentTableList'
import FilePreview from '../../../common/FilePreview'
import TableContextMenu from '../../../common/TableContextMenu'
import { getAction } from '@/api/manage'
import UseDeviceCustomTypeEquipmentTableList
  from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/UseDeviceCustomTypeEquipmentTableList.vue'
import ProcessSpecVersionInfo
  from '@views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue'
import { getAction } from '@/api/manage'
export default {
  name: 'ProductStructureMainBottom',
  components: {
    ProcessSpecVersionInfo,
    UseDeviceCustomTypeEquipmentTableList,
    CutterTableList,
    TableContextMenu,
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
@@ -1,5 +1,5 @@
<template>
  <div v-if="+currentTreeNodeInfo.type!==4">
  <div>
    <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">
@@ -69,6 +69,12 @@
    this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList')
    this.getDeviceTypeListDisplayPermission('dnc_device_type_step', 'isProcessStepHasDeviceTypeList')
  },
  beforeDestroy() {
    this.$bus.$off('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo)
    this.$bus.$off('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo)
    this.$bus.$off('reloadDocumentListData', this.reloadDocumentListData)
    this.$bus.$off('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
  methods: {
    /**
     * èŽ·å–è®¾å¤‡ç±»åž‹åˆ—è¡¨åœ¨å·¥åºå’Œå·¥æ­¥å±‚çº§çš„å±•ç¤ºæƒé™
@@ -89,15 +95,24 @@
     */
    receiveCurrentTreeNodeInfo(treeNodeInfo) {
      console.log('treeNodeInfo', treeNodeInfo)
      const { id, type } = treeNodeInfo
      // ä»Žæ ‘组件接受树节点信息后从父组件流入子组件
      this.currentTreeNodeInfo = treeNodeInfo
      this.currentNCDocumentAttributionInfo = Object.assign({}, {
        attributionId: id,
        attributionType: type,
        docClassCode: 'NC'
      })
      // æ¸…空上一节点已经加载过得文档列表tabKey
      this.hasLoadedDataTabKeyArray = []
      if (+treeNodeInfo.type === 5 || +treeNodeInfo.type === 6) {
      if (+type === 5 || +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)
          if (this.$refs.deviceCustomTypeTableList) {
            this.$refs.deviceCustomTypeTableList.setQueryParamAndLoadData()
            // åˆ‡æ¢æ ‘之后清空NC程序列表
            if (this.$refs.ncDocumentTableListRef && this.$refs.ncDocumentTableListRef.dataSource.length > 0) this.$refs.ncDocumentTableListRef.dataSource = []
          } else if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1)
        })
      } else {
        this.activeTabKey = 2
@@ -179,7 +194,7 @@
      const { docId, docName } = this.currentRightClickedTableRowInfo
      dncApi.downloadDocumentApi({ docId, docName })
        .then(res => {
          if (res && !res.success) {
          if (!res.success) {
            that.$notification.error({
              message: '消息',
              description: res.message
@@ -254,7 +269,6 @@
        onOk: () => {
          dncApi.documentOutboundApi({ docId, docName })
            .then(res => {
              console.log('res------------------', res)
              if (res.success) {
                that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType })
                that.$notification.success({
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
@@ -114,6 +114,9 @@
    this.getTreeDataByApi()
    this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
  beforeDestroy() {
    this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
  methods: {
    getTreeDataByApi() {
      this.loading = true
@@ -243,6 +246,7 @@
    /**
     * è‡ªåŠ¨å±•å¼€æ·»åŠ ä¸‹çº§èŠ‚ç‚¹çš„çˆ¶èŠ‚ç‚¹
     * @param isAddNextLevel æ˜¯å¦éœ€è¦å±•开下级
     */
    modalFormSubmitSuccess(isAddNextLevel) {
      // åˆ¤æ–­æ˜¯å¦ä¸ºæ·»åŠ ä¸‹çº§å¹¶ä¸”åˆ¤æ–­çˆ¶èŠ‚ç‚¹æ˜¯å¦å±•å¼€
src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue
@@ -70,6 +70,7 @@
          { 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_import', icon: 'import', isCommonMethod: true },
          { label: '删除', code: 'version_delete', icon: 'delete', isCommonMethod: true },
          { label: '权限配置', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true }
        ],
@@ -122,6 +123,8 @@
          return 'OTHER'
        case 3:
          return 'OTHER'
        case 4:
          return 'OTHER'
        case 5:
          return 'NC'
        case 6:
src/views/dnc/common/DocumentInfo.vue
@@ -1,18 +1,18 @@
<template>
  <a-descriptions bordered :size="size">
  <a-descriptions bordered :size="size" :column="4">
    <a-descriptions-item label="文档名称">{{currentLevelDetails.docName}}</a-descriptions-item>
    <a-descriptions-item label="代码版本">{{currentLevelDetails.docAlias}}</a-descriptions-item>
    <a-descriptions-item label="设备编号    ">{{currentLevelDetails.docCode}}</a-descriptions-item>
    <a-descriptions-item label="设备编号">{{currentLevelDetails.docCode}}</a-descriptions-item>
    <a-descriptions-item label="文档后缀">{{currentLevelDetails.docSuffix}}</a-descriptions-item>
    <a-descriptions-item label="文档状态">{{currentLevelDetails.docStatus_dictText}}</a-descriptions-item>
    <a-descriptions-item label="系统指定版本">{{currentLevelDetails.publishVersion}}</a-descriptions-item>
    <a-descriptions-item label="出库状态">{{currentLevelDetails.pullStatus_dictText}}</a-descriptions-item>
    <a-descriptions-item label="出库人" :span="2">{{currentLevelDetails.pullUser_dictText}}</a-descriptions-item>
    <a-descriptions-item label="出库人">{{currentLevelDetails.pullUser_dictText}}</a-descriptions-item>
    <a-descriptions-item label="创建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item>
    <a-descriptions-item label="创建时间" :span="2">{{currentLevelDetails.createTime}}</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="修改时间" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item>
    <a-descriptions-item label="描述" :span="3">{{currentLevelDetails.description}}</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>
</template>