From 27de4ad24ebc4c44f3cbd24d4dab61eceb09cf83 Mon Sep 17 00:00:00 2001 From: fks-xuxinyue <2822784518@qq.com> Date: Mon, 29 Jul 2024 15:13:30 +0800 Subject: [PATCH] taskid:111 remark:"commit" --- .../src/router/carbonEmissionManage.ts | 20 ++ .../carbonAssets/carbonAssetsDetail/index.vue | 361 ++++++++++++++++++++- .../carbonEmissionManage/carbonAssets/index.vue | 20 +- .../carbonInventoryCheck/fillInPage/index.vue | 163 +--------- .../carbonEmissionManage/carbonPlanning/index.vue | 21 ++ 5 files changed, 426 insertions(+), 159 deletions(-) create mode 100644 hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue diff --git a/hx-ai-intelligent/src/router/carbonEmissionManage.ts b/hx-ai-intelligent/src/router/carbonEmissionManage.ts index 46bf216..9adcfc0 100644 --- a/hx-ai-intelligent/src/router/carbonEmissionManage.ts +++ b/hx-ai-intelligent/src/router/carbonEmissionManage.ts @@ -85,6 +85,26 @@ const equipment = { }, ], }, + { + path: 'carbonPlanning', + name: 'CarbonPlanning', + meta: { title: '碳规划', hideChildren: true, icon: 'tanpaiguanli' }, + component: Base, + redirect: { name: 'CarbonPlanningIndex' }, + children: [ + { + path: 'index', + name: 'CarbonPlanningIndex', + // component: () => import('/nerv-lib/saas/view/menuManage/index.vue'), + component: () => import('/@/view/carbonEmissionManage/carbonPlanning/index.vue'), + meta: { + title: '碳规划', + keepAlive: false, + // backApi: [], + }, + }, + ], + }, ], }; export default equipment; 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 aa5ea2e..d682c68 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue @@ -1,12 +1,147 @@ diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue index df55258..be634e7 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue @@ -8,7 +8,11 @@
全国碳账户估值(CNY)
300,000.00
@@ -163,7 +167,7 @@
- +
@@ -174,6 +178,14 @@ energyType: 'carbonAssets', // 与页面路由name一致缓存才可生效 }); const homePage = ref(true); + // 点击跳转详情 + const viewDetail = () => { + homePage.value = false; + }; + // 填报页点击返回 + const updateData = (type) => { + homePage.value = type; + }; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue index f7ba68f..8e888df 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue @@ -1010,9 +1010,6 @@ isClickedPftj.value = false; isClickedTplx.value = true; getCarbonFlowDirection(); - setTimeout(() => { - drawEcharts(); - }, 500); }; // 获取碳排流向数据 const queryFlowDirection = ref({ @@ -1021,9 +1018,14 @@ year: props.year, categoryId: categoryId.value, }); + const linksData = ref([]) + const datalist = ref([]) const getCarbonFlowDirection = () => { fetch(carbonInventoryCheck.carbonFlowDirection, queryFlowDirection.value).then((res) => { console.log(res); + linksData.value = res.data[0] + datalist.value = res.data[1] + drawEcharts(); }); }; // 获取排放统计数据 @@ -1154,133 +1156,6 @@ let chartInstance: echarts.ECharts | null = null; const drawEcharts = () => { chartInstance = echarts.init(tplxChart.value); - let datalist = [ - { - name: '公共平台', - }, - { - name: '系统0000', - }, - { - name: '系统0011', - }, - { - name: '系统0022', - }, - { - name: '系统0033', - }, - { - name: '系统0044', - }, - { - name: '系统0055', - }, - { - name: '系统11', - }, - { - name: '系统22', - }, - { - name: '系统33', - }, - { - name: '系统44', - }, - { - name: '系统55', - }, - { - name: '系统66', - }, - { - name: '系统77', - }, - { - name: '系统88', - }, - { - name: '系统99', - }, - ]; - let linksData = [ - { - source: '公共平台', - target: '系统0000', - value: 1044305, - }, - { - source: '公共平台', - target: '系统0011', - value: 651527, - }, - { - source: '公共平台', - target: '系统0022', - value: 651527, - }, - { - source: '公共平台', - target: '系统0033', - value: 486710, - }, - { - source: '公共平台', - target: '系统0044', - value: 212670, - }, - { - source: '公共平台', - target: '系统0055', - value: 210400, - }, - { - source: '系统0011', - target: '系统11', - value: 645246, - }, - { - source: '系统0022', - target: '系统22', - value: 513275, - }, - { - source: '系统0011', - target: '系统33', - value: 282986, - }, - { - source: '系统0011', - target: '系统44', - value: 118655, - }, - { - source: '系统0022', - target: '系统55', - value: 105989, - }, - { - source: '系统0022', - target: '系统66', - value: 95100, - }, - { - source: '系统0033', - target: '系统77', - value: 87796, - }, - { - source: '系统0044', - target: '系统88', - value: 47658, - }, - { - source: '系统0055', - target: '系统99', - value: 243660, - }, - ]; let Color = [ '#61FEFF', '#937FE6', @@ -1337,18 +1212,17 @@ ]; let itemStyleColor = []; let labelSource = []; - for (let i = 0; i < datalist.length; i++) { - datalist[i].label = { + for (let i = 0; i < datalist.value.length; i++) { + datalist.value[i].label = { normal: { position: sourceLabel[i], }, }; labelSource.push(sourceLabel[i]); } - for (let d = 0; d < datalist.length; d++) { - datalist[d].itemStyle = { + for (let d = 0; d < datalist.value.length; d++) { + datalist.value[d].itemStyle = { normal: { - // color: Color[d] color: { type: 'linear', x: 0, @@ -1369,28 +1243,13 @@ }, }, }; - itemStyleColor.push(datalist[d]); + itemStyleColor.push(datalist.value[d]); } const option = { backgroundColor: 'transparent', tooltip: { trigger: 'item', triggerOn: 'mousemove', - formatter: function (params) { - if (params.name == '公共平台') { - return ' 公共平台 '; - } else { - let value = params.data.value; - if (!value && value !== 0) return 0; - let str = value.toString(); - let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g; - if (params.data.source == '公共平台') { - return params.data.target + ' : ' + str.replace(reg, '$1,'); - } else { - return params.data.source + ' : ' + str.replace(reg, '$1,'); - } - } - }, }, series: [ { @@ -1404,7 +1263,7 @@ nodeWidth: 25, focusNodeAdjacency: 'allEdges', data: itemStyleColor, - links: linksData, + links: linksData.value, label: { normal: { color: '#fff', diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue new file mode 100644 index 0000000..fb91423 --- /dev/null +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue @@ -0,0 +1,21 @@ + +