duy 2 жил өмнө
parent
commit
9c1cb1b02c

+ 11 - 12
src/views/data-fill/collapse-form/index.vue

@@ -404,7 +404,7 @@ import {
     arrIndex, deepClone, getArrValue,
     getObjVal, getObjValue, isNullES, setPosRange,
 } from 'js-fast-way'
-
+import { delMessageV2 } from '~com/message/index.js'
 //参数
 const props = defineProps({
     datas: {
@@ -673,18 +673,17 @@ const handleMenuSelect = async ({ key }) => {
     } else if (key === 'clear') {
         const { pkeyId } = tableFormItemNode.value
         const refs = await getFormRef(pkeyId)
-        // refs?.getTableFormInfo(1)
-        window?.$messageBox?.alert('请谨慎考虑是否要 清除数据?', '清除数据?', {
-            type: 'error',
-            showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
-            callback: (action) => {
-                if (action === 'confirm') {
-                       refs?.getTableFormInfo(1)
-                }
-            },
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                refs?.getTableFormInfo(1)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
         })
+        
      
     }
 }

+ 10 - 8
src/views/data-fill/division.vue

@@ -482,6 +482,7 @@ import wbsApi from '~api/data-fill/wbs'
 import queryApi from '~api/data-fill/query'
 import divisionApi from '~api/data-fill/division'
 import Draggable from 'vuedraggable'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const router = useRouter()
@@ -1081,16 +1082,17 @@ const addNodeClick = async () => {
 
 //删除节点
 const delModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除节点', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        callback: (action) => {
+
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 removeContractTreeNode()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        },
-    })
+     })
 }
 const removeContractTreeNode = async () => {
     const loadingInstance = window.$loading.service({
@@ -1308,7 +1310,7 @@ const addingFormClick = () => {
 const deltableexcel = async (row) => {
     console.log(row, 'row')
     if (row['isEle'] === 1) {
-        if (row['pdfUrl'] !== '') {
+        if (row['pdfUrl']) {
             window?.$messageBox?.alert('该表已填写数据' + ',请谨慎考虑后,确认是否需要删除?', '删除', {
                 showCancelButton: true,
                 confirmButtonText: '确认删除',

+ 8 - 7
src/views/data-fill/wbs.vue

@@ -674,6 +674,7 @@ import { eVisaTaskCheckApi, getDictionary } from '~api/other'
 import wbsApi from '~api/data-fill/wbs'
 import queryApi from '~api/data-fill/query'
 import Draggable from 'vuedraggable'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const router = useRouter()
@@ -1544,16 +1545,16 @@ const addNodeClick = async () => {
 
 //删除节点
 const delModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除节点', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 removeContractTreeNode()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        },
-    })
+     })
 }
 
 const removeContractTreeNode = async () => {

+ 7 - 6
src/views/gauge/bezier.vue

@@ -380,6 +380,7 @@ import bezierApi from '~api/gauge/bezier'
 import { getTokenHeader } from '~src/api/request/header'
 import { deepClone, downloadBlob, formValidate, getArrValue, getObjValue, isObjNull } from 'js-fast-way'
 import { genFileId } from 'element-plus'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
@@ -480,15 +481,15 @@ const handleTableEdit = (row) => {
 }
 //删除表格
 const handleTableDelete = (row) => {
-    window?.$messageBox?.alert('是否删除当前数据?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确定删除',
-        cancelButtonText: '取消',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 saveDelMileage(row.id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        },
     })
 }
 //确认删除

+ 140 - 119
src/views/gauge/station.vue

@@ -1,42 +1,44 @@
 <template>
     <div class="hc-layout-box">
-        <HcCard :scrollbar="false" actionSize="lg">
+        <HcCard :scrollbar="false" action-size="lg">
             <template #header>
                 <HcTooltip keys="gauge-station-add">
                     <el-button hc-btn type="primary" @click="AddRowClick">
-                        <HcIcon name="add-box"/>
+                        <HcIcon name="add-box" />
                         <span>新增</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="gauge-station-import">
                     <el-button hc-btn @click="importModalClick">
-                        <HcIcon name="upload-cloud"/>
+                        <HcIcon name="upload-cloud" />
                         <span>导入</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="gauge-station-export">
                     <el-button :loading="downloadLoading" hc-btn @click="exportModalClick">
-                        <HcIcon name="download"/>
+                        <HcIcon name="download" />
                         <span>导出</span>
                     </el-button>
                 </HcTooltip>
                 <div class="w-60 ml-6">
-                    <el-input v-model="searchForm.name" clearable placeholder="请输入测站点或关键字进行搜索"
-                              size="large" @keyup="keyUpEvent"/>
+                    <el-input
+                        v-model="searchForm.name" clearable placeholder="请输入测站点或关键字进行搜索"
+                        size="large" @keyup="keyUpEvent"
+                    />
                 </div>
                 <div class="ml-2">
                     <el-button size="large" type="primary" @click="searchClick">
-                        <HcIcon name="search-2"/>
+                        <HcIcon name="search-2" />
                         <span>搜索</span>
                     </el-button>
                 </div>
             </template>
             <template #extra>
-                <HcNewSwitch :datas="tabsTypeData" :keys="tabsTypeKey" @change="tabsTypeChange"/>
+                <HcNewSwitch :datas="tabsTypeData" :keys="tabsTypeKey" @change="tabsTypeChange" />
             </template>
 
             <HcTable v-if="tabsTypeKey === '0'" :column="levelTableColumn" :datas="levelTable" :loading="tableLoading">
-                <template #action="{row}">
+                <template #action="{ row }">
                     <HcTooltip keys="gauge-station-edit">
                         <el-button size="small" text type="primary" @click="handleLevelEdit(row)">编辑</el-button>
                     </HcTooltip>
@@ -46,9 +48,11 @@
                 </template>
             </HcTable>
 
-            <HcTable v-if="tabsTypeKey === '1'" :column="traverseTableColumn" :datas="traverseTable"
-                     :loading="tableLoading">
-                <template #action="{row}">
+            <HcTable
+                v-if="tabsTypeKey === '1'" :column="traverseTableColumn" :datas="traverseTable"
+                :loading="tableLoading"
+            >
+                <template #action="{ row }">
                     <HcTooltip keys="gauge-station-edit">
                         <el-button size="small" text type="primary" @click="handleTraverseEdit(row)">编辑</el-button>
                     </HcTooltip>
@@ -59,37 +63,43 @@
             </HcTable>
 
             <template #action>
-                <HcPages :pages="searchForm" @change="pageChange"/>
+                <HcPages :pages="searchForm" @change="pageChange" />
             </template>
         </HcCard>
-        <!--新增/编辑 弹框-->
-        <el-dialog v-model="showRowModal"
-                   :title="`${formRowValue?.id ? '编辑' : '新增'}${tabsTypeKey==='1'?'导线点':'水准点'}`"
-                   class="hc-modal-border"
-                   width="47rem">
+        <!-- 新增/编辑 弹框 -->
+        <el-dialog
+            v-model="showRowModal"
+            :title="`${formRowValue?.id ? '编辑' : '新增'}${tabsTypeKey === '1' ? '导线点' : '水准点'}`"
+            class="hc-modal-border"
+            width="47rem"
+        >
             <el-form ref="formRowRef" :model="formRowValue" :rules="rulesRow" label-width="auto" size="large">
                 <el-form-item label="点名称" prop="name">
-                    <el-input v-model="formRowValue.name" placeholder="请输入点名称"/>
+                    <el-input v-model="formRowValue.name" placeholder="请输入点名称" />
                 </el-form-item>
                 <el-form-item v-if="tabsTypeKey === '1'" label="X坐标(m)" prop="x">
-                    <el-input v-model="formRowValue.x" placeholder="请输入X坐标(m)"/>
+                    <el-input v-model="formRowValue.x" placeholder="请输入X坐标(m)" />
                 </el-form-item>
                 <el-form-item v-if="tabsTypeKey === '1'" label="Y坐标(m)" prop="y">
-                    <el-input v-model="formRowValue.y" placeholder="请输入Y坐标(m)"/>
+                    <el-input v-model="formRowValue.y" placeholder="请输入Y坐标(m)" />
                 </el-form-item>
                 <el-form-item label="高程(m)" prop="h">
-                    <el-input v-model="formRowValue.h" placeholder="请输入高程(m)"/>
+                    <el-input v-model="formRowValue.h" placeholder="请输入高程(m)" />
                 </el-form-item>
                 <el-form-item label="等级">
                     <el-select v-model="formRowValue.level" block>
-                        <el-option v-for="item in personData" :label="item.label" :value="item.value"
-                                   placeholder="请选择等级"/>
+                        <el-option
+                            v-for="item in personData" :label="item.label" :value="item.value"
+                            placeholder="请选择等级"
+                        />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="备注">
-                    <el-input v-model="formRowValue.remark" :autosize="{ minRows: 3, maxRows: 5 }"
-                              placeholder="请输入文字说明"
-                              type="textarea"/>
+                    <el-input
+                        v-model="formRowValue.remark" :autosize="{ minRows: 3, maxRows: 5 }"
+                        placeholder="请输入文字说明"
+                        type="textarea"
+                    />
                 </el-form-item>
             </el-form>
             <template #footer>
@@ -99,46 +109,57 @@
                 </div>
             </template>
         </el-dialog>
-        <!--导入 弹框-->
-        <el-dialog v-model="showImportModal" :title="`导入${tabsTypeKey==='1'?'导线点':'水准点'}`"
-                   class="hc-modal-border"
-                   width="47rem">
+        <!-- 导入 弹框 -->
+        <el-dialog
+            v-model="showImportModal" :title="`导入${tabsTypeKey === '1' ? '导线点' : '水准点'}`"
+            class="hc-modal-border"
+            width="47rem"
+        >
             <div class="hc-import-modal-box">
                 <div class="tip-box">
                     <span>请先下载导入模板(</span>
-                    <a v-if="tabsTypeKey==='1'"
-                       class="text-link"
-                       href="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220614/a4b08ea228dbf74db1c049c4d878fbe7.xlsx"
-                       target="_blank">导线点导入模板</a>
-                    <a v-if="tabsTypeKey==='0'"
-                       class="text-link"
-                       href="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220629/5fa2abeaa1ad553ee4adf64118df4e2a.xlsx"
-                       target="_blank">水准点导入模板</a>
+                    <a
+                        v-if="tabsTypeKey === '1'"
+                        class="text-link"
+                        href="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220614/a4b08ea228dbf74db1c049c4d878fbe7.xlsx"
+                        target="_blank"
+                    >导线点导入模板</a>
+                    <a
+                        v-if="tabsTypeKey === '0'"
+                        class="text-link"
+                        href="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220629/5fa2abeaa1ad553ee4adf64118df4e2a.xlsx"
+                        target="_blank"
+                    >水准点导入模板</a>
                     <span> ),按模板样式编辑测站点后,再点击"选择文件"按钮选择编辑好的文件,并点击底部的"确认导入"按钮即可导入成功!</span>
                 </div>
                 <div class="upload-box">
-                    <el-upload ref="uploadRef" v-model:file-list="fileList" :accept="accept" :action="action"
-                               :auto-upload="false" :data="addition" :headers="getTokenHeader()" :limit="1"
-                               :on-error="handleUploadError" :on-exceed="handleUploadExceed"
-                               :on-progress="handleUploadProgress" :on-success="handleUploadFinish">
+                    <el-upload
+                        ref="uploadRef" v-model:file-list="fileList" :accept="accept" :action="action"
+                        :auto-upload="false" :data="addition" :headers="getTokenHeader()" :limit="1"
+                        :on-error="handleUploadError" :on-exceed="handleUploadExceed"
+                        :on-progress="handleUploadProgress" :on-success="handleUploadFinish"
+                    >
                         <template #trigger>
                             <el-button :loading="importLoading" type="primary">选择文件</el-button>
                         </template>
                     </el-upload>
                 </div>
                 <div class="text-orange">导入模板格式示例:</div>
-                <div v-if="tabsTypeKey==='1'" class="demo-img-box">
+                <div v-if="tabsTypeKey === '1'" class="demo-img-box">
                     <img alt="" src="../../assets/view/152221@2x.png">
                 </div>
-                <div v-if="tabsTypeKey==='0'" class="demo-img-box">
+                <div v-if="tabsTypeKey === '0'" class="demo-img-box">
                     <img alt="" src="../../assets/view/152211@2x.png">
                 </div>
             </div>
             <template #footer>
                 <div class="dialog-footer">
                     <el-button size="large" @click="showImportModal = false">取消</el-button>
-                    <el-button :disabled="fileList.length <= 0" :loading="importLoading" hc-btn type="primary"
-                               @click="handleImportClick">确认导入
+                    <el-button
+                        :disabled="fileList.length <= 0" :loading="importLoading" hc-btn type="primary"
+                        @click="handleImportClick"
+                    >
+                        确认导入
                     </el-button>
                 </div>
             </template>
@@ -147,13 +168,14 @@
 </template>
 
 <script setup>
-import {ref, onMounted} from "vue";
-import {useRouter, useRoute} from 'vue-router'
-import {useAppStore} from "~src/store/index";
-import stationApi from '~api/gauge/station';
-import {getTokenHeader} from '~src/api/request/header';
-import {genFileId} from 'element-plus'
-import {getArrValue, downloadBlob, formValidate} from "js-fast-way"
+import { onMounted, ref } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+import { useAppStore } from '~src/store/index'
+import stationApi from '~api/gauge/station'
+import { getTokenHeader } from '~src/api/request/header'
+import { genFileId } from 'element-plus'
+import { downloadBlob, formValidate, getArrValue } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const router = useRouter()
@@ -161,19 +183,19 @@ const useRoutes = useRoute()
 const useAppState = useAppStore()
 
 //路由参数
-const routerQuery = useRoutes?.query;
+const routerQuery = useRoutes?.query
 const typeName = routerQuery?.type || '0'
 
 //全局变量
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 
 //类型tab数据和相关处理
 const tabsTypeKey = ref(typeName)
 const tabsTypeData = ref([
-    {key: '0', name: '水准点'},
-    {key: '1', name: '导线点'}
-]);
+    { key: '0', name: '水准点' },
+    { key: '1', name: '导线点' },
+])
 const tabsTypeChange = (item) => {
     tabsTypeKey.value = item?.key
     searchForm.value.type = item?.key
@@ -183,8 +205,8 @@ const tabsTypeChange = (item) => {
     router.push({
         path: useRoutes.path,
         query: {
-            type: item?.key
-        }
+            type: item?.key,
+        },
     })
 }
 //渲染完成
@@ -196,13 +218,13 @@ onMounted(() => {
 //搜索表单
 const searchForm = ref({
     projectId: projectId.value, contractId: contractId.value, name: null, type: '0',
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
@@ -214,7 +236,7 @@ const searchClick = () => {
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -222,23 +244,23 @@ const pageChange = ({current, size}) => {
 
 //导线点
 const traverseTableColumn = ref([
-    {key: 'name', name: '测站点名称'},
-    {key: 'x', name: 'X坐标(m)'},
-    {key: 'y', name: 'Y坐标(m)'},
-    {key: 'h', name: '高程(m)'},
-    {key: 'level', name: '等级'},
-    {key: 'remark', name: '备注'},
-    {key: 'action', name: '操作', width: '130'}
+    { key: 'name', name: '测站点名称' },
+    { key: 'x', name: 'X坐标(m)' },
+    { key: 'y', name: 'Y坐标(m)' },
+    { key: 'h', name: '高程(m)' },
+    { key: 'level', name: '等级' },
+    { key: 'remark', name: '备注' },
+    { key: 'action', name: '操作', width: '130' },
 ])
 const traverseTable = ref([])
 
 //水准点
 const levelTableColumn = ref([
-    {key: 'name', name: '测站点名称'},
-    {key: 'h', name: '高程(m)'},
-    {key: 'level', name: '等级'},
-    {key: 'remark', name: '备注'},
-    {key: 'action', name: '操作', width: '130'}
+    { key: 'name', name: '测站点名称' },
+    { key: 'h', name: '高程(m)' },
+    { key: 'level', name: '等级' },
+    { key: 'remark', name: '备注' },
+    { key: 'action', name: '操作', width: '130' },
 ])
 const levelTable = ref([])
 
@@ -246,10 +268,10 @@ const levelTable = ref([])
 const tableLoading = ref(false)
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await stationApi.queryListData({
+    const { error, code, data } = await stationApi.queryListData({
         projectId: projectId.value,
         contractId: contractId.value,
-        ...searchForm.value
+        ...searchForm.value,
     })
     //处理数据
     tableLoading.value = false
@@ -270,35 +292,35 @@ const getTableData = async () => {
 
 //等级
 const personData = ref([
-    {label: "一级", value: "一级"}, {label: "二级", value: "二级"},
-    {label: "三级", value: "三级"}, {label: "四级", value: "四级"}
+    { label: '一级', value: '一级' }, { label: '二级', value: '二级' },
+    { label: '三级', value: '三级' }, { label: '四级', value: '四级' },
 ])
 
 //新增 / 编辑 配置
 const showRowModal = ref(false)
 const formRowRef = ref(null)
-const formRowValue = ref({name: '', x: '', y: '', h: '', level: null, remark: null})
+const formRowValue = ref({ name: '', x: '', y: '', h: '', level: null, remark: null })
 const rulesRow = {
     name: {
         required: true,
-        trigger: "blur",
-        message: "请输入测站点名称"
+        trigger: 'blur',
+        message: '请输入测站点名称',
     },
     x: {
         required: true,
-        trigger: "blur",
-        message: "请输入X坐标(m)"
+        trigger: 'blur',
+        message: '请输入X坐标(m)',
     },
     y: {
         required: true,
-        trigger: "blur",
-        message: "请输入Y坐标(m)"
+        trigger: 'blur',
+        message: '请输入Y坐标(m)',
     },
     h: {
         required: true,
-        trigger: "blur",
-        message: "请输入高程(m)"
-    }
+        trigger: 'blur',
+        message: '请输入高程(m)',
+    },
 }
 
 //新增
@@ -308,12 +330,12 @@ const AddRowClick = () => {
         projectId: projectId.value,
         contractId: contractId.value,
         type: tabsTypeKey.value,
-        name: '', h: '', level: null, remark: null
+        name: '', h: '', level: null, remark: null,
     }
     if (type === '0') {
         formRowValue.value = obj
     } else if (type === '1') {
-        formRowValue.value = {...obj, x: '', y: ''}
+        formRowValue.value = { ...obj, x: '', y: '' }
     }
     saveFormLoading.value = false
     showRowModal.value = true
@@ -325,9 +347,9 @@ const saveFormClick = async () => {
     const validate = await formValidate(formRowRef.value)
     if (validate) {
         const form = formRowValue.value
-        if (!!form.id) {
+        if (form.id) {
             saveFormLoading.value = true
-            const {error, code} = await stationApi.updateSave(form, false)
+            const { error, code } = await stationApi.updateSave(form, false)
             //判断状态
             saveFormLoading.value = false
             if (!error && code === 200) {
@@ -339,7 +361,7 @@ const saveFormClick = async () => {
             }
         } else {
             saveFormLoading.value = true
-            const {error, code} = await stationApi.addSave(form, false)
+            const { error, code } = await stationApi.addSave(form, false)
             //判断状态
             saveFormLoading.value = false
             if (!error && code === 200) {
@@ -361,15 +383,15 @@ const importLoading = ref(false)
 const uploadRef = ref(null)
 const addition = ref({})
 const fileList = ref([])
-const action = '/api/blade-business/dap/import';
-const accept = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel';
+const action = '/api/blade-business/dap/import'
+const accept = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel'
 
 //导入
 const importModalClick = () => {
     addition.value = {
         projectId: projectId.value,
         contractId: contractId.value,
-        type: tabsTypeKey.value
+        type: tabsTypeKey.value,
     }
     importLoading.value = false
     showImportModal.value = true
@@ -415,7 +437,7 @@ const exportModalClick = () => {
             if (action === 'confirm') {
                 getExportExcel()
             }
-        }
+        },
     })
 }
 //确定导出
@@ -423,11 +445,11 @@ const downloadLoading = ref(false)
 const getExportExcel = async () => {
     //批量下载
     downloadLoading.value = true
-    const {error, disposition, res} = await stationApi.getExportExcel({
+    const { error, disposition, res } = await stationApi.getExportExcel({
         projectId: projectId.value,
         contractId: contractId.value,
         type: tabsTypeKey.value,
-        search: searchForm.value['name'] || ''
+        search: searchForm.value['name'] || '',
     })
     //处理数据
     downloadLoading.value = false
@@ -446,21 +468,21 @@ const handleLevelEdit = (row) => {
         ...row,
         projectId: projectId.value,
         contractId: contractId.value,
-        type: tabsTypeKey.value
+        type: tabsTypeKey.value,
     }
     saveFormLoading.value = false
     showRowModal.value = true
 }
 const handleLevelDelete = (row) => {
-    window?.$messageBox?.alert('是否删除当前数据?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确定删除',
-        cancelButtonText: '取消',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 delData(row.id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
     })
 }
 
@@ -470,27 +492,27 @@ const handleTraverseEdit = (row) => {
         ...row,
         projectId: projectId.value,
         contractId: contractId.value,
-        type: tabsTypeKey.value
+        type: tabsTypeKey.value,
     }
     saveFormLoading.value = false
     showRowModal.value = true
 }
 const handleTraverseDelete = (row) => {
-    window?.$messageBox?.alert('是否删除当前数据?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确定删除',
-        cancelButtonText: '取消',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 delData(row.id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
     })
 }
 
 //删除请求
 const delData = async (id) => {
-    const {error, code} = await stationApi.delData({ids: id}, false)
+    const { error, code } = await stationApi.delData({ ids: id }, false)
     //判断状态
     if (!error && code === 200) {
         window?.$message?.success('删除成功')
@@ -499,7 +521,6 @@ const delData = async (id) => {
         window?.$message?.error('删除失败')
     }
 }
-
 </script>
 
 <style lang="scss" scoped>

+ 123 - 105
src/views/other-file/image-view.vue

@@ -1,71 +1,83 @@
 <template>
     <div class="hc-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <template v-if="dataType === 1">
                 <div class="hc-project-box">
                     <div class="hc-project-icon-box">
-                        <HcIcon name="stack"/>
+                        <HcIcon name="stack" />
                     </div>
                     <div class="ml-2 project-name-box">
-                        <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                        <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                        <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                        <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                     </div>
                 </div>
-                <div class="hc-tree-box" v-if="dataType === 1">
+                <div v-if="dataType === 1" class="hc-tree-box">
                     <el-scrollbar>
-                        <WbsTree :autoExpandKeys="TreeAutoExpandKeys" :contractId="contractId" :projectId="projectId"
-                                 @nodeTap="nodeWbsElTreeClick"/>
+                        <WbsTree
+                            :auto-expand-keys="TreeAutoExpandKeys" :contract-id="contractId" :project-id="projectId"
+                            @nodeTap="nodeWbsElTreeClick"
+                        />
                     </el-scrollbar>
                 </div>
             </template>
             <div v-else class="hc-tree-box date-tree">
                 <el-scrollbar v-if="dataType === 2">
-                    <HcTreeData :autoExpandKeys="TreeExpandedKeys" :datas="dateElTreeData"
-                                @nodeTap="dateWbsElTreeClick"/>
+                    <HcTreeData
+                        :auto-expand-keys="TreeExpandedKeys" :datas="dateElTreeData"
+                        @nodeTap="dateWbsElTreeClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-layout-content-box">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip keys="image-data-add">
                         <el-button :disabled="!queryKey && dataType === 1" hc-btn type="primary" @click="addFormFile">
-                            <HcIcon name="add_box"/>
+                            <HcIcon name="add_box" />
                             <span>新增文件</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="image-data-download">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="downloadLoading" hc-btn
-                                   @click="downloadClick">
-                            <HcIcon name="download"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="downloadLoading" hc-btn
+                            @click="downloadClick"
+                        >
+                            <HcIcon name="download" />
                             <span>下载</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="image-data-del">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="delLoading" hc-btn
-                                   @click="delClick">
-                            <HcIcon name="delete"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="delLoading" hc-btn
+                            @click="delClick"
+                        >
+                            <HcIcon name="delete" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #extra>
                     <div class="w-60">
-                        <el-input v-model="searchForm.queryStr" clearable placeholder="根据题名名称或拍摄者搜索"
-                                  size="large" @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryStr" clearable placeholder="根据题名名称或拍摄者搜索"
+                            size="large" @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button size="large" type="primary" @click="searchClick">搜索</el-button>
                     </div>
                 </template>
-                <HcTable ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
-                         isCheck @selection-change="tableSelectionChange">
-                    <template #info="{row}">
+                <HcTable
+                    ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
+                    is-check @selection-change="tableSelectionChange"
+                >
+                    <template #info="{ row }">
                         <div class="hc-table-col-item">
                             <div v-if="row.type !== 1" class="img-box">
-                                <HcImg :src="setImageUrl(row.imageUrl)" class="hc-image"/>
+                                <HcImg :src="setImageUrl(row.imageUrl)" class="hc-image" />
                             </div>
                             <div v-else class="img-box">
                                 <video :src="row.imageUrl">
@@ -80,10 +92,13 @@
                             </div>
                         </div>
                     </template>
-                    <template #operate="{row}">
+                    <template #operate="{ row }">
                         <HcTooltip keys="image-data-preview">
-                            <el-button :loading="previewLoading" size="small" text type="primary"
-                                       @click="previewClick(row)">查看
+                            <el-button
+                                :loading="previewLoading" size="small" text type="primary"
+                                @click="previewClick(row)"
+                            >
+                                查看
                             </el-button>
                         </HcTooltip>
                         <HcTooltip keys="image-data-edit">
@@ -95,21 +110,23 @@
                     <div class="lr-dialog-footer">
                         <div class="left">
                             <el-button size="large" @click="goToBack">
-                                <HcIcon name="arrow-go-back"/>
+                                <HcIcon name="arrow-go-back" />
                                 <span>返回</span>
                             </el-button>
                         </div>
                         <div class="right">
-                            <HcPages :pages="searchForm" @change="pageChange"/>
+                            <HcPages :pages="searchForm" @change="pageChange" />
                         </div>
                     </div>
                 </template>
             </HcCard>
         </div>
-        <!--视频预览 弹框-->
+        <!-- 视频预览 弹框 -->
         <el-dialog v-model="previewVideoModal" class="hc-modal-border" destroy-on-close title="预览" width="47rem">
-            <video v-if="previewVideoUrl" :src="previewVideoUrl" autoplay="autoplay" class="preview-video"
-                   controls="controls">
+            <video
+                v-if="previewVideoUrl" :src="previewVideoUrl" autoplay="autoplay" class="preview-video"
+                controls="controls"
+            >
                 您的浏览器不支持 video
             </video>
         </el-dialog>
@@ -117,34 +134,35 @@
 </template>
 
 <script setup>
-import {onMounted, ref, watch} from 'vue'
-import {useAppStore} from "~src/store";
-import {useRouter, useRoute} from 'vue-router'
-import WbsTree from "./components/WbsTree.vue"
-import HcTreeData from "./components/HcTreeData.vue"
-import imageApi from '~api/other-file/imageData';
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
-import {arrToId, downloadBlob, getArrValue, isString} from "js-fast-way"
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import { useRoute, useRouter } from 'vue-router'
+import WbsTree from './components/WbsTree.vue'
+import HcTreeData from './components/HcTreeData.vue'
+import imageApi from '~api/other-file/imageData'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import { arrToId, downloadBlob, getArrValue, isString } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 //变量
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //路由参数
-const routerQuery = useRoutes?.query;
+const routerQuery = useRoutes?.query
 //存储目录格式 1按部位存储,2按日期存储
 const dataId = ref(routerQuery?.id || '')
-const dataType = ref(parseInt(routerQuery?.type + '') );
-const fileType = ref(parseInt(routerQuery?.fileType + '') || 2);
+const dataType = ref(parseInt(routerQuery?.type + '') )
+const fileType = ref(parseInt(routerQuery?.fileType + '') || 2)
 
 //监听
 watch(() => [
     useAppState.getCollapse,
-    useAppState.getContractId
+    useAppState.getContractId,
 ], ([Collapse, ContractId]) => {
     isCollapse.value = Collapse
     contractId.value = ContractId
@@ -152,13 +170,13 @@ watch(() => [
 
 //监听路由参数改变
 watch(() => [
-    useRoutes?.query
+    useRoutes?.query,
 ], ([query]) => {
     dataId.value = query?.id || ''
     dataType.value = parseInt(query?.type + '') 
     fileType.value = parseInt(query?.fileType + '') || 2
     initMounted()
-}, {deep: true})
+}, { deep: true })
 
 watch(contractId, (val) => {
     if (val) {
@@ -195,7 +213,7 @@ const initMounted = () => {
             queryKey.value = ''
         }
         searchForm.value.queryDate = nodeKey
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
     } else {
         queryKey.value = ''
@@ -205,10 +223,10 @@ const initMounted = () => {
 //获取时间结构
 const dateElTreeData = ref([])
 const getYearDateTree = async () => {
-    const {error, code, data} = await imageApi.getYearDateTree({
+    const { error, code, data } = await imageApi.getYearDateTree({
         projectId: projectId.value,
         contractId: contractId.value,
-        classifyId: dataId.value
+        classifyId: dataId.value,
     })
     //处理数据
     if (!error && code === 200) {
@@ -219,7 +237,7 @@ const getYearDateTree = async () => {
 }
 //日期树被点击
 const nodeDataInfo = ref({})
-const dateWbsElTreeClick = ({data, keys, key}) => {
+const dateWbsElTreeClick = ({ data, keys, key }) => {
     // queryKey.value = key
     queryKey.value = ''
     nodeDataInfo.value = data
@@ -231,12 +249,12 @@ const dateWbsElTreeClick = ({data, keys, key}) => {
     //改变搜索表单数据
     searchForm.value.queryDate = data['hierarchy'] || ''
     searchForm.value.wbsIdsStr = null
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //项目树被点击
-const nodeWbsElTreeClick = ({data, keys}) => {
+const nodeWbsElTreeClick = ({ data, keys }) => {
     searchForm.value.wbsIdsStr = data?.primaryKeyId || ''
     if (data.leaf === true) {
         nodeDataInfo.value = data
@@ -248,7 +266,7 @@ const nodeWbsElTreeClick = ({data, keys}) => {
         //改变搜索表单数据
         searchForm.value.queryDate = null
         // searchForm.value.wbsIdsStr = data?.primaryKeyId || ''
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
     } else {
         getTableData()
@@ -265,12 +283,12 @@ const nodeWbsElTreeClick = ({data, keys}) => {
 const queryKey = ref(null)
 const searchForm = ref({
     queryStr: null, classifyId: dataId.value, wbsIdsStr: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
+    if (e.key === 'Enter') {
         searchClick()
     }
 }
@@ -278,7 +296,7 @@ const keyUpEvent = (e) => {
 //搜索
 const searchClick = () => {
     if (queryKey.value) {
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
     } else {
         window?.$message?.warning('请先在左边选择一个树节点')
@@ -286,7 +304,7 @@ const searchClick = () => {
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -297,16 +315,16 @@ 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'},
+    { 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({
+    const { error, code, data } = await imageApi.getPageList({
         ...searchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //判断状态
     tableLoading.value = false
@@ -320,10 +338,10 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelectionChange = (rows) => {
     tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== '';
+        return (item ?? '') !== ''
     })
 }
 
@@ -346,29 +364,29 @@ const previewVideoUrl = ref('')
 const previewVideoModal = ref(false)
 const previewLoading = ref(false)
 const previewClick = async (item) => {
-    const {id, type, imageUrl, margePdfUrl} = item
+    const { id, type, imageUrl, margePdfUrl } = item
     if (parseInt(type) === 1) {
         if (imageUrl) {
             previewVideoUrl.value = imageUrl
             previewVideoModal.value = true
         } else {
-            window.$message?.warning('暂无可预览的资料文件');
+            window.$message?.warning('暂无可预览的资料文件')
         }
     } else if (parseInt(type) === 2) {
         if (margePdfUrl) {
-            window.open(margePdfUrl, "_blank");
+            window.open(margePdfUrl, '_blank')
         } else {
             previewLoading.value = true
-            const {error, code, data} = await imageApi.imageClassificationFile({
-                ids: id
+            const { error, code, data } = await imageApi.imageClassificationFile({
+                ids: id,
             }, false)
             //判断状态
             previewLoading.value = false
             if (!error && code === 200 && isString(data)) {
                 item.margePdfUrl = data
-                window.open(data, "_blank");
+                window.open(data, '_blank')
             } else {
-                window.$message?.warning('预览资料文件异常');
+                window.$message?.warning('预览资料文件异常')
             }
         }
     }
@@ -379,25 +397,25 @@ const addFormFile = () => {
     router.push({
         path: '/other-file/image-form',
         query: {
-            wbsId: queryKey.value,  //树节点ID
-            dataType: dataType.value,     //存储目录格式 1按部位存储,2按日期存储
-            fileType: fileType.value,     //文件类型,1视频文件,2图片文件
-            classifyId: dataId.value,     //classifyId,分类ID,
-        }
+            wbsId: queryKey.value, //树节点ID
+            dataType: dataType.value, //存储目录格式 1按部位存储,2按日期存储
+            fileType: fileType.value, //文件类型,1视频文件,2图片文件
+            classifyId: dataId.value, //classifyId,分类ID,
+        },
     })
 }
 
 //编辑修改
-const editClick = ({id}) => {
+const editClick = ({ id }) => {
     router.push({
         path: '/other-file/image-form',
         query: {
-            wbsId: queryKey.value,  //树节点ID
-            dataType: dataType.value,     //存储目录格式 1按部位存储,2按日期存储
-            fileType: fileType.value,     //文件类型,1视频文件,2图片文件
-            classifyId: dataId.value,     //classifyId,分类ID,
-            id: id  //数据ID
-        }
+            wbsId: queryKey.value, //树节点ID
+            dataType: dataType.value, //存储目录格式 1按部位存储,2按日期存储
+            fileType: fileType.value, //文件类型,1视频文件,2图片文件
+            classifyId: dataId.value, //classifyId,分类ID,
+            id: id, //数据ID
+        },
     })
 }
 
@@ -408,7 +426,7 @@ const downloadClick = async () => {
     if (rows.length > 0) {
         downloadLoading.value = true
         const ids = arrToId(rows)
-        const {error, disposition, res} = await imageApi.batchDownloadFileToZip({ids: ids}, false)
+        const { error, disposition, res } = await imageApi.batchDownloadFileToZip({ ids: ids }, false)
         //判断状态
         if (!error) {
             if (disposition) {
@@ -418,7 +436,7 @@ const downloadClick = async () => {
             }
         }
     } else {
-        window.$message?.warning('请先勾选需要下载的资料文件');
+        window.$message?.warning('请先勾选需要下载的资料文件')
     }
 }
 
@@ -428,23 +446,23 @@ const delClick = async () => {
     const rows = tableCheckedKeys.value
     if (rows.length > 0) {
         const ids = arrToId(rows)
-        window?.$messageBox?.alert('是否删除勾选的资料文件?', '删除提醒', {
-            showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
-            callback: (action) => {
-                if (action === 'confirm') {
-                    removeImageclassifyFile(ids)
-                }
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                removeImageclassifyFile(ids)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
         })
     } else {
-        window.$message?.warning('请先勾选需要删除的资料文件');
+        window.$message?.warning('请先勾选需要删除的资料文件')
     }
 }
 const removeImageclassifyFile = async (ids) => {
     delLoading.value = true
-    const {error, code} = await imageApi.removeImageclassifyFile({ids: ids}, false)
+    const { error, code } = await imageApi.removeImageclassifyFile({ ids: ids }, false)
     //判断状态
     delLoading.value = false
     if (!error && code === 200) {
@@ -457,24 +475,24 @@ const removeImageclassifyFile = async (ids) => {
 
 //回到影像资料页
 const goToBack = () => {
-    router.push({path: '/other-file/image-data'})
+    router.push({ path: '/other-file/image-data' })
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(dataType.value === 1 ? 382 : 220);
+const leftWidth = ref(dataType.value === 1 ? 382 : 220)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        const diffVal = ve.clientX - leftNum;
+        const diffVal = ve.clientX - leftNum
         const minWidth = dataType.value === 1 ? 310 : 200
         const maxWidth = dataType.value === 1 ? 900 : 300
         if (diffVal >= minWidth && diffVal <= maxWidth) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 269 - 229
src/views/other-file/project-scanning.vue

@@ -1,67 +1,71 @@
 <template>
     <div class="hc-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                    <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
-                    <ProjectTree :autoExpandKeys="TreeAutoExpandKeys" :datas="ElTreeData" @nodeTap="nodeElTreeClick"/>
+                    <ProjectTree :auto-expand-keys="TreeAutoExpandKeys" :datas="ElTreeData" @nodeTap="nodeElTreeClick" />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-layout-content-box">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip keys="project-scanning-upload">
                         <el-button :disabled="!nodeIds" hc-btn type="primary" @click="uploadModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>上传文件</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="project-scanning-download">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="batchDownloadLoading" hc-btn
-                                   @click="batchDownload">
-                            <HcIcon name="download"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="batchDownloadLoading" hc-btn
+                            @click="batchDownload"
+                        >
+                            <HcIcon name="download" />
                             <span>批量下载</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="project-scanning-report">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="reportLoading" hc-btn
-                                   @click="reportModalClick">
-                            <HcIcon name="send-plane-2"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="reportLoading" hc-btn
+                            @click="reportModalClick"
+                        >
+                            <HcIcon name="send-plane-2" />
                             <span>批量上报</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="project-scanning-attest">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="certificationModalClick">
-                            <HcIcon name="vip-diamond"/>
+                            <HcIcon name="vip-diamond" />
                             <span>批量认证</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="project-scanning-del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="batchDel">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>批量删除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="project-scanning-edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="batchEditClick">
-                            <HcIcon name="draft"/>
+                            <HcIcon name="draft" />
                             <span>批量编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="project-scanning-abolish">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="batchAbolishClick">
-                            <HcIcon name="delete-bin-3"/>
+                            <HcIcon name="delete-bin-3" />
                             <span>批量废除</span>
                         </el-button>
                     </HcTooltip>
@@ -69,103 +73,135 @@
                 <template #search>
                     <div class="w-32">
                         <el-select v-model="searchForm.isApprovalValue" clearable placeholder="审批状态">
-                            <el-option v-for="item in approvalData" :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" clearable placeholder="认证状态">
-                            <el-option v-for="item in certificationType" :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">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入文件名、责任者进行搜索"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入文件名、责任者进行搜索"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
-                         isCheck @selection-change="tableSelectionChange">
-                    <template #fileName="{row}">
+                <HcTable
+                    ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
+                    is-check @selection-change="tableSelectionChange"
+                >
+                    <template #fileName="{ row }">
                         <span class="text-link" @click="tablePreview(row)">{{ row?.fileName }}</span>
                     </template>
-                    <template #isApprovalValue="{row}">
+                    <template #isApprovalValue="{ row }">
                         <el-tag
-                            v-if="row['isApprovalValue']"
+                            v-if="row.isApprovalValue"
                             :type="`${row.status === 2 ? 'success' : row.status === 0 ? 'warning' : row.status === 1 ? 'danger' : 'info'}`"
-                            class="mx-1" effect="dark">{{ row['isApprovalValue'] }}
+                            class="mx-1" effect="dark"
+                        >
+                            {{ row.isApprovalValue }}
                         </el-tag>
                     </template>
                 </HcTable>
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增编辑文件-->
+        <!-- 新增编辑文件 -->
         <el-dialog v-model="showUploadModal" class="hc-modal-border hc-modal-table" title="上传工程文件" width="80vw">
-            <HcTable :column="tableUploadColumn" :datas="tableUploadData" :loading="uploadSaveLoading"
-                     ui="hc-form-table">
-                <template #fileNumber="{row}">
-                    <el-input v-model="row.fileNumber" :class="row['isFileNumber'] ? 'is-error' : ''"
-                              @input="tableInput($event, row, 'isFileNumber')"/>
+            <HcTable
+                :column="tableUploadColumn" :datas="tableUploadData" :loading="uploadSaveLoading"
+                ui="hc-form-table"
+            >
+                <template #fileNumber="{ row }">
+                    <el-input
+                        v-model="row.fileNumber" :class="row.isFileNumber ? 'is-error' : ''"
+                        @input="tableInput($event, row, 'isFileNumber')"
+                    />
                 </template>
-                <template #fileName="{row}">
-                    <el-input v-model="row.fileName" :class="row['isFileName'] ? 'is-error' : ''"
-                              @input="tableInput($event, row, 'isFileName')"/>
+                <template #fileName="{ row }">
+                    <el-input
+                        v-model="row.fileName" :class="row.isFileName ? 'is-error' : ''"
+                        @input="tableInput($event, row, 'isFileName')"
+                    />
                 </template>
-                <template #fileTime="{row}">
-                    <el-date-picker v-model="row.fileTime" :clearable="false" format="YYYY/MM/DD" type="date"
-                                    value-format="YYYY-MM-DD"/>
+                <template #fileTime="{ row }">
+                    <el-date-picker
+                        v-model="row.fileTime" :clearable="false" format="YYYY/MM/DD" type="date"
+                        value-format="YYYY-MM-DD"
+                    />
                 </template>
-                <template v-if="isBuiltDrawing === 1" #sheetType="{row}">
+                <template v-if="isBuiltDrawing === 1" #sheetType="{ row }">
                     <el-select v-model="row.sheetType">
-                        <el-option v-for="item in sheetType" :key="item['dictKey']" :label="item['dictValue']"
-                                   :value="item['dictKey']"/>
+                        <el-option
+                            v-for="item in sheetType" :key="item.dictKey" :label="item.dictValue"
+                            :value="item.dictKey"
+                        />
                     </el-select>
                 </template>
-                <template v-if="isBuiltDrawing === 1" #sheetSource="{row}">
+                <template v-if="isBuiltDrawing === 1" #sheetSource="{ row }">
                     <el-select v-model="row.sheetSource">
-                        <el-option v-for="item in sheetSourceType" :key="item['dictKey']" :label="item['dictValue']"
-                                   :value="item['dictKey']"/>
+                        <el-option
+                            v-for="item in sheetSourceType" :key="item.dictKey" :label="item.dictValue"
+                            :value="item.dictKey"
+                        />
                     </el-select>
                 </template>
-                <template v-if="isBuiltDrawing === 1" #drawingNo="{row}">
-                    <el-input v-model="row.drawingNo"/>
+                <template v-if="isBuiltDrawing === 1" #drawingNo="{ row }">
+                    <el-input v-model="row.drawingNo" />
                 </template>
-                <template v-if="isBuiltDrawing === 1" #citeChangeNumber="{row}">
-                    <el-input v-model="row.citeChangeNumber"/>
+                <template v-if="isBuiltDrawing === 1" #citeChangeNumber="{ row }">
+                    <el-input v-model="row.citeChangeNumber" />
                 </template>
-                <template #isApproval="{row}">
+                <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-option
+                            v-for="item in whetherData" :key="item.value" :label="item.label"
+                            :value="item.value"
+                        />
                     </el-select>
                 </template>
-                <template #isNeedCertification="{row}">
+                <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-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 #dutyUser="{ row }">
+                    <el-input v-model="row.dutyUser" />
                 </template>
-                <template #action="{row,index}">
-                    <HcFileUpload1 v-if="row.id" @change="newUploadsChange($event, row)"
-                                   @progress="newUploadsProgress($event, row)">
-                        <el-button :loading="row['newBtnLoading']" plain size="small" type="primary">上传新文件
+                <template #action="{ row, index }">
+                    <HcFileUpload1
+                        v-if="row.id" @change="newUploadsChange($event, row)"
+                        @progress="newUploadsProgress($event, row)"
+                    >
+                        <el-button :loading="row.newBtnLoading" plain size="small" type="primary">
+                            上传新文件
                         </el-button>
                     </HcFileUpload1>
-                    <el-button :loading="row['delBtnLoading']" plain size="small" type="danger"
-                               @click="delUploadData(row,index)">删除
+                    <el-button
+                        :loading="row.delBtnLoading" plain size="small" type="danger"
+                        @click="delUploadData(row, index)"
+                    >
+                        删除
                     </el-button>
                 </template>
             </HcTable>
@@ -174,19 +210,21 @@
                     <div class="left flex items-center">
                         <HcFileUpload @change="uploadsChange" @progress="uploadsProgress">
                             <el-button :disabled="uploadSaveLoading" :loading="uploadsLoading" hc-btn type="primary">
-                                <HcIcon name="add-circle"/>
+                                <HcIcon name="add-circle" />
                                 <span>新增上传</span>
                             </el-button>
                         </HcFileUpload>
                     </div>
                     <div class="right">
                         <el-button size="large" @click="batchUploadCancel">
-                            <HcIcon name="close"/>
+                            <HcIcon name="close" />
                             <span>取消</span>
                         </el-button>
-                        <el-button :disabled="uploadsLoading" :loading="uploadSaveLoading" hc-btn type="primary"
-                                   @click="batchUploadSave">
-                            <HcIcon name="save"/>
+                        <el-button
+                            :disabled="uploadsLoading" :loading="uploadSaveLoading" hc-btn type="primary"
+                            @click="batchUploadSave"
+                        >
+                            <HcIcon name="save" />
                             <span>提交保存</span>
                         </el-button>
                     </div>
@@ -194,15 +232,15 @@
             </template>
         </el-dialog>
 
-        <!--批量上报审批-->
+        <!-- 批量上报审批 -->
         <HcReportModal
-            :contractId="contractId"
+            :contract-id="contractId"
             :datas="reportDatas"
             :ids="reportIds"
-            :projectId="projectId"
+            :project-id="projectId"
             :show="showReportModal"
-            :taskName="reportTaskName"
-            isDatas
+            :task-name="reportTaskName"
+            is-datas
             title="批量上报审批"
             url="archiveFile/batchApproval2"
             @finish="showReportFinish"
@@ -210,24 +248,27 @@
             @tagClose="reportTaskTagClose"
         />
 
-        <!--批量认证-->
-        <el-dialog v-model="showCertificationModal" class="hc-modal-border hc-modal-table" title="批量认证"
-                   width="80vw">
+        <!-- 批量认证 -->
+        <el-dialog
+            v-model="showCertificationModal" class="hc-modal-border hc-modal-table" title="批量认证"
+            width="80vw"
+        >
             <div class="hc-card-body-flex">
                 <div class="flex-table">
                     <HcTable :column="CertColumns" :datas="CertData" ui="hc-form-table" @row-click="CertRowClick">
-                        <template #action="{row,index}">
-                            <el-button plain size="small" type="primary" @click.stop="CertRowClick2(row)">预览
+                        <template #action="{ row, index }">
+                            <el-button plain size="small" type="primary" @click.stop="CertRowClick2(row)">
+                                预览
                             </el-button>
                         </template>
                     </HcTable>
                 </div>
                 <div v-if="CertPdf" class="flex-iframe">
-                    <iframe :src="CertPdf" allow="display-capture" frameborder='1' height='100%' width='100%'></iframe>
+                    <iframe :src="CertPdf" allow="display-capture" frameborder="1" height="100%" width="100%" />
                 </div>
                 <div v-else class="flex-iframe hc-no-table-form">
                     <div class="table-form-no">
-                        <img :src="notableform" alt=""/>
+                        <img :src="notableform" alt="">
                         <div class="desc">暂无 PDF 数据</div>
                     </div>
                 </div>
@@ -235,48 +276,48 @@
             <template #footer>
                 <div class="dialog-footer">
                     <el-button size="large" @click="showCertificationModal = false">
-                        <HcIcon name="close"/>
+                        <HcIcon name="close" />
                         <span>取消</span>
                     </el-button>
                     <el-button :loading="CertLoading" hc-btn type="primary" @click="CertClick">
-                        <HcIcon name="save"/>
+                        <HcIcon name="save" />
                         <span>确认认证</span>
                     </el-button>
                 </div>
             </template>
         </el-dialog>
-
     </div>
 </template>
 
 <script setup>
-import {onMounted, ref, watch} from 'vue'
-import {useAppStore} from "~src/store";
-import {useRouter, useRoute} from 'vue-router'
-import ProjectTree from "./components/ProjectTree.vue"
-import HcFileUpload from "./components/HcFileUpload.vue"
-import HcFileUpload1 from "./components/HcFileUpload1.vue"
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
-import projectScanningApi from "~api/other-file/projectScanning";
-import notableform from '~src/assets/view/notableform.svg';
-import {downloadBlob, getArrValue, deepClone, arrToId} from "js-fast-way"
-import {eVisaTaskCheckApi} from "~api/other"
-import tasksDataApi from '~api/tasks/data';
-import ossApi from "~api/oss";
-import dayjs from "dayjs"
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import { useRoute, useRouter } from 'vue-router'
+import ProjectTree from './components/ProjectTree.vue'
+import HcFileUpload from './components/HcFileUpload.vue'
+import HcFileUpload1 from './components/HcFileUpload1.vue'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import projectScanningApi from '~api/other-file/projectScanning'
+import notableform from '~src/assets/view/notableform.svg'
+import { arrToId, deepClone, downloadBlob, getArrValue } from 'js-fast-way'
+import { eVisaTaskCheckApi } from '~api/other'
+import tasksDataApi from '~api/tasks/data'
+import ossApi from '~api/oss'
+import dayjs from 'dayjs'
+import { delMessageV2 } from '~com/message/index.js'
 
 //变量
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -297,9 +338,9 @@ onMounted(() => {
 //获取树的数据
 const ElTreeData = ref([])
 const getClassIfyList = async () => {
-    const {error, code, data} = await projectScanningApi.getClassIfyList({
+    const { error, code, data } = await projectScanningApi.getClassIfyList({
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
     if (!error && code === 200) {
@@ -315,7 +356,7 @@ const treeDataInfo = ref({})
 const nodeIds = ref('')
 const isStorageNode = ref(0)
 const isBuiltDrawing = ref(0)
-const nodeElTreeClick = ({node, data, keys, key}) => {
+const nodeElTreeClick = ({ node, data, keys, key }) => {
     treeNodeInfo.value = node
     treeDataInfo.value = data
     //设置变量
@@ -323,7 +364,7 @@ const nodeElTreeClick = ({node, data, keys, key}) => {
     isStorageNode.value = data['isStorageNode'] || 0
     isBuiltDrawing.value = data['isBuiltDrawing'] || 0
     //设置搜索数据
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     searchForm.value.nodeIds = key || ''
     setTableColumns()
     getTableData()
@@ -334,8 +375,8 @@ const nodeElTreeClick = ({node, data, keys, key}) => {
 //获取任务类型
 const approvalData = ref([])
 const firstTaskStatus = async () => {
-    const {error, code, data} = await tasksDataApi.queryTaskTypeStatus({
-        typeOrStatus: 'first_task_status'
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'first_task_status',
     })
     //处理数据
     if (!error && code === 200) {
@@ -348,8 +389,8 @@ const firstTaskStatus = async () => {
 //获取认证状态
 const certificationType = ref([])
 const certificationStatus = async () => {
-    const {error, code, data} = await tasksDataApi.queryTaskTypeStatus({
-        typeOrStatus: 'certification_status'
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'certification_status',
     })
     //处理数据
     if (!error && code === 200) {
@@ -362,8 +403,8 @@ const certificationStatus = async () => {
 //获取图幅类型
 const sheetType = ref([])
 const sheetTypeStatus = async () => {
-    const {error, code, data} = await tasksDataApi.queryTaskTypeStatus({
-        typeOrStatus: 'sheet_type'
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'sheet_type',
     })
     //处理数据
     if (!error && code === 200) {
@@ -376,8 +417,8 @@ const sheetTypeStatus = async () => {
 //获取图表来源
 const sheetSourceType = ref([])
 const sheetSourceStatus = async () => {
-    const {error, code, data} = await tasksDataApi.queryTaskTypeStatus({
-        typeOrStatus: 'sheet_source'
+    const { error, code, data } = await tasksDataApi.queryTaskTypeStatus({
+        typeOrStatus: 'sheet_source',
     })
     //处理数据
     if (!error && code === 200) {
@@ -390,12 +431,12 @@ const sheetSourceStatus = async () => {
 //搜索表单
 const searchForm = ref({
     nodeIds: '', isApprovalValue: null, isCertificationValue: null, queryValue: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
+    if (e.key === 'Enter') {
         searchClick()
     }
 }
@@ -403,7 +444,7 @@ const keyUpEvent = (e) => {
 //搜索
 const searchClick = () => {
     if (nodeIds.value) {
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
     } else {
         window?.$message?.warning('请先在左边选择一个树节点')
@@ -411,7 +452,7 @@ const searchClick = () => {
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -419,40 +460,40 @@ const pageChange = ({current, size}) => {
 
 //设置表头
 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}
+    { 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}
+            { 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}
+            { 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 },
         ]
     }
 }
@@ -462,10 +503,10 @@ const tableLoading = ref(false)
 const tableListData = ref([])
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await projectScanningApi.getarchiveFilePage({
+    const { error, code, data } = await projectScanningApi.getarchiveFilePage({
         ...searchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //判断状态
     tableLoading.value = false
@@ -480,10 +521,10 @@ const getTableData = async () => {
 
 //多选
 const tableListRef = ref(null)
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelectionChange = (rows) => {
     tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== '';
+        return (item ?? '') !== ''
     })
 }
 
@@ -517,51 +558,51 @@ const uploadModalClick = () => {
 
 //设置文件表头
 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: 180}
+    { key: 'fileNumber', name: '文件编号' },
+    { key: 'fileName', name: '文件名称' },
+    { key: 'fileTime', name: '文件时间' },
+    { key: 'isApproval', name: '是否需要审批' },
+    { key: 'isNeedCertification', name: '是否需要认证' },
+    { key: 'dutyUser', name: '责任者' },
+    { key: 'action', name: '操作', width: 180 },
 ])
 const setTableUploadColumn = () => {
     if (isBuiltDrawing.value === 1) {
         tableUploadColumn.value = [
-            {key: 'fileNumber', name: '文件编号'},
-            {key: 'fileName', name: '文件名称'},
-            {key: 'fileTime', name: '文件时间'},
-            {key: 'sheetType', name: '图幅'},
-            {key: 'sheetSource', name: '图表来源'},
-            {key: 'drawingNo', name: '图号'},
-            {key: 'citeChangeNumber', name: '引用变更令编号'},
-            {key: 'isApproval', name: '是否需要审批'},
-            {key: 'isNeedCertification', name: '是否需要认证'},
-            {key: 'dutyUser', name: '责任者'},
-            {key: 'action', name: '操作', width: 180}
+            { key: 'fileNumber', name: '文件编号' },
+            { key: 'fileName', name: '文件名称' },
+            { key: 'fileTime', name: '文件时间' },
+            { key: 'sheetType', name: '图幅' },
+            { key: 'sheetSource', name: '图表来源' },
+            { key: 'drawingNo', name: '图号' },
+            { key: 'citeChangeNumber', name: '引用变更令编号' },
+            { key: 'isApproval', name: '是否需要审批' },
+            { key: 'isNeedCertification', name: '是否需要认证' },
+            { key: 'dutyUser', name: '责任者' },
+            { key: 'action', name: '操作', width: 180 },
         ]
     } 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: 180}
+            { key: 'fileNumber', name: '文件编号' },
+            { key: 'fileName', name: '文件名称' },
+            { key: 'fileTime', name: '文件时间' },
+            { key: 'isApproval', name: '是否需要审批' },
+            { key: 'isNeedCertification', name: '是否需要认证' },
+            { key: 'dutyUser', name: '责任者' },
+            { key: 'action', name: '操作', width: 180 },
         ]
     }
 }
 const tableUploadData = ref([])
 
 //上传的文件结果
-const uploadsChange = ({fileList}) => {
+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("."))
+        let fileName = name.substring(0, name.lastIndexOf('.'))
         newArr.push({
             projectId: projectId.value,
             contractId: contractId.value,
@@ -592,7 +633,7 @@ const uploadsProgress = (val) => {
 }
 
 //表单下拉数据
-const whetherData = ref([{label: "不需要", value: 0}, {label: "需要", value: 1}])
+const whetherData = ref([{ label: '不需要', value: 0 }, { label: '需要', value: 1 }])
 
 //输入框验证
 const tableInput = (val, row, isv) => {
@@ -605,13 +646,13 @@ const tableInput = (val, row, isv) => {
 
 
 //上传新文件
-const newUploadsChange = ({fileList}, row) => {
+const newUploadsChange = ({ fileList }, row) => {
     if (fileList.length > 0) {
         const item = fileList[0]
         const name = item['originalName'] || ''
-        const fileName = name.substring(0, name.lastIndexOf("."))
+        const fileName = name.substring(0, name.lastIndexOf('.'))
         //更新数据
-        row.fileName = fileName;
+        row.fileName = fileName
         row.ossFileName = item?.name || ''
         row.fileUrl = item?.link || ''
         row.pdfFileUrl = item?.pdfUrl || ''
@@ -627,11 +668,11 @@ const newUploadsProgress = (val, row) => {
 const delUploadData = async (row, index) => {
     if (row['ossFileName']) {
         row['delBtnLoading'] = true
-        await ossApi.removeFile({fileName: row['ossFileName']})
+        await ossApi.removeFile({ fileName: row['ossFileName'] })
         row['delBtnLoading'] = false
-        tableUploadData.value.splice(index, 1);
+        tableUploadData.value.splice(index, 1)
     } else {
-        tableUploadData.value.splice(index, 1);
+        tableUploadData.value.splice(index, 1)
     }
 }
 
@@ -642,7 +683,7 @@ const batchUploadSave = async () => {
     if (rows.length > 0) {
         //验证表单数据
         uploadSaveLoading.value = true
-        let isTableRows = false;
+        let isTableRows = false
         for (let i = 0; i < rows.length; i++) {
             if (!rows[i]['fileNumber']) {
                 rows[i]['isFileNumber'] = true
@@ -671,8 +712,8 @@ const batchUploadSave = async () => {
 //确认上传保存
 const batchUploadSaveApi = async (rows) => {
     uploadSaveLoading.value = true
-    const {error, code} = await projectScanningApi.batchUploadSave({
-        list: rows
+    const { error, code } = await projectScanningApi.batchUploadSave({
+        list: rows,
     }, false)
     //判断状态
     uploadSaveLoading.value = false
@@ -697,7 +738,7 @@ const batchUploadCancel = () => {
 const batchEditClick = () => {
     const rows = deepClone(tableCheckedKeys.value)
     //判断是否满足条件
-    const result = rows.every(({status}) => {
+    const result = rows.every(({ status }) => {
         return status !== 1 && status !== 2
     })
     console.log(rows)
@@ -716,8 +757,8 @@ const batchEditClick = () => {
 //确认编辑上传保存
 const batchEditSaveApi = async (rows) => {
     uploadSaveLoading.value = true
-    const {error, code} = await projectScanningApi.batchEditSave({
-        list: rows
+    const { error, code } = await projectScanningApi.batchEditSave({
+        list: rows,
     }, false)
     //判断状态
     uploadSaveLoading.value = false
@@ -737,7 +778,7 @@ const batchDownload = async () => {
     const ids = arrToId(rows)
     //批量下载
     batchDownloadLoading.value = true
-    const {error, disposition, res} = await projectScanningApi.batchDownloadFileToZip({ids: ids})
+    const { error, disposition, res } = await projectScanningApi.batchDownloadFileToZip({ ids: ids })
     //处理数据
     batchDownloadLoading.value = false
     if (!error) {
@@ -756,15 +797,15 @@ const reportDatas = ref([])
 const showReportModal = ref(false)
 const reportLoading = ref(false)
 const reportModalClick = async () => {
-    const rows = tableCheckedKeys.value;
-    const result = rows.every(({status}) => {
+    const rows = tableCheckedKeys.value
+    const result = rows.every(({ status }) => {
         return status === 0 //isApproval !== 1 && status !== 0 || isApproval === 1 && status !== 0
     })
     if (result) {
         reportLoading.value = true
         const taskCheck = await eVisaTaskCheckApi({
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         if (taskCheck) {
             reportIds.value = arrToId(rows)
@@ -773,7 +814,7 @@ const reportModalClick = async () => {
             rows.forEach(item => {
                 reportDataArr.push({
                     id: item?.id,
-                    name: item?.fileName
+                    name: item?.fileName,
                 })
             })
             reportDatas.value = reportDataArr
@@ -791,7 +832,7 @@ const reportModalClick = async () => {
 
 //上报的审批内容移除
 const reportTaskTagClose = (index) => {
-    const row = tableCheckedKeys.value[index];
+    const row = tableCheckedKeys.value[index]
     tableListRef.value?.toggleRowSelection(row, false)
 }
 
@@ -806,15 +847,15 @@ const CertData = ref([])
 const CertIds = ref([])
 const CertPdf = ref('')
 const CertColumns = [
-    {key: 'fileName', name: '文件名称'},
-    {key: 'action', name: '操作', width: 100}
+    { key: 'fileName', name: '文件名称' },
+    { key: 'action', name: '操作', width: 100 },
 ]
 
 //批量认证弹窗
 const showCertificationModal = ref(false)
 const certificationModalClick = () => {
-    const rows = tableCheckedKeys.value;
-    const result = rows.every(({isCertification}) => {
+    const rows = tableCheckedKeys.value
+    const result = rows.every(({ isCertification }) => {
         return isCertification === 0
     })
     if (result) {
@@ -828,7 +869,7 @@ const certificationModalClick = () => {
 }
 
 //认证行被点击
-const CertRowClick = ({row}) => {
+const CertRowClick = ({ row }) => {
     const pdfFileUrl = row?.pdfFileUrl || ''
     if (CertPdf.value !== pdfFileUrl) {
         CertPdf.value = pdfFileUrl
@@ -836,7 +877,7 @@ const CertRowClick = ({row}) => {
 }
 
 //认证预览被点击
-const CertRowClick2 = ({pdfFileUrl}) => {
+const CertRowClick2 = ({ pdfFileUrl }) => {
     const pdfUrl = pdfFileUrl || ''
     if (CertPdf.value !== pdfUrl) {
         CertPdf.value = pdfUrl
@@ -847,8 +888,8 @@ const CertRowClick2 = ({pdfFileUrl}) => {
 const CertLoading = ref(false)
 const CertClick = async () => {
     CertLoading.value = true
-    const {error, code} = await projectScanningApi.batchCertification({
-        ids: CertIds.value.split(',')
+    const { error, code } = await projectScanningApi.batchCertification({
+        ids: CertIds.value.split(','),
     }, false)
     //判断状态
     CertLoading.value = false
@@ -863,31 +904,30 @@ const CertClick = async () => {
 
 //批量删除
 const batchDel = () => {
-    const rows = tableCheckedKeys.value;
-    const result = rows.every(({status}) => {
+    const rows = tableCheckedKeys.value
+    const result = rows.every(({ status }) => {
         return status === 0
     })
     if (result) {
         const ids = arrToId(rows)
-        window?.$messageBox?.alert('请谨慎考虑是否要 批量删除文件?', '删除文件', {
-            type: 'error',
-            showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
-            callback: (action) => {
-                if (action === 'confirm') {
-                    removeArchiveFile(ids)
-                }
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                removeArchiveFile(ids)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        })
+    })
     } else {
         window.$message?.warning('已上报的文件需要先废除,才能执行删除')
     }
 }
 //确认批量删除
 const removeArchiveFile = async (ids) => {
-    const {error, code} = await projectScanningApi.removeArchiveFile({
-        ids: ids
+    const { error, code } = await projectScanningApi.removeArchiveFile({
+        ids: ids,
     }, false)
     //判断状态
     CertLoading.value = false
@@ -901,8 +941,8 @@ const removeArchiveFile = async (ids) => {
 
 //批量废除
 const batchAbolishClick = () => {
-    const rows = tableCheckedKeys.value;
-    const result = rows.every(({status}) => {
+    const rows = tableCheckedKeys.value
+    const result = rows.every(({ status }) => {
         return status > 0
     })
     if (result) {
@@ -916,7 +956,7 @@ const batchAbolishClick = () => {
                 if (action === 'confirm') {
                     batchAbolishSave(ids)
                 }
-            }
+            },
         })
     } else {
         window.$message?.warning('未上报的文件不能废除')
@@ -924,8 +964,8 @@ const batchAbolishClick = () => {
 }
 //确认批量废除
 const batchAbolishSave = async (ids) => {
-    const {error, code} = await projectScanningApi.batchAbolishSave({
-        ids: ids
+    const { error, code } = await projectScanningApi.batchAbolishSave({
+        ids: ids,
     }, false)
     //判断状态
     if (!error && code === 200) {
@@ -941,14 +981,14 @@ const leftWidth = ref(382)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        const diffVal = ve.clientX - leftNum;
+        const diffVal = ve.clientX - leftNum
         if (diffVal >= 310 && diffVal <= 900) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 207 - 180
src/views/other/first-item.vue

@@ -1,103 +1,121 @@
 <template>
     <div id="first-item-node-layout-target" class="hc-layout-box">
-        <div v-show="!isFirstReportDrawer" :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div v-show="!isFirstReportDrawer" :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                    <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
-                    <WbsTree :autoExpandKeys="TreeAutoExpandKeys" :contractId="contractId" :projectId="projectId"
-                             @nodeTap="nodeWbsElTreeClick"/>
+                    <WbsTree
+                        :auto-expand-keys="TreeAutoExpandKeys" :contract-id="contractId" :project-id="projectId"
+                        @nodeTap="nodeWbsElTreeClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div v-show="!isFirstReportDrawer" class="hc-layout-content-box first-item">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip v-if="tabTypeKey === 'mark'" keys="other-first-item-report">
-                        <el-button :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
-                                   @click="firstReportClick">
-                            <HcIcon name="send-plane-2"/>
+                        <el-button
+                            :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
+                            @click="firstReportClick"
+                        >
+                            <HcIcon name="send-plane-2" />
                             <span>上报首件</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip v-if="tabTypeKey === 'query'" keys="other-first-item-report-approval">
-                        <el-button :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
-                                   @click="reportModalClick(1)">
-                            <HcIcon name="send-plane-2"/>
+                        <el-button
+                            :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
+                            @click="reportModalClick(1)"
+                        >
+                            <HcIcon name="send-plane-2" />
                             <span>上报审批</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip v-if="tabTypeKey === 'query'" keys="other-first-item-repeal">
                         <el-button :disabled="tableSelectionKeys.length <= 0" hc-btn @click="batchAbolishClick">
-                            <HcIcon name="delete-bin-3"/>
+                            <HcIcon name="delete-bin-3" />
                             <span>批量废除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="other-first-item-down-print">
-                        <el-button :disabled="tableSelectionKeys.length <= 0" :loading="printLoading" hc-btn
-                                   @click="batchPrint">
-                            <HcIcon name="printer"/>
+                        <el-button
+                            :disabled="tableSelectionKeys.length <= 0" :loading="printLoading" hc-btn
+                            @click="batchPrint"
+                        >
+                            <HcIcon name="printer" />
                             <span>预览/打印</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #extra>
-                    <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
+                    <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" />
                 </template>
                 <template #search>
                     <div class="w-32">
                         <el-select v-model="searchForm.status" clearable placeholder="流程状态">
-                            <el-option v-for="item in processStatus" :label="item['dictValue']"
-                                       :value="item['dictKey']"/>
+                            <el-option
+                                v-for="item in processStatus" :label="item.dictValue"
+                                :value="item.dictKey"
+                            />
                         </el-select>
                     </div>
                     <div class="w-32 ml-3">
                         <el-select v-model="searchForm.reportNumber" clearable placeholder="上报批次">
-                            <el-option v-for="item in reportBatch" :label="item" :value="item"/>
+                            <el-option v-for="item in reportBatch" :label="item" :value="item" />
                         </el-select>
                     </div>
                     <div class="w-64 ml-3">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-64 ml-3">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入名称关键词检索"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入名称关键词检索"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
-                         isCheck @selection-change="tableSelectionChange">
-                    <template #name="{row}">
+                <HcTable
+                    ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
+                    is-check @selection-change="tableSelectionChange"
+                >
+                    <template #name="{ row }">
                         <span class="text-link" @click="tableRowName(row)">{{ row?.name }}</span>
                     </template>
-                    <template #waitingUserList="{row}">
-                        <template v-for="item in row['waitingUserList']">
+                    <template #waitingUserList="{ row }">
+                        <template v-for="item in row.waitingUserList">
                             <el-tag
-                                v-if="item['waitingUserName']"
+                                v-if="item.waitingUserName"
                                 :type="`${item.status === 2 ? 'success' : item.status === 3 ? 'warning' : item.status === 999 ? 'danger' : 'info'}`"
-                                class="mx-1" effect="dark">{{ item['waitingUserName'] }}
+                                class="mx-1" effect="dark"
+                            >
+                                {{ item.waitingUserName }}
                             </el-tag>
                         </template>
                     </template>
-                    <template #taskStatusStr="{row}">
+                    <template #taskStatusStr="{ row }">
                         <el-tag
-                            v-if="row['taskStatusStr']"
+                            v-if="row.taskStatusStr"
                             :type="`${row.status === 2 ? 'success' : row.status === 0 ? 'warning' : row.status === 1 ? 'danger' : 'info'}`"
-                            class="mx-1" effect="dark">{{ row['taskStatusStr'] }}
+                            class="mx-1" effect="dark"
+                        >
+                            {{ row.taskStatusStr }}
                         </el-tag>
                     </template>
                 </HcTable>
@@ -110,37 +128,40 @@
                             <el-tag class="mx-1" effect="dark" type="danger">签字异常</el-tag>
                         </div>
                         <div class="right">
-                            <HcPages :pages="searchForm" @change="pageChange"/>
+                            <HcPages :pages="searchForm" @change="pageChange" />
                         </div>
                     </div>
                 </template>
             </HcCard>
         </div>
 
-        <!--上报首件-->
-        <HcDrawer :isCard="false" :show="isFirstReportDrawer" to-id="first-item-node-layout-target"
-                  uis="hc-first-item-node-layout" @close="FirstReportDrawerClose">
+        <!-- 上报首件 -->
+        <HcDrawer
+            :is-card="false" :show="isFirstReportDrawer" to-id="first-item-node-layout-target"
+            uis="hc-first-item-node-layout" @close="FirstReportDrawerClose"
+        >
             <div class="node-content">
                 <div class="node-form">
                     <el-scrollbar v-if="contractId && isTableForm">
-                        <div :id="`table-form-${contractId}`" class="hc-excel-table-form-view"></div>
+                        <div :id="`table-form-${contractId}`" class="hc-excel-table-form-view" />
                     </el-scrollbar>
-                    <HcStatus v-else :desc="statusDesc"/>
+                    <HcStatus v-else :desc="statusDesc" />
                 </div>
                 <div class="node-file">
                     <div class="title">上传总结报告</div>
                     <div v-if="contractId && isTableForm" class="node-upload-box">
-                        <HcUpload :fileList="fileListData" :pkeyId="pkeyIds" @finish='uploadChange'/>
+                        <HcUpload :file-list="fileListData" :pkey-id="pkeyIds" @finish="uploadChange" />
                     </div>
                     <div v-else class="node-upload-box">
-                        <el-alert :closable="false" show-icon title="表单异常,暂时无法使用上传" type="warning"/>
+                        <el-alert :closable="false" show-icon title="表单异常,暂时无法使用上传" type="warning" />
                     </div>
-                    <el-divider border-style="dashed"/>
+                    <el-divider border-style="dashed" />
                     <div class="title">文件附件</div>
                     <div class="hc-table-node-file-box">
-                        <HcTable :column="tableFileColumn" :datas="tableFileData" :isIndex="false">
-                            <template #action="{row,index}">
-                                <el-button plain size="small" type="danger" @click="tableDelButton(index)">删除
+                        <HcTable :column="tableFileColumn" :datas="tableFileData" :is-index="false">
+                            <template #action="{ row, index }">
+                                <el-button plain size="small" type="danger" @click="tableDelButton(index)">
+                                    删除
                                 </el-button>
                             </template>
                         </HcTable>
@@ -148,47 +169,53 @@
                 </div>
             </div>
             <div class="node-action">
-                <el-button :disabled="!contractId || !isTableForm||NodeStatus === '3'" :loading="tableFormSaveLoading"
-                           hc-btn
-                           type="primary" @click="saveBussData">
-                    <HcIcon name="save"/>
+                <el-button
+                    :disabled="!contractId || !isTableForm || NodeStatus === '3'" :loading="tableFormSaveLoading"
+                    hc-btn
+                    type="primary" @click="saveBussData"
+                >
+                    <HcIcon name="save" />
                     <span>保存</span>
                 </el-button>
-                <el-button :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '1'" hc-btn
-                           @click="bussPdfInfo">
-                    <HcIcon name="eye"/>
+                <el-button
+                    :disabled="!contractId || !isTableForm || !tableFormId || NodeStatus === '1'" hc-btn
+                    @click="bussPdfInfo"
+                >
+                    <HcIcon name="eye" />
                     <span>预览</span>
                 </el-button>
-                <el-button v-if="NodeStatus !== '3'"
-                           :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '3' || NodeStatus === '1'"
-                           :loading="reportLoading"
-                           hc-btn @click="reportModalClick(2)">
-                    <HcIcon name="send-plane-2"/>
+                <el-button
+                    v-if="NodeStatus !== '3'"
+                    :disabled="!contractId || !isTableForm || !tableFormId || NodeStatus === '3' || NodeStatus === '1'"
+                    :loading="reportLoading"
+                    hc-btn @click="reportModalClick(2)"
+                >
+                    <HcIcon name="send-plane-2" />
                     <span>上报</span>
                 </el-button>
 
                 <el-button v-if="NodeStatus === '3'" hc-btn @click="abolishOneClick">
-                    <HcIcon name="arrow-go-back"/>
+                    <HcIcon name="arrow-go-back" />
                     <span>撤回上报流程</span>
                 </el-button>
 
                 <el-button hc-btn @click="FirstReportDrawerClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>返回</span>
                 </el-button>
             </div>
         </HcDrawer>
 
-        <!--上报审批-->
+        <!-- 上报审批 -->
         <HcReportModal
-            :contractId="contractId"
+            :contract-id="contractId"
             :datas="reportDatas"
             :ids="reportIds"
-            :isDatas="isReportModalDatas"
-            :projectId="projectId"
+            :is-datas="isReportModalDatas"
+            :project-id="projectId"
             :show="showReportModal"
-            :taskName="reportTaskName"
-            :typeData="reportTypeData"
+            :task-name="reportTaskName"
+            :type-data="reportTypeData"
             title="上报审批"
             type="first"
             url="informationWriteQuery/batchTask"
@@ -200,36 +227,37 @@
 </template>
 
 <script setup>
-import {useAppStore} from "~src/store";
-import {nextTick, onMounted, ref, watch} from 'vue'
-import {useRouter, useRoute} from 'vue-router'
-import WbsTree from "./components/WbsTree.vue"
-import HcUpload from "./components/HcUpload.vue"
-import HTableForm from "~src/plugins/HTableForm"
-import {getReportNumber, eVisaTaskCheckApi} from "~api/other";
-import firstApi from '~api/other/first-item';
-import tasksApi from '~api/tasks/data';
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
-import queryApi from "~api/data-fill/query";
-import wbsApi from "~api/data-fill/wbs";
-import {getArrValue, getObjValue, isString, deepClone, getObjVal, arrToId} from "js-fast-way"
+import { useAppStore } from '~src/store'
+import { nextTick, onMounted, ref, watch } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+import WbsTree from './components/WbsTree.vue'
+import HcUpload from './components/HcUpload.vue'
+import HTableForm from '~src/plugins/HTableForm'
+import { eVisaTaskCheckApi, getReportNumber } from '~api/other'
+import firstApi from '~api/other/first-item'
+import tasksApi from '~api/tasks/data'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import queryApi from '~api/data-fill/query'
+import wbsApi from '~api/data-fill/wbs'
+import { arrToId, deepClone, getArrValue, getObjVal, getObjValue, isString } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 //变量
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
-const contractInfo = ref(useAppState.getContractInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
+const contractInfo = ref(useAppState.getContractInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //路由参数
-const routerQuery = useRoutes?.query;
+const routerQuery = useRoutes?.query
 const typeName = routerQuery?.type || 'mark'
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -241,22 +269,22 @@ const TreeAutoExpandKeys = ref(getStoreValue('firstItemTreeKeys') || [])
 //类型tab数据和相关处理
 const tabTypeKey = ref(typeName)
 const tabTypeTab = ref([
-    {key: 'mark', name: '已标记为首件'},
-    {key: 'query', name: '首件查询'}
-]);
+    { key: 'mark', name: '已标记为首件' },
+    { key: 'query', name: '首件查询' },
+])
 
 const tabTypeChange = (item) => {
     tableFormId.value = ''
     tabTypeKey.value = item?.key
     if (searchForm.value.wbsId) {
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
 
     }
     //路由跳转
     router.push({
         path: useRoutes.path,
-        query: {type: item?.key}
+        query: { type: item?.key },
     })
 }
 
@@ -267,7 +295,7 @@ onMounted(() => {
 
 //项目树被点击
 const treeItem = ref({})
-const nodeWbsElTreeClick = ({data, keys}) => {
+const nodeWbsElTreeClick = ({ data, keys }) => {
     treeItem.value = data
     searchForm.value.contractIdRelation = data['contractIdRelation']
     searchForm.value.wbsId = data['primaryKeyId']
@@ -283,8 +311,8 @@ const nodeWbsElTreeClick = ({data, keys}) => {
 //获取流程状态
 const processStatus = ref([])
 const firstTaskStatus = async () => {
-    const {data} = await tasksApi.queryTaskTypeStatus({
-        typeOrStatus: 'first_task_status'
+    const { data } = await tasksApi.queryTaskTypeStatus({
+        typeOrStatus: 'first_task_status',
     })
     //处理数据
     processStatus.value = getArrValue(data)
@@ -292,18 +320,18 @@ const firstTaskStatus = async () => {
 //查询状态
 const NodeStatus = ref('1')
 const queryNodeStatusId = ref('')
-const {contractType} = contractInfo.value;
+const { contractType } = contractInfo.value
 const authBtnTabKey = ref(contractType === 2 ? '2' : '1')
 const queryNodeStatus = async () => {
-    const info = treeItem.value;
+    const info = treeItem.value
     console.log(info, 'info')
-    const {error, code, data} = await wbsApi.queryNodeStatusSj({
+    const { error, code, data } = await wbsApi.queryNodeStatusSj({
         // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
         // classify: 1
         //    primaryKeyId: authBtnTabKey.value==1 ? info['id'] : info['primaryKeyId'],
         primaryKeyId: info.primaryKeyId,
         classify: authBtnTabKey.value,
-        id: queryNodeStatusId.value
+        id: queryNodeStatusId.value,
 
     })
     //1 未填报,2待上报,3已上报
@@ -316,12 +344,12 @@ const queryNodeStatus = async () => {
 //获取上报批次
 const reportBatch = ref([])
 const getReportNumberByContractId = async (cid, type) => {
-    const {data} = await getReportNumber({
+    const { data } = await getReportNumber({
         projectId: projectId.value,
         contractId: contractId.value,
         contractIdRelation: cid ?? '',
         firstTitle: tabTypeKey.value === 'query' ? 1 : null,
-        type: type
+        type: type,
     })
     //处理数据
     reportBatch.value = getArrValue(data)
@@ -330,19 +358,19 @@ const getReportNumberByContractId = async (cid, type) => {
 //搜索表单
 const searchForm = ref({
     wbsId: '', status: null, reportNumber: null, queryValue: '', betweenTime: '',
-    contractIdRelation: '', current: 1, size: 20, total: 0
+    contractIdRelation: '', current: 1, size: 20, total: 0,
 })
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({query, arr}) => {
+const betweenTimeUpdate = ({ query, arr }) => {
     betweenTime.value = arr
     searchForm.value.betweenTime = query
 }
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
+    if (e.key === 'Enter') {
         searchClick()
     }
 }
@@ -350,7 +378,7 @@ const keyUpEvent = (e) => {
 //搜索
 const searchClick = () => {
     if (searchForm.value.wbsId) {
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
     } else {
         window?.$message?.warning('请先在左边选择一个树节点')
@@ -358,7 +386,7 @@ const searchClick = () => {
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -366,11 +394,11 @@ const pageChange = ({current, size}) => {
 
 //表格表头
 const tableListColumn = ref([
-    {key: 'name', name: '文件名称'},
-    {key: 'waitingUserList', name: '任务人'},
-    {key: 'startTime', name: '开始时间', width: 180},
-    {key: 'taskStatusStr', name: '流程状态', width: 140},
-    {key: 'reportNumber', name: '上报批次', width: 120},
+    { key: 'name', name: '文件名称' },
+    { key: 'waitingUserList', name: '任务人' },
+    { key: 'startTime', name: '开始时间', width: 180 },
+    { key: 'taskStatusStr', name: '流程状态', width: 140 },
+    { key: 'reportNumber', name: '上报批次', width: 120 },
 ])
 
 //获取表格数据
@@ -379,7 +407,7 @@ const tableListData = ref([])
 const getTableData = async () => {
     const searchInfo = searchForm.value
     const tabKey = tabTypeKey.value
-    if (!!searchInfo.wbsId) {
+    if (searchInfo.wbsId) {
         //初始处理
         tableLoading.value = true
         tableListRef.value?.clearSelection()
@@ -402,7 +430,7 @@ const getTableData = async () => {
         }
         addFormData['wbsId'] = treeInfo['contractIdRelation'] ? treeInfo['id'] : treeInfo['primaryKeyId']
         //处理数据
-        const {error, code, data} = await firstApi.getQueryPageData({
+        const { error, code, data } = await firstApi.getQueryPageData({
             ...addFormData,
             ...searchInfo,
         })
@@ -421,10 +449,10 @@ const getTableData = async () => {
 
 //多选
 const tableListRef = ref(null)
-const tableSelectionKeys = ref([]);
+const tableSelectionKeys = ref([])
 const tableSelectionChange = (rows) => {
     tableSelectionKeys.value = rows.filter((item) => {
-        return (item ?? '') !== '';
+        return (item ?? '') !== ''
     })
 }
 
@@ -447,10 +475,10 @@ const tableRowName = (row) => {
 const isFirstReportDrawer = ref(false)
 const isCanreport = ref(false)
 const firstReportClick = () => {
-    pdfId.value=''
+    pdfId.value = ''
     const rows = deepClone(tableSelectionKeys.value)
     //判断是否满足条件
-    const result = rows.every(({status}) => {
+    const result = rows.every(({ status }) => {
         return status === 2
         // return status === 0 || status === 3
     })
@@ -480,21 +508,21 @@ const abolishOneClick = () => {
             if (action === 'confirm') {
                 abolishOneSave()
             }
-        }
+        },
     })
 }
 
 //撤回请求
 const abolishOneSave = async () => {
-    const info = treeItem.value;
-    const {error, code} = await wbsApi.abolishOneSJ({
+    const info = treeItem.value
+    const { error, code } = await wbsApi.abolishOneSJ({
         primaryKeyId: info?.primaryKeyId || '',
-        id: queryNodeStatusId.value
+        id: queryNodeStatusId.value,
     })
     if (!error && code === 200) {
         window.$message?.success('撤回成功')
         getTableDataAll()
-        window?.location?.reload()  //刷新页面
+        window?.location?.reload() //刷新页面
     }
 }
 
@@ -507,9 +535,9 @@ const statusDesc = ref('')
 const isTableForm = ref(false)
 const pkeyIds = ref('')
 const getFirstExcelHtml = async () => {
-    const cid = contractId.value;
-    const {error, code, data} = await firstApi.getFirstExcelHtml({
-        contractId: contractId.value || ''
+    const cid = contractId.value
+    const { error, code, data } = await firstApi.getFirstExcelHtml({
+        contractId: contractId.value || '',
     }, false)
     //处理数据
     const temp = isString(data?.data) ? data?.data || '' : ''
@@ -539,7 +567,7 @@ const setHTableForm = (resData, cid) => {
             tableFormApp.value = HTableForm.createForm({
                 template: resData,
                 tableForm: tableFormData.value,
-                appId: `#table-form-${cid}`
+                appId: `#table-form-${cid}`,
             })
         })
     } else {
@@ -553,9 +581,9 @@ const setHTableForm = (resData, cid) => {
 const tableFormData = ref({})
 const getFirstBussDataInfo = async (pkeyId) => {
     if (pkeyId) {
-        const {data} = await firstApi.getFirstBussDataInfo({
+        const { data } = await firstApi.getFirstBussDataInfo({
             contractId: contractId.value || '',
-            firstId: pkeyId + ''
+            firstId: pkeyId + '',
         }, false)
         const info = getObjValue(data)
         if (getObjVal(info)) {
@@ -570,45 +598,44 @@ const getFirstBussDataInfo = async (pkeyId) => {
 }
 
 //上传变量
-const fileListData = ref([]);
+const fileListData = ref([])
 const finishFile = ref({
-    sourceUrl: '', pdfUrl: '', firstFileName: ''
+    sourceUrl: '', pdfUrl: '', firstFileName: '',
 })
 //上传文件
-const uploadChange = async ({type, res}) => {
+const uploadChange = async ({ type, res }) => {
     if (type === 'success') {
-        const {code, data, msg} = res
+        const { code, data, msg } = res
         if (code === 200) {
             finishFile.value = {
                 sourceUrl: data?.sourceUrl,
                 pdfUrl: data?.pdfUrl,
                 firstFileName: data?.fileName,
             }
-            window.$message?.success(msg);
+            window.$message?.success(msg)
         } else {
-            window.$message?.error(msg || '上传失败');
+            window.$message?.error(msg || '上传失败')
         }
     }
 }
 
 //文件附件列表
 const tableFileColumn = ref([
-    {key: 'name', name: '文件名称'},
-    {key: 'action', name: '操作', width: 80, align: 'center'}
-]);
-const tableFileData = ref([]);
+    { key: 'name', name: '文件名称' },
+    { key: 'action', name: '操作', width: 80, align: 'center' },
+])
+const tableFileData = ref([])
 const tableDelButton = (index) => {
     const arr = tableFileData.value
     if (arr.length > 1) {
-        window?.$messageBox?.alert('确定删除该文件吗?', '删除提醒', {
-            type: 'warning',
-            showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
-            callback: (action) => {
-                if (action === 'confirm') {
-                    tableFileData.value.splice(index, 1)
-                }
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                tableFileData.value.splice(index, 1)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
         })
     } else {
@@ -619,8 +646,8 @@ const tableDelButton = (index) => {
 //填报数据保存
 const pdfId = ref('')
 const saveBussData = async () => {
-    console.log('保存');
-    const {id} = treeItem.value
+    console.log('保存')
+    const { id } = treeItem.value
     const res = await saveExcelBussData(id + '')
     //刷新页面
     //  window?.location?.reload()  //刷新页面
@@ -639,10 +666,10 @@ const tableFormSaveLoading = ref(false)
 const tableFormId = ref('')
 const saveExcelBussData = async (pkeyId) => {
     tableFormId.value = ''
-    const {primaryKeyId} = treeItem.value
+    const { primaryKeyId } = treeItem.value
     tableFormSaveLoading.value = true
-    const linkIds = rowsToArr(tableFileData.value);
-    const {error, code, data} = await firstApi.saveBussData({
+    const linkIds = rowsToArr(tableFileData.value)
+    const { error, code, data } = await firstApi.saveBussData({
         ...tableFormData.value,
         projectId: projectId.value,
         contractId: contractId.value,
@@ -652,7 +679,7 @@ const saveExcelBussData = async (pkeyId) => {
         isFirst: 1,
         linkProcessList: linkIds,
         ...finishFile.value,
-        firstId:pdfId.value
+        firstId:pdfId.value,
     }, false)
     //判断状态
     tableFormSaveLoading.value = false
@@ -669,7 +696,7 @@ const saveExcelBussData = async (pkeyId) => {
 
 //pdf预览
 const bussPdfInfo = () => {
-    const {id} = treeItem.value
+    const { id } = treeItem.value
     // getBussPdfInfo(id + '')
     getBussPdfInfo(pdfId.value)
 
@@ -677,8 +704,8 @@ const bussPdfInfo = () => {
 
 //预览PDF请求
 const getBussPdfInfo = async (pkeyId) => {
-    const {error, code, data} = await firstApi.getFirstBussPdfInfo({
-        firstId: pkeyId
+    const { error, code, data } = await firstApi.getFirstBussPdfInfo({
+        firstId: pkeyId,
     })
     //判断状态
     const res = isString(data) ? data ?? '' : ''
@@ -700,8 +727,8 @@ const iscanReport = ref(false)
 //上报方法封装
 const toreportModalClick = async (type) => {
     if (type) {
-        const {primaryKeyId, contractIdRelation} = treeItem.value
-        let rows = [];
+        const { primaryKeyId, contractIdRelation } = treeItem.value
+        let rows = []
         //处理获取流程的条件
         if (tabTypeKey.value === 'mark') {
             reportTypeData.value = tableFormId.value
@@ -715,15 +742,15 @@ const toreportModalClick = async (type) => {
             reportLoading.value = true
             const taskCheck = await eVisaTaskCheckApi({
                 projectId: projectId.value,
-                contractId: contractId.value
+                contractId: contractId.value,
             })
             if (taskCheck) {
                 if (tabTypeKey.value === 'mark') {
                     reportIds.value = tableFormId.value
-                    const {data} = await firstApi.queryFirstDocumentTitle({
+                    const { data } = await firstApi.queryFirstDocumentTitle({
                         projectId: projectId.value,
                         contractId: contractId.value,
-                        queryId: tableFormId.value
+                        queryId: tableFormId.value,
                     })
                     reportTaskName.value = isString(data) ? data ?? '' : ''
                 } else {
@@ -733,7 +760,7 @@ const toreportModalClick = async (type) => {
                     rows.forEach(item => {
                         reportDataArr.push({
                             id: item?.id,
-                            name: item?.name
+                            name: item?.name,
                         })
                     })
                     reportDatas.value = reportDataArr
@@ -764,7 +791,7 @@ const toreportModalClick = async (type) => {
 const reportModalClick = async (type) => {
     if (type === 2) {
         console.log('上报')
-        iscanReport.value = isCanreport.value;
+        iscanReport.value = isCanreport.value
         toreportModalClick(iscanReport.value)
 
     } else {
@@ -772,12 +799,12 @@ const reportModalClick = async (type) => {
         let result = false
         console.log('上报审批', rows)
         //判断自身是否满足条件
-        const result1 = rows.every(({taskStatusStr}) => {
+        const result1 = rows.every(({ taskStatusStr }) => {
             return taskStatusStr === '未上报' || taskStatusStr === '已废除'
         })
         if (result1) {
             //判断工序节点是否满足条件
-            result = rows.every(({isApprove}) => {
+            result = rows.every(({ isApprove }) => {
                 return isApprove === true
             })
             iscanReport.value = result
@@ -794,7 +821,7 @@ const reportModalClick = async (type) => {
 
 //上报的审批内容移除
 const reportTaskTagClose = (index) => {
-    const row = tableSelectionKeys.value[index];
+    const row = tableSelectionKeys.value[index]
     tableListRef.value?.toggleRowSelection(row, false)
 }
 const getTableDataAll = () => {
@@ -811,12 +838,12 @@ const showReportFinish = () => {
 //打印
 const printLoading = ref(false)
 const batchPrint = async () => {
-    const rows = tableSelectionKeys.value;
+    const rows = tableSelectionKeys.value
     const ids = arrToId(rows)
     //批量下载
     printLoading.value = true
-    const {error, code, data} = await firstApi.batchPrint({
-        ids: ids
+    const { error, code, data } = await firstApi.batchPrint({
+        ids: ids,
     })
     //处理数据
     printLoading.value = false
@@ -829,9 +856,9 @@ const batchPrint = async () => {
 
 //废除
 const batchAbolishClick = () => {
-    const rows = tableSelectionKeys.value;
+    const rows = tableSelectionKeys.value
     //判断是否满足条件
-    const result = rows.every(({status}) => {
+    const result = rows.every(({ status }) => {
         return status !== 0 && status !== 3
     })
     //判断状态
@@ -846,7 +873,7 @@ const batchAbolishClick = () => {
                 if (action === 'confirm') {
                     batchAbolishSave(ids)
                 }
-            }
+            },
         })
     } else {
         window.$message?.warning('未上报的文件不能废除')
@@ -854,7 +881,7 @@ const batchAbolishClick = () => {
 }
 //废除勾选的已上报文件
 const batchAbolishSave = async (ids) => {
-    const {error, code} = await queryApi.batchAbolish({ids: ids})
+    const { error, code } = await queryApi.batchAbolish({ ids: ids })
     //处理数据
     if (!error && code === 200) {
         window.$message?.success('批量废除成功')
@@ -865,11 +892,11 @@ const batchAbolishSave = async (ids) => {
 
 //处理数据
 const rowsToArr = (rows) => {
-    let newArr = [];
+    let newArr = []
     for (let i = 0; i < rows.length; i++) {
         newArr.push({
             id: rows[i]?.id,
-            name: rows[i]?.name
+            name: rows[i]?.name,
         })
     }
     return newArr
@@ -880,14 +907,14 @@ const leftWidth = ref(382)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        const diffVal = ve.clientX - leftNum;
+        const diffVal = ve.clientX - leftNum
         if (diffVal >= 310 && diffVal <= 900) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 211 - 184
src/views/other/first-itemcopy.vue

@@ -1,103 +1,121 @@
 <template>
     <div id="first-item-node-layout-target" class="hc-layout-box">
-        <div v-show="!isFirstReportDrawer" :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div v-show="!isFirstReportDrawer" :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                    <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
-                    <WbsTree :autoExpandKeys="TreeAutoExpandKeys" :contractId="contractId" :projectId="projectId"
-                             @nodeTap="nodeWbsElTreeClick"/>
+                    <WbsTree
+                        :auto-expand-keys="TreeAutoExpandKeys" :contract-id="contractId" :project-id="projectId"
+                        @nodeTap="nodeWbsElTreeClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div v-show="!isFirstReportDrawer" class="hc-layout-content-box first-item">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip v-if="tabTypeKey === 'mark'" keys="other-first-item-report">
-                        <el-button :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
-                                   @click="firstReportClick">
-                            <HcIcon name="send-plane-2"/>
+                        <el-button
+                            :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
+                            @click="firstReportClick"
+                        >
+                            <HcIcon name="send-plane-2" />
                             <span>上报首件</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip v-if="tabTypeKey === 'query'" keys="other-first-item-report-approval">
-                        <el-button :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
-                                   @click="reportModalClick(1)">
-                            <HcIcon name="send-plane-2"/>
+                        <el-button
+                            :disabled="tableSelectionKeys.length <= 0" hc-btn type="primary"
+                            @click="reportModalClick(1)"
+                        >
+                            <HcIcon name="send-plane-2" />
                             <span>上报审批</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip v-if="tabTypeKey === 'query'" keys="other-first-item-repeal">
                         <el-button :disabled="tableSelectionKeys.length <= 0" hc-btn @click="batchAbolishClick">
-                            <HcIcon name="delete-bin-3"/>
+                            <HcIcon name="delete-bin-3" />
                             <span>批量废除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="other-first-item-down-print">
-                        <el-button :disabled="tableSelectionKeys.length <= 0" :loading="printLoading" hc-btn
-                                   @click="batchPrint">
-                            <HcIcon name="printer"/>
+                        <el-button
+                            :disabled="tableSelectionKeys.length <= 0" :loading="printLoading" hc-btn
+                            @click="batchPrint"
+                        >
+                            <HcIcon name="printer" />
                             <span>预览/打印</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #extra>
-                    <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
+                    <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" />
                 </template>
                 <template #search>
                     <div class="w-32">
                         <el-select v-model="searchForm.status" clearable placeholder="流程状态">
-                            <el-option v-for="item in processStatus" :label="item['dictValue']"
-                                       :value="item['dictKey']"/>
+                            <el-option
+                                v-for="item in processStatus" :label="item.dictValue"
+                                :value="item.dictKey"
+                            />
                         </el-select>
                     </div>
                     <div class="w-32 ml-3">
                         <el-select v-model="searchForm.reportNumber" clearable placeholder="上报批次">
-                            <el-option v-for="item in reportBatch" :label="item" :value="item"/>
+                            <el-option v-for="item in reportBatch" :label="item" :value="item" />
                         </el-select>
                     </div>
                     <div class="w-64 ml-3">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-64 ml-3">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入名称关键词检索"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入名称关键词检索"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
-                         isCheck @selection-change="tableSelectionChange">
-                    <template #name="{row}">
+                <HcTable
+                    ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
+                    is-check @selection-change="tableSelectionChange"
+                >
+                    <template #name="{ row }">
                         <span class="text-link" @click="tableRowName(row)">{{ row?.name }}</span>
                     </template>
-                    <template #waitingUserList="{row}">
-                        <template v-for="item in row['waitingUserList']">
+                    <template #waitingUserList="{ row }">
+                        <template v-for="item in row.waitingUserList">
                             <el-tag
-                                v-if="item['waitingUserName']"
+                                v-if="item.waitingUserName"
                                 :type="`${item.status === 2 ? 'success' : item.status === 3 ? 'warning' : item.status === 999 ? 'danger' : 'info'}`"
-                                class="mx-1" effect="dark">{{ item['waitingUserName'] }}
+                                class="mx-1" effect="dark"
+                            >
+                                {{ item.waitingUserName }}
                             </el-tag>
                         </template>
                     </template>
-                    <template #taskStatusStr="{row}">
+                    <template #taskStatusStr="{ row }">
                         <el-tag
-                            v-if="row['taskStatusStr']"
+                            v-if="row.taskStatusStr"
                             :type="`${row.status === 2 ? 'success' : row.status === 0 ? 'warning' : row.status === 1 ? 'danger' : 'info'}`"
-                            class="mx-1" effect="dark">{{ row['taskStatusStr'] }}
+                            class="mx-1" effect="dark"
+                        >
+                            {{ row.taskStatusStr }}
                         </el-tag>
                     </template>
                 </HcTable>
@@ -110,50 +128,54 @@
                             <el-tag class="mx-1" effect="dark" type="danger">签字异常</el-tag>
                         </div>
                         <div class="right">
-                            <HcPages :pages="searchForm" @change="pageChange"/>
+                            <HcPages :pages="searchForm" @change="pageChange" />
                         </div>
                     </div>
                 </template>
             </HcCard>
         </div>
 
-        <!--上报首件-->
-        <HcDrawer :isCard="false" :show="isFirstReportDrawer" to-id="first-item-node-layout-target"
-                  uis="hc-first-item-node-layout" @close="FirstReportDrawerClose">
+        <!-- 上报首件 -->
+        <HcDrawer
+            :is-card="false" :show="isFirstReportDrawer" to-id="first-item-node-layout-target"
+            uis="hc-first-item-node-layout" @close="FirstReportDrawerClose"
+        >
             <div class="node-content">
                 <div class="node-form">
                     <el-scrollbar v-if="contractId && isTableForm" ref="ListItemScrollRef">
                         <!-- <div class="hc-excel-table-form-view" :id="`table-form-${contractId}`"></div> -->
-                        <ListItem ref="ListItemsRef"
-                                  :classify="authBtnTabKey"
-                                  :contractId="contractId"
-                                  :datas="ListItemDatas"
-                                  :drawType="isDrawType"
-                                  :finishFile="finishFile"
-                                  :projectInfo="projectInfo"
-                                  :status="NodeStatus"
-                                  :tableFileData="tableFileData"
-                                  :treeItem="treeItem"
-                                  @offsetTop="ListItemOffsetTop"
-                                  @renew="renewtable"
+                        <ListItem
+                            ref="ListItemsRef"
+                            :classify="authBtnTabKey"
+                            :contract-id="contractId"
+                            :datas="ListItemDatas"
+                            :draw-type="isDrawType"
+                            :finish-file="finishFile"
+                            :project-info="projectInfo"
+                            :status="NodeStatus"
+                            :table-file-data="tableFileData"
+                            :tree-item="treeItem"
+                            @offsetTop="ListItemOffsetTop"
+                            @renew="renewtable"
                         />
                     </el-scrollbar>
-                    <HcStatus v-else :desc="statusDesc"/>
+                    <HcStatus v-else :desc="statusDesc" />
                 </div>
                 <div class="node-file">
                     <div class="title">上传总结报告1111</div>
                     <div v-if="contractId && isTableForm" class="node-upload-box">
-                        <HcUpload :fileList="fileListData" :pkeyId="pkeyIds" @finish='uploadChange'/>
+                        <HcUpload :file-list="fileListData" :pkey-id="pkeyIds" @finish="uploadChange" />
                     </div>
                     <div v-else class="node-upload-box">
-                        <el-alert :closable="false" show-icon title="表单异常,暂时无法使用上传" type="warning"/>
+                        <el-alert :closable="false" show-icon title="表单异常,暂时无法使用上传" type="warning" />
                     </div>
-                    <el-divider border-style="dashed"/>
+                    <el-divider border-style="dashed" />
                     <div class="title">文件附件</div>
                     <div class="hc-table-node-file-box">
-                        <HcTable :column="tableFileColumn" :datas="tableFileData" :isIndex="false">
-                            <template #action="{row,index}">
-                                <el-button plain size="small" type="danger" @click="tableDelButton(index)">删除
+                        <HcTable :column="tableFileColumn" :datas="tableFileData" :is-index="false">
+                            <template #action="{ row, index }">
+                                <el-button plain size="small" type="danger" @click="tableDelButton(index)">
+                                    删除
                                 </el-button>
                             </template>
                         </HcTable>
@@ -161,41 +183,46 @@
                 </div>
             </div>
             <div class="node-action">
-                <el-button :disabled="!contractId || !isTableForm||NodeStatus === '3'" :loading="tableFormSaveLoading"
-                           hc-btn
-                           type="primary" @click="saveBussData">
-                    <HcIcon name="save"/>
+                <el-button
+                    :disabled="!contractId || !isTableForm || NodeStatus === '3'" :loading="tableFormSaveLoading"
+                    hc-btn
+                    type="primary" @click="saveBussData"
+                >
+                    <HcIcon name="save" />
                     <span>保存</span>
                 </el-button>
-                <el-button :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '1'" hc-btn
-                           @click="bussPdfInfo">
-                    <HcIcon name="eye"/>
+                <el-button
+                    :disabled="!contractId || !isTableForm || !tableFormId || NodeStatus === '1'" hc-btn
+                    @click="bussPdfInfo"
+                >
+                    <HcIcon name="eye" />
                     <span>预览</span>
                 </el-button>
                 <el-button
-                    :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '3' || NodeStatus === '1'"
+                    :disabled="!contractId || !isTableForm || !tableFormId || NodeStatus === '3' || NodeStatus === '1'"
                     :loading="reportLoading"
-                    hc-btn @click="reportModalClick(2)">
-                    <HcIcon name="send-plane-2"/>
+                    hc-btn @click="reportModalClick(2)"
+                >
+                    <HcIcon name="send-plane-2" />
                     <span>上报</span>
                 </el-button>
                 <el-button hc-btn @click="FirstReportDrawerClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>返回</span>
                 </el-button>
             </div>
         </HcDrawer>
 
-        <!--上报审批-->
+        <!-- 上报审批 -->
         <HcReportModal
-            :contractId="contractId"
+            :contract-id="contractId"
             :datas="reportDatas"
             :ids="reportIds"
-            :isDatas="isReportModalDatas"
-            :projectId="projectId"
+            :is-datas="isReportModalDatas"
+            :project-id="projectId"
             :show="showReportModal"
-            :taskName="reportTaskName"
-            :typeData="reportTypeData"
+            :task-name="reportTaskName"
+            :type-data="reportTypeData"
             title="上报审批"
             type="first"
             url="informationWriteQuery/batchTask"
@@ -207,37 +234,38 @@
 </template>
 
 <script setup>
-import {useAppStore} from "~src/store";
-import {nextTick, onMounted, ref, watch} from 'vue'
-import {useRouter, useRoute} from 'vue-router'
-import WbsTree from "./components/WbsTree.vue"
-import HcUpload from "./components/HcUpload.vue"
-import HTableForm from "~src/plugins/HTableForm"
-import {getReportNumber, eVisaTaskCheckApi} from "~api/other";
-import firstApi from '~api/other/first-item';
-import tasksApi from '~api/tasks/data';
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
-import {getArrValue, getObjValue, isString, deepClone, getObjVal, arrToId} from "js-fast-way"
-import queryApi from "~api/data-fill/query";
-import wbsApi from "~api/data-fill/wbs";
-import ListItem from "./components/ListItem.vue"
+import { useAppStore } from '~src/store'
+import { nextTick, onMounted, ref, watch } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+import WbsTree from './components/WbsTree.vue'
+import HcUpload from './components/HcUpload.vue'
+import HTableForm from '~src/plugins/HTableForm'
+import { eVisaTaskCheckApi, getReportNumber } from '~api/other'
+import firstApi from '~api/other/first-item'
+import tasksApi from '~api/tasks/data'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import { arrToId, deepClone, getArrValue, getObjVal, getObjValue, isString } from 'js-fast-way'
+import queryApi from '~api/data-fill/query'
+import wbsApi from '~api/data-fill/wbs'
+import ListItem from './components/ListItem.vue'
+import { delMessageV2 } from '~com/message/index.js'
 //变量
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
-const contractInfo = ref(useAppState.getContractInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
+const contractInfo = ref(useAppState.getContractInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //路由参数
-const routerQuery = useRoutes?.query;
+const routerQuery = useRoutes?.query
 const typeName = routerQuery?.type || 'mark'
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -249,21 +277,21 @@ const TreeAutoExpandKeys = ref(getStoreValue('firstItemTreeKeys') || [])
 //类型tab数据和相关处理
 const tabTypeKey = ref(typeName)
 const tabTypeTab = ref([
-    {key: 'mark', name: '已标记为首件'},
-    {key: 'query', name: '首件查询'}
-]);
+    { key: 'mark', name: '已标记为首件' },
+    { key: 'query', name: '首件查询' },
+])
 
 const tabTypeChange = (item) => {
     tableFormId.value = ''
     tabTypeKey.value = item?.key
     if (searchForm.value.wbsId) {
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
     }
     //路由跳转
     router.push({
         path: useRoutes.path,
-        query: {type: item?.key}
+        query: { type: item?.key },
     })
 }
 
@@ -277,7 +305,7 @@ const renewtable = () => {
 }
 //项目树被点击
 const treeItem = ref({})
-const nodeWbsElTreeClick = ({data, keys}) => {
+const nodeWbsElTreeClick = ({ data, keys }) => {
     treeItem.value = data
     searchForm.value.contractIdRelation = data['contractIdRelation']
     searchForm.value.wbsId = data['primaryKeyId']
@@ -292,24 +320,24 @@ const nodeWbsElTreeClick = ({data, keys}) => {
 //获取流程状态
 const processStatus = ref([])
 const firstTaskStatus = async () => {
-    const {data} = await tasksApi.queryTaskTypeStatus({
-        typeOrStatus: 'first_task_status'
+    const { data } = await tasksApi.queryTaskTypeStatus({
+        typeOrStatus: 'first_task_status',
     })
     //处理数据
     processStatus.value = getArrValue(data)
 }
 //查询状态
 const NodeStatus = ref('1')
-const {contractType} = contractInfo.value;
+const { contractType } = contractInfo.value
 const authBtnTabKey = ref(contractType === 2 ? '2' : '1')
 const queryNodeStatus = async () => {
-    const info = treeItem.value;
+    const info = treeItem.value
     console.log(info, 'info')
-    const {error, code, data} = await wbsApi.queryNodeStatus({
+    const { error, code, data } = await wbsApi.queryNodeStatus({
         // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
         // classify: 1
         primaryKeyId: authBtnTabKey.value == 1 ? info['id'] : info['primaryKeyId'],
-        classify: authBtnTabKey.value
+        classify: authBtnTabKey.value,
 
     })
     //1 未填报,2待上报,3已上报
@@ -322,11 +350,11 @@ const queryNodeStatus = async () => {
 //获取上报批次
 const reportBatch = ref([])
 const getReportNumberByContractId = async (cid) => {
-    const {data} = await getReportNumber({
+    const { data } = await getReportNumber({
         contractId: contractId.value,
         projectId: projectId.value,
         contractIdRelation: cid ?? '',
-        firstTitle: tabTypeKey.value === 'query' ? 1 : null
+        firstTitle: tabTypeKey.value === 'query' ? 1 : null,
     })
     //处理数据
     reportBatch.value = getArrValue(data)
@@ -335,19 +363,19 @@ const getReportNumberByContractId = async (cid) => {
 //搜索表单
 const searchForm = ref({
     wbsId: '', status: null, reportNumber: null, queryValue: '', betweenTime: '',
-    contractIdRelation: '', current: 1, size: 20, total: 0
+    contractIdRelation: '', current: 1, size: 20, total: 0,
 })
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({query, arr}) => {
+const betweenTimeUpdate = ({ query, arr }) => {
     betweenTime.value = arr
     searchForm.value.betweenTime = query
 }
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
+    if (e.key === 'Enter') {
         searchClick()
     }
 }
@@ -355,7 +383,7 @@ const keyUpEvent = (e) => {
 //搜索
 const searchClick = () => {
     if (searchForm.value.wbsId) {
-        searchForm.value.current = 1;
+        searchForm.value.current = 1
         getTableData()
     } else {
         window?.$message?.warning('请先在左边选择一个树节点')
@@ -363,7 +391,7 @@ const searchClick = () => {
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -371,11 +399,11 @@ const pageChange = ({current, size}) => {
 
 //表格表头
 const tableListColumn = ref([
-    {key: 'name', name: '文件名称'},
-    {key: 'waitingUserList', name: '任务人'},
-    {key: 'startTime', name: '开始时间', width: 180},
-    {key: 'taskStatusStr', name: '流程状态', width: 140},
-    {key: 'reportNumber', name: '上报批次', width: 120},
+    { key: 'name', name: '文件名称' },
+    { key: 'waitingUserList', name: '任务人' },
+    { key: 'startTime', name: '开始时间', width: 180 },
+    { key: 'taskStatusStr', name: '流程状态', width: 140 },
+    { key: 'reportNumber', name: '上报批次', width: 120 },
 ])
 
 //获取表格数据
@@ -400,7 +428,7 @@ const ListItemOffsetTop = (offsetTop) => {
 const getTableData = async () => {
     const searchInfo = searchForm.value
     const tabKey = tabTypeKey.value
-    if (!!searchInfo.wbsId) {
+    if (searchInfo.wbsId) {
         //初始处理
         tableLoading.value = true
         tableListRef.value?.clearSelection()
@@ -423,7 +451,7 @@ const getTableData = async () => {
         }
         addFormData['wbsId'] = treeInfo['contractIdRelation'] ? treeInfo['id'] : treeInfo['primaryKeyId']
         //处理数据
-        const {error, code, data} = await firstApi.getQueryPageData({
+        const { error, code, data } = await firstApi.getQueryPageData({
             ...addFormData,
             ...searchInfo,
         })
@@ -443,10 +471,10 @@ const getTableData = async () => {
 
 //多选
 const tableListRef = ref(null)
-const tableSelectionKeys = ref([]);
+const tableSelectionKeys = ref([])
 const tableSelectionChange = (rows) => {
     tableSelectionKeys.value = rows.filter((item) => {
-        return (item ?? '') !== '';
+        return (item ?? '') !== ''
     })
 }
 
@@ -464,7 +492,7 @@ const tableRowName = (row) => {
         window.$message?.warning('文件不存在')
     }
 }
-const ListItemDatas = ref([]);
+const ListItemDatas = ref([])
 //上报首件
 const isFirstReportDrawer = ref(false)
 const isCanreport = ref(false)
@@ -477,7 +505,7 @@ const firstReportClick = () => {
     })
     console.log(ListItemDatas.value, ' ListItemDatas.value')
     //判断是否满足条件
-    const result = rows.every(({status}) => {
+    const result = rows.every(({ status }) => {
         return status === 2
         // return status === 0 || status === 3
     })
@@ -507,9 +535,9 @@ const statusDesc = ref('')
 const isTableForm = ref(false)
 const pkeyIds = ref('')
 const getFirstExcelHtml = async () => {
-    const cid = contractId.value;
-    const {error, code, data} = await firstApi.getFirstExcelHtml({
-        contractId: contractId.value || ''
+    const cid = contractId.value
+    const { error, code, data } = await firstApi.getFirstExcelHtml({
+        contractId: contractId.value || '',
     }, false)
     //处理数据
     const temp = isString(data?.data) ? data?.data || '' : ''
@@ -538,7 +566,7 @@ const setHTableForm = (resData, cid) => {
             tableFormApp.value = HTableForm.createForm({
                 template: resData,
                 tableForm: tableFormData.value,
-                appId: `#table-form-${cid}`
+                appId: `#table-form-${cid}`,
             })
         })
     } else {
@@ -552,9 +580,9 @@ const setHTableForm = (resData, cid) => {
 const tableFormData = ref({})
 const getFirstBussDataInfo = async (pkeyId) => {
     if (pkeyId) {
-        const {data} = await firstApi.getFirstBussDataInfo({
+        const { data } = await firstApi.getFirstBussDataInfo({
             contractId: contractId.value || '',
-            firstId: pkeyId + ''
+            firstId: pkeyId + '',
         }, false)
         const info = getObjValue(data)
         if (getObjVal(info)) {
@@ -569,45 +597,44 @@ const getFirstBussDataInfo = async (pkeyId) => {
 }
 
 //上传变量
-const fileListData = ref([]);
+const fileListData = ref([])
 const finishFile = ref({
-    sourceUrl: '', pdfUrl: '', firstFileName: ''
+    sourceUrl: '', pdfUrl: '', firstFileName: '',
 })
 //上传文件
-const uploadChange = async ({type, res}) => {
+const uploadChange = async ({ type, res }) => {
     if (type === 'success') {
-        const {code, data, msg} = res
+        const { code, data, msg } = res
         if (code === 200) {
             finishFile.value = {
                 sourceUrl: data?.sourceUrl,
                 pdfUrl: data?.pdfUrl,
                 firstFileName: data?.fileName,
             }
-            window.$message?.success(msg);
+            window.$message?.success(msg)
         } else {
-            window.$message?.error(msg || '上传失败');
+            window.$message?.error(msg || '上传失败')
         }
     }
 }
 
 //文件附件列表
 const tableFileColumn = ref([
-    {key: 'name', name: '文件名称'},
-    {key: 'action', name: '操作', width: 80, align: 'center'}
-]);
-const tableFileData = ref([]);
+    { key: 'name', name: '文件名称' },
+    { key: 'action', name: '操作', width: 80, align: 'center' },
+])
+const tableFileData = ref([])
 const tableDelButton = (index) => {
     const arr = tableFileData.value
     if (arr.length > 1) {
-        window?.$messageBox?.alert('确定删除该文件吗?', '删除提醒', {
-            type: 'warning',
-            showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
-            callback: (action) => {
-                if (action === 'confirm') {
-                    tableFileData.value.splice(index, 1)
-                }
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                tableFileData.value.splice(index, 1)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
         })
     } else {
@@ -618,8 +645,8 @@ const tableDelButton = (index) => {
 //填报数据保存
 const pdfId = ref('')
 const saveBussData = async () => {
-    console.log('保存');
-    const {id} = treeItem.value
+    console.log('保存')
+    const { id } = treeItem.value
     const res = await saveExcelBussData(id + '')
     //刷新页面
     //  window?.location?.reload()  //刷新页面
@@ -637,10 +664,10 @@ const tableFormSaveLoading = ref(false)
 const tableFormId = ref('')
 const saveExcelBussData = async (pkeyId) => {
     tableFormId.value = ''
-    const {primaryKeyId} = treeItem.value
+    const { primaryKeyId } = treeItem.value
     tableFormSaveLoading.value = true
-    const linkIds = rowsToArr(tableFileData.value);
-    const {error, code, data} = await firstApi.saveBussData({
+    const linkIds = rowsToArr(tableFileData.value)
+    const { error, code, data } = await firstApi.saveBussData({
         ...tableFormData.value,
         projectId: projectId.value,
         contractId: contractId.value,
@@ -649,7 +676,7 @@ const saveExcelBussData = async (pkeyId) => {
         classify: '1',
         isFirst: 1,
         linkProcessList: linkIds,
-        ...finishFile.value
+        ...finishFile.value,
     }, false)
     //判断状态
     tableFormSaveLoading.value = false
@@ -666,7 +693,7 @@ const saveExcelBussData = async (pkeyId) => {
 
 //pdf预览
 const bussPdfInfo = () => {
-    const {id} = treeItem.value
+    const { id } = treeItem.value
     // getBussPdfInfo(id + '')
     getBussPdfInfo(pdfId.value)
 
@@ -674,8 +701,8 @@ const bussPdfInfo = () => {
 
 //预览PDF请求
 const getBussPdfInfo = async (pkeyId) => {
-    const {error, code, data} = await firstApi.getFirstBussPdfInfo({
-        firstId: pkeyId
+    const { error, code, data } = await firstApi.getFirstBussPdfInfo({
+        firstId: pkeyId,
     })
     //判断状态
     const res = isString(data) ? data ?? '' : ''
@@ -697,8 +724,8 @@ const iscanReport = ref(false)
 //上报方法封装
 const toreportModalClick = async (type) => {
     if (type) {
-        const {primaryKeyId, contractIdRelation} = treeItem.value
-        let rows = [];
+        const { primaryKeyId, contractIdRelation } = treeItem.value
+        let rows = []
         //处理获取流程的条件
         if (tabTypeKey.value === 'mark') {
             reportTypeData.value = tableFormId.value
@@ -712,15 +739,15 @@ const toreportModalClick = async (type) => {
             reportLoading.value = true
             const taskCheck = await eVisaTaskCheckApi({
                 projectId: projectId.value,
-                contractId: contractId.value
+                contractId: contractId.value,
             })
             if (taskCheck) {
                 if (tabTypeKey.value === 'mark') {
                     reportIds.value = tableFormId.value
-                    const {data} = await firstApi.queryFirstDocumentTitle({
+                    const { data } = await firstApi.queryFirstDocumentTitle({
                         projectId: projectId.value,
                         contractId: contractId.value,
-                        queryId: tableFormId.value
+                        queryId: tableFormId.value,
                     })
                     reportTaskName.value = isString(data) ? data ?? '' : ''
                 } else {
@@ -730,7 +757,7 @@ const toreportModalClick = async (type) => {
                     rows.forEach(item => {
                         reportDataArr.push({
                             id: item?.id,
-                            name: item?.name
+                            name: item?.name,
                         })
                     })
                     reportDatas.value = reportDataArr
@@ -761,7 +788,7 @@ const toreportModalClick = async (type) => {
 const reportModalClick = async (type) => {
     if (type === 2) {
         console.log('上报')
-        iscanReport.value = isCanreport.value;
+        iscanReport.value = isCanreport.value
         toreportModalClick(iscanReport.value)
 
     } else {
@@ -769,12 +796,12 @@ const reportModalClick = async (type) => {
         let result = false
         console.log('上报审批', rows)
         //判断自身是否满足条件
-        const result1 = rows.every(({taskStatusStr}) => {
+        const result1 = rows.every(({ taskStatusStr }) => {
             return taskStatusStr === '未上报' || taskStatusStr === '已废除'
         })
         if (result1) {
             //判断工序节点是否满足条件
-            result = rows.every(({isApprove}) => {
+            result = rows.every(({ isApprove }) => {
                 return isApprove === true
             })
             iscanReport.value = result
@@ -791,7 +818,7 @@ const reportModalClick = async (type) => {
 
 //上报的审批内容移除
 const reportTaskTagClose = (index) => {
-    const row = tableSelectionKeys.value[index];
+    const row = tableSelectionKeys.value[index]
     tableListRef.value?.toggleRowSelection(row, false)
 }
 const getTableDataAll = () => {
@@ -807,12 +834,12 @@ const showReportFinish = () => {
 //打印
 const printLoading = ref(false)
 const batchPrint = async () => {
-    const rows = tableSelectionKeys.value;
+    const rows = tableSelectionKeys.value
     const ids = arrToId(rows)
     //批量下载
     printLoading.value = true
-    const {error, code, data} = await firstApi.batchPrint({
-        ids: ids
+    const { error, code, data } = await firstApi.batchPrint({
+        ids: ids,
     })
     //处理数据
     printLoading.value = false
@@ -825,9 +852,9 @@ const batchPrint = async () => {
 
 //废除
 const batchAbolishClick = () => {
-    const rows = tableSelectionKeys.value;
+    const rows = tableSelectionKeys.value
     //判断是否满足条件
-    const result = rows.every(({status}) => {
+    const result = rows.every(({ status }) => {
         return status !== 0 && status !== 3
     })
     //判断状态
@@ -842,7 +869,7 @@ const batchAbolishClick = () => {
                 if (action === 'confirm') {
                     batchAbolishSave(ids)
                 }
-            }
+            },
         })
     } else {
         window.$message?.warning('未上报的文件不能废除')
@@ -850,7 +877,7 @@ const batchAbolishClick = () => {
 }
 //废除勾选的已上报文件
 const batchAbolishSave = async (ids) => {
-    const {error, code} = await queryApi.batchAbolish({ids: ids})
+    const { error, code } = await queryApi.batchAbolish({ ids: ids })
     //处理数据
     if (!error && code === 200) {
         window.$message?.success('批量废除成功')
@@ -861,11 +888,11 @@ const batchAbolishSave = async (ids) => {
 
 //处理数据
 const rowsToArr = (rows) => {
-    let newArr = [];
+    let newArr = []
     for (let i = 0; i < rows.length; i++) {
         newArr.push({
             id: rows[i]?.id,
-            name: rows[i]?.name
+            name: rows[i]?.name,
         })
     }
     return newArr
@@ -876,14 +903,14 @@ const leftWidth = ref(382)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        const diffVal = ve.clientX - leftNum;
+        const diffVal = ve.clientX - leftNum
         if (diffVal >= 310 && diffVal <= 900) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 54 - 49
src/views/tasks/flow.vue

@@ -1,10 +1,10 @@
 <template>
     <div class="hc-layout-box">
-        <HcCard :scrollbar="false" actionSize="lg">
+        <HcCard :scrollbar="false" action-size="lg">
             <template #header>
                 <HcTooltip keys="tasks_flow_add">
                     <el-button hc-btn type="primary" @click="addFlowData">
-                        <HcIcon name="add-circle"/>
+                        <HcIcon name="add-circle" />
                         <span>新建流程</span>
                     </el-button>
                 </HcTooltip>
@@ -12,10 +12,11 @@
             <template #extra>
                 <el-alert
                     :closable="false"
-                    title="同一合同段内,只需要设置重复岗位的流程即可,其他任务岗位,系统将自动推送,无需创建更多任务流" type="error"/>
+                    title="同一合同段内,只需要设置重复岗位的流程即可,其他任务岗位,系统将自动推送,无需创建更多任务流" type="error"
+                />
             </template>
             <HcTable :column="tableListColumn" :datas="tableListData" :loading="tableLoading">
-                <template #action="{row}">
+                <template #action="{ row }">
                     <HcTooltip keys="tasks_flow_edit">
                         <el-button plain size="small" type="primary" @click="handleTableEdit(row)">编辑</el-button>
                     </HcTooltip>
@@ -25,19 +26,23 @@
                 </template>
             </HcTable>
             <template #action>
-                <HcPages :pages="searchForm" @change="pageChange"/>
+                <HcPages :pages="searchForm" @change="pageChange" />
             </template>
         </HcCard>
-        <!--新增/编辑流程 弹框-->
-        <el-dialog v-model="showEditModal" :title="`${flowFormData.id?'编辑':'新增'}流程`" class="hc-modal-border"
-                   width="47rem">
+        <!-- 新增/编辑流程 弹框 -->
+        <el-dialog
+            v-model="showEditModal" :title="`${flowFormData.id ? '编辑' : '新增'}流程`" class="hc-modal-border"
+            width="47rem"
+        >
             <el-form ref="formFlowRef" :model="flowFormData" :rules="formFlowRules" label-width="auto" size="large">
                 <el-form-item label="流程名称" prop="fixedFlowName">
-                    <el-input v-model="flowFormData.fixedFlowName" placeholder="请输入流程名称"/>
+                    <el-input v-model="flowFormData.fixedFlowName" placeholder="请输入流程名称" />
                 </el-form-item>
                 <el-form-item label="任务人" prop="linkUserJoinString">
-                    <HcTasksUser :contractId="contractId" :projectId="projectId" :users="flowFormData.linkUserJoinString"
-                                 ui="w-full" @change="tasksUserChange"/>
+                    <HcTasksUser
+                        :contract-id="contractId" :project-id="projectId" :users="flowFormData.linkUserJoinString"
+                        ui="w-full" @change="tasksUserChange"
+                    />
                 </el-form-item>
             </el-form>
             <template #footer>
@@ -51,15 +56,15 @@
 </template>
 
 <script setup>
-import {ref, onMounted} from "vue";
-import {useAppStore} from "~src/store";
-import {getArrValue, getObjValue} from "js-fast-way"
-import tasksFlowApi from '~api/tasks/flow';
-
+import { onMounted, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import { getArrValue, getObjValue } from 'js-fast-way'
+import tasksFlowApi from '~api/tasks/flow'
+import { delMessageV2 } from '~com/message/index.js'
 //变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 
 //渲染完成
 onMounted(() => {
@@ -67,10 +72,10 @@ onMounted(() => {
 })
 
 //搜索表单
-const searchForm = ref({current: 1, size: 20, total: 0})
+const searchForm = ref({ current: 1, size: 20, total: 0 })
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -81,17 +86,17 @@ const tableLoading = ref(false)
 const tableListData = ref([])
 
 const tableListColumn = ref([
-    {key: 'fixedFlowName', name: '流程名称'},
-    {key: 'linkUserJoinString', name: '流程详情'},
-    {key: 'action', name: '操作', width: '200', align: 'center'},
+    { key: 'fixedFlowName', name: '流程名称' },
+    { key: 'linkUserJoinString', name: '流程详情' },
+    { key: 'action', name: '操作', width: '200', align: 'center' },
 ])
 
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await tasksFlowApi.getPageData({
+    const { error, code, data } = await tasksFlowApi.getPageData({
         projectId: projectId.value,
         contractId: contractId.value,
-        ...searchForm.value
+        ...searchForm.value,
     })
     //处理数据
     tableLoading.value = false
@@ -107,18 +112,18 @@ const getTableData = async () => {
 //新增编辑数据
 const showEditModal = ref(false)
 const formFlowRef = ref(null)
-const flowFormData = ref({id: '', fixedFlowName: '', linkUserJoinString: ''})
+const flowFormData = ref({ id: '', fixedFlowName: '', linkUserJoinString: '' })
 const formFlowRules = {
     fixedFlowName: {
         required: true,
-        trigger: "blur",
-        message: "请输入流程名称"
+        trigger: 'blur',
+        message: '请输入流程名称',
     },
     linkUserJoinString: {
         required: true,
-        trigger: "blur",
-        message: "请选择任务人"
-    }
+        trigger: 'blur',
+        message: '请选择任务人',
+    },
 }
 
 //任务人选择改变
@@ -128,16 +133,16 @@ const tasksUserChange = (a, b, users) => {
 
 //新建流程
 const addFlowData = () => {
-    flowFormData.value = {id: '', fixedFlowName: '', linkUserJoinString: ''}
+    flowFormData.value = { id: '', fixedFlowName: '', linkUserJoinString: '' }
     showEditModal.value = true
 }
 
 //编辑流程
 const handleTableEdit = async (row) => {
-    flowFormData.value = {id: '', fixedFlowName: '', linkUserJoinString: ''}
+    flowFormData.value = { id: '', fixedFlowName: '', linkUserJoinString: '' }
     showEditModal.value = true
-    const {error, code, data} = await tasksFlowApi.queryFixedFlowDetail({
-        id: row?.id
+    const { error, code, data } = await tasksFlowApi.queryFixedFlowDetail({
+        id: row?.id,
     })
     if (!error && code === 200) {
         let users = '', res = getObjValue(data)
@@ -150,9 +155,9 @@ const handleTableEdit = async (row) => {
                 users = `${item['fixedFlowLinkUserName']}-${item['fixedFlowLinkUser']}`
             }
         }
-        flowFormData.value = {id: res.id, fixedFlowName: res.fixedFlowName, linkUserJoinString: users}
+        flowFormData.value = { id: res.id, fixedFlowName: res.fixedFlowName, linkUserJoinString: users }
     } else {
-        flowFormData.value = {id: '', fixedFlowName: '', linkUserJoinString: ''}
+        flowFormData.value = { id: '', fixedFlowName: '', linkUserJoinString: '' }
     }
 }
 
@@ -162,10 +167,10 @@ const saveFormClick = async () => {
     const form = flowFormData.value
     if (!form.id) {
         sevaLoading.value = true
-        const {error, code} = await tasksFlowApi.addFixedFlowData({
+        const { error, code } = await tasksFlowApi.addFixedFlowData({
             ...form,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
         sevaLoading.value = false
@@ -176,10 +181,10 @@ const saveFormClick = async () => {
         }
     } else {
         sevaLoading.value = true
-        const {error, code} = await tasksFlowApi.updateFixedFlowData({
+        const { error, code } = await tasksFlowApi.updateFixedFlowData({
             ...form,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
         sevaLoading.value = false
@@ -193,24 +198,24 @@ const saveFormClick = async () => {
 
 //删除
 const handleTableDel = (row) => {
-    window?.$messageBox?.alert('是否删除当前流程?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确定删除',
-        cancelButtonText: '取消',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 removeFixedFlowData(row)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
     })
 }
 
 //确认删除
 const removeFixedFlowData = async (row) => {
-    const {error, code} = await tasksFlowApi.removeFixedFlowData({
+    const { error, code } = await tasksFlowApi.removeFixedFlowData({
         ids: row?.id || '',
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
     if (!error && code === 200) {

+ 72 - 68
src/views/tasks/message-data.vue

@@ -2,50 +2,54 @@
     <div class="hc-layout-box">
         <div class="hc-layout-left-box">
             <el-scrollbar>
-                <HcMenuSimple :datas="menuOptions" :keys="menuKey" @change="handleMenuValue"/>
+                <HcMenuSimple :datas="menuOptions" :keys="menuKey" @change="handleMenuValue" />
             </el-scrollbar>
         </div>
         <div class="hc-layout-content-box">
-            <HcCard actionSize="lg">
+            <HcCard action-size="lg">
                 <template #header>
                     <div class="w-32 ml-2">
                         <el-select v-model="searchForm.smsType" clearable placeholder="消息类型" size="large">
-                            <el-option v-for="item in smsTypeData" :label="item['label']" :value="item['value']"/>
+                            <el-option v-for="item in smsTypeData" :label="item.label" :value="item.value" />
                         </el-select>
                     </div>
                     <div class="w-64 ml-2">
-                        <HcDatePicker :dates="betweenTime" clearable size="large" @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable size="large" @change="betweenTimeUpdate" />
                     </div>
                     <div class="ml-2">
                         <el-button size="large" type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
                 <template #extra>
                     <el-button :disabled="tableCheckedKeys.length <= 0" :loading="delLoading" hc-btn @click="delClick">
-                        <HcIcon name="delete-bin-3"/>
+                        <HcIcon name="delete-bin-3" />
                         <span>删除消息</span>
                     </el-button>
-                    <el-button :disabled="tableCheckedKeys.length <= 0" :loading="markReadLoading" hc-btn
-                               @click="markReadClick">
-                        <HcIcon name="bookmark"/>
+                    <el-button
+                        :disabled="tableCheckedKeys.length <= 0" :loading="markReadLoading" hc-btn
+                        @click="markReadClick"
+                    >
+                        <HcIcon name="bookmark" />
                         <span>标记已读</span>
                     </el-button>
                 </template>
-                <HcTable ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
-                         isCheck @selection-change="tableSelectionChange">
-                    <template #content="{row}">
+                <HcTable
+                    ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
+                    is-check @selection-change="tableSelectionChange"
+                >
+                    <template #content="{ row }">
                         <div class="text-link text-cut" @click="tableContent(row)">{{ row.content }}</div>
                     </template>
                 </HcTable>
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
-        <!--日志内容-->
+        <!-- 日志内容 -->
         <el-dialog v-model="operationContentModal" class="hc-modal-border" title="消息内容" width="38rem">
             {{ operationContent }}
         </el-dialog>
@@ -53,24 +57,14 @@
 </template>
 
 <script setup>
-import {ref, onMounted, watch} from "vue";
-import {useAppStore} from "~src/store";
-import {useRouter, useRoute} from 'vue-router'
-import messageApi from '~api/tasks/message';
-import {arrToId, getArrValue} from "js-fast-way"
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import { useRoute, useRouter } from 'vue-router'
+import messageApi from '~api/tasks/message'
+import { arrToId, getArrValue } from 'js-fast-way'
 import website from '~src/config/index'
+import { delMessageV2 } from '~com/message/index.js'
 
-//变量
-const router = useRouter()
-const useRoutes = useRoute()
-const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const userInfo = ref(useAppState.getUserInfo);
-
-//路由参数数据
-const routerQuery = useRoutes?.query;
-let MenuType = routerQuery?.MenuType || '1'
 //消息数量
 const props = defineProps(
     {
@@ -85,10 +79,21 @@ const props = defineProps(
                 messageCount_3: 0,
                 messageCount_4: 0,
                 messageCount_5: 0,
-            })
+            }),
         },
-    }
+    },
 )
+//变量
+const router = useRouter()
+const useRoutes = useRoute()
+const useAppState = useAppStore()
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const userInfo = ref(useAppState.getUserInfo)
+
+//路由参数数据
+const routerQuery = useRoutes?.query
+let MenuType = routerQuery?.MenuType || '1'
 const menumsgCount = ref(props.msgCount)
 //监听
 //监听
@@ -100,7 +105,7 @@ watch(() => [
             queryCurrentUserMessageCount()
         }
 
-    }
+    },
 )
 //渲染完成
 onMounted(() => {
@@ -112,12 +117,12 @@ onMounted(() => {
 //左侧菜单
 const menuKey = ref(MenuType)
 const menuOptions = ref([
-    {key: '1', label: '任务催办', icon: 'alarm-warning', badge: 0},
-    {key: '2', label: '监测预警', icon: 'eye', badge: 0},
-    {key: '3', label: '废除通知', icon: 'delete-bin-3', badge: 0},
-    {key: '4', label: '工单反馈', icon: 'question-answer', badge: 0},
-    {key: '5', label: '系统消息', icon: 'chat-settings', badge: 0},
-]);
+    { key: '1', label: '任务催办', icon: 'alarm-warning', badge: 0 },
+    { key: '2', label: '监测预警', icon: 'eye', badge: 0 },
+    { key: '3', label: '废除通知', icon: 'delete-bin-3', badge: 0 },
+    { key: '4', label: '工单反馈', icon: 'question-answer', badge: 0 },
+    { key: '5', label: '系统消息', icon: 'chat-settings', badge: 0 },
+])
 
 const handleMenuValue = (item) => {
     searchForm.value.type = item.key
@@ -126,29 +131,29 @@ const handleMenuValue = (item) => {
     searchClick()
     router.push({
         path: useRoutes.path,
-        query: {MenuType: item.key}
+        query: { MenuType: item.key },
     })
 }
 
 //获取消息数量
 const queryCurrentUserMessageCount = async () => {
-    const typeArr = ['messageCount_1', 'messageCount_2', 'messageCount_3', 'messageCount_4', 'messageCount_5'];
+    const typeArr = ['messageCount_1', 'messageCount_2', 'messageCount_3', 'messageCount_4', 'messageCount_5']
     for (let i = 0; i < typeArr.length; i++) {
         menuOptions.value[i].badge = menumsgCount.value[typeArr[i]] ?? 0
     }
 }
 //消息类型
-const smsTypeData = ref([{label: "已读消息", value: "1"}, {label: "未读消息", value: "2"}])
+const smsTypeData = ref([{ label: '已读消息', value: '1' }, { label: '未读消息', value: '2' }])
 
 //搜索和分页数据
 const searchForm = ref({
     isRead: null, startTime: null, endTime: null, type: 1,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({val, arr}) => {
+const betweenTimeUpdate = ({ val, arr }) => {
     betweenTime.value = arr
     if (val && val.length > 0) {
         searchForm.value.startTime = val['start']
@@ -161,12 +166,12 @@ const betweenTimeUpdate = ({val, arr}) => {
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -175,9 +180,9 @@ const pageChange = ({current, size}) => {
 //设置表头数据
 const tableListRef = ref(null)
 const tableListColumn = ref([
-    {key: 'typeValue', name: '类型', width: '120'},
-    {key: 'time', name: '日期时间', width: '180'},
-    {key: 'content', name: '内容'},
+    { key: 'typeValue', name: '类型', width: '120' },
+    { key: 'time', name: '日期时间', width: '180' },
+    { key: 'content', name: '内容' },
 ])
 const tableListData = ref([])
 
@@ -190,7 +195,7 @@ const getTableData = async () => {
     tableListRef.value?.clearSelection()
     tableCheckedKeys.value = []
     //获取数据
-    const {error, code, data} = await messageApi.getPageData({
+    const { error, code, data } = await messageApi.getPageData({
         ...searchForm.value,
         projectId: projectId.value,
         contractId: contractId.value,
@@ -207,10 +212,10 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelectionChange = (rows) => {
     tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== '';
+        return (item ?? '') !== ''
     })
 }
 
@@ -225,16 +230,16 @@ const tableContent = (row) => {
 
 //删除消息
 const delClick = () => {
-    const rows = tableCheckedKeys.value;
+    const rows = tableCheckedKeys.value
     if (rows.length > 0) {
-        window?.$messageBox?.alert('是否删除勾选的消息?', '确认操作', {
-            showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
-            callback: (action) => {
-                if (action === 'confirm') {
-                    removeData(rows)
-                }
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                removeData(rows)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
         })
     } else {
@@ -248,8 +253,8 @@ const removeData = async (rows) => {
     delLoading.value = true
     const ids = arrToId(rows)
     //请求数据
-    const {error, code} = await messageApi.removeData({
-        ids: ids
+    const { error, code } = await messageApi.removeData({
+        ids: ids,
     }, false)
     //处理返回数据
     delLoading.value = false
@@ -265,7 +270,7 @@ const removeData = async (rows) => {
 
 //标记已读
 const markReadClick = () => {
-    const rows = tableCheckedKeys.value;
+    const rows = tableCheckedKeys.value
     if (rows.length > 0) {
         const ids = arrToId(rows)
         window?.$messageBox?.alert('勾选的消息是否标记为已读?', '确认操作', {
@@ -276,7 +281,7 @@ const markReadClick = () => {
                 if (action === 'confirm') {
                     setMessageWarningReadApi(ids)
                 }
-            }
+            },
         })
     } else {
         window.$message?.warning('请先勾选要标记的消息')
@@ -288,8 +293,8 @@ const markReadLoading = ref(false)
 const setMessageWarningReadApi = async (ids, getTable = true) => {
     markReadLoading.value = true
     //请求数据
-    const {error, code} = await messageApi.setMessageWarningRead({
-        ids: ids
+    const { error, code } = await messageApi.setMessageWarningRead({
+        ids: ids,
     }, false)
     //处理返回数据
     markReadLoading.value = false
@@ -306,7 +311,6 @@ const setMessageWarningReadApi = async (ids, getTable = true) => {
         window.$message?.error('消息标记为已读失败')
     }
 }
-
 </script>
 
 <style lang="scss" scoped>

+ 97 - 90
src/views/tentative/collect/test.vue

@@ -1,41 +1,41 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                    <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
-                    <HcLazyTree :autoExpandKeys="treeAutoExpandKeys" isType @load="treeLoadNode" @nodeTap="wbsElTreeClick"/>
+                    <HcLazyTree :auto-expand-keys="treeAutoExpandKeys" is-type @load="treeLoadNode" @nodeTap="wbsElTreeClick" />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip keys="tentative_collect_test_del">
                         <el-button hc-btn @click="delModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_collect_test_print">
                         <el-button hc-btn>
-                            <HcIcon name="printer"/>
+                            <HcIcon name="printer" />
                             <span>打印</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_collect_test_download">
                         <el-button hc-btn>
-                            <HcIcon name="download"/>
+                            <HcIcon name="download" />
                             <span>下载</span>
                         </el-button>
                     </HcTooltip>
@@ -43,62 +43,70 @@
                 <template #search>
                     <div class="w-auto">
                         <el-select v-model="searchForm.contractId" block clearable placeholder="请选择合同段">
-                            <el-option v-for="item in projectInfo?.contractInfoList" :key="item.id"
-                                       :label="item['name']" :value="item['id']"/>
+                            <el-option
+                                v-for="item in projectInfo?.contractInfoList" :key="item.id"
+                                :label="item.name" :value="item.id"
+                            />
                         </el-select>
                     </div>
                     <div class="w-32 ml-2">
                         <el-select v-model="searchForm.type" block clearable placeholder="检测类别">
-                            <el-option v-for="item in typeData" :key="item.value" :label="item['label']"
-                                       :value="item['value']"/>
+                            <el-option
+                                v-for="item in typeData" :key="item.value" :label="item.label"
+                                :value="item.value"
+                            />
                         </el-select>
                     </div>
                     <div class="w-32 ml-2">
                         <el-select v-model="searchForm.approval" block clearable placeholder="审批状态">
-                            <el-option v-for="item in approvalData" :key="item.value" :label="item['label']"
-                                       :value="item['value']"/>
+                            <el-option
+                                v-for="item in approvalData" :key="item.value" :label="item.label"
+                                :value="item.value"
+                            />
                         </el-select>
                     </div>
                     <div class="w-64 ml-2">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection"/>
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                />
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
-
     </div>
 </template>
 
 <script setup>
-import {ref, watch, onMounted} from "vue";
-import {useAppStore} from "~src/store";
-import queryApi from '~api/data-fill/query';
-import {getArrValue, getObjValue} from "js-fast-way";
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import queryApi from '~api/data-fill/query'
+import { getArrValue, getObjValue } from 'js-fast-way'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import { delMessageV2 } from '~com/message/index.js'
 
 //变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
 const isCollapse = ref(useAppState.getCollapse)
-const contractInfo = ref(useAppState.getContractInfo);
-const {contractType} = contractInfo.value;
+const contractInfo = ref(useAppState.getContractInfo)
+const { contractType } = contractInfo.value
 const classifyType = ref(contractType === 2 ? '2' : '1')
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -114,7 +122,7 @@ onMounted(() => {
 //搜索表单
 const searchForm = ref({
     contractId: null, type: null, approval: null, betweenTime: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //树相关的变量
@@ -123,27 +131,27 @@ const nodeItemInfo = ref({})
 const nodeDataInfo = ref({})
 
 //懒加载的数据
-const treeLoadNode = async ({node, item, level},resolve) => {
-    let contractIdRelation = '', parentId = '', primaryKeyId = '';
+const treeLoadNode = async ({ node, item, level }, resolve) => {
+    let contractIdRelation = '', parentId = '', primaryKeyId = ''
     if (level !== 0) {
-        const nodeData = getObjValue(item);
+        const nodeData = getObjValue(item)
         contractIdRelation = nodeData?.contractIdRelation || ''
         parentId = contractIdRelation ? nodeData?.primaryKeyId : nodeData?.id
         primaryKeyId = nodeData?.id || ''
     }
     //获取数据
-    const {data} = await queryApi.queryWbsTreeData({
+    const { data } = await queryApi.queryWbsTreeData({
         contractId: contractId.value || '',
         contractIdRelation,
         primaryKeyId,
         parentId,
-        classifyType: classifyType.value
+        classifyType: classifyType.value,
     })
     resolve(getArrValue(data))
 }
 
 //树被点击
-const wbsElTreeClick = ({node, data, keys}) => {
+const wbsElTreeClick = ({ node, data, keys }) => {
     nodeItemInfo.value = node
     nodeDataInfo.value = data
     primaryKeyId.value = data['primaryKeyId'] || ''
@@ -153,41 +161,41 @@ const wbsElTreeClick = ({node, data, keys}) => {
     //改变搜索表单数据
     //searchForm.value.wbsId = data['contractIdRelation'] ? data['id'] : data['primaryKeyId']
     //searchForm.value.contractIdRelation = data['contractIdRelation']
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //检测类别
 const typeData = ref([
-    {label: '自检', value: '1'},
-    {label: '抽检', value: '2'},
-    {label: '平行试验', value: '3'},
-    {label: '验证试验', value: '4'},
-    {label: '中心试验', value: '5'}
+    { label: '自检', value: '1' },
+    { label: '抽检', value: '2' },
+    { label: '平行试验', value: '3' },
+    { label: '验证试验', value: '4' },
+    { label: '中心试验', value: '5' },
 ])
 
 //审批状态
 const approvalData = ref([
-    {label: '未上报', value: '1'},
-    {label: '待审批', value: '2'},
-    {label: '已审批', value: '3'}
+    { label: '未上报', value: '1' },
+    { label: '待审批', value: '2' },
+    { label: '已审批', value: '3' },
 ])
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr, query}) => {
+const betweenTimeUpdate = ({ arr, query }) => {
     betweenTime.value = arr
     searchForm.value.betweenTime = query
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -196,27 +204,27 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'key1', name: '报告编号'},
-    {key: 'key2', name: '工程部位'},
-    {key: 'key3', name: '试验日期'},
-    {key: 'key4', name: '样品编号'},
-    {key: 'key5', name: '生产厂家'},
-    {key: 'key6', name: '规格型号'},
-    {key: 'key7', name: '代表数量'},
-    {key: 'key8', name: '密度(开kg/m3)'},
-    {key: 'key9', name: '比表面积(m2/kg)'},
-    {key: 'key10', name: '细度(%)'},
-    {key: 'key11', name: '标准稠度用水量(%)'},
-    {key: 'key12', name: '初凝结时间(min)'},
-    {key: 'key13', name: '终凝结时间(min)'},
-    {key: 'key14', name: '安定性霍氏夹法'},
-    {key: 'key15', name: '抗折3D胶砂强度(Mpa)'},
-    {key: 'key16', name: '抗折28D胶砂强度(Mpa)'},
-    {key: 'key17', name: '抗压3D胶砂强度(Mpa)'},
-    {key: 'key18', name: '抗压28D胶砂强度(Mpa)'},
-    {key: 'key19', name: '试验结果'},
-    {key: 'key20', name: '检测类型'},
-    {key: 'key21', name: '检测人'},
+    { key: 'key1', name: '报告编号' },
+    { key: 'key2', name: '工程部位' },
+    { key: 'key3', name: '试验日期' },
+    { key: 'key4', name: '样品编号' },
+    { key: 'key5', name: '生产厂家' },
+    { key: 'key6', name: '规格型号' },
+    { key: 'key7', name: '代表数量' },
+    { key: 'key8', name: '密度(开kg/m3)' },
+    { key: 'key9', name: '比表面积(m2/kg)' },
+    { key: 'key10', name: '细度(%)' },
+    { key: 'key11', name: '标准稠度用水量(%)' },
+    { key: 'key12', name: '初凝结时间(min)' },
+    { key: 'key13', name: '终凝结时间(min)' },
+    { key: 'key14', name: '安定性霍氏夹法' },
+    { key: 'key15', name: '抗折3D胶砂强度(Mpa)' },
+    { key: 'key16', name: '抗折28D胶砂强度(Mpa)' },
+    { key: 'key17', name: '抗压3D胶砂强度(Mpa)' },
+    { key: 'key18', name: '抗压28D胶砂强度(Mpa)' },
+    { key: 'key19', name: '试验结果' },
+    { key: 'key20', name: '检测类型' },
+    { key: 'key21', name: '检测人' },
 ])
 
 //获取数据
@@ -227,41 +235,40 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== '';
+        return (item ?? '') !== ''
     })
 }
 
 //删除
 const delModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
-                //removeContractTreeNode()
+                instance.confirmButtonLoading = true
+                  //removeContractTreeNode()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
-    })
+     })
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(382);
+const leftWidth = ref(382)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 310 && diffVal <= 900) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 72 - 60
src/views/tentative/detect/components/HcTreeData.vue

@@ -1,71 +1,79 @@
 <template>
-    <ElTree ref="ElTreeRef" :current-node-key="treeKey" :data="treeDatas" :default-expanded-keys="[treeKey]" :indent="0"
-            :props="ElTreeProps" accordion
-            class="hc-tree-node tree-line" highlight-current node-key="id"
-            @node-click="ElTreeClick" @node-contextmenu="ElTreeLabelContextMenu">
+    <ElTree
+        ref="ElTreeRef" :current-node-key="treeKey" :data="treeDatas" :default-expanded-keys="[treeKey]" :indent="0"
+        :props="ElTreeProps" accordion
+        class="hc-tree-node tree-line" highlight-current node-key="id"
+        @node-click="ElTreeClick" @node-contextmenu="ElTreeLabelContextMenu"
+    >
         <template #default="{ node, data }">
-            <div :id="`${idPrefix}${data['id']}`" class="data-custom-tree-node">
-                <!--树组件,节点名称-->
+            <div :id="`${idPrefix}${data.id}`" class="data-custom-tree-node">
+                <!-- 树组件,节点名称 -->
                 <div class="label">{{ node.label }}</div>
-                <!--树组件,操作菜单-->
-                <div v-if="menusData.length > 0" :class="node.showTreeMenu?'show':''" class="menu-icon" @click.stop>
-                    <div class="cu-tree-node-popover-menu-icon"
-                         @click.prevent.stop="ElTreeLabelContextMenu($event,data,node)">
-                        <HcIcon name="menu" ui="text-2xl"/>
+                <!-- 树组件,操作菜单 -->
+                <div v-if="menusData.length > 0" :class="node.showTreeMenu ? 'show' : ''" class="menu-icon" @click.stop>
+                    <div
+                        class="cu-tree-node-popover-menu-icon"
+                        @click.prevent.stop="ElTreeLabelContextMenu($event, data, node)"
+                    >
+                        <HcIcon name="menu" ui="text-2xl" />
                     </div>
                 </div>
-                <!--树组件,操作菜单 END-->
+                <!-- 树组件,操作菜单 END -->
             </div>
         </template>
     </ElTree>
-    <!--右键菜单-->
+    <!-- 右键菜单 -->
     <HcContextMenu v-if="menusData.length > 0" ref="contextMenuRef" :datas="menusData" @item-click="handleMenuSelect">
-        <template #sort="{item}">
-            <HcIcon :line="false" :name="item.icon" class="menu-item-icon"/>
+        <template #sort="{ item }">
+            <HcIcon :line="false" :name="item.icon" class="menu-item-icon" />
             <span class="menu-item-name">{{ item.label }}</span>
         </template>
     </HcContextMenu>
 
-    <!--新增/编辑 节点-->
-    <HcDialog :loading="nodeFormLoading" :show="nodeFormModal" :title="`${nodeFormModel.id?'编辑':'新增'}节点`"
-              widths="30rem" @close="nodeFormModalClose" @save="nodeFormModalSave">
-        <el-form ref="nodeFormRef" :model="nodeFormModel" :rules="nodeFormRules" label-position="top" label-width="auto"
-                 size="large">
+    <!-- 新增/编辑 节点 -->
+    <HcDialog
+        :loading="nodeFormLoading" :show="nodeFormModal" :title="`${nodeFormModel.id ? '编辑' : '新增'}节点`"
+        widths="30rem" @close="nodeFormModalClose" @save="nodeFormModalSave"
+    >
+        <el-form
+            ref="nodeFormRef" :model="nodeFormModel" :rules="nodeFormRules" label-position="top" label-width="auto"
+            size="large"
+        >
             <el-form-item class="mb-0" label="节点名称">
-                <el-input v-model="nodeFormModel.nodeName" placeholder="请输入节点名称"/>
+                <el-input v-model="nodeFormModel.nodeName" placeholder="请输入节点名称" />
             </el-form-item>
         </el-form>
     </HcDialog>
-
 </template>
 
 <script setup>
-import {nextTick, onMounted, ref, watch} from "vue";
-import {HcIsButton} from "~src/plugins/IsButtons";
-import {getTreeAll, submitTree, removeTree} from "~api/tentative/detect"
-import {formValidate, getArrValue} from "js-fast-way"
-import {delMessage} from "~uti/tools";
-
+import { nextTick, onMounted, ref, watch } from 'vue'
+import { HcIsButton } from '~src/plugins/IsButtons'
+import { getTreeAll, removeTree, submitTree } from '~api/tentative/detect'
+import { formValidate, getArrValue } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 //参数
 const props = defineProps({
     autoExpandKeys: {
         type: [String, Number],
-        default: ''
+        default: '',
     },
     projectId: {
         type: [String, Number],
-        default: ''
+        default: '',
     },
     contractId: {
         type: [String, Number],
-        default: ''
+        default: '',
     },
     type: {
         type: String,
-        default: 'leftTree'
+        default: 'leftTree',
     },
 })
 
+//事件
+const emit = defineEmits(['menuTap', 'nodeTap'])
 //变量
 const ElTreeRef = ref(null)
 const idPrefix = ref('detect-tree-data-')
@@ -76,7 +84,7 @@ const dataType = ref(props.type)
 const ElTreeProps = ref({
     label: 'nodeName',
     children: 'children',
-    isLeaf: 'hasChildren'
+    isLeaf: 'hasChildren',
 })
 
 //监听
@@ -84,7 +92,7 @@ watch(() => [
     props.projectId,
     props.contractId,
     props.type,
-    props.autoExpandKeys
+    props.autoExpandKeys,
 ], ([pid, cid, type, expandKeys]) => {
     projectId.value = pid
     contractId.value = cid
@@ -101,15 +109,15 @@ onMounted(() => {
 //树菜单配置
 const menusData = ref([])
 const setElTreeMenu = () => {
-    let newArr = [];
+    let newArr = []
     if (HcIsButton('tentative_detect_third_tree_add')) {
-        newArr.push({icon: 'add-circle', label: '新增节点', key: "add"})
+        newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
     }
     if (HcIsButton('tentative_detect_third_tree_edit')) {
-        newArr.push({icon: 'draft', label: '修改节点', key: "edit"})
+        newArr.push({ icon: 'draft', label: '修改节点', key: 'edit' })
     }
     if (HcIsButton('tentative_detect_third_tree_del')) {
-        newArr.push({icon: 'delete-bin', label: '删除节点', key: "del"})
+        newArr.push({ icon: 'delete-bin', label: '删除节点', key: 'del' })
     }
     menusData.value = newArr
 }
@@ -117,9 +125,9 @@ const setElTreeMenu = () => {
 //获取树数据
 const treeDatas = ref([])
 const getTreeDatas = async () => {
-    const {error, code, data} = await getTreeAll({
+    const { error, code, data } = await getTreeAll({
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     if (!error && code === 200) {
         treeDatas.value = getArrValue(data[dataType.value])
@@ -133,12 +141,9 @@ const getTreeDatas = async () => {
     }
 }
 
-//事件
-const emit = defineEmits(['menuTap', 'nodeTap'])
-
 //节点被点击
 const ElTreeClick = async (data, node) => {
-    emit('nodeTap', {node, data, keys: data.id})
+    emit('nodeTap', { node, data, keys: data.id })
 }
 
 //鼠标右键事件
@@ -146,25 +151,25 @@ const treeRefNode = ref(null)
 const treeRefData = ref(null)
 const contextMenuRef = ref(null)
 const ElTreeLabelContextMenu = (e, data, node) => {
-    const rows = menusData.value || [];
+    const rows = menusData.value || []
     if (rows.length > 0) {
-        e.preventDefault();
-        treeRefNode.value = node;
-        treeRefData.value = data;
+        e.preventDefault()
+        treeRefNode.value = node
+        treeRefData.value = data
         //展开菜单
         contextMenuRef.value?.showMenu(e)
     }
 }
 
 //鼠标右键菜单被点击
-const handleMenuSelect = ({key}) => {
-    const data = treeRefData.value;
+const handleMenuSelect = ({ key }) => {
+    const data = treeRefData.value
     if (key === 'add') {
-        emit('menuTap', {data})
+        emit('menuTap', { data })
         nodeFormModel.value = {
             parentId: data.id,
             nodeType: data.nodeType,
-            nodeName: ''
+            nodeName: '',
         }
         if (data?.isData !== 1) {
             nodeFormModal.value = true
@@ -174,8 +179,15 @@ const handleMenuSelect = ({key}) => {
         nodeFormModel.value = data
         nodeFormModal.value = true
     } else if (key === 'del') {
-        delMessage(() => {
-            treeRemoveData(data.id)
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                await treeRemoveData(data.id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
         })
     }
 }
@@ -184,13 +196,13 @@ const handleMenuSelect = ({key}) => {
 const nodeFormModal = ref(false)
 const nodeFormRef = ref(null)
 const nodeFormModel = ref({
-    nodeName: ''
+    nodeName: '',
 })
 const nodeFormRules = {
     nodeName: {
         required: true,
         trigger: 'blur',
-        message: "请输入节点名称"
+        message: '请输入节点名称',
     },
 }
 
@@ -200,10 +212,10 @@ const nodeFormModalSave = async () => {
     const validate = await formValidate(nodeFormRef.value)
     if (validate) {
         //发起请求
-        const {error, code} = await submitTree({
+        const { error, code } = await submitTree({
             ...nodeFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
         if (!error && code === 200) {
@@ -221,10 +233,10 @@ const nodeFormModalClose = () => {
 
 //删除节点
 const treeRemoveData = async (id) => {
-    const {error, code} = await removeTree({
+    const { error, code } = await removeTree({
         projectId: projectId.value,
         contractId: contractId.value,
-        id: id
+        id: id,
     })
     //处理数据
     if (!error && code === 200) {

+ 265 - 210
src/views/tentative/detect/outside.vue

@@ -1,104 +1,122 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                    <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
-                    <HcTreeData :autoExpandKeys="thirdTreeKeys" :contractId="contractId" :projectId="projectId"
-                                type="rightTree" @menuTap="menuTapClick" @nodeTap="wbsElTreeClick"/>
+                    <HcTreeData
+                        v-if="isShowTree" :auto-expand-keys="thirdTreeKeys" :contract-id="contractId"
+                        :project-id="projectId" type="rightTree" @menuTap="menuTapClick" @nodeTap="wbsElTreeClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip keys="tentative_detect_third_add">
                         <el-button :disabled="!thirdTreeKeys" hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_copy">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="copyLoading" hc-btn
-                                   @click="copyTableModalClick">
-                            <HcIcon name="file-copy-2"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="copyLoading" hc-btn
+                            @click="copyTableModalClick"
+                        >
+                            <HcIcon name="file-copy-2" />
                             <span>复制</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #search>
                     <div class="w-40">
-                        <el-input v-model="searchForm.queryName" clearable placeholder="送样人员"/>
+                        <el-input v-model="searchForm.queryName" clearable placeholder="送样人员" />
                     </div>
                     <div class="w-40 ml-2">
                         <el-select v-model="searchForm.queryStatus" clearable placeholder="请选择是否合格">
-                            <el-option v-for="item in qualifiedData" :key="item.value" :label="item['label']"
-                                       :value="item['value']"/>
+                            <el-option
+                                v-for="item in qualifiedData" :key="item.value" :label="item.label"
+                                :value="item.value"
+                            />
                         </el-select>
                     </div>
                     <div class="w-64 ml-2">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-72 ml-2">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入报告编号、委托编号"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入报告编号、委托编号"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection">
-                         <template #status="{row}">
-                            <span>{{ row.status===1?'合格':row.status===0?'不合格':'' }}</span>
-                        </template>
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                >
+                    <template #status="{ row }">
+                        <span>{{ row.status === 1 ? '合格' : row.status === 0 ? '不合格' : '' }}</span>
+                    </template>
                 </HcTable>
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增/编辑-->
-        <HcDialog :isClose="false" :show="addEditFormModal" :title="formModalTitle + ' 第三方试验信息'" isRowFooter
-                  widths="70rem" @close="addEditFormModalClose">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :is-close="false" :show="addEditFormModal" :title="`${formModalTitle} 第三方试验信息`" is-row-footer
+            widths="70rem" @close="addEditFormModalClose"
+        >
             <template #extra>
-                <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
+                <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" />
             </template>
-            <el-form v-if="tabTypeKey === 'tab1'" ref="addEditFormRef" :model="addEditFormModel"
-                     :rules="addEditFormRules"
-                     label-width="auto" size="large">
+            <el-form
+                v-if="tabTypeKey === 'tab1'" ref="addEditFormRef" :model="addEditFormModel"
+                :rules="addEditFormRules"
+                label-width="auto" size="large"
+            >
                 <div class="hc-form-item">
                     <el-form-item label="合同段">
-                        <el-select v-model="addEditFormModel.contractId" :teleported="false" block
-                                   placeholder="请选择合同段" popper-class="select-popper">
-                            <el-option v-for="item in projectInfo?.contractInfoList" :key="item.id"
-                                       :label="item['name']" :value="item['id']"/>
+                        <el-select
+                            v-model="addEditFormModel.contractId" :teleported="false" block
+                            placeholder="请选择合同段" popper-class="select-popper"
+                        >
+                            <el-option
+                                v-for="item in projectInfo?.contractInfoList" :key="item.id"
+                                :label="item.name" :value="item.id"
+                            />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="合格状态">
@@ -110,166 +128,193 @@
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="委托编号" prop="entrustNo">
-                        <el-input v-model="addEditFormModel.entrustNo"/>
+                        <el-input v-model="addEditFormModel.entrustNo" />
                     </el-form-item>
                     <el-form-item label="样品名称">
-                        <el-input v-model="addEditFormModel.materialName"/>
+                        <el-input v-model="addEditFormModel.materialName" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="委托单位" prop="entrustCompany">
-                        <el-input v-model="addEditFormModel.entrustCompany"/>
+                        <el-input v-model="addEditFormModel.entrustCompany" />
                     </el-form-item>
                     <el-form-item label="样品编号">
-                        <el-input v-model="addEditFormModel.specificationNumber"/>
+                        <el-input v-model="addEditFormModel.specificationNumber" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="证书编号">
-                        <el-input v-model="addEditFormModel.testingAgencyCertificateNo"
-                                  placeholder="检测机构资质证书编号"/>
+                        <el-input
+                            v-model="addEditFormModel.testingAgencyCertificateNo"
+                            placeholder="检测机构资质证书编号"
+                        />
                     </el-form-item>
                     <el-form-item label="样品数量">
-                        <el-input v-model="addEditFormModel.materialCount"/>
+                        <el-input v-model="addEditFormModel.materialCount" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="取样人">
-                        <el-input v-model="addEditFormModel.userName"/>
+                        <el-input v-model="addEditFormModel.userName" />
                     </el-form-item>
                     <el-form-item label="代表数量">
-                        <el-input v-model="addEditFormModel.representativeCount"/>
+                        <el-input v-model="addEditFormModel.representativeCount" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="见证人">
-                        <el-input v-model="addEditFormModel.witness"/>
+                        <el-input v-model="addEditFormModel.witness" />
                     </el-form-item>
                     <el-form-item label="检测机构">
-                        <el-input v-model="addEditFormModel.inspectionOrganization"/>
+                        <el-input v-model="addEditFormModel.inspectionOrganization" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="送样日期">
-                        <el-date-picker v-model="addEditFormModel.sampleDeliveryDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.sampleDeliveryDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="产地">
-                        <el-input v-model="addEditFormModel.placeOfOrigin"/>
+                        <el-input v-model="addEditFormModel.placeOfOrigin" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="取样日期">
-                        <el-date-picker v-model="addEditFormModel.samplingDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.samplingDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="取样地点">
-                        <el-input v-model="addEditFormModel.samplingLocation"/>
+                        <el-input v-model="addEditFormModel.samplingLocation" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="检测日期">
-                        <el-date-picker v-model="addEditFormModel.testDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.testDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="生产厂家">
-                        <el-input v-model="addEditFormModel.manufacturer"/>
+                        <el-input v-model="addEditFormModel.manufacturer" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="报告日期">
-                        <el-date-picker v-model="addEditFormModel.reportDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.reportDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="生产批号">
-                        <el-input v-model="addEditFormModel.batchNumber"/>
+                        <el-input v-model="addEditFormModel.batchNumber" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="报告编号" prop="reportNo">
-                        <el-input v-model="addEditFormModel.reportNo"/>
+                        <el-input v-model="addEditFormModel.reportNo" />
                     </el-form-item>
                     <el-form-item label="工程部位">
-                        <el-input v-model="addEditFormModel.projectPosition"/>
+                        <el-input v-model="addEditFormModel.projectPosition" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="试验类型">
-                        <el-input v-model="addEditFormModel.trialType"/>
+                        <el-input v-model="addEditFormModel.trialType" />
                     </el-form-item>
                     <el-form-item label="规格型号">
-                        <el-input v-model="addEditFormModel.specificationModel"/>
+                        <el-input v-model="addEditFormModel.specificationModel" />
                     </el-form-item>
                 </div>
                 <el-form-item label="委托单附件">
-                    <FormItemUpload v-model="addEditFormModel.delegationOrderUrl" :action="'upload-file'" :fileName="addEditFormModel.delegationOrderUrlName"/>
+                    <FormItemUpload v-model="addEditFormModel.delegationOrderUrl" action="upload-file" :file-name="addEditFormModel.delegationOrderUrlName" />
                 </el-form-item>
                 <el-form-item label="记录表附件">
-                    <FormItemUpload v-model="addEditFormModel.recordTableUrl" :action="'upload-file'"  :fileName="addEditFormModel.recordTableUrlName"/>
+                    <FormItemUpload v-model="addEditFormModel.recordTableUrl" action="upload-file" :file-name="addEditFormModel.recordTableUrlName" />
                 </el-form-item>
                 <el-form-item label="报告单附件">
-                    <FormItemUpload v-model="addEditFormModel.reportAttachmentUrl" :action="'upload-file'"   :fileName="addEditFormModel.reportAttachmentUrlName"/>
+                    <FormItemUpload v-model="addEditFormModel.reportAttachmentUrl" action="upload-file" :file-name="addEditFormModel.reportAttachmentUrlName" />
                 </el-form-item>
             </el-form>
-            <el-form v-if="tabTypeKey === 'tab2'" :model="addEditFormModel" :rules="addEditFormRules" ref="addEditFormRef"
-                     label-position="top"
-                     label-width="auto" size="large">
+            <el-form
+                v-if="tabTypeKey === 'tab2'" ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules"
+                label-position="top"
+                label-width="auto" size="large"
+            >
                 <el-form-item label="检测依据">
-                    <el-input v-model="addEditFormModel.testBasisText" :autosize="{ minRows: 3}" maxlength="1000"
-                              placeholder="请输入检测依据" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.testBasisText" :autosize="{ minRows: 3 }" maxlength="1000"
+                        placeholder="请输入检测依据" show-word-limit type="textarea"
+                    />
                 </el-form-item>
                 <el-form-item label="评定标准">
-                    <el-input v-model="addEditFormModel.evaluationCriteriaText" :autosize="{ minRows: 3}"
-                              maxlength="1000" placeholder="请输入评定标准" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.evaluationCriteriaText" :autosize="{ minRows: 3 }"
+                        maxlength="1000" placeholder="请输入评定标准" show-word-limit type="textarea"
+                    />
                 </el-form-item>
                 <el-form-item label="检测结论">
-                    <el-input v-model="addEditFormModel.testConclusionText" :autosize="{ minRows: 3}" maxlength="1000"
-                              placeholder="请输入检测结论" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.testConclusionText" :autosize="{ minRows: 3 }" maxlength="1000"
+                        placeholder="请输入检测结论" show-word-limit type="textarea"
+                    />
                 </el-form-item>
                 <el-form-item label="备注">
-                    <el-input v-model="addEditFormModel.remarks" :autosize="{ minRows: 3}" maxlength="1000"
-                              placeholder="请输入备注" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.remarks" :autosize="{ minRows: 3 }" maxlength="1000"
+                        placeholder="请输入备注" show-word-limit type="textarea"
+                    />
                 </el-form-item>
             </el-form>
             <template #leftRowFooter>
                 <el-button hc-btn type="primary" @click="linksSampleModalClick">
-                    <HcIcon name="links"/>
+                    <HcIcon name="links" />
                     <span>选择样品信息</span>
                 </el-button>
             </template>
             <template #rightRowFooter>
                 <el-button size="large" @click="addEditFormModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
                 <el-button :loading="addEditFormLoading" hc-btn type="primary" @click="addEditFormClick">
-                    <HcIcon name="check"/>
+                    <HcIcon name="check" />
                     <span>确认</span>
                 </el-button>
             </template>
         </HcDialog>
 
-        <!--选择样品信息-->
-        <HcDialog :show="linksSampleModal" isRowFooter isTable title="选择样品信息" widths="70%"
-                  @close="linksSampleModalClose">
+        <!-- 选择样品信息 -->
+        <HcDialog
+            :show="linksSampleModal" is-row-footer is-table title="选择样品信息" widths="70%"
+            @close="linksSampleModalClose"
+        >
             <div class="hc-links-sample-modal-box">
                 <div class="hc-links-sample-tree-box">
                     <el-scrollbar>
-                        <TestTree :projectId="projectId"
-                                  :tenantId="userInfo?.tenant_id"
-                                  :wbsTempId="projectInfo?.referenceWbsTemplateIdTrial"
-                                  :wbsType="2"
-                                  @nodeTap="sampleTreeClick"/>
+                        <TestTree
+                            :project-id="projectId"
+                            :tenant-id="userInfo?.tenant_id"
+                            :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
+                            :wbs-type="2"
+                            @nodeTap="sampleTreeClick"
+                        />
                     </el-scrollbar>
                 </div>
                 <div class="hc-links-sample-table-box">
-                    <HcTable :column="linksSampleTableColumn" :datas="linksSampleTableData"
-                             :isIndex="false" :loading="linksSampleTableLoading">
-                        <template #action="{row}">
+                    <HcTable
+                        :column="linksSampleTableColumn" :datas="linksSampleTableData"
+                        :is-index="false" :loading="linksSampleTableLoading"
+                    >
+                        <template #action="{ row }">
                             <el-button v-if="addEditFormModel.sampleId === row.id" plain size="small" type="primary">
                                 已选择
                             </el-button>
-                            <el-button v-else plain size="small" type="primary" @click="linksSampleRow(row)">选择
+                            <el-button v-else plain size="small" type="primary" @click="linksSampleRow(row)">
+                                选择
                             </el-button>
                         </template>
                     </HcTable>
@@ -277,41 +322,41 @@
             </div>
             <template #leftRowFooter>
                 <el-button size="large" @click="linksSampleModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
             </template>
             <template #rightRowFooter>
-                <HcPages :pages="searchSampleForm" @change="pageSampleChange"/>
+                <HcPages :pages="searchSampleForm" @change="pageSampleChange" />
             </template>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {ref, watch, onMounted} from "vue";
-import {useAppStore} from "~src/store";
-import HcTreeData from "./components/HcTreeData.vue"
-import FormItemUpload from "./components/FormItemUpload.vue"
-import TestTree from "../material/components/TestTree.vue"
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
-import dataApi from "~api/tentative/detect/third";
-import samplingApi from "~api/tentative/material/sampling"
-import {formValidate, getArrValue, arrToId} from "js-fast-way"
-import {delMessage} from "~uti/tools";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import HcTreeData from './components/HcTreeData.vue'
+import FormItemUpload from './components/FormItemUpload.vue'
+import TestTree from '../material/components/TestTree.vue'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import dataApi from '~api/tentative/detect/third'
+import samplingApi from '~api/tentative/material/sampling'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+// import {delMessage} from "~uti/tools";
+import { delMessageV2 } from '~com/message/index.js'
 
 //变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
-const userInfo = ref(useAppState.getUserInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
+const userInfo = ref(useAppState.getUserInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -330,36 +375,37 @@ onMounted(() => {
 
 //是否合格
 const qualifiedData = ref([
-    {label: '不合格', value: 0},
-    {label: '合格', value: 1}
+    { label: '不合格', value: 0 },
+    { label: '合格', value: 1 },
 ])
 
 //搜索表单
 const searchForm = ref({
     queryName: null, queryStatus: null, queryValue: null, startTime: null, endTime: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //树被点击
 const nodeItemInfo = ref({})
-const wbsElTreeClick = ({node, keys}) => {
+const wbsElTreeClick = ({ node, keys }) => {
     nodeItemInfo.value = node
     //缓存自动展开
     thirdTreeKeys.value = keys
     setStoreValue('outsideTreeKeys', keys)
     //改变搜索表单数据
     searchForm.value.nodeId = keys
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
-const menuTapClick = ({data}) => {
+const menuTapClick = ({ data }) => {
     if (data?.isData === 1) {
         window.$message.warning('当前节点下已有数据,不允许新增节点')
     }
 }
+const isShowTree = ref(true)
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr}) => {
+const betweenTimeUpdate = ({ arr }) => {
     betweenTime.value = arr
     if (arr.length > 0) {
         searchForm.value.startTime = arr[0]
@@ -372,20 +418,20 @@ const betweenTimeUpdate = ({arr}) => {
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -394,20 +440,20 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'entrustNo', name: '委托编号', width: 150},
-    {key: 'reportNo', name: '报告编号', width: 150},
-    {key: 'specificationNumber', name: '样品编号', width: 150},
-    {key: 'trialType', name: '试验类型', width: 150},
-    {key: 'materialName', name: '样品名称', width: 150},
-    {key: 'specificationModel', name: '规格型号', width: 150},
-    {key: 'entrustCompany', name: '委托单位', width: 150},
-    {key: 'inspectionOrganization', name: '检测机构', width: 150},
-    {key: 'projectPosition', name: '工程部位', width: 150},
-    {key: 'userName', name: '送样人', width: 100},
-    {key: 'sampleDeliveryDate', name: '送样日期', width: 150},
-    {key: 'reportDate', name: '报告日期', width: 150},
-    {key: 'status', name: '检测结果', width: 150},
-    {key: 'remarks', name: '备注', width: 180},
+    { key: 'entrustNo', name: '委托编号', width: 150 },
+    { key: 'reportNo', name: '报告编号', width: 150 },
+    { key: 'specificationNumber', name: '样品编号', width: 150 },
+    { key: 'trialType', name: '试验类型', width: 150 },
+    { key: 'materialName', name: '样品名称', width: 150 },
+    { key: 'specificationModel', name: '规格型号', width: 150 },
+    { key: 'entrustCompany', name: '委托单位', width: 150 },
+    { key: 'inspectionOrganization', name: '检测机构', width: 150 },
+    { key: 'projectPosition', name: '工程部位', width: 150 },
+    { key: 'userName', name: '送样人', width: 100 },
+    { key: 'sampleDeliveryDate', name: '送样日期', width: 150 },
+    { key: 'reportDate', name: '报告日期', width: 150 },
+    { key: 'status', name: '检测结果', width: 150 },
+    { key: 'remarks', name: '备注', width: 180 },
 ])
 const tableData = ref([])
 
@@ -415,10 +461,10 @@ const tableData = ref([])
 const tableLoading = ref(false)
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         ...searchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
     tableLoading.value = false
@@ -432,7 +478,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -442,10 +488,10 @@ const addEditFormModal = ref(false)
 
 const formModalTitle = ref('新增')
 const addFormModalClick = () => {
-    const {data} = nodeItemInfo.value
+    const { data } = nodeItemInfo.value
     if (data?.id) {
         addEditFormModel.value = {
-            nodeId: data.id, trialType: data.nodeName, status: 1
+            nodeId: data.id, trialType: data.nodeName, status: 1,
         }
         formModalTitle.value = '新增'
         addEditFormModal.value = true
@@ -476,9 +522,9 @@ const addEditFormModalClose = () => {
 //类型tab数据和相关处理
 const tabTypeKey = ref('tab1')
 const tabTypeTab = ref([
-    {key: 'tab1', name: '基础信息'},
-    {key: 'tab2', name: '检查结论'},
-]);
+    { key: 'tab1', name: '基础信息' },
+    { key: 'tab2', name: '检查结论' },
+])
 const tabTypeChange = (item) => {
     tabTypeKey.value = item?.key
 }
@@ -486,25 +532,25 @@ const tabTypeChange = (item) => {
 //新增/编辑 表单
 const addEditFormRef = ref(null)
 const addEditFormModel = ref({})
-const delegationOrderUrlName=ref('')
-const recordTableUrlName=ref('')
-const reportAttachmentUrlName=ref('')
+const delegationOrderUrlName = ref('')
+const recordTableUrlName = ref('')
+const reportAttachmentUrlName = ref('')
 const addEditFormRules = {
     entrustNo: {
         required: true,
         trigger: 'blur',
-        message: "请输入编号"
+        message: '请输入编号',
     },
     reportNo: {
         required: true,
         trigger: 'blur',
-        message: "请输入报告编号"
+        message: '请输入报告编号',
     },
     entrustCompany: {
         required: true,
         trigger: 'blur',
-        message: "请输入委托单位"
-    }
+        message: '请输入委托单位',
+    },
 }
 const addEditFormRules2 = {}
 //新增/编辑/复制弹窗 保存
@@ -529,23 +575,24 @@ const addEditFormClick = async () => {
 //新增、编辑 提交保存
 const submitFormApi = async () => {
     addEditFormLoading.value = true
-    const {error, code} = await dataApi.submitForm({
+    const { error, code } = await dataApi.submitForm({
         ...addEditFormModel.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
-
+    addEditFormLoading.value = false
     if (!error && code === 200) {
         window?.$message?.success('操作成功')
         addEditFormModal.value = false
-        setTimeout(() => {
-            addEditFormLoading.value = false
-        }, 1000);
-        // await getTableData()
-        window?.location?.reload()  //刷新页面
+       isShowTree.value = false
+       setTimeout(() => {
+        isShowTree.value = true
+       }, 100)
+        await getTableData()
+        // window?.location?.reload() //刷新页面
     }
-    addEditFormLoading.value = false
+  
 }
 
 //复制
@@ -564,29 +611,26 @@ const copyTableModalClick = () => {
 //复制提交保存
 const copyFormApi = async () => {
     addEditFormLoading.value = true
-    const {error, code} = await dataApi.copyData({
+    const { error, code } = await dataApi.copyData({
         ...addEditFormModel.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
-
+    addEditFormLoading.value = false
     if (!error && code === 200) {
         window?.$message?.success('操作成功')
         addEditFormModal.value = false
-        setTimeout(() => {
-            addEditFormLoading.value = false
-        }, 1000);
         await getTableData()
     }
-    addEditFormLoading.value = false
+   
 }
 
 //批量复制 提交保存
 const copyLoading = ref(false)
 const batchCopyFormApi = async (ids) => {
     copyLoading.value = true
-    const {error, code} = await dataApi.copyData({
+    const { error, code } = await dataApi.copyData({
         projectId: projectId.value,
         contractId: contractId.value,
         ids: ids,
@@ -601,8 +645,15 @@ const batchCopyFormApi = async (ids) => {
 
 //删除
 const delModalClick = () => {
-    delMessage(() => {
-        tableRemoveData()
+    delMessageV2(async (action, instance, done) => {
+        if (action === 'confirm') {
+            instance.confirmButtonLoading = true
+           await tableRemoveData()
+           instance.confirmButtonLoading = false
+           done()
+        } else {
+            done()
+        }
     })
 }
 
@@ -612,7 +663,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -620,34 +671,38 @@ const tableRemoveData = async () => {
         //处理数据
         if (!error && code === 200) {
             window?.$message?.success('操作成功')
-            // searchClick()
-            window?.location?.reload()  //刷新页面
+            // getTableData()
+            isShowTree.value = false
+            setTimeout(() => {
+                    isShowTree.value = true
+            }, 100)
+       
         }
     }
 }
 
 //关联数据搜索
 const searchSampleForm = ref({
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //关联进场材料
 const linksSampleModal = ref(false)
 const linksSampleModalClick = () => {
-    searchSampleForm.value.current = 1;
+    searchSampleForm.value.current = 1
     linksSampleTableData.value = []
     linksSampleModal.value = true
 }
 
 //树被点击
-const sampleTreeClick = ({data}) => {
+const sampleTreeClick = ({ data }) => {
     searchSampleForm.value.nodeId = data['primaryKeyId'] || ''
-    searchSampleForm.value.current = 1;
+    searchSampleForm.value.current = 1
     getLinksSampleTable()
 }
 
 //分页被点击
-const pageSampleChange = ({current, size}) => {
+const pageSampleChange = ({ current, size }) => {
     searchSampleForm.value.current = current
     searchSampleForm.value.size = size
     getLinksSampleTable()
@@ -655,16 +710,16 @@ const pageSampleChange = ({current, size}) => {
 
 //关联进场材料数据
 const linksSampleTableColumn = ref([
-    {key: 'materialName', name: '取样名称'},
-    {key: 'samplingDate', name: '取样日期'},
-    {key: 'specificationNumber', name: '样品编号'},
-    {key: 'specificationModel', name: '规格型号'},
-    {key: 'materialCount', name: '试样数量'},
-    {key: 'calculationUnit', name: '计算单位'},
-    {key: 'proposedPosition', name: '拟用部位'},
-    {key: 'representativeCount', name: '代表数量'},
-    {key: 'userName', name: '取样人'},
-    {key: 'action', name: '操作'},
+    { key: 'materialName', name: '取样名称' },
+    { key: 'samplingDate', name: '取样日期' },
+    { key: 'specificationNumber', name: '样品编号' },
+    { key: 'specificationModel', name: '规格型号' },
+    { key: 'materialCount', name: '试样数量' },
+    { key: 'calculationUnit', name: '计算单位' },
+    { key: 'proposedPosition', name: '拟用部位' },
+    { key: 'representativeCount', name: '代表数量' },
+    { key: 'userName', name: '取样人' },
+    { key: 'action', name: '操作' },
 
 ])
 const linksSampleTableData = ref([])
@@ -672,13 +727,13 @@ const linksSampleTableData = ref([])
 //获取关联数据
 const linksSampleTableLoading = ref(false)
 const getLinksSampleTable = async () => {
-    const {nodeId} = searchSampleForm.value
+    const { nodeId } = searchSampleForm.value
     if (nodeId) {
         linksSampleTableLoading.value = true
-        const {error, code, data} = await samplingApi.queryPage({
+        const { error, code, data } = await samplingApi.queryPage({
             ...searchSampleForm.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
         linksSampleTableLoading.value = false
@@ -696,17 +751,17 @@ const getLinksSampleTable = async () => {
 
 //确认关联
 const linksSampleRow = (row) => {
-    const form = addEditFormModel.value;
-    form.materialName = row.materialName ?? ''                  //样品名称
-    form.specificationNumber = row.specificationNumber ?? ''    //样品编号
-    form.materialCount = row.materialCount ?? ''                //试样数量
-    form.userName = row.userName ?? ''                          //取样人
-    form.representativeCount = row.representativeCount ?? ''    //代表数量
-    form.samplingDate = row.samplingDate ?? ''                  //取样日期
-    form.samplingLocation = row.samplingLocation ?? ''          //取样地点
-    form.batchNumber = row.batchNumber ?? ''                    //生产批号
-    form.specificationModel = row.specificationModel ?? ''      //规格型号
-    form.sampleId = row.id                                      //关联ID
+    const form = addEditFormModel.value
+    form.materialName = row.materialName ?? '' //样品名称
+    form.specificationNumber = row.specificationNumber ?? '' //样品编号
+    form.materialCount = row.materialCount ?? '' //试样数量
+    form.userName = row.userName ?? '' //取样人
+    form.representativeCount = row.representativeCount ?? '' //代表数量
+    form.samplingDate = row.samplingDate ?? '' //取样日期
+    form.samplingLocation = row.samplingLocation ?? '' //取样地点
+    form.batchNumber = row.batchNumber ?? '' //生产批号
+    form.specificationModel = row.specificationModel ?? '' //规格型号
+    form.sampleId = row.id //关联ID
     //更新数据
     addEditFormModel.value = form
 }
@@ -715,22 +770,22 @@ const linksSampleRow = (row) => {
 const linksSampleModalClose = () => {
     linksSampleModal.value = false
     linksSampleTableData.value = []
-    searchSampleForm.value.current = 1;
+    searchSampleForm.value.current = 1
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(300);
+const leftWidth = ref(300)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 260 && diffVal <= 700) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 10 - 3
src/views/tentative/detect/test.vue

@@ -265,7 +265,7 @@ import { arrKeyValue, arrToId, getArrValue, getObjValue, isString } from 'js-fas
 
 import { Loading } from 'element-plus/es/components/loading/src/service'
 import notableform from '~src/assets/view/notableform.svg'
-import { delMessage } from '~uti/tools'
+import { delMessageV2 } from '~com/message/index.js'
 
 //变量
 const router = useRouter()
@@ -547,10 +547,17 @@ const copyDataApi = async (ids) => {
 const delModalClick = () => {
     const rows = tableCheckedKeys.value
     if (rows.length > 0) {
-        delMessage(() => {
+        delMessageV2(async (action, instance, done) => {
+        if (action === 'confirm') {
+            instance.confirmButtonLoading = true
             const ids = arrToId(rows)
             removeDataApi(ids)
-        })
+           instance.confirmButtonLoading = false
+           done()
+        } else {
+            done()
+        }
+    })
     } else {
         window.$message?.warning('请先勾选需要删除的记录')
     }

+ 262 - 210
src/views/tentative/detect/third.vue

@@ -1,106 +1,123 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                    <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
-                    <HcTreeData :autoExpandKeys="thirdTreeKeys" :contractId="contractId" :projectId="projectId"
-                                type="leftTree" @menuTap="menuTapClick" @nodeTap="wbsElTreeClick"/>
+                    <HcTreeData
+                        v-if="isShowTree" :auto-expand-keys="thirdTreeKeys" :contract-id="contractId"
+                        :project-id="projectId" type="leftTree" @menuTap="menuTapClick" @nodeTap="wbsElTreeClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip keys="tentative_detect_third_add">
                         <el-button :disabled="!thirdTreeKeys" hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_copy">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="copyLoading" hc-btn
-                                   @click="copyTableModalClick">
-                            <HcIcon name="file-copy-2"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="copyLoading" hc-btn
+                            @click="copyTableModalClick"
+                        >
+                            <HcIcon name="file-copy-2" />
                             <span>复制</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #search>
                     <div class="w-40">
-                        <el-input v-model="searchForm.queryName" clearable placeholder="送样人员"/>
+                        <el-input v-model="searchForm.queryName" clearable placeholder="送样人员" />
                     </div>
                     <div class="w-40 ml-2">
                         <el-select v-model="searchForm.queryStatus" clearable placeholder="请选择是否合格">
-                            <el-option v-for="item in qualifiedData" :key="item.value" :label="item['label']"
-                                       :value="item['value']"/>
+                            <el-option
+                                v-for="item in qualifiedData" :key="item.value" :label="item.label"
+                                :value="item.value"
+                            />
                         </el-select>
                     </div>
                     <div class="w-64 ml-2">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-72 ml-2">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入报告编号、委托编号"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入报告编号、委托编号"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection">
-                         
-                         <template #status="{row}">
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                >
+                    <template #status="{ row }">
                         <!-- <span>{{arrKeyValue(categoryData, 'dictKey', 'dictValue', row.detectionCategory)}}</span> -->
-                            <span>{{ row.status===1?'合格':row.status===0?'不合格':'' }}</span>
-                        </template>
+                        <span>{{ row.status === 1 ? '合格' : row.status === 0 ? '不合格' : '' }}</span>
+                    </template>
                 </HcTable>
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增/编辑-->
-        <HcDialog :isClose="false" :show="addEditFormModal" :title="formModalTitle + ' 外委试验信息'" isRowFooter
-                  widths="70rem" @close="addEditFormModalClose">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :is-close="false" :show="addEditFormModal" :title="`${formModalTitle} 外委试验信息`" is-row-footer
+            widths="70rem" @close="addEditFormModalClose"
+        >
             <template #extra>
-                <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
+                <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" />
             </template>
-            <el-form v-if="tabTypeKey === 'tab1'" ref="addEditFormRef" :model="addEditFormModel"
-                     :rules="addEditFormRules"
-                     label-width="auto" size="large">
+            <el-form
+                v-if="tabTypeKey === 'tab1'" ref="addEditFormRef" :model="addEditFormModel"
+                :rules="addEditFormRules"
+                label-width="auto" size="large"
+            >
                 <div class="hc-form-item">
                     <el-form-item label="合同段">
-                        <el-select v-model="addEditFormModel.contractId" :teleported="false" block
-                                   placeholder="请选择合同段" popper-class="select-popper">
-                            <el-option v-for="item in projectInfo?.contractInfoList" :key="item.id"
-                                       :label="item['name']" :value="item['id']"/>
+                        <el-select
+                            v-model="addEditFormModel.contractId" :teleported="false" block
+                            placeholder="请选择合同段" popper-class="select-popper"
+                        >
+                            <el-option
+                                v-for="item in projectInfo?.contractInfoList" :key="item.id"
+                                :label="item.name" :value="item.id"
+                            />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="合格状态">
@@ -112,166 +129,192 @@
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="委托编号" prop="entrustNo">
-                        <el-input v-model="addEditFormModel.entrustNo"/>
+                        <el-input v-model="addEditFormModel.entrustNo" />
                     </el-form-item>
                     <el-form-item label="样品名称">
-                        <el-input v-model="addEditFormModel.materialName"/>
+                        <el-input v-model="addEditFormModel.materialName" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="委托单位" prop="entrustCompany">
-                        <el-input v-model="addEditFormModel.entrustCompany"/>
+                        <el-input v-model="addEditFormModel.entrustCompany" />
                     </el-form-item>
                     <el-form-item label="样品编号">
-                        <el-input v-model="addEditFormModel.specificationNumber"/>
+                        <el-input v-model="addEditFormModel.specificationNumber" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="证书编号">
-                        <el-input v-model="addEditFormModel.testingAgencyCertificateNo"
-                                  placeholder="检测机构资质证书编号"/>
+                        <el-input
+                            v-model="addEditFormModel.testingAgencyCertificateNo"
+                            placeholder="检测机构资质证书编号"
+                        />
                     </el-form-item>
                     <el-form-item label="样品数量">
-                        <el-input v-model="addEditFormModel.materialCount"/>
+                        <el-input v-model="addEditFormModel.materialCount" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="取样人">
-                        <el-input v-model="addEditFormModel.userName"/>
+                        <el-input v-model="addEditFormModel.userName" />
                     </el-form-item>
                     <el-form-item label="代表数量">
-                        <el-input v-model="addEditFormModel.representativeCount"/>
+                        <el-input v-model="addEditFormModel.representativeCount" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="见证人">
-                        <el-input v-model="addEditFormModel.witness"/>
+                        <el-input v-model="addEditFormModel.witness" />
                     </el-form-item>
                     <el-form-item label="检测机构">
-                        <el-input v-model="addEditFormModel.inspectionOrganization"/>
+                        <el-input v-model="addEditFormModel.inspectionOrganization" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="送样日期">
-                        <el-date-picker v-model="addEditFormModel.sampleDeliveryDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.sampleDeliveryDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="产地">
-                        <el-input v-model="addEditFormModel.placeOfOrigin"/>
+                        <el-input v-model="addEditFormModel.placeOfOrigin" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="取样日期">
-                        <el-date-picker v-model="addEditFormModel.samplingDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.samplingDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="取样地点">
-                        <el-input v-model="addEditFormModel.samplingLocation"/>
+                        <el-input v-model="addEditFormModel.samplingLocation" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="检测日期">
-                        <el-date-picker v-model="addEditFormModel.testDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.testDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="生产厂家">
-                        <el-input v-model="addEditFormModel.manufacturer"/>
+                        <el-input v-model="addEditFormModel.manufacturer" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="报告日期">
-                        <el-date-picker v-model="addEditFormModel.reportDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.reportDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="生产批号">
-                        <el-input v-model="addEditFormModel.batchNumber"/>
+                        <el-input v-model="addEditFormModel.batchNumber" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="报告编号" prop="reportNo">
-                        <el-input v-model="addEditFormModel.reportNo"/>
+                        <el-input v-model="addEditFormModel.reportNo" />
                     </el-form-item>
                     <el-form-item label="工程部位">
-                        <el-input v-model="addEditFormModel.projectPosition"/>
+                        <el-input v-model="addEditFormModel.projectPosition" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="试验类型">
-                        <el-input v-model="addEditFormModel.trialType"/>
+                        <el-input v-model="addEditFormModel.trialType" />
                     </el-form-item>
                     <el-form-item label="规格型号">
-                        <el-input v-model="addEditFormModel.specificationModel"/>
+                        <el-input v-model="addEditFormModel.specificationModel" />
                     </el-form-item>
                 </div>
                 <el-form-item label="委托单附件">
-                        <FormItemUpload v-model="addEditFormModel.delegationOrderUrl" :action="'upload-file'"  :fileName="addEditFormModel.delegationOrderUrlName"/>
+                    <FormItemUpload v-model="addEditFormModel.delegationOrderUrl" action="upload-file" :file-name="addEditFormModel.delegationOrderUrlName" />
                 </el-form-item>
                 <el-form-item label="记录表附件">
-                    <FormItemUpload v-model="addEditFormModel.recordTableUrl" :action="'upload-file'" :fileName="addEditFormModel.recordTableUrlName"/>
+                    <FormItemUpload v-model="addEditFormModel.recordTableUrl" action="upload-file" :file-name="addEditFormModel.recordTableUrlName" />
                 </el-form-item>
                 <el-form-item label="报告单附件">
-                        <FormItemUpload v-model="addEditFormModel.reportAttachmentUrl" :action="'upload-file'" :fileName="addEditFormModel.reportAttachmentUrlName"/>
-             
+                    <FormItemUpload v-model="addEditFormModel.reportAttachmentUrl" action="upload-file" :file-name="addEditFormModel.reportAttachmentUrlName" />
                 </el-form-item>
             </el-form>
-            <el-form v-if="tabTypeKey === 'tab2'" :model="addEditFormModel" label-position="top" label-width="auto" ref="addEditFormRef"
-                     size="large">
+            <el-form
+                v-if="tabTypeKey === 'tab2'" ref="addEditFormRef" :model="addEditFormModel" label-position="top" label-width="auto"
+                size="large"
+            >
                 <el-form-item label="检测依据">
-                    <el-input v-model="addEditFormModel.testBasisText" :autosize="{ minRows: 3}" maxlength="1000"
-                              placeholder="请输入检测依据" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.testBasisText" :autosize="{ minRows: 3 }" maxlength="1000"
+                        placeholder="请输入检测依据" show-word-limit type="textarea"
+                    />
                 </el-form-item>
                 <el-form-item label="评定标准">
-                    <el-input v-model="addEditFormModel.evaluationCriteriaText" :autosize="{ minRows: 3}"
-                              maxlength="1000" placeholder="请输入评定标准" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.evaluationCriteriaText" :autosize="{ minRows: 3 }"
+                        maxlength="1000" placeholder="请输入评定标准" show-word-limit type="textarea"
+                    />
                 </el-form-item>
                 <el-form-item label="检测结论">
-                    <el-input v-model="addEditFormModel.testConclusionText" :autosize="{ minRows: 3}" maxlength="1000"
-                              placeholder="请输入检测结论" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.testConclusionText" :autosize="{ minRows: 3 }" maxlength="1000"
+                        placeholder="请输入检测结论" show-word-limit type="textarea"
+                    />
                 </el-form-item>
                 <el-form-item label="备注">
-                    <el-input v-model="addEditFormModel.remarks" :autosize="{ minRows: 3}" maxlength="1000"
-                              placeholder="请输入备注" show-word-limit type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.remarks" :autosize="{ minRows: 3 }" maxlength="1000"
+                        placeholder="请输入备注" show-word-limit type="textarea"
+                    />
                 </el-form-item>
             </el-form>
             <template #leftRowFooter>
                 <el-button hc-btn type="primary" @click="linksSampleModalClick">
-                    <HcIcon name="links"/>
+                    <HcIcon name="links" />
                     <span>选择样品信息</span>
                 </el-button>
             </template>
             <template #rightRowFooter>
                 <el-button size="large" @click="addEditFormModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
                 <el-button :loading="addEditFormLoading" hc-btn type="primary" @click="addEditFormClick">
-                    <HcIcon name="check"/>
+                    <HcIcon name="check" />
                     <span>确认</span>
                 </el-button>
             </template>
         </HcDialog>
 
-        <!--选择样品信息-->
-        <HcDialog :show="linksSampleModal" isRowFooter isTable title="选择样品信息" widths="70%"
-                  @close="linksSampleModalClose">
+        <!-- 选择样品信息 -->
+        <HcDialog
+            :show="linksSampleModal" is-row-footer is-table title="选择样品信息" widths="70%"
+            @close="linksSampleModalClose"
+        >
             <div class="hc-links-sample-modal-box">
                 <div class="hc-links-sample-tree-box">
                     <el-scrollbar>
-                        <TestTree :projectId="projectId"
-                                  :tenantId="userInfo?.tenant_id"
-                                  :wbsTempId="projectInfo?.referenceWbsTemplateIdTrial"
-                                  :wbsType="2"
-                                  @nodeTap="sampleTreeClick"/>
+                        <TestTree
+                            :project-id="projectId"
+                            :tenant-id="userInfo?.tenant_id"
+                            :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
+                            :wbs-type="2"
+                            @nodeTap="sampleTreeClick"
+                        />
                     </el-scrollbar>
                 </div>
                 <div class="hc-links-sample-table-box">
-                    <HcTable :column="linksSampleTableColumn" :datas="linksSampleTableData"
-                             :isIndex="false" :loading="linksSampleTableLoading">
-                        <template #action="{row}">
+                    <HcTable
+                        :column="linksSampleTableColumn" :datas="linksSampleTableData"
+                        :is-index="false" :loading="linksSampleTableLoading"
+                    >
+                        <template #action="{ row }">
                             <el-button v-if="addEditFormModel.sampleId === row.id" plain size="small" type="primary">
                                 已选择
                             </el-button>
-                            <el-button v-else plain size="small" type="primary" @click="linksSampleRow(row)">选择
+                            <el-button v-else plain size="small" type="primary" @click="linksSampleRow(row)">
+                                选择
                             </el-button>
                         </template>
                     </HcTable>
@@ -279,41 +322,40 @@
             </div>
             <template #leftRowFooter>
                 <el-button size="large" @click="linksSampleModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
             </template>
             <template #rightRowFooter>
-                <HcPages :pages="searchSampleForm" @change="pageSampleChange"/>
+                <HcPages :pages="searchSampleForm" @change="pageSampleChange" />
             </template>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {ref, watch, onMounted} from "vue";
-import {useAppStore} from "~src/store";
-import HcTreeData from "./components/HcTreeData.vue"
-import FormItemUpload from "./components/FormItemUpload.vue"
-import TestTree from "../material/components/TestTree.vue"
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
-import dataApi from "~api/tentative/detect/third";
-import samplingApi from "~api/tentative/material/sampling"
-import {formValidate, getArrValue, arrToId} from "js-fast-way"
-import {delMessage} from "~uti/tools";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import HcTreeData from './components/HcTreeData.vue'
+import FormItemUpload from './components/FormItemUpload.vue'
+import TestTree from '../material/components/TestTree.vue'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import dataApi from '~api/tentative/detect/third'
+import samplingApi from '~api/tentative/material/sampling'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 
 //变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
-const userInfo = ref(useAppState.getUserInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
+const userInfo = ref(useAppState.getUserInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -332,36 +374,37 @@ onMounted(() => {
 
 //是否合格
 const qualifiedData = ref([
-    {label: '不合格', value: 0},
-    {label: '合格', value: 1}
+    { label: '不合格', value: 0 },
+    { label: '合格', value: 1 },
 ])
 
 //搜索表单
 const searchForm = ref({
     queryName: null, queryStatus: null, queryValue: null, startTime: null, endTime: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //树被点击
 const nodeItemInfo = ref({})
-const wbsElTreeClick = ({node, keys}) => {
+const wbsElTreeClick = ({ node, keys }) => {
     nodeItemInfo.value = node
     //缓存自动展开
     thirdTreeKeys.value = keys
     setStoreValue('thirdTreeKeys', keys)
     //改变搜索表单数据
     searchForm.value.nodeId = keys
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
-const menuTapClick = ({data}) => {
+const menuTapClick = ({ data }) => {
     if (data?.isData === 1) {
         window.$message.warning('当前节点下已有数据,不允许新增节点')
     }
 }
+const isShowTree = ref(true)
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr}) => {
+const betweenTimeUpdate = ({ arr }) => {
     betweenTime.value = arr
     if (arr.length > 0) {
         searchForm.value.startTime = arr[0]
@@ -374,20 +417,20 @@ const betweenTimeUpdate = ({arr}) => {
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -396,20 +439,20 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'entrustNo', name: '委托编号', width: 150},
-    {key: 'reportNo', name: '报告编号', width: 150},
-    {key: 'specificationNumber', name: '样品编号', width: 150},
-    {key: 'trialType', name: '试验类型', width: 150},
-    {key: 'materialName', name: '样品名称', width: 150},
-    {key: 'specificationModel', name: '规格型号', width: 150},
-    {key: 'entrustCompany', name: '委托单位', width: 150},
-    {key: 'inspectionOrganization', name: '检测机构', width: 150},
-    {key: 'projectPosition', name: '工程部位', width: 150},
-    {key: 'userName', name: '送样人', width: 100},
-    {key: 'sampleDeliveryDate', name: '送样日期', width: 150},
-    {key: 'reportDate', name: '报告日期', width: 150},
-    {key: 'status', name: '检测结果', width: 150},
-    {key: 'remarks', name: '备注', width: 180},
+    { key: 'entrustNo', name: '委托编号', width: 150 },
+    { key: 'reportNo', name: '报告编号', width: 150 },
+    { key: 'specificationNumber', name: '样品编号', width: 150 },
+    { key: 'trialType', name: '试验类型', width: 150 },
+    { key: 'materialName', name: '样品名称', width: 150 },
+    { key: 'specificationModel', name: '规格型号', width: 150 },
+    { key: 'entrustCompany', name: '委托单位', width: 150 },
+    { key: 'inspectionOrganization', name: '检测机构', width: 150 },
+    { key: 'projectPosition', name: '工程部位', width: 150 },
+    { key: 'userName', name: '送样人', width: 100 },
+    { key: 'sampleDeliveryDate', name: '送样日期', width: 150 },
+    { key: 'reportDate', name: '报告日期', width: 150 },
+    { key: 'status', name: '检测结果', width: 150 },
+    { key: 'remarks', name: '备注', width: 180 },
 ])
 const tableData = ref([])
 
@@ -417,10 +460,10 @@ const tableData = ref([])
 const tableLoading = ref(false)
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         ...searchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
     tableLoading.value = false
@@ -434,7 +477,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -443,10 +486,10 @@ const tableSelection = (rows) => {
 const addEditFormModal = ref(false)
 const formModalTitle = ref('新增')
 const addFormModalClick = () => {
-    const {data} = nodeItemInfo.value
+    const { data } = nodeItemInfo.value
     if (data?.id) {
         addEditFormModel.value = {
-            nodeId: data.id, trialType: data.nodeName, status: 1
+            nodeId: data.id, trialType: data.nodeName, status: 1,
         }
         formModalTitle.value = '新增'
         addEditFormModal.value = true
@@ -476,9 +519,9 @@ const addEditFormModalClose = () => {
 //类型tab数据和相关处理
 const tabTypeKey = ref('tab1')
 const tabTypeTab = ref([
-    {key: 'tab1', name: '基础信息'},
-    {key: 'tab2', name: '检查结论'},
-]);
+    { key: 'tab1', name: '基础信息' },
+    { key: 'tab2', name: '检查结论' },
+])
 const tabTypeChange = (item) => {
     tabTypeKey.value = item?.key
 }
@@ -490,17 +533,17 @@ const addEditFormRules = {
     entrustCompany: {
         required: true,
         trigger: 'blur',
-        message: "请输入委托单位"
+        message: '请输入委托单位',
     },
     entrustNo: {
         required: true,
         trigger: 'blur',
-        message: "请输入编号"
+        message: '请输入编号',
     },
     reportNo: {
         required: true,
         trigger: 'blur',
-        message: "请输入报告编号"
+        message: '请输入报告编号',
     },
 
 }
@@ -509,12 +552,12 @@ const addEditFormRules = {
 const addEditFormLoading = ref(false)
 const addEditFormClick = async () => {
     let validate
-    console.log(addEditFormRef.value,'addEditFormRef.value');
+    console.log(addEditFormRef.value, 'addEditFormRef.value')
     if (addEditFormRef.value !== null) {
         validate = await formValidate(addEditFormRef.value)
     }
 
-    console.log(validate,'validate');
+    console.log(validate, 'validate')
     if (validate) {
         if (formModalTitle.value === '复制') {
             await copyFormApi()
@@ -528,24 +571,24 @@ const addEditFormClick = async () => {
 //新增、编辑 提交保存
 const submitFormApi = async () => {
     addEditFormLoading.value = true
-    console.log(addEditFormModel.value,'addEditFormModel.value');
-    const {error, code} = await dataApi.submitForm({
+    console.log(addEditFormModel.value, 'addEditFormModel.value')
+    const { error, code } = await dataApi.submitForm({
         ...addEditFormModel.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
-
+    addEditFormLoading.value = false
     if (!error && code === 200) {
         window?.$message?.success('操作成功')
         addEditFormModal.value = false
+        isShowTree.value = false
         setTimeout(() => {
-            addEditFormLoading.value = false
-        }, 1000);
-        // await getTableData()
-        window?.location?.reload()  //刷新页面
+            isShowTree.value = true
+        }, 100)
+        await getTableData()
+       
     }
-    addEditFormLoading.value = false
 }
 
 //复制
@@ -560,16 +603,16 @@ const copyTableModalClick = () => {
         batchCopyFormApi(ids)
     }
 }
-const changepdf=(pdf)=>{
-    console.log(pdf,'pdf');
+const changepdf = (pdf)=>{
+    console.log(pdf, 'pdf')
 }
 //复制提交保存
 const copyFormApi = async () => {
     addEditFormLoading.value = true
-    const {error, code} = await dataApi.copyData({
+    const { error, code } = await dataApi.copyData({
         ...addEditFormModel.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
 
@@ -578,7 +621,7 @@ const copyFormApi = async () => {
         addEditFormModal.value = false
         setTimeout(() => {
             addEditFormLoading.value = false
-        }, 1000);
+        }, 1000)
         await getTableData()
     }
     addEditFormLoading.value = false
@@ -588,7 +631,7 @@ const copyFormApi = async () => {
 const copyLoading = ref(false)
 const batchCopyFormApi = async (ids) => {
     copyLoading.value = true
-    const {error, code} = await dataApi.copyData({
+    const { error, code } = await dataApi.copyData({
         projectId: projectId.value,
         contractId: contractId.value,
         ids: ids,
@@ -603,9 +646,16 @@ const batchCopyFormApi = async (ids) => {
 
 //删除
 const delModalClick = () => {
-    delMessage(() => {
-        tableRemoveData()
-    })
+    delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                await tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
+     })
 }
 
 //批量删除
@@ -614,7 +664,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -623,33 +673,37 @@ const tableRemoveData = async () => {
         if (!error && code === 200) {
             window?.$message?.success('操作成功')
             // searchClick()
-            window?.location?.reload()  //刷新页面
-        }
+            isShowTree.value = false
+            setTimeout(() => {
+                isShowTree.value = true
+            }, 100)
+            await getTableData()
+            }
     }
 }
 
 //关联数据搜索
 const searchSampleForm = ref({
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //关联进场材料
 const linksSampleModal = ref(false)
 const linksSampleModalClick = () => {
-    searchSampleForm.value.current = 1;
+    searchSampleForm.value.current = 1
     linksSampleTableData.value = []
     linksSampleModal.value = true
 }
 
 //树被点击
-const sampleTreeClick = ({data}) => {
+const sampleTreeClick = ({ data }) => {
     searchSampleForm.value.nodeId = data['primaryKeyId'] || ''
-    searchSampleForm.value.current = 1;
+    searchSampleForm.value.current = 1
     getLinksSampleTable()
 }
 
 //分页被点击
-const pageSampleChange = ({current, size}) => {
+const pageSampleChange = ({ current, size }) => {
     searchSampleForm.value.current = current
     searchSampleForm.value.size = size
     getLinksSampleTable()
@@ -657,16 +711,16 @@ const pageSampleChange = ({current, size}) => {
 
 //关联进场材料数据
 const linksSampleTableColumn = ref([
-    {key: 'materialName', name: '取样名称'},
-    {key: 'samplingDate', name: '取样日期'},
-    {key: 'specificationNumber', name: '样品编号'},
-    {key: 'specificationModel', name: '规格型号'},
-    {key: 'materialCount', name: '试样数量'},
-    {key: 'calculationUnit', name: '计算单位'},
-    {key: 'proposedPosition', name: '拟用部位'},
-    {key: 'representativeCount', name: '代表数量'},
-    {key: 'userName', name: '取样人'},
-    {key: 'action', name: '操作'},
+    { key: 'materialName', name: '取样名称' },
+    { key: 'samplingDate', name: '取样日期' },
+    { key: 'specificationNumber', name: '样品编号' },
+    { key: 'specificationModel', name: '规格型号' },
+    { key: 'materialCount', name: '试样数量' },
+    { key: 'calculationUnit', name: '计算单位' },
+    { key: 'proposedPosition', name: '拟用部位' },
+    { key: 'representativeCount', name: '代表数量' },
+    { key: 'userName', name: '取样人' },
+    { key: 'action', name: '操作' },
 
 ])
 const linksSampleTableData = ref([])
@@ -674,13 +728,13 @@ const linksSampleTableData = ref([])
 //获取关联数据
 const linksSampleTableLoading = ref(false)
 const getLinksSampleTable = async () => {
-    const {nodeId} = searchSampleForm.value
+    const { nodeId } = searchSampleForm.value
     if (nodeId) {
         linksSampleTableLoading.value = true
-        const {error, code, data} = await samplingApi.queryPage({
+        const { error, code, data } = await samplingApi.queryPage({
             ...searchSampleForm.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
         linksSampleTableLoading.value = false
@@ -698,17 +752,17 @@ const getLinksSampleTable = async () => {
 
 //确认关联
 const linksSampleRow = (row) => {
-    const form = addEditFormModel.value;
-    form.materialName = row.materialName ?? ''                  //样品名称
-    form.specificationNumber = row.specificationNumber ?? ''    //样品编号
-    form.materialCount = row.materialCount ?? ''                //试样数量
-    form.userName = row.userName ?? ''                          //取样人
-    form.representativeCount = row.representativeCount ?? ''    //代表数量
-    form.samplingDate = row.samplingDate ?? ''                  //取样日期
-    form.samplingLocation = row.samplingLocation ?? ''          //取样地点
-    form.batchNumber = row.batchNumber ?? ''                    //生产批号
-    form.specificationModel = row.specificationModel ?? ''      //规格型号
-    form.sampleId = row.id                                      //关联ID
+    const form = addEditFormModel.value
+    form.materialName = row.materialName ?? '' //样品名称
+    form.specificationNumber = row.specificationNumber ?? '' //样品编号
+    form.materialCount = row.materialCount ?? '' //试样数量
+    form.userName = row.userName ?? '' //取样人
+    form.representativeCount = row.representativeCount ?? '' //代表数量
+    form.samplingDate = row.samplingDate ?? '' //取样日期
+    form.samplingLocation = row.samplingLocation ?? '' //取样地点
+    form.batchNumber = row.batchNumber ?? '' //生产批号
+    form.specificationModel = row.specificationModel ?? '' //规格型号
+    form.sampleId = row.id //关联ID
     //更新数据
     addEditFormModel.value = form
 }
@@ -717,22 +771,22 @@ const linksSampleRow = (row) => {
 const linksSampleModalClose = () => {
     linksSampleModal.value = false
     linksSampleTableData.value = []
-    searchSampleForm.value.current = 1;
+    searchSampleForm.value.current = 1
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(300);
+const leftWidth = ref(300)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 260 && diffVal <= 700) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>
@@ -744,6 +798,4 @@ const onmousedown = () => {
 //     top: 100px !important;
 //     left: 133px !important;
 // }
-
-
 </style>

+ 183 - 155
src/views/tentative/device/approach.vue

@@ -7,50 +7,54 @@
                 </div>
                 <HcTooltip keys="tentative_device_approach_menu_add">
                     <el-button _icon hc-btn size="small" type="primary" @click="addEditNodeFormModalClick">
-                        <HcIcon name="add"/>
+                        <HcIcon name="add" />
                     </el-button>
                 </HcTooltip>
             </div>
             <div class="hc-menu-contents-box">
                 <el-scrollbar>
-                    <HcMenuSimple :datas="menus" :keys="menuKey" :menus="contextMenu" :props="menusProps"
-                                  @change="menuChange" @menuTap="contextMenuClick"/>
+                    <HcMenuSimple
+                        :datas="menus" :keys="menuKey" :menus="contextMenu" :props="menusProps"
+                        @change="menuChange" @menuTap="contextMenuClick"
+                    />
                 </el-scrollbar>
             </div>
             <!-- 左右拖动 -->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
             <HcCard>
                 <template #header>
                     <HcTooltip keys="tentative_device_approach_add">
                         <el-button hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_approach_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_approach_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delTableModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_approach_printer">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
-                                   @click="printerClick">
-                            <HcIcon name="printer"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
+                            @click="printerClick"
+                        >
+                            <HcIcon name="printer" />
                             <span>打印</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_approach_import">
                         <el-button hc-btn @click="importModalClick">
-                            <HcIcon name="folder-upload"/>
+                            <HcIcon name="folder-upload" />
                             <span>导入</span>
                         </el-button>
                     </HcTooltip>
@@ -58,158 +62,184 @@
                 <template #search>
                     <div class="w-32">
                         <el-select v-model="searchForm.isCalibration" clearable placeholder="是否需要效验">
-                            <el-option :value="1" label="是"/>
-                            <el-option :value="0" label="否"/>
+                            <el-option :value="1" label="是" />
+                            <el-option :value="0" label="否" />
                         </el-select>
                     </div>
                     <div class="w-32 ml-2">
                         <el-select v-model="searchForm.status" clearable placeholder="状态">
-                            <el-option :value="1" label="启用中"/>
-                            <el-option :value="0" label="已停用"/>
+                            <el-option :value="1" label="启用中" />
+                            <el-option :value="0" label="已停用" />
                         </el-select>
                     </div>
                     <div class="w-64 ml-2">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-72 ml-2">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入设备名称\设备型号查询"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入设备名称\设备型号查询"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection">
-                    <template #status="{row}">
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                >
+                    <template #status="{ row }">
                         {{ row.status === 1 ? '启用中' : '已停用' }}
                     </template>
-                    <template #isCalibration="{row}">
+                    <template #isCalibration="{ row }">
                         {{ row.isCalibration === 1 ? '是' : '否' }}
                     </template>
                 </HcTable>
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
         <!-- 新增/编辑 节点 -->
-        <HcDialog :loading="addEditNodeFormLoading" :show="addEditNodeFormModal" :title="`${addEditNodeFormModel.id ? '编辑' : '新增'}分类`"
-                  widths="30rem" @close="addEditNodeFormModalClose" @save="addEditNodeFormModalSave">
-            <el-form ref="addEditNodeFormRef" :model="addEditNodeFormModel" :rules="addEditNodeFormRules"
-                     label-position="top" label-width="auto" size="large">
+        <HcDialog
+            :loading="addEditNodeFormLoading" :show="addEditNodeFormModal" :title="`${addEditNodeFormModel.id ? '编辑' : '新增'}分类`"
+            widths="30rem" @close="addEditNodeFormModalClose" @save="addEditNodeFormModalSave"
+        >
+            <el-form
+                ref="addEditNodeFormRef" :model="addEditNodeFormModel" :rules="addEditNodeFormRules"
+                label-position="top" label-width="auto" size="large"
+            >
                 <el-form-item class="mb-0" label="分类名称" prop="className">
-                    <el-input v-model="addEditNodeFormModel.className" placeholder="请输入分类名称"/>
+                    <el-input v-model="addEditNodeFormModel.className" placeholder="请输入分类名称" />
                 </el-form-item>
             </el-form>
         </HcDialog>
 
         <!-- 新增/编辑 -->
-        <HcDialog :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id ? '编辑' : '新增'}设备信息`"
-                  widths="50rem" @close="addEditFormModalClose" @save="addEditFormClick">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <HcDialog
+            :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id ? '编辑' : '新增'}设备信息`"
+            widths="50rem" @close="addEditFormModalClose" @save="addEditFormClick"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <div class="hc-form-item">
                     <el-form-item label="设备名称" prop="deviceName">
-                        <el-input v-model="addEditFormModel.deviceName"/>
+                        <el-input v-model="addEditFormModel.deviceName" />
                     </el-form-item>
                     <el-form-item label="进场日期">
-                        <el-date-picker v-model="addEditFormModel.mobilizationDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.mobilizationDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备分类" prop="deviceClassId">
                         <el-select v-model="addEditFormModel.deviceClassId" block>
-                            <el-option v-for="item in typeData" :key="item.id" :label="item.className" :value="item.id"/>
+                            <el-option v-for="item in typeData" :key="item.id" :label="item.className" :value="item.id" />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="测量范围">
-                        <el-input v-model="addEditFormModel.measuringRange"/>
+                        <el-input v-model="addEditFormModel.measuringRange" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备编号" prop="deviceNumber">
-                        <el-input v-model="addEditFormModel.deviceNumber"/>
+                        <el-input v-model="addEditFormModel.deviceNumber" />
                     </el-form-item>
                     <el-form-item label="精准度">
-                        <el-input v-model="addEditFormModel.accuracy"/>
+                        <el-input v-model="addEditFormModel.accuracy" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备型号">
-                        <el-input v-model="addEditFormModel.deviceModel"/>
+                        <el-input v-model="addEditFormModel.deviceModel" />
                     </el-form-item>
                     <el-form-item label="效验周期">
-                        <HcCounter v-model="addEditFormModel.calibrationCycle" block size="large" text="(月)"/>
+                        <HcCounter v-model="addEditFormModel.calibrationCycle" block size="large" text="(月)" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="生产厂家">
-                        <el-input v-model="addEditFormModel.manufacturer"/>
+                        <el-input v-model="addEditFormModel.manufacturer" />
                     </el-form-item>
                     <el-form-item label="最近效验时间">
-                        <el-date-picker v-model="addEditFormModel.lastCalibrationTime" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.lastCalibrationTime" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="出厂日期">
-                        <el-date-picker v-model="addEditFormModel.factoryDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.factoryDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="状态">
                         <el-select v-model="addEditFormModel.status" block placeholder="状态">
-                            <el-option :value="1" label="启用中"/>
-                            <el-option :value="0" label="已停用"/>
+                            <el-option :value="1" label="启用中" />
+                            <el-option :value="0" label="已停用" />
                         </el-select>
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="出厂编号">
-                        <el-input v-model="addEditFormModel.factoryNumber"/>
+                        <el-input v-model="addEditFormModel.factoryNumber" />
                     </el-form-item>
                     <el-form-item label="管理人员">
-                        <hcAutoComplete v-model="addEditFormModel.managerName" :datas="userListData" keys="userName"
-                                        placeholder="请选择或输入试验人员名称"/>
+                        <hcAutoComplete
+                            v-model="addEditFormModel.managerName" :datas="userListData" keys="userName"
+                            placeholder="请选择或输入试验人员名称"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备采集编号">
-                        <el-input v-model="addEditFormModel.equipmentAcquisitionNumber"/>
+                        <el-input v-model="addEditFormModel.equipmentAcquisitionNumber" />
                     </el-form-item>
                     <el-form-item label="是否需要效验">
                         <el-select v-model="addEditFormModel.isCalibration" block disabled>
-                            <el-option :value="1" label="是"/>
-                            <el-option :value="0" label="否"/>
+                            <el-option :value="1" label="是" />
+                            <el-option :value="0" label="否" />
                         </el-select>
                     </el-form-item>
                 </div>
                 <el-form-item label="备注">
-                    <el-input v-model="addEditFormModel.remarks" :autosize="{ minRows: 3}" placeholder="备注"
-                              type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.remarks" :autosize="{ minRows: 3 }" placeholder="备注"
+                        type="textarea"
+                    />
                 </el-form-item>
             </el-form>
         </HcDialog>
 
-        <!--导入-->
-        <HcDialog :loading="importModalLoading" :show="importModal" isFooterCenter isTable title="导入设备数据"
-                  widths="70rem" @close="importModalClose" @save="importModalYesClick">
+        <!-- 导入 -->
+        <HcDialog
+            :loading="importModalLoading" :show="importModal" is-footer-center is-table title="导入设备数据"
+            widths="70rem" @close="importModalClose" @save="importModalYesClick"
+        >
             <div class="text-orange mb-6">
                 <span>请先下载模板模板表格 (</span>
                 <span class="text-link" @click="downloadImportClick">范例试验设备文件</span>
                 <span>) ,按模板样式编辑试验容器后,在点击“选择文件”按钮选择编辑好的文件,点击确认即可导入成功!</span>
             </div>
 
-            <HcDragUpload action="mobilization/read-excel" @finished="uploadFinished" @progress="uploadprogress"/>
+            <HcDragUpload action="mobilization/read-excel" @finished="uploadFinished" @progress="uploadprogress" />
 
             <div class="hc-import-modal-table-box">
-                <HcTable ref="tableImportRef" :column="tableColumn" :datas="tableImportData"
-                         :loading="tableImportLoading" isCheck @selection-change="tableImportSelection">
+                <HcTable
+                    ref="tableImportRef" :column="tableColumn" :datas="tableImportData"
+                    :loading="tableImportLoading" is-check @selection-change="tableImportSelection"
+                >
                     <template #status="{ row }">
                         {{ row.status === 1 ? '启用中' : '已停用' }}
                     </template>
@@ -219,29 +249,29 @@
                 </HcTable>
             </div>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {ref, onMounted, watch} from "vue";
-import {useAppStore} from "~src/store";
-import {HcIsButton} from "~src/plugins/IsButtons";
-import HcDragUpload from "./components/HcDragUpload.vue"
-import approachApi from "~api/tentative/device/approach";
-import {formValidate, getArrValue} from "js-fast-way"
-import {getContractUserList} from "~api/other";
-import {getClassList, deviceClassListInit} from "~api/tentative";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import { HcIsButton } from '~src/plugins/IsButtons'
+import HcDragUpload from './components/HcDragUpload.vue'
+import approachApi from '~api/tentative/device/approach'
+import { formValidate, getArrValue } from 'js-fast-way'
+import { getContractUserList } from '~api/other'
+import { deviceClassListInit, getClassList } from '~api/tentative'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -258,8 +288,8 @@ onMounted(() => {
 //获取用户列表
 const userListData = ref([])
 const getUserListData = async () => {
-    const {data} = await getContractUserList({
-        contractId: contractId.value
+    const { data } = await getContractUserList({
+        contractId: contractId.value,
     })
     userListData.value = getArrValue(data)
 }
@@ -269,23 +299,23 @@ const menuKey = ref('0')
 const menuItem = ref({})
 const menusProps = ref({
     key: 'id',
-    label: 'className'
+    label: 'className',
 })
 //获取菜单数据
-const menus = ref([]);
-const typeData = ref([]);
+const menus = ref([])
+const typeData = ref([])
 const getClassListData = async () => {
-    const {data} = await getClassList({
-        contractId: contractId.value
+    const { data } = await getClassList({
+        contractId: contractId.value,
     })
     const arr = getArrValue(data)
     typeData.value = arr
-    menus.value = [{id: '0', className: '全部', isNoContextMenu: true}, ...arr]
+    menus.value = [{ id: '0', className: '全部', isNoContextMenu: true }, ...arr]
 }
 //初始化设备分类
 const deviceClassListInitdata = async () => {
-    const {data} = await deviceClassListInit({
-        contractId: contractId.value
+    const { data } = await deviceClassListInit({
+        contractId: contractId.value,
     })
 }
 
@@ -294,25 +324,25 @@ const menuChange = (item) => {
     menuItem.value = item
     menuKey.value = item?.id
     searchForm.value.deviceClassId = item?.id
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //菜单的右键菜单
 const contextMenu = ref([])
 const setContextMenu = () => {
-    let newArr = [];
+    let newArr = []
     if (HcIsButton('tentative_device_approach_menu_edit')) {
-        newArr.push({icon: 'draft', label: '编辑分类', key: "edit"})
+        newArr.push({ icon: 'draft', label: '编辑分类', key: 'edit' })
     }
     if (HcIsButton('tentative_device_approach_menu_del')) {
-        newArr.push({icon: 'delete-bin', label: '删除分类', key: "del"})
+        newArr.push({ icon: 'delete-bin', label: '删除分类', key: 'del' })
     }
     contextMenu.value = newArr
 }
 
 //菜单的右键菜单被点击
-const contextMenuClick = ({key, item}) => {
+const contextMenuClick = ({ key, item }) => {
     if (key === 'edit') {
         addEditNodeFormModel.value = item
         addEditNodeFormModal.value = true
@@ -324,12 +354,12 @@ const contextMenuClick = ({key, item}) => {
 //搜索表单
 const searchForm = ref({
     deviceClassId: '', isCalibration: null, status: null, startTime: null, endTime: null, queryValue: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr}) => {
+const betweenTimeUpdate = ({ arr }) => {
     betweenTime.value = arr
     if (arr.length > 0) {
         searchForm.value.startTime = arr[0]
@@ -343,21 +373,21 @@ const betweenTimeUpdate = ({arr}) => {
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
-    console.log(searchForm.value, '  searchForm.value');
+    searchForm.value.current = 1
+    console.log(searchForm.value, '  searchForm.value')
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -366,32 +396,32 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'deviceName', name: '设备名称', width: '200'},
-    {key: 'deviceClassName', name: '设备分类', width: '160'},
-    {key: 'deviceNumber', name: '设备编号', width: '160'},
-    {key: 'deviceModel', name: '设备型号', width: '180'},
-    {key: 'manufacturer', name: '生产厂家', width: '200'},
-    {key: 'factoryDate', name: '出厂日期', width: '160'},
-    {key: 'factoryNumber', name: '出厂编号', width: '160'},
-    {key: 'mobilizationDate', name: '进场日期', width: '160'},
-    {key: 'measuringRange', name: '测量范围', width: '120'},
-    {key: 'accuracy', name: '精准度', width: '120'},
-    {key: 'calibrationCycle', name: '校准周期(月)', width: '120'},
-    {key: 'lastCalibrationTime', name: '最近效验时间', width: '160'},
-    {key: 'status', name: '状态', width: '100'},
-    {key: 'isCalibration', name: '是否需要效验', width: '120'},
-    {key: 'equipmentAcquisitionNumber', name: '设备采集编号', width: '160'},
-    {key: 'managerName', name: '设备管理人员', width: '120'},
-    {key: 'remarks', name: '备注', width: '160'},
+    { key: 'deviceName', name: '设备名称', width: '200' },
+    { key: 'deviceClassName', name: '设备分类', width: '160' },
+    { key: 'deviceNumber', name: '设备编号', width: '160' },
+    { key: 'deviceModel', name: '设备型号', width: '180' },
+    { key: 'manufacturer', name: '生产厂家', width: '200' },
+    { key: 'factoryDate', name: '出厂日期', width: '160' },
+    { key: 'factoryNumber', name: '出厂编号', width: '160' },
+    { key: 'mobilizationDate', name: '进场日期', width: '160' },
+    { key: 'measuringRange', name: '测量范围', width: '120' },
+    { key: 'accuracy', name: '精准度', width: '120' },
+    { key: 'calibrationCycle', name: '校准周期(月)', width: '120' },
+    { key: 'lastCalibrationTime', name: '最近效验时间', width: '160' },
+    { key: 'status', name: '状态', width: '100' },
+    { key: 'isCalibration', name: '是否需要效验', width: '120' },
+    { key: 'equipmentAcquisitionNumber', name: '设备采集编号', width: '160' },
+    { key: 'managerName', name: '设备管理人员', width: '120' },
+    { key: 'remarks', name: '备注', width: '160' },
 ])
 const tableData = ref([])
 
 //获取数据
 const tableLoading = ref(false)
 const getTableData = async () => {
-    console.log(searchForm.value, '  searchForm.value');
+    console.log(searchForm.value, '  searchForm.value')
     tableLoading.value = true
-    const {error, code, data} = await approachApi.queryPage({
+    const { error, code, data } = await approachApi.queryPage({
         projectId: projectId.value,
         contractId: contractId.value,
         ...searchForm.value,
@@ -408,7 +438,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -419,13 +449,13 @@ const addEditNodeFormModal = ref(false)
 
 //分类表单
 const addEditNodeFormModel = ref({
-    className: ''
+    className: '',
 })
 const addEditNodeFormRules = {
     className: {
         required: true,
         trigger: 'blur',
-        message: "请输入分类名称"
+        message: '请输入分类名称',
     },
 }
 
@@ -441,10 +471,10 @@ const addEditNodeFormModalSave = async () => {
     const validate = await formValidate(addEditNodeFormRef.value)
     if (validate) {
         addEditNodeFormLoading.value = true
-        const {error, code} = await approachApi.getClassSubmit({
+        const { error, code } = await approachApi.getClassSubmit({
             ...addEditNodeFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
         // addEditNodeFormLoading.value = false
@@ -464,25 +494,24 @@ const addEditNodeFormModalClose = () => {
 
 //删除分类
 const delNodeModalClick = (id) => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 setClassRemove(id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
-    })
+     })
 }
 
 //删除分类
 const setClassRemove = async (id) => {
-    const {error, code} = await approachApi.setClassRemove({
+    const { error, code } = await approachApi.setClassRemove({
         projectId: projectId.value,
         contractId: contractId.value,
-        id: id
+        id: id,
     })
     //处理数据
     if (!error && code === 200) {
@@ -493,17 +522,16 @@ const setClassRemove = async (id) => {
 
 //删除表格数据
 const delTableModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
-    })
+     })
 }
 
 //批量删除
@@ -512,7 +540,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await approachApi.removeData({
+        const { error, code } = await approachApi.removeData({
             contractId: contractId.value,
             ids: ids,
         })
@@ -533,7 +561,7 @@ const printerClick = async () => {
         printerLoading.value = true
         const ids = arrToId(rows)
         //删除请求
-        const {error, code, data} = await approachApi.exportPdf({
+        const { error, code, data } = await approachApi.exportPdf({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -579,10 +607,10 @@ const importModalYesClick = () => {
 //导入数据保存
 const samplingRecord = async (keys) => {
     importModalLoading.value = true
-    const {error, code} = await approachApi.samplingRecord({
+    const { error, code } = await approachApi.samplingRecord({
         projectId: projectId.value,
         contractId: contractId.value,
-        list: keys
+        list: keys,
     })
     //处理数据
     importModalLoading.value = false
@@ -605,7 +633,7 @@ const tableImportLoading = ref(false)
 const tableImportData = ref([])
 
 //多选
-const tableImportKeys = ref([]);
+const tableImportKeys = ref([])
 const tableImportSelection = (rows) => {
     tableImportKeys.value = rows
 }
@@ -618,17 +646,17 @@ const addEditFormRules = {
     deviceName: {
         required: true,
         trigger: 'blur',
-        message: "请输入设备名称"
+        message: '请输入设备名称',
     },
     deviceClassId: {
         required: true,
         trigger: 'blur',
-        message: "请选择设备分类"
+        message: '请选择设备分类',
     },
     deviceNumber: {
         required: true,
         trigger: 'blur',
-        message: "请输入设备编号"
+        message: '请输入设备编号',
     },
 }
 
@@ -658,7 +686,7 @@ const addEditFormModalClose = () => {
     addEditFormModal.value = false
     addEditFormModel.value = {
         isCalibration: 0,
-        status: 1
+        status: 1,
     }
 }
 
@@ -668,10 +696,10 @@ const addEditFormClick = async () => {
     const validate = await formValidate(addEditFormRef.value)
     if (validate) {
         addEditFormLoading.value = true
-        const {error, code} = await approachApi.submitForm({
+        const { error, code } = await approachApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
         // addEditFormLoading.value = false
@@ -691,18 +719,18 @@ const downloadImportClick = () => {
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(240);
+const leftWidth = ref(240)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 220 && diffVal <= 400) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 172 - 135
src/views/tentative/device/employ.vue

@@ -1,189 +1,227 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box menu">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box menu">
             <div class="hc-menu-header-box">
                 <div class="text-xl name">设备分类 - 使用记录</div>
             </div>
             <div class="hc-menu-contents-box">
                 <el-scrollbar>
-                    <HcMenuSimple :datas="menus" :keys="menuKey" :props="menusProps" @change="menuChange"/>
+                    <HcMenuSimple :datas="menus" :keys="menuKey" :props="menusProps" @change="menuChange" />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
             <HcCard>
                 <template #header>
                     <HcTooltip keys="tentative_device_employ_add">
                         <el-button hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_employ_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_employ_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delNodeModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_employ_printer">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
-                                   @click="printerClick">
-                            <HcIcon name="printer"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
+                            @click="printerClick"
+                        >
+                            <HcIcon name="printer" />
                             <span>打印</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_employ_import">
                         <el-button hc-btn @click="importModalClick">
-                            <HcIcon name="folder-upload"/>
+                            <HcIcon name="folder-upload" />
                             <span>导入</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #search>
                     <div class="w-64">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-72 ml-2">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入设备名称\设备型号查询"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入设备名称\设备型号查询"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection"/>
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                />
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增/编辑-->
-        <HcDialog :loading="addEditFormLoading" :show="addEditFormModal" title="新增/编辑 设备使用信息" widths="50rem"
-                  @close="addEditFormModalClose" @save="addEditFormClick">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :loading="addEditFormLoading" :show="addEditFormModal" title="新增/编辑 设备使用信息" widths="50rem"
+            @close="addEditFormModalClose" @save="addEditFormClick"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <div class="hc-form-item">
                     <el-form-item label="设备分类">
-                        <el-select v-model="addEditFormModel.deviceClassId" :disabled="deviceFormLoading" block
-                                   @change="deviceClassIdChange">
-                            <el-option v-for="item in typeData" :label="item.className" :value="item.id"/>
+                        <el-select
+                            v-model="addEditFormModel.deviceClassId" :disabled="deviceFormLoading" block
+                            @change="deviceClassIdChange"
+                        >
+                            <el-option v-for="item in typeData" :label="item.className" :value="item.id" />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="检测项目">
-                        <HcSelectTree v-model="addEditFormModel.nodeId" :contractId="contractId"
-                                      :projectId="projectId" :title="addEditFormModel.nodeName"
-                                      :wbsId="projectInfo?.referenceWbsTemplateIdTrial" @change="HcSelectTreeChange"/>
+                        <HcSelectTree
+                            v-model="addEditFormModel.nodeId" :contract-id="contractId"
+                            :project-id="projectId" :title="addEditFormModel.nodeName"
+                            :wbs-id="projectInfo?.referenceWbsTemplateIdTrial" @change="HcSelectTreeChange"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备编号" prop="deviceNumber">
-                        <el-select v-model="addEditFormModel.deviceNumber" :disabled="deviceFormLoading" block
-                                   @change="deviceNumberChange">
-                            <el-option v-for="item in deviceFormSelectData" :label="item.deviceNumber"
-                                       :value="item.deviceNumber"/>
+                        <el-select
+                            v-model="addEditFormModel.deviceNumber" :disabled="deviceFormLoading" block
+                            @change="deviceNumberChange"
+                        >
+                            <el-option
+                                v-for="item in deviceFormSelectData" :label="item.deviceNumber"
+                                :value="item.deviceNumber"
+                            />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="样品名称">
-                        <hcAutoComplete v-model="addEditFormModel.materialName" :datas="nodeMaterialSelectData"
-                                        keys="materialName" placeholder="请选择或输入样品名称"/>
+                        <hcAutoComplete
+                            v-model="addEditFormModel.materialName" :datas="nodeMaterialSelectData"
+                            keys="materialName" placeholder="请选择或输入样品名称"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备名称">
-                        <el-select v-model="addEditFormModel.deviceName" :disabled="deviceFormLoading" block
-                                   @change="deviceNameChange">
-                            <el-option v-for="item in deviceFormSelectData" :label="item.deviceName"
-                                       :value="item.deviceName"/>
+                        <el-select
+                            v-model="addEditFormModel.deviceName" :disabled="deviceFormLoading" block
+                            @change="deviceNameChange"
+                        >
+                            <el-option
+                                v-for="item in deviceFormSelectData" :label="item.deviceName"
+                                :value="item.deviceName"
+                            />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="样品编号">
-                        <hcAutoComplete v-model="addEditFormModel.specificationNumber" :datas="nodeMaterialSelectData"
-                                        keys="specificationNumber" placeholder="请选择或输入样品编号"/>
+                        <hcAutoComplete
+                            v-model="addEditFormModel.specificationNumber" :datas="nodeMaterialSelectData"
+                            keys="specificationNumber" placeholder="请选择或输入样品编号"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="使用日期(起)" prop="startDate">
-                        <el-date-picker v-model="addEditFormModel.startDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.startDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="使用日期(止)" prop="endDate">
-                        <el-date-picker v-model="addEditFormModel.endDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.endDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="使用人员">
-                        <hcAutoComplete v-model="addEditFormModel.managerName" :datas="userListData" keys="userName"
-                                        placeholder="请选择或输入使用人员名称"/>
+                        <hcAutoComplete
+                            v-model="addEditFormModel.managerName" :datas="userListData" keys="userName"
+                            placeholder="请选择或输入使用人员名称"
+                        />
                     </el-form-item>
-                    <el-form-item/>
+                    <el-form-item />
                 </div>
                 <el-form-item label="备注">
-                    <el-input v-model="addEditFormModel.remarks" :autosize="{ minRows: 3}" placeholder="备注"
-                              type="textarea"/>
+                    <el-input
+                        v-model="addEditFormModel.remarks" :autosize="{ minRows: 3 }" placeholder="备注"
+                        type="textarea"
+                    />
                 </el-form-item>
             </el-form>
         </HcDialog>
 
-        <!--导入-->
-        <HcDialog :loading="importModalLoading" :show="importModal" isFooterCenter isTable title="导入设备使用数据"
-                  widths="70rem" @close="importModalClose" @save="importModalYesClick">
+        <!-- 导入 -->
+        <HcDialog
+            :loading="importModalLoading" :show="importModal" is-footer-center is-table title="导入设备使用数据"
+            widths="70rem" @close="importModalClose" @save="importModalYesClick"
+        >
             <div class="text-orange mb-6">
                 <span>请先下载模板模板表格 (</span>
                 <span class="text-link" @click="downloadImportClick">范例试验设备文件</span>
                 <span>) ,按模板样式编辑试验容器后,在点击“选择文件”按钮选择编辑好的文件,点击确认即可导入成功!</span>
             </div>
-            <HcDragUpload action="use/read-excel" @finished="uploadFinished" @progress="uploadprogress"/>
+            <HcDragUpload action="use/read-excel" @finished="uploadFinished" @progress="uploadprogress" />
             <div class="hc-import-modal-table-box">
-                <HcTable ref="tableImportRef" :column="tableColumn" :datas="tableImportData"
-                         :loading="tableImportLoading" isCheck @selection-change="tableImportSelection">
-                    <template #status="{row}">
+                <HcTable
+                    ref="tableImportRef" :column="tableColumn" :datas="tableImportData"
+                    :loading="tableImportLoading" is-check @selection-change="tableImportSelection"
+                >
+                    <template #status="{ row }">
                         {{ row.status == 1 ? '启用中' : '已停用' }}
                     </template>
-                    <template #isCalibration="{row}">
+                    <template #isCalibration="{ row }">
                         {{ row.isCalibration == 1 ? '是' : '否' }}
                     </template>
                 </HcTable>
             </div>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {ref, onMounted, watch} from "vue";
-import {useAppStore} from "~src/store";
-import HcDragUpload from "./components/HcDragUpload.vue"
-import HcSelectTree from "./components/HcSelectTree.vue"
-import {getClassList, deviceClassListInit, queryDeviceList, querySampleList, getSampleInfo} from "~api/tentative";
-import {getContractUserList} from "~api/other";
-import dataApi from "~api/tentative/device/employ";
-import {formValidate, getArrValue, getObjValue, arrToId} from "js-fast-way"
-import {getRowsValue} from "~uti/tools";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import HcDragUpload from './components/HcDragUpload.vue'
+import HcSelectTree from './components/HcSelectTree.vue'
+import { deviceClassListInit, getClassList, getSampleInfo, queryDeviceList, querySampleList } from '~api/tentative'
+import { getContractUserList } from '~api/other'
+import dataApi from '~api/tentative/device/employ'
+import { arrToId, formValidate, getArrValue, getObjValue } from 'js-fast-way'
+import { getRowsValue } from '~uti/tools'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -200,8 +238,8 @@ onMounted(() => {
 //获取用户列表
 const userListData = ref([])
 const getUserListData = async () => {
-    const {data} = await getContractUserList({
-        contractId: contractId.value
+    const { data } = await getContractUserList({
+        contractId: contractId.value,
     })
     userListData.value = getArrValue(data)
 }
@@ -211,23 +249,23 @@ const menuKey = ref('0')
 const menuItem = ref({})
 const menusProps = ref({
     key: 'id',
-    label: 'className'
+    label: 'className',
 })
 //获取菜单数据
-const menus = ref([]);
-const typeData = ref([]);
+const menus = ref([])
+const typeData = ref([])
 const getClassListData = async () => {
-    const {data} = await getClassList({
-        contractId: contractId.value
+    const { data } = await getClassList({
+        contractId: contractId.value,
     })
     const arr = getArrValue(data)
     typeData.value = arr
-    menus.value = [{id: '0', className: '全部', isNoContextMenu: true}, ...arr]
+    menus.value = [{ id: '0', className: '全部', isNoContextMenu: true }, ...arr]
 }
 //初始化设备分类
 const deviceClassListInitdata = async () => {
-    const {data} = await deviceClassListInit({
-        contractId: contractId.value
+    const { data } = await deviceClassListInit({
+        contractId: contractId.value,
     })
 }
 //菜单被点击
@@ -235,19 +273,19 @@ const menuChange = (item) => {
     menuItem.value = item
     menuKey.value = item?.id
     searchForm.value.deviceClassId = item?.id
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //搜索表单
 const searchForm = ref({
     deviceClassId: '', startTime: null, endTime: null, queryValue: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr}) => {
+const betweenTimeUpdate = ({ arr }) => {
     betweenTime.value = arr
     if (arr.length > 0) {
         searchForm.value.startTime = arr[0]
@@ -260,20 +298,20 @@ const betweenTimeUpdate = ({arr}) => {
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -283,18 +321,18 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'deviceName', name: '设备名称'},
-    {key: 'deviceClassName', name: '设备分类'},
-    {key: 'deviceNumber', name: '设备编号'},
-    {key: 'deviceModel', name: '设备型号'},
-    {key: 'factoryNumber', name: '出厂编号'},
-    {key: 'startDate', name: '使用日期(起)'},
-    {key: 'endDate', name: '使用日期(止)'},
-    {key: 'nodeName', name: '检测试验项目'},
-    {key: 'specificationNumber', name: '样品编号'},
-    {key: 'materialName', name: '样品名称'},
-    {key: 'managerName', name: '使用人'},
-    {key: 'remarks', name: '备注'},
+    { key: 'deviceName', name: '设备名称' },
+    { key: 'deviceClassName', name: '设备分类' },
+    { key: 'deviceNumber', name: '设备编号' },
+    { key: 'deviceModel', name: '设备型号' },
+    { key: 'factoryNumber', name: '出厂编号' },
+    { key: 'startDate', name: '使用日期(起)' },
+    { key: 'endDate', name: '使用日期(止)' },
+    { key: 'nodeName', name: '检测试验项目' },
+    { key: 'specificationNumber', name: '样品编号' },
+    { key: 'materialName', name: '样品名称' },
+    { key: 'managerName', name: '使用人' },
+    { key: 'remarks', name: '备注' },
 ])
 const tableData = ref([])
 
@@ -302,7 +340,7 @@ const tableData = ref([])
 const tableLoading = ref(false)
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         projectId: projectId.value,
         contractId: contractId.value,
         ...searchForm.value,
@@ -319,24 +357,23 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
 
 //删除
 const delNodeModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
-    })
+     })
 }
 
 //批量删除
@@ -345,7 +382,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             contractId: contractId.value,
             ids: ids,
         })
@@ -365,7 +402,7 @@ const printerClick = async () => {
         printerLoading.value = true
         const ids = arrToId(rows)
         //删除请求
-        const {error, code, data} = await dataApi.exportPdf({
+        const { error, code, data } = await dataApi.exportPdf({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -410,10 +447,10 @@ const importModalYesClick = () => {
 //导入数据保存
 const samplingRecord = async (keys) => {
     importModalLoading.value = true
-    const {error, code} = await dataApi.samplingRecord({
+    const { error, code } = await dataApi.samplingRecord({
         projectId: projectId.value,
         contractId: contractId.value,
-        list: keys
+        list: keys,
     })
     //处理数据
     importModalLoading.value = false
@@ -437,7 +474,7 @@ const tableImportLoading = ref(false)
 const tableImportData = ref([])
 
 //多选
-const tableImportKeys = ref([]);
+const tableImportKeys = ref([])
 const tableImportSelection = (rows) => {
     tableImportKeys.value = rows
 }
@@ -490,7 +527,7 @@ const addEditFormRules = {
                 callback()
             }
         },
-        trigger: "blur",
+        trigger: 'blur',
     },
     endDate: {
         required: false,
@@ -502,13 +539,13 @@ const addEditFormRules = {
                 callback()
             }
         },
-        trigger: "blur",
+        trigger: 'blur',
     },
     deviceNumber: {
         required: true,
         trigger: 'blur',
-        message: "请选择设备编号"
-    }
+        message: '请选择设备编号',
+    },
 }
 
 //分类被选择
@@ -516,10 +553,10 @@ const deviceFormLoading = ref(false)
 const deviceFormSelectData = ref([])
 const deviceClassIdChange = async (val) => {
     deviceFormLoading.value = true
-    const {data} = await queryDeviceList({
+    const { data } = await queryDeviceList({
         projectId: projectId.value,
         contractId: contractId.value,
-        deviceClassId: val
+        deviceClassId: val,
     })
     //处理数据
     const records = getArrValue(data)
@@ -533,7 +570,7 @@ const deviceClassIdChange = async (val) => {
         addEditFormModel.value.deviceName = ''
         addEditFormModel.value.deviceInfoId = ''
     }
-    deviceFormLoading.value = false;
+    deviceFormLoading.value = false
 }
 //设备编号
 const deviceNumberChange = (val) => {
@@ -547,7 +584,7 @@ const deviceNameChange = (val) => {
 }
 
 //检测项目被选择
-const HcSelectTreeChange = ({title, primaryKeyId}) => {
+const HcSelectTreeChange = ({ title, primaryKeyId }) => {
     addEditFormModel.value.nodeName = title
     addEditFormModel.value.nodeId = primaryKeyId
     nodeMaterialChange(primaryKeyId)
@@ -563,8 +600,8 @@ const nodeMaterialChange = async (val) => {
     //     contractId: contractId.value,
     //     nodeId: val
     // })
-    const {data} = await getSampleInfo({
-        primaryKeyId: val
+    const { data } = await getSampleInfo({
+        primaryKeyId: val,
     })
     //处理数据
     if (data) {
@@ -574,23 +611,23 @@ const nodeMaterialChange = async (val) => {
         addEditFormModel.value.specificationNumber = ''
         addEditFormModel.value.materialName = ''
     }
-    nodeMaterialLoading.value = false;
+    nodeMaterialLoading.value = false
 }
 
 
 //新增/编辑 保存
 const addEditFormLoading = ref(false)
 const addEditFormClick = async () => {
-    console.log('提交');
+    console.log('提交')
     const validate = await formValidate(addEditFormRef.value)
     // console.log(validate,'validate');
 
     if (validate) {
         addEditFormLoading.value = true
-        const {error, code} = await dataApi.submitForm({
+        const { error, code } = await dataApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -610,18 +647,18 @@ const downloadImportClick = () => {
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(240);
+const leftWidth = ref(240)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 220 && diffVal <= 400) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 139 - 111
src/views/tentative/device/overhaul.vue

@@ -1,161 +1,190 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box menu">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box menu">
             <div class="hc-menu-header-box">
                 <div class="text-xl name">设备分类 - 检修记录</div>
             </div>
             <div class="hc-menu-contents-box">
                 <el-scrollbar>
-                    <HcMenuSimple :datas="menus" :keys="menuKey" :props="menusProps" @change="menuChange"/>
+                    <HcMenuSimple :datas="menus" :keys="menuKey" :props="menusProps" @change="menuChange" />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
             <HcCard>
                 <template #header>
                     <HcTooltip keys="tentative_device_overhaul_add">
                         <el-button hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_overhaul_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_overhaul_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delNodeModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_overhaul_printer">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
-                                   @click="printerClick">
-                            <HcIcon name="printer"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
+                            @click="printerClick"
+                        >
+                            <HcIcon name="printer" />
                             <span>打印</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_device_overhaul_import">
                         <el-button hc-btn @click="importModalClick">
-                            <HcIcon name="folder-upload"/>
+                            <HcIcon name="folder-upload" />
                             <span>导入</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #search>
                     <div class="w-64">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-72 ml-2">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入设备名称\设备型号查询"
-                                  @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入设备名称\设备型号查询"
+                            @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection"/>
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                />
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增/编辑-->
-        <HcDialog :loading="addEditFormLoading" :show="addEditFormModal" title="新增/编辑 设备检修信息" widths="50rem"
-                  @close="addEditFormModalClose" @save="addEditFormClick">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :loading="addEditFormLoading" :show="addEditFormModal" title="新增/编辑 设备检修信息" widths="50rem"
+            @close="addEditFormModalClose" @save="addEditFormClick"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <div class="hc-form-item">
                     <el-form-item label="设备分类">
-                        <el-select v-model="addEditFormModel.deviceClassId" :disabled="deviceFormLoading" block
-                                   @change="deviceClassIdChange">
-                            <el-option v-for="item in typeData" :label="item.className" :value="item.id"/>
+                        <el-select
+                            v-model="addEditFormModel.deviceClassId" :disabled="deviceFormLoading" block
+                            @change="deviceClassIdChange"
+                        >
+                            <el-option v-for="item in typeData" :label="item.className" :value="item.id" />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="维修/检定日期">
-                        <el-date-picker v-model="addEditFormModel.overhaulDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.overhaulDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备编号">
-                        <el-select v-model="addEditFormModel.deviceNumber" :disabled="deviceFormLoading" block
-                                   @change="deviceNumberChange">
-                            <el-option v-for="item in deviceFormSelectData" :label="item.deviceNumber"
-                                       :value="item.deviceNumber"/>
+                        <el-select
+                            v-model="addEditFormModel.deviceNumber" :disabled="deviceFormLoading" block
+                            @change="deviceNumberChange"
+                        >
+                            <el-option
+                                v-for="item in deviceFormSelectData" :label="item.deviceNumber"
+                                :value="item.deviceNumber"
+                            />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="维修/检定人">
-                        <hcAutoComplete v-model="addEditFormModel.managerName" :datas="userListData" keys="userName"
-                                        placeholder="请选择或输入维修/检定人"/>
+                        <hcAutoComplete
+                            v-model="addEditFormModel.managerName" :datas="userListData" keys="userName"
+                            placeholder="请选择或输入维修/检定人"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="设备名称">
-                        <el-select v-model="addEditFormModel.deviceName" :disabled="deviceFormLoading" block
-                                   @change="deviceNameChange">
-                            <el-option v-for="item in deviceFormSelectData" :label="item.deviceName"
-                                       :value="item.deviceName"/>
+                        <el-select
+                            v-model="addEditFormModel.deviceName" :disabled="deviceFormLoading" block
+                            @change="deviceNameChange"
+                        >
+                            <el-option
+                                v-for="item in deviceFormSelectData" :label="item.deviceName"
+                                :value="item.deviceName"
+                            />
                         </el-select>
                     </el-form-item>
-                    <el-form-item/>
+                    <el-form-item />
                 </div>
                 <el-form-item label="维修/检定内容">
-                    <el-input v-model="addEditFormModel.overhaulText" :autosize="{ minRows: 3}" type="textarea"/>
+                    <el-input v-model="addEditFormModel.overhaulText" :autosize="{ minRows: 3 }" type="textarea" />
                 </el-form-item>
                 <el-form-item label="备注">
-                    <el-input v-model="addEditFormModel.remarks" :autosize="{ minRows: 3}" type="textarea"/>
+                    <el-input v-model="addEditFormModel.remarks" :autosize="{ minRows: 3 }" type="textarea" />
                 </el-form-item>
             </el-form>
         </HcDialog>
 
-        <!--导入-->
-        <HcDialog :loading="importModalLoading" :show="importModal" isFooterCenter isTable title="导入设备检修数据"
-                  widths="70rem" @close="importModalClose" @save="importModalYesClick">
+        <!-- 导入 -->
+        <HcDialog
+            :loading="importModalLoading" :show="importModal" is-footer-center is-table title="导入设备检修数据"
+            widths="70rem" @close="importModalClose" @save="importModalYesClick"
+        >
             <div class="text-orange mb-6">
                 <span>请先下载模板模板表格 (</span>
                 <span class="text-link" @click="downloadImportClick">范例试验设备文件</span>
                 <span>) ,按模板样式编辑试验容器后,在点击“选择文件”按钮选择编辑好的文件,点击确认即可导入成功!</span>
             </div>
-            <HcDragUpload action="overhaul/read-excel" @finished="uploadFinished" @progress="uploadprogress"/>
+            <HcDragUpload action="overhaul/read-excel" @finished="uploadFinished" @progress="uploadprogress" />
             <div class="hc-import-modal-table-box">
-                <HcTable ref="tableImportRef" :column="tableColumn" :datas="tableImportData"
-                         :loading="tableImportLoading" isCheck @selection-change="tableImportSelection"/>
+                <HcTable
+                    ref="tableImportRef" :column="tableColumn" :datas="tableImportData"
+                    :loading="tableImportLoading" is-check @selection-change="tableImportSelection"
+                />
             </div>
         </HcDialog>
     </div>
 </template>
 
 <script setup>
-import {ref, onMounted, watch} from "vue";
-import {useAppStore} from "~src/store";
-import HcDragUpload from "./components/HcDragUpload.vue"
-import {getClassList, deviceClassListInit, queryDeviceList, querySampleList} from "~api/tentative";
-import {getContractUserList} from "~api/other";
-import {formValidate, getArrValue, arrToId} from "js-fast-way"
-import dataApi from "~api/tentative/device/overhaul";
-import {getRowsValue} from "~uti/tools";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import HcDragUpload from './components/HcDragUpload.vue'
+import { deviceClassListInit, getClassList, queryDeviceList, querySampleList } from '~api/tentative'
+import { getContractUserList } from '~api/other'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import dataApi from '~api/tentative/device/overhaul'
+import { getRowsValue } from '~uti/tools'
+import { delMessageV2 } from '~com/message/index.js'
 
 
 //初始变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -171,8 +200,8 @@ onMounted(() => {
 //获取用户列表
 const userListData = ref([])
 const getUserListData = async () => {
-    const {data} = await getContractUserList({
-        contractId: contractId.value
+    const { data } = await getContractUserList({
+        contractId: contractId.value,
     })
     userListData.value = getArrValue(data)
 }
@@ -182,23 +211,23 @@ const menuKey = ref('0')
 const menuItem = ref({})
 const menusProps = ref({
     key: 'id',
-    label: 'className'
+    label: 'className',
 })
 //获取菜单数据
-const menus = ref([]);
-const typeData = ref([]);
+const menus = ref([])
+const typeData = ref([])
 const getClassListData = async () => {
-    const {data} = await getClassList({
-        contractId: contractId.value
+    const { data } = await getClassList({
+        contractId: contractId.value,
     })
     const arr = getArrValue(data)
     typeData.value = arr
-    menus.value = [{id: '0', className: '全部', isNoContextMenu: true}, ...arr]
+    menus.value = [{ id: '0', className: '全部', isNoContextMenu: true }, ...arr]
 }
 //初始化设备分类
 const deviceClassListInitdata = async () => {
-    const {data} = await deviceClassListInit({
-        contractId: contractId.value
+    const { data } = await deviceClassListInit({
+        contractId: contractId.value,
     })
 }
 //菜单被点击
@@ -206,20 +235,20 @@ const menuChange = (item) => {
     menuItem.value = item
     menuKey.value = item?.id
     searchForm.value.deviceClassId = item?.id
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //搜索表单
 const searchForm = ref({
     deviceClassId: '', startTime: null, endTime: null, queryValue: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr}) => {
+const betweenTimeUpdate = ({ arr }) => {
     betweenTime.value = arr
     if (arr.length > 0) {
         searchForm.value.startTime = arr[0]
@@ -232,20 +261,20 @@ const betweenTimeUpdate = ({arr}) => {
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -254,15 +283,15 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'deviceName', name: '设备名称'},
-    {key: 'deviceClassName', name: '设备分类'},
-    {key: 'deviceNumber', name: '设备编号'},
-    {key: 'deviceModel', name: '设备型号'},
-    {key: 'factoryNumber', name: '出厂编号'},
-    {key: 'overhaulDate', name: '维修/检定日期'},
-    {key: 'overhaulText', name: '维修/检定内容'},
-    {key: 'managerName', name: '维修/检定人'},
-    {key: 'remarks', name: '备注'},
+    { key: 'deviceName', name: '设备名称' },
+    { key: 'deviceClassName', name: '设备分类' },
+    { key: 'deviceNumber', name: '设备编号' },
+    { key: 'deviceModel', name: '设备型号' },
+    { key: 'factoryNumber', name: '出厂编号' },
+    { key: 'overhaulDate', name: '维修/检定日期' },
+    { key: 'overhaulText', name: '维修/检定内容' },
+    { key: 'managerName', name: '维修/检定人' },
+    { key: 'remarks', name: '备注' },
 ])
 const tableLoading = ref(false)
 
@@ -270,7 +299,7 @@ const tableLoading = ref(false)
 const tableData = ref([])
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         projectId: projectId.value,
         contractId: contractId.value,
         ...searchForm.value,
@@ -287,24 +316,23 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
 
 //删除
 const delNodeModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
-    })
+     })
 }
 
 //批量删除
@@ -313,7 +341,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             contractId: contractId.value,
             ids: ids,
         })
@@ -333,7 +361,7 @@ const printerClick = async () => {
         printerLoading.value = true
         const ids = arrToId(rows)
         //删除请求
-        const {error, code, data} = await dataApi.exportPdf({
+        const { error, code, data } = await dataApi.exportPdf({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -381,10 +409,10 @@ const importModalYesClick = () => {
 //导入数据保存
 const samplingRecord = async (keys) => {
     importModalLoading.value = true
-    const {error, code} = await dataApi.samplingRecord({
+    const { error, code } = await dataApi.samplingRecord({
         projectId: projectId.value,
         contractId: contractId.value,
-        list: keys
+        list: keys,
     })
     //处理数据
     importModalLoading.value = false
@@ -407,7 +435,7 @@ const tableImportLoading = ref(false)
 const tableImportData = ref([])
 
 //多选
-const tableImportKeys = ref([]);
+const tableImportKeys = ref([])
 const tableImportSelection = (rows) => {
     tableImportKeys.value = rows
 }
@@ -442,12 +470,12 @@ const addEditFormRules = {
     key1: {
         required: true,
         trigger: 'blur',
-        message: "请输入"
+        message: '请输入',
     },
     key2: {
         required: true,
         trigger: 'blur',
-        message: "请选择"
+        message: '请选择',
     },
 }
 
@@ -456,10 +484,10 @@ const deviceFormLoading = ref(false)
 const deviceFormSelectData = ref([])
 const deviceClassIdChange = async (val) => {
     deviceFormLoading.value = true
-    const {data} = await queryDeviceList({
+    const { data } = await queryDeviceList({
         projectId: projectId.value,
         contractId: contractId.value,
-        deviceClassId: val
+        deviceClassId: val,
     })
     //处理数据
     const records = getArrValue(data)
@@ -473,7 +501,7 @@ const deviceClassIdChange = async (val) => {
         addEditFormModel.value.deviceName = ''
         addEditFormModel.value.deviceInfoId = ''
     }
-    deviceFormLoading.value = false;
+    deviceFormLoading.value = false
 }
 //设备编号
 const deviceNumberChange = (val) => {
@@ -492,10 +520,10 @@ const addEditFormClick = async () => {
     const validate = await formValidate(addEditFormRef.value)
     if (validate) {
         addEditFormLoading.value = true
-        const {error, code} = await dataApi.submitForm({
+        const { error, code } = await dataApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -515,18 +543,18 @@ const downloadImportClick = () => {
 
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(240);
+const leftWidth = ref(240)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 220 && diffVal <= 400) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 137 - 112
src/views/tentative/laboratory/user.vue

@@ -3,12 +3,14 @@
         <HcCard>
             <template #header>
                 <div class="w-72">
-                    <el-input v-model="searchForm.queryValue" clearable placeholder="请输入人员名称查询"
-                              size="large" @keyup="keyUpEvent"/>
+                    <el-input
+                        v-model="searchForm.queryValue" clearable placeholder="请输入人员名称查询"
+                        size="large" @keyup="keyUpEvent"
+                    />
                 </div>
                 <div class="ml-2">
-                    <el-button :disabled="tableData.length<1" size="large" type="primary" @click="searchClick">
-                        <HcIcon name="search-2"/>
+                    <el-button :disabled="tableData.length < 1" size="large" type="primary" @click="searchClick">
+                        <HcIcon name="search-2" />
                         <span>搜索</span>
                     </el-button>
                 </div>
@@ -16,185 +18,209 @@
             <template #extra>
                 <HcTooltip keys="tentative_laboratory_user_add">
                     <el-button hc-btn type="primary" @click="addFormModalClick">
-                        <HcIcon name="add-circle"/>
+                        <HcIcon name="add-circle" />
                         <span>新增</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="tentative_parameter_density_edit">
                     <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                        <HcIcon name="edit"/>
+                        <HcIcon name="edit" />
                         <span>编辑</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="tentative_laboratory_user_del">
                     <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delModalClick">
-                        <HcIcon name="delete-bin-2"/>
+                        <HcIcon name="delete-bin-2" />
                         <span>删除</span>
                     </el-button>
                 </HcTooltip>
             </template>
-            <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                     @selection-change="tableSelection">
-                <template #sex="{row}">
+            <HcTable
+                ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                @selection-change="tableSelection"
+            >
+                <template #sex="{ row }">
                     <span>{{ row.sex === 1 ? '男' : '女' }}</span>
                 </template>
-                <template #status="{row}">
+                <template #status="{ row }">
                     <span>{{ row.status === 1 ? '在职' : '离职' }}</span>
                 </template>
-                <template #education="{row}">
+                <template #education="{ row }">
                     <span>{{ arrKeyValue(educationData, 'dictKey', 'dictValue', row.education) }}</span>
                 </template>
             </HcTable>
             <template #action>
-                <HcPages :pages="searchForm" @change="pageChange"/>
+                <HcPages :pages="searchForm" @change="pageChange" />
             </template>
         </HcCard>
 
-        <!--新增/编辑-->
-        <HcDialog :isClose="false" :loading="addEditFormLoading" :show="addEditFormModal"
-                  :title="`${addEditFormModel.id?'编辑':'新增'}人员档案`" widths="70rem" @close="addEditFormModalClose"
-                  @save="addEditFormClick">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :is-close="false" :loading="addEditFormLoading" :show="addEditFormModal"
+            :title="`${addEditFormModel.id ? '编辑' : '新增'}人员档案`" widths="70rem" @close="addEditFormModalClose"
+            @save="addEditFormClick"
+        >
             <template #extra>
-                <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
+                <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" />
             </template>
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <template v-if="tabTypeKey === 'tab1'">
                     <div class="hc-form-item">
                         <el-form-item label="姓名" prop="name">
-                            <el-input v-model="addEditFormModel.name"/>
+                            <el-input v-model="addEditFormModel.name" />
                         </el-form-item>
                         <el-form-item label="身份证" prop="idCard">
-                            <el-input v-model="addEditFormModel.idCard"/>
+                            <el-input v-model="addEditFormModel.idCard" />
                         </el-form-item>
                         <el-form-item label="出生日期" prop="birthday">
-                            <el-date-picker v-model="addEditFormModel.birthday" :clearable="false" class="block"
-                                            type="date" value-format="YYYY-MM-DD"/>
+                            <el-date-picker
+                                v-model="addEditFormModel.birthday" :clearable="false" class="block"
+                                type="date" value-format="YYYY-MM-DD"
+                            />
                         </el-form-item>
                     </div>
                     <div class="hc-form-item">
                         <el-form-item label="性别">
                             <el-select v-model="addEditFormModel.sex" block>
-                                <el-option :value="1" label="男"/>
-                                <el-option :value="2" label="女"/>
+                                <el-option :value="1" label="男" />
+                                <el-option :value="2" label="女" />
                             </el-select>
                         </el-form-item>
                         <el-form-item label="毕业院校">
-                            <el-input v-model="addEditFormModel.graduationSchool"/>
+                            <el-input v-model="addEditFormModel.graduationSchool" />
                         </el-form-item>
                         <el-form-item label="专业">
-                            <el-input v-model="addEditFormModel.major"/>
+                            <el-input v-model="addEditFormModel.major" />
                         </el-form-item>
                     </div>
                     <div class="hc-form-item">
                         <el-form-item label="学历">
                             <el-select v-model="addEditFormModel.education" block>
-                                <el-option v-for="item in educationData" :label="item['dictValue']"
-                                           :value="item['dictKey']"/>
+                                <el-option
+                                    v-for="item in educationData" :label="item.dictValue"
+                                    :value="item.dictKey"
+                                />
                             </el-select>
                         </el-form-item>
                         <el-form-item label="毕业日期">
-                            <el-date-picker v-model="addEditFormModel.graduationDate" :clearable="false" class="block"
-                                            type="date" value-format="YYYY-MM-DD"/>
+                            <el-date-picker
+                                v-model="addEditFormModel.graduationDate" :clearable="false" class="block"
+                                type="date" value-format="YYYY-MM-DD"
+                            />
                         </el-form-item>
                         <el-form-item label="入职时间">
-                            <el-date-picker v-model="addEditFormModel.entryTime" :clearable="false" class="block"
-                                            type="date" value-format="YYYY-MM-DD"/>
+                            <el-date-picker
+                                v-model="addEditFormModel.entryTime" :clearable="false" class="block"
+                                type="date" value-format="YYYY-MM-DD"
+                            />
                         </el-form-item>
                     </div>
                     <div class="hc-form-item">
                         <el-form-item label="就职状态">
                             <el-select v-model="addEditFormModel.status" block>
-                                <el-option :value="1" label="在职"/>
-                                <el-option :value="0" label="离职"/>
+                                <el-option :value="1" label="在职" />
+                                <el-option :value="0" label="离职" />
                             </el-select>
                         </el-form-item>
                         <el-form-item label="职称">
-                            <el-input v-model="addEditFormModel.jobTitleName"/>
+                            <el-input v-model="addEditFormModel.jobTitleName" />
                         </el-form-item>
                         <el-form-item label="工作职务">
-                            <el-input v-model="addEditFormModel.jobTitlePost"/>
+                            <el-input v-model="addEditFormModel.jobTitlePost" />
                         </el-form-item>
                     </div>
                     <div class="hc-form-item">
                         <el-form-item label="进场时间">
-                            <el-date-picker v-model="addEditFormModel.mobilizationTime" :clearable="false" class="block"
-                                            type="date" value-format="YYYY-MM-DD"/>
+                            <el-date-picker
+                                v-model="addEditFormModel.mobilizationTime" :clearable="false" class="block"
+                                type="date" value-format="YYYY-MM-DD"
+                            />
                         </el-form-item>
                         <el-form-item label="部门">
-                            <el-input v-model="addEditFormModel.department"/>
+                            <el-input v-model="addEditFormModel.department" />
                         </el-form-item>
                         <el-form-item label="从事检测工作时间(月)">
-                            <el-input v-model="addEditFormModel.workingTime"/>
+                            <el-input v-model="addEditFormModel.workingTime" />
                         </el-form-item>
                     </div>
                     <div class="hc-form-item">
                         <el-form-item label="退场时间">
-                            <el-date-picker v-model="addEditFormModel.exitTime" :clearable="false" class="block"
-                                            type="date" value-format="YYYY-MM-DD"/>
+                            <el-date-picker
+                                v-model="addEditFormModel.exitTime" :clearable="false" class="block"
+                                type="date" value-format="YYYY-MM-DD"
+                            />
                         </el-form-item>
                         <el-form-item label="劳动合同开始日期">
-                            <el-date-picker v-model="addEditFormModel.laborContractStartDate" :clearable="false" class="block"
-                                            type="date" value-format="YYYY-MM-DD"/>
+                            <el-date-picker
+                                v-model="addEditFormModel.laborContractStartDate" :clearable="false" class="block"
+                                type="date" value-format="YYYY-MM-DD"
+                            />
                         </el-form-item>
                         <el-form-item label="劳动合同终止日期">
-                            <el-date-picker v-model="addEditFormModel.laborContractEndDate" :clearable="false" class="block"
-                                            type="date" value-format="YYYY-MM-DD"/>
+                            <el-date-picker
+                                v-model="addEditFormModel.laborContractEndDate" :clearable="false" class="block"
+                                type="date" value-format="YYYY-MM-DD"
+                            />
                         </el-form-item>
                     </div>
                 </template>
                 <template v-if="tabTypeKey === 'tab2'">
                     <el-form-item label="证书编号">
-                        <el-input v-model="addEditFormModel.certificateNo"/>
+                        <el-input v-model="addEditFormModel.certificateNo" />
                     </el-form-item>
                     <el-form-item label="持证类型">
                         <el-select v-model="addEditFormModel.certificateType" block>
-                            <el-option label="检测员" value="1"/>
-                            <el-option label="检测工程师" value="2"/>
+                            <el-option label="检测员" value="1" />
+                            <el-option label="检测工程师" value="2" />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="持证专业">
                         <el-select v-model="addEditFormModel.certificateMajor" block>
-                            <el-option label="水运结构与地基" value="1"/>
-                            <el-option label="交通工具" value="2"/>
-                            <el-option label="水运材料" value="3"/>
-                            <el-option label="桥梁隧道工程" value="4"/>
-                            <el-option label="道路工程" value="5"/>
+                            <el-option label="水运结构与地基" value="1" />
+                            <el-option label="交通工具" value="2" />
+                            <el-option label="水运材料" value="3" />
+                            <el-option label="桥梁隧道工程" value="4" />
+                            <el-option label="道路工程" value="5" />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="证书文件">
-                        <FormItemUpload v-model="addEditFormModel.certificateUrl"/>
+                        <FormItemUpload v-model="addEditFormModel.certificateUrl" />
                     </el-form-item>
                 </template>
                 <template v-if="tabTypeKey === 'tab3'">
                     <el-form-item label="记录日期">
-                        <el-date-picker v-model="addEditFormModel.workRecordDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.workRecordDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                     <el-form-item label="内容">
-                        <el-input v-model="addEditFormModel.workContent" :autosize="{ minRows: 8}" type="textarea"/>
+                        <el-input v-model="addEditFormModel.workContent" :autosize="{ minRows: 8 }" type="textarea" />
                     </el-form-item>
                 </template>
             </el-form>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {onMounted, ref} from "vue";
-import {useAppStore} from "~src/store";
-import dataApi from "~api/tentative/laboratory/user"
-import FormItemUpload from "./components/FormItemUpload.vue"
-import {getArrValue, arrKeyValue, isIdCard, formValidate, arrToId} from "js-fast-way"
-import {getDictionary} from "~api/other";
+import { onMounted, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import dataApi from '~api/tentative/laboratory/user'
+import FormItemUpload from './components/FormItemUpload.vue'
+import { arrKeyValue, arrToId, formValidate, getArrValue, isIdCard } from 'js-fast-way'
+import { getDictionary } from '~api/other'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
 
 //全局变量
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 
 //渲染完成
 onMounted(() => {
@@ -205,8 +231,8 @@ onMounted(() => {
 //获取学历类型
 const educationData = ref([])
 const getEducationType = async () => {
-    const {data} = await getDictionary({
-        code: 'trial_user_education'
+    const { data } = await getDictionary({
+        code: 'trial_user_education',
     })
     const arrData = getArrValue(data)
     arrData.forEach(item => {
@@ -220,25 +246,25 @@ const getEducationType = async () => {
 
 //搜索表单
 const searchForm = ref({
-    queryValue: null, current: 1, size: 20, total: 0
+    queryValue: null, current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -247,23 +273,23 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'name', name: '姓名', width: 100},
-    {key: 'department', name: '部门', width: 120},
-    {key: 'jobTitleName', name: '职称', width: 100},
-    {key: 'status', name: '就职状态', width: 80},
-    {key: 'entryTime', name: '入职时间', width: 140},
-    {key: 'workingTime', name: '从事检测工作(月)', width: 150},
-    {key: 'jobTitlePost', name: '工作职务', width: 120},
-    {key: 'idCard', name: '身份证号码', width: 180},
-    {key: 'birthday', name: '出生日期', width: 140},
-    {key: 'sex', name: '性别', width: 80},
-    {key: 'graduationSchool', name: '毕业院校'},
-    {key: 'education', name: '学历', width: 120},
-    {key: 'major', name: '专业', width: 150},
-    {key: 'graduationDate', name: '毕业时间', width: 140},
-    {key: 'laborContractEndDate', name: '劳动合同终止日期', width: 140},
-    {key: 'mobilizationTime', name: '进场时间', width: 140},
-    {key: 'exitTime', name: '退场时间', width: 140},
+    { key: 'name', name: '姓名', width: 100 },
+    { key: 'department', name: '部门', width: 120 },
+    { key: 'jobTitleName', name: '职称', width: 100 },
+    { key: 'status', name: '就职状态', width: 80 },
+    { key: 'entryTime', name: '入职时间', width: 140 },
+    { key: 'workingTime', name: '从事检测工作(月)', width: 150 },
+    { key: 'jobTitlePost', name: '工作职务', width: 120 },
+    { key: 'idCard', name: '身份证号码', width: 180 },
+    { key: 'birthday', name: '出生日期', width: 140 },
+    { key: 'sex', name: '性别', width: 80 },
+    { key: 'graduationSchool', name: '毕业院校' },
+    { key: 'education', name: '学历', width: 120 },
+    { key: 'major', name: '专业', width: 150 },
+    { key: 'graduationDate', name: '毕业时间', width: 140 },
+    { key: 'laborContractEndDate', name: '劳动合同终止日期', width: 140 },
+    { key: 'mobilizationTime', name: '进场时间', width: 140 },
+    { key: 'exitTime', name: '退场时间', width: 140 },
 ])
 
 //获取数据
@@ -271,7 +297,7 @@ const tableLoading = ref(false)
 const tableData = ref([])
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         projectId: projectId.value,
         contractId: contractId.value,
         ...searchForm.value,
@@ -293,7 +319,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -329,10 +355,10 @@ const addEditFormModalClose = () => {
 //类型tab数据和相关处理
 const tabTypeKey = ref('tab1')
 const tabTypeTab = ref([
-    {key: 'tab1', name: '基本信息'},
-    {key: 'tab2', name: '证书信息'},
-    {key: 'tab3', name: '工作记录'},
-]);
+    { key: 'tab1', name: '基本信息' },
+    { key: 'tab2', name: '证书信息' },
+    { key: 'tab3', name: '工作记录' },
+])
 const tabTypeChange = (item) => {
     tabTypeKey.value = item?.key
 }
@@ -365,12 +391,12 @@ const addEditFormRules = {
                 callback()
             }
         },
-        trigger: 'blur'
+        trigger: 'blur',
     },
     birthday: {
         required: true,
         trigger: 'blur',
-        message: "请选择出生日期"
+        message: '请选择出生日期',
     },
 }
 
@@ -381,10 +407,10 @@ const addEditFormClick = async () => {
     if (validate) {
         addEditFormLoading.value = true
         addEditFormModel.value.workingTime = Number(addEditFormModel.value.workingTime)
-        const {error, code} = await dataApi.submitForm({
+        const { error, code } = await dataApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -401,17 +427,17 @@ const addEditFormClick = async () => {
 
 //删除
 const delModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
     })
+    
 }
 
 //批量删除
@@ -420,7 +446,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -432,7 +458,6 @@ const tableRemoveData = async () => {
         }
     }
 }
-
 </script>
 
 <style lang="scss" scoped>

+ 7 - 7
src/views/tentative/material/approach.vue

@@ -295,6 +295,7 @@ import notableform from '~src/assets/view/notableform.svg'
 import approachApi from '~api/tentative/material/approach'
 import { arrIndex, arrToId, deepClone, formValidate, getArrValue } from 'js-fast-way'
 import { getDictionary } from '~api/other'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
@@ -628,16 +629,15 @@ const tableCopyData = async (rows) => {
 
 //删除
 const delModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        },
     })
 }
 

+ 197 - 171
src/views/tentative/material/sampling.vue

@@ -1,132 +1,147 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
-                    <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
             <div class="hc-tree-box">
                 <el-scrollbar>
                     <TestTree
-                        :autoExpandKeys="treeAutoExpandKeys"
-                        :projectId="projectId"
-                        :tenantId="userInfo?.tenant_id"
-                        :wbsTempId="projectInfo?.referenceWbsTemplateIdTrial"
-                        :wbsType="2"
-                        @nodeTap="wbsElTreeClick"/>
+                        :auto-expand-keys="treeAutoExpandKeys"
+                        :project-id="projectId"
+                        :tenant-id="userInfo?.tenant_id"
+                        :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
+                        :wbs-type="2"
+                        @nodeTap="wbsElTreeClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
-            <HcCard :scrollbar="false" actionSize="lg">
+            <HcCard :scrollbar="false" action-size="lg">
                 <template #header>
                     <HcTooltip keys="tentative_material_sampling_add">
                         <el-button :disabled="!primaryKeyId" hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_material_sampling_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_material_sampling_copy">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="copyTableModalClick">
-                            <HcIcon name="file-copy-2"/>
+                            <HcIcon name="file-copy-2" />
                             <span>复制</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_material_sampling_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_material_sampling_printer">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
-                                   @click="printerClick">
-                            <HcIcon name="printer"/>
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" hc-btn
+                            @click="printerClick"
+                        >
+                            <HcIcon name="printer" />
                             <span>打印</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_material_sampling_import">
                         <el-button :disabled="!primaryKeyId" hc-btn @click="importModalClick">
-                            <HcIcon name="folder-upload"/>
+                            <HcIcon name="folder-upload" />
                             <span>导入</span>
                         </el-button>
                     </HcTooltip>
                 </template>
                 <template #search>
                     <div class="w-64">
-                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate"/>
+                        <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
                     <div class="w-72 ml-2">
-                        <el-input v-model="searchForm.queryValue" clearable
-                                  placeholder="请输入名称、规格、材料编号进行查询" @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable
+                            placeholder="请输入名称、规格、材料编号进行查询" @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection">
-                    <template #materialCount="{row}">{{ row.materialCount === -1 ? "" : row.materialCount }}</template>
-                    <template #representativeCount="{row}">
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                >
+                    <template #materialCount="{ row }">{{ row.materialCount === -1 ? "" : row.materialCount }}</template>
+                    <template #representativeCount="{ row }">
                         {{ row.representativeCount === -1 ? "" : row.representativeCount }}
                     </template>
                 </HcTable>
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增/编辑-->
-        <HcDialog :show="addEditFormModal" :title="`${addEditFormModel.id?'编辑':'新增'}样品信息`" isRowFooter
-                  widths="50rem" @close="addEditFormModalClose">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :show="addEditFormModal" :title="`${addEditFormModel.id ? '编辑' : '新增'}样品信息`" is-row-footer
+            widths="50rem" @close="addEditFormModalClose"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <div class="hc-form-item">
                     <el-form-item label="样品名称" prop="materialName">
-                        <el-input v-model="addEditFormModel.materialName"/>
+                        <el-input v-model="addEditFormModel.materialName" />
                     </el-form-item>
                     <el-form-item label="进场日期">
-                        <el-date-picker v-model="addEditFormModel.mobilizationDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.mobilizationDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="样品编号" prop="specificationNumber">
-                        <el-input v-model="addEditFormModel.specificationNumber"/>
+                        <el-input v-model="addEditFormModel.specificationNumber" />
                     </el-form-item>
                     <el-form-item label="取样日期">
-                        <el-date-picker v-model="addEditFormModel.samplingDate" :clearable="false" class="block"
-                                        type="date" value-format="YYYY-MM-DD"/>
+                        <el-date-picker
+                            v-model="addEditFormModel.samplingDate" :clearable="false" class="block"
+                            type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="规格型号">
-                        <el-input v-model="addEditFormModel.specificationModel"/>
+                        <el-input v-model="addEditFormModel.specificationModel" />
                     </el-form-item>
                     <el-form-item label="取样地点">
-                        <el-input v-model="addEditFormModel.samplingLocation"/>
+                        <el-input v-model="addEditFormModel.samplingLocation" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="试样数量">
-                        <el-input v-model="addEditFormModel.materialCount" type="number"/>
+                        <el-input v-model="addEditFormModel.materialCount" type="number" />
                     </el-form-item>
                     <el-form-item label="是否外委">
                         <el-radio-group v-model="addEditFormModel.isOutsourcing" size="large">
@@ -137,146 +152,158 @@
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="代表数量">
-                        <el-input v-model="addEditFormModel.representativeCount" type="number"/>
+                        <el-input v-model="addEditFormModel.representativeCount" type="number" />
                     </el-form-item>
                     <el-form-item label="供应商">
-                        <el-input v-model="addEditFormModel.supplierUnit"/>
+                        <el-input v-model="addEditFormModel.supplierUnit" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="计算单位">
-                        <el-input v-model="addEditFormModel.calculationUnit"/>
+                        <el-input v-model="addEditFormModel.calculationUnit" />
                     </el-form-item>
                     <el-form-item label="生产批号">
-                        <el-input v-model="addEditFormModel.batchNumber"/>
+                        <el-input v-model="addEditFormModel.batchNumber" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="取样人">
                         <el-select v-model="addEditFormModel.userId" block @change="changeusername">
-                            <el-option v-for="item in userListData" :label="item['userName']" :value="item['userId']"/>
+                            <el-option v-for="item in userListData" :label="item.userName" :value="item.userId" />
                         </el-select>
                     </el-form-item>
                     <el-form-item label="拟用部位">
-                        <el-input v-model="addEditFormModel.proposedPosition"/>
+                        <el-input v-model="addEditFormModel.proposedPosition" />
                     </el-form-item>
                 </div>
                 <el-form-item label="样品描述">
-                    <el-input v-model="addEditFormModel.sampleDescription"/>
+                    <el-input v-model="addEditFormModel.sampleDescription" />
                 </el-form-item>
             </el-form>
             <template #leftRowFooter>
                 <HcTooltip keys="tentative_material_sampling_links">
                     <el-button hc-btn type="primary" @click="linksApproachModalClick(addEditFormModel.mobilizationId)">
-                        <HcIcon name="links"/>
+                        <HcIcon name="links" />
                         <span>关联进场材料</span>
                     </el-button>
                 </HcTooltip>
             </template>
             <template #rightRowFooter>
                 <el-button size="large" @click="addEditFormModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
                 <el-button :loading="addEditFormLoading" hc-btn type="primary" @click="addEditFormClick">
-                    <HcIcon name="check"/>
+                    <HcIcon name="check" />
                     <span>确认</span>
                 </el-button>
             </template>
         </HcDialog>
 
-        <!--关联进场材料-->
-        <HcDialog :show="linksApproachModal" isRowFooter isTable title="关联进场材料信息" widths="60%"
-                  @close="linksApproachModalClose">
-            <HcTable :column="linksApproachTableColumn" :datas="linksApproachTableData"
-                     :isIndex="false" :loading="linksApproachTableLoading">
-                <template #materialType="{row}">{{ getRowTableMaterialType(row['materialType']) }}</template>
-                <template #action="{row}">
+        <!-- 关联进场材料 -->
+        <HcDialog
+            :show="linksApproachModal" is-row-footer is-table title="关联进场材料信息" widths="60%"
+            @close="linksApproachModalClose"
+        >
+            <HcTable
+                :column="linksApproachTableColumn" :datas="linksApproachTableData"
+                :is-index="false" :loading="linksApproachTableLoading"
+            >
+                <template #materialType="{ row }">{{ getRowTableMaterialType(row.materialType) }}</template>
+                <template #action="{ row }">
                     <HcTooltip keys="tentative_material_approach_annex">
-                        <el-button v-if="mobilizationId === row.id" plain size="small" type="primary"
-                                   @click="cancelApproachRow(row)">取消关联
+                        <el-button
+                            v-if="mobilizationId === row.id" plain size="small" type="primary"
+                            @click="cancelApproachRow(row)"
+                        >
+                            取消关联
                         </el-button>
-                        <el-button v-else plain size="small" type="primary" @click="linksApproachRow(row)">关联
+                        <el-button v-else plain size="small" type="primary" @click="linksApproachRow(row)">
+                            关联
                         </el-button>
                     </HcTooltip>
                 </template>
             </HcTable>
             <template #leftRowFooter>
-                <HcPages :pages="ApproachSearchForm" @change="linksApproachPageChange"/>
+                <HcPages :pages="ApproachSearchForm" @change="linksApproachPageChange" />
             </template>
             <template #rightRowFooter>
                 <el-button size="large" @click="linksApproachModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
                 <el-button hc-btn type="primary" @click="linksApproachModalSave">
-                    <HcIcon name="check"/>
+                    <HcIcon name="check" />
                     <span>确定</span>
                 </el-button>
             </template>
         </HcDialog>
 
-        <!--复制样品登记信息-->
-        <HcDialog :loading="copyTableLoading" :show="copyTableModal" isTable title="复制样品登记信息" widths="60rem"
-                  @close="copyTableModalClose" @save="copyTableClick">
+        <!-- 复制样品登记信息 -->
+        <HcDialog
+            :loading="copyTableLoading" :show="copyTableModal" is-table title="复制样品登记信息" widths="60rem"
+            @close="copyTableModalClose" @save="copyTableClick"
+        >
             <HcTable :column="copyTableColumn" :datas="copyTableData">
-                <template #specificationNumber="{row}">
-                    <el-input v-model="row.specificationNumber" placeholder="请输入样品编号"/>
+                <template #specificationNumber="{ row }">
+                    <el-input v-model="row.specificationNumber" placeholder="请输入样品编号" />
                 </template>
-                <template #action="{index}">
+                <template #action="{ index }">
                     <el-button plain size="small" type="danger" @click="specificationNumberDel(index)">删除</el-button>
                 </template>
             </HcTable>
         </HcDialog>
 
-        <!--导入-->
-        <HcDialog :show="importModal" isRowFooter title="导入" widths="38rem" @close="importModalClose">
-            <HcDragUpload ref="uploadRef" :api="'/api/blade-business/material/'" :datas="uploadData"
-                          action="sample/import"
-                          @finished="uploadFinished" @progress="uploadprogress"/>
+        <!-- 导入 -->
+        <HcDialog :show="importModal" is-row-footer title="导入" widths="38rem" @close="importModalClose">
+            <HcDragUpload
+                ref="uploadRef" api="/api/blade-business/material/" :datas="uploadData"
+                action="sample/import"
+                @finished="uploadFinished" @progress="uploadprogress"
+            />
             <template #leftRowFooter>
                 <el-button size="large" @click="downloadImportClick">
-                    <HcIcon name="download-2"/>
+                    <HcIcon name="download-2" />
                     <span>下载模板</span>
                 </el-button>
             </template>
             <template #rightRowFooter>
                 <el-button size="large" @click="importModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消导入</span>
                 </el-button>
                 <el-button :loading="importModalLoading" hc-btn type="primary" @click="importModalYesClick">
-                    <HcIcon name="folder-upload"/>
+                    <HcIcon name="folder-upload" />
                     <span>确认导入</span>
                 </el-button>
             </template>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {ref, watch, onMounted} from "vue";
-import {useAppStore} from "~src/store";
-import TestTree from "./components/TestTree.vue"
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
-import HcDragUpload from "./components/HcDragUpload.vue"
-import samplingApi from "~api/tentative/material/sampling"
-import approachApi from "~api/tentative/material/approach";
-import {getContractUserList, getDictionary} from "~api/other";
-import {deepClone, formValidate, getArrValue, arrIndex, arrToId} from "js-fast-way"
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import TestTree from './components/TestTree.vue'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import HcDragUpload from './components/HcDragUpload.vue'
+import samplingApi from '~api/tentative/material/sampling'
+import approachApi from '~api/tentative/material/approach'
+import { getContractUserList, getDictionary } from '~api/other'
+import { arrIndex, arrToId, deepClone, formValidate, getArrValue } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 
 //变量
 const useAppState = useAppStore()
-const userInfo = ref(useAppState.getUserInfo);
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
+const userInfo = ref(useAppState.getUserInfo)
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -293,8 +320,8 @@ onMounted(() => {
 //获取材料类型
 const typeData = ref([])
 const getMaterialType = async () => {
-    const {data} = await getDictionary({
-        code: 'material_type'
+    const { data } = await getDictionary({
+        code: 'material_type',
     })
     typeData.value = getArrValue(data)
 }
@@ -314,8 +341,8 @@ const getRowTableMaterialType = (type) => {
 //获取用户列表
 const userListData = ref([])
 const getUserListData = async () => {
-    const {data} = await getContractUserList({
-        contractId: contractId.value
+    const { data } = await getContractUserList({
+        contractId: contractId.value,
     })
     userListData.value = getArrValue(data)
 }
@@ -323,7 +350,7 @@ const getUserListData = async () => {
 //搜索表单
 const searchForm = ref({
     startTime: null, endTime: null, queryValue: null, nodeId: '',
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //树相关的变量
@@ -332,7 +359,7 @@ const nodeItemInfo = ref({})
 const nodeDataInfo = ref({})
 
 //树被点击
-const wbsElTreeClick = ({node, data, keys}) => {
+const wbsElTreeClick = ({ node, data, keys }) => {
     nodeItemInfo.value = node
     nodeDataInfo.value = data
     primaryKeyId.value = data['primaryKeyId'] || ''
@@ -341,13 +368,13 @@ const wbsElTreeClick = ({node, data, keys}) => {
     setStoreValue('testTreeExpandKeys', keys)
     //改变搜索表单数据
     searchForm.value.nodeId = data['primaryKeyId'] || ''
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr}) => {
+const betweenTimeUpdate = ({ arr }) => {
     betweenTime.value = arr
     if (arr.length > 0) {
         searchForm.value.startTime = arr[0]
@@ -360,20 +387,20 @@ const betweenTimeUpdate = ({arr}) => {
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -382,15 +409,15 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'materialName', name: '取样名称'},
-    {key: 'samplingDate', name: '取样日期'},
-    {key: 'specificationNumber', name: '样品编号'},
-    {key: 'specificationModel', name: '规格型号'},
-    {key: 'materialCount', name: '试样数量'},
-    {key: 'calculationUnit', name: '计算单位'},
-    {key: 'proposedPosition', name: '拟用部位'},
-    {key: 'representativeCount', name: '代表数量'},
-    {key: 'userName', name: '取样人'}
+    { key: 'materialName', name: '取样名称' },
+    { key: 'samplingDate', name: '取样日期' },
+    { key: 'specificationNumber', name: '样品编号' },
+    { key: 'specificationModel', name: '规格型号' },
+    { key: 'materialCount', name: '试样数量' },
+    { key: 'calculationUnit', name: '计算单位' },
+    { key: 'proposedPosition', name: '拟用部位' },
+    { key: 'representativeCount', name: '代表数量' },
+    { key: 'userName', name: '取样人' },
 ])
 
 //获取数据
@@ -400,7 +427,7 @@ const getTableData = async () => {
     const nodeId = primaryKeyId.value
     if (nodeId) {
         tableLoading.value = true
-        const {error, code, data} = await samplingApi.queryPage({
+        const { error, code, data } = await samplingApi.queryPage({
             projectId: projectId.value,
             contractId: contractId.value,
             nodeId,
@@ -421,10 +448,10 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== '';
+        return (item ?? '') !== ''
     })
 }
 
@@ -435,7 +462,7 @@ const addFormModalClick = () => {
         isOutsourcing: 0,
         mobilizationId: '',
         nodeId: primaryKeyId.value,
-        userId: userInfo.value.user_id
+        userId: userInfo.value.user_id,
     }
     addEditFormModal.value = true
 }
@@ -463,7 +490,7 @@ const addEditFormRules = {
     materialName: {
         required: true,
         trigger: 'blur',
-        message: "请输入样品名称"
+        message: '请输入样品名称',
     },
     specificationNumber: {
         required: false,
@@ -479,18 +506,18 @@ const addEditFormRules = {
                 }
             }
         },
-        trigger: 'blur'
+        trigger: 'blur',
     },
 }
 
 //校验材料编号是否唯一
 const verification = async (val) => {
-    const {error, code, data} = await samplingApi.verification({
+    const { error, code, data } = await samplingApi.verification({
         projectId: projectId.value,
         contractId: contractId.value,
         specificationNumber: val,
         id: addEditFormModel.value.id ?? '',
-        nodeId: primaryKeyId.value
+        nodeId: primaryKeyId.value,
     })
     if (!error && code === 200) {
         return !data
@@ -505,10 +532,10 @@ const addEditFormClick = async () => {
     const validate = await formValidate(addEditFormRef.value)
     if (validate) {
         addEditFormLoading.value = true
-        const {error, code} = await samplingApi.submitForm({
+        const { error, code } = await samplingApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -517,7 +544,7 @@ const addEditFormClick = async () => {
             addEditFormModal.value = false
             setTimeout(() => {
                 addEditFormLoading.value = false
-            }, 1000);
+            }, 1000)
             await getTableData()
         }
     }
@@ -526,9 +553,9 @@ const addEditFormClick = async () => {
 
 //复制表格
 const copyTableColumn = ref([
-    {key: 'materialName', name: '样品名称'},
-    {key: 'specificationNumber', name: '样品编号'},
-    {key: 'action', name: '操作', width: 100},
+    { key: 'materialName', name: '样品名称' },
+    { key: 'specificationNumber', name: '样品编号' },
+    { key: 'action', name: '操作', width: 100 },
 ])
 const copyTableData = ref([])
 
@@ -541,7 +568,7 @@ const copyTableModalClick = () => {
 
 //删除
 const specificationNumberDel = (index) => {
-    copyTableData.value.splice(index, 1);
+    copyTableData.value.splice(index, 1)
     const rows = copyTableData.value
     if (rows.length <= 0) {
         copyTableModal.value = false
@@ -571,7 +598,7 @@ const copyTableClick = () => {
 //复制数据请求
 const tableCopyData = async (rows) => {
     copyTableLoading.value = true
-    const {error, code} = await samplingApi.copyData(rows)
+    const { error, code } = await samplingApi.copyData(rows)
     //处理数据
     copyTableLoading.value = false
     if (!error && code === 200) {
@@ -583,16 +610,15 @@ const tableCopyData = async (rows) => {
 
 //删除
 const delModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
     })
 }
 
@@ -602,7 +628,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await samplingApi.removeData({
+        const { error, code } = await samplingApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -623,7 +649,7 @@ const printerClick = async () => {
         printerLoading.value = true
         const ids = arrToId(rows)
         //删除请求
-        const {error, code, data} = await samplingApi.exportPdf({
+        const { error, code, data } = await samplingApi.exportPdf({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -647,7 +673,7 @@ const importModalClick = () => {
     uploadData.value = {
         contractId: contractId.value,
         nodeId: primaryKeyId.value,
-        isCovered: 1
+        isCovered: 1,
     }
 }
 
@@ -684,18 +710,18 @@ const changeusername = (item) => {
 //关联进场材料
 const linksApproachModal = ref(false)
 const ApproachSearchForm = ref({
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 const mobilizationId = ref('')
 const linksApproachModalClick = (mId) => {
     mobilizationId.value = mId ?? ''
-    ApproachSearchForm.value.current = 1;
+    ApproachSearchForm.value.current = 1
     linksApproachModal.value = true
     getApproachTableData()
 }
 
 //分页被点击
-const linksApproachPageChange = ({current, size}) => {
+const linksApproachPageChange = ({ current, size }) => {
     ApproachSearchForm.value.current = current
     ApproachSearchForm.value.size = size
     getApproachTableData()
@@ -703,15 +729,15 @@ const linksApproachPageChange = ({current, size}) => {
 
 //关联进场材料数据
 const linksApproachTableColumn = ref([
-    {key: 'materialNumber', name: '材料编号'},
-    {key: 'mobilizationDate', name: '进场日期'},
-    {key: 'materialName', name: '材料名称'},
-    {key: 'materialType', name: '材料类型'},
-    {key: 'specificationModel', name: '规格型号'},
-    {key: 'supplierUnit', name: '供应商单位'},
-    {key: 'proposedPosition', name: '拟用部位'},
-    {key: 'userName', name: '记录人'},
-    {key: 'action', name: '操作', width: 100, fixed: 'right', align: 'center'},
+    { key: 'materialNumber', name: '材料编号' },
+    { key: 'mobilizationDate', name: '进场日期' },
+    { key: 'materialName', name: '材料名称' },
+    { key: 'materialType', name: '材料类型' },
+    { key: 'specificationModel', name: '规格型号' },
+    { key: 'supplierUnit', name: '供应商单位' },
+    { key: 'proposedPosition', name: '拟用部位' },
+    { key: 'userName', name: '记录人' },
+    { key: 'action', name: '操作', width: 100, fixed: 'right', align: 'center' },
 ])
 const linksApproachTableData = ref([])
 
@@ -719,7 +745,7 @@ const linksApproachTableData = ref([])
 const linksApproachTableLoading = ref(false)
 const getApproachTableData = async () => {
     linksApproachTableLoading.value = true
-    const {error, code, data} = await approachApi.queryPage({
+    const { error, code, data } = await approachApi.queryPage({
         projectId: projectId.value,
         contractId: contractId.value,
         ...ApproachSearchForm.value,
@@ -737,16 +763,16 @@ const getApproachTableData = async () => {
 
 //关联
 const linksApproachRow = (row) => {
-    const form = addEditFormModel.value;
-    form.materialName = row.materialName ?? ''              //样品名称
-    form.mobilizationDate = row.mobilizationDate ?? null    //进场日期
-    form.specificationNumber = row.materialNumber ?? ''     //样品编号
-    form.specificationModel = row.specificationModel ?? ''  //规格型号
-    form.supplierUnit = row.supplierUnit ?? ''              //供应商
-    form.calculationUnit = row.calculationUnit ?? ''        //计算单位
-    form.batchNumber = row.batchNumber ?? ''                //生产批号
-    form.proposedPosition = row.proposedPosition ?? ''      //拟用部位
-    form.mobilizationId = row.id                            //关联ID
+    const form = addEditFormModel.value
+    form.materialName = row.materialName ?? '' //样品名称
+    form.mobilizationDate = row.mobilizationDate ?? null //进场日期
+    form.specificationNumber = row.materialNumber ?? '' //样品编号
+    form.specificationModel = row.specificationModel ?? '' //规格型号
+    form.supplierUnit = row.supplierUnit ?? '' //供应商
+    form.calculationUnit = row.calculationUnit ?? '' //计算单位
+    form.batchNumber = row.batchNumber ?? '' //生产批号
+    form.proposedPosition = row.proposedPosition ?? '' //拟用部位
+    form.mobilizationId = row.id //关联ID
     //更新数据
     addEditFormModel.value = form
     mobilizationId.value = row.id //关联ID
@@ -775,18 +801,18 @@ const downloadImportClick = () => {
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(382);
+const leftWidth = ref(382)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 310 && diffVal <= 900) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 57 - 45
src/views/tentative/parameter/compactness.vue

@@ -4,66 +4,71 @@
             <template #header>
                 <HcTooltip keys="tentative_parameter_compactness_add">
                     <el-button hc-btn type="primary" @click="addFormModalClick">
-                        <HcIcon name="add-circle"/>
+                        <HcIcon name="add-circle" />
                         <span>新增</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="tentative_parameter_compactness_edit">
                     <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                        <HcIcon name="edit"/>
+                        <HcIcon name="edit" />
                         <span>编辑</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="tentative_parameter_compactness_del">
                     <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delModalClick">
-                        <HcIcon name="delete-bin-2"/>
+                        <HcIcon name="delete-bin-2" />
                         <span>删除</span>
                     </el-button>
                 </HcTooltip>
             </template>
-            <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                     @selection-change="tableSelection"></HcTable>
+            <HcTable
+                ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                @selection-change="tableSelection"
+            />
             <template #action>
-                <HcPages :pages="searchForm" @change="pageChange"/>
+                <HcPages :pages="searchForm" @change="pageChange" />
             </template>
         </HcCard>
 
-        <!--新增/编辑-->
-        <HcDialog :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id?'编辑':'新增'}压实度参数`"
-                  widths="30rem" @close="addEditFormModalClose" @save="addEditFormClick">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id ? '编辑' : '新增'}压实度参数`"
+            widths="30rem" @close="addEditFormModalClose" @save="addEditFormClick"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <el-form-item label="N值" prop="valueN">
-                    <el-input v-model="addEditFormModel.valueN"/>
+                    <el-input v-model="addEditFormModel.valueN" />
                 </el-form-item>
                 <el-form-item label="保证率99%" prop="assuranceRateNinetyNinePercent">
-                    <el-input v-model="addEditFormModel.assuranceRateNinetyNinePercent"/>
+                    <el-input v-model="addEditFormModel.assuranceRateNinetyNinePercent" />
                 </el-form-item>
                 <el-form-item label="保证率95%" prop="assuranceRateNinetyFivePercent">
-                    <el-input v-model="addEditFormModel.assuranceRateNinetyFivePercent"/>
+                    <el-input v-model="addEditFormModel.assuranceRateNinetyFivePercent" />
                 </el-form-item>
                 <el-form-item label="保证率90%" prop="assuranceRateNinetyPercent">
-                    <el-input v-model="addEditFormModel.assuranceRateNinetyPercent"/>
+                    <el-input v-model="addEditFormModel.assuranceRateNinetyPercent" />
                 </el-form-item>
             </el-form>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {onMounted, ref} from "vue";
-import {useAppStore} from "~src/store";
-import dataApi from "~api/tentative/parameter/compactness"
-import {formValidate, getArrValue, arrToId} from "js-fast-way"
-import {delMessage} from "~uti/tools";
+import { onMounted, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import dataApi from '~api/tentative/parameter/compactness'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
 
 //全局变量
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 
 //渲染完成
 onMounted(() => {
@@ -72,25 +77,25 @@ onMounted(() => {
 
 //搜索表单
 const searchForm = ref({
-    queryValue: null, current: 1, size: 20, total: 0
+    queryValue: null, current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -99,10 +104,10 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'valueN', name: 'N值'},
-    {key: 'assuranceRateNinetyNinePercent', name: '保证率99%'},
-    {key: 'assuranceRateNinetyFivePercent', name: '保证率95%'},
-    {key: 'assuranceRateNinetyPercent', name: '保证率90%'},
+    { key: 'valueN', name: 'N值' },
+    { key: 'assuranceRateNinetyNinePercent', name: '保证率99%' },
+    { key: 'assuranceRateNinetyFivePercent', name: '保证率95%' },
+    { key: 'assuranceRateNinetyPercent', name: '保证率90%' },
 ])
 const tableData = ref([])
 
@@ -110,10 +115,10 @@ const tableData = ref([])
 const tableLoading = ref(false)
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         ...searchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
     tableLoading.value = false
@@ -127,7 +132,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -158,22 +163,22 @@ const addEditFormRules = {
     valueN: {
         required: true,
         trigger: 'blur',
-        message: "请输入N值"
+        message: '请输入N值',
     },
     assuranceRateNinetyNinePercent: {
         required: true,
         trigger: 'blur',
-        message: "请输入保证率99%"
+        message: '请输入保证率99%',
     },
     assuranceRateNinetyFivePercent: {
         required: true,
         trigger: 'blur',
-        message: "请输入保证率95%"
+        message: '请输入保证率95%',
     },
     assuranceRateNinetyPercent: {
         required: true,
         trigger: 'blur',
-        message: "请输入保证率90%"
+        message: '请输入保证率90%',
     },
 }
 
@@ -184,10 +189,10 @@ const addEditFormClick = async () => {
     if (validate) {
         //发起请求
         addEditFormLoading.value = true
-        const {error, code} = await dataApi.submitForm({
+        const { error, code } = await dataApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -202,9 +207,16 @@ const addEditFormClick = async () => {
 
 //删除
 const delModalClick = () => {
-    delMessage(() => {
-        tableRemoveData()
-    })
+    delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
+     })
 }
 
 //批量删除
@@ -213,7 +225,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,

+ 153 - 133
src/views/tentative/parameter/container.vue

@@ -1,33 +1,37 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box menu">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box menu">
             <div class="hc-menu-header-box">
                 <div class="text-xl name">试验容器</div>
                 <HcTooltip keys="tentative_parameter_container_menu_add">
                     <el-button _icon hc-btn size="small" type="primary" @click="addEditNodeFormModalClick">
-                        <HcIcon name="add"/>
+                        <HcIcon name="add" />
                     </el-button>
                 </HcTooltip>
             </div>
             <div class="hc-menu-contents-box">
                 <el-scrollbar>
-                    <HcMenuSimple :datas="menus" :keys="menuKey" :menus="contextMenu" :props="menuProps"
-                                  @change="menuChange" @menuTap="contextMenuClick"/>
+                    <HcMenuSimple
+                        :datas="menus" :keys="menuKey" :menus="contextMenu" :props="menuProps"
+                        @change="menuChange" @menuTap="contextMenuClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
             <HcCard>
                 <template #header>
                     <div class="w-72">
-                        <el-input v-model="searchForm.queryValue" clearable placeholder="请输入容器编号查询"
-                                  size="large" @keyup="keyUpEvent"/>
+                        <el-input
+                            v-model="searchForm.queryValue" clearable placeholder="请输入容器编号查询"
+                            size="large" @keyup="keyUpEvent"
+                        />
                     </div>
                     <div class="ml-2">
                         <el-button size="large" type="primary" @click="searchClick">
-                            <HcIcon name="search-2"/>
+                            <HcIcon name="search-2" />
                             <span>搜索</span>
                         </el-button>
                     </div>
@@ -35,152 +39,169 @@
                 <template #extra>
                     <HcTooltip keys="tentative_parameter_container_add">
                         <el-button hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_parameter_container_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_parameter_container_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delTableModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_parameter_container_printer">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn>
-                            <HcIcon name="printer"/>
+                            <HcIcon name="printer" />
                             <span>打印</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_parameter_container_import">
                         <el-button hc-btn @click="importModalClick">
-                            <HcIcon name="folder-upload"/>
+                            <HcIcon name="folder-upload" />
                             <span>导入</span>
                         </el-button>
                     </HcTooltip>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection"/>
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                />
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增/编辑 节点-->
-        <HcDialog :show="addEditNodeFormModal" :title="`${addEditNodeFormModel.id?'编辑':'新增'}试验容器`"
-                  isRowFooter widths="30rem" @close="addEditNodeFormModalClose">
+        <!-- 新增/编辑 节点 -->
+        <HcDialog
+            :show="addEditNodeFormModal" :title="`${addEditNodeFormModel.id ? '编辑' : '新增'}试验容器`"
+            is-row-footer widths="30rem" @close="addEditNodeFormModalClose"
+        >
             <el-form :model="addEditNodeFormModel" label-position="top" label-width="auto" size="large">
                 <el-form-item label="试验容器名称">
-                    <el-input v-model="addEditNodeFormModel.containerName" placeholder="请输入试验容器名称"/>
+                    <el-input v-model="addEditNodeFormModel.containerName" placeholder="请输入试验容器名称" />
                 </el-form-item>
                 <template v-for="(item, index) in addEditNodeFormModel.fieldList">
                     <div class="hc-form-item">
                         <el-form-item class="w-32" label="数据类型" style="flex: initial;">
                             <el-select v-model="item.fieldType" block>
-                                <el-option :value="1" label="文本"/>
-                                <el-option :value="2" label="日期框"/>
+                                <el-option :value="1" label="文本" />
+                                <el-option :value="2" label="日期框" />
                             </el-select>
                         </el-form-item>
                         <el-form-item label="字段名">
                             <template #label>
                                 <div class="solt-label">
                                     <span class="mr-1">字段名</span>
-                                    <span v-if="index === 0"
-                                          class="text-xs text-slate-400">第一个作为编号,是唯一的</span>
+                                    <span
+                                        v-if="index === 0"
+                                        class="text-xs text-slate-400"
+                                    >第一个作为编号,是唯一的</span>
                                 </div>
                                 <div class="solt-extra">
-                                    <el-button plain size="small" type="primary"
-                                               @click="addEditNodeDataDel(item,index)">删除
+                                    <el-button
+                                        plain size="small" type="primary"
+                                        @click="addEditNodeDataDel(item, index)"
+                                    >
+                                        删除
                                     </el-button>
                                 </div>
                             </template>
-                            <el-input v-model="item.fieldName" block/>
+                            <el-input v-model="item.fieldName" block />
                         </el-form-item>
                     </div>
                 </template>
             </el-form>
             <template #leftRowFooter>
                 <el-button size="large" @click="addEditNodeDataAdd">
-                    <HcIcon name="add"/>
+                    <HcIcon name="add" />
                     <span>加字段</span>
                 </el-button>
             </template>
             <template #rightRowFooter>
                 <el-button size="large" @click="addEditNodeFormModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
                 <el-button :loading="addEditNodeFormLoading" hc-btn type="primary" @click="addEditNodeFormModalSave">
-                    <HcIcon name="check"/>
+                    <HcIcon name="check" />
                     <span>提交</span>
                 </el-button>
             </template>
         </HcDialog>
 
-        <!--新增/编辑-->
-        <HcDialog :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id?'编辑':'新增'}数据`"
-                  widths="30rem" @close="addEditFormModalClose" @save="addEditFormClick">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id ? '编辑' : '新增'}数据`"
+            widths="30rem" @close="addEditFormModalClose" @save="addEditFormClick"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <template v-for="(item, index) in tableColumn">
                     <el-form-item :label="item.name" :prop="item.key">
-                        <el-input v-if="item.type === 1"
-                                  v-model="addEditFormModel[item.key]"
-                                  :placeholder="`${index===0?'作为编号,是唯一的':'请输入' + item.name}`"/>
-                        <el-date-picker v-if="item.type === 2" v-model="addEditFormModel[item.key]" :clearable="false"
-                                        class="block" type="date" value-format="YYYY-MM-DD"/>
+                        <el-input
+                            v-if="item.type === 1"
+                            v-model="addEditFormModel[item.key]"
+                            :placeholder="`${index === 0 ? '作为编号,是唯一的' : `请输入${item.name}`}`"
+                        />
+                        <el-date-picker
+                            v-if="item.type === 2" v-model="addEditFormModel[item.key]" :clearable="false"
+                            class="block" type="date" value-format="YYYY-MM-DD"
+                        />
                     </el-form-item>
                 </template>
             </el-form>
         </HcDialog>
 
-        <!--导入-->
-        <HcDialog :show="importModal" isRowFooter title="导入" widths="38rem" @close="importModalClose">
-            <HcDragUpload  :datas="uploadData" :action="'/api/blade-business/container/data/import-excel'"    @finished="uploadFinished" @progress="uploadprogress" ref="uploadRef"/>
+        <!-- 导入 -->
+        <HcDialog :show="importModal" is-row-footer title="导入" widths="38rem" @close="importModalClose">
+            <HcDragUpload ref="uploadRef" :datas="uploadData" action="/api/blade-business/container/data/import-excel" @finished="uploadFinished" @progress="uploadprogress" />
             <template #leftRowFooter>
-                <el-button size="large" @click="download" :loading="downloadLoading">
-                    <HcIcon name="download-2"/>
+                <el-button size="large" :loading="downloadLoading" @click="download">
+                    <HcIcon name="download-2" />
                     <span>下载模板</span>
                 </el-button>
             </template>
             <template #rightRowFooter>
                 <el-button size="large" @click="importModalClose">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消导入</span>
                 </el-button>
                 <el-button :loading="importModalLoading" hc-btn type="primary" @click="importModalYesClick">
-                    <HcIcon name="folder-upload"/>
+                    <HcIcon name="folder-upload" />
                     <span>确认导入</span>
                 </el-button>
             </template>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {ref, onMounted, watch} from "vue";
-import {useAppStore} from "~src/store";
-import {HcIsButton} from "~src/plugins/IsButtons";
-import {arrToId, formValidate, getArrValue,downloadBlob} from "js-fast-way"
-import HcDragUpload from "./components/HcDragUpload.vue"
-import dataApi from "~api/tentative/parameter/container"
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import { HcIsButton } from '~src/plugins/IsButtons'
+import { arrToId, downloadBlob, formValidate, getArrValue } from 'js-fast-way'
+import HcDragUpload from './components/HcDragUpload.vue'
+import dataApi from '~api/tentative/parameter/container'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -196,11 +217,11 @@ const menuProps = {
     key: 'id',
     label: 'containerName',
 }
-const menus = ref([]);
+const menus = ref([])
 const getMenusData = async () => {
-    const {data} = await dataApi.queryClassification({
+    const { data } = await dataApi.queryClassification({
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     const arr = getArrValue(data)
     menus.value = arr
@@ -223,18 +244,18 @@ const menuChange = (item) => {
 
 //设置表格头
 const setMenuTableColumn = (data) => {
-    let newArr = [];
+    let newArr = []
     for (let i = 0; i < data.length; i++) {
         newArr.push({
             key: data[i].fieldKey,
             name: data[i].fieldName,
-            type: data[i].fieldType
+            type: data[i].fieldType,
         })
     }
     newArr.push({
         key: 'field_calibration_time',
         name: '校准日期',
-        type: 2
+        type: 2,
     })
     tableColumn.value = newArr
     //取列表数据
@@ -245,18 +266,18 @@ const setMenuTableColumn = (data) => {
 //菜单的右键菜单
 const contextMenu = ref([])
 const setContextMenu = () => {
-    let newArr = [];
+    let newArr = []
     if (HcIsButton('tentative_parameter_container_menu_edit')) {
-        newArr.push({icon: 'draft', label: '编辑容器', key: "edit"})
+        newArr.push({ icon: 'draft', label: '编辑容器', key: 'edit' })
     }
     if (HcIsButton('tentative_parameter_container_menu_del')) {
-        newArr.push({icon: 'delete-bin', label: '删除容器', key: "del"})
+        newArr.push({ icon: 'delete-bin', label: '删除容器', key: 'del' })
     }
     contextMenu.value = newArr
 }
 
 //菜单的右键菜单被点击
-const contextMenuClick = ({key, item}) => {
+const contextMenuClick = ({ key, item }) => {
     if (key === 'edit') {
         addEditNodeFormModel.value = item
         addEditNodeFormModal.value = true
@@ -267,25 +288,25 @@ const contextMenuClick = ({key, item}) => {
 
 //搜索表单
 const searchForm = ref({
-    queryValue: null, current: 1, size: 20, total: 0
+    queryValue: null, current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -299,17 +320,17 @@ const tableData = ref([])
 //获取数据
 const tableLoading = ref(false)
 const getTableData = async () => {
-    const {id, fieldList} = menuItem.value
+    const { id, fieldList } = menuItem.value
     const fieldLists = getArrValue(fieldList)
     if (fieldLists.length > 0) {
         tableLoading.value = true
-        const {error, code, data} = await dataApi.queryPage({
+        const { error, code, data } = await dataApi.queryPage({
             projectId: projectId.value,
             contractId: contractId.value,
             containerId: id,
             ...searchForm.value,
             fieldKey: fieldList[0].fieldKey,
-            id: id
+            id: id,
         })
         //处理数据
         tableLoading.value = false
@@ -326,7 +347,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -336,15 +357,15 @@ const addEditNodeFormModal = ref(false)
 const addEditNodeFormModel = ref({
     containerName: '', fieldList: [{
         fieldType: 1,
-        fieldName: ''
-    }]
+        fieldName: '',
+    }],
 })
 const addEditNodeFormModalClick = () => {
     addEditNodeFormModel.value = {
         containerName: '', fieldList: [{
             fieldType: 1,
-            fieldName: ''
-        }]
+            fieldName: '',
+        }],
     }
     addEditNodeFormModal.value = true
 }
@@ -352,24 +373,24 @@ const addEditNodeFormModalClick = () => {
 //加字段
 const addEditNodeDataAdd = () => {
     if (addEditNodeFormModel.value.fieldList.length > 4) {
-        window.$message?.warning('最多只能添加5个字段');
+        window.$message?.warning('最多只能添加5个字段')
     } else {
         addEditNodeFormModel.value.fieldList.push({
             fieldType: 1,
-            fieldName: ''
+            fieldName: '',
         })
     }
 
 
 }
 //删除当前行
-const addEditNodeDataDel = async ({fieldId}, index) => {
+const addEditNodeDataDel = async ({ fieldId }, index) => {
     if (!fieldId) {
-        addEditNodeFormModel.value.fieldList.splice(index, 1);
+        addEditNodeFormModel.value.fieldList.splice(index, 1)
     } else {
-        const {error, code} = await dataApi.removeField({fieldId})
+        const { error, code } = await dataApi.removeField({ fieldId })
         if (!error && code === 200) {
-            addEditNodeFormModel.value.fieldList.splice(index, 1);
+            addEditNodeFormModel.value.fieldList.splice(index, 1)
         }
     }
 }
@@ -384,7 +405,7 @@ const addEditNodeFormModalSave = () => {
         window.$message.warning('请添加容器字段')
     } else {
         //判断是否满足条件
-        const result = form.fieldList.every(({fieldName}) => {
+        const result = form.fieldList.every(({ fieldName }) => {
             return fieldName !== ''
         })
         if (!result) {
@@ -400,7 +421,7 @@ const addEditNodeFormModalSave = () => {
 //提交保存分类
 const submitClassification = async (form) => {
     addEditNodeFormLoading.value = true
-    const {error, code} = await dataApi.submitClassification(form)
+    const { error, code } = await dataApi.submitClassification(form)
     //处理数据
     addEditNodeFormLoading.value = false
     if (!error && code === 200) {
@@ -417,23 +438,23 @@ const addEditNodeFormModalClose = () => {
 
 //删除分类
 const delNodeModalClick = (id) => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 removeClassification(id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
     })
+    
 }
 
 //删除容器
 const removeClassification = async (id) => {
     //删除请求
-    const {error, code} = await dataApi.removeClassification({
+    const { error, code } = await dataApi.removeClassification({
         projectId: projectId.value,
         contractId: contractId.value,
         id: id,
@@ -452,15 +473,15 @@ const addEditFormRules = ref({})
 
 //处理表单校验
 const setAddEditFormRules = (fieldList) => {
-    let newArr = {};
+    let newArr = {}
     for (let i = 0; i < fieldList.length; i++) {
-        const item = fieldList[i];
+        const item = fieldList[i]
         if (i === 0) {
             newArr[item.key] = {
                 required: true,
                 validator: async (rule, value, callback) => {
                     if (!value) {
-                        callback(new Error("请输入" + item.name))
+                        callback(new Error('请输入' + item.name))
                     } else {
                         const ver = await verification(item.key, value)
                         if (!ver) {
@@ -470,7 +491,7 @@ const setAddEditFormRules = (fieldList) => {
                         }
                     }
                 },
-                trigger: 'blur'
+                trigger: 'blur',
             }
         }
         // else if (item.type === 1) {
@@ -492,20 +513,20 @@ const setAddEditFormRules = (fieldList) => {
 
 //校验材料编号是否唯一
 const verification = async (key, val) => {
-    const {containerInitTabName} = menuItem.value
+    const { containerInitTabName } = menuItem.value
     const form = addEditFormModel.value
-    const {error, code, data} = await dataApi.verification({
+    const { error, code, data } = await dataApi.verification({
         projectId: projectId.value,
         contractId: contractId.value,
         id: form['id'] ?? '',
         bean: {
             fieldKey: key,
-            fieldValue: val
+            fieldValue: val,
         },
-        containerInitTabName: containerInitTabName
+        containerInitTabName: containerInitTabName,
     })
     if (!error && code === 200) {
-        return data === '编号可以使用';
+        return data === '编号可以使用'
     } else {
         return false
     }
@@ -540,27 +561,27 @@ const addEditFormClick = async () => {
     const validate = await formValidate(addEditFormRef.value)
 
     if (validate) {
-        const {containerInitTabName} = menuItem.value
+        const { containerInitTabName } = menuItem.value
         const form = addEditFormModel.value
         addEditFormLoading.value = true
         //处理数据格式
-        let beanList = [];
+        let beanList = []
         Object.keys(form).forEach(key => {
             if (key !== 'field_calibration_time') {
                 beanList.push({
                     fieldKey: key,
-                    fieldValue: form[key]
+                    fieldValue: form[key],
                 })
             }
         })
         //发起请求
-        const {error, code} = await dataApi.submitForm({
+        const { error, code } = await dataApi.submitForm({
             projectId: projectId.value,
             contractId: contractId.value,
             beanList,
             containerInitTabName,
             fieldCalibrationTime: form['field_calibration_time'],
-            id: form['id'] ?? ''
+            id: form['id'] ?? '',
         })
         //处理数据
 
@@ -571,23 +592,22 @@ const addEditFormClick = async () => {
             addEditFormLoading.value = false
 
             await getTableData()
-            console.log(addEditFormLoading.value, 'addEditFormLoading.value');
+            console.log(addEditFormLoading.value, 'addEditFormLoading.value')
         }
     }
 }
 
 //删除数据
 const delTableModalClick = () => {
-    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
-        showCancelButton: true,
-        confirmButtonText: '确认删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-        callback: (action) => {
+    delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
+                instance.confirmButtonLoading = true
                 tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
             }
-        }
     })
 }
 
@@ -596,9 +616,9 @@ const tableRemoveData = async () => {
     const rows = tableCheckedKeys.value
     if (rows.length > 0) {
         const ids = arrToId(rows)
-        const {containerInitTabName} = menuItem.value
+        const { containerInitTabName } = menuItem.value
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             containerInitTabName: containerInitTabName,
@@ -614,16 +634,16 @@ const tableRemoveData = async () => {
 
 //导入
 const importModal = ref(false)
-const uploadData=ref({})
+const uploadData = ref({})
 const importModalClick = () => {
-    const {containerInitTabName} = menuItem.value
+    const { containerInitTabName } = menuItem.value
     importModal.value = true
     importModalLoading.value = false
     uploadData.value = {
         containerInitTabName: containerInitTabName,
     }
 }
-const uploadRef=ref(null)
+const uploadRef = ref(null)
 //上传完成
 const uploadFinished = (res) => {
     importModalLoading.value = false
@@ -639,7 +659,7 @@ const uploadprogress = (res) => {
 
 //确认导入
 const importModalLoading = ref(false)
-const importModalYesClick = async() => {
+const importModalYesClick = async () => {
      uploadRef.value?.submit()
   
    
@@ -653,10 +673,10 @@ const importModalYesClick = async() => {
 const importModalClose = () => {
     importModal.value = false
 }
-const downloadLoading=ref(false)
-const download=async()=>{
+const downloadLoading = ref(false)
+const download = async ()=>{
     downloadLoading.value = true
-    const {error, disposition, res} = await dataApi.downloadTemplate({id: menuKey.value})
+    const { error, disposition, res } = await dataApi.downloadTemplate({ id: menuKey.value })
       //处理数据
       downloadLoading.value = false
     if (!error) {
@@ -668,18 +688,18 @@ const download=async()=>{
     }
 }
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(240);
+const leftWidth = ref(240)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 220 && diffVal <= 400) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>

+ 51 - 39
src/views/tentative/parameter/density.vue

@@ -4,60 +4,65 @@
             <template #header>
                 <HcTooltip keys="tentative_parameter_density_add">
                     <el-button hc-btn type="primary" @click="addFormModalClick">
-                        <HcIcon name="add-circle"/>
+                        <HcIcon name="add-circle" />
                         <span>新增</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="tentative_parameter_density_edit">
                     <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                        <HcIcon name="edit"/>
+                        <HcIcon name="edit" />
                         <span>编辑</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="tentative_parameter_density_del">
                     <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delModalClick">
-                        <HcIcon name="delete-bin-2"/>
+                        <HcIcon name="delete-bin-2" />
                         <span>删除</span>
                     </el-button>
                 </HcTooltip>
             </template>
-            <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                     @selection-change="tableSelection"></HcTable>
+            <HcTable
+                ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                @selection-change="tableSelection"
+            />
             <template #action>
-                <HcPages :pages="searchForm" @change="pageChange"/>
+                <HcPages :pages="searchForm" @change="pageChange" />
             </template>
         </HcCard>
 
-        <!--新增/编辑-->
-        <HcDialog :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id?'编辑':'新增'}温度信息`"
-                  widths="30rem" @close="addEditFormModalClose" @save="addEditFormClick">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id ? '编辑' : '新增'}温度信息`"
+            widths="30rem" @close="addEditFormModalClose" @save="addEditFormClick"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <el-form-item label="温度" prop="temperature">
-                    <el-input v-model="addEditFormModel.temperature"/>
+                    <el-input v-model="addEditFormModel.temperature" />
                 </el-form-item>
                 <el-form-item label="水密度" prop="waterDensity">
-                    <el-input v-model="addEditFormModel.waterDensity"/>
+                    <el-input v-model="addEditFormModel.waterDensity" />
                 </el-form-item>
             </el-form>
         </HcDialog>
-
     </div>
 </template>
 
 <script setup>
-import {onMounted, ref} from "vue";
-import {useAppStore} from "~src/store";
-import dataApi from "~api/tentative/parameter/density"
-import {formValidate, getArrValue, arrToId} from "js-fast-way"
-import {delMessage} from "~uti/tools";
+import { onMounted, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import dataApi from '~api/tentative/parameter/density'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
 
 //全局变量
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 
 //渲染完成
 onMounted(() => {
@@ -66,25 +71,25 @@ onMounted(() => {
 
 //搜索表单
 const searchForm = ref({
-    queryValue: null, current: 1, size: 20, total: 0
+    queryValue: null, current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -93,8 +98,8 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'temperature', name: '温度'},
-    {key: 'waterDensity', name: '密度'},
+    { key: 'temperature', name: '温度' },
+    { key: 'waterDensity', name: '密度' },
 ])
 
 //获取数据
@@ -102,10 +107,10 @@ const tableLoading = ref(false)
 const tableData = ref([])
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         ...searchForm.value,
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     //处理数据
     tableLoading.value = false
@@ -119,7 +124,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -150,12 +155,12 @@ const addEditFormRules = {
     temperature: {
         required: true,
         trigger: 'blur',
-        message: "请输入温度"
+        message: '请输入温度',
     },
     waterDensity: {
         required: true,
         trigger: 'blur',
-        message: "请输入密度"
+        message: '请输入密度',
     },
 }
 
@@ -166,10 +171,10 @@ const addEditFormClick = async () => {
     if (validate) {
         addEditFormLoading.value = true
         //发起请求
-        const {error, code} = await dataApi.submitForm({
+        const { error, code } = await dataApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -184,9 +189,16 @@ const addEditFormClick = async () => {
 
 //删除
 const delModalClick = () => {
-    delMessage(() => {
-        tableRemoveData()
-    })
+    delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                await tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
+     })
 }
 
 //批量删除
@@ -195,7 +207,7 @@ const tableRemoveData = async () => {
     if (rows.length > 0) {
         const ids = arrToId(rows)
         //删除请求
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,

+ 119 - 93
src/views/tentative/parameter/sieve.vue

@@ -1,22 +1,24 @@
 <template>
     <div class="hc-page-layout-box">
-        <div :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box menu">
+        <div :style="`width:${leftWidth}px;`" class="hc-layout-left-box menu">
             <div class="hc-menu-header-box">
                 <div class="text-xl name">自定义筛孔类型</div>
                 <HcTooltip keys="tentative_parameter_sieve_menu_add">
                     <el-button _icon hc-btn size="small" type="primary" @click="addEditNodeFormModalClick">
-                        <HcIcon name="add"/>
+                        <HcIcon name="add" />
                     </el-button>
                 </HcTooltip>
             </div>
             <div class="hc-menu-contents-box">
                 <el-scrollbar>
-                    <HcMenuSimple :datas="menus" :keys="menuKey" :menus="contextMenu" :props="menuProps"
-                                  @change="menuChange" @menuTap="contextMenuClick"/>
+                    <HcMenuSimple
+                        :datas="menus" :keys="menuKey" :menus="contextMenu" :props="menuProps"
+                        @change="menuChange" @menuTap="contextMenuClick"
+                    />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box">
             <HcCard>
@@ -33,78 +35,88 @@
                 </template> -->
                 <template #extra>
                     <HcTooltip keys="tentative_parameter_sieve_add">
-                        <el-button :disabled="menus.length <1 " hc-btn type="primary" @click="addFormModalClick">
-                            <HcIcon name="add-circle"/>
+                        <el-button :disabled="menus.length < 1 " hc-btn type="primary" @click="addFormModalClick">
+                            <HcIcon name="add-circle" />
                             <span>新增</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_parameter_sieve_edit">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="editFormModalClick">
-                            <HcIcon name="edit"/>
+                            <HcIcon name="edit" />
                             <span>编辑</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_parameter_sieve_del">
                         <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="delNodeModalClick">
-                            <HcIcon name="delete-bin-2"/>
+                            <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
                     </HcTooltip>
                 </template>
-                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck
-                         @selection-change="tableSelection"/>
+                <HcTable
+                    ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
+                    @selection-change="tableSelection"
+                />
                 <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
+                    <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
             </HcCard>
         </div>
 
-        <!--新增/编辑 节点-->
-        <HcDialog :loading="addEditNodeFormLoading" :show="addEditNodeFormModal" :title="`${addEditNodeFormModel.id?'编辑':'新增'}类型`"
-                  widths="30rem" @close="addEditNodeFormModalClose" @save="addEditNodeFormModalSave">
-            <el-form ref="addEditNodeFormRef" :model="addEditNodeFormModel" :rules="addEditNodeFormRules"
-                     label-position="top" label-width="auto" size="large">
+        <!-- 新增/编辑 节点 -->
+        <HcDialog
+            :loading="addEditNodeFormLoading" :show="addEditNodeFormModal" :title="`${addEditNodeFormModel.id ? '编辑' : '新增'}类型`"
+            widths="30rem" @close="addEditNodeFormModalClose" @save="addEditNodeFormModalSave"
+        >
+            <el-form
+                ref="addEditNodeFormRef" :model="addEditNodeFormModel" :rules="addEditNodeFormRules"
+                label-position="top" label-width="auto" size="large"
+            >
                 <el-form-item label="类型名称" prop="name">
-                    <el-input v-model="addEditNodeFormModel.name" placeholder="请输入类型名称"/>
+                    <el-input v-model="addEditNodeFormModel.name" placeholder="请输入类型名称" />
                 </el-form-item>
             </el-form>
         </HcDialog>
 
-        <!--新增/编辑-->
-        <HcDialog :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id?'编辑':'新增'}筛孔尺寸信息`"
-                  widths="45rem" @close="addEditFormModalClose" @save="addEditFormClick">
-            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
-                     size="large">
+        <!-- 新增/编辑 -->
+        <HcDialog
+            :loading="addEditFormLoading" :show="addEditFormModal" :title="`${addEditFormModel.id ? '编辑' : '新增'}筛孔尺寸信息`"
+            widths="45rem" @close="addEditFormModalClose" @save="addEditFormClick"
+        >
+            <el-form
+                ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto"
+                size="large"
+            >
                 <div class="hc-form-item">
                     <el-form-item label="筛孔尺寸" prop="sievePoreSize">
-                        <el-input v-model="addEditFormModel.sievePoreSize"/>
+                        <el-input v-model="addEditFormModel.sievePoreSize" />
                     </el-form-item>
                     <el-form-item label="标准" prop="standard">
-                        <el-input v-model="addEditFormModel.standard"/>
+                        <el-input v-model="addEditFormModel.standard" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="下限" prop="lowerLimit">
-                        <el-input v-model="addEditFormModel.lowerLimit"/>
+                        <el-input v-model="addEditFormModel.lowerLimit" />
                     </el-form-item>
                     <el-form-item label="上限" prop="upperLimit">
-                        <el-input v-model="addEditFormModel.upperLimit"/>
+                        <el-input v-model="addEditFormModel.upperLimit" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="限制区界限最大" prop="maxLimitBoundary">
-                        <el-input v-model="addEditFormModel.maxLimitBoundary"/>
+                        <el-input v-model="addEditFormModel.maxLimitBoundary" />
                     </el-form-item>
                     <el-form-item label="限制区界限最小" prop="minLimitBoundary">
-                        <el-input v-model="addEditFormModel.minLimitBoundary"/>
+                        <el-input v-model="addEditFormModel.minLimitBoundary" />
                     </el-form-item>
                 </div>
                 <div class="hc-form-item">
                     <el-form-item label="控制点界限最大" prop="maxLimitControl">
-                        <el-input v-model="addEditFormModel.maxLimitControl"/>
+                        <el-input v-model="addEditFormModel.maxLimitControl" />
                     </el-form-item>
                     <el-form-item label="控制点界限最小" prop="minLimitControl">
-                        <el-input v-model="addEditFormModel.minLimitControl"/>
+                        <el-input v-model="addEditFormModel.minLimitControl" />
                     </el-form-item>
                 </div>
             </el-form>
@@ -113,22 +125,22 @@
 </template>
 
 <script setup>
-import {ref, onMounted, watch} from "vue";
-import {useAppStore} from "~src/store";
-import {HcIsButton} from "~src/plugins/IsButtons";
-import {formValidate, getArrValue, arrToId} from "js-fast-way"
-import dataApi from "~api/tentative/parameter/sieve"
-import {delMessage} from "~uti/tools";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import { HcIsButton } from '~src/plugins/IsButtons'
+import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import dataApi from '~api/tentative/parameter/sieve'
+import { delMessageV2 } from '~com/message/index.js'
 
 //初始变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -141,15 +153,15 @@ onMounted(() => {
 
 //左侧菜单
 const menuKey = ref('')
-const menus = ref([]);
+const menus = ref([])
 const menuProps = {
     key: 'id',
     label: 'name',
 }
 const queryClassification = async () => {
-    const {data} = await dataApi.queryClassification({
+    const { data } = await dataApi.queryClassification({
         projectId: projectId.value,
-        contractId: contractId.value
+        contractId: contractId.value,
     })
     const arr = getArrValue(data)
     menus.value = arr
@@ -163,7 +175,7 @@ const menuItem = ref({})
 const menuChange = (item) => {
     menuItem.value = item
     menuKey.value = item?.id
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     searchForm.value.classId = item?.id
     getTableData()
 }
@@ -171,26 +183,33 @@ const menuChange = (item) => {
 //菜单的右键菜单
 const contextMenu = ref([])
 const setContextMenu = () => {
-    let newArr = [];
+    let newArr = []
     if (HcIsButton('tentative_parameter_sieve_menu_edit')) {
-        newArr.push({icon: 'draft', label: '编辑分类', key: "edit"})
+        newArr.push({ icon: 'draft', label: '编辑分类', key: 'edit' })
     }
     if (HcIsButton('tentative_parameter_sieve_menu_del')) {
-        newArr.push({icon: 'delete-bin', label: '删除分类', key: "del"})
+        newArr.push({ icon: 'delete-bin', label: '删除分类', key: 'del' })
     }
     contextMenu.value = newArr
 }
 
 //菜单的右键菜单被点击
 const contextMenuItem = ref({})
-const contextMenuClick = ({key, item}) => {
+const contextMenuClick = ({ key, item }) => {
     contextMenuItem.value = item
     if (key === 'edit') {
         addEditNodeFormModel.value = item
         addEditNodeFormModal.value = true
     } else if (key === 'del') {
-        delMessage(() => {
-            delClassification(item)
+        delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                delClassification(item)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
         })
     }
 }
@@ -198,25 +217,25 @@ const contextMenuClick = ({key, item}) => {
 //搜索表单
 const searchForm = ref({
     classId: null, queryValue: null,
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,
 })
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchForm.value.current = 1
         getTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -225,14 +244,14 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key: 'sievePoreSize', name: '筛孔尺寸'},
-    {key: 'lowerLimit', name: '下限'},
-    {key: 'upperLimit', name: '上限'},
-    {key: 'standard', name: '标准'},
-    {key: 'maxLimitBoundary', name: '限制区最大'},
-    {key: 'minLimitBoundary', name: '限制区最小'},
-    {key: 'maxLimitControl', name: '控制点最大'},
-    {key: 'minLimitControl', name: '控制点最小'},
+    { key: 'sievePoreSize', name: '筛孔尺寸' },
+    { key: 'lowerLimit', name: '下限' },
+    { key: 'upperLimit', name: '上限' },
+    { key: 'standard', name: '标准' },
+    { key: 'maxLimitBoundary', name: '限制区最大' },
+    { key: 'minLimitBoundary', name: '限制区最小' },
+    { key: 'maxLimitControl', name: '控制点最大' },
+    { key: 'minLimitControl', name: '控制点最小' },
 ])
 const tableData = ref([])
 
@@ -240,10 +259,10 @@ const tableData = ref([])
 const tableLoading = ref(false)
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await dataApi.queryPage({
+    const { error, code, data } = await dataApi.queryPage({
         projectId: projectId.value,
         contractId: contractId.value,
-        ...searchForm.value
+        ...searchForm.value,
     })
     //处理数据
     tableLoading.value = false
@@ -257,7 +276,7 @@ const getTableData = async () => {
 }
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
     tableCheckedKeys.value = rows
 }
@@ -265,12 +284,12 @@ const tableSelection = (rows) => {
 //新增/编辑 分类
 const addEditNodeFormModal = ref(false)
 const addEditNodeFormRef = ref(null)
-const addEditNodeFormModel = ref({name: ''})
+const addEditNodeFormModel = ref({ name: '' })
 const addEditNodeFormRules = {
     name: {
         required: true,
         trigger: 'blur',
-        message: "请输入分类名称"
+        message: '请输入分类名称',
     },
 }
 
@@ -287,10 +306,10 @@ const addEditNodeFormModalSave = async () => {
     if (validate) {
         addEditNodeFormLoading.value = true
         //发起请求
-        const {error, code} = await dataApi.submitClassification({
+        const { error, code } = await dataApi.submitClassification({
             ...addEditNodeFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -314,7 +333,7 @@ const addEditNodeFormModalClose = () => {
 //删除分类
 const delClassification = async (item) => {
     //删除请求
-    const {error, code} = await dataApi.removeField({
+    const { error, code } = await dataApi.removeField({
         projectId: projectId.value,
         contractId: contractId.value,
         id: item.id,
@@ -329,9 +348,9 @@ const delClassification = async (item) => {
 //新增/编辑
 const addEditFormModal = ref(false)
 const addFormModalClick = () => {
-    const {id} = menuItem.value
+    const { id } = menuItem.value
     addEditFormModel.value = {
-        classId: id
+        classId: id,
     }
     addEditFormModal.value = true
 }
@@ -355,42 +374,42 @@ const addEditFormRules = {
     sievePoreSize: {
         required: true,
         trigger: 'blur',
-        message: "请输入筛孔尺寸"
+        message: '请输入筛孔尺寸',
     },
     standard: {
         required: true,
         trigger: 'blur',
-        message: "请输入标准"
+        message: '请输入标准',
     },
     upperLimit: {
         required: true,
         trigger: 'blur',
-        message: "请输入上限"
+        message: '请输入上限',
     },
     lowerLimit: {
         required: true,
         trigger: 'blur',
-        message: "请输入下限"
+        message: '请输入下限',
     },
     maxLimitBoundary: {
         required: true,
         trigger: 'blur',
-        message: "请输入限制区界限最大"
+        message: '请输入限制区界限最大',
     },
     minLimitBoundary: {
         required: true,
         trigger: 'blur',
-        message: "请输入限制区界限最小"
+        message: '请输入限制区界限最小',
     },
     maxLimitControl: {
         required: true,
         trigger: 'blur',
-        message: "请输入控制点界限最小"
+        message: '请输入控制点界限最小',
     },
     minLimitControl: {
         required: true,
         trigger: 'blur',
-        message: "请输入标准"
+        message: '请输入标准',
     },
 }
 
@@ -401,10 +420,10 @@ const addEditFormClick = async () => {
     if (validate) {
         addEditFormLoading.value = true
         //发起请求
-        const {error, code} = await dataApi.submitForm({
+        const { error, code } = await dataApi.submitForm({
             ...addEditFormModel.value,
             projectId: projectId.value,
-            contractId: contractId.value
+            contractId: contractId.value,
         })
         //处理数据
 
@@ -420,9 +439,16 @@ const addEditFormClick = async () => {
 
 //删除分类
 const delNodeModalClick = () => {
-    delMessage(() => {
-        tableRemoveData()
-    })
+    delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                tableRemoveData()
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
+     })
 }
 
 //批量删除
@@ -430,7 +456,7 @@ const tableRemoveData = async () => {
     const rows = tableCheckedKeys.value
     if (rows.length > 0) {
         const ids = arrToId(rows)
-        const {error, code} = await dataApi.removeData({
+        const { error, code } = await dataApi.removeData({
             projectId: projectId.value,
             contractId: contractId.value,
             ids: ids,
@@ -444,18 +470,18 @@ const tableRemoveData = async () => {
 }
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(240);
+const leftWidth = ref(240)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
+        let diffVal = ve.clientX - leftNum
         if (diffVal >= 220 && diffVal <= 400) {
-            leftWidth.value = diffVal;
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>