1、产品/部件/零件的新增与编辑以及根据层级查询对应文档功能已完成后端联调
2、产品结构树新增节点展开记忆功能方便新增节点后查看
已修改13个文件
已删除2个文件
558 ■■■■■ 文件已修改
.env.development 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/dnc.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Component/ComponentModal.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Component/ComponentModalForm.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue 173 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Part/PartModal.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Part/PartModalForm.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Process/ProcessModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Product/ProductModal.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Product/ProductModalForm.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/ProductStructureTree.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
ÎļþÒÑɾ³ý
.env.production
ÎļþÒÑɾ³ý
src/api/dnc.js
@@ -1,5 +1,7 @@
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
export default {
  getProductStructureTreeApi: () => getAction('/nc/product/load/tree')
  //-------------------------产品结构树------------------------------------------------
  getProductStructureTreeApi: () => getAction('/nc/product/load/tree'),
}
src/views/dnc/base/modules/ProductStructure/Component/ComponentModal.vue
@@ -29,7 +29,8 @@
      return {
        title: '',
        width: 700,
        visible: false
        visible: false,
        isAddNextLevel: false // æ˜¯å¦ä¸ºæ·»åŠ ä¸‹çº§ï¼Œä½œä¸ºæ ‘èŠ‚ç‚¹æ˜¯å¦å±•å¼€çš„åˆ¤æ–­
      }
    },
    created() {
@@ -38,33 +39,37 @@
    methods: {
      /**
       * æ·»åŠ å½“å‰äº§å“éƒ¨ä»¶
       * @param modalTitle
       */
      handleProductAddChild(modalTitle) {
        this.title = modalTitle
      handleProductAddChild() {
        this.visible = true
        this.isAddNextLevel = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
          this.$refs.realForm.add({ productId: this.currentTreeNodeInfo.id })
        })
      },
      /**
       * æ·»åŠ å½“å‰éƒ¨ä»¶çš„å­éƒ¨ä»¶
       * @param modalTitle
       */
      handleComponentAdd(modalTitle) {
        this.title = modalTitle
      handleComponentAdd() {
        this.visible = true
        this.isAddNextLevel = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
          this.$refs.realForm.add({
            productId: this.currentTreeNodeInfo.parentId,
            parentId: this.currentTreeNodeInfo.id
          })
        })
      },
      handleComponentEdit(modalTitle) {
        this.title = modalTitle
      /**
       * ç¼–辑部件信息
       */
      handleComponentEdit() {
        this.visible = true
        this.isAddNextLevel = false
        this.$nextTick(() => {
          this.$refs.realForm.edit(this.currentTreeNodeInfo.entity)
          this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
        })
      },
@@ -73,7 +78,7 @@
      },
      submitCallback() {
        this.$emit('ok')
        this.$emit('submitSuccess', this.isAddNextLevel)
        this.visible = false
      },
@@ -83,9 +88,10 @@
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        console.log('methodName', methodName)
        console.log('modalTitle', modalTitle)
        if (this[methodName]) this[methodName](modalTitle)
        if (this[methodName]) {
          this[methodName]()
          this.title = modalTitle
        }
      }
    }
  }
src/views/dnc/base/modules/ProductStructure/Component/ComponentModalForm.vue
@@ -112,8 +112,8 @@
          ]
        },
        url: {
          add: '/mdc/mdcPartProcessInfo/add',
          edit: '/mdc/mdcPartProcessInfo/edit'
          add: '/nc/component/add',
          edit: '/nc/component/edit'
        }
      }
    },
