iZaiZaiA 2 years ago
parent
commit
97fac41378

+ 1 - 0
package.json

@@ -10,6 +10,7 @@
         "axios": "^0.27.2",
         "click-outside-vue3": "^4.0.1",
         "crypto-js": "^4.1.1",
+        "dayjs": "^1.11.5",
         "echarts": "^5.3.3",
         "element-plus": "^2.2.16",
         "js-base64": "^3.7.2",

+ 10 - 4
src/global/components/hc-uploads/index.vue

@@ -119,8 +119,7 @@ const uploadSuccess = (response,uploadFile,uploadFiles) => {
     finishFileNum.value ++;
     if (beforeFileNum.value === finishFileNum.value) {
         let fileList = getUploadFileList(uploadFiles)
-        spinShow.value = false
-        uploadDisabled.value = false
+        uploadClearFiles()
         emit('change', {type: 'success', fileList})
         emit('progress', false)
     }
@@ -134,13 +133,20 @@ const uploadError = () => {
     const num = finishFileNum.value + errorFileNum.value;
     if (beforeFileNum.value === num) {
         let fileList = getUploadFileList(fileListData.value)
-        spinShow.value = false
-        uploadDisabled.value = false
+        uploadClearFiles()
         emit('change', {type: 'error', fileList})
         emit('progress', false)
     }
 }
 
+const uploadClearFiles = () => {
+    finishFileNum.value = 0
+    beforeFileNum.value = 0
+    errorFileNum.value = 0
+    spinShow.value = false
+    uploadDisabled.value = false
+}
+
 //获取文件URL
 const getUploadFileList = (fileListArr) => {
     let fileArr = [], fileList = fileListArr ??[];

+ 1 - 0
src/plugins/day-zh-cn.js

@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){return"W"===_?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));

+ 18 - 0
src/styles/app/element.scss

@@ -5,6 +5,9 @@
 .el-button .hc-icon-i {
     margin-right: 4px;
 }
+.el-button.is-loading .hc-icon-i {
+    display: none;
+}
 //主色
 .el-button--primary.is-link,
 .el-button--primary.is-plain,
@@ -169,6 +172,19 @@
     }
     .el-table__cell {
         padding: 12px 0;
+        .el-checkbox {
+            --el-checkbox-input-height: 18px;
+            --el-checkbox-input-width: 18px;
+            --el-checkbox-font-size: 16px;
+            --el-checkbox-border-radius: 3px;
+            .el-checkbox__inner::after {
+                top: 3px;
+                left: 6px;
+            }
+        }
+        .el-checkbox__input.is-indeterminate .el-checkbox__inner::before {
+            top: 7px;
+        }
     }
 }
 
@@ -325,6 +341,8 @@
 //弹窗提示
 .el-dialog .el-dialog__body {
     position: relative;
+    max-height: 60vh;
+    overflow: auto;
     .el-alert {
         margin-top: -10px;
         margin-bottom: 20px;

+ 1 - 0
src/views/data-fill/wbs.vue

@@ -690,6 +690,7 @@ const editNodeClick = async () => {
             nodeDataInfo.value['title'] = title || ''
             nodeDataInfo.value['partitionCode'] = partitionCode || ''
             editNodeModal.value = false
+            window?.location?.reload()  //刷新页面
         }
     }
 }

+ 132 - 0
src/views/other-file/components/HcFileUpload.vue

