微调
This commit is contained in:
@@ -19,6 +19,6 @@ VITE_API_URL=/api
|
||||
|
||||
# 开发环境跨域代理,支持配置多个
|
||||
|
||||
VITE_PROXY=[["/api","http://192.168.1.127:18092/"]]
|
||||
VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
|
||||
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
|
||||
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
||||
|
||||
@@ -50,7 +50,7 @@ export namespace Device {
|
||||
planId?:string;//检测计划Id
|
||||
timeCheckResult?:number;//守时检测结果(0:不符合1:符合)
|
||||
factorFlag?:number;//是否支持系数校准(0:不支持,1:支持)
|
||||
factorCheckResult?: number;//系数校准结果(0:不符合1:符合)
|
||||
factorCheckResult?: number;//系数校准结果(0:不合格,1:合格,2:/表示没有做系数校准)
|
||||
state: number; //状态
|
||||
createBy?: string| null; //创建用户
|
||||
createTime?: string| null; //创建时间
|
||||
|
||||
@@ -20,7 +20,7 @@ export namespace ChannelsTest {
|
||||
cIeData:string;//电流通道C数据
|
||||
cIeXi:string;//电流通道C系数
|
||||
loading: boolean;
|
||||
|
||||
reason?:string;//(不)合格原因
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,12 +10,14 @@ const auth: Directive = {
|
||||
const { value } = binding
|
||||
const authStore = useAuthStore()
|
||||
const currentPageRoles = authStore.authButtonListGet[authStore.routeName] ?? []
|
||||
// console.log('1234',authStore.routeName)
|
||||
// console.log('123',currentPageRoles)
|
||||
if (value instanceof Array && value.length) {
|
||||
// console.log('1234',authStore.routeName)
|
||||
// console.log('123',currentPageRoles)
|
||||
if (value instanceof Array && value.length) {
|
||||
console.log('123456',value)
|
||||
const hasPermission = value.every(item => currentPageRoles.includes(item))
|
||||
if (!hasPermission) el.remove()
|
||||
} else {
|
||||
console.log('12345',value)
|
||||
if (!currentPageRoles.includes(value)) el.remove()
|
||||
}
|
||||
},
|
||||
|
||||
@@ -96,6 +96,7 @@ import { ElMessage, ElMessageBox, TabsPaneContext } from 'element-plus';
|
||||
import { getCoefficientCheck } from '@/api/home/channelsTest/index'
|
||||
import type { ChannelsTest } from '@/api/home/interface/channelsTest';
|
||||
import type { Plan } from '@/api/plan/interface';
|
||||
import { fa } from 'element-plus/es/locale';
|
||||
const activeIndex = ref(0)
|
||||
const activeTotalNum = ref(4)
|
||||
const qualified = ref(0)
|
||||
@@ -324,7 +325,8 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
devName:'',
|
||||
reason:'',
|
||||
},
|
||||
{
|
||||
monitorNum: '2',
|
||||
@@ -343,7 +345,8 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
devName:'',
|
||||
reason:'',
|
||||
},
|
||||
{
|
||||
monitorNum: '3',
|
||||
@@ -362,7 +365,8 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
devName:'',
|
||||
reason:'',
|
||||
},
|
||||
{
|
||||
monitorNum: '4',
|
||||
@@ -381,7 +385,8 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
devName:'',
|
||||
reason:'',
|
||||
},
|
||||
|
||||
];
|
||||
@@ -403,6 +408,8 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
},
|
||||
{
|
||||
monitorNum: '2',
|
||||
@@ -420,6 +427,8 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
},
|
||||
{
|
||||
monitorNum: '3',
|
||||
@@ -437,6 +446,8 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
},
|
||||
{
|
||||
monitorNum: '4',
|
||||
@@ -454,6 +465,8 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading:false,
|
||||
devName:''
|
||||
},
|
||||
|
||||
];
|
||||
@@ -465,22 +478,6 @@ const updateErrorState = (index: number, hasError: boolean) => {
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (selection: Device.ResPqDev[],plan:Plan.ReqPlan) => {
|
||||
const checkStates = selection.map(item => item.checkState);
|
||||
const allCheckStatesEqual = new Set(checkStates).size <= 1;
|
||||
|
||||
if (!allCheckStatesEqual) {
|
||||
ElMessageBox.confirm(
|
||||
'所勾选设备检测状态不一致,请重新选择',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
isButtonDisabled.value = false; // 恢复按钮
|
||||
select_Plan.value = plan
|
||||
planId.value = selection[0]?.planId || '';
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<el-table-column prop="monitorNum" label="监测点序号" width="80"/>
|
||||
<el-table-column prop="desc" label="描述" width="90"/>
|
||||
<el-table-column label="电压通道" >
|
||||
<el-table-column prop="Ua" label="L1">
|
||||
<el-table-column prop="aVuData" label="数据(V)">
|
||||
<el-table-column prop="Ua" label="L1(V)">
|
||||
<el-table-column prop="aVuData" label="被检值">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.aVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -20,7 +20,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="aVuXi" label="结果">
|
||||
<el-table-column prop="aVuXi" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.aVuXi === '不合格'"
|
||||
@@ -54,8 +54,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ub" label="L2">
|
||||
<el-table-column prop="bVuData" label="数据(V)">
|
||||
<el-table-column prop="Ub" label="L2(V)">
|
||||
<el-table-column prop="bVuData" label="被检值">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.bVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -65,7 +65,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bVuXi" label="结果">
|
||||
<el-table-column prop="bVuXi" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.bVuXi === '不合格'"
|
||||
@@ -93,8 +93,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Uc" label="L3">
|
||||
<el-table-column prop="cVuData" label="数据(V)">
|
||||
<el-table-column prop="Uc" label="L3(V)">
|
||||
<el-table-column prop="cVuData" label="被检值">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.cVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -104,7 +104,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cVuXi" label="结果">
|
||||
<el-table-column prop="cVuXi" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.cVuXi === '不合格'"
|
||||
@@ -134,8 +134,8 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="电流通道" >
|
||||
<el-table-column prop="Ia" label="L1">
|
||||
<el-table-column prop="aIeData" label="数据(A)">
|
||||
<el-table-column prop="Ia" label="L1(A)">
|
||||
<el-table-column prop="aIeData" label="被检值">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.aIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -145,7 +145,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="aIeXi" label="结果">
|
||||
<el-table-column prop="aIeXi" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.aIeXi === '不合格'"
|
||||
@@ -173,8 +173,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ib" label="L2">
|
||||
<el-table-column prop="bIeData" label="数据(A)">
|
||||
<el-table-column prop="Ib" label="L2(A)">
|
||||
<el-table-column prop="bIeData" label="被检值">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.bIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -184,7 +184,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bIeXi" label="结果">
|
||||
<el-table-column prop="bIeXi" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.bIeXi === '不合格'"
|
||||
@@ -212,8 +212,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ic" label="L3">
|
||||
<el-table-column prop="cIeData" label="数据(A)">
|
||||
<el-table-column prop="Ic" label="L3(A)">
|
||||
<el-table-column prop="cIeData" label="被检值">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.cIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -223,7 +223,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cIeXi" label="结果">
|
||||
<el-table-column prop="cIeXi" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.cIeXi === '不合格'"
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<!-- <el-button type="primary" :icon="CirclePlus" @click="addDevice('设备新增')" v-if="form.activeTabs === 0"
|
||||
>设备新增</el-button> -->
|
||||
|
||||
<el-button type="primary" :icon="Odometer" @click="handleTest('系数校准')" v-if="form.activeTabs === 0"
|
||||
<el-button type="primary" v-auth.role="'channelsTest'" :icon="Odometer" @click="handleTest('系数校准')" v-if="form.activeTabs === 0"
|
||||
>系数校准</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -258,6 +258,8 @@ import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
import {useCheckStore} from '@/stores/modules/check'
|
||||
import {CheckData} from '@/api/check/interface'
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
import auth from "@/directives/modules/auth";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const checkStore = useCheckStore()
|
||||
@@ -304,6 +306,7 @@ const deviceData = ref<Device.ResPqDev[]>([]);
|
||||
const operationShow = ref(false);
|
||||
const documentStateShow = ref(false);
|
||||
const checkStateShow = ref(true);
|
||||
const factorCheckShow = ref(true);
|
||||
const operationMinWidth = ref(200);
|
||||
const selectionShow = ref(true);
|
||||
const channelsTest = ref()
|
||||
@@ -405,6 +408,14 @@ const searchForm = ref({
|
||||
const proTable = ref<ProTableInstance>();
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
//权限不包含通道系数,表格不展示列
|
||||
const authStore = useAuthStore()
|
||||
const currentPageRoles = authStore.authButtonListGet[authStore.routeName] ?? []
|
||||
if (!currentPageRoles.includes('channelsTest')) {
|
||||
factorCheckShow.value = false;
|
||||
}
|
||||
|
||||
|
||||
// 调用 ProTable 的 clearSelection 方法清空选择
|
||||
if (proTable.value) {
|
||||
proTable.value.clearSelection();
|
||||
@@ -515,6 +526,28 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'factorCheckResult',
|
||||
label: '系数校准结果',
|
||||
minWidth: 100,
|
||||
sortable:true,
|
||||
isShow:factorCheckShow,
|
||||
render: scope => {
|
||||
if (scope.row.factorCheckResult === 0)
|
||||
{
|
||||
return '不合格';
|
||||
}
|
||||
else if (scope.row.factorCheckResult === 1)
|
||||
{
|
||||
return '合格';
|
||||
}
|
||||
else if (scope.row.factorCheckResult === 2)
|
||||
{
|
||||
return '/';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow},
|
||||
])
|
||||
|
||||
@@ -627,6 +660,7 @@ function tableHeaderInit(val: number) {
|
||||
documentStateShow.value = false;
|
||||
checkStateShow.value = true;
|
||||
selectionShow.value = true;
|
||||
factorCheckShow.value = true;
|
||||
break;
|
||||
case 2://设备复检
|
||||
// form.value.checkStatus = 2;//检测状态默认为检测完成
|
||||
@@ -653,6 +687,7 @@ function tableHeaderInit(val: number) {
|
||||
operationShow.value = true;
|
||||
documentStateShow.value = true;
|
||||
checkStateShow.value = false;
|
||||
factorCheckShow.value = false;
|
||||
selectionShow.value = true;
|
||||
break;
|
||||
case 4://设备归档
|
||||
@@ -670,6 +705,7 @@ function tableHeaderInit(val: number) {
|
||||
operationShow.value = true;
|
||||
documentStateShow.value = false;
|
||||
checkStateShow.value = false;
|
||||
factorCheckShow.value = false;
|
||||
selectionShow.value = true;
|
||||
break;
|
||||
case 5://数据查询
|
||||
@@ -680,6 +716,7 @@ function tableHeaderInit(val: number) {
|
||||
operationShow.value = true;
|
||||
documentStateShow.value = true;
|
||||
checkStateShow.value = false;
|
||||
factorCheckShow.value = false;
|
||||
selectionShow.value = false;
|
||||
columns[0].isShow = false;
|
||||
tableKey.value += 1;
|
||||
@@ -851,6 +888,45 @@ const handleTest = async (val:string) => {
|
||||
}
|
||||
|
||||
if(val === '系数校准') {
|
||||
const checkStates = channelsSelection.value.map(item => item.checkState);
|
||||
const allCheckStatesEqual = new Set(checkStates).size <= 1;
|
||||
|
||||
if (!allCheckStatesEqual) {
|
||||
ElMessageBox.confirm(
|
||||
'所勾选设备检测状态不一致,请重新选择',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const factorFlagArray = ref<string[]>([]); // 初始化为空数组
|
||||
for (let i = 0; i < channelsSelection.value.length; i++) {
|
||||
const factorFlag = channelsSelection.value[i].factorFlag;
|
||||
if (factorFlag !== undefined && factorFlag !== null && factorFlag === 0) {
|
||||
factorFlagArray.value.push(channelsSelection.value[i].name.toString());
|
||||
}
|
||||
}
|
||||
if(factorFlagArray.value.length > 0){
|
||||
const factorFlags = factorFlagArray.value.join(', ');
|
||||
ElMessageBox.confirm(
|
||||
factorFlags + '设备不支持系数校准,请重新选择',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
//开始创建webSocket客户端
|
||||
const data = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
|
||||
Reference in New Issue
Block a user