From 7b1f25689eb0f65b31a178cabe371cce9bdd40d7 Mon Sep 17 00:00:00 2001 From: fks-yangshouda Date: Thu, 22 Aug 2024 15:23:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=20=E5=89=8D=E5=8F=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/equipmentManage/group/config.ts | 66 ++++++++++++------- .../view/equipmentManage/group/editCal.vue | 4 +- .../group/editCarbonEquipment.vue | 3 + .../src/view/equipmentManage/group/index.vue | 20 +++--- .../energyMonitor/graphGraph/index.vue | 2 +- .../src/view/monitor/energyMonitor/page.vue | 6 +- .../view/monitor/energyMonitor/tree/index.vue | 22 +++---- .../aggregateData/index.vue | 20 ++++++ .../environmentMonitor/averageData/config.ts | 4 ++ .../environmentMonitor/averageData/index.vue | 11 +++- .../environmentMonitor/historyData/index.vue | 16 ++++- .../view/monitor/environmentMonitor/index.vue | 28 +------- 12 files changed, 122 insertions(+), 80 deletions(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index 40615fa..aedce11 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -149,7 +149,7 @@ export const formSchema = [ component: 'NsInput', componentProps: { placeholder: '请输入', - maxLength: 32, + maxLength: 20, }, rules: [ { @@ -410,25 +410,26 @@ export const tableConfigCal = ( } }, }, - isCarbon - ? { - label: '关联因子值', - name: 'SetFactor', - type: 'primary', - dynamicDisabled: (data: any) => { - return data.list.length === 0; - }, - handle: ({ list }) => { - // 过滤出 id 大于 0 的项 - const filteredList = list.filter(({ id }) => id > 0); + { + label: '关联因子值', + name: 'SetFactor', + type: 'primary', + dynamicDisabled: (data: any) => { + return data.list.length === 0; + }, + ifShow: (data: any) => { + return isCarbon; + }, + handle: ({ list }) => { + // 过滤出 id 大于 0 的项 + const filteredList = list.filter(({ id }) => id > 0); - // 提取出 id 值 - const ids = filteredList.map(({ id }) => id); + // 提取出 id 值 + const ids = filteredList.map(({ id }) => id); - setFactorRef.value.toggle(ids); - }, - } - : {}, + setFactorRef.value.toggle(ids); + }, + }, { label: '批量删除', name: 'GroupPointDelete', @@ -518,10 +519,29 @@ export const tableConfigCal = ( actions: [ { label: '关联因子', + // label: (record) => { + // // 根据record的某个字段值判断显示'关联因子'或'修改因子' + // return record.emissionFactor ? '修改因子' : '关联因子'; + // }, name: 'SetFactor', - dynamicDisabled: (record) => { + ifShow: (record) => { // 这里根据record的某个字段值判断是否禁用删除按钮 - return record.id < 0; + return isCarbon && record.id >= 0 && !record.emissionFactor; + }, + handle: (row) => { + setFactorRef.value.toggle([row.id]); + }, + }, + { + label: '修改关联', + // label: (record) => { + // // 根据record的某个字段值判断显示'关联因子'或'修改因子' + // return record.emissionFactor ? '修改因子' : '关联因子'; + // }, + name: 'SetFactor', + ifShow: (record) => { + // 这里根据record的某个字段值判断是否禁用删除按钮 + return isCarbon && record.id >= 0 && record.emissionFactor; }, handle: (row) => { setFactorRef.value.toggle([row.id]); @@ -530,9 +550,9 @@ export const tableConfigCal = ( { label: '删除', name: 'GroupPointDelete', - dynamicDisabled: (record) => { + ifShow: (record) => { // 这里根据record的某个字段值判断是否禁用删除按钮 - return record.id < 0; + return record.id >= 0; }, dynamicParams: isCarbon ? { @@ -797,7 +817,7 @@ export const editCarbonEquipmentConfig = (orgId) => { ], params: {}, }, - // pagination: { pageSizeOptions: false }, + pagination: true, rowKey: 'deviceInfoCode', }); }; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue index f60b997..2414239 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue @@ -9,7 +9,9 @@ :cancel="() => (visible = false)" placement="right">
- +
+ +
diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue index 2a00e91..bbb7769 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue @@ -22,7 +22,9 @@ ? 'fenzujiedian' : 'jisuanjiedian' " /> - {{ data.pointName }} + + {{ truncatedName(data.pointName) }} +
@@ -52,15 +54,7 @@ v-show="!defaultType && isCarbon" class="table" v-bind="configCarbon" - ref="tableCalRef"> - - + ref="tableCalRef" />