diff --git a/frontend/.env.development b/frontend/.env.development
index ca3d07d..8f13788 100644
--- a/frontend/.env.development
+++ b/frontend/.env.development
@@ -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/"]]张文
diff --git a/frontend/src/api/device/interface/device.ts b/frontend/src/api/device/interface/device.ts
index 8135666..ce3d6b7 100644
--- a/frontend/src/api/device/interface/device.ts
+++ b/frontend/src/api/device/interface/device.ts
@@ -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; //创建时间
diff --git a/frontend/src/api/home/interface/channelsTest.ts b/frontend/src/api/home/interface/channelsTest.ts
index 60230ab..195892f 100644
--- a/frontend/src/api/home/interface/channelsTest.ts
+++ b/frontend/src/api/home/interface/channelsTest.ts
@@ -20,7 +20,7 @@ export namespace ChannelsTest {
cIeData:string;//电流通道C数据
cIeXi:string;//电流通道C系数
loading: boolean;
-
+ reason?:string;//(不)合格原因
}
}
\ No newline at end of file
diff --git a/frontend/src/directives/modules/auth.ts b/frontend/src/directives/modules/auth.ts
index 8730c93..8d78f0b 100644
--- a/frontend/src/directives/modules/auth.ts
+++ b/frontend/src/directives/modules/auth.ts
@@ -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()
}
},
diff --git a/frontend/src/views/home/components/channelsTest.vue b/frontend/src/views/home/components/channelsTest.vue
index 33a23f1..f5ffa28 100644
--- a/frontend/src/views/home/components/channelsTest.vue
+++ b/frontend/src/views/home/components/channelsTest.vue
@@ -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 || '';
diff --git a/frontend/src/views/home/components/channelsTestTable.vue b/frontend/src/views/home/components/channelsTestTable.vue
index e8bac94..63bb9c4 100644
--- a/frontend/src/views/home/components/channelsTestTable.vue
+++ b/frontend/src/views/home/components/channelsTestTable.vue
@@ -9,8 +9,8 @@
-
-
+
+
@@ -20,7 +20,7 @@
-
+
-
-
+
+
@@ -65,7 +65,7 @@
-
+
-
-
+
+
@@ -104,7 +104,7 @@
-
+
-
-
+
+
@@ -145,7 +145,7 @@
-
+
-
-
+
+
@@ -184,7 +184,7 @@
-
+
-
-
+
+
@@ -223,7 +223,7 @@
-
+
设备新增 -->
- 系数校准
@@ -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([]);
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();
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[]>([
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([]); // 初始化为空数组
+ 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,