检测计划

This commit is contained in:
sjl
2024-12-11 19:39:09 +08:00
parent 393ad5fa0b
commit 5dbd6eb8be
15 changed files with 634 additions and 550 deletions

View File

@@ -2,6 +2,7 @@
"cSpell.words": [
"Chns",
"Combox",
"Datasource",
"daterange",
"devicedata",
"errordata",

View File

@@ -8,8 +8,10 @@ export namespace Device {
*/
export interface ReqPqDevParams extends ReqPage{
id: string; // 装置序号id 必填
name: string; //设备名称
devType?: string; // 设备名称
createTime?:string; //创建时间
pattern:string;
}
/**
@@ -46,6 +48,10 @@ export namespace Device {
reportPath?: string| null; //报告路径
qRCode?: string| null; //设备关键信息二维码
reCheckNum: number; //复检次数
planId?:string;//检测计划Id
TimeCheckResult?:number;//守时检测结果(0:不符合1:符合)
FactorFlag?:number;//是否支持系数校准(0:不支持,1:支持)
FactorCheckResult?: number;//系数校准结果(0:不符合1:符合)
state: number; //状态
createBy?: string| null; //创建用户
createTime?: string| null; //创建时间

View File

@@ -11,13 +11,14 @@ export namespace TestScript {
id: string; // 装置序号id 必填
name: string;
type: string;
pattern:string;
}
// 检测脚本接口
export interface ResTestScript {
id?: string; //检测脚本ID
name: string; //检测脚本名称
type: string; //检测脚本类型(字典表Code字段脚本还是模板)
type: string; //设定0为脚本1为模板
pattern: string;//检测脚本模式(字典表Code字段数字、模拟、比对)
valueType?: string;//脚本值类型(字典表Code字段相对值脚本、绝对值脚本、无)
standardName: string;//参照标准名称

View File

@@ -1,72 +1,44 @@
import type { ReqPage } from '@/api/interface'
import type { DatetimeFormatProps } from 'vue-i18n';
// 检测计划模块
export namespace Plan {
// 检测计划接口
export interface PlanBO {
id?: string; //检测计划ID
export interface ResPlan {
id: string; //检测计划ID
name: string; //检测计划名称
pattern: string; //模式,字典表(数字、模拟、比对)
father_Plan_Id?: string; //父计划ID
dataSource_Id: string[]; //数据源ID
script_Id: string; //检测脚本ID
error_Sys_Id: string;//误差体系ID
test_State: string; //检测状态
report_State: string; //报告生成状态
result: string;//检测结果
create_Time?: string;//创建时间
fatherPlanId?: string; //父计划ID
dataSourceId: string; //数据源ID
scriptId: string; //检测脚本ID
errorSysId: string;//误差体系ID
timeCheck:number;//守时检测:0否1。是
testState: number; //检测状态:0:未检、1检测中、2检测完成,默认为 0
reportState: number; //报告生成状态:0:未生成、1部分生成、2全部生成,默认为 0
result: number;//检测结果:0:不符合、1:符合、2/,默认为 2
code:number; //自动生成,用于生成数据表后缀
state: number;//;状态0-删除 1-正常
createBy?:string; //创建用户
createTime?:string; //创建时间
updateBy?:string; //更新用户
updateTime?:string; //更新时间
}
// 检测计划 + 分页
export interface ReqPlanParams extends ReqPage,PlanBO {
export interface ReqPlanParams extends ReqPage,ResPlan {
}
// 检测计划 + 检测源
export interface PlanAndSourceBO extends PlanBO {
testSourceName: string;//计划所属检测源
source_Id: string[];
device_Id?: string[];
testSourceList?: string[];//临时测试
dataSource_Ids:string;
}
// // 检测计划列表
// export interface PlanList {
// id: string; //检测计划ID
// name: string; //检测计划名称
// pattern: string; //模式,字典表(数字、模拟、比对)
// father_Plan_Id: string; //父计划ID
// dataSource_Id: string; //数据源ID
// script_Id: string; //检测脚本ID
// error_Sys_Id: string;//误差体系ID
// test_State: string; //检测状态
// report_State: string; //报告生成状态
// result: string;//检测结果
// state: number; //状态
// create_By?: string; //创建用户
// create_Time?: string;//创建时间
// update_By?: string; //更新用户
// update_Time?: string; //更新时间
// }
// // 被检设备参数
// export interface ReqPlanParams extends ReqPage {
// id: string; //检测计划ID
// name: string; //检测计划名称
// pattern: string; //模式,字典表(数字、模拟、比对)
// father_Plan_Id: string; //父计划ID
// dataSource_Id: string; //数据源ID
// script_Id: string; //检测脚本ID
// error_Sys_Id: string;//误差体系ID
// test_State: string; //检测状态
// report_State: string; //报告生成状态
// result: string;//检测结果
// state: number; //状态
// create_By?: string; //创建用户
// create_Time?: string;//创建时间
// update_By?: string; //更新用户
// update_Time?: string; //更新时间
// }
export interface ReqPlan extends ResPlan {
datasourceIds:string;
sourceIds: string[];
planId:string;
scriptName: string ;
errorSysName: string;
sourceName: string ;
devIds:string[];
}
}

View File

@@ -1,27 +1,60 @@
import { ResPage } from '@/api/interface'
import { Plan } from './interface'
import { ADMIN as rePrefix } from '@/api/config/serviceName'
import type { ResPage } from '@/api/interface'
import type { Plan } from './interface'
import http from '@/api'
import type { TestSource } from '../device/interface/testSource'
import type { TestScript } from '../device/interface/testScript'
import type { ErrorSystem } from '../device/interface/error'
import type { Device } from '../device/interface/device'
/**
* @name 检测计划管理模块
*/
// 获取检测计划列表
export const getPlanList = (params: Plan.ReqPlanParams) => {
return http.post<ResPage<Plan.PlanBO>>(`/plan/list`, params)
return http.post(`/adPlan/list`, params)
}
// 新增检测计划
export const addPlan = (params: Plan.PlanBO) => {
return http.post(`/role/add`, params)
export const addPlan = (params: Plan.ResPlan) => {
return http.post(`/adPlan/add`, params)
}
// 编辑检测计划
export const editPlan = (params: Plan.PlanBO) => {
return http.post(`/role/edit`, params)
export const updatePlan = (params: Plan.ResPlan) => {
return http.post(`/adPlan/update`, params)
}
// 删除检测计划
export const deletePlan = (params: { id: string[] }) => {
return http.post(`/role/del`, params)
return http.post(`/adPlan/delete`, params)
}
// 获取指定模式下所有检测源
export const getTestSourceList = (params: Plan.ReqPlan) => {
return http.get(`/pqSource/getAll?patternId=${params.pattern}`)
}
// 获取指定模式下所有检测脚本
export const getPqScriptList = (params: Plan.ReqPlan) => {
return http.get(`/pqScript/getAll?patternId=${params.pattern}`)
}
//获取所有误差体系
export const getPqErrSysList = () => {
return http.get<ErrorSystem.ErrorSystemList>(`/pqErrSys/getAll`)
}
//获取指定模式下所有未绑定的设备
export const getUnboundPqDevList = (params: Plan.ReqPlan) => {
return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`)
}
//根据检测计划id查询出所有已绑定的设备
export const getBoundPqDevList = (params: any) => {
return http.post(`/pqDev/listBoundByPlanId`,params)
}
//检测计划绑定设备
export const BindPqDevList = (params: any) => {
return http.post(`/adPlan/bindDev`,params)
}

View File

@@ -806,7 +806,7 @@ function tableHeaderInit(val: number) {
tableKey.value += 1;
break;
}
console.log("test",columns);
//console.log("test",columns);
}

View File

@@ -351,7 +351,7 @@ const handleCheckFunction = (val: any) => {
const resizeObserver = new ResizeObserver(entries => {
for (let entry of entries) {
chartsWidth.value = entry.contentRect.width;
console.log('Charts Info Width:', chartsWidth.value);
//console.log('Charts Info Width:', chartsWidth.value);
pieRef1.value.reSize(chartsWidth.value * 0.95,180,true);
pieRef2.value.reSize(chartsWidth.value * 0.95,180,true);

View File

@@ -142,14 +142,16 @@ const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
// 批量删除设备
const batchDelete = async (id: string[]) => {
await useHandleData(deletePqDev, id, '删除所选设备')
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id
await useHandleData(deletePqDev, {'ids':id,'pattern': patternId} , '删除所选设备')
proTable.value?.clearSelection()
proTable.value?.getTableList()
}
// 删除设备
const handleDelete = async (params: Device.ResPqDev) => {
await useHandleData(deletePqDev, [params.id], `删除【${params.name}】设备`)
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
await useHandleData(deletePqDev, {'ids': [params.id] ,'pattern': patternId}, `删除【${params.name}】设备`)
proTable.value?.getTableList()
}

View File

@@ -25,7 +25,7 @@
</template>
<script setup lang='tsx' name='useRole'>
import { Device } from '@/api/device/interface/device.ts';
import { type Device } from '@/api/device/interface/device.ts';
import { useHandleData } from '@/hooks/useHandleData'
import { useDownload } from '@/hooks/useDownload'
import { useAuthButtons } from '@/hooks/useAuthButtons'

View File

@@ -1,12 +1,12 @@
<template>
<!-- 权限信息弹出框 -->
<el-dialog :model-value="dialogVisible" title="设备绑定" v-bind="dialogBig" @close="handleCancel" width="600" draggable>
<el-dialog title="设备绑定" v-model='dialogVisible' @close="close" v-bind="dialogBig" width="600" draggable>
<div>
<el-transfer v-model="value"
filterable
:filter-method="filterMethod"
filter-placeholder="请输入内容搜索"
:data="data"
:data="allData"
:titles="['未绑定设备', '已绑定设备']">
<template #default="{ option }">
<el-tooltip :content="option.tips" placement="top" :show-after=1000>
@@ -18,8 +18,8 @@
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleCancel">
<el-button @click="close()">取消</el-button>
<el-button type="primary" @click="save()">
保存
</el-button>
</div>
@@ -28,94 +28,68 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { computed, ref } from 'vue'
import type { Device } from '@/api/device/interface'
import deviceDataList from '@/api/device/deviceData'
import { dialogBig } from '@/utils/elementBind'
import { getUnboundPqDevList,getBoundPqDevList,BindPqDevList } from '@/api/plan/plan.ts'
import { type Plan } from '@/api/plan/interface'
import { ElMessage } from 'element-plus'
const unboundPqDevList=ref<Device.ReqPqDevParams[]>([])//指定模式下所有未绑定的设备
const boundPqDevList=ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
const dialogVisible = ref(false)
const planData = ref<Plan.ReqPlan | null>(null) // 新增状态管理
const {dialogVisible} = defineProps<{
dialogVisible: boolean;
}>()
interface Option {
key: number
label: string
initial: string
tips: string
}
const generateData = () => {
const data: Option[] = []
const states = [
'240001',
'240002',
'240003',
'240004',
'240005',
'240006',
'240007',
'240008',
'240009',
'240010',
'240011',
'240012',
'240013',
'240014',
]
const initials = ['CA', 'IL', 'MD', 'TX', 'FL', 'CO', 'CT', 'GT', 'IL', 'MD', 'TX', 'FL', 'CO', 'CT', 'GT']
states.forEach((city, index) => {
data.push({
label: city,
key: index,
initial: initials[index],
tips:"PQS882A 192.16.1.136",
})
})
return data
}
const generateValue = () => {
const data: number[] = []
const states = [
'240001',
'240002',
]
const initials = ['AB', 'CD']
states.forEach((city, index) => {
const key = states.indexOf(city)
if (key !== -1) {
data.push(key)
}
})
return data
const value = ref<string[]>([])
const generateData = () => {
const unboundData = unboundPqDevList.value.map((i: Device.ReqPqDevParams) => ({
key: i.id,
label: i.name,
tips: i.description
}))
const boundData = boundPqDevList.value.map((i: Device.ReqPqDevParams) => ({
key: i.id,
label: i.name,
tips: i.description
}))
return [...unboundData, ...boundData]
}
// const generateValue = () => {
// const data: Option[] = []
// const states = [
// '山大电力测试装置1',
// '山大电力测试装置2',
// ]
// const initials = ['AB', 'CD']
// states.forEach((city, index) => {
// data.push({
// label: city,
// key: index,
// initial: initials[index],
// })
// })
// return data
// }
const data = ref<Option[]>(generateData())
const value = ref<number[]>(generateValue())
const emit = defineEmits<{
(e:'update:visible',value:boolean):void;
}>();
const allData = computed(() => generateData())
const handleCancel = () => {
emit('update:visible',false)
const filterMethod = (query: string, item: { label?: string }) => {
return item.label?.toLowerCase().includes(query.toLowerCase()) ?? false
}
// 打开弹窗,可能是新增,也可能是编辑
const open = async (data: Plan.ReqPlan,) => {
dialogVisible.value = true
planData.value = data
const pqDevList_Result1 = await getUnboundPqDevList(data);
unboundPqDevList.value = pqDevList_Result1.data as Device.ReqPqDevParams[];
const pqDevList_Result2 = await getBoundPqDevList({'planId': data.id});
boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[];
value.value = boundPqDevList.value.map((i: { id: { toString: () => any } }) => i.id.toString());
}
const close = () => {
dialogVisible.value = false
}
const filterMethod = (query, item) => {
return item.label.toLowerCase().includes(query.toLowerCase())
const save = async () => {
if (planData.value) {
await BindPqDevList({ 'planId': planData.value.id,'pqDevIds': value.value })
ElMessage.success({ message: `设备绑定保存成功成功!` })
}
dialogVisible.value = false
}
// 对外映射
defineExpose({ open })
const props = defineProps<{
refreshTable: (() => Promise<void>) | undefined;
}>()
</script>

View File

@@ -1,57 +1,32 @@
<template>
<div class="device-list-container" v-if="isShow">
<el-dropdown @command="handleCommand">
<el-button link type='primary' class='table-operate'>
<el-link link type='primary' class='table-operate'>
<div class='table-operate-text'>更多...</div>
</el-button>
</el-link>
<!-- <span class="el-dropdown-link">
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
</span> -->
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="高精度设备-PQV520-2">高精度设备-PQV-520便携式电能质量监测装置-2</el-dropdown-item>
<!-- <el-dropdown-item command="高精度设备-PQV520-2">高精度设备-PQV-520便携式电能质量监测装置-2</el-dropdown-item>
<el-dropdown-item command="高精度设备-PQV520-3">高精度设备-PQV-520便携式电能质量监测装置-3</el-dropdown-item>
<el-dropdown-item command="高精度设备-PQV520-4">高精度设备-PQV-520便携式电能质量监测装置-4</el-dropdown-item>
<el-dropdown-item command="高精度设备-PQV520-4">高精度设备-PQV-520便携式电能质量监测装置-4</el-dropdown-item> -->
</el-dropdown-menu>
</template>
</el-dropdown>
<!-- 查看误差体系详细信息 -->
<ErrorStandardDialog
:visible='detail_dialogFormVisible'
:formData='detail_dialogForm'
:dialogTitle='detail_dialogTitle'
@update:visible='detail_dialogFormVisible = $event'
/>
</div>
</template>
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { ArrowDown } from '@element-plus/icons-vue'
import ErrorStandardDialog from '@/views/machine/errorSystem/components/errorStandardPopup.vue' // 导入子组件
import type { ErrorSystem } from '@/api/error/interface'
const detail_dialogFormVisible = ref(false)
const detail_dialogTitle = ref('Q/GDW 10650.2-2021 误差体系')
const detail_dialogForm = ref<ErrorSystem.Error_detail>({
measured: '',//被测量
deviceLevel: '',//检测装置级别
measurementType: '',
condition: '',//测量条件
maxErrorValue: '',//最大误差
})
const props = defineProps<{
isShow: boolean;
}>();
//console.log(props.isShow,1111)
const handleCommand = (command: string | number | object) => {
detail_dialogTitle.value = command as string;
detail_dialogFormVisible.value = true // 显示对话框
}
</script>
<style scoped>

View File

@@ -1,150 +1,163 @@
<template>
<!-- 基础信息弹出框 -->
<el-dialog :model-value="visible" :title="dialogTitle" v-bind="dialogSmall" @close="handleCancel" draggable>
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogSmall">
<div>
<el-form :model="formData" ref='formRuleRef' :rules='rules'>
<el-form :model="formContent" ref='dialogFormRef' :rules='rules'>
<el-form-item label="名称" prop="name" :label-width="100">
<el-input v-model="formData.name" placeholder="请输入名称" autocomplete="off" :disabled="isReadOnly"/>
<el-input v-model="formContent.name" placeholder="请输入名称" autocomplete="off"/>
</el-form-item>
<!-- <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-option
v-for="plan in testFatherPlanList"
:key="plan.id"
:label="plan.label"
:value="plan.id">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label='检测源' prop='source_Id' :label-width='100'>
<el-select v-model="formData.source_Id" multiple collapse-tags placeholder="请选择检测源">
<el-form-item label='检测源' prop='sourceIds' :label-width='100'>
<el-select v-model="formContent.sourceIds" multiple collapse-tags placeholder="请选择检测源">
<el-option
v-for="plan in sourceDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id"
/>
v-for="(option, index) in pqSourceArray"
:key="index"
:label="option.label"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item label="数据源" prop="dataSource_Id" :label-width="100">
<el-select v-model="formData.dataSource_Id" multiple collapse-tags placeholder="请选择数据源" autocomplete="off" :disabled="isReadOnly">
<el-form-item label="数据源" prop="datasourceIds" :label-width="100">
<el-select v-model="formContent.datasourceIds" multiple collapse-tags placeholder="请选择数据源" autocomplete="off" >
<el-option
v-for="plan in testSoureDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id">
</el-option>
v-for="item in dictStore.getDictData(dataSourceType)"
:key="item.id"
:label="item.name"
:value="item.value || ''"
/>
</el-select>
</el-form-item>
<el-form-item label="检测脚本" prop="scriptId" :label-width="100">
<el-select v-model="formContent.scriptId" placeholder="请选择检测脚本" autocomplete="off" >
<el-option
v-for="(option, index) in pqScriptArray"
:key="index"
:label="option.label"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item label="检测脚本" prop="script_Id" :label-width="100">
<el-select v-model="formData.script_Id" placeholder="请选择检测脚本" autocomplete="off" :disabled="isReadOnly">
<el-form-item label="误差体系" prop="errorSysId" :label-width="100">
<el-select v-model="formContent.errorSysId" placeholder="请选择误差体系" autocomplete="off">
<el-option
v-for="plan in testScriptDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id">
</el-option>
v-for="(option, index) in pqErrorArray"
:key="index"
:label="option.label"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item label="误差体系" prop="error_Sys_Id" :label-width="100">
<el-select v-model="formData.error_Sys_Id" placeholder="请选择误差体系" autocomplete="off" :disabled="isReadOnly">
<el-option
v-for="plan in testErrSystDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label='被检设备' :label-width='100' prop='device_Id'>
<el-select v-model="formData.device_Id" multiple collapse-tags placeholder="请选择被检设备">
<el-form-item label='被检设备' :label-width='100' prop='devIds'>
<el-select v-model="formContent.devIds" multiple collapse-tags placeholder="请选择被检设备">
<el-option
v-for="plan in deviceDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id"
/>
v-for="(option, index) in pqDevArray"
:key="index"
:label="option.label"
:value="option.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label='检测功能' :label-width='100' prop='device_Id'>
<el-checkbox v-model="checked1" label="守时检测" size="large" />
</el-form-item> -->
<el-form-item label="守时检测" :label-width="100">
<el-radio-group v-model="timeFlag" >
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-form-item>
<el-form-item label="守时检测" :label-width="100" prop='timeCheck'>
<el-radio-group v-model="formContent.timeCheck" >
<el-radio :value="1"></el-radio>
<el-radio :value="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form-item>
</el-form>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleSubmit" :disabled="isReadOnly"> </el-button>
<el-button @click='close()'> </el-button>
<el-button type="primary" @click='save()' > </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
import{ElMessage, type FormInstance,type FormItemRule}from'element-plus'
import { defineProps, defineEmits, reactive,watch,ref, type Ref, computed } from 'vue';
import { dialogSmall} from '@/utils/elementBind'
import {dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,sourceDataList,deviceDataList,testSoureDataList,testScriptDataList,testErrSystDataList,planData,testFatherPlanList} from '@/api/plan/planData'
import { type Plan } from '@/api/plan/interface';
import { addPlan, updatePlan,getUnboundPqDevList,getBoundPqDevList,getPqErrSysList,getPqScriptList,getTestSourceList } from '@/api/plan/plan.ts'
import { useDictStore } from '@/stores/modules/dict'
import { type TestSource } from '@/api/device/interface/testSource';
import { type TestScript } from '@/api/device/interface/testScript';
import { type ErrorSystem } from '@/api/device/interface/error';
import { type Device } from '@/api/device/interface/device';
const props = defineProps<{
visible: boolean;
dialogTitle: string;
isReadOnly: boolean,
formData: {
id:string;
name: string;
pattern: string; //模式,字典表(数字、模拟、比对)
father_Plan_Id: string; //父计划ID
source_Id: string;//检测源ID
dataSource_Id: string; //数据源ID
script_Id: string; //检测脚本ID
error_Sys_Id: string;//误差体系ID
device_Id: string;//被检设备ID
test_State: string; //检测状态
report_State: string; //报告生成状态
result: string;//检测结果
state: number; //状态
};
}>();
const checked1 = ref(false)
const timeFlag = ref('0')
const fatherPlanList = [
{ label: '/', value: 'type0' },
{ label: '检测计划1', value: 'type1' },
{ label: '检测计划2', value: 'type2' },
{ label: '检测计划3', value: 'type3' },
{ label: '检测计划4', value: 'type4' },
];
const sourceList = [
{ label: '分钟统计数据最大值', value: 'type0' },
{ label: '分钟统计数据最大值', value: 'type1' },
{ label: '分钟统计数据CP95值', value: 'type2' },
];
const scriptList = [
{ label: '/', value: 'type0' },
{ label: '国网入网检测脚本(单影响量-模拟式)', value: 'type1' },
{ label: '国网入网检测脚本Q/GDW 10650.4 - 2021) 数字式', value: 'type1' },
];
const errorList = [
{ label: 'Q/GDW 1650.2- 2016', value: 'type0' },
{ label: 'Q/GDW 10650.2 - 2021', value: 'type1' },
];
const dictStore = useDictStore()
// 定义弹出组件元信息
const dialogFormRef = ref()
const mode = ref()
const pqSourceList=ref<TestSource.ResTestSource[]>([])//获取指定模式下所有检测源
const pqScriptList=ref<TestScript.ResTestScript[]>([])//获取指定模式下所有检测源
const pqErrSysList=ref<ErrorSystem.ErrorSystemList[]>([])//获取指定模式下所有检测源
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
(e: 'submit', data: any): void;
}>();
const pqSourceArray = ref<{ label: string; value: string; }[]>()
const pqScriptArray = ref<{ label: string; value: string; }[]>()
const pqErrorArray = ref<{ label: string; value: string; }[]>()
const pqDevArray = ref<{ label: string; value: string; }[]>()
function useMetaInfo() {
const dialogVisible = ref(false)
const titleType = ref('add')
const formContent = ref<Plan.ReqPlan>({
id:'',
planId:'',
name: '',
pattern: mode.value,
fatherPlanId: '',
dataSourceId: '',
scriptId: '',
errorSysId: '',
timeCheck:0,
testState: 0,
reportState: 0,
result: 2,
code:1,
state:1,
scriptName:'',
errorSysName:'',
sourceName:'',
devIds:[],
sourceIds:[],
datasourceIds:'',
})
return { dialogVisible, titleType, formContent }
}
const { dialogVisible, titleType, formContent } = useMetaInfo()
// 清空formContent
const resetFormContent = () => {
formContent.value = {
id:'',
planId:'',
name: '',
pattern: mode.value,
fatherPlanId: '',
dataSourceId: '',
scriptId: '',
errorSysId: '',
timeCheck:0,
testState: 0,
reportState: 0,
result: 2,
code:1,
state:1,
scriptName:'',
errorSysName:'',
sourceName:'',
devIds:[],
sourceIds:[],
datasourceIds:'',
}
}
let dialogTitle = computed(() => {
return titleType.value === 'add' ? '新增检测计划' : '编辑检测计划'
})
// 定义规则
const formRuleRef = ref<FormInstance>()
@@ -154,47 +167,150 @@ const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
dataSource_Id: [{ required: true, message: '数据源必选!', trigger: 'blur' }],
script_Id: [{ required: true, message: '检测脚本必选!', trigger: 'blur' }],
error_Sys_Id: [{ required: true, message: '误差体系必选!', trigger: 'blur' }],
// name: [{ required: true, message: '检测计划名称必填!', trigger: 'blur' }],
// father_Plan_Id: [{ required: true, message: '参照标准名称必填!', trigger: 'change' }],
});
const handleCancel = () => {
//重置表单内容
//取消表单校验状态
formRuleRef.value && formRuleRef.value.resetFields()
emit('update:visible', false); // 关闭对话框
};
// 关闭弹窗
const close = () => {
dialogVisible.value = false
// 清空dialogForm中的值
resetFormContent()
// 重置表单
dialogFormRef.value?.resetFields()
const handleSubmit = () => {
}
// 保存数据
const save = () => {
try {
formRuleRef.value?.validate((valid: boolean) => {
if (valid)
{
// 将表单数据转为json,发送到后端
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
//console.log(confirmFormData)
emit('submit', props.formData); // 提交表单数据
emit('update:visible', false); // 提交后关闭对话框
}
else
{
ElMessage.error('请填选必填项!')
}
dialogFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
if (formContent.value.id) {
await updatePlan(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
} else {
// 新增需要把设备模式转成字典ID
const patternItem = dictStore.getDictData('Pattern').find(item => item.name === formContent.value.pattern);
if (patternItem) {
formContent.value.pattern = patternItem.id;
}
await addPlan(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
close()
// 刷新表格
await props.refreshTable!()
}
})
} catch (error) {
console.error('验证过程中发生错误', error)
}
};
} catch (err) {
console.error('验证过程中出现错误', err)
}
}
// 当 props.visible 改变时,更新 formData
watch(() => props.visible, (newVal) => {
if (!newVal) {
// 这里可以重置表单数据,如果需要的话
// 打开弹窗,可能是新增,也可能是编辑
const open = async (sign: string,
data: Plan.ReqPlan,
currentMode: string,) => {
let pqDevList=ref<Device.ResPqDev[]>([])//获取指定模式下所有检测源
//处理异步调用
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== currentMode)?.id ?? ''
data.pattern = patternId
const pqSource_Result = await getTestSourceList(data);
pqSourceList.value = pqSource_Result.data as TestSource.ResTestSource[];
const PqScript_Result = await getPqScriptList(data);
pqScriptList.value = PqScript_Result.data as TestScript.ResTestScript[];
const PqErrSys_Result = await getPqErrSysList();
pqErrSysList.value = PqErrSys_Result.data as unknown as ErrorSystem.ErrorSystemList[];
if(sign == 'add')
{
const pqDevList_Result = await getUnboundPqDevList(data);
pqDevList.value = pqDevList_Result.data as Device.ResPqDev[];
}else{
const boundPqDevList_Result = await getBoundPqDevList({ 'planId': data.id });
const unboundPqDevList_Result = await getUnboundPqDevList(data);
const boundData = Array.isArray(boundPqDevList_Result.data) ? boundPqDevList_Result.data : [];
const unboundData = Array.isArray(unboundPqDevList_Result.data) ? unboundPqDevList_Result.data : [];
pqDevList.value = [...boundData,...unboundData] as Device.ResPqDev[];
pqDevArray.value = pqDevList.value.map(i => ({
label: i.name,
value: i.id
})); // 设置已绑定设备为默认选中
formContent.value.devIds = boundData.map(i => i.id)// 已绑定设备id集合
console.log('123',formContent.value.devIds)
}
console.log(formContent.value)
const sourceArray1 = Array.isArray(pqSourceList.value) ? pqSourceList.value : []
// 将 pqSource_Result 转换成 { label, value } 数组
pqSourceArray.value = sourceArray1.map(item => ({
label: item.name || '',
value: item.id
}));
const sourceArray2 = Array.isArray(pqScriptList.value ) ? pqScriptList.value : []
pqScriptArray.value = sourceArray2.map(item => ({
label: item.name || '',
value: item.id || ''
}));
const sourceArray3 = Array.isArray(pqErrSysList.value) ? pqErrSysList.value : []
pqErrorArray.value = sourceArray3.map(item => ({
label: item.name,
value: item.id
}));
// const sourceArray4 = Array.isArray(pqDevList.value) ? pqDevList.value : []
// pqDevArray.value = sourceArray4.map(item => ({
// label: item.name,
// value: item.id
// }))
mode.value = currentMode
titleType.value = sign
dialogVisible.value = true
if (data.id) {
formContent.value = { ...data }
} else {
resetFormContent()
}
});
// 重置表单
dialogFormRef.value?.resetFields()
}
const dataSourceType = computed(() => {
switch (mode.value) {
case '模拟式':
return 'Datasource_Simulate'
case '数字式':
return 'Datasource_Digital'
default:
return 'Datasource_Contrast'
}
})
// 对外映射
defineExpose({ open })
const props = defineProps<{
refreshTable: (() => Promise<void>) | undefined;
}>()
</script>
<style scoped lang="scss">

View File

@@ -14,7 +14,6 @@
:data='testSourceData'
type='selection'
>
<!-- :request-api="getTableList" 如果要显示静态数据就切换该配置-->
<!-- 表格 header 按钮 -->
<template #tableHeader='scope'>
<el-button type='primary' :icon='Download' plain :disabled='!scope.isSelected' @click="exportClick">移入检测计划</el-button>

View File

@@ -3,7 +3,7 @@
<ProTable
ref='proTable'
:columns='columns'
:data='planData'
:request-api='getTableList'
>
<!-- 表格 header 按钮 -->
<template #tableHeader='scope'>
@@ -12,99 +12,40 @@
<el-button type='primary' :icon='ScaleToOriginal' :disabled='!(scope.selectedList.length > 1)' @click='combineClick'>
合并
</el-button>
<el-button type='primary' :icon='CirclePlus' @click='openAddDialog'>新增</el-button>
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
删除
</el-button>
<input type='file' style='display: none' ref='fileInput' @change='handleFiles'>
</template>
<!-- 表格操作 -->
<template #operation='scope'>
<!-- <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='EditPen' @click='openEditDialog(scope.row)'>编辑</el-button>
<el-button type='primary' link :icon='Delete' @click='openEditDialog(scope.row)'>删除</el-button>
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit',scope.row)">编辑</el-button>
<el-button type='primary' link :icon='Delete' @click='handleDelete(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-button link type='primary' class='table-operate'>
<div class='table-operate-text'>更多</div>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item :style="{color: 'var(--el-color-danger)'}" :icon='Delete'>
删除
</el-dropdown-item>
<el-dropdown-item :icon='List' @click='showDeviceOpen(scope.row)'>
设备绑定
</el-dropdown-item>
<el-dropdown-item :icon='Tools' @click='showtestSourceOpen(scope.row)'>
检测源绑定
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div> -->
</template>
</ProTable>
<!-- 向计划导入/导出设备对话框 -->
<planPopup
:visible="dialogFormVisible"
:formData="dialogForm"
:dialogTitle="dialogTitle"
:is-read-only="isReadOnly"
@update:visible="dialogFormVisible = $event"
/>
<!-- 查看误差体系详细信息 -->
<ErrorStandardDialog
:visible='detail_dialogFormVisible'
:formData='detail_dialogForm'
:dialogTitle='detail_dialogTitle'
@update:visible='detail_dialogFormVisible = $event'
ref="errorStandardPopup"
/>
<!-- <TestSourcePopup :refresh-table='proTable?.getTableList' ref='testSourcePopup' /> -->
</div>
<devTransfer
:dialogVisible=devTransferVisible
@update:visible='devTransferVisible = $event'
/>
<sourceTransfer
:dialogVisible=sourceTransferVisible
@update:visible='sourceTransferVisible = $event'
/>
<DeviceOpen :width='viewWidth' :height='viewHeight' ref='openDeviceView' />
<SourceOpen :width='viewWidth' :height='viewHeight' ref='openSourceView' />
<!-- 向计划导入/导出设备对话框 -->
<PlanPopup :refresh-table='proTable?.getTableList' ref='planPopup'/>
<!-- 查看误差体系详细信息 -->
<ErrorStandardDialog :refresh-table='proTable?.getTableList' ref="errorStandardPopup"/>
<DevTransfer :refresh-table='proTable?.getTableList' ref='devTransferPopup'/>
</template>
<script setup lang='tsx' name='useProTable'>
import ProTable from '@/components/ProTable/index.vue'
import TimeControl from '@/components/TimeControl/index.vue'
import type { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
import { ScaleToOriginal, CirclePlus, Delete, EditPen, View, Upload, Download, List, Tools } from '@element-plus/icons-vue'
import {
dictPattern,
dictTestState,
dictReportState,
dictResult,
testPlanDataList,
testSoureDataList,
testScriptDataList,
testErrSystDataList,
planData,
testFatherPlanList,
} from '@/api/plan/planData'
import { reactive, ref } from 'vue'
import {getPlanList,deletePlan } from '@/api/plan/plan.ts'
import { computed, onMounted, reactive, ref } from 'vue'
import type { Plan } from '@/api/plan/interface'
import planPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
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 moreButtons from './components/moreButtons.vue'
import devTransfer from './components/devTransfer.vue'
import sourceTransfer from './components/sourceTransfer.vue'
import DevTransfer from './components/devTransfer.vue'
import { useViewSize } from '@/hooks/useViewSize'
import { useRouter } from 'vue-router'
import { useDictStore } from '@/stores/modules/dict'
@@ -113,60 +54,45 @@ import type { Action } from 'element-plus'
import type { ErrorSystem } from '@/api/error/interface'
import ErrorStandardDialog 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 { type TestSource } from '@/api/device/interface/testSource'
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
import { useHandleData } from '@/hooks/useHandleData'
const dictStore = useDictStore()
// 定义包含和排除的单位
const includedUnits = ['日', '周', '月', '自定义'] // 可以根据需要包含的单位
const excludedUnits = ['季度', '年'] // 要排除的单位
const defaultUnits = '日' // 默认的单位
const { popupBaseView, viewWidth, viewHeight } = useViewSize()
const openDeviceView = ref()
const openSourceView = ref()
const devTransferVisible = ref(false)
const sourceTransferVisible = ref(false)
// ProTable 实例
const proTable = ref<ProTableInstance>()
// const planData = planData
const dialogFormVisible = ref(false)
const dialogTitle = ref('')
const isReadOnly = ref(false)
const router = useRouter()
const errorStandardPopup = ref()
const planPopup = ref()
const devTransferPopup = ref()
const modeStore = useModeStore();
const fileInput = ref<HTMLInputElement | null>(null) // 声明 fileInput
const dialogForm = ref<Plan.PlanBO>({
id: '',
name: '',
pattern: '',
father_Plan_Id: '',
dataSource_Id: '',
script_Id: '',
error_Sys_Id: '',
test_State: '',
report_State: '',
result: '',
const getTableList = async(params: any) => {
let newParams = JSON.parse(JSON.stringify(params))
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
newParams.pattern = patternId
return getPlanList(newParams)
}
})
const detail_dialogFormVisible = ref(false)
const detail_dialogTitle = ref('Q/GDW 10650.2-2021 误差体系')
const detail_dialogForm = ref<ErrorSystem.Error_detail>({
measured: '',//被测量
deviceLevel: '',//检测装置级别
measurementType: '',
condition: '',//测量条件
maxErrorValue: '',//最大误差
})
// <el-button
// v-for="(button, index) in scope.row.testSourceList"
// :key="index"
// @click="handleClick(button)"
// >
// {{ button.text }}
// </el-button>
const dataSourceType = computed(() => {
switch (modeStore.currentMode) {
case '模拟式':
return 'Datasource_Simulate'
case '数字式':
return 'Datasource_Digital'
default:
return 'Datasource_Contrast'
}
})
// 表格配置项
const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{
@@ -176,96 +102,204 @@ const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
search: { el: 'input' },
},
{
prop: 'testSourceName',
prop: 'sourceName',
label: '检测源',
width: 375,
minWidth: 480,
render: scope => {
return (
<div class='flx-flex-start'>
<el-button type='primary' link onClick={() => showTestSource(scope.row.testSourceName)}>
{scope.row.testSourceName}
</el-button>
<el-link type='primary' link onClick={() => showTestSource(scope.row.sourceName)}>
{scope.row.sourceName}
</el-link>
<moreButtons isShow={isVisible(scope.row)} ></moreButtons>
</div>
)
},
},
{
prop: 'script_Id',
prop: 'scriptId',
label: '检测脚本',
width: 360,
enum: testScriptDataList,
fieldNames: { label: 'label', value: 'id' },
render: scope => {
return (
<el-button type='primary' link onClick={() => showTestScript(scope.row.script_Id)}>
{getScriptName(scope.row.script_Id)}
</el-button>
<el-link type='primary' link onClick={() => showTestScript(scope.row.scriptId)}>
{scope.row.scriptName}
</el-link>
)
},
},
{
prop: 'error_Sys_Id',
prop: 'errorSysId',
label: '误差体系',
width: 200,
enum: testErrSystDataList,
fieldNames: { label: 'label', value: 'id' },
render: scope => {
const errSysName = getErrSysName(scope.row.error_Sys_Id)
return (
<el-button type='primary' link onClick={() => showData(errSysName || '')}>
{errSysName}
</el-button>
<el-link type='primary' link onClick={() => showData(scope.row.errorSysId || '')}>
{scope.row.errorSysName}
</el-link>
)
},
},
{
prop: 'dataSource_Ids',
prop: 'datasourceIds',
label: '数据源',
width: 120,
// enum: testSoureDataList,
// fieldNames: { label: 'label', value: 'id' },
enum: dictStore.getDictData(dataSourceType.value),
fieldNames: { label: 'name', value: 'value' },
minWidth: 250,
render: (scope) => {
const codes = scope.row.datasourceIds // 获取当前行的 datasourceIds 字段
if (!codes) {
return '/'
}
// 确保 codes 是一个字符串
const codeString = Array.isArray(codes) ? codes.join(',') : codes
const codeArray = codeString.split(',')
if (codeArray.length > 1) {
// 查找与每个 code 值匹配的 name然后拼接成逗号分割的字符串
const names = codeArray.map(code => {
const dictItem = dictStore.getDictData(dataSourceType.value).find(item => item.value === code)
return dictItem ? dictItem.name : '/' // 如果找到匹配的项,返回对应的 name
})
return names.join(', ') // 用逗号连接所有的 name
}
// 查找单个 code 对应的 name
const dictItem = dictStore.getDictData(dataSourceType.value).find(item => item.value === codeArray[0])
return dictItem ? dictItem.name : '/' // 如果找到匹配的项,返回对应的 name
},
},
{
prop: 'test_State',
prop: 'testState',
label: '检测状态',
width: 120,
enum: dictTestState,
// enum: dictStore.getDictData('planTestState'),
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'id' },
render: scope => {
return (
scope.row.testState === 0 ? '未检' : scope.row.testState === 1 ? '检测中' : '检测完成'
)
},
},
{
prop: 'report_State',
prop: 'reportState',
label: '检测报告状态',
width: 120,
enum: dictReportState,
// enum: dictStore.getDictData('planReportState'),
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'id' },
render: scope => {
return (
scope.row.testState === 0 ? '未生成' : scope.row.testState === 1 ? '部分生成' : '全部生成'
)
},
},
{
prop: 'result',
label: '检测结果',
width: 120,
enum: dictResult,
// enum: dictStore.getDictData('planResult'),
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'id' },
render: scope => {
return (
scope.row.testState === 0 ? '不符合' : scope.row.testState === 1 ? '符合' : '/'
)
},
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
])
function getScriptName(id: string) {
return testScriptDataList.find(item => item.id == id)?.label
}
function getErrSysName(id: string) {
return testErrSystDataList.find(item => item.id == id)?.label
}
// // 表格配置项
// const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
// { type: 'selection', fixed: 'left', width: 70 },
// { type: 'index', fixed: 'left', width: 70, label: '序号' },
// {
// prop: 'name',
// label: '名称',
// width: 220,
// search: { el: 'input' },
// },
// {
// prop: 'testSourceName',
// label: '检测源',
// width: 375,
// render: scope => {
// return (
// <div class='flx-flex-start'>
// <el-link type='primary' link onClick={() => showTestSource(scope.row.testSourceName)}>
// {scope.row.testSourceName}
// </el-link>
// <moreButtons isShow={isVisible(scope.row)} ></moreButtons>
// </div>
// )
// },
// },
// {
// prop: 'script_Id',
// label: '检测脚本',
// width: 360,
// enum: testScriptDataList,
// fieldNames: { label: 'label', value: 'id' },
// render: scope => {
// return (
// <el-link type='primary' link onClick={() => showTestScript(scope.row.script_Id)}>
// {getScriptName(scope.row.script_Id)}
// </el-link>
// )
// },
// },
// {
// prop: 'error_Sys_Id',
// label: '误差体系',
// width: 200,
// enum: testErrSystDataList,
// fieldNames: { label: 'label', value: 'id' },
// render: scope => {
// const errSysName = getErrSysName(scope.row.error_Sys_Id)
// return (
// <el-link type='primary' link onClick={() => showData(errSysName || '')}>
// {errSysName}
// </el-link>
// )
// },
// },
// {
// prop: 'dataSource_Ids',
// label: '数据源',
// width: 120,
// // enum: testSoureDataList,
// // fieldNames: { label: 'label', value: 'id' },
// },
// {
// prop: 'test_State',
// label: '检测状态',
// width: 120,
// enum: dictTestState,
// // enum: dictStore.getDictData('planTestState'),
// search: { el: 'select', props: { filterable: true } },
// fieldNames: { label: 'label', value: 'id' },
// },
// {
// prop: 'report_State',
// label: '检测报告状态',
// width: 120,
// enum: dictReportState,
// // enum: dictStore.getDictData('planReportState'),
// search: { el: 'select', props: { filterable: true } },
// fieldNames: { label: 'label', value: 'id' },
// },
// {
// prop: 'result',
// label: '检测结果',
// width: 120,
// enum: dictResult,
// // enum: dictStore.getDictData('planResult'),
// search: { el: 'select', props: { filterable: true } },
// fieldNames: { label: 'label', value: 'id' },
// },
// { prop: 'operation', label: '操作', fixed: 'right', width: 250 },
// ])
const fileInput = ref<HTMLInputElement | null>(null) // 声明 fileInput
function openFileDialog() {
if (fileInput.value) {
fileInput.value.click()
@@ -273,36 +307,34 @@ function openFileDialog() {
}
function isVisible(row: Plan.PlanAndSourceBO) {
//console.log(row)
if(!row.hasOwnProperty('testSourceList') || !Array.isArray(row.testSourceList))
function isVisible(row: Plan.ReqPlan) {
if(!row.hasOwnProperty('sourceName') || !Array.isArray(row.sourceName)){
return false
else if(row.testSourceList.length <= 1)
}
else if(row.sourceName.length <= 1){
return false
else
}
else{
return true
}
}
const errorStandardPopup = ref()
function showData(row: string) {
errorStandardPopup.value?.open(row, row)
// router.push({
// path: "/machine/device",
// query: { id: row }
// });
}
const testSourcePopup = ref()
function showTestSource(row: string) {
//testSourcePopup.value?.open('view', row,'模拟式')
}
function showTestScript(row: string) {
}
function handleFiles(event: Event) {
const target = event.target as HTMLInputElement
const files = target.files
@@ -363,52 +395,25 @@ const combineClick = () => {
})
}
// 打开编辑对话框
const openEditDialog = (planSystem: Plan.PlanBO) => {
dialogForm.value = { ...planSystem }
dialogTitle.value = '编辑检测计划'
isReadOnly.value = false
dialogFormVisible.value = true // 打开对话框
// 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<Plan.ReqPlan> = {}) => {
planPopup.value?.open(titleType, row,modeStore.currentMode)
}
const openAddDialog = () => {
dialogForm.value = {
id: '',
name: '',
pattern: '',
father_Plan_Id: '',
dataSource_Id: '',
script_Id: '',
error_Sys_Id: '',
test_State: '',
report_State: '',
result: '',
}
dialogTitle.value = '新增检测计划'
isReadOnly.value = false
dialogFormVisible.value = true // 打开对话框
// 删除检测计划
const handleDelete = async (params: Plan.ReqPlanParams) => {
await useHandleData(deletePlan, [params.id], `删除【${params.name}】检测计划`)
proTable.value?.getTableList()
}
const handleRowClick = (planSystem: Plan.PlanBO) => {
dialogForm.value = { ...planSystem }
dialogTitle.value = '查看检测计划'
isReadOnly.value = true
dialogFormVisible.value = true // 打开对话框
const showDeviceOpen = (row: Partial<Plan.ReqPlan> = {}) => {
devTransferPopup.value.open(row)
}
const showDeviceOpen = (planSystem: Plan.PlanBO) => {
devTransferVisible.value = true
//openDeviceView.value.open('计划设备列表')
}
const showtestSourceOpen = (planSystem: Plan.PlanBO) => {
sourceTransferVisible.value = true
// openSourceView.value.open('计划检测源列表')
// router.push({
// path: "/machine/testSource",
// });
}
</script>
<style scoped>

View File

@@ -14,7 +14,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label='检最大次数' prop='maxTime' :label-width="110">
<el-form-item label='检最大次数' prop='maxTime' :label-width="110">
<el-input-number v-model='TestConfigForm.maxTime' :min='1' :max='999' />
</el-form-item>
</el-col>