调整检测首页布局;根据不同的功能,实现不同的表格展示

This commit is contained in:
GYYM
2024-11-14 11:45:25 +08:00
parent 65cb7826d3
commit 8f89252d8b
5 changed files with 136 additions and 36 deletions

View File

@@ -71,11 +71,11 @@
>
<el-button type="primary" v-if="form.activeTabs === 3"
>报告批量生成</el-button
>批量生成</el-button
>
<el-button type="primary" v-if="form.activeTabs === 4"
>设备批量归档</el-button
>批量归档</el-button
>
</el-form-item>
</el-form>
@@ -86,9 +86,40 @@
type="primary"
link
:icon="View"
@click="openDrawer('报告查看', scope.row)"
@click="openDrawer('查看', scope.row)"
v-if="form.activeTabs === 3 && form.activeChildTabs === 0"
>查看</el-button
>
<div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 1">
<el-dropdown trigger='click'>
<el-button link type='primary' :icon="View" class='table-operate'>
<div class='table-operate-text'>查看...</div>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>Q/GDW 10650.2-2021 报告</el-dropdown-item>
<el-dropdown-item>Q/GDW 1650.2-2016 报告</el-dropdown-item>
<el-dropdown-item>GBT 19862-2016 报告</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<el-button
type="primary"
link
:icon="EditPen"
@click="openDrawer('生成', scope.row)"
v-if="form.activeTabs === 3"
>报告查看</el-button
>生成</el-button
>
<el-button
type="primary"
link
:icon="EditPen"
@click="openDrawer('归档', scope.row)"
v-if="form.activeTabs === 4"
>归档</el-button
>
<el-button
type="primary"
@@ -114,7 +145,7 @@
import { useRouter } from "vue-router";
import type { Device } from '@/api/device/interface'
import { useHandleData } from "@/hooks/useHandleData";
import { ElMessage, ElMessageBox } from "element-plus";
import { ElMessage, ElMessageBox, ElLoading} from "element-plus";
import ProTable from "@/components/ProTable/index.vue";
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
import {
@@ -245,6 +276,7 @@ let checkResultList = reactive([
//查询条件
const form: any = ref({
activeTabs: 0, //功能选择
activeChildTabs: 0,//子功能选择
checkStatus: 0, //检测状态
checkReportStatus: 0, //检测报告状态
checkResult: 0, //检测结果
@@ -552,10 +584,11 @@ const changeStatus = async (row: User.ResUserList) => {
proTable.value?.getTableList();
};
//顶部功能切换时修改activeTabs
const changeActiveTabs = (val: number) => {
const changeActiveTabs = (val: number,val2: number) => {
form.value.activeTabs = val;
form.value.activeChildTabs= val2;
tableHeaderInit(val)
console.log(form,val,666)
console.log(form,val,val2,666)
};
//根据当前功能,初始化表头下拉框中的默认值和禁用值
@@ -600,7 +633,7 @@ function tableHeaderInit(val: number) {
disableCheckStatus("归档")
disableCheckReportStatus("未生成报告")
disablecheckResultList("未出结果")
operationShow.value = false;
operationShow.value = true;
break;
case 5://设备浏览
operationShow.value = true;
@@ -663,14 +696,35 @@ const handleTest = () => {
}
};
// 打开 drawer(新增、查看、编辑)
const openDrawer = (title: string, row: any) => {
if (title === '报告查看')
console.log(title);
if (title === '查看')
{
console.log(title);
const link = document.createElement('a');
const fileUrl = 'G:/南网数研院非结构化数据生成程序MMS_JSON修改记录.docx'; // 文件路径
link.href = fileUrl;
link.target = '_blank'; // 在新标签页中打开
link.download = 'file.docx'; // 设置下载文件的名称
link.click();
}
else if (title === '误差体系编辑')
console.log(title);
if (title === '归档')
{
const loading = ElLoading.service({
lock: true,
text: '归档中...',
background: 'rgba(0, 0, 0, 0.7)',
})
setTimeout(() => {
loading.close()
ElMessage.success("归档成功");
}, 2000)
}
}
onMounted(() => {