From a386380fdac4feebddc246f417620c2aeab3a3e4 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Mon, 30 Dec 2024 16:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(table):=20=E5=A4=B4=E9=83=A8?= =?UTF-8?q?breadcumb=E6=A0=B7=E5=BC=8F=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8A=A8=E7=94=BB=E5=88=87=E6=8D=A2=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E5=8D=97=E5=8C=97=E5=90=91=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/navBars/topBar/breadcrumb.vue | 28 +++++++-------- src/layout/routerView/parent.vue | 4 ++- src/router/route.js | 2 +- src/views/gateway/northboundtask.vue | 38 +++++++++++++++------ src/views/gateway/southdirection.vue | 43 +++++++++++++++--------- vite.config.js | 2 +- 6 files changed, 74 insertions(+), 43 deletions(-) diff --git a/src/layout/navBars/topBar/breadcrumb.vue b/src/layout/navBars/topBar/breadcrumb.vue index 80cc226..62c49c8 100644 --- a/src/layout/navBars/topBar/breadcrumb.vue +++ b/src/layout/navBars/topBar/breadcrumb.vue @@ -6,20 +6,20 @@ :size="16" @click="onThemeConfigChange" /> - - - - - -
{{ v.meta.title }}
-
{{ v.meta.tagsViewName }}
-
- - {{ v.meta.title }} - -
-
-
+ + + + + + + + + + + + + + diff --git a/src/layout/routerView/parent.vue b/src/layout/routerView/parent.vue index 97c8fa0..a1e45a9 100644 --- a/src/layout/routerView/parent.vue +++ b/src/layout/routerView/parent.vue @@ -3,7 +3,9 @@ - +
+ +
diff --git a/src/router/route.js b/src/router/route.js index 3672612..41fdfc7 100644 --- a/src/router/route.js +++ b/src/router/route.js @@ -25,7 +25,7 @@ export const dynamicRoutes = [ component: () => import('/@/layout/index.vue'), redirect: '/southdirection', meta: { - isKeepAlive: true, + // isKeepAlive: true, }, children: [ // { diff --git a/src/views/gateway/northboundtask.vue b/src/views/gateway/northboundtask.vue index 00ca80c..dfb5beb 100644 --- a/src/views/gateway/northboundtask.vue +++ b/src/views/gateway/northboundtask.vue @@ -113,10 +113,10 @@
-

上报测点 {{ activeDeviceConfig.taskId }}

+

上报测点 {{ activeTask.taskId}}

- +

加密算法配置

@@ -391,15 +391,17 @@ const getDeviceConfig = () => { }) || []; // taskList.value = taskDataList; console.log('格式化后数据', taskList.value); + // debugger if (!platConfigList.value.length) { addDeviceConfig(); } - if (platConfigList.value.length) { - if (platConfigList.value.length > ActiveRowIndex.value) { - activeDeviceConfig.value = platConfigList.value[ActiveRowIndex.value]; + if (taskList.value.length) { + if (taskList.value.length > ActiveRowIndex.value) { + activeTask.value = taskList.value[ActiveRowIndex.value]; } else { - activeDeviceConfig.value = platConfigList.value[0]; + activeTask.value = taskList.value[0]; } + platConfigTableRef.value.toggleRowSelection(activeTask.value, true); } } else { ElMessage.error(response.message); @@ -481,6 +483,13 @@ const editCollection = () => { collectionModelShow.value = false; }; +const activeTask = ref({ + taskId: '', + dataIdEntire: [], + taskType: '', + uploadMode: 'timer 1 || change 0.1' +}); + const activeDeviceConfig = ref({ PlatformIp: '', tasks: ['T1', 'T2', 'T3', 'T4', 'T5'], @@ -530,15 +539,23 @@ const activeDeviceConfig = ref({ }, }); + watch( () => ({ ...activeDeviceConfig.value }), (newVal) => { - console.log('数据变化', newVal); platConfigList.value[ActiveRowIndex.value] = newVal; }, { deep: true } ); +watch( + () => ({ ...activeTask.value }), + (newVal) => { + taskList.value[ActiveRowIndex.value] = newVal; + }, + { deep: true } +); + // const saveDeviceDataConfig = () => { // platConfigList.value[ActiveRowIndex.value] = activeDeviceConfig.value; // } @@ -552,10 +569,11 @@ const tableRowClassName = ({ row, rowIndex }) => { //选择设备配置 const taskConfigClick = (e) => { console.log(`current page:`, e); - activeDeviceConfig.value = e; + // activeDeviceConfig.value = e; + activeTask.value = e; platConfigTableRef.value.toggleRowSelection(e); - ActiveRowIndex.value = platConfigList.value.indexOf(e); + ActiveRowIndex.value = taskList.value.indexOf(e); // e.isDoubleClicked = !e.isDoubleClicked; }; diff --git a/src/views/gateway/southdirection.vue b/src/views/gateway/southdirection.vue index 2113172..c5d7e4a 100644 --- a/src/views/gateway/southdirection.vue +++ b/src/views/gateway/southdirection.vue @@ -26,7 +26,7 @@ height="187" :style="{ width: tabelBox + 'px', background: '#f2f2f2' }" empty-text="配置为空" - row-key="index" + row-key="id" @row-click="deviceConfigClick" > @@ -85,33 +85,34 @@ size="small" height="100%" :style="{ width: tabelBox + 'px' }" + row-key="index" empty-text="配置为空" > - + - + - + - + - + - + - + @@ -163,22 +164,22 @@ - + - + - + - + - + - +