src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
@@ -30,8 +30,12 @@
                  :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent"
                  @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick">
            <template slot="title" slot-scope="{ label, parentId, key:treeKey,type}">
              <ProductStructureTreeContextMenu ref="contextMenuRef"
                                               :treeParams="{label,treeKey,searchValue,type}"/>
              <span v-if="label.indexOf(searchValue) > -1">
                {{label.substr(0, label.indexOf(searchValue))}}
                <span class="replaceSearch">{{searchValue}}</span>
                {{label.substr(label.indexOf(searchValue) + searchValue.length)}}
              </span>
              <span v-else>{{ label }}</span>
            </template>
            <a-icon slot="switcherIcon" type="down"/>
@@ -68,6 +72,10 @@
                             @submitSuccess="modalFormSubmitSuccess"/>
    <!--引用部件-->
    <NcComponentBorrowModal :currentBorrowInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--产品结构树右键菜单(树节点触发)-->
    <product-structure-tree-context-menu ref="mainContextmenuRef" :treeParams="rightClickSelected"/>
    <!--产品结构树基本右键菜单(空白处触发)-->
    <ProductStructureBaseContextMenu ref="baseContextmenuRef"/>
@@ -79,7 +87,7 @@
<script>
  import dncApi from '@/api/dnc'
  import { deleteAction } from '@/api/manage'
  import { deleteAction, getAction } from '@/api/manage'
  import ProductStructureTreeContextMenu from './ProductStructureTreeContextMenu'
  import ProductModal from './Product/ProductModal'
  import ComponentModal from './Component/ComponentModal'
@@ -130,7 +138,8 @@
        rightClickSelected: {},
        fullScreenSpinning: false,
        url: {
          delete: '/nc/product/delete'
          delete: '/nc/product/delete',
          webServiceDNCToPlm: '/dnc/guideCardBatch/webServiceDNCToPlm'
        }
      }
    },
@@ -203,9 +212,10 @@
      /**
       * 树节点右键单击节点时触发
       * @param event 事件对象
       * @param node 节点对象
       */
      handleTreeRightClick({ node }) {
      handleTreeRightClick({ event, node }) {
        if (this.$refs.baseContextmenuRef) this.$refs.baseContextmenuRef.menuVisible = false
        const that = this
        const record = node.dataRef
@@ -221,7 +231,9 @@
                  message: '消息',
                  description: '暂无该节点详细信息'
                })
                return
              }
              this.openMainContextMenu(event)
            } else {
              that.$notification.error({
                message: '消息',
@@ -242,11 +254,48 @@
          okType: 'danger',
          cancelText: '取消',
          onOk: () => {
            if (!url.delete) {
              this.$message.error('请设置url.delete属性!')
            that.loading = true
            deleteAction(url.delete + `/${id}/${type}`)
              .then((res) => {
                if (res.success) {
                  that.getTreeDataByApi()
                  $notification.success({
                    message: '消息',
                    description: res.message
                  })
                } else {
                  $notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.$destroyAll()
              })
          },
          onCancel: () => {
            that.$destroyAll()
          }
        })
      },
      // 发送nc程序至三维工艺
      handleSendNcToPlm() {
        const that = this
        const { rightClickSelected: { id, type }, $confirm, url, $notification } = that
        $confirm({
          title: '提示',
          content: '确认发送该nc程序?',
          okText: '确认',
          okType: 'danger',
          cancelText: '取消',
          onOk: () => {
            if (!url.webServiceDNCToPlm) {
              this.$message.error('请设置url.webServiceDNCToPlm!')
              return
            }
            deleteAction(url.delete + `/${id}/${type}`)
            getAction(url.webServiceDNCToPlm, { id: id })
              .then((res) => {
                if (res.success) {
                  that.getTreeDataByApi()
@@ -405,12 +454,24 @@
      },
      /**
       * 打开树节点菜单事件
       * @param event 树节点事件对象
       */
      openMainContextMenu(event) {
        this.$refs.mainContextmenuRef.menuStyle.top = event.clientY + 'px'
        this.$refs.mainContextmenuRef.menuStyle.left = event.clientX + 'px'
        this.$refs.mainContextmenuRef.menuVisible = true
        document.body.addEventListener('click', this.handleMainContextMenuClose)
      },
      /**
       * 树所在父元素的右键事件
       * @param event 事件对象
       */
      openBaseContextMenu(event) {
        event.preventDefault()
        if (event.target.id !== 'tree-container') return
        if (this.$refs.mainContextmenuRef) this.$refs.mainContextmenuRef.menuVisible = false
        this.$refs.baseContextmenuRef.menuStyle.top = event.clientY + 'px'
        this.$refs.baseContextmenuRef.menuStyle.left = event.clientX + 'px'
        this.$refs.baseContextmenuRef.menuVisible = true
@@ -443,6 +504,12 @@
            break
          default:
        }
      },
      // 控制主要右键菜单关闭
      handleMainContextMenuClose() {
        if (this.$refs.mainContextmenuRef) this.$refs.mainContextmenuRef.menuVisible = false
        document.body.removeEventListener('click', this.handleMainContextMenuClose)
      },
      // 控制基础右键菜单关闭
@@ -496,6 +563,12 @@
    align-items: center;
  }
  .replaceSearch {
    color: #40a9ff;
    font-weight: bold;
    background-color: rgb(204, 204, 204);
  }
  @media screen and (min-width: 1920px) {
    .tree_con {
      height: 748px !important;