From 9124d4b745900ca4902baaf858f462a7bb830c24 Mon Sep 17 00:00:00 2001 From: fengrong Date: Tue, 29 Oct 2024 16:48:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/backend/realData/index.vue | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/ui/dasadmin/src/views/backend/realData/index.vue b/ui/dasadmin/src/views/backend/realData/index.vue index a6692899..826c189c 100644 --- a/ui/dasadmin/src/views/backend/realData/index.vue +++ b/ui/dasadmin/src/views/backend/realData/index.vue @@ -123,7 +123,8 @@ const tableItem0: any = [ prop: 'code', align: 'center', custom: 'default', - name:'' + name:'', + title: '风机列表' }] const tableItem1: any = [ { @@ -331,17 +332,24 @@ const selectList=ref([]) const getSel = () => { debugger selectList.value=[] - tableColumn.value.forEach(item => { - if (item.prop) { - if(item.prop!='code'){ - selectList.value.push({ - attributeName: item.title, - attributeCode: item.name, - }); - } + try { + if (tableColumn.value && Array.isArray(tableColumn.value)) { + for (const item of tableColumn.value) { + if (item && item.prop && item.prop !== 'code') { + if(item.title!==undefined){ + selectList.value.push({ + attributeName: item.title || '', + attributeCode: item.name || '', + unit: item.unit || '', + }); + } + } + } } - }); + } catch (error) { + console.error('Error in tableColumn processing:', error); + } //tableRef.value.clearSelection() if (selectList.value.length > 0) { //setTimeout(()=>{ @@ -601,14 +609,11 @@ const downFun=(tableColumn,tableData)=>{ onUnmounted(() => { autoUpdateInterval.value && clearInterval(autoUpdateInterval.value) autoUpdateInterval.value = null - //selectList.value=[] }) onMounted(() => { deviceQuery(devicelistData) - //queryListData.pageSize=200 modelAttributeList(queryListData) - //tableRef.value.toggleRowSelection(modalTbleData.value[0], true); })