diff --git a/frontend/src/api/device/device/index.ts b/frontend/src/api/device/device/index.ts
index 77a6236..f9cf8d9 100644
--- a/frontend/src/api/device/device/index.ts
+++ b/frontend/src/api/device/device/index.ts
@@ -32,7 +32,7 @@ export const exportPqDev=(params: Device.ReqPqDevParams)=>{
export const downloadTemplate = () => {
return http.download(`/pqDev/downloadTemplate`)
}
-//导入被检设备
+//导入被检设备(比对)
export const importPqDev=(params: Device.ReqPqDevParams)=>{
return http.upload(`/pqDev/import`, params)
}
diff --git a/frontend/src/layouts/components/Footer/index.vue b/frontend/src/layouts/components/Footer/index.vue
index 38404fc..858afb2 100644
--- a/frontend/src/layouts/components/Footer/index.vue
+++ b/frontend/src/layouts/components/Footer/index.vue
@@ -67,12 +67,13 @@ const handelOpen = async (item: string) => {
await authStore.setShowMenu();
modeStore.setCurrentMode(item); // 将模式code存入 store
- if (router.currentRoute.value.path === '/home/index') {
+ //if (router.currentRoute.value.path === '/home/index') {
// 强制刷新页面
window.location.reload();
- } else {
- router.push({ path: '/home/index' });
- }
+ //} else {
+ // router.push({ path: '/home/index' });
+ //}
+
};
diff --git a/frontend/src/views/home/components/channelsTest.vue b/frontend/src/views/home/components/channelsTest.vue
index 813276b..cf9db9e 100644
--- a/frontend/src/views/home/components/channelsTest.vue
+++ b/frontend/src/views/home/components/channelsTest.vue
@@ -145,13 +145,20 @@ watch(webMsgSend,function (newValue,oldValue){
switch (newValue.requestId){
case 'yjc_ytxjy':
switch (newValue.operateCode) {
- case'INIT GATHER':
+ case'INIT_GATHER':
if(newValue.code ==-1){
- ElMessageBox.alert('源未知异常', '初始化失败', {
+ ElMessageBox.alert('源未知异常', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
- }
+ TableInit();
+ }else if (newValue.code == 10523) {
+ ElMessageBox.alert('源连接失败', '源连接失败', {
+ confirmButtonText: '确定',
+ type: 'error',
+ })
+ TableInit();
+ }
}
break;
case 'YJC_xujy':
@@ -162,13 +169,14 @@ watch(webMsgSend,function (newValue,oldValue){
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
} else if (newValue.code == 10520) {
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
}
- TableInit();
break;
case 'DATA_REQUEST$02':
if (newValue.code == 25003) {
@@ -176,8 +184,8 @@ watch(webMsgSend,function (newValue,oldValue){
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
}
- TableInit();
break;
}
break;
@@ -189,6 +197,7 @@ watch(webMsgSend,function (newValue,oldValue){
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
}else if (newValue.code == 10551) {
ElMessageBox.alert('设备触发报告异常', '设备触发报告异常', {
confirmButtonText: '确定',
@@ -200,17 +209,20 @@ watch(webMsgSend,function (newValue,oldValue){
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
} else if (newValue.code == 10520) {
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
}
- TableInit();
+
break;
}
break;
case 'Coefficient_Check':
+ console.log("Coefficient_Checkactive",active.value);
switch (newValue.operateCode){
case 'big_end'://大电压,电流下装
active.value++;
@@ -363,29 +375,41 @@ watch(webMsgSend,function (newValue,oldValue){
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
break;
case "Dev":
ElMessageBox.alert('设备服务端连接失败', '设备服务端连接失败', {
confirmButtonText: '确定',
type: 'error',
})
+ TableInit();
break;
}
- TableInit();
+
break;
}
})
//出错系数检测初始化
const TableInit = () => {
+ console.log("TableInitactive",active.value);
isButtonDisabled.value = false; // 恢复按钮
for (let i = 0; i < channel.value.length; i++) {
const currentTableData = initializeTableData(dataTemplates, i);
tableDataMap.set(i,currentTableData)
+
+ // const targetArrayRef = tableDataMap.get(i);
+ // if (targetArrayRef) {
+ // const targetArray = targetArrayRef.value;
+ // if (targetArray.length > 0) {
+ // targetArray.forEach(item => item.loading =false)
+ // }
+ // }
}
activeIndex.value = 0
qualified.value = 0
active.value = 0
+
}
//按行图标转动
@@ -679,7 +703,7 @@ const handleSubmit = async () => {
operateType:'0' // '0'为预检测、‘1‘为正式检测
})
active.value++;
-
+ console.log("handleSubmitactive",active.value);
// 初始化 loadingStates 为 true
// loadingStates.value = new Array(name.value.length).fill(true);
diff --git a/frontend/src/views/home/components/channelsTestTable.vue b/frontend/src/views/home/components/channelsTestTable.vue
index 9dede00..7bacfa8 100644
--- a/frontend/src/views/home/components/channelsTestTable.vue
+++ b/frontend/src/views/home/components/channelsTestTable.vue
@@ -29,8 +29,8 @@
placement="bottom-start"
>
- 误差范围: {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}
- 误差值:{{ scope.row.aV }}
+ 误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}
+ 误差值:{{ scope.row.aV + 'V'}}
{{ scope.row.aVuXi }}
@@ -43,8 +43,8 @@
placement="bottom-start"
>
- 误差范围: {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}
- 误差值:{{ scope.row.aV }}
+ 误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}
+ 误差值:{{ scope.row.aV + 'V'}}
{{ scope.row.aVuXi }}
@@ -80,8 +80,8 @@
placement="bottom-start"
>
- 误差范围: {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}
- 误差值:{{ scope.row.bV }}
+ 误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}
+ 误差值:{{ scope.row.bV + 'V'}}
{{ scope.row.bVuXi }}
@@ -94,8 +94,8 @@
placement="bottom-start"
>
- 误差范围: {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}
- 误差值:{{ scope.row.bV }}
+ 误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}
+ 误差值:{{ scope.row.bV + 'V'}}
{{ scope.row.bVuXi }}
@@ -125,8 +125,8 @@
placement="bottom-start"
>
- 误差范围: {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}
- 误差值:{{ scope.row.cV }}
+ 误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}
+ 误差值:{{ scope.row.cV + 'V'}}
{{ scope.row.cVuXi }}
@@ -139,8 +139,8 @@
placement="bottom-start"
>
- 误差范围: {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}
- 误差值:{{ scope.row.cV }}
+ 误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'}}
+ 误差值:{{ scope.row.cV + 'V'}}
{{ scope.row.cVuXi }}
@@ -172,8 +172,8 @@
placement="bottom-start"
>
- 误差范围: {{ -0.5 + "~" +0.5 }}
- 误差值:{{ scope.row.aI }}
+ 误差范围: {{-0.5 + "%~" +0.5 + "%" }}
+ 误差值:{{ scope.row.aI + '%'}}
{{ scope.row.aIeXi }}
@@ -186,8 +186,8 @@
placement="bottom-start"
>
- 误差范围: {{ -0.5 + "~" +0.5 }}
- 误差值:{{ scope.row.aI }}
+ 误差范围: {{ -0.5 + "%~" +0.5 + "%" }}
+ 误差值:{{ scope.row.aI + '%'}}
{{ scope.row.aIeXi }}
@@ -217,8 +217,8 @@
placement="bottom-start"
>
- 误差范围: {{ -0.5 + "~" +0.5 }}
- 误差值:{{ scope.row.bI }}
+ 误差范围: {{ -0.5 + "%~" +0.5 + "%" }}
+ 误差值:{{ scope.row.bI + '%'}}
{{ scope.row.bIeXi }}
@@ -231,8 +231,8 @@
placement="bottom-start"
>
- 误差范围: {{ -0.5 + "~" +0.5 }}
- 误差值:{{ scope.row.bI }}
+ 误差范围: {{ -0.5 + "%~" +0.5 + "%" }}
+ 误差值:{{ scope.row.bI + '%'}}
{{ scope.row.bIeXi }}
@@ -262,8 +262,8 @@
placement="bottom-start"
>
- 误差范围: {{ -0.5 + "~" +0.5 }}
- 误差值:{{ scope.row.cI }}
+ 误差范围: {{ -0.5 + "%~" +0.5 + "%" }}
+ 误差值:{{ scope.row.cI + '%'}}
{{ scope.row.cIeXi }}
@@ -276,8 +276,8 @@
placement="bottom-start"
>
- 误差范围: {{ -0.5 + "~" +0.5 }}
- 误差值:{{ scope.row.cI }}
+ 误差范围: {{ -0.5 + "%~" +0.5 + "%" }}
+ 误差值:{{ scope.row.cI + '%'}}
{{ scope.row.cIeXi }}
diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue
index c7a2e75..b96f4a3 100644
--- a/frontend/src/views/home/components/table.vue
+++ b/frontend/src/views/home/components/table.vue
@@ -756,6 +756,7 @@ function tableHeaderInit(val: number) {
break;
}
//console.log("test",columns);
+handleRefresh()
}
function refreshStatusList(){
@@ -968,7 +969,7 @@ const handleTest = async (val:string) => {
const data = reactive({
socketServe: socketClient.Instance,
});
- const url = 'ws://localhost:7777/hello?name=cdf';
+ const url = 'ws://192.168.1.127:7777/hello?name=cdf';
socketClient.Instance.connect(url);
data.socketServe = socketClient.Instance;
data.socketServe.registerCallBack('aaa', (res: { code: number; }) => {
@@ -1092,9 +1093,9 @@ function formatDate(date : Date) {
watch(
() => props.id,
(newId) => {
-
+ handleRefresh()
// 调用获取数据的方法
- handleSearch();
+ //handleSearch();
},
{ immediate: true } // 立即执行一次
);
diff --git a/frontend/src/views/machine/device/components/devicePopup.vue b/frontend/src/views/machine/device/components/devicePopup.vue
index 035f602..de610d6 100644
--- a/frontend/src/views/machine/device/components/devicePopup.vue
+++ b/frontend/src/views/machine/device/components/devicePopup.vue
@@ -5,8 +5,8 @@
设备信息
-
-
+
+
@@ -274,7 +274,7 @@ const baseRules: Record> = {
{ required: true, message: '额定电流必填!', trigger: 'blur' },
{ pattern: /^\d+(\.\d+)?$/, message: '额定电流格式错误', trigger: 'blur' }
],
- createId: [{ required: true, message: '设备序列号必填!', trigger: 'blur' }],
+ createId: [{ required: true, message: '装置编号必填!', trigger: 'blur' }],
ip: [
{ required: true, message: 'IP地址必填!', trigger: 'blur' },
{ pattern: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, message: 'IP地址格式错误', trigger: 'blur' }
diff --git a/frontend/src/views/machine/device/index.vue b/frontend/src/views/machine/device/index.vue
index 917e0bc..ea95e6cf 100644
--- a/frontend/src/views/machine/device/index.vue
+++ b/frontend/src/views/machine/device/index.vue
@@ -10,7 +10,8 @@
新增
导出
- 导入
+ 导入
+ 导入
删除
@@ -52,8 +53,6 @@ const appSceneStore = useAppSceneStore()
// ProTable 实例
const proTable = ref()
const devicePopup = ref()
-
-
const boundPqDevList=ref([])//根据检测计划id查询出所有已绑定的设备
// 存储设备类型选项
const devTypeOptions = ref([])
@@ -205,15 +204,28 @@ const downloadFile = async () => {
//导入设备
const deviceImportExcel = ref | null>(null)
-const importFile = async () => {
- const params = {
- title: '被检设备',
- showCover: false,
- tempApi: downloadTemplate,
- importApi: importPqDev,
- getTableList: proTable.value?.getTableList,
+const importFile = async (pattern:string) => {
+
+ if(pattern === '比对式'){
+ const params = {
+ title: '被检设备',
+ showCover: false,
+ tempApi: downloadTemplate,
+ importApi: importPqDev,
+ getTableList: proTable.value?.getTableList,
+ }
+ deviceImportExcel.value?.acceptParams(params)
+ }else{
+ const params = {
+ title: '被检设备',
+ showCover: false,
+ tempApi: downloadTemplate,
+
+ getTableList: proTable.value?.getTableList,
+ }
+ deviceImportExcel.value?.acceptParams(params)
}
- deviceImportExcel.value?.acceptParams(params)
+
}
onBeforeMount(async () => {