1、产品结构树以及设备结构树中的列表增加行选中样式
2、产品结构树实现点击设备类出现设备类下挂载的NC程序列表
3、产品结构树实现在设备类中导入NC程序功能
已修改15个文件
已删除1个文件
926 ■■■■ 文件已修改
src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/Workshop/WorkshopInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModalForm.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeTableList.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/DocumentInfo.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue 349 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/DocumentBatchDeleteModal.vue 426 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/ImportFileModal.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/TableContextMenu.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue
@@ -16,7 +16,7 @@
    <template v-else>
      <a-tabs>
        <a-tab-pane :key="1" tab="车间属性">
        <a-tab-pane :key="1" tab="属性">
          <WorkshopInfo :currentLevelDetails="currentTreeNodeInfo" :size="containerSize"/>
        </a-tab-pane>
      </a-tabs>
src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue
@@ -132,6 +132,9 @@
      customRow(record) {
        return {
          style: {
            backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent'
          },
          on: {
            contextmenu: event => {
              event.preventDefault()
src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue
@@ -142,6 +142,9 @@
      customRow(record) {
        return {
          style: {
            backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent'
          },
          on: {
            contextmenu: event => {
              event.preventDefault()
src/views/dnc/base/modules/DeviceStructure/Workshop/WorkshopInfo.vue
@@ -1,6 +1,6 @@
<template>
  <a-descriptions bordered :size="size">
    <a-descriptions-item label="车间名称">{{currentLevelDetails.title}}</a-descriptions-item>
    <a-descriptions-item label="名称">{{currentLevelDetails.title}}</a-descriptions-item>
    <a-descriptions-item label="备注">{{currentLevelDetails.memo}}</a-descriptions-item>
  </a-descriptions>
</template>
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue
@@ -54,7 +54,7 @@
      this.$nextTick(() => {
        if (this.$refs.realForm) {
          this.$refs.realForm.getWorkshopListByApi()
          this.$refs.realForm.handleProductionChange()
          this.$refs.realForm.handleProductionChange(tableRowInfo.productionId)
          this.$refs.realForm.edit({ ...tableRowInfo })
        }
      })
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModalForm.vue
@@ -84,10 +84,10 @@
    },
    // è½¦é—´é€‰æ‹©æ”¹å˜åŽæ¸…空设备类选择并重新获取设备类列表
    handleProductionChange() {
    handleProductionChange(value) {
      if (this.model.deviceManagementId) delete this.model.deviceManagementId
      if (this.model.deviceManagementId_dictText) delete this.model.deviceManagementId_dictText
      dncApi.getDeviceCustomTypeListByProductionIdApi(this.model.productionId)
      dncApi.getDeviceCustomTypeListByProductionIdApi(value)
        .then(res => {
          if (res.success) this.deviceCustomTypeList = res.result
        })
src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeTableList.vue
@@ -1,7 +1,7 @@
<template>
  <div style="flex: 0.25;margin-right: 10px">
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false"
             :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="id" @change="handleTableChange">
             :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="id" @change="handleTableChange">
    </a-table>
  </div>
@@ -75,6 +75,9 @@
    customRow(record) {
      return {
        style: {
          backgroundColor: this.currentClickedTypeInfo.id === record.id ? '#BAE7FF' : 'transparent'
        },
        on: {
          contextmenu: event => {
            event.preventDefault()
@@ -82,9 +85,9 @@
            this.$emit('handleTableContextMenuOpen', this.currentRightClickedTypeInfo)
          },
          click: () => {
            if (this.currentClickedTypeInfo.docId === record.docId) return
            if (this.currentClickedTypeInfo.id === record.id) return
            this.currentClickedTypeInfo = Object.assign({}, record)
            // this.$bus.$emit('sendCurrentClickedDocumentInfo', record)
            this.$bus.$emit('sendCurrentClickedTypeInfo', record)
          }
        }
      }
src/views/dnc/base/modules/ProductStructure/Document/DocumentInfo.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue
@@ -1,7 +1,7 @@
<template>
  <div style="flex: 1">
    <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>
@@ -13,185 +13,190 @@
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import DocumentModal from '../../../../common/DocumentModal'
  import NcDocumentAssignModal from './NcDocumentAssignModal'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DocumentModal from '../../../../common/DocumentModal'
import NcDocumentAssignModal from './NcDocumentAssignModal'
  export default {
    name: 'NcDocumentTableList',
    components: { NcDocumentAssignModal, DocumentModal },
    mixins: [JeecgListMixin],
    props: {
      currentTreeNodeInfo: {
        type: Object
      },
      size: {
        type: String
      }
export default {
  name: 'NcDocumentTableList',
  components: { NcDocumentAssignModal, DocumentModal },
  mixins: [JeecgListMixin],
  props: {
    currentNCDocumentAttributionInfo: {
      type: Object
    },
    data() {
      return {
        disableMixinCreated: true,
        columns: [
          {
            title: '序号',
            dataIndex: 'rowIndex',
            key: 'rowIndex',
            width: 65,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '文件名称',
            dataIndex: 'docName',
            key: 'docName',
            align: 'center',
            width: 300,
            sorter: true
          },
          { title: '代码版本', dataIndex: 'docAlias', align: 'center' },
          {
            title: '出库状态',
            dataIndex: 'pullStatus_dictText',
            key: 'pullStatus',
            align: 'center',
            filters: [
              { text: '未出库', value: 1 },
              { text: '已出库', value: 2 }
            ]
          },
          {
            title: '状  æ€',
            dataIndex: 'docStatus_dictText',
            key: 'docStatus',
            align: 'center',
            filters: [
              { text: '设计', value: 1 },
              { text: '发布', value: 2 },
              { text: '归档', value: 3 }
            ]
          },
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center', width: 200 },
          {
            title: '创建时间',
            dataIndex: 'createTime',
            align: 'center',
            width: 200,
            sorter: true
    size: {
      type: String
    }
  },
  data() {
    return {
      disableMixinCreated: true,
      columns: [
        {
          title: '序号',
          dataIndex: 'rowIndex',
          key: 'rowIndex',
          width: 65,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        ],
        dataSource: [],
        currentRightClickedDocumentInfo: {},
        currentClickedDocumentInfo: {},
        url: {
          list: '/nc/doc/find/page'
        }
      }
    },
    watch: {
      currentTreeNodeInfo: {
        handler(value) {
          this.currentClickedDocumentInfo = {}
        },
        immediate: true
      }
    },
    created() {
      this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      loadData(arg) {
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        {
          title: '文件名称',
          dataIndex: 'docName',
          key: 'docName',
          align: 'center',
          width: 300,
          sorter: true
        },
        { title: '代码版本', dataIndex: 'docAlias', align: 'center' },
        {
          title: '出库状态',
          dataIndex: 'pullStatus_dictText',
          key: 'pullStatus',
          align: 'center',
          filters: [
            { text: '未出库', value: 1 },
            { text: '已出库', value: 2 }
          ]
        },
        {
          title: '状  æ€',
          dataIndex: 'docStatus_dictText',
          key: 'docStatus',
          align: 'center',
          filters: [
            { text: '设计', value: 1 },
            { text: '发布', value: 2 },
            { text: '归档', value: 3 }
          ]
        },
        { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center', width: 200 },
        {
          title: '创建时间',
          dataIndex: 'createTime',
          align: 'center',
          width: 200,
          sorter: true
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°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.dataSource = []
        this.loading = true
        getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
            if (res.result.total) {
              this.ipagination.total = res.result.total
            } else {
              this.ipagination.total = 0
            }
          } else {
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      customRow(record) {
        return {
          on: {
            contextmenu: event => {
              event.preventDefault()
              this.currentRightClickedDocumentInfo = Object.assign({ param: 'NC' }, record)
              this.$emit('handleTableContextMenuOpen', this.currentRightClickedDocumentInfo)
            },
            click: () => {
              if (this.currentClickedDocumentInfo.docId === record.docId) return
              this.currentClickedDocumentInfo = Object.assign({}, record)
              this.$bus.$emit('sendCurrentClickedDocumentInfo', record)
            }
          }
        }
      },
      /**
       * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
       * @param pagination åˆ†é¡µå™¨é€‰é¡¹
       * @param filters ç­›é€‰é€‰é¡¹
       * @param sorter æŽ’序选项
       */
      handleTableChange(pagination, filters, sorter) {
        if (sorter.order) {
          this.isorter.column = sorter.field
          this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
        } else {
          this.isorter.column = 'createTime'
          this.isorter.order = 'desc'
        }
        for (let key in filters) {
          this.filters[key] = filters[key].join(',')
        }
        this.ipagination = pagination
        this.loadData()
      },
      handleDocumentEdit(record, modalTitle) {
        if (!this.$refs.modalForm) return
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = modalTitle
      },
      handleDocumentAssign(record, modalTitle) {
        if (!this.$refs.documentAssignModalRef) return
        this.$refs.documentAssignModalRef.title = modalTitle
        this.$refs.documentAssignModalRef.visible = true
      },
      handleDelete() {
        // æ­¤å¤„函数为屏蔽mixins中的同名函数,通用函数写在父级中
      },
      triggerCorrespondingMethod({ methodName, level, modalTitle, tableRowInfo }) {
        if (this[methodName] && tableRowInfo.param === 'NC') this[methodName](tableRowInfo, modalTitle)
      ],
      dataSource: [],
      currentRightClickedDocumentInfo: {},
      currentClickedDocumentInfo: {},
      url: {
        list: '/nc/doc/find/page'
      }
    }
  },
  watch: {
    currentNCDocumentAttributionInfo: {
      handler(value) {
        this.currentClickedDocumentInfo = {}
      },
      immediate: true
    }
  },
  created() {
    this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
  methods: {
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
      }
      console.log('currentNCDocumentAttributionInfo', this.currentNCDocumentAttributionInfo)
      const { attributionId, attributionType, docClassCode } = this.currentNCDocumentAttributionInfo
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) this.ipagination.current = 1
      var params = this.getQueryParams()//查询条件
      params.attributionId = attributionId
      params.attributionType = attributionType
      params.docClassCode = docClassCode
      if (!params) return false
      this.dataSource = []
      this.loading = true
      getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records
          if (res.result.total) {
            this.ipagination.total = res.result.total
          } else {
            this.ipagination.total = 0
          }
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    },
    customRow(record) {
      return {
        style: {
          backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent'
        },
        on: {
          contextmenu: event => {
            event.preventDefault()
            this.currentRightClickedDocumentInfo = Object.assign({ param: 'NC' }, record)
            this.$emit('handleTableContextMenuOpen', this.currentRightClickedDocumentInfo)
          },
          click: () => {
            if (this.currentClickedDocumentInfo.docId === record.docId) return
            this.currentClickedDocumentInfo = Object.assign({}, record)
            this.$bus.$emit('sendCurrentClickedDocumentInfo', record)
          }
        }
      }
    },
    /**
     * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
     * @param pagination åˆ†é¡µå™¨é€‰é¡¹
     * @param filters ç­›é€‰é€‰é¡¹
     * @param sorter æŽ’序选项
     */
    handleTableChange(pagination, filters, sorter) {
      if (sorter.order) {
        this.isorter.column = sorter.field
        this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
      } else {
        this.isorter.column = 'createTime'
        this.isorter.order = 'desc'
      }
      for (let key in filters) {
        this.filters[key] = filters[key].join(',')
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleDocumentEdit(record, modalTitle) {
      if (!this.$refs.modalForm) return
      this.$refs.modalForm.edit(record)
      this.$refs.modalForm.title = modalTitle
    },
    handleDocumentAssign(record, modalTitle) {
      if (!this.$refs.documentAssignModalRef) return
      this.$refs.documentAssignModalRef.title = modalTitle
      this.$refs.documentAssignModalRef.visible = true
    },
    handleDelete() {
      // æ­¤å¤„函数为屏蔽mixins中的同名函数,通用函数写在父级中
    },
    triggerCorrespondingMethod({ methodName, level, modalTitle, tableRowInfo }) {
      if (this[methodName] && tableRowInfo.param === 'NC') this[methodName](tableRowInfo, modalTitle)
    }
  }
}
</script>
<style scoped>
src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.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>
@@ -131,6 +131,9 @@
      customRow(record) {
        return {
          style: {
            backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent'
          },
          on: {
            contextmenu: event => {
              event.preventDefault()
src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue
@@ -22,13 +22,18 @@
        <ProcessStepInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
      </a-tab-pane>
      <a-tab-pane :key="1" tab="设备列表" v-if="currentLevelInfo.hasOwnProperty('deviceManagementId')">
<!--        <ProcessStepInfo :currentLevelDetails="currentLevelInfo" :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>
      <template v-if="currentLevelInfo.hasOwnProperty('attributionType')">
      <template v-if="currentLevelInfo.hasOwnProperty('docId')">
        <a-tab-pane :key="1" tab="文档属性">
          <DocumentInfo :currentLevelDetails="currentLevelInfo" :size="containerSize"/>
        </a-tab-pane>
@@ -97,6 +102,7 @@
  },
  created() {
    this.$bus.$on('sendCurrentClickedDocumentInfo', this.receiveCurrentLevelInfo)
    this.$bus.$on('sendCurrentClickedTypeInfo', this.receiveCurrentLevelInfo)
    this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentLevelInfo)
    this.$bus.$on('reloadMainBottomTableData', this.reloadMainBottomTableData)
    this.getCutterListDisplayPermission('dnc_cutter_process', 'isProcessHasCutterList')
src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
@@ -10,7 +10,8 @@
            ref="deviceCustomTypeTableList" :currentTreeNodeInfo="currentTreeNodeInfo"
            @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
          <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo"
          <NcDocumentTableList ref="ncDocumentTableListRef"
                               :currentNCDocumentAttributionInfo="currentNCDocumentAttributionInfo"
                               @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/>
        </div>
      </a-tab-pane>
@@ -55,11 +56,14 @@
      isProcessStepHasDeviceTypeList: false,
      currentRightClickedTableRowInfo: {},
      currentTreeNodeInfo: {},
      currentClickedTypeInfo: {},
      currentNCDocumentAttributionInfo: {},//当前NC文档的所属级即父级的详细信息(引入设备类后NC挂载至设备类下反之则挂载在工序和工步下)
      hasLoadedDataTabKeyArray: []
    }
  },
  created() {
    this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo)
    this.$bus.$on('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo)
    this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData)
    this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList')
@@ -104,6 +108,19 @@
      this.hasLoadedDataTabKeyArray.push(this.activeTabKey)
    },
    receiveCurrentClickedTypeInfo(record) {
      const { id, attributionType } = record
      this.currentClickedTypeInfo = Object.assign({}, record)
      this.currentNCDocumentAttributionInfo = Object.assign({}, {
        attributionId: id,
        attributionType,
        docClassCode: 'NC'
      })
      this.$nextTick(() => {
        if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1)
      })
    },
    /**
     * æŽ§åˆ¶å³é”®èœå•开启
     * @param record å½“前表格行信息
@@ -134,13 +151,23 @@
    /**
     * æ–‡æ¡£ä»¥åŠNC程序导入/出库/入库成功后触发重新加载文档列表
     * @param docClassCode æ–‡æ¡£ç±»åˆ«
     * @param attributionId èŠ‚ç‚¹Id
     * @param attributionType æ–‡æ¡£çˆ¶çº§type类型
     * @param attributionId æ–‡æ¡£çˆ¶çº§Id
     */
    reloadDocumentListData({ docClassCode, attributionId }) {
      // å¦‚果上传的文档不是所属于当前所展示节点的文档则不重新获取文档列表
      if (this.currentTreeNodeInfo.id !== attributionId) return
    reloadDocumentListData({ docClassCode, attributionType, attributionId }) {
      console.log('docClassCode, attributionType, attributionId', docClassCode, attributionType, attributionId)
      // åœ¨æ­¤å¤„设备NC文档父级参数是可此方法是结构树以及设备类两种不同导入方式的共同出口
      this.currentNCDocumentAttributionInfo = Object.assign({}, { docClassCode, attributionId, attributionType })
      // è‹¥å¼•入设备类则只需要判断当前出现的文档所属是否是当前左键选中的文档,若不是当前选中的文档则不刷新文档列表(避免无效刷新)
      if (this.currentRightClickedTableRowInfo.hasOwnProperty('deviceManagementId')) {
        if (this.currentClickedTypeInfo.id !== attributionId) return
      } else {
        if (this.currentTreeNodeInfo.id !== attributionId) return
      }
      if (docClassCode === 'NC') {
        if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1)
        this.$nextTick(() => {
          if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1)
        })
      } else {
        if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1)
      }
@@ -169,7 +196,7 @@
    // åˆ é™¤å½“前右键选中文档
    handleDelete() {
      const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
      const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo
      const that = this
      that.$confirm({
        title: '提示',
@@ -184,7 +211,7 @@
                  message: '消息',
                  description: res.message
                })
                that.reloadDocumentListData({ docClassCode: param, attributionId })
                that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType })
              } else {
                that.$notification.warning({
                  message: '消息',
@@ -218,7 +245,7 @@
     */
    handlePull(menuLabel) {
      const that = this
      const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo
      const { docId, docName, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo
      that.$confirm({
        title: '提示',
        content: `确认${menuLabel}吗?`,
@@ -229,7 +256,7 @@
            .then(res => {
              console.log('res------------------', res)
              if (res.success) {
                that.reloadDocumentListData({ docClassCode: param, attributionId })
                that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType })
                that.$notification.success({
                  message: '消息',
                  description: `${menuLabel}成功`
@@ -263,7 +290,7 @@
     */
    handleCancelPull(menuLabel) {
      const that = this
      const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
      const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo
      that.$confirm({
        title: '提示',
        content: `确认${menuLabel}吗?`,
@@ -273,7 +300,7 @@
          dncApi.documentCancelOutboundApi(docId)
            .then(res => {
              if (res.success) {
                this.reloadDocumentListData({ docClassCode: param, attributionId })
                this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType })
                that.$notification.success({
                  message: '消息',
                  description: res.message
@@ -307,7 +334,7 @@
     */
    handlePublish(menuLabel) {
      const that = this
      const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
      const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo
      that.$confirm({
        title: '提示',
        content: `确认${menuLabel}吗?`,
@@ -317,7 +344,7 @@
          dncApi.documentPublishApi(docId)
            .then(res => {
              if (res.success) {
                this.reloadDocumentListData({ docClassCode: param, attributionId })
                this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType })
                this.$bus.$emit('reloadMainBottomTableData', 'documentVersion')
                that.$notification.success({
                  message: '消息',
@@ -352,7 +379,7 @@
     */
    handleRepublish(menuLabel) {
      const that = this
      const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
      const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo
      that.$confirm({
        title: '提示',
        content: `确认${menuLabel}吗?`,
@@ -362,7 +389,7 @@
          dncApi.documentRepublishApi(docId)
            .then(res => {
              if (res.success) {
                this.reloadDocumentListData({ docClassCode: param, attributionId })
                this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType })
                that.$notification.success({
                  message: '消息',
                  description: res.message
@@ -396,7 +423,7 @@
     */
    handlePigeonhole(menuLabel) {
      const that = this
      const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
      const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo
      that.$confirm({
        title: '提示',
        content: `${menuLabel}后不可取消,确认${menuLabel}吗?`,
@@ -406,7 +433,7 @@
          dncApi.documentPigeonholeApi(docId)
            .then(res => {
              if (res.success) {
                this.reloadDocumentListData({ docClassCode: param, attributionId })
                this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType })
                that.$notification.success({
                  message: '消息',
                  description: res.message
src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
@@ -10,7 +10,7 @@
          </a-tooltip>
          <a-button type="primary" v-has="'product_add'" icon="plus" style="margin-left: 8px"
                    @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'添加产品',methodName:'handleProductAdd'})">
            æ·»åŠ äº§å“
            äº§å“
          </a-button>
          <!--          <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px">-->
          <!--            <a-menu slot="overlay">-->
src/views/dnc/common/DocumentBatchDeleteModal.vue
@@ -27,227 +27,231 @@
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
             :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"
             :scroll="{y:380}" :size="size" rowKey="docId" style="min-height: 480px">
      <span slot="docName" slot-scope="text">{{text}}</span>
      <span slot="docName" slot-scope="text">{{ text }}</span>
    </a-table>
  </a-modal>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import dncApi from '@/api/dnc'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import dncApi from '@/api/dnc'
  export default {
    name: 'DocumentBatchDeleteModal',
    components: {},
    mixins: [JeecgListMixin],
    props: {
      currentDocumentInfo: {
        type: Object
      },
      size: {
        type: String
      }
export default {
  name: 'DocumentBatchDeleteModal',
  components: {},
  mixins: [JeecgListMixin],
  props: {
    currentDocumentInfo: {
      type: Object
    },
    data() {
      return {
        disableMixinCreated: true,
        visible: false,
        title: '',
        date: [],
        columns: [
          {
            title: '序号',
            dataIndex: 'rowIndex',
            key: 'rowIndex',
            width: 65,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '文件名称',
            dataIndex: 'docName',
            key: 'docName',
            align: 'center',
            width: 300,
            sorter: true
          },
          { title: '设备编号', dataIndex: 'docCode', align: 'center' },
          {
            title: '出库状态',
            dataIndex: 'pullStatus_dictText',
            key: 'pullStatus',
            align: 'center',
            filters: [
              { text: '未出库', value: 1 },
              { text: '已出库', value: 2 }
            ]
          },
          {
            title: '状  æ€',
            dataIndex: 'docStatus_dictText',
            key: 'docStatus',
            align: 'center',
            filters: [
              { text: '设计', value: 1 },
              { text: '发布', value: 2 },
              { text: '归档', value: 3 }
            ]
          },
          { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center', width: 200 },
          {
            title: '创建时间',
            dataIndex: 'createTime',
            align: 'center',
            width: 200,
            sorter: true
    size: {
      type: String
    }
  },
  data() {
    return {
      disableMixinCreated: true,
      visible: false,
      title: '',
      date: [],
      columns: [
        {
          title: '序号',
          dataIndex: 'rowIndex',
          key: 'rowIndex',
          width: 65,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        ],
        spinning: false,
        url: {
          list: '/nc/doc/find/page'
        },
        {
          title: '文件名称',
          dataIndex: 'docName',
          key: 'docName',
          align: 'center',
          width: 300,
          sorter: true
        },
        { title: '设备编号', dataIndex: 'docCode', align: 'center' },
        {
          title: '出库状态',
          dataIndex: 'pullStatus_dictText',
          key: 'pullStatus',
          align: 'center',
          filters: [
            { text: '未出库', value: 1 },
            { text: '已出库', value: 2 }
          ]
        },
        {
          title: '状  æ€',
          dataIndex: 'docStatus_dictText',
          key: 'docStatus',
          align: 'center',
          filters: [
            { text: '设计', value: 1 },
            { text: '发布', value: 2 },
            { text: '归档', value: 3 }
          ]
        },
        { title: '系统指定版本', dataIndex: 'publishVersion', align: 'center', width: 200 },
        {
          title: '创建时间',
          dataIndex: 'createTime',
          align: 'center',
          width: 200,
          sorter: true
        }
      }
    },
    watch: {
      visible: {
        handler(value) {
          if (value) {
            this.resetData()
            this.loadData()
          }
        }
      }
    },
    methods: {
      // èŽ·å–å½“å‰å·¥åºæˆ–å·¥æ­¥å¯¹åº”æ–‡æ¡£åˆ—è¡¨
      loadData() {
        this.dataSource = []
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        }
        var params = this.getQueryParams()//查询条件
        if (!params) return false
        const { attributionType, attributionId, param } = this.currentDocumentInfo
        params.attributionType = attributionType
        params.attributionId = attributionId
        params.docClassCode = param
        console.log('params', params)
        this.loading = true
        getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
            if (res.result.total) {
              this.ipagination.total = res.result.total
            } else {
              this.ipagination.total = 0
            }
          }
          else this.$message.warning(res.message)
        }).finally(() => {
          this.loading = false
        })
      },
      /**
       * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
       * @param pagination åˆ†é¡µå™¨é€‰é¡¹
       * @param filters ç­›é€‰é€‰é¡¹
       * @param sorter æŽ’序选项
       */
      handleTableChange(pagination, filters, sorter) {
        if (sorter.order) {
          this.isorter.column = sorter.field
          this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
        } else {
          this.isorter.column = 'createTime'
          this.isorter.order = 'desc'
        }
        for (let key in filters) {
          this.filters[key] = filters[key].join(',')
        }
        this.ipagination = pagination
        this.loadData()
      },
      // æ—¶é—´é€‰æ‹©å™¨é€‰æ‹©å®ŒæˆåŽè§¦å‘
      handleDateChange(value) {
        this.queryParam.startTime = value[0]
        this.queryParam.endTime = value[1]
      },
      // ç¡®è®¤æ‰¹é‡åˆ é™¤æ–‡æ¡£
      confirmBatchDeleteDocument() {
        const that = this
        const { selectedRowKeys, $notification, $confirm, currentDocumentInfo: { param, attributionId, attributionType } } = that
        if (selectedRowKeys.length === 0) {
          $notification.warning({
            message: '消息',
            description: '请选择文档'
          })
          return
        }
        $confirm({
          title: '提示',
          content: `删除后不可取消,确认删除吗?`,
          okText: '确认',
          cancelText: '取消',
          onOk: () => {
            let hasRequestedSuccessCount = 0
            let hasRequestedCount = 0
            let method
            let queryParam
            selectedRowKeys.forEach(key => {
              if (attributionType !== 4) {
                method = dncApi.deleteDocumentApi
                queryParam = key
              } else {
                method = dncApi.deleteDeviceRelativeDocumentApi
                queryParam = { docId: key, attributionId }
              }
              method(queryParam)
                .then(res => {
                  if (res.success) {
                    $notification.success({
                      message: '消息',
                      description: res.message
                    })
                    hasRequestedSuccessCount++
                  } else {
                    $notification.error({
                      message: '消息',
                      description: res.message
                    })
                  }
                })
                .finally(() => {
                  hasRequestedCount++
                  if (hasRequestedCount === selectedRowKeys.length && hasRequestedSuccessCount > 0) {
                    this.loadData()
                    this.$emit('reloadDocumentListData', { docClassCode: param, attributionId })
                  }
                })
            })
            that.$destroyAll()
          },
          onCancel: () => {
            that.$destroyAll()
          }
        })
      },
      resetData() {
        this.queryParam = {}
        this.selectedRowKeys = []
      ],
      spinning: false,
      url: {
        list: '/nc/doc/find/page'
      }
    }
  },
  watch: {
    visible: {
      handler(value) {
        if (value) {
          this.resetData()
          this.loadData()
        }
      }
    }
  },
  methods: {
    // èŽ·å–å½“å‰å·¥åºæˆ–å·¥æ­¥å¯¹åº”æ–‡æ¡£åˆ—è¡¨
    loadData() {
      this.dataSource = []
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
      }
      var params = this.getQueryParams()//查询条件
      if (!params) return false
      const { attributionType, attributionId, param } = this.currentDocumentInfo
      params.attributionType = attributionType
      params.attributionId = attributionId
      params.docClassCode = param
      console.log('params', params)
      this.loading = true
      getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records
          if (res.result.total) {
            this.ipagination.total = res.result.total
          } else {
            this.ipagination.total = 0
          }
        } else this.$message.warning(res.message)
      }).finally(() => {
        this.loading = false
      })
    },
    /**
     * è¡¨æ ¼åˆ†é¡µã€æŽ’序改变、筛选时触发
     * @param pagination åˆ†é¡µå™¨é€‰é¡¹
     * @param filters ç­›é€‰é€‰é¡¹
     * @param sorter æŽ’序选项
     */
    handleTableChange(pagination, filters, sorter) {
      if (sorter.order) {
        this.isorter.column = sorter.field
        this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
      } else {
        this.isorter.column = 'createTime'
        this.isorter.order = 'desc'
      }
      for (let key in filters) {
        this.filters[key] = filters[key].join(',')
      }
      this.ipagination = pagination
      this.loadData()
    },
    // æ—¶é—´é€‰æ‹©å™¨é€‰æ‹©å®ŒæˆåŽè§¦å‘
    handleDateChange(value) {
      this.queryParam.startTime = value[0]
      this.queryParam.endTime = value[1]
    },
    // ç¡®è®¤æ‰¹é‡åˆ é™¤æ–‡æ¡£
    confirmBatchDeleteDocument() {
      const that = this
      const {
        selectedRowKeys,
        $notification,
        $confirm,
        currentDocumentInfo: { param, attributionId, attributionType }
      } = that
      if (selectedRowKeys.length === 0) {
        $notification.warning({
          message: '消息',
          description: '请选择文档'
        })
        return
      }
      $confirm({
        title: '提示',
        content: `删除后不可取消,确认删除吗?`,
        okText: '确认',
        cancelText: '取消',
        onOk: () => {
          let hasRequestedSuccessCount = 0
          let hasRequestedCount = 0
          let method
          let queryParam
          selectedRowKeys.forEach(key => {
            if (attributionType !== 4) {
              method = dncApi.deleteDocumentApi
              queryParam = key
            } else {
              method = dncApi.deleteDeviceRelativeDocumentApi
              queryParam = { docId: key, attributionId }
            }
            method(queryParam)
              .then(res => {
                if (res.success) {
                  $notification.success({
                    message: '消息',
                    description: res.message
                  })
                  hasRequestedSuccessCount++
                } else {
                  $notification.error({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                hasRequestedCount++
                if (hasRequestedCount === selectedRowKeys.length && hasRequestedSuccessCount > 0) {
                  this.loadData()
                  this.$emit('reloadDocumentListData', { docClassCode: param, attributionId, attributionType })
                }
              })
          })
          that.$destroyAll()
        },
        onCancel: () => {
          that.$destroyAll()
        }
      })
    },
    resetData() {
      this.queryParam = {}
      this.selectedRowKeys = []
    }
  }
}
</script>
src/views/dnc/common/ImportFileModal.vue
@@ -64,9 +64,10 @@
          attributionType = treeNodeInfo.type
          docClassCode = treeNodeInfo.param
        } else {
          attributionId = tableRowInfo.attributionId
          // è‹¥å·¥åºåŠå·¥æ­¥å±‚级下有设备类时则导入NC的参数需要调整
          attributionId = tableRowInfo.param==='deviceCustomType'?tableRowInfo.id:tableRowInfo.attributionId
          attributionType = tableRowInfo.attributionType
          docClassCode = tableRowInfo.param
          docClassCode = tableRowInfo.param==='deviceCustomType'?'NC':tableRowInfo.param
        }
        this.setModalTitle(modalTitle, docClassCode)
        this.uploadParams = Object.assign({}, { attributionId, attributionType, docClassCode })
src/views/dnc/common/TableContextMenu.vue
@@ -45,7 +45,7 @@
          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 },
            { label: '导入NC程序', code: 'type_import', subMenu: [], icon: 'import', isCommonMethod: true },
          ],
          //NC文档
          NC: [
@@ -159,6 +159,7 @@
          methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('')
        }
        console.log('tableRowInfo---------------------------------------', this.tableRowInfo)
        console.log('methodName---------------------------------------', methodName)
        this.$bus.$emit('tableMenuItemMethodTrigger', {
          methodName,
          modalTitle,