修改测试问题

This commit is contained in:
guanj
2026-06-11 20:27:37 +08:00
parent bda7373133
commit 1a09c31669
61 changed files with 3393 additions and 2406 deletions

View File

@@ -1,55 +1,26 @@
<template>
<div>
<!-- 监测点列表 -->
<TableHeader
ref="TableHeaderRef"
:showReset="false"
@selectChange="selectChange"
v-if="fullscreen"
:timeKeyList="prop.timeKey"
>
<TableHeader ref="TableHeaderRef" :showReset="false" @selectChange="selectChange" v-if="fullscreen"
:timeKeyList="prop.timeKey">
<template #select>
<el-form-item label="关键字筛选">
<el-input maxlength="32" show-word-limit
style="width: 240px"
v-model.trim="tableStore.table.params.searchValue"
clearable
placeholder="请输入监测点名称"
/>
<el-input maxlength="32" show-word-limit style="width: 240px"
v-model.trim="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" />
</el-form-item>
</template>
</TableHeader>
<Table
ref="tableRef"
@cell-click="cellClickEvent"
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? -58 : 56}px )`"
></Table>
<Table ref="tableRef" @cell-click="cellClickEvent"
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? -58 : 56}px )`"></Table>
<!-- 指标越限详情 -->
<OverLimitDetails ref="OverLimitDetailsRef" />
<!-- 上传对话框 -->
<el-dialog
v-model="uploadDialogVisible"
title="上传报告"
append-to-body
width="500px"
@closed="handleDialogClosed"
>
<el-upload
ref="uploadRef"
class="upload-demo"
action=""
accept=".doc,.docx,.PDF"
:on-change="handleChange"
:before-upload="beforeUpload"
:limit="1"
:auto-upload="false"
:on-exceed="handleExceed"
:on-remove="handleRemove"
:file-list="fileList"
>
<el-dialog v-model="uploadDialogVisible" title="上传报告" append-to-body width="500px" @closed="handleDialogClosed">
<el-upload ref="uploadRef" class="upload-demo" action="" accept=".doc,.docx,.PDF" :on-change="handleChange"
:before-upload="beforeUpload" :limit="1" :auto-upload="false" :on-exceed="handleExceed"
:on-remove="handleRemove" :file-list="fileList">
<el-button type="primary">点击上传</el-button>
<template #tip>
<div class="el-upload__tip">请上传Word或PDF文件</div>
@@ -73,7 +44,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import OverLimitDetails from '@/components/cockpit/monitoringPointList/components/overLimitDetails.vue'
import TableHeader from '@/components/table/header/index.vue'
import { uploadReport, getReportUrl } from '@/api/harmonic-boot/cockpit/cockpit'
import { getTime } from '@/utils/formatTime'
const prop = defineProps({
w: { type: [String, Number] },
@@ -82,7 +53,8 @@ const prop = defineProps({
height: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
interval: { type: Number },
flag: { type: Boolean }
})
const headerHeight = ref(57)
@@ -135,16 +107,19 @@ const tableStore: any = new TableStore({
{
title: '监测点名称',
field: 'lineName',
minWidth: '120',
minWidth: 120,
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.lineName}</span>`
}
},
{ title: '设备名称', field: 'devName', minWidth: 130, align: 'center' },
{ title: '项目名称', field: 'projectName', minWidth: 130, align: 'center' },
{ title: '工程名称', field: 'engineeringName', minWidth: 130, align: 'center' },
{
title: '监测类型',
field: 'position',
minWidth: '80',
minWidth: '100',
formatter: (row: any) => {
return row.cellValue || '/'
}
@@ -162,28 +137,22 @@ const tableStore: any = new TableStore({
title: '监测点状态',
field: 'runStatus',
render: 'tag',
width: 100,
width: 90,
custom: {
停运: 'danger',
退运: 'danger',
运行: 'success',
在线: 'success',
中断: 'warning',
离线: 'danger',
检修: 'warning',
调试: 'warning',
// 0运行1检修2停运3调试4退运
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'info'
},
replaceValue: {
运行: '运行',
在线: '在线',
退运: '退运',
停运: '停运',
中断: '中断',
检修: '检修',
离线: '离线',
调试: '调试',
0: '运行',
1: '检修',
2: '运',
3: '调试',
4: '退运',
null: '/'
}
},
@@ -192,21 +161,21 @@ const tableStore: any = new TableStore({
field: 'volGrade',
minWidth: '80',
formatter: (row: any) => {
return row.cellValue == 0 ? '/' : row.cellValue || '/'
return row.cellValue == 0 ? '/' : row.cellValue || '/'
}
},
{
title: '治理对象',
field: 'sensitiveUser',
minWidth: '90',
minWidth: '100',
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: '是否治理',
title: '治理方案',
field: 'govern',
minWidth: '80',
formatter: (row: any) => {
@@ -241,7 +210,7 @@ const tableStore: any = new TableStore({
// }
// },
{
title: '报告',
title: '治理前报告',
field: 'reportFilePath',
minWidth: '150',
formatter: (row: any) => {
@@ -347,7 +316,7 @@ const downloadTheReport = (lineId: string, name: string) => {
forceDownloadPdf(res.data, name.split('/').pop() || '')
})
}
const forceDownloadPdf = async (pdfUrl:any, fileName = '文件.pdf') => {
const forceDownloadPdf = async (pdfUrl: any, fileName = '文件.pdf') => {
try {
// 1. 请求 PDF 并转为 Blob关键绕开浏览器直接解析
const response = await fetch(pdfUrl, {
@@ -374,9 +343,9 @@ const forceDownloadPdf = async (pdfUrl:any, fileName = '文件.pdf') => {
// 4. 清理资源(避免内存泄漏)
document.body.removeChild(a)
URL.revokeObjectURL(blobUrl)
setTimeout(() => {
ElMessage.success('下载成功')
}, 2000)
setTimeout(() => {
ElMessage.success('下载成功')
}, 2000)
} catch (error) {
console.error('下载失败:', error)
// ElMessage.error('文件下载失败,请检查网络或文件地址') // 适配 Element Plus
@@ -456,6 +425,12 @@ const handleUpload = async () => {
onMounted(() => {
tableStore.index()
})
watch(
() => prop.flag,
val => {
tableStore.showPage = fullscreen.value ? true : false
}
)
watch(
() => prop.timeKey,
val => {