@@ -0,0 +1,132 @@
+<template>
+    <el-upload ref="uploadRef" class="hc-file-upload-box" :action="api + action" :headers="getTokenHeader()" :data="uploadData" :accept="accept" :disabled="uploadDisabled" multiple :show-file-list="false"
+               :on-success="uploadSuccess" :on-exceed="uploadExceed" :on-error="uploadError" :before-upload="beforeUpload" :on-progress="uploadprogress">
+        <slot></slot>
+    </el-upload>
+</template>
+
+<script setup>
+import {ref,watch,onMounted} from "vue";
+import {getTokenHeader} from '~src/api/request/header';
+import {isSize, deepClone, getObjValue} from "vue-utils-plus"
+const props = defineProps({
+    datas: {
+        type: Object,
+        default: () => ({})
+    },
+    api: {
+        type: String,
+        default: "/api/blade-resource/oss/endpoint/"
+    },
+    action: {
+        type: String,
+        default: "upload-file"
+    },
+    accept: {
+        type: String,
+        default: "image/png,image/jpg,image/jpeg,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/pdf,.doc,.docx,application/msword"
+    },
+    size: {
+        type: Number,
+        default: 60
+    }
+})
+
+//变量
+const uploadRef = ref(null)
+const uploadData = ref(props.datas)
+const uploadDisabled = ref(false)
+
+//监听
+watch(() => [
+    props.datas,
+], ([datas]) => {
+    uploadData.value = datas
+})
+
+//渲染完成
+onMounted(()=> {
+    beforeFileNum.value = 0
+    finishFileNum.value = 0
+    errorFileNum.value = 0
+})
+
+//事件
+const emit = defineEmits(['change', 'progress'])
+
+//上传前
+const beforeFileNum = ref(0)
+const beforeUpload = async (file) => {
+    if (isSize(file?.size, props.size)) {
+        beforeFileNum.value ++;
+        return true;
+    } else {
+        beforeFileNum.value = 0;
+        window?.$message?.warning(`文件大小, 不能过${props.size}M!`);
+        return false;
+    }
+}
+
+//超出限制时
+const uploadExceed = () => {
+    window?.$message?.warning(`请上传 ${props.accept} 格式的文件,文件大小不超过${props.size}M`);
+}
+
+//上传中
+const uploadprogress = () => {
+    uploadDisabled.value = true
+    emit('progress', true)
+}
+
+//上传完成
+const finishFileNum = ref(0)
+const uploadSuccess = (response, uploadFile, uploadFiles) => {
+    finishFileNum.value ++;
+    if (beforeFileNum.value === finishFileNum.value) {
+        const fileList = getUploadFile(deepClone(uploadFiles))
+        uploadClearFiles()
+        emit('change', {type: 'success', fileList})
+        emit('progress', false)
+    }
+}
+
+//上传失败
+const errorFileNum = ref(0)
+const uploadError = (error,uploadFile,uploadFiles) => {
+    errorFileNum.value ++;
+    window?.$message?.error('上传失败');
+    const num = finishFileNum.value + errorFileNum.value;
+    if (beforeFileNum.value === num) {
+        const fileList = getUploadFile(deepClone(uploadFiles))
+        uploadClearFiles()
+        emit('change', {type: 'error', fileList})
+        emit('progress', false)
+    }
+}
+
+const uploadClearFiles = () => {
+    finishFileNum.value = 0
+    beforeFileNum.value = 0
+    errorFileNum.value = 0
+    uploadDisabled.value = false
+    uploadRef.value?.clearFiles()
+}
+
+//获取文件
+const getUploadFile = (fileList) => {
+    let fileArr = [];
+    for (let i = 0; i < fileList.length; i++) {
+        const item = getObjValue(fileList[i]?.response?.data)
+        fileArr.push(item)
+    }
+    return fileArr
+}
+</script>
+
+<style lang="scss">
+.hc-file-upload-box .el-upload-list .el-upload-list__item {
+    .el-upload-list__item-status-label, .el-icon--close-tip {
+        display: none;
+    }
+}
+</style>

+ 72 - 0
src/views/other-file/components/ProjectTree.vue

