From 117db1c400df7519aba5d138cc69d68d8627f3fe Mon Sep 17 00:00:00 2001 From: fks-xuxinyue <2822784518@qq.com> Date: Tue, 3 Sep 2024 17:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E7=A2=B3=E6=8E=92=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/carbonEmissionFactorLibrary.ts | 1 + .../carbonAssets/carbonAssetsDetail/index.vue | 28 +++++-- .../carbonEmissionFactorLibrary/index.vue | 88 ++++++++++++++++++---- .../carbonEmissions/index.vue | 50 ++++++++++-- .../carbonEmissionStatistics/config.ts | 2 +- .../energyConsumption/index.vue | 31 +++++++- .../carbonEmissionStatistics/index.vue | 27 ++++--- .../quickCalculation/index.vue | 20 +++-- .../carbonInventoryCheck/config.ts | 5 +- .../carbonInventoryCheck/fillInPage/index.vue | 56 ++++++++++++-- .../carbonInventoryCheck/index.vue | 62 +++++++++------ .../carbonPlanning/all/index.vue | 15 +++- .../carbonPlanning/category/categoryDeatil.vue | 12 +++ .../carbonPlanning/category/index.vue | 30 +++++++- .../carbonEmissionManage/carbonPlanning/index.vue | 28 ++++++- 15 files changed, 370 insertions(+), 85 deletions(-) diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts index 291f0b3..c0f5ff8 100644 --- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts +++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts @@ -12,6 +12,7 @@ export enum carbonEmissionFactorLibrary { import = '/carbon-smart/api/carbon/emission/factor/import', export = '/carbon-smart/api/carbon/emission/factor/export', gasAndDatabase = '/carbon-smart/api/carbon/emission/factor/gasAndDatabase', + checkDel = '/carbon-smart/api/carbon/emission/factor/checkDel', // 单位管理 dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement', findOutermost = '/carbon-smart/client/dict/findOutermost', diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue index 95ef056..10801b2 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue @@ -1,6 +1,6 @@ @@ -424,7 +433,7 @@ const onExpand = (keys: string[]) => { expandedKeys.value = keys; - autoExpandParent.value = false; + // autoExpandParent.value = false; }; // watch(selectTreeDataValue, (value) => { // const expanded = dataList @@ -458,7 +467,7 @@ mainRef.value?.nsTableRef.reload(); }; // 点击新增树节点 - const addTreeNodeData = () => { + const addTreeNodeData = (data) => { operationTree.value = '新增'; treeNodeAdd.value = true; editTreeNode.value.type = 'create'; @@ -557,6 +566,7 @@ const editTreeNode = ref({}); const onSelectKeys = ref([]); const onSelect = (selectedKey: string[], info: any) => { + expandedKeys.value = selectedKey; if (selectedKey.length === 1) { if (info.selectedNodes[0].emissionName === '全部') { onSelectKeys.value = []; @@ -771,6 +781,7 @@ { title: 'id', width: 50, + align: 'center', customRender: (text: any) => { return text.index + 1; }, @@ -778,57 +789,68 @@ { title: '排放源', width: 100, + align: 'center', dataIndex: 'emissionSources', }, { title: '排放类型', width: 100, + align: 'center', dataIndex: 'emissionTypeColumn', }, { title: '排放气体', width: 100, + align: 'center', dataIndex: 'emissionGas', }, { title: '排放环节', width: 100, + align: 'center', dataIndex: 'emissionProcess', }, { title: '排放因子', width: 100, + align: 'center', dataIndex: 'emissionFactors', }, { title: '排放因子单位', width: 100, + align: 'center', dataIndex: 'emissionFactorUnits', }, { title: '数据来源', width: 100, + align: 'center', dataIndex: 'dataSources', }, { title: '数据库', width: 100, + align: 'center', dataIndex: 'carbonDatabase', }, { title: '参考文献', width: 100, + align: 'center', dataIndex: 'bibliography', ellipsis: true, }, { title: '引用数量', width: 100, + align: 'center', dataIndex: 'numberOfReferences', }, ], columnActions: { title: '操作', + align: 'center', actions: [ { label: '编辑', @@ -875,10 +897,42 @@ { label: '删除', name: 'userDelete', - dynamicParams: { ids: 'id[]' }, - confirm: true, - isReload: true, - api: carbonEmissionFactorLibrary.del, + // dynamicParams: { ids: 'id[]' }, + // confirm: true, + // isReload: true, + // api: carbonEmissionFactorLibrary.del, + handle: (record: any) => { + fetch(carbonEmissionFactorLibrary.checkDel, { ids: [record.id] }).then((res) => { + if (res.data === '确定要删除吗?') { + Modal.confirm({ + title: res.data, + icon: createVNode(ExclamationCircleOutlined), + onOk() { + fetch(carbonEmissionFactorLibrary.del, { ids: [record.id] }).then((res) => { + mainRef.value?.nsTableRef.reload(); + NsMessage.success('操作成功'); + }); + }, + onCancel() { + console.log('Cancel'); + }, + class: 'test', + }); + } else { + Modal.confirm({ + title: res.data, + icon: createVNode(ExclamationCircleOutlined), + onOk() { + console.log('OK'); + }, + onCancel() { + console.log('Cancel'); + }, + class: 'test', + }); + } + }); + }, }, ], }, @@ -1147,7 +1201,7 @@ display: flex; } .left { - width: 300px; + width: 255px; // max-height: calc(100vh - 96px); margin-right: @ns-gap; min-width: fit-content; @@ -1198,7 +1252,8 @@ margin-bottom: unset; padding-bottom: unset; border-bottom: unset; - width: 70%; + margin-bottom: 16px; + width: 255px; height: 5vh; display: flex; align-items: center; @@ -1238,18 +1293,19 @@ justify-content: space-evenly; } .treePart { - width: 70%; - height: calc(100% - 5vh); + width: 255px; + height: 700px; display: flex; border: 1px solid #bfbfbf; margin-left: 10%; flex-direction: column; border-radius: 12px; overflow: auto; + padding: 16px; align-items: center; :deep(.ant-tree) { height: 90%; - width: 90%; + width: 100%; overflow: auto; } } diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue index e07a9ec..d27738c 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue @@ -1,11 +1,12 @@ + @@ -382,11 +384,21 @@ ballChartInstance = echarts.init(ballChartRef.value); let ballData = (Number(ballValue.value) / 100).toFixed(2); const option = { + title: { + text: selectedTime.value + ? '历年' + props.energyTypeName + '分析' + : '每月' + props.energyTypeName + '分析', + x: '0', + textStyle: { + color: 'rgba(51, 51, 51, 1)', + fontSize: '16', + }, + }, series: [ { type: 'liquidFill', - radius: '78.1%', - center: ['50%', '50%'], + radius: '70%', + center: ['55%', '55%'], color: !selectedTime.value ? ['#ecf3fe', '#c8dcfe', '#5594fa'] : ['rgba(12, 168, 126, 0.5)', 'rgba(12, 168, 126, 0.1)', 'rgba(12, 168, 126, 1)'], @@ -402,7 +414,7 @@ textStyle: { color: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)', insideColor: '#12786f', - fontSize: Number(ballData) > 1000 ? 20 : 40, + fontSize: Number(ballData) > 100 ? 20 : 40, }, formatter: (params) => { // return `${(params.value * 100).toFixed(2)}%`; @@ -549,6 +561,7 @@ const columns = ref([ { title: '序号', + align: 'center', customRender: (text: any) => { return text.index + 1; }, @@ -556,37 +569,45 @@ { title: '分项名称', dataIndex: 'itemizeName', + align: 'center', }, { title: '年份', + align: 'center', dataIndex: 'year', }, { title: '实际用量', dataIndex: 'actualUsage', + align: 'center', customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位 }, { title: '预算量', dataIndex: 'budget', + align: 'center', customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位 }, { title: '基准值', dataIndex: 'referenceValue', + align: 'center', customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位 }, { title: '节能量', dataIndex: 'energyConservation', + align: 'center', customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位 }, { title: '预算达成率', + align: 'center', dataIndex: 'budgetAchievement', }, { title: '操作', + align: 'center', key: 'action', }, ]); @@ -693,13 +714,14 @@ background: #ffffff; box-shadow: 0px 2px 20px rgb(69 123 234 / 20%); border-radius: 8px; + padding: 16px; } .pillarChart { width: calc(80% - 12px); background: #ffffff; box-shadow: 0px 2px 20px rgb(69 123 234 / 20%); border-radius: 8px; - padding: 5px; + padding: 16px; } } .tablePart { diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue index f107a76..60cd659 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue @@ -103,7 +103,7 @@ }); } else if (key === '5') { tabId.value = 7; - energyType.value = 'CARBON_EMISSIONS'; + energyType.value = 'HEAT_SUPPLY'; energyTypeName.value = '供热量'; nextTick(() => { if (carbonEmissionsRef.value) { @@ -113,7 +113,7 @@ }); } else if (key === '6') { tabId.value = 8; - energyType.value = 'HEAT_SUPPLY'; + energyType.value = 'CARBON_EMISSIONS'; energyTypeName.value = '碳排量'; nextTick(() => { if (provideHotRef.value) { @@ -124,3 +124,27 @@ } }; + +