标准设备,比对模式被检设备

This commit is contained in:
sjl
2025-07-09 20:12:40 +08:00
parent d2f0382bd9
commit cc848b1ffb
39 changed files with 2247 additions and 285 deletions

View File

@@ -7,8 +7,8 @@
>
<!-- 表格 header 按钮 -->
<template #tableHeader='scope'>
<el-button type='primary' v-auth.plan="'import'" :icon='Download' @click='importClick'>导入</el-button>
<el-button type='primary' v-auth.plan="'export'" :icon='Upload' @click='exportClick'>导出</el-button>
<el-button type='primary' v-auth.plan="'import'" :icon='Download' @click='importClick' v-if="modeStore.currentMode != '比对式'">导入</el-button>
<el-button type='primary' v-auth.plan="'export'" :icon='Upload' @click='exportClick' v-if="modeStore.currentMode != '比对式'">导出</el-button>
<el-button type='primary' v-auth.plan="'combine'" :icon='ScaleToOriginal' :disabled='!(scope.selectedList.length > 1)' @click='combineClick'>
合并
</el-button>
@@ -23,6 +23,7 @@
<template #operation='scope'>
<el-button type='primary' v-auth.plan="'edit'" link :icon='EditPen' @click="openDialog('edit',scope.row)">编辑</el-button>
<el-button type='primary' v-auth.plan="'delete'" link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
<el-button type='primary' link :icon='List' @click="openTestSource(scope.row)">子计划</el-button>
<!-- <el-button type='primary' link :icon='List' @click='showDeviceOpen(scope.row)'>设备绑定</el-button> -->
<el-button type='primary' v-auth.plan="'analysis'" link :icon='List' v-if="scope.row.testState == '2'" @click='statisticalAnalysis(scope.row)'>统计分析</el-button>
</template>
@@ -38,7 +39,7 @@
<!-- 查看设备绑定
<DevTransfer :refresh-table='proTable?.getTableList' ref='devTransferPopup'/> -->
<ImportExcel ref='planImportExcel' />
<SourceOpen :refresh-table='proTable?.getTableList' ref='openSourceView' :width='viewWidth' :height='viewHeight'></SourceOpen>
</template>
@@ -51,7 +52,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
import type { Plan } from '@/api/plan/interface'
import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
import DeviceOpen from '@/views/plan/planList/components/devPopup.vue'
import SourceOpen from '@/views/plan/planList/components/sourcePopup.vue'
import SourceOpen from '@/views/plan/planList/components/chidrenPlan.vue'
import DevTransfer from './components/devTransfer.vue'
import { useViewSize } from '@/hooks/useViewSize'
import { useRouter } from 'vue-router'
@@ -62,7 +63,7 @@ import type { ErrorSystem } from '@/api/error/interface'
import ErrorStandardPopup from '@/views/machine/errorSystem/components/errorStandardPopup.vue' // 导入子组件
import TestSourcePopup from '@/views/machine/testSource/components/testSourcePopup.vue' // 导入子组件
import { type TestSource } from '@/api/device/interface/testSource'
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
import { useAppSceneStore, useModeStore } from '@/stores/modules/mode'; // 引入模式 store
import { useHandleData } from '@/hooks/useHandleData'
import { dictTestState,dictReportState,dictResult } from '@/api/plan/planData.ts'
import {getTestSourceById} from '@/api/device/testSource/index'
@@ -105,6 +106,7 @@ const getTableList = async(params: any) => {
}
}
const { popupBaseView, viewWidth, viewHeight } = useViewSize()
const dataSourceType = computed(() => {
// switch (modeStore.currentMode) {
@@ -138,10 +140,28 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
fieldNames: { label: 'label', value: 'id' },
render: scope => {
return (
scope.row.testState === 0 ? '未检' : scope.row.testState === 1 ? '检测中' : '检测完成'
scope.row.testState === 0 ? <el-tag type='warning' effect="dark">未检</el-tag> :
scope.row.testState === 1 ? <el-tag type='danger' effect="dark">检测中</el-tag> :
<el-tag type='success' effect="dark">检测完成</el-tag>
)
},
},
{
prop: 'progress',
label: '检测进度',
minWidth: 180,
render: (scope) => {
const randomPercentage = Math.floor(Math.random() * 101); // 生成 0 到 100 的随机整数
return (
<el-progress
text-inside={true}
stroke-width={20}
percentage={randomPercentage}
status='success'
/>
);
},
},
{
prop: 'reportState',
label: '检测报告状态',
@@ -407,6 +427,10 @@ const handleDelete = async (params: Plan.ReqPlanParams) => {
proTable.value?.getTableList()
}
const openTestSource = (row: Partial<Plan.ReqPlan> = {}) => {
openSourceView.value.open("检测计划详情",row.name)
}
const showDeviceOpen = (row: Partial<Plan.ReqPlan> = {}) => {
devTransferPopup.value.open(row)
}