src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
@@ -9,13 +9,13 @@
            <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="queryTreeData">刷新</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"
          <a-button type="primary" v-has="'product_add'"
                    @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'添加产品',methodName:'handleProductAdd'})">
            <a-icon type="plus"></a-icon>
            产品
@@ -23,8 +23,8 @@
        </div>
        <!--产品结构树-->
        <div class="" style="flex: 1;overflow:auto;margin-top: 10px">
          <a-tree ref="tree" show-icon :checkStrictly="checkStrictly" :expandedKeys.sync="expandedKeys"
        <div style="flex: 1;overflow:auto;margin-top: 10px">
          <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, entity, key:treeKey,type}">
@@ -45,7 +45,7 @@
    <!--产品弹窗-->
    <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected"
                  @submitSuccess="queryTreeData"/>
                  @submitSuccess="getTreeDataByApi"/>
    <!--部件弹窗-->
    <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--零件弹窗-->
@@ -54,6 +54,8 @@
    <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--工步弹窗-->
    <ProcessStepModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--权限配置弹窗-->
    <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
  </a-card>
</template>
@@ -66,10 +68,12 @@
  import PartModal from './Part/PartModal'
  import ProcessModal from './Process/ProcessModal'
  import ProcessStepModal from './ProcessStep/ProcessStepModal'
  import AssignPermissionModal from './Permission/AssignPermissionModal'
  export default {
    name: 'ProductStructureTree',
    components: {
      AssignPermissionModal,
      ProcessStepModal,
      ProcessModal,
      PartModal,
@@ -98,15 +102,14 @@
      }
    },
    created() {
      this.queryTreeData()
      this.getTreeDataByApi()
      this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      queryTreeData() {
      getTreeDataByApi() {
        this.loading = true
        this.cardLoading = true
        dncApi.getProductStructureTreeApi().then(res => {
          console.log('res', res)
          if (res.success) {
            this.dataList = []
            this.allTreeKeys = []
@@ -146,9 +149,7 @@
        this.rightClickSelected = Object.assign({}, record)
      },
      /**
       * 树节点右键单击菜单中删除按钮时触发
       */
      // 树节点右键单击菜单中删除按钮时触发
      handleDelete() {
        this.$confirm({
          title: '提示',
@@ -166,7 +167,7 @@
            deleteAction(that.url.delete, { id: this.rightClickSelected.id })
              .then((res) => {
                if (res.success) {
                  that.queryTreeData()
                  that.getTreeDataByApi()
                  that.$notification.success({
                    message: '消息',
                    description: res.message
@@ -188,7 +189,7 @@
      modalFormSubmitSuccess(isAddNextLevel) {
        // 判断是否为添加下级并且判断父节点是否展开
        if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id)
        this.queryTreeData()
        this.getTreeDataByApi()
      },
      /**
@@ -258,8 +259,8 @@
        }
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) this[methodName](modalTitle)
      triggerCorrespondingMethod({ methodName }) {
        if (this[methodName]) this[methodName]()
      },
      /**
@@ -297,10 +298,6 @@
  /deep/ .ant-card-body, /deep/ .ant-spin-nested-loading, /deep/ .ant-spin-container {
    height: 100%;
  }
  /deep/ .ant-tree-node-content-wrapper {
    width: calc(100% - 24px);
  }
  /deep/ .ant-tree-title, .ant-tree-title .ant-dropdown-trigger {