@@ -0,0 +1,72 @@
+<template>
+    <ElTree class="hc-tree-node" :props="ElTreeProps" :data="datas" highlight-current accordion node-key="id" :default-expanded-keys="TreeExpandKey" @node-click="ElTreeClick">
+        <template #default="{ node, data }">
+            <div class="data-custom-tree-node" :id="`${idPrefix}${data['id']}`">{{ node.label }}</div>
+        </template>
+    </ElTree>
+</template>
+
+<script setup>
+import {ref, watch, nextTick} from "vue";
+const props = defineProps({
+    datas: {
+        type: Array,
+        default: () => ([])
+    },
+    autoExpandKeys: {
+        type: Array,
+        default: () => ([])
+    },
+    idPrefix: {
+        type: String,
+        default: 'project-tree-data-'
+    },
+})
+
+//变量
+const ElTreeProps = ref({label: 'title', children: 'children'})
+const TreeExpandKey = ref(props.autoExpandKeys)
+
+//监听
+watch(() => [
+    props.autoExpandKeys,
+    props.datas,
+], ([expandKeys, datas]) => {
+    TreeExpandKey.value = expandKeys
+    setTreeNodeClick(expandKeys)
+})
+
+nextTick(() => {
+    setTreeNodeClick(props.autoExpandKeys)
+})
+
+//设置选中
+const setTreeNodeClick = (keys) => {
+    TreeExpandKey.value = keys
+    if (keys.length > 0) {
+        const byId = `${props.idPrefix}${keys[0]}`
+        let timer = setInterval(() => {
+            document.getElementById(byId)?.click()
+            clearInterval(timer);
+        }, 800);
+    }
+}
+
+//事件
+const emit = defineEmits(['nodeTap'])
+
+//节点被点击
+const ElTreeClick = async (data,node) => {
+    emit('nodeTap', {node, data, keys: [data?.id], key: data?.id})
+}
+</script>
+
+<style lang="scss" scoped>
+.data-custom-tree-node {
+    position: relative;
+    display: flex;
+    align-items: center;
+    width: 100%;
+    color: var(--ui-TC);
+}
+</style>

+ 365 - 25
src/views/other-file/project-scanning.vue

@@ -12,7 +12,7 @@
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
-                    <WbsTree :autoExpandKeys="TreeAutoExpandKeys" :projectId="projectId" :contractId="contractId" @nodeTap="nodeWbsElTreeClick"/>
+                    <ProjectTree :datas="ElTreeData" :autoExpandKeys="TreeAutoExpandKeys" @nodeTap="nodeElTreeClick"/>
                 </el-scrollbar>
             </div>
             <!--左右拖动-->
@@ -22,7 +22,7 @@
             <HcCard :scrollbar="false" actionSize="lg">
                 <template #header>
                     <HcTooltip keys="project-scanning-upload">
-                        <el-button type="primary" hc-btn>
+                        <el-button type="primary" :disabled="!nodeIds" hc-btn @click="uploadModalClick">
                             <HcIcon name="add-circle"/>
                             <span>上传文件</span>
                         </el-button>
@@ -67,12 +67,12 @@
                 <template #search>
                     <div class="w-32">
                         <el-select v-model="searchForm.isApprovalValue" placeholder="审批状态" clearable>
-                            <el-option v-for="item in approvalData" :key="item.value" :label="item['dictValue']" :value="item['dictKey']"/>
+                            <el-option v-for="item in approvalData" :label="item['dictValue']" :value="item['dictKey']"/>
                         </el-select>
                     </div>
                     <div class="w-32 ml-4">
                         <el-select v-model="searchForm.isCertificationValue" placeholder="认证状态" clearable>
-                            <el-option v-for="item in certificationType" :key="item.value" :label="item['dictValue']" :value="item['dictKey']"/>
+                            <el-option v-for="item in certificationType" :label="item['dictValue']" :value="item['dictKey']"/>
                         </el-select>
                     </div>
                     <div class="w-64 ml-3">
@@ -85,16 +85,89 @@
                         </el-button>
                     </div>
                 </template>
-
                 <HcTable ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading" isCheck @selection-change="tableSelectionChange">
-
+                    <template #fileName="{row}">
+                        <span class="text-link" @click="tablePreview(row)">{{row?.fileName}}</span>
+                    </template>
+                    <template #isApprovalValue="{row}">
+                        <el-tag :type="`${row.status === 2 ? 'success' : row.status === 0 ? 'warning' : row.status === 1 ? 'danger' : 'info'}`"
+                                class="mx-1" effect="dark" v-if="row['isApprovalValue']">{{row['isApprovalValue']}}</el-tag>
+                    </template>
                 </HcTable>
