zhaowei
2025-03-21 63ac895629d2de0e7f4284b1617d9aa8cbd07d05
1、删除DNC冗余组件
2、优化DNC文档版本、文档指派及文档预览功能代码
已修改4个文件
已删除16个文件
2391 ■■■■■ 文件已修改
src/views/dnc/base/WorkDoneList.vue 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/WorkUpcomingList.vue 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineForm.vue 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal__Style#Drawer.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserForm.vue 208 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkDone/WorkDoneModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkDone/WorkDoneModal__Style#Drawer.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalForm.vue 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingForm.vue 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingModal__Style#Drawer.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/DocumentVersionTableList.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/FilePreview.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/common/SelectFileCompareModal.vue 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/WorkDoneList.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/WorkUpcomingList.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineForm.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal__Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserForm.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue
@@ -160,7 +160,7 @@
        checkedKeys: [],
        expandedKeys: [],
        autoExpandParent: true,
        isExpandAllTreeNode: false,
        isExpandAllTreeNode: true,
        date: [],
        url: {
          list: '/nc/doc/find/list'
src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/WorkDone/WorkDoneModal.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/WorkDone/WorkDoneModal__Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalForm.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalModal.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingForm.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingModal.vue
ÎļþÒÑɾ³ý
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingModal__Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/dnc/common/DocumentVersionTableList.vue
@@ -1,23 +1,15 @@
<template>
  <div>
    <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :size="size" rowKey="fileId"
             :customRow="customRow">
      <template slot="rowIndex" slot-scope="text,record,index">
        <span :style="{color:setCurrentVersionColor(record.publishFlag)}">{{parseInt(index) + 1}}</span>
      </template>
             :customRow="customRow" :scroll="{y:189}">
      <template slot="fileName" slot-scope="text,record,index">
      <span :style="{color:setCurrentVersionColor(record.publishFlag)}">
      <span>
        {{text}}.{{record.fileSuffix}}
        <span v-if="record.publishFlag">[当前版本]</span>
      </span>
      </template>
      <template slot="docVersion" slot-scope="text,record">
        <span :style="{color:setCurrentVersionColor(record.publishFlag)}">{{text}}</span>
      </template>
      <template slot="fileSize" slot-scope="text,record">
        <span :style="{color:setCurrentVersionColor(record.publishFlag)}">{{(text/1024).toFixed(2)}}KB</span>
      </template>
    </a-table>
    <SelectFileCompareModal :dataSource="dataSource" :setCurrentVersionColor="setCurrentVersionColor"
                            ref="selectFileCompareModalRef"/>
  </div>
@@ -45,12 +37,19 @@
      return {
        disableMixinCreated: true,
        queryParams: {},
        currentDocumentVersion: '',
        columns: [
          { title: '序号', dataIndex: 'rowIndex', width: 65, align: 'center', scopedSlots: { customRender: 'rowIndex' } },
        {
          title: '序号',
          dataIndex: 'rowIndex',
          width: 65,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
          { title: '文件名称', dataIndex: 'fileName', align: 'center', scopedSlots: { customRender: 'fileName' } },
          { title: '版本号', dataIndex: 'docVersion', align: 'center', scopedSlots: { customRender: 'docVersion' } },
          { title: '文件大小', dataIndex: 'fileSize', align: 'center', scopedSlots: { customRender: 'fileSize' } }
        { title: '版本号', dataIndex: 'docVersion', align: 'center' },
        { title: '文件大小', dataIndex: 'fileSize', align: 'center' }
        ],
        url: {
          list: '/nc/file/find/list'
@@ -60,7 +59,11 @@
    created() {
      this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
  beforeDestroy() {
    this.$bus.$off('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod)
  },
    methods: {
    // åŠ è½½åˆ—è¡¨æ•°æ®
      loadData() {
        this.dataSource = []
        if (!this.url.list) {
@@ -73,15 +76,17 @@
          return false
        }
        this.loading = true
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            this.dataSource = res.list
            this.currentDocumentVersion = res.list.find(item => item.publishFlag).docVersion
            console.log('currentDocumentVersion', this.currentDocumentVersion)
          } else {
            this.$message.warning(res.message)
      getAction(this.url.list, params)
        .then((res) => {
          if (res.success) this.dataSource = res.list
          else {
            that.$notification.error({
              message: '消息',
              description: res.message
            })
          }
        }).finally(() => {
        })
        .finally(() => {
          this.loading = false
        })
      },
@@ -90,8 +95,17 @@
       * æŒ‡å®šå½“前文档为当前版本
       * @param fileId æ–‡ä»¶Id
       */
      handleFileAssign({ fileId }) {
    handleFileAssign({ fileId, publishFlag }) {
        const that = this
      console.log('publishFlag', publishFlag)
      // å¦‚果当前指定版本的版本号与当前版本的版本号一致则不发起请求
      if (publishFlag) {
        that.$notification.info({
          message: '消息',
          description: '当前文档版本即为当前文件'
        })
        return
      }
        dncApi.appointCurrentDocumentVersionApi(fileId)
          .then(res => {
            if (res.success) {
@@ -99,9 +113,6 @@
                message: '消息',
                description: res.message
              })
              const currentAssignDocumentVersion = that.dataSource.find(item => item.fileId === fileId).docVersion
              // å¦‚果当前指定版本的版本号与当前版本的版本号一致则不重新加载列表并且不重新释放预览接口调取
              if (that.currentDocumentVersion === currentAssignDocumentVersion) return
              that.loadData()
              that.$emit('releaseFilePreviewApi')
            } else {
@@ -119,14 +130,27 @@
          })
      },
    /**
     * æ¯”对两个版本的文档内容
     * @param _
     * @param modalTitle å¼¹çª—标题
     */
      handleFileAddRelative(_, modalTitle) {
        if (!this.$refs.selectFileCompareModalRef) return
        this.$refs.selectFileCompareModalRef.visible = true
        this.$refs.selectFileCompareModalRef.title = modalTitle
      },
    /**
     * å®šåˆ¶è¡¨æ ¼è¡Œæ ·å¼åŠåŠŸèƒ½
     * @param record è¡¨æ ¼è¡Œä¿¡æ¯
     * @returns {{style: {color: (string)}, on: {contextmenu: *}}} æ ·å¼åŠåŠŸèƒ½
     */
      customRow(record) {
        return {
        style: {
          color: this.setCurrentVersionColor(record.publishFlag)
        },
          on: {
            contextmenu: event => {
              event.preventDefault()
@@ -136,10 +160,6 @@
        }
      },
      triggerCorrespondingMethod({ methodName, level, modalTitle, tableRowInfo }) {
        if (this[methodName]) this[methodName](tableRowInfo, modalTitle)
      },
      /**
       * è®¾ç½®è¡¨æ ¼ä¸­ä¸ºå½“前版本的文件表格行颜色标识
       * @param publishFlag æ˜¯å¦ä¸ºå½“前版本
@@ -147,11 +167,11 @@
       */
      setCurrentVersionColor(publishFlag) {
        return publishFlag ? '#DB9538' : ''
    },
    triggerCorrespondingMethod({ methodName, modalTitle, tableRowInfo }) {
      if (this[methodName]) this[methodName](tableRowInfo, modalTitle)
      }
    }
  }
</script>
<style scoped>
</style>
src/views/dnc/common/FilePreview.vue
@@ -62,8 +62,9 @@
        //       console.log('pdfUrl===========================', this.pdfUrl)
        //     })
        // }
        this.spinning = true
        document.getElementById('ncFileInfo').innerHTML = ''
      if (docSuffix == 'jpg' || docSuffix == 'png' || docSuffix == 'jpeg' || docSuffix === 'gif' || docSuffix == 'pdf') return
      this.spinning = true
        dncApi.getFilePreviewApi(docId)
          .then(res => {
            console.log('res----------------------------', res)
@@ -86,7 +87,7 @@
          .finally(() => {
            this.spinning = false
          })
      },
    }
    }
  }
</script>
src/views/dnc/common/SelectFileCompareModal.vue
@@ -2,18 +2,13 @@
  <a-modal :title="title" :visible="visible" :width="700" @cancel="handleCloseModal" @ok="handleOpenCompareModal"
           :maskClosable="false">
    <a-table :dataSource="dataSource" :columns="columns" :pagination="false" bordered :scroll="{y:364}"
               :customRow="customRow"
             :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" rowKey="fileId">
      <template slot="rowIndex" slot-scope="text,record,index">
        <span :style="{color:setCurrentVersionColor(record.publishFlag)}">{{parseInt(index) + 1}}</span>
      </template>
      <template slot="fileName" slot-scope="text,record,index">
      <span :style="{color:setCurrentVersionColor(record.publishFlag)}">
        {{text}}.{{record.fileSuffix}}
        <span v-if="record.publishFlag">[当前版本]</span>
      </span>
      </template>
      <template slot="docVersion" slot-scope="text,record">
        <span :style="{color:setCurrentVersionColor(record.publishFlag)}">{{text}}</span>
      </template>
    </a-table>
@@ -45,9 +40,17 @@
        fileVersionArray: [],
        selectedFileInfo: {},
        columns: [
          { title: '序号', dataIndex: 'rowIndex', width: 65, align: 'center', scopedSlots: { customRender: 'rowIndex' } },
          {
            title: '序号',
            dataIndex: 'rowIndex',
            width: 65,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          { title: '文件名称', dataIndex: 'fileName', align: 'center', scopedSlots: { customRender: 'fileName' } },
          { title: '版本号', dataIndex: 'docVersion', align: 'center', scopedSlots: { customRender: 'docVersion' } }
          { title: '版本号', dataIndex: 'docVersion', align: 'center' }
        ]
      }
    },
@@ -65,11 +68,29 @@
      }
    },
    methods: {
      /**
       * å®šåˆ¶è¡¨æ ¼è¡Œæ ·å¼
       * @param record è¡¨æ ¼è¡Œä¿¡æ¯
       * @returns {{style: {color: *}}} æ ·å¼
       */
      customRow(record) {
        return {
          style: {
            color: this.setCurrentVersionColor(record.publishFlag)
          }
        }
      },
      /**
       * å½“表格多选框改变时触发
       * @param selectedRowKeys é€‰ä¸­çš„æ¯ä¸€è¡Œçš„key集合
       */
      onSelectChange(selectedRowKeys) {
        if (selectedRowKeys.length < 3) this.selectedRowKeys = selectedRowKeys
        else this.selectedRowKeys = selectedRowKeys.slice(-2)
      },
      // æ‰“开对比窗口
      handleOpenCompareModal() {
        const { $confirm, $notification, selectedRowKeys, title, dataSource } = this
        if (selectedRowKeys.length < 2) {
@@ -121,6 +142,7 @@
        })
      },
      // å…³é—­çª—口
      handleCloseModal() {
        this.visible = false
        this.selectedRowKeys = []