检测过程流程展示页面框架绘制

This commit is contained in:
GYYM
2024-11-18 22:04:59 +08:00
parent 5cdbee88b4
commit 977a998767
15 changed files with 1469 additions and 171 deletions

View File

@@ -27,6 +27,8 @@ export namespace Plan {
// 检测计划 + 检测源 // 检测计划 + 检测源
export interface PlanAndSourceBO extends PlanBO { export interface PlanAndSourceBO extends PlanBO {
testSourceName: string;//计划所属检测源 testSourceName: string;//计划所属检测源
source_Id: string[];
device_Id?: string[];
testSourceList?: string[];//临时测试 testSourceList?: string[];//临时测试
} }
// // 检测计划列表 // // 检测计划列表

View File

@@ -165,12 +165,86 @@ const testFatherPlanList: Dict[] = [
label: '检测子计划1-2', label: '检测子计划1-2',
}, },
] ]
//检测源ID及名称
const sourceDataList: Dict[] = [
{
id: "1",
label: '标准源-福禄克-6100A',
},
{
id: "2",
label: '标准源-昂立-PF2',
},
{
id: "3",
label: '标准源-丹迪克-DKLN1',
},
{
id: "4",
label: '标准源-博电源-PQC600A',
},
{
id: "5",
label: '高精度设备-PQV520-1',
},
{
id: "6",
label: '高精度设备-PQV520-2',
},
{
id: "7",
label: '高精度设备-PQV520-3',
},
{
id: "8",
label: '高精度设备-PQV520-4',
},
]
//被检设备ID及名称
const deviceDataList: Dict[] = [
{
id: "1",
label: '模拟装置1',
},
{
id: "2",
label: '模拟装置2',
},
{
id: "3",
label: '模拟装置3',
},
{
id: "4",
label: '模拟装置4',
},
{
id: "5",
label: '中电送检装置',
},
{
id: "6",
label: '易司拓测试装置',
},
{
id: "7",
label: '山大电力测试装置1',
},
{
id: "8",
label: '山大电力测试装置2',
},
]
const planData = ref<Plan.PlanAndSourceBO[]>([ const planData = ref<Plan.PlanAndSourceBO[]>([
{ {
'id': '1', 'id': '1',
'name': '检测计划1', 'name': '检测计划1',
'pattern':'1', 'pattern':'1',
"source_Id" : ['1'],
"testSourceName":'标准源-福禄克-6100A', "testSourceName":'标准源-福禄克-6100A',
'dataSource_Id':'1', 'dataSource_Id':'1',
'script_Id':'1', 'script_Id':'1',
@@ -178,12 +252,12 @@ const planData = ref<Plan.PlanAndSourceBO[]>([
'test_State':'1', 'test_State':'1',
'report_State':'1', 'report_State':'1',
'result':'1', 'result':'1',
}, },
{ {
'id': '2', 'id': '2',
'name': '检测计划2', 'name': '检测计划2',
'pattern':'1', 'pattern':'1',
"source_Id" : ['5','6','7','8'],
"testSourceName":'高精度设备-PQV520-1', "testSourceName":'高精度设备-PQV520-1',
'father_Plan_Id':'1', 'father_Plan_Id':'1',
'dataSource_Id':'2', 'dataSource_Id':'2',
@@ -193,13 +267,14 @@ const planData = ref<Plan.PlanAndSourceBO[]>([
'report_State':'2', 'report_State':'2',
'result':'0', 'result':'0',
"testSourceList":[ "testSourceList":[
'高精度设备-PQV520-2','高精度设备-PQV520-3','高精度设备-PQV520-3' '高精度设备-PQV520-2','高精度设备-PQV520-3','高精度设备-PQV520-4'
] ]
}, },
{ {
'id': '3', 'id': '3',
'name': '检测子计划3', 'name': '检测子计划3',
'pattern':'1', 'pattern':'1',
"source_Id" : ['3'],
"testSourceName":'标准源-丹迪克-DKLN1', "testSourceName":'标准源-丹迪克-DKLN1',
'father_Plan_Id':'1', 'father_Plan_Id':'1',
'dataSource_Id':'3', 'dataSource_Id':'3',
@@ -370,4 +445,4 @@ const planData = ref<Plan.PlanAndSourceBO[]>([
// }, // },
// ]) // ])
export {planData,dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,testSoureDataList,testScriptDataList,testErrSystDataList,testFatherPlanList} export {planData,dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,sourceDataList,deviceDataList,testSoureDataList,testScriptDataList,testErrSystDataList,testFatherPlanList}

View File

@@ -157,6 +157,9 @@
if (data.id) { if (data.id) {
IsPasswordShow.value = false IsPasswordShow.value = false
formContent.value = { ...data } formContent.value = { ...data }
console.log(formContent.value,111);
} else { } else {
IsPasswordShow.value = true IsPasswordShow.value = true
resetFormContent() resetFormContent()

View File

@@ -1,134 +0,0 @@
<template>
<!-- 基础信息弹出框 -->
<el-dialog :model-value="dialogVisible" title="误差体系编辑" v-bind="dialogSmall" @close="handleCancel" width="500" draggable>
<div>
<el-form :model="data"
ref='formRuleRef'
:rules='rules'
>
<el-form-item label="设备名称" prop='name' :label-width="100">
<el-input v-model="data.name" placeholder="请输入名称" autocomplete="off" />
</el-form-item>
<el-form-item label="选择误差体系" prop='type' :label-width="100">
<el-select v-model="data.type" placeholder="请选择误差体系" autocomplete="off">
<el-option
v-for="item in dictStore.getDictData('roleType')"
:key="item.id"
:label="item.label"
:value="item.code"
/>
</el-select>
<el-button type="primary" @click="handleOK">
生成报告
</el-button>
</el-form-item>
<!-- <el-form-item label="描述" prop='remark' :label-width="100">
<el-input v-model="data.remark" :rows="2" type="textarea" placeholder="请输入备注" autocomplete="off" />
</el-form-item> -->
</el-form>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleOK">
保存
</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import type { FormInstance,FormItemRule } from 'element-plus'
import { ref,computed } from 'vue'
import {dialogSmall} from '@/utils/elementBind'
import { useDictStore } from '@/stores/modules/dict'
import {
addRole,
editRole,
} from '@/api/user/role/index'
const dictStore = useDictStore()
const {dialogVisible,title,data,openType,getTableList} = defineProps<{
dialogVisible:boolean;
title:string;
openType:string;
getTableList:Function;
data:{
id?: string; //角色类型ID
name: string; //角色类型名称
code: string; //角色代码
type: number;
remark:string; //角色描述
}
}>();
//定义规则
const formRuleRef = ref<FormInstance>()
//定义校验规则
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
name: [{ required: true, message: '名称必填!', trigger: 'blur' }],
code: [{ required: true, message: '编码必填!', trigger: 'blur' }],
})
const emit = defineEmits<{
(e:'update:visible',value:boolean):void;
}>();
const handleCancel = () => {
emit('update:visible',false)
}
const handleOK = () => {
ElMessage.info('角色数据提交')
try {
formRuleRef.value?.validate((valid: boolean) => {
if (valid) {
// 将表单数据转为json,发送到后端
// let confirmFormData = JSON.parse(JSON.stringify(form.value))
// console.log(confirmFormData)
if(openType === "add")
{
addRole(data).then(res => {
// if(res.code === "200")
// {
ElMessage.success(res.message)
getTableList()
// }
// else
// ElMessage.error(res.message)
})
}
if(openType === "edit")
{
editRole(data).then(res => {
// if(res.code === "200")
// {
ElMessage.success(res.message)
getTableList()
// }
// else
// ElMessage.error(res.message)
})
}
emit('update:visible',false)
} else {
ElMessage.error('表单验证失败!')
}
})
} catch (error) {
console.error('验证过程中发生错误', error)
}
}
</script>

View File

@@ -0,0 +1,149 @@
<template>
<div>
<div class = "test-dialog">
<div class="dialog-content">
<div>当前源输出为Ua=Ub=Uc=57.74V Ia=Ib=Ic=1A</div>
<div class="right-title">
<div>系数校准表</div>
<div>
<el-button type="primary" loading>通道系数已校准2台/共4台</el-button>
</div>
</div>
<div class="right-content">
<el-tabs type="border-card">
<el-tab-pane label="被检设备1">
<channelsTestTable></channelsTestTable>
</el-tab-pane>
<el-tab-pane label="被检设备2">
<channelsTestTable></channelsTestTable>
</el-tab-pane>
<el-tab-pane label="被检设备3">
<channelsTestTable></channelsTestTable>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</div>
</template>
<script lang="tsx" setup name="channelsTest">
import { SuccessFilled } from '@element-plus/icons-vue'
const activeIndex = ref(0)
const activeTotalNum = ref(5)
const activities = [
{
content: '开始检测',
timestamp: '2018-04-12 20:46',
size: 'large',
color: '#0bbd87',
icon: SuccessFilled,
},
{
content: 'GPS上送时刻',
timestamp: '2018-04-03 20:46',
hollow: true,
},
{
content: '设备最早上送时刻',
timestamp: '2018-04-03 20:46',
hollow: true,
},
{
content: '设备最晚上送时刻',
timestamp: '2018-04-03 20:46',
hollow: true,
},
{
content: '检测结束',
timestamp: '2018-04-03 20:46',
hollow: true,
},
]
const errorData = ref([
{
deviceName: '被检设备1',
updataTime: '10:30:08.136',
ErrorValue:'148',
Result: '合格',
},
{
deviceName: '被检设备2',
updataTime: '10:30:08.136',
ErrorValue:'136',
Result: '合格',
},
{
deviceName: '被检设备3',
updataTime: '10:30:09.006',
ErrorValue:'1006',
Result: '不合格',
},
{
deviceName: '被检设备4',
updataTime: '10:30:08.736',
ErrorValue:'736',
Result: '合格',
},
])
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
const props = defineProps({
testStatus: {
type: String,
default: 'wait'
}
})
const testStatus = toRef(props, 'testStatus');
const ts = ref('');
//监听goods_sn的变化
watch(testStatus, function (newValue, oldValue) {
ts.value = props.testStatus;
if(ts.value==='start')
{
ts.value = 'process'
let timer = setInterval(() => {
if(activeIndex.value < activeTotalNum.value - 2)
activeIndex.value++
else if(activeIndex.value === activeTotalNum.value -2)
{
activeIndex.value++
activeIndex.value++
}
else
{
clearInterval(timer)
ts.value = 'success'
}
}, 1000);
}
})
const emit = defineEmits(['update:testStatus']);
//监听sn
watch(ts, function (newValue, oldValue) {
//修改父组件
emit('update:testStatus',ts.value)
})
</script>
<style scoped>
.right-title{
display: flex;
flex-direction: row; /* 横向排列 */
justify-content: space-between;
margin-bottom: 10px;
}
</style>

View File

@@ -0,0 +1,157 @@
<template>
<div class="table-container">
<el-table :data="tableData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
<el-table-column prop="id" label="序号" width="70" />
<el-table-column prop="updateTime" label="上送时刻" />
<el-table-column prop="deviceName" label="设备名称" />
<el-table-column prop="MonitorIdx" label="监测点序号" />
<el-table-column label="电压通道" >
<el-table-column prop="Ua" label="L1">
</el-table-column>
<el-table-column prop="Ub" label="L2">
</el-table-column>
<el-table-column prop="Uc" label="L3">
</el-table-column>
</el-table-column>
<el-table-column label="电流通道" >
<el-table-column prop="Ia" label="L1">
</el-table-column>
<el-table-column prop="Ib" label="L2">
</el-table-column>
<el-table-column prop="Ic" label="L3">
</el-table-column>
</el-table-column>
<el-table-column prop="Result" label="校准结果">
</el-table-column>
</el-table>
</div>
</template>
<script lang="ts" setup name="ErrorSystemDialog">
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
import { useDictStore } from '@/stores/modules/dict'
const dictStore = useDictStore()
const props = defineProps<{
visible: boolean;
dialogTitle: string;
formData: {
id: string;//误差体系表Id
name: string;//误差体系名称
standard_Name:string;//参照标准名称
standard_Time:string;//标准推行时间
dev_Level:string;//使用设备等级
enable:number;//状态0-不启用 1-启用
state:number;//0-删除 1-正常
};
}>();
const tableData = ref([
{
id: '1',
updateTime: '2024-10-10 10:30:00',
deviceName:'被检设备1',
MonitorIdx: 1,
Ua:1.0003,
Ub:1.0003,
Uc:0.0096,
Ia:1.0003,
Ib:1.0003,
Ic:1.0008,
Result: '合格',
},
{
id: '2',
updateTime: '2024-10-10 10:30:00',
deviceName:'被检设备1',
MonitorIdx: 2,
Ua:1.0003,
Ub:1.0003,
Uc:0.0096,
Ia:1.0003,
Ib:1.0003,
Ic:1.0008,
Result: '合格',
},
{
id: '3',
updateTime: '2024-10-10 10:30:00',
deviceName:'被检设备1',
MonitorIdx: 3,
Ua:1.0003,
Ub:1.0003,
Uc:0.0096,
Ia:1.0003,
Ib:1.0003,
Ic:1.0008,
Result: '合格',
},
{
id: '4',
updateTime: '2024-10-10 10:30:00',
deviceName:'被检设备1',
MonitorIdx: 4,
Ua:1.0003,
Ub:1.0003,
Uc:0.0096,
Ia:1.0003,
Ib:1.0003,
Ic:1.0008,
Result: '合格',
},
])
</script>
<style scoped>
.form-grid {
display: flex;
flex-direction: row; /* 横向排列 */
flex-wrap: wrap; /* 允许换行 */
}
.form-grid .el-form-item {
flex: 1 1 30%; /* 控件宽度 */
margin-right: 20px; /* 控件间距 */
}
.form-grid .el-form-item:last-child {
margin-right: 0; /* 最后一个控件不需要右边距 */
}
.dialog-footer {
display: flex;
justify-content: flex-start;
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
}
.el-tabs {
margin-bottom: 20px; /* 添加底部边距 */
}
.el-table th, .el-table td {
text-align: center; /* 所有单元格文字居中 */
}
.table-container {
max-height: 400px; /* 根据需要调整高度 */
overflow-y: auto; /* 允许垂直滚动 */
overflow-x: hidden; /* 隐藏水平滚动条 */
}
</style>

View File

@@ -0,0 +1,227 @@
<template>
<div>
<el-tabs type="border-card">
<el-tab-pane label="预检测项目:">
<div class="form-grid">
<el-checkbox
v-for="(item, index) in detectionOptions"
v-model="item.selected"
:key="index"
:label="item.name"
></el-checkbox
>
<!-- <el-form :model="formData" ref='formRuleRef' :rules='rules'>
<el-row :gutter="120" >
<el-col :span="9">
<el-form-item label="误差体系名称" prop="name">
<el-input v-model='formData.name' placeholder="标准号+年份+设备等级"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参照标准名称" prop="standard_Name">
<el-input v-model='formData.standard_Name'/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="发布时间" prop="standard_Time">
<el-input v-model="formData.standard_Time" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="120" >
<el-col :span="9">
<el-form-item label="适用设备等级" prop="dev_Level">
<el-select v-model='formData.dev_Level' placeholder="请选择设备等级">
<el-option
v-for="item in dictStore.getDictData('errorLevel')"
:key="item.id"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="状态" prop="enable">
<el-select v-model='formData.enable' placeholder="请选择状态">
<el-option
v-for="item in dictStore.getDictData('status')"
:key="item.id"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form> -->
</div>
</el-tab-pane>
</el-tabs>
<div class = "test-dialog">
<div class="dialog-left">
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus" finish-status="success">
<el-step title="源通讯校验" />
<el-step title="设备通讯校验" />
<el-step title="协议校验" />
<el-step title="相序校验" />
<el-step title="检测完成" />
</el-steps>
</div>
<div class="dialog-right">
<el-collapse :v-model="1" accordion>
<el-collapse-item title="源通讯校验" name="1">
<div>
暂无数据等待检测开始
</div>
</el-collapse-item>
<el-collapse-item title="设备通讯校验" name="2">
<div>
Operation feedback: enable the users to clearly perceive their
operations by style updates and interactive effects;
</div>
<div>
Visual feedback: reflect current state by updating or rearranging
elements of the page.
</div>
</el-collapse-item>
<el-collapse-item title="协议校验" name="3">
<div>
Simplify the process: keep operating process simple and intuitive;
</div>
<div>
Definite and clear: enunciate your intentions clearly so that the
users can quickly understand and make decisions;
</div>
<div>
Easy to identify: the interface should be straightforward, which helps
the users to identify and frees them from memorizing and recalling.
</div>
</el-collapse-item>
<el-collapse-item title="相序校验" name="4">
<div>
Decision making: giving advices about operations is acceptable, but do
not make decisions for the users;
</div>
<div>
Controlled consequences: users should be granted the freedom to
operate, including canceling, aborting or terminating current
operation.
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
</div>
</template>
<script lang="tsx" setup name="preTest">
const activeIndex = ref(0)
const activeTotalNum = ref(5)
//定义与预检测配置数组
const detectionOptions = ref([
{
id: 0,
name: "源通讯检测",//判断源通讯是否正常
selected: true,
},
{
id: 1,
name: "设备通讯检测",//判断设备的IP、Port、识别码、秘钥是否正常
selected: true,
},
{
id: 2,
name: "协议校验",//ICD报告触发测试
selected: true,
},
{
id: 3,
name: "相序校验",//判断装置的接线是否正确
selected: true,
},
// {
// id: 4,
// name: "守时校验",//判断装置24小时内的守时误差是否小于1s
// selected: true,
// },
// {
// id: 5,
// name: "通道系数校准",//通过私有协议与装置进行通讯,校准三相电压电流的通道系数
// selected: true,
// },
// {
// id: 6,
// name: "实时数据比对",
// },
// {
// id: 7,
// name: "录波数据比对",
// },
]);
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
const props = defineProps({
testStatus: {
type: String,
default: 'wait'
}
})
const testStatus = toRef(props, 'testStatus');
const ts = ref('');
//监听goods_sn的变化
watch(testStatus, function (newValue, oldValue) {
ts.value = props.testStatus;
if(ts.value==='start')
{
ts.value = 'process'
let timer = setInterval(() => {
if(activeIndex.value < activeTotalNum.value - 2)
activeIndex.value++
else if(activeIndex.value === activeTotalNum.value -2)
{
activeIndex.value++
activeIndex.value++
}
else
{
clearInterval(timer)
ts.value = 'success'
}
}, 1000);
}
})
const emit = defineEmits(['update:testStatus']);
//监听sn
watch(ts, function (newValue, oldValue) {
//修改父组件
emit('update:testStatus',ts.value)
})
</script>
<style scoped>
.test-dialog{
display: flex;
flex-direction: row; /* 横向排列 */
margin-top: 20px;
/* .dialog-left{
margin-right: 20px;
} */
}
.dialog-left{
margin-left: 20px;
}
.dialog-right{
margin-left: 20px;
width: 500px
}
</style>

View File

@@ -53,28 +53,30 @@
> >
<el-button <el-button
type="primary" type="primary"
:icon="Clock"
@click="handleTest" @click="handleTest"
v-if="form.activeTabs === 0" v-if="form.activeTabs === 0"
>手动检测</el-button >手动检测</el-button
> >
<el-button <el-button
type="primary" type="primary"
:icon="ChatLineRound"
@click="handleTest" @click="handleTest"
v-if="form.activeTabs === 0" v-if="form.activeTabs === 0"
>自动检测</el-button >自动检测</el-button
> >
<el-button type="primary" v-if="form.activeTabs === 2" <el-button type="primary" :icon="ChatLineSquare" v-if="form.activeTabs === 2"
>不合格项复检</el-button >不合格项复检</el-button
> >
<el-button type="primary" v-if="form.activeTabs === 2" <el-button type="primary" :icon="ChatDotSquare" v-if="form.activeTabs === 2"
>全部复检</el-button >全部复检</el-button
> >
<el-button type="primary" v-if="form.activeTabs === 3" <el-button type="primary" :icon="Postcard" v-if="form.activeTabs === 3"
>批量生成</el-button >批量生成</el-button
> >
<el-button type="primary" v-if="form.activeTabs === 4" <el-button type="primary" :icon="Notebook" v-if="form.activeTabs === 4"
>批量归档</el-button >批量归档</el-button
> >
</el-form-item> </el-form-item>
@@ -108,7 +110,7 @@
<el-button <el-button
type="primary" type="primary"
link link
:icon="EditPen" :icon="Postcard"
@click="openDrawer('生成', scope.row)" @click="openDrawer('生成', scope.row)"
v-if="form.activeTabs === 3" v-if="form.activeTabs === 3"
>生成</el-button >生成</el-button
@@ -124,7 +126,7 @@
<el-button <el-button
type="primary" type="primary"
link link
:icon="EditPen" :icon="Notebook"
@click="openDrawer('归档', scope.row)" @click="openDrawer('归档', scope.row)"
v-if="form.activeTabs === 4" v-if="form.activeTabs === 4"
>归档</el-button >归档</el-button
@@ -146,6 +148,14 @@
> --> > -->
</template> </template>
</ProTable> </ProTable>
<!-- 检测过程对话框 -->
<testPopup
:visible="dialogFormVisible"
:formData="dialogForm"
:dialogTitle="dialogTitle"
@update:visible="dialogFormVisible = $event"
/>
</div> </div>
</template> </template>
@@ -157,10 +167,11 @@ import { ElMessage, ElMessageBox, ElLoading} from "element-plus";
import ProTable from "@/components/ProTable/index.vue"; import ProTable from "@/components/ProTable/index.vue";
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface' import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
import { import {
Search,View,EditPen Search,View,EditPen,Clock,ChatLineRound,ChatLineSquare,ChatDotSquare,Postcard,Notebook
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { getPlanList } from "@/api/plan/planList"; import { getPlanList } from "@/api/plan/planList";
import deviceDataList from '@/api/device/device/deviceData' import deviceDataList from '@/api/device/device/deviceData'
import testPopup from "./testPopup.vue";
import { log } from "console"; import { log } from "console";
import { isVisible } from "element-plus/es/utils"; import { isVisible } from "element-plus/es/utils";
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
@@ -168,6 +179,17 @@ const router = useRouter();
const value1 = ref(""); const value1 = ref("");
const value2 = ref(""); const value2 = ref("");
const tableHeight = ref(0); const tableHeight = ref(0);
const dialogFormVisible = ref(false)
const dialogTitle = ref('手动检测')
const dialogForm = ref<any>({
id: '',
name: '',
standard_Name:'',
standard_Time:'',
dev_Level:'',
enable:1,
state:1,
});
//console.log(window.innerHeight, "+++++++++"); //console.log(window.innerHeight, "+++++++++");
tableHeight.value = window.innerHeight - 630; tableHeight.value = window.innerHeight - 630;
const deviceData = deviceDataList.plan_devicedata const deviceData = deviceDataList.plan_devicedata
@@ -695,9 +717,13 @@ const handleTest = () => {
//自动检测 //自动检测
if (form.value.activeTabs === 0) { if (form.value.activeTabs === 0) {
ElMessage.success("手动检测"); ElMessage.success("手动检测");
router.push({
path: "/plan/autoTest", dialogTitle.value = '手动检测';
}); dialogFormVisible.value = true; // 打开对话框
// router.push({
// path: "/plan/autoTest",
// });
} else { } else {
ElMessage.warning("手动检测"); ElMessage.warning("手动检测");
router.push({ router.push({

View File

@@ -0,0 +1,159 @@
<template>
<div class = "test-dialog">
<div class="dialog-title">
<el-progress
style="width: 80%"
:percentage="percentage"
:color="customColors"
/>
<el-button
type="primary"
v-if="!isPause"
:icon="VideoPause"
@click="handlePauseTest"
>暂停检测</el-button
>
<el-button
type="warning"
v-if="isPause"
:icon="Refresh"
@click="handlePauseTest"
>继续检测</el-button
>
<el-button type="danger" :icon="Close" @click="handleFinishTest"
>停止检测</el-button
>
</div>
<div class="dialog-content">
<el-table :data="errorData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
<el-table-column prop="deviceName" label="检测项目" />
<el-table-column prop="updataTime" label="被检通道1" />
<el-table-column prop="ErrorValue" label="被检通道2" />
<el-table-column prop="Result" label="被检通道3" />
</el-table>
</div>
<div class="dialog-log">
<el-collapse :v-model="1" accordion>
<el-collapse-item title="检测日志:" name="1">
<div>
暂无数据等待检测开始
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
</template>
<script lang="tsx" setup name="test">
import { VideoPause,Refresh,Close } from '@element-plus/icons-vue'
const percentage = ref(0);
const customColors = [
{ color: "#5cb87a", percentage: 100 }, //绿
];
//暂停检测
const isPause = ref<boolean>(false);
const handlePauseTest = () => {
if (!isPause.value) {
} else {
}
isPause.value = !isPause.value;
};
//完成检测
const handleFinishTest = () => {
ElMessage.success("完成检测");
};
const errorData = ref([
{
deviceName: '额定条件下频率检测42.5Hz',
updataTime: '√',
ErrorValue:'×',
Result: '/',
},
{
deviceName: '额定条件下频率检测50Hz',
updataTime: '/',
ErrorValue:'√',
Result: '×',
},
{
deviceName: '额定条件下频率检测50.05Hz',
updataTime: '—',
ErrorValue:'—',
Result: '—',
},
{
deviceName: '额定条件下频率检测57.5Hz',
updataTime: '—',
ErrorValue:'—',
Result: '—',
},
])
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
const props = defineProps({
testStatus: {
type: String,
default: 'wait'
}
})
const testStatus = toRef(props, 'testStatus');
const ts = ref('');
//监听goods_sn的变化
watch(testStatus, function (newValue, oldValue) {
ts.value = props.testStatus;
if(ts.value==='start')
{
ts.value = 'process'
let timer = setInterval(() => {
if(activeIndex.value < activeTotalNum.value - 2)
activeIndex.value++
else if(activeIndex.value === activeTotalNum.value -2)
{
activeIndex.value++
activeIndex.value++
}
else
{
clearInterval(timer)
ts.value = 'success'
}
}, 1000);
}
})
const emit = defineEmits(['update:testStatus']);
//监听sn
watch(ts, function (newValue, oldValue) {
//修改父组件
emit('update:testStatus',ts.value)
})
</script>
<style scoped>
.test-dialog{
display: flex;
flex-direction: column;
}
.dialog-title{
display: flex;
justify-content: space-between;
align-items: center;
margin-right:10px;
margin-bottom:10px;
}
</style>

View File

@@ -0,0 +1,420 @@
<template>
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogBig" width="900px">
<!-- simple -->
<!-- :style="{color:node.label=='未检测'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" -->
<el-steps class="test-head-steps" :space="200" :active="stepsActiveIndex" process-status="finish" finish-status="success" simple>
<el-step title="预检测" :icon="stepsActiveIndex > 0 ? SuccessFilled : Edit" />
<el-step title="守时检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :UploadFilled"/>
<el-step title="系数校准" :icon="stepsActiveIndex > 2 ? SuccessFilled :Picture" />
<el-step title="正式检测" :icon="stepsActiveIndex > 3 ? SuccessFilled :Picture" />
<el-step title="检测完成" :icon="stepsActiveIndex > 4 ? SuccessFilled :Picture" />
</el-steps>
<preTest v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus"></preTest>
<timeTest v-if="stepsActiveIndex === 1" v-model:testStatus="timeTestStatus"></timeTest>
<channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest>
<test v-if="stepsActiveIndex === 3" v-model:testStatus="TestStatus"></test>
<!-- <el-tabs type="border-card">
<el-tab-pane label="预检测项目:">
<div class="form-grid">
<el-checkbox
v-for="(item, index) in detectionOptions"
v-model="item.selected"
:key="index"
:label="item.name"
></el-checkbox
>
</div>
</el-tab-pane>
</el-tabs>
<div class = "test-dialog">
<div class="dialog-left">
<el-steps direction="vertical" :active="0">
<el-step title="源通讯校验" />
<el-step title="设备通讯校验" />
<el-step title="协议校验" />
<el-step title="相序校验" />
<el-step title="检测完成" />
</el-steps>
</div>
<div class="dialog-right">
<el-collapse :v-model="1" accordion>
<el-collapse-item title="源通讯校验" name="1">
<div>
暂无数据等待检测开始
</div>
</el-collapse-item>
<el-collapse-item title="设备通讯校验" name="2">
<div>
Operation feedback: enable the users to clearly perceive their
operations by style updates and interactive effects;
</div>
<div>
Visual feedback: reflect current state by updating or rearranging
elements of the page.
</div>
</el-collapse-item>
<el-collapse-item title="协议校验" name="3">
<div>
Simplify the process: keep operating process simple and intuitive;
</div>
<div>
Definite and clear: enunciate your intentions clearly so that the
users can quickly understand and make decisions;
</div>
<div>
Easy to identify: the interface should be straightforward, which helps
the users to identify and frees them from memorizing and recalling.
</div>
</el-collapse-item>
<el-collapse-item title="相序校验" name="4">
<div>
Decision making: giving advices about operations is acceptable, but do
not make decisions for the users;
</div>
<div>
Controlled consequences: users should be granted the freedom to
operate, including canceling, aborting or terminating current
operation.
</div>
</el-collapse-item>
</el-collapse>
</div>
</div> -->
<!-- <div class="dialog-footer">
<el-button :icon='CirclePlus' type="primary" @click="openAddDialog">新增</el-button>
<el-button :icon='Delete' type="danger" plain :disabled='!multipleSelection.length' @click="deleteSelectedRows">批量删除</el-button>
</div>
<div class="table-container">
<el-table :data="tableData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" @selection-change="handleSelectionChange" >
<el-table-column type="selection" width="55" />
<el-table-column prop="id" label="序号" width="60" />
<el-table-column prop="type" label="电能质量检测指标类型" width="181">
<template #default="{ row }">
<el-select v-model="row.type" placeholder="选择指标类型">
<el-option v-for="option in typeList" :key="option.value" :label="option.label" :value="option.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="起止范围" >
<el-table-column label="起始">
<template #default="{ row }">
<el-row type="flex">
<el-col :span="14">
<el-select v-model="row.startSelect" placeholder="选择起始值" style="width: 70px;">
<el-option v-for="option in errorStartOptions" :key="option.value" :label="option.label" :value="option.value"/>
</el-select>
</el-col>
<el-col :span="10">
<el-input v-model= "row.startRange" style="width: 70px;"
/>
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column label="结束">
<template #default="{ row }">
<el-row type="flex" >
<el-col :span="14">
<el-select v-model="row.endSelect" placeholder="选择结束值" style="width: 70px;">
<el-option v-for="option in errorEndOptions" :key="option.value" :label="option.label" :value="option.value"/>
</el-select>
</el-col>
<el-col :span="10">
<el-input v-model= "row.endRange" style="width: 70px;"/>
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column label="单位" width="115">
<template #default="{ row }">
<el-select v-model="row.unit" placeholder="选择单位">
<el-option
v-for="option in errorUnitOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="最大误差">
<el-table-column prop="maxErrorValue" label="最大误差值" width="100">
<template #default="{ row }">
<el-input v-model= "row.startRange" style="width: 70px;"/>
</template>
</el-table-column>
<el-table-column label="误差类型">
<template #default="{ row }">
<el-select v-model="row.errorType" placeholder="选择误差类型">
<el-option
v-for="option in errorTypeOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button type="primary" link :icon='CopyDocument' @click="copyRow(row)">复制</el-button>
<el-button type='primary' link :icon='Delete' @click="deleteRow(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div> -->
<template #footer>
<div>
<!-- <el-button @click="handleCancel"> </el-button> -->
<el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit">开始检测</el-button>
<el-button type="danger" :icon="Close" v-if="ActiveStatue === 'process'" @click="handleSubmit">停止检测</el-button>
<el-button type="primary" :icon="Refresh" v-if="ActiveStatue === 'error'" @click="handleSubmit">重新检测</el-button>
<el-button type="primary" :icon="Right" v-if="ActiveStatue === 'success'" @click="nextStep">{{nextStepText}}</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup name="testPopup">
import{ElMessage, ElSelectV2, FormInstance,FormItemRule}from'element-plus'
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument,Edit, Picture, UploadFilled, SuccessFilled,VideoPlay,Right,Refresh,Close} from '@element-plus/icons-vue'
import { useDictStore } from '@/stores/modules/dict'
import preTest from './preTest.vue'
import timeTest from './timeTest.vue'
import channelsTest from './channelsTest.vue'
const props = defineProps<{
visible: boolean;
dialogTitle: string;
formData: {
id: string;//误差体系表Id
name: string;//误差体系名称
standard_Name:string;//参照标准名称
standard_Time:string;//标准推行时间
dev_Level:string;//使用设备等级
enable:number;//状态0-不启用 1-启用
state:number;//0-删除 1-正常
};
}>();
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
(e: 'submit', data: any): void;
}>();
const nextStepText = ref('下一步');
//定义与预检测配置数组
const detectionOptions = ref([
{
id: 0,
name: "源通讯检测",//判断源通讯是否正常
selected: true,
},
{
id: 1,
name: "设备通讯检测",//判断设备的IP、Port、识别码、秘钥是否正常
selected: true,
},
{
id: 2,
name: "协议校验",//ICD报告触发测试
selected: true,
},
{
id: 3,
name: "相序校验",//判断装置的接线是否正确
selected: true,
},
// {
// id: 4,
// name: "守时校验",//判断装置24小时内的守时误差是否小于1s
// selected: true,
// },
// {
// id: 5,
// name: "通道系数校准",//通过私有协议与装置进行通讯,校准三相电压电流的通道系数
// selected: true,
// },
// {
// id: 6,
// name: "实时数据比对",
// },
// {
// id: 7,
// name: "录波数据比对",
// },
]);
const stepsTotalNum = ref(4);//步骤总数
const stepsActiveIndex = ref(0); //当前正在执行的步骤索引
const ActiveStatue = ref('waiting');//当前步骤状态
const preTestStatus = ref('waiting');//预检测执行状态
const timeTestStatus = ref('waiting');//守时校验执行状态
const channelsTestStatus = ref('waiting');//通道系数校准执行状态
const TestStatus = ref('waiting');//正式检测执行状态
watch(preTestStatus,function(newValue,oldValue){
console.log(newValue,oldValue);
ActiveStatue.value = newValue
})
watch(timeTestStatus,function(newValue,oldValue){
console.log(newValue,oldValue);
ActiveStatue.value = newValue
})
watch(channelsTestStatus,function(newValue,oldValue){
console.log(newValue,oldValue);
ActiveStatue.value = newValue
})
watch(TestStatus,function(newValue,oldValue){
console.log(newValue,oldValue);
ActiveStatue.value = newValue
})
const nextStep = () => {
if(stepsActiveIndex.value < stepsTotalNum.value )
stepsActiveIndex.value++
else if(stepsActiveIndex.value === stepsTotalNum.value)
{
stepsActiveIndex.value++
nextStepText.value = '检测完成'
}
else
{
emit('update:visible', false); // 关闭对话框
clearData()
}
};
function clearData(){
stepsActiveIndex.value = 0;
preTestStatus.value = "waiting"
timeTestStatus.value = "waiting"
channelsTestStatus.value = "waiting"
TestStatus.value = "waiting"
nextStepText.value = "下一步"
}
const handleCancel = () => {
clearData()
emit('update:visible', false); // 关闭对话框
};
const handleSubmit = () => {
switch (stepsActiveIndex.value) {
case 0:
preTestStatus.value = 'start'
break;
case 1:
timeTestStatus.value = 'start'
break;
case 2:
channelsTestStatus.value = 'start'
break;
case 3:
TestStatus.value = 'start'
break;
default:
break;
}
};
// 当 props.visible 改变时,更新 formData
watch(() => props.visible, (newVal) => {
if (!newVal) {
// 这里可以重置表单数据,如果需要的话
}
});
//选中
// 处理选择变化
const handleSelectionChange = (selection: any[]) => {
multipleSelection.value = selection.map(row => row.id); // 更新选中的行
};
const openAddDialog = () => {
tableData.value.push({
id: tableData.value.length + 1,
type: '',
startSelect: '',
startRange: '',
endSelect: '',
endRange: '',
unit:'',
maxErrorValue:'',
errorType:''
});
};
</script>
<style scoped>
.test-head-steps{
margin-bottom: 20px;
}
.test-dialog{
display: flex;
flex: 30% 65%; /* 控件宽度 */
flex-direction: row; /* 横向排列 */
/* .dialog-left{
margin-right: 20px;
} */
}
.form-grid {
display: flex;
flex-direction: row; /* 横向排列 */
flex-wrap: wrap; /* 允许换行 */
}
.form-grid .el-form-item {
flex: 1 1 30%; /* 控件宽度 */
margin-right: 20px; /* 控件间距 */
}
.form-grid .el-form-item:last-child {
margin-right: 0; /* 最后一个控件不需要右边距 */
}
.dialog-footer {
display: flex;
justify-content: flex-start;
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
}
.el-tabs {
margin-bottom: 20px; /* 添加底部边距 */
}
.el-table th, .el-table td {
text-align: center; /* 所有单元格文字居中 */
}
.table-container {
max-height: 400px; /* 根据需要调整高度 */
overflow-y: auto; /* 允许垂直滚动 */
overflow-x: hidden; /* 隐藏水平滚动条 */
}
</style>

View File

@@ -0,0 +1,183 @@
<template>
<div>
<div class = "test-dialog">
<div class="dialog-left">
<el-timeline style="max-width: 600px">
<el-timeline-item
v-for="(activity, index) in activities"
:key="index"
:icon="activity.icon"
:type="activity.type"
:color="activity.color"
:size="activity.size"
:hollow="activity.hollow"
:timestamp="activity.timestamp"
>
{{ activity.content }}
</el-timeline-item>
</el-timeline>
</div>
<div class="dialog-right">
<div class="right-title">
<div>设备上送时刻表</div>
<div>
<el-button type="primary" loading>设备已合格2台/共4台</el-button>
</div>
</div>
<div class="right-content">
<el-table :data="errorData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border class="custom-table">
<el-table-column prop="deviceName" label="设备名" />
<el-table-column prop="updataTime" label="上送时刻" />
<el-table-column prop="ErrorValue" label="守时误差(ms)" />
<el-table-column prop="Result" label="检测结果" />
</el-table>
</div>
</div>
</div>
</div>
</template>
<script lang="tsx" setup name="timeTest">
import { SuccessFilled } from '@element-plus/icons-vue'
const activeIndex = ref(0)
const activeTotalNum = ref(5)
const activities = [
{
content: '开始检测',
timestamp: '2018-04-12 20:46',
size: 'large',
color: '#0bbd87',
icon: SuccessFilled,
},
{
content: 'GPS上送时刻',
timestamp: '2018-04-03 20:46',
hollow: true,
},
{
content: '设备最早上送时刻',
timestamp: '2018-04-03 20:46',
hollow: true,
},
{
content: '设备最晚上送时刻',
timestamp: '2018-04-03 20:46',
hollow: true,
},
{
content: '检测结束',
timestamp: '2018-04-03 20:46',
hollow: true,
},
]
const errorData = ref([
{
deviceName: '被检设备1',
updataTime: '10:30:08.136',
ErrorValue:'148',
Result: '合格',
},
{
deviceName: '被检设备2',
updataTime: '10:30:08.136',
ErrorValue:'136',
Result: '合格',
},
{
deviceName: '被检设备3',
updataTime: '10:30:09.006',
ErrorValue:'1006',
Result: '不合格',
},
{
deviceName: '被检设备4',
updataTime: '10:30:08.736',
ErrorValue:'736',
Result: '合格',
},
])
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
const props = defineProps({
testStatus: {
type: String,
default: 'wait'
}
})
const testStatus = toRef(props, 'testStatus');
const ts = ref('');
//监听goods_sn的变化
watch(testStatus, function (newValue, oldValue) {
ts.value = props.testStatus;
if(ts.value==='start')
{
ts.value = 'process'
let timer = setInterval(() => {
if(activeIndex.value < activeTotalNum.value - 2)
activeIndex.value++
else if(activeIndex.value === activeTotalNum.value -2)
{
activeIndex.value++
activeIndex.value++
}
else
{
clearInterval(timer)
ts.value = 'success'
}
}, 1000);
}
})
const emit = defineEmits(['update:testStatus']);
//监听sn
watch(ts, function (newValue, oldValue) {
//修改父组件
emit('update:testStatus',ts.value)
})
</script>
<style scoped>
.test-dialog{
display: flex;
flex-direction: row; /* 横向排列 */
margin-top: 20px;
/* .dialog-left{
margin-right: 20px;
} */
}
.dialog-left{
margin-left: 20px;
}
.dialog-right{
margin-left: 20px;
width: 500px
}
.right-title{
display: flex;
flex-direction: row; /* 横向排列 */
justify-content: space-between;
margin-bottom: 10px;
}
/* width: 100%;
height: auto;
background: #fff;
border-radius: 4px;
display: flex;
// justify-content: space-around;
// justify-content: space-evenly;
align-items: center;
margin-bottom: 10px;
padding: 10px 20px 10px 20px;
box-sizing: border-box; */
</style>

View File

@@ -158,6 +158,12 @@ const tabsList = ref([
img: "/src/assets/images/plan/static/3.svg", img: "/src/assets/images/plan/static/3.svg",
checked: false, checked: false,
}, },
{
label: "数据查询",
value: 5,
img: "/src/assets/images/plan/static/5.svg",
checked: false,
},
{ {
label: "设备归档", label: "设备归档",
value: 4, value: 4,

View File

@@ -448,8 +448,8 @@ ElMessageBox.confirm(
'检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作',
'检测完成', '检测完成',
{ {
confirmButtonText: 'OK', confirmButtonText: '确定',
cancelButtonText: 'Cancel', cancelButtonText: '取消',
type: 'success', type: 'success',
} }
) )

View File

@@ -6,7 +6,7 @@
<el-form-item label="名称" prop="name" :label-width="100"> <el-form-item label="名称" prop="name" :label-width="100">
<el-input v-model="formData.name" placeholder="请输入名称" autocomplete="off" :disabled="isReadOnly"/> <el-input v-model="formData.name" placeholder="请输入名称" autocomplete="off" :disabled="isReadOnly"/>
</el-form-item> </el-form-item>
<el-form-item label="父计划" prop="father_Plan_Id" :label-width="100"> <!-- <el-form-item label="父计划" prop="father_Plan_Id" :label-width="100">
<el-select v-model="formData.father_Plan_Id" placeholder="请选择父计划" autocomplete="off" :disabled="isReadOnly" @change="fatherPlanChange"> <el-select v-model="formData.father_Plan_Id" placeholder="请选择父计划" autocomplete="off" :disabled="isReadOnly" @change="fatherPlanChange">
<el-option <el-option
v-for="plan in testFatherPlanList" v-for="plan in testFatherPlanList"
@@ -15,7 +15,17 @@
:value="plan.id"> :value="plan.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label='检测源' prop='source_Id' :label-width='100'>
<el-select v-model="formData.source_Id" multiple placeholder="请选择检测源">
<el-option
v-for="plan in sourceDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id"
/>
</el-select>
</el-form-item>
<el-form-item label="数据源" prop="dataSource_Id" :label-width="100"> <el-form-item label="数据源" prop="dataSource_Id" :label-width="100">
<el-select v-model="formData.dataSource_Id" placeholder="请选择数据源" autocomplete="off" :disabled="isReadOnly"> <el-select v-model="formData.dataSource_Id" placeholder="请选择数据源" autocomplete="off" :disabled="isReadOnly">
<el-option <el-option
@@ -46,7 +56,16 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='被检设备' :label-width='100' prop='device_Id'>
<el-select v-model="formData.device_Id" multiple placeholder="请选择被检设备">
<el-option
v-for="plan in deviceDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id"
/>
</el-select>
</el-form-item>
</el-form> </el-form>
</div> </div>
<template #footer> <template #footer>
@@ -62,7 +81,7 @@
import{ElMessage, FormInstance,FormItemRule}from'element-plus' import{ElMessage, FormInstance,FormItemRule}from'element-plus'
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue'; import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
import { dialogSmall} from '@/utils/elementBind' import { dialogSmall} from '@/utils/elementBind'
import {dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,testSoureDataList,testScriptDataList,testErrSystDataList,planData,testFatherPlanList} from '@/api/plan/planData' import {dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,sourceDataList,deviceDataList,testSoureDataList,testScriptDataList,testErrSystDataList,planData,testFatherPlanList} from '@/api/plan/planData'
const props = defineProps<{ const props = defineProps<{
visible: boolean; visible: boolean;
@@ -73,9 +92,11 @@
name: string; name: string;
pattern: string; //模式,字典表(数字、模拟、比对) pattern: string; //模式,字典表(数字、模拟、比对)
father_Plan_Id: string; //父计划ID father_Plan_Id: string; //父计划ID
source_Id: string;//检测源ID
dataSource_Id: string; //数据源ID dataSource_Id: string; //数据源ID
script_Id: string; //检测脚本ID script_Id: string; //检测脚本ID
error_Sys_Id: string;//误差体系ID error_Sys_Id: string;//误差体系ID
device_Id: string;//被检设备ID
test_State: string; //检测状态 test_State: string; //检测状态
report_State: string; //报告生成状态 report_State: string; //报告生成状态
result: string;//检测结果 result: string;//检测结果
@@ -119,6 +140,7 @@ const emit = defineEmits<{
const formRuleRef = ref<FormInstance>() const formRuleRef = ref<FormInstance>()
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({ const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
name: [{ required: true, message: '检测计划名称必填!', trigger: 'blur' }], name: [{ required: true, message: '检测计划名称必填!', trigger: 'blur' }],
source_Id: [{ required: true, message: '检测源必选!', trigger: 'blur' }],
dataSource_Id: [{ required: true, message: '数据源必选!', trigger: 'blur' }], dataSource_Id: [{ required: true, message: '数据源必选!', trigger: 'blur' }],
script_Id: [{ required: true, message: '检测脚本必选!', trigger: 'blur' }], script_Id: [{ required: true, message: '检测脚本必选!', trigger: 'blur' }],
error_Sys_Id: [{ required: true, message: '误差体系必选!', trigger: 'blur' }], error_Sys_Id: [{ required: true, message: '误差体系必选!', trigger: 'blur' }],

View File

@@ -8,7 +8,8 @@
<!-- 表格 header 按钮 --> <!-- 表格 header 按钮 -->
<template #tableHeader='scope'> <template #tableHeader='scope'>
<el-button type='primary' :icon='Download' @click='importClick'>导入</el-button> <el-button type='primary' :icon='Download' @click='importClick'>导入</el-button>
<el-button type='primary' :icon='CirclePlus' :disabled='!(scope.selectedList.length > 1)' @click='combineClick'> <el-button type='primary' :icon='Upload' @click='exportClick'>导出</el-button>
<el-button type='primary' :icon='ScaleToOriginal' :disabled='!(scope.selectedList.length > 1)' @click='combineClick'>
合并 合并
</el-button> </el-button>
<el-button type='primary' :icon='CirclePlus' @click='openAddDialog'>新增</el-button> <el-button type='primary' :icon='CirclePlus' @click='openAddDialog'>新增</el-button>
@@ -20,9 +21,11 @@
<!-- 表格操作 --> <!-- 表格操作 -->
<template #operation='scope'> <template #operation='scope'>
<!-- <el-button type='primary' link :icon='View' @click="handleRowClick(scope.row)">查看</el-button> --> <!-- <el-button type='primary' link :icon='View' @click="handleRowClick(scope.row)">查看</el-button> -->
<el-button type='primary' link :icon='Upload' @click='exportClick'>导出</el-button> <!-- <el-button type='primary' link :icon='Upload' @click='exportClick'>导出</el-button> -->
<el-button type='primary' link :icon='EditPen' @click='openEditDialog(scope.row)'>编辑</el-button> <el-button type='primary' link :icon='EditPen' @click='openEditDialog(scope.row)'>编辑</el-button>
<div class='cn-render-buttons'> <el-button type='primary' link :icon='Delete' @click='openEditDialog(scope.row)'>删除</el-button>
<el-button type='primary' link :icon='List' @click='showDeviceOpen(scope.row)'>设备绑定</el-button>
<!-- <div class='cn-render-buttons'>
<el-dropdown trigger='click'> <el-dropdown trigger='click'>
<el-button link type='primary' class='table-operate'> <el-button link type='primary' class='table-operate'>
<div class='table-operate-text'>更多</div> <div class='table-operate-text'>更多</div>
@@ -41,7 +44,7 @@
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div> -->
</template> </template>
</ProTable> </ProTable>
@@ -77,7 +80,7 @@
import ProTable from '@/components/ProTable/index.vue' import ProTable from '@/components/ProTable/index.vue'
import TimeControl from '@/components/TimeControl/index.vue' import TimeControl from '@/components/TimeControl/index.vue'
import type { ProTableInstance, ColumnProps } from '@/components/ProTable/interface' import type { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
import { CirclePlus, Delete, EditPen, View, Upload, Download, List, Tools } from '@element-plus/icons-vue' import { ScaleToOriginal, CirclePlus, Delete, EditPen, View, Upload, Download, List, Tools } from '@element-plus/icons-vue'
import { import {
dictPattern, dictPattern,
dictTestState, dictTestState,
@@ -163,14 +166,14 @@ const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
{ type: 'index', fixed: 'left', width: 70, label: '序号' }, { type: 'index', fixed: 'left', width: 70, label: '序号' },
{ {
prop: 'name', prop: 'name',
label: '检测计划名称', label: '名称',
width: 200, width: 200,
search: { el: 'input' }, search: { el: 'input' },
}, },
{ {
prop: 'testSourceName', prop: 'testSourceName',
label: '检测源名称', label: '检测源',
width: 300, width: 215,
render: scope => { render: scope => {
return ( return (
<div class='flx-flex-start'> <div class='flx-flex-start'>
@@ -187,7 +190,7 @@ const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
{ {
prop: 'script_Id', prop: 'script_Id',
label: '检测脚本', label: '检测脚本',
width: 300, width: 350,
enum: testScriptDataList, enum: testScriptDataList,
fieldNames: { label: 'label', value: 'id' }, fieldNames: { label: 'label', value: 'id' },
render: scope => { render: scope => {
@@ -215,7 +218,7 @@ const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
}, },
{ {
prop: 'dataSource_Id', prop: 'dataSource_Id',
label: '数据源名称', label: '数据源',
width: 200, width: 200,
enum: testSoureDataList, enum: testSoureDataList,
fieldNames: { label: 'label', value: 'id' }, fieldNames: { label: 'label', value: 'id' },
@@ -247,13 +250,13 @@ const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
search: { el: 'select', props: { filterable: true } }, search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'id' }, fieldNames: { label: 'label', value: 'id' },
}, },
{ // {
prop: 'father_Plan_Id', // prop: 'father_Plan_Id',
label: '父节点', // label: '父节点',
width: 200, // width: 200,
enum: testFatherPlanList, // enum: testFatherPlanList,
fieldNames: { label: 'label', value: 'id' }, // fieldNames: { label: 'label', value: 'id' },
}, // },
// { // {
// prop: 'create_Time', // prop: 'create_Time',
// label: '记录时间', // label: '记录时间',