-
                 <template #action>
                     <HcPages :pages="searchForm" @change="pageChange"/>
                 </template>
             </HcCard>
         </div>
+
+        <!--新增文件-->
+        <el-dialog v-model="showUploadModal" title="上传工程文件" width="80vw" class="hc-modal-border">
+            <HcTable ui="hc-form-table" :column="tableUploadColumn" :datas="tableUploadData" :loading="tableUpLoading">
+                <template #fileNumber="{row}">
+                    <el-input v-model="row.fileNumber"/>
+                </template>
+                <template #fileName="{row}">
+                    <el-input v-model="row.fileName"/>
+                </template>
+                <template #fileTime="{row}">
+                    <el-date-picker v-model="row.fileTime" type="date" format="YYYY/MM/DD" value-format="YYYY-MM-DD" :clearable="false"/>
+                </template>
+                <template #sheetType="{row}" v-if="isBuiltDrawing === 1">
+                    <el-select v-model="row.sheetType">
+                        <el-option v-for="item in sheetType" :key="item['dictKey']" :label="item['dictValue']" :value="item['dictKey']"/>
+                    </el-select>
+                </template>
+                <template #sheetSource="{row}" v-if="isBuiltDrawing === 1">
+                    <el-select v-model="row.sheetSource">
+                        <el-option v-for="item in sheetSourceType" :key="item['dictKey']" :label="item['dictValue']" :value="item['dictKey']"/>
+                    </el-select>
+                </template>
+                <template #drawingNo="{row}" v-if="isBuiltDrawing === 1">
+                    <el-input v-model="row.drawingNo"/>
+                </template>
+                <template #citeChangeNumber="{row}" v-if="isBuiltDrawing === 1">
+                    <el-input v-model="row.citeChangeNumber"/>
+                </template>
+                <template #isApproval="{row}">
+                    <el-select v-model="row.isApproval">
+                        <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value"/>
+                    </el-select>
+                </template>
+                <template #isNeedCertification="{row}">
+                    <el-select v-model="row.isNeedCertification">
+                        <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value"/>
+                    </el-select>
+                </template>
+                <template #dutyUser="{row}">
+                    <el-input v-model="row.dutyUser"/>
+                </template>
+                <template #action="{row,index}">
+                    <el-button type="danger" plain size="small" @click="delUploadData(row,index)">删除</el-button>
+                </template>
+            </HcTable>
+            <template #footer>
+                <div class="lr-dialog-footer">
+                    <div class="left flex items-center">
+                        <HcFileUpload @change="uploadsChange" @progress="uploadsProgress">
+                            <el-button type="primary" hc-btn :loading="uploadsLoading">
+                                <HcIcon name="add-circle"/>
+                                <span>新增上传</span>
+                            </el-button>
+                        </HcFileUpload>
+                    </div>
+                    <div class="right">
+                        <el-button size="large" @click="showUploadModal = false">
+                            <HcIcon name="close"/>
+                            <span>取消</span>
+                        </el-button>
+                        <el-button type="primary" hc-btn :disabled="uploadsLoading" :loading="uploadSaveLoading" @click="batchUploadSave">
+                            <HcIcon name="save"/>
+                            <span>提交保存</span>
+                        </el-button>
+                    </div>
+                </div>
+            </template>
+        </el-dialog>
     </div>
 </template>
 
@@ -102,9 +175,13 @@
 import {onMounted, ref, watch} from 'vue'
 import {useAppStore} from "~src/store";
 import {useRouter, useRoute} from 'vue-router'
-import WbsTree from "../data-fill/components/WbsTree.vue"
+import ProjectTree from "./components/ProjectTree.vue"
+import HcFileUpload from "./components/HcFileUpload.vue"
 import {getStoreData, setStoreData} from '~src/utils/storage'
-import {downloadBlob, getArrValue, getObjNullValue} from "vue-utils-plus"
+import projectScanningApi from "~api/other-file/projectScanning";
+import tasksDataApi from '~api/tasks/data';
+import {downloadBlob, getArrValue} from "vue-utils-plus"
+import dayjs from "dayjs"
 
 //变量
 const router = useRouter()