@@ -127,14 +127,13 @@
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
    },
    methods: {
      add() {
        this.edit(this.modelDefault)
      add(params) {
        this.edit({ ...this.modelDefault, ...params })
      },
      edit(record) {
        this.model = Object.assign({}, record)
        console.log('model', this.model)
        this.visible = true
      },
      submitForm() {
@@ -144,11 +143,13 @@
          if (valid) {
            that.confirmLoading = true
            let httpUrl = ''
            let method = 'post'
            let method = ''
            if (!this.model.id) {
              httpUrl += this.url.add
              method = 'post'
            } else {
              httpUrl += this.url.edit
              httpUrl += this.url.edit + `/${this.model.id}`
              method = 'put'
            }
            httpAction(httpUrl, this.model, method).then((res) => {
              if (res.success) {
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue
@@ -15,7 +15,7 @@
                  <a-col :md="11" :sm="11">
                    <a-form-item label="上传时间">
                      <a-range-picker placeholder="请选择上传时间" v-model="queryParam.collectTime"></a-range-picker>
                      <a-range-picker v-model="queryParam.collectTime"></a-range-picker>
                    </a-form-item>
                  </a-col>
@@ -52,6 +52,12 @@
  export default {
    name: 'NcDocumentAssignModal',
    components: {},
    mixins: [JeecgListMixin],
    props: {
      size: {
        type: String
      }
    },
    data() {
      return {
        disableMixinCreated: true,
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue
@@ -7,11 +7,12 @@
    <DocumentModal ref="modalForm" @ok="modalFormOk"/>
    <NcDocumentAssignModal ref="documentAssignModalRef"/>
    <NcDocumentAssignModal :size="size" ref="documentAssignModalRef"/>
  </div>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import DocumentModal from './DocumentModal'
  import NcDocumentAssignModal from './NcDocumentAssignModal'
@@ -21,12 +22,16 @@
    components: { NcDocumentAssignModal, DocumentModal },
    mixins: [JeecgListMixin],
    props: {
      currentTreeNodeInfo: {
        type: Object
      },
      size: {
        type: String
      }
    },
    data() {
      return {
        disableMixinCreated: true,
        columns: [
          {
            title: '序号',
@@ -45,142 +50,9 @@
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center' },
          { title: '上传时间', dataIndex: 'createTime', align: 'center' }
        ],
        dataSource: [
          {
            'docId': '1876099281127645185',
            'docName': 'avatar2.jpg',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'jpg',
            'docStatus': 1,
            'publishFileId': '1876099281458995202',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2025-01-06 10:51:40',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 5,
            'attributionId': '1868504592315248641',
            'classificationId': '1257965381181095938',
            'syncStatus': null
          },
          {
            'docId': '1876114720452943873',
            'docName': 'color.less',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'less',
            'docStatus': 1,
            'publishFileId': '1876114720582967297',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2025-01-06 11:53:01',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 5,
            'attributionId': '1868504592315248641',
            'classificationId': '1257965381181095938',
            'syncStatus': null
          },
          {
            'docId': '1876114736512933889',
            'docName': 'index.html',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'html',
            'docStatus': 1,
            'publishFileId': '1876114736705871874',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2025-01-06 11:53:05',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 5,
            'attributionId': '1868504592315248641',
            'classificationId': '1257965381181095938',
            'syncStatus': null
          },
          {
            'docId': '1876114746621206529',
            'docName': 'logo.png',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'png',
            'docStatus': 1,
            'publishFileId': '1876114746818338818',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2025-01-06 11:53:07',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 5,
            'attributionId': '1868504592315248641',
            'classificationId': '1257965381181095938',
            'syncStatus': null
          },
          {
            'docId': '1876114758923100161',
            'docName': 'lxzn.png',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'png',
            'docStatus': 1,
            'publishFileId': '1876114759111843842',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2025-01-06 11:53:10',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 5,
            'attributionId': '1868504592315248641',
            'classificationId': '1257965381181095938',
            'syncStatus': null
          },
          {
            'docId': '1876114776241381377',
            'docName': 'v2.js',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'js',
            'docStatus': 1,
            'publishFileId': '1876114776438513666',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2025-01-06 11:53:14',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 5,
            'attributionId': '1868504592315248641',
            'classificationId': '1257965381181095938',
            'syncStatus': null
          }
        ],
        dataSource: [],
        url: {
          list: ''
          list: '/nc/doc/find/page'
        }
      }
    },
@@ -188,6 +60,35 @@
      this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      loadData(arg) {
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) this.ipagination.current = 1
        var params = this.getQueryParams()//查询条件
        params.attributionId = this.currentTreeNodeInfo.id
        params.attributionType = this.currentTreeNodeInfo.type
        params.docClassCode = 'NC'
        if (!params) return false
        this.loading = true
        getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
          if (res.success) {
            this.dataSource = res.page.records
            if (res.page.total) {
              this.ipagination.total = res.page.total
            } else {
              this.ipagination.total = 0
            }
          } else {
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      customRow(record) {
        return {
          on: {
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue
@@ -10,6 +10,7 @@
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import DocumentModal from './DocumentModal'
@@ -18,12 +19,16 @@
    components: { DocumentModal },
    mixins: [JeecgListMixin],
    props: {
      currentTreeNodeInfo: {
        type: Object
      },
      size: {
        type: String
      }
    },
    data() {
      return {
        disableMixinCreated: true,
        columns: [
          {
            title: '序号',
@@ -42,76 +47,9 @@
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center' },
          { title: '上传时间', dataIndex: 'createTime', align: 'center' }
        ],
        dataSource: [
          {
            'docId': '1868943615190044674',
            'docName': '测试.nc',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'nc',
            'docStatus': 1,
            'publishFileId': '1868943615454285825',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2024-12-17 16:57:36',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 1,
            'attributionId': '1326377675659276290',
            'classificationId': '1257965467827027969',
            'syncStatus': null
          },
          {
            'docId': '1868946627732103170',
            'docName': 'nacos-config.sh',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'sh',
            'docStatus': 1,
            'publishFileId': '1868946628004732930',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2024-12-17 17:09:34',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 1,
            'attributionId': '1326377675659276290',
            'classificationId': '1257965467827027969',
            'syncStatus': null
          },
          {
            'docId': '1868947564353740801',
            'docName': 'dir.sql',
            'docAlias': null,
            'docCode': null,
            'docSuffix': 'sql',
            'docStatus': 1,
            'publishFileId': '1868947564487958530',
            'publishVersion': 'a.1',
            'description': null,
            'createTime': '2024-12-17 17:13:17',
            'updateTime': null,
            'createUser': '1254966905669160962',
            'updateUser': null,
            'docClassCode': null,
            'pullStatus': 1,
            'pullUser': null,
            'attributionType': 1,
            'attributionId': '1326377675659276290',
            'classificationId': '1257965467827027969',
            'syncStatus': null
          }
        ],
        dataSource: [],
        url: {
          list: ''
          list: '/nc/doc/find/page'
        }
      }
    },
@@ -119,6 +57,35 @@
      this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      loadData(arg) {
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) this.ipagination.current = 1
        var params = this.getQueryParams()//查询条件
        params.attributionId = this.currentTreeNodeInfo.id
        params.attributionType = this.currentTreeNodeInfo.type
        params.docClassCode = 'OTHER'
        if (!params) return false
        this.loading = true
        getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
          if (res.success) {
            this.dataSource = res.page.records
            if (res.page.total) {
              this.ipagination.total = res.page.total
            } else {
              this.ipagination.total = 0
            }
          } else {
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      customRow(record) {
        return {
          on: {
src/views/dnc/base/modules/ProductStructure/Part/PartModal.vue
@@ -29,7 +29,8 @@
      return {
        title: '',
        width: 700,
        visible: false
        visible: false,
        isAddNextLevel: false // æ˜¯å¦ä¸ºæ·»åŠ ä¸‹çº§ï¼Œä½œä¸ºæ ‘èŠ‚ç‚¹æ˜¯å¦å±•å¼€çš„åˆ¤æ–­
      }
    },
    created() {
@@ -37,38 +38,41 @@
    },
    methods: {
      /**
       * æ·»åŠ å½“å‰éƒ¨ä»¶é›¶ä»¶
       * @param modalTitle
       * æ·»åŠ éƒ¨ä»¶ä¸‹çº§é›¶ä»¶
       */
      handleComponentAddChild(modalTitle) {
        this.title = modalTitle
      handleComponentAddChild() {
        this.visible = true
        this.isAddNextLevel = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
          this.$refs.realForm.add({
            productId: this.currentTreeNodeInfo.rfield,
            componentId: this.currentTreeNodeInfo.id
          })
        })
      },
      /**
       * æ·»åŠ é›¶ä»¶
       * @param modalTitle
       * ç‚¹å‡»é›¶ä»¶å±‚级添加同级零件
       */
      handlePartsAdd(modalTitle) {
        this.title = modalTitle
      handlePartsAdd() {
        this.visible = true
        this.isAddNextLevel = false
        this.$nextTick(() => {
          this.$refs.realForm.add()
          this.$refs.realForm.add({
            productId: this.currentTreeNodeInfo.rfield,
            componentId: this.currentTreeNodeInfo.parentId
          })
        })
      },
      /**
       * ç¼–辑零件信息
       * @param modalTitle
       */
      handlePartsEdit(modalTitle) {
        this.title = modalTitle
      handlePartsEdit() {
        this.visible = true
        this.isAddNextLevel = false
        this.$nextTick(() => {
          this.$refs.realForm.edit(this.currentTreeNodeInfo.entity)
          this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
        })
      },
@@ -77,7 +81,7 @@
      },
      submitCallback() {
        this.$emit('ok')
        this.$emit('submitSuccess', this.isAddNextLevel)
        this.visible = false
      },
@@ -87,7 +91,10 @@
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) this[methodName](modalTitle)
        if (this[methodName]) {
          this[methodName](modalTitle)
          this.title = modalTitle
        }
      }
    }
  }
src/views/dnc/base/modules/ProductStructure/Part/PartModalForm.vue
@@ -112,8 +112,8 @@
          ]
        },
        url: {
          add: '/mdc/mdcPartProcessInfo/add',
          edit: '/mdc/mdcPartProcessInfo/edit'
          add: '/nc/parts/add',
          edit: '/nc/parts/edit'
        }
      }
    },
@@ -127,14 +127,13 @@
      this.modelDefault = JSON.parse(JSON.stringify(this.model))
    },
    methods: {
      add() {
        this.edit(this.modelDefault)
      add(params) {
        this.edit({ ...this.modelDefault, ...params })
      },
      edit(record) {
        this.model = Object.assign({}, record)
        console.log('model', this.model)
        this.visible = true
      },
      submitForm() {
@@ -144,11 +143,13 @@
          if (valid) {
            that.confirmLoading = true
            let httpUrl = ''
            let method = 'post'
            let method = ''
            if (!this.model.id) {
              httpUrl += this.url.add
              method = 'post'
            } else {
              httpUrl += this.url.edit
              httpUrl += this.url.edit + `/${this.model.id}`
              method = 'put'
            }
            httpAction(httpUrl, this.model, method).then((res) => {
              if (res.success) {
src/views/dnc/base/modules/ProductStructure/Process/ProcessModal.vue
@@ -77,7 +77,7 @@
      },
      submitCallback() {
        this.$emit('ok')
        this.$emit('submitSuccess')
        this.visible = false
      },
src/views/dnc/base/modules/ProductStructure/Product/ProductModal.vue
@@ -29,41 +29,52 @@
      return {
        title: '',
        width: 500,
        visible: false
        visible: false,
      }
    },
    created() {
      this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      handleProductAdd(modalTitle) {
        this.title = modalTitle
      /**
       * æ·»åŠ äº§å“
       */
      handleProductAdd() {
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
        })
      },
      handleProductEdit(modalTitle) {
        this.title = modalTitle
      /**
       * ç¼–辑产品信息
       */
      handleProductEdit() {
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.edit(this.currentTreeNodeInfo.entity)
          this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity })
        })
      },
      handleOk() {
        this.$refs.realForm.submitForm()
      },
      submitCallback() {
        this.$emit('ok')
        this.$emit('submitSuccess')
        this.visible = false
      },
      handleCancel() {
        this.$emit('close')
        this.visible = false
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) this[methodName](modalTitle)
        if (this[methodName]) {
          this[methodName](modalTitle)
          this.title = modalTitle
        }
      }
    }
  }
src/views/dnc/base/modules/ProductStructure/Product/ProductModalForm.vue
@@ -30,7 +30,7 @@
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { httpAction } from '@/api/manage'
  export default {
    name: 'ProductModalForm',
@@ -61,11 +61,11 @@
          ],
          productNo: [
            { required: true, message: '请输入产品代号!' }
          ],
          ]
        },
        url: {
          add: '/mdc/mdcPartProcessInfo/add',
          edit: '/mdc/mdcPartProcessInfo/edit'
          add: '/nc/product/add',
          edit: '/nc/product/edit'
        }
      }
    },
@@ -86,7 +86,6 @@
      edit(record) {
        this.model = Object.assign({}, record)
        console.log('model', this.model)
        this.visible = true
      },
      submitForm() {
@@ -96,11 +95,13 @@
          if (valid) {
            that.confirmLoading = true
            let httpUrl = ''
            let method = 'post'
            let method = ''
            if (!this.model.id) {
              httpUrl += this.url.add
              method = 'post'
            } else {
              httpUrl += this.url.edit
              method = 'put'
              httpUrl += this.url.edit + `/${this.model.id}`
            }
            httpAction(httpUrl, this.model, method).then((res) => {
              if (res.success) {
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
@@ -1,12 +1,14 @@
<template>
  <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()"
  <a-tabs v-model="activeTabKey" @change="handleTabChange" @contextmenu.native="e=>e.preventDefault()"
          v-if="Object.keys(currentTreeNodeInfo).length!==0">
    <a-tab-pane :key="1" tab="NC文档" v-if="currentTreeNodeInfo.type!==1">
      <NcDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
      <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                           @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
    </a-tab-pane>
    <a-tab-pane :key="2" tab="其他文档">
      <OtherDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
      <OtherDocumentTableList ref="otherDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo"
                              @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
    </a-tab-pane>
    <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/>
@@ -23,7 +25,8 @@
    components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList },
    data() {
      return {
        activeTabKey: '1',
        activeTabKey: null,
        hasLoadingDataTabKey: [],
        tableContainerSize: 'small',
        currentRightClickedTableRowInfo: {},
        currentTreeNodeInfo: {}
@@ -31,6 +34,19 @@
    },
    created() {
      this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo)
    },
    watch: {
      activeTabKey: {
        handler(value) {
          // tab切换时加载对应文档列表,当前树节点下已经加载过的文档列表不再重复加载
          if (!this.hasLoadingDataTabKey.includes(value)) {
            if (value === 1) this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1))
            else this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1))
            this.hasLoadingDataTabKey.push(value)
          }
        },
        deep: true
      }
    },
    methods: {
      /**
@@ -48,13 +64,30 @@
      /**
       * æŽ¥æ”¶æ ‘组件传来的当前选中的树节点信息
       * @param treeNodeInfo
       * @param treeNodeInfo æ ‘节点信息
       */
      receiveCurrentTreeNodeInfo(treeNodeInfo) {
        // ä»Žæ ‘组件接受树节点信息后从父组件流入子组件
        this.currentTreeNodeInfo = treeNodeInfo
        if (treeNodeInfo.type !== 1) this.activeTabKey = 1
        else this.activeTabKey = 2
        // æ¸…空上一节点已经加载过得文档列表tabKey
        this.hasLoadingDataTabKey = []
        if (treeNodeInfo.type !== 1) {
          this.activeTabKey = 1
          this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1))
        } else {
          this.activeTabKey = 2
          this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1))
        }
        this.hasLoadingDataTabKey.push(this.activeTabKey)
      },
      handleTabChange(activeTabKey) {
        // tab切换时加载对应文档列表,当前树节点下已经加载过的文档列表不再重复加载
        if (!this.hasLoadingDataTabKey.includes(activeTabKey)) {
          if (activeTabKey === 1) this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1))
          else this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1))
          this.hasLoadingDataTabKey.push(activeTabKey)
        }
      },
      /**
src/views/dnc/common/ProductStructureTree.vue
@@ -16,7 +16,8 @@
              <a-icon type="bars"/>
            </a-button>
          </a-dropdown>
          <a-button type="primary" @click="$refs.productModalFormRef.handleProductAdd('添加产品')">
          <a-button type="primary"
                    @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'添加产品',methodName:'handleProductAdd'})">
            <a-icon type="plus"></a-icon>
            äº§å“
          </a-button>
@@ -44,18 +45,20 @@
    </a-spin>
    <!--产品弹窗-->
    <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected"/>
    <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected"
                  @submitSuccess="queryTreeData"/>
    <!--部件弹窗-->
    <ComponentModal :currentTreeNodeInfo="rightClickSelected"/>
    <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--零件弹窗-->
    <PartModal :currentTreeNodeInfo="rightClickSelected"/>
    <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
    <!--工序弹窗-->
    <ProcessModal :currentTreeNodeInfo="rightClickSelected"/>
    <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/>
  </a-card>
</template>
<script>
  import dncApi from '@/api/dnc'
  import { deleteAction } from '@/api/manage'
  import ProductStructureTreeContextMenu from './modules/ProductStructureTree/ProductStructureTreeContextMenu'
  import ProductModal from '../base/modules/ProductStructure/Product/ProductModal'
  import ComponentModal from '../base/modules/ProductStructure/Component/ComponentModal'
@@ -87,7 +90,7 @@
        currentSelected: {},
        rightClickSelected: {},
        url: {
          delete: ''
          delete: '/nc/product/delete'
        }
      }
    },
@@ -107,8 +110,7 @@
            this.treeDataSource = res.list
            this.generateList(this.treeDataSource)
            // this.expandedKeys = this.allTreeKeys
            this.expandedKeys = [this.treeDataSource[0].id]
            console.log('treeDataSource', this.treeDataSource)
            if (this.expandedKeys.length === 0) this.expandedKeys = [this.treeDataSource[0].id]
          } else {
            this.$message.warn(res.message)
          }
@@ -158,23 +160,32 @@
              return
            }
            const that = this
            // deleteAction(that.url.delete, { id: this.rightClickSelected.id })
            //   .then((res) => {
            //     if (res.success) {
            //       that.queryTreeData()
            //       that.$notification.success({
            //         message: '消息',
            //         description: res.message
            //       })
            //     } else {
            //       that.$notification.warning({
            //         message: '消息',
            //         description: res.message
            //       })
            //     }
            //   })
            deleteAction(that.url.delete, { id: this.rightClickSelected.id })
              .then((res) => {
                if (res.success) {
                  that.queryTreeData()
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
          }
        })
          }
        })
      },
      /**
       * è‡ªåŠ¨å±•å¼€æ·»åŠ ä¸‹çº§èŠ‚ç‚¹çš„çˆ¶èŠ‚ç‚¹
       */
      modalFormSubmitSuccess(isAddNextLevel) {
        // åˆ¤æ–­æ˜¯å¦ä¸ºæ·»åŠ ä¸‹çº§å¹¶ä¸”åˆ¤æ–­çˆ¶èŠ‚ç‚¹æ˜¯å¦å±•å¼€
        if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id)
        this.queryTreeData()
      },
      /**