@@ -125,22 +202,112 @@ watch(() => [
 //自动展开缓存
 const TreeAutoExpandKeys = ref(getStoreData('scanningTreeExpandKeys') || [])
 
+const dayDate = ref('')
+
 //渲染完成
 onMounted(() => {
-
+    getClassIfyList()
+    firstTaskStatus()
+    certificationStatus()
+    dayDate.value = dayjs(new Date()).format('YYYY-MM-DD')
 })
 
+//获取树的数据
+const ElTreeData = ref([])
+const getClassIfyList = async () => {
+    const { error, code, data } = await projectScanningApi.getClassIfyList({
+        projectId: projectId.value,
+        contractId: contractId.value
+    })
+    //处理数据
+    if (!error && code === 200) {
+        ElTreeData.value = getArrValue(data)
+    } else {
+        ElTreeData.value = []
+    }
+}
+
+//项目树被点击
+const treeNodeInfo = ref({})
+const treeDataInfo = ref({})
+const nodeIds = ref('')
+const isStorageNode = ref(0)
+const isBuiltDrawing = ref(0)
+const nodeElTreeClick = ({node, data, keys, key}) => {
+    treeNodeInfo.value = node
+    treeDataInfo.value = data
+    //设置变量
+    nodeIds.value = key || ''
+    isStorageNode.value = data['isStorageNode'] || 0
+    isBuiltDrawing.value = data['isBuiltDrawing'] || 0
+    //设置搜索数据
+    searchForm.value.current = 1;
+    searchForm.value.nodeIds = key || ''
+    setTableColumns()
+    getTableData()
+    //缓存展开的节点
+    setStoreData('scanningTreeExpandKeys', keys)
+}
+
+//获取任务类型
 const approvalData = ref([])
+const firstTaskStatus = async () => {
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'first_task_status'
+    })
+    //处理数据
+    if (!error && code === 200) {
+        approvalData.value = getArrValue(data)
+    } else {
+        approvalData.value = []
+    }
+}
 
+//获取认证状态
 const certificationType = ref([])
+const certificationStatus = async () => {
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'certification_status'
+    })
+    //处理数据
+    if (!error && code === 200) {
+        certificationType.value = getArrValue(data)
+    } else {
+        certificationType.value = []
+    }
+}
 
-//项目树被点击
-const nodeWbsElTreeClick = ({data, keys}) => {
+//获取图幅类型
+const sheetType = ref([])
+const sheetTypeStatus = async () => {
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'sheet_type'
+    })
+    //处理数据
+    if (!error && code === 200) {
+        sheetType.value = getArrValue(data)
+    } else {
+        sheetType.value = []
+    }
+}
 
+//获取图表来源
+const sheetSourceType = ref([])
+const sheetSourceStatus = async () => {
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'sheet_source'
+    })
+    //处理数据
+    if (!error && code === 200) {
+        sheetSourceType.value = getArrValue(data)
+    } else {
+        sheetSourceType.value = []
+    }
 }
 
+//搜索表单
 const searchForm = ref({
-    queryValue: null, isApprovalValue: null, isCertificationValue: null,
+    nodeIds: '', isApprovalValue: null, isCertificationValue: null, queryValue: null,
     current: 1, size: 20, total: 0
 })
 
@@ -153,12 +320,12 @@ const keyUpEvent = (e) => {
 
 //搜索
 const searchClick = () => {
-    /*if (queryKey.value) {
+    if (nodeIds.value) {
         searchForm.value.current = 1;
         getTableData()
     } else {
         window?.$message?.warning('请先在左边选择一个树节点')
-    }*/
+    }
 }
 
 //分页被点击
@@ -168,18 +335,52 @@ const pageChange = ({current, size}) => {
     getTableData()
 }
 
+//设置表头
+const tableListColumn = ref([
+    {key:'fileNumber', name: '文件编号', width: 160},
+    {key:'fileName', name: '文件名称'},
+    {key:'filePage', name: '文件页数', width: 120},
+    {key:'isCertificationValue', name: '认证状态', width: 160},
+    {key:'isApprovalValue', name: '状态', width: 160},
+    {key:'fileTime', name: '文件时间', width: 160},
+    {key:'dutyUser', name: '责任者', width: 160}
+])
+const setTableColumns = () => {
+    if (isBuiltDrawing.value === 1) {
+        tableListColumn.value = [
+            {key:'fileNumber', name: '文件编号', width: 160},
+            {key:'fileName', name: '文件名称'},
+            {key:'filePage', name: '文件页数', width: 120},
+            {key:'sheetType', name: '图幅'},
+            {key:'sheetSourceValue', name: '图表来源'},
+            {key:'drawingNo', name: '图号'},
+            {key:'citeChangeNumber', name: '引用变更令编号'},
+            {key:'isCertificationValue', name: '认证状态', width: 160},
+            {key:'isApprovalValue', name: '状态', width: 160},
+            {key:'fileTime', name: '文件时间', width: 160},
+            {key:'dutyUser', name: '责任者', width: 160}
+        ]
+        sheetTypeStatus()
+        sheetSourceStatus()
+    } else {
+        tableListColumn.value = [
+            {key:'fileNumber', name: '文件编号', width: 160},
+            {key:'fileName', name: '文件名称'},
+            {key:'filePage', name: '文件页数', width: 120},
+            {key:'isCertificationValue', name: '认证状态', width: 160},
+            {key:'isApprovalValue', name: '状态', width: 160},
+            {key:'fileTime', name: '文件时间', width: 160},
+            {key:'dutyUser', name: '责任者', width: 160}
+        ]
+    }
+}
+
 //获取数据
-const tableListRef = ref(null)
 const tableLoading = ref(false)
 const tableListData = ref([])
-const tableListColumn = ref([
-    {key:'info', name: '文件详情'},
-    {key:'textContent', name: '文字说明'},
-    {key:'operate', name: '操作', align: 'center', width: '140'},
-])
 const getTableData = async () => {
-    /*tableLoading.value = true
-    const {error, code, data} = await imageApi.getPageList({
+    tableLoading.value = true
+    const {error, code, data} = await projectScanningApi.getarchiveFilePage({
         ...searchForm.value,
         projectId: projectId.value,
         contractId: contractId.value
@@ -192,10 +393,11 @@ const getTableData = async () => {
     } else {
         tableListData.value = []
         searchForm.value.total = 0
-    }*/
+    }
 }
 
 //多选
+const tableListRef = ref(null)
 const tableCheckedKeys = ref([]);
 const tableSelectionChange = (rows) => {
     tableCheckedKeys.value = rows.filter((item) => {
@@ -203,6 +405,145 @@ const tableSelectionChange = (rows) => {
     })
 }
 
+//文件名称被点击
+const tablePreview = (row) => {
+    const pdfUrl = row['pdfFileUrl'] || ''
+    const evisaFile = row['evisaFile'] || ''
+    if (evisaFile) {
+        window.open(evisaFile,'_blank')
+    } else if (pdfUrl) {
+        window.open(pdfUrl,'_blank')
+    } else {
+        window.$message?.warning('该数据暂无PDF')
+    }
+}
+
+//新增文件
+const showUploadModal = ref(false)
+const uploadModalClick = () => {
+    if (nodeIds.value && isStorageNode.value === 1) {
+        setTableUploadColumn()
+        tableUpLoading.value = false
+        uploadSaveLoading.value = false
+        tableUploadData.value = []
+        showUploadModal.value = true
+    } else {
+        window?.$message?.warning('请先选择一个子节点')
+    }
+}
+
+//设置文件表头
+const tableUploadColumn = ref([
+    {key:'fileNumber', name: '文件编号'},
+    {key:'fileName', name: '文件名称'},
+    {key:'fileTime', name: '文件时间'},
+    {key:'isApproval', name: '是否需要审批'},
+    {key:'isNeedCertification', name: '是否需要认证'},
+    {key:'dutyUser', name: '责任者'},
+    {key:'action', name: '操作', width: 100}
+])
+const setTableUploadColumn = () => {
+    if (isBuiltDrawing.value === 1) {
+        tableUploadColumn.value = [
+            {key:'fileNumber', name: '文件编号'},
+            {key:'fileName', name: '文件名称'},
+            {key:'fileTime', name: '文件时间'},
+            {key:'sheetType', name: '图幅'},
+            {key:'sheetSourceValue', name: '图表来源'},
+            {key:'drawingNo', name: '图号'},
+            {key:'citeChangeNumber', name: '引用变更令编号'},
+            {key:'isApproval', name: '是否需要审批'},
+            {key:'isNeedCertification', name: '是否需要认证'},
+            {key:'dutyUser', name: '责任者'},
+            {key:'action', name: '操作', width: 100}
+        ]
+    } else {
+        tableUploadColumn.value = [
+            {key:'fileNumber', name: '文件编号'},
+            {key:'fileName', name: '文件名称'},
+            {key:'fileTime', name: '文件时间'},
+            {key:'isApproval', name: '是否需要审批'},
+            {key:'isNeedCertification', name: '是否需要认证'},
+            {key:'dutyUser', name: '责任者'},
+            {key:'action', name: '操作', width: 100}
+        ]
+    }
+}
+
+//文件数据表
+const tableUpLoading = ref(false)
+const tableUploadData = ref([])
+
+//上传的文件结果
+const uploadsChange = ({fileList}) => {
+    let newArr = []
+    const sheet = sheetType.value, source = sheetSourceType.value
+    for (let i = 0; i < fileList.length; i++) {
+        const item = fileList[i]
+        let name = item['originalName'] || ''
+        let fileName = name.substring(0, name.lastIndexOf("."))
+        newArr.push({
+            projectId: projectId.value,
+            contractId: contractId.value,
+            nodeId: nodeIds.value,
+            fileNumber: '',
+            fileName: fileName,
+            ossFileName: item?.name || '',
+            fileTime: dayDate.value,
+            fileUrl: item?.link || '',
+            sheetType: sheet.length > 0 ? sheet[0]['dictKey'] || '': '',
+            sheetSource: source.length > 0 ? source[0]['dictKey'] || '': '',
+            drawingNo: '',
+            citeChangeNumber: '',
+            isApproval: 0,
+            isNeedCertification: 0,
+            dutyUser: '',
+            pdfFileUrl: item?.pdfUrl || '',
+            filePage: item?.page || '',
+        })
+    }
+    tableUploadData.value = newArr
+}
+
+//上传进度
+const uploadsLoading = ref(false)
+const uploadsProgress = (val) => {
+    uploadsLoading.value = val
+}
+
+//表单验证
+const whetherData = ref([{label: "不需要", value: 0}, {label: "需要", value: 1}])
+const uploadDataRules = ref({
+    fileNumber: {
+        required: true,
+        trigger: "input",
+        message: "请输入文件编号",
+    },
+    fileName: {
+        required: true,
+        trigger: "input",
+        message: "请输入文件名称",
+    },
+    fileTime: {
+        required: true,
+        trigger: "input",
+        message: "请选择文件时间",
+    },
+})
+
+//删除
+const delUploadData = (row,index) => {
+
+}
+
+
+//批量上传保存
+const uploadSaveLoading = ref(false)
+const batchUploadSave = () => {
+
+}
+
+
 //左右拖动,改变树形结构宽度
 const leftWidth = ref(382)
 const onmousedown = () => {
@@ -218,7 +559,6 @@ const onmousedown = () => {
         document.onmouseup = null;
     }
 }
-
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
yarn.lock

@@ -382,7 +382,7 @@ csstype@^2.6.8:
   resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.20.tgz#9229c65ea0b260cf4d3d997cb06288e36a8d6dda"
   integrity sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==
 
-dayjs@^1.11.3:
+dayjs@^1.11.3, dayjs@^1.11.5:
   version "1.11.5"
   resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.5.tgz#00e8cc627f231f9499c19b38af49f56dc0ac5e93"
   integrity sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA==