Browse Source

remark:'commit'

temp
fks-xuxinyue 3 months ago
parent
commit
55051da8a5
  1. 8
      hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
  2. 207
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue
  3. 92
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue
  4. 6
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue
  5. 17
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  6. 26
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/index.vue
  7. 6
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  8. 20
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  9. 19
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  10. 6
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
  11. 87
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
  12. 358
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue
  13. 5
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue

8
hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts

@ -60,9 +60,13 @@ export enum carbonInventoryCheck {
// 碳排流向
carbonFlowDirection = '/carbon-smart/api/carbon/inventory/carbonFlowDirection',
}
// 碳资产-详情
export enum carbonAssetsDetail {
// 碳资产
export enum carbonAssets {
// 全部
carbonAssets = '/carbon-smart/api/carbon/trade/details/carbonAssets',
// 详情
carbonDetailsList = '/carbon-smart/api/carbon/trade/details/carbonDetailsList',
createOrUpdate = '/carbon-smart/api/carbon/trade/details/createOrUpdate',
delete = '/carbon-smart/api/carbon/trade/details/delete',
quotaStatistics = '/carbon-smart/api/carbon/trade/details/quotaStatistics',
}

207
hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue

@ -9,33 +9,39 @@
</div>
<a-form layout="inline">
<a-form-item>
<a-input
style="width: 200px"
<a-select
v-model:value="queryParams.accountType"
placeholder="请输入账户类型" />
style="width: 200px"
placeholder="请输入账户类型">
<a-select-option :value="1">全国账户</a-select-option>
<a-select-option :value="2">地方账户</a-select-option>
<a-select-option :value="3">CCER</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<a-select
ref="select"
<a-cascader
v-model:value="queryParams.transactionType"
multiple
style="width: 200px"
:options="options"
placeholder="请选择交易类型"
@focus="focus"
@change="handleChange">
<a-select-option value="jack">Jack</a-select-option>
<a-select-option value="lucy">Lucy</a-select-option>
</a-select>
suffix-icon="Shopping Around">
<template #tagRender="data">
<a-tag :key="data.value" color="blue">{{ data.label }}</a-tag>
</template>
</a-cascader>
</a-form-item>
<a-form-item>
<a-date-picker
style="width: 200px"
v-model:value="queryParams.transactionDate"
v-model:value="queryParams.year"
placeholder="请选择账期"
picker="year" />
picker="year"
valueFormat="YYYY" />
</a-form-item>
<a-form-item>
<a-button type="primary">查询</a-button>
<a-button html-type="submit" style="margin-left: 6px">重置</a-button>
<a-button type="primary" @click="searchTableList">查询</a-button>
<a-button html-type="submit" style="margin-left: 6px" @click="reset">重置</a-button>
</a-form-item>
</a-form>
</a-card>
@ -110,7 +116,11 @@
:label-col="labelCol"
:wrapper-col="wrapperCol">
<a-form-item ref="name" label="账户类型" name="accountType">
<a-input v-model:value="formState.accountType" placeholder="请输入账户类型" />
<a-select v-model:value="formState.accountType" placeholder="请输入账户类型">
<a-select-option value="1">全国账户</a-select-option>
<a-select-option value="2">地方账户</a-select-option>
<a-select-option value="3">CCER</a-select-option>
</a-select>
</a-form-item>
<a-form-item ref="name" label="交易类型" name="transactionType">
<a-cascader
@ -130,17 +140,19 @@
<a-form-item ref="name" label="交易对象" name="tradingPartner">
<a-input v-model:value="formState.tradingPartner" placeholder="请输入交易对象" />
</a-form-item>
<a-upload
v-model:file-list="fileList"
name="file"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:headers="headers"
@change="handleChange">
<a-button>
<upload-outlined></upload-outlined>
点击上传凭证
</a-button>
</a-upload>
<a-form-item ref="name" label="交易凭证" name="tradingPartner">
<a-upload
v-model:file-list="fileList"
name="file"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:headers="headers"
@change="handleChange">
<a-button>
<upload-outlined></upload-outlined>
上传
</a-button>
</a-upload>
</a-form-item>
</a-form>
<template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
@ -155,13 +167,19 @@
import { UploadOutlined } from '@ant-design/icons-vue';
import type { UploadChangeParam } from 'ant-design-vue';
import { Pagination, Modal, message } from 'ant-design-vue';
import { carbonAssetsDetail } from '/@/api/carbonEmissionFactorLibrary';
import { carbonAssets, carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
defineOptions({
energyType: 'carbonAssetsDetail', // name
energyType: 'carbonAssets', // name
components: {
'a-pagination': Pagination,
},
});
// id
const props = defineProps({
parentId: {
type: Number,
},
});
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
@ -174,14 +192,20 @@
selectedRowKeys.value = selectedKeys;
};
const total = ref<number>();
const thisYear = ref(new Date().getFullYear().toString());
const queryParams = ref({
pageNum: 1,
pageSize: 10,
orgId: orgId.value,
accountType: props.parentId,
year: thisYear.value,
});
const searchTableList = () => {
getDetailList();
};
//
const getDetailList = () => {
fetch(carbonAssetsDetail.carbonDetailsList, queryParams.value).then((res) => {
fetch(carbonAssets.carbonDetailsList, queryParams.value).then((res) => {
data.value = res.data.records;
});
};
@ -239,11 +263,39 @@
},
];
const data = ref([]);
const reset = () => {
queryParams.value = {
pageNum: 1,
pageSize: 10,
orgId: orgId.value,
year: new Date().getFullYear(),
};
getDetailList();
};
const editData = (record) => {
getDictList();
visible.value = true;
formState.value.id = record.id;
formState.value = record;
setTimeout(() => {
let selectDevice = ref([Number(record.transactionType)]);
findParentIds(options.value, record.transactionType, selectDevice.value);
record.transactionType = selectDevice;
formState.value.transactionType = record.transactionType;
formState.value = record;
}, 500);
};
// id
function findParentIds(tree: any, targetId: number, result: any) {
for (let item of tree) {
if (item.children && item.children.length > 0) {
if (item.children.some((child: any) => child.value === targetId)) {
result.unshift(item.value); // id
findParentIds(tree, item.value, result); // id
break; // 退
}
}
}
}
const delData = (record) => {
Modal.confirm({
title: '警告',
@ -252,7 +304,7 @@
okType: 'primary',
cancelText: '取消',
onOk() {
fetch(carbonAssetsDetail.delete, { id: record.id }).then((res) => {
fetch(carbonAssets.delete, { id: record.id }).then((res) => {
message.success('操作成功!');
getDetailList();
});
@ -270,55 +322,48 @@
};
//
const visible = ref(false);
const formState = ref({});
const formState = ref({
orgId: orgId.value,
});
const formRef = ref();
const labelCol = { span: 5 };
const wrapperCol = { span: 19 };
const options: CascaderProps['options'] = [
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake',
},
],
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
},
],
},
],
},
];
const options = ref([]);
//
const getDictList = () => {
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'TRANSACTION_TYPE' }).then(
(res) => {
options.value = res.data;
options.value = options.value.map((item) => ({
value: item.id,
label: item.cnValue,
children: item.children
? item.children.map((child) => ({
value: child.id,
label: child.cnValue,
}))
: [],
}));
},
);
};
getDictList();
//
const addDetail = () => {
visible.value = true;
getDictList();
};
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
console.log('values', formState, toRaw(formState));
fetch(carbonAssetsDetail.createOrUpdate, formState.value).then((res) => {
if (formState.value.transactionType) {
formState.value.transactionType = formState.value.transactionType.join(',').split(',')[1];
}
fetch(carbonAssets.createOrUpdate, formState.value).then((res) => {
message.success('操作成功!');
visible.value = false;
getDetailList();
});
})
@ -342,36 +387,28 @@
formRef.value.resetFields();
};
//
const getTotalTable = () => {
fetch(carbonAssets.quotaStatistics, queryParams.value).then((res) => {
totalData.value = res.data;
});
};
getTotalTable();
const totalColumns = [
{
title: '统计类型',
dataIndex: 'name',
dataIndex: 'statisticType',
},
{
title: '小计',
dataIndex: 'name',
dataIndex: 'subtotal',
},
{
title: '合计',
dataIndex: 'name',
dataIndex: 'amountTo',
},
];
const totalData = [
{
key: '1',
total: '0',
name: 'John',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park',
},
];
const totalData = ref([]);
//
const emit = defineEmits(['change-data']);
const changeParentData = () => {

92
hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue

@ -1,15 +1,15 @@
<template>
<div class="mainContant" v-if="homePage">
<a-card class="card" style="margin-right: 1%; margin-bottom: 1%">
<a-card class="card" v-if="nationwide" style="margin-right: 1%; margin-bottom: 1%">
<div class="top" style="background: rgba(252, 139, 78, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-1.svg"
/></div>
<div class="moneyTitle">全国碳账户估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{nationwide.valuation}}</div>
<div class="moneyDetail"
><img
@click="viewDetail"
@click="viewDetail(1)"
width="34px"
height="34px"
src="../../../../src/icon/carbonAssetsSearch-1.svg"
@ -21,12 +21,12 @@
</div>
<div class="bottom">
<div class="calculation TLCard">
<div class="money">75,000.00</div>
<div class="money">{{nationwide.opening}}</div>
<div class="moneyType">期初余额tCO2</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="calculation TLCard">
<div class="money">20,000.00</div>
<div class="money">{{nationwide.income}}</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
增加tCO2
@ -34,7 +34,7 @@
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
<div class="calculation TLCard">
<div class="money">20,000.00</div>
<div class="money">{{nationwide.expenditure}}</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
减少tCO2
@ -42,20 +42,24 @@
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
<div class="calculation TLCard">
<div class="money">75,000.00</div>
<div class="money">{{nationwide.period}}</div>
<div class="moneyType">期末余额tCO2</div>
</div>
</div>
</a-card>
<a-card class="card" style="margin-bottom: 1%">
<a-card class="card" v-if="place" style="margin-bottom: 1%">
<div class="top" style="background: rgba(234, 71, 54, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-2.svg"
/></div>
<div class="moneyTitle">地方碳账户估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{place.valuation}}</div>
<div class="moneyDetail"
><img width="34px" height="34px" src="../../../../src/icon/carbonAssetsSearch-2.svg"
><img
width="34px"
height="34px"
@click="viewDetail(2)"
src="../../../../src/icon/carbonAssetsSearch-2.svg"
/></div>
</div>
<div class="title">
@ -64,12 +68,12 @@
</div>
<div class="bottom">
<div class="calculation TRCard">
<div class="money">75,000.00</div>
<div class="money">{{place.opening}}</div>
<div class="moneyType">期初余额tCO2</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="calculation TRCard">
<div class="money">20,000.00</div>
<div class="money">{{place.income}}</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
增加tCO2
@ -77,7 +81,7 @@
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
<div class="calculation TRCard">
<div class="money">20,000.00</div>
<div class="money">{{place.expenditure}}</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
减少tCO2
@ -85,20 +89,24 @@
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
<div class="calculation TRCard">
<div class="money">75,000.00</div>
<div class="money">{{place.period}}</div>
<div class="moneyType">期末余额tCO2</div>
</div>
</div>
</a-card>
<a-card class="card" style="margin-right: 1%">
<a-card class="card" v-if="ccer" style="margin-right: 1%">
<div class="top" style="background: rgba(65, 163, 224, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-3.svg"
/></div>
<div class="moneyTitle">CCER资产估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{ccer.valuation}}</div>
<div class="moneyDetail"
><img width="34px" height="34px" src="../../../../src/icon/carbonAssetsSearch-3.svg"
><img
width="34px"
height="34px"
@click="viewDetail(3)"
src="../../../../src/icon/carbonAssetsSearch-3.svg"
/></div>
</div>
<div class="title">
@ -107,12 +115,12 @@
</div>
<div class="bottom">
<div class="calculation BLCard">
<div class="money">75,000.00</div>
<div class="money">{{ccer.opening}}</div>
<div class="moneyType">期初余额tCO2</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="calculation BLCard">
<div class="money">20,000.00</div>
<div class="money">{{ccer.income}}</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
增加tCO2
@ -120,7 +128,7 @@
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
<div class="calculation BLCard">
<div class="money">20,000.00</div>
<div class="money">{{ccer.expenditure}}</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
减少tCO2
@ -128,18 +136,18 @@
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
<div class="calculation BLCard">
<div class="money">75,000.00</div>
<div class="money">{{ccer.period}}</div>
<div class="moneyType">期末余额tCO2</div>
</div>
</div>
</a-card>
<a-card class="card">
<a-card class="card" v-if="whole">
<div class="top" style="background: rgba(37, 192, 150, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-4.svg"
/></div>
<div class="moneyTitle">全国碳账户估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{whole.whole}}</div>
</div>
<div class="title" style="justify-content: center">
<img
@ -150,38 +158,66 @@
</div>
<div class="bottom">
<div class="BRCard">
<div class="money">300,000.00</div>
<div class="money">{{whole.nationwide}}</div>
<div class="moneyType">全国碳账户资产估值</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="BRCard">
<div class="money">300,000.00</div>
<div class="money">{{whole.place}}</div>
<div class="moneyType">地方碳账户资产估值</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="BRCard">
<div class="money">300,000.00</div>
<div class="money">{{whole.ccer}}</div>
<div class="moneyType">CCER碳资产估值</div>
</div>
</div>
</a-card>
</div>
<div class="detail" v-else>
<carbonAssetsDetail @change-data="updateData" />
<carbonAssetsDetail @change-data="updateData" :parentId="parentId" />
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import carbonAssetsDetail from './carbonAssetsDetail/index.vue';
import { http } from '/nerv-lib/util/http';
import { carbonAssets } from '/@/api/carbonEmissionFactorLibrary';
defineOptions({
energyType: 'carbonAssets', // name
});
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
const homePage = ref(true);
//
const viewDetail = () => {
const parentId = ref(1);
const viewDetail = (data) => {
homePage.value = false;
parentId.value = data;
};
const queryParams = ref({
orgId: orgId.value,
year: new Date().getFullYear(),
});
const nationwide = ref()
const place = ref()
const ccer = ref()
const whole = ref()
const getData = () => {
fetch(carbonAssets.carbonAssets, queryParams.value).then((res) => {
console.log(res);
nationwide.value = res.data.nationwide
place.value = res.data.place
ccer.value = res.data.ccer
whole.value = res.data.whole
});
};
getData();
//
const updateData = (type) => {
homePage.value = type;

6
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue

@ -25,7 +25,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { ref, defineExpose } from 'vue';
import { http } from '/nerv-lib/util/http';
import { Pagination } from 'ant-design-vue';
import dayjs, { Dayjs } from 'dayjs';
@ -172,7 +172,9 @@
total.value = res.data.length;
});
};
getTableList();
defineExpose({
getTableList,
});
//
const onChange = (pageNumber: number, size: number) => {
queryParams.value.pageNum = pageNumber;

17
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue

@ -165,7 +165,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref, toRaw } from 'vue';
import { ref, toRaw,defineExpose } from 'vue';
import type { Rule } from 'ant-design-vue/es/form';
import { Pagination,message,Modal } from 'ant-design-vue';
import type { TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
@ -382,6 +382,12 @@
res.data.unit = selectDevice
}
formState.value = res.data
emissionType.value = res.data.emissionType
if(formState.value.isComputeCarbon===0){
isRequired.value = true
}else{
isRequired.value = false
}
});
},
},
@ -413,6 +419,10 @@
},
rowKey: 'id',
});
defineExpose({
mainRef,
});
// id
function findParentIds(tree: any, targetId: number, result: any) {
for (let item of tree) {
@ -438,11 +448,16 @@
mainRef.value?.nsTableRef.reload();
};
//
const emissionType = ref()
const changeRadio = (e) => {
if(e.target.value === 0){
isRequired.value = true
if(emissionType.value){
formState.value.emissionType = emissionType.value
}
}else{
isRequired.value = false
formState.value.emissionType = ''
}
};
//

26
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/index.vue

@ -18,16 +18,32 @@
import quickCalculation from './quickCalculation/index.vue';
defineOptions({
name: 'CarbonEmissionStatisticsIndex', // name
components: {
energyConsumption,
carbonEmissions,
quickCalculation,
},
});
const activeKey = ref('1');
const energyConsumptionRef = ref<InstanceType<typeof energyConsumption> | null>(null);
const carbonEmissionsRef = ref<InstanceType<typeof carbonEmissions> | null>(null);
const quickCalculationRef = ref<InstanceType<typeof quickCalculation> | null>(null);
// tab
const handleTabChange = (key) => {
console.log('Tab changed:', key);
//
// if(key==='1'){
// if (energyConsumptionRef.value) {
// energyConsumptionRef.value.getTableList(); //
// }
// }
if (key === '1') {
if (energyConsumptionRef.value) {
energyConsumptionRef.value.mainRef.nsTableRef.reload();
}
} else if (key === '2') {
if (carbonEmissionsRef.value) {
carbonEmissionsRef.value.getTableList(); //
}
} else if (key === '3') {
if (quickCalculationRef.value) {
quickCalculationRef.value.getTreeData();
}
}
};
</script>

6
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue

@ -129,7 +129,7 @@
</template>
<script lang="ts" setup>
import { ref, watch, toRaw } from 'vue';
import { ref, watch, toRaw, defineExpose } from 'vue';
import type { TreeProps } from 'ant-design-vue';
import { Pagination, Modal } from 'ant-design-vue';
import { columns, drawerColumns } from '../config';
@ -350,6 +350,10 @@
},
rowKey: 'id',
});
defineExpose({
getTreeData,
});
//
const getTableList = () => {
fetch(quickCalculation.queryCarbonEmissionPage, queryParams.value).then((res) => {

20
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue

@ -60,7 +60,7 @@
<div class="ns-table-title ns-title-extra-box">排放源</div>
<a-button type="primary" style="margin-left: 12px" @click="changeParentData">返回</a-button>
</div>
<div style="display: flex" v-if="fillInPage">
<div style="display: flex; height: 100%" v-if="fillInPage">
<div class="mainLeft">
<a-tree
:expandedKeys="expandedKeysR"
@ -370,8 +370,13 @@
year: {
type: String,
},
startTime: {
type: String,
},
endTime: {
type: String,
},
});
console.log(props, 'xxy');
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -624,6 +629,8 @@
const formState = ref({
orgId: orgId.value,
year: props.year,
startTime: props.startTime,
endTime: props.endTime,
});
//
const measurementUnit = ref([]);
@ -1018,13 +1025,13 @@
year: props.year,
categoryId: categoryId.value,
});
const linksData = ref([])
const datalist = ref([])
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]
linksData.value = res.data[0];
datalist.value = res.data[1];
drawEcharts();
});
};
@ -1431,6 +1438,7 @@
margin-right: 1%;
border-right: 1px solid #f2f2f2;
position: relative;
height: 96%;
.treeRow {
display: flex;
justify-content: space-between;

19
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue

@ -5,7 +5,7 @@
</div>
<!-- 填报页 -->
<div v-if="fillInPage" style="height: 100%">
<fillIn :reportId="reportId" :year="year" @change-data="updateData" />
<fillIn :reportId="reportId" :year="year" :startTime="startTime" :endTime="endTime" @change-data="updateData" />
</div>
<!-- 新增报告弹窗 -->
<a-drawer
@ -31,7 +31,10 @@
<a-input v-model:value="formState.genericStandard" placeholder="请输入适用标准" />
</a-form-item>
<a-form-item label="报告周期" name="reportPeriod">
<a-select v-model:value="formState.reportPeriod" placeholder="请选择排放类型">
<a-select
v-model:value="formState.reportPeriod"
placeholder="请选择排放类型"
@change="selectChange">
<a-select-option value="1">年度</a-select-option>
<a-select-option value="2">月度</a-select-option>
</a-select>
@ -40,6 +43,7 @@
<a-range-picker
v-model:value="formState.reportScope"
picker="month"
:disabledDate="disabledDate"
valueFormat="YYYY-MM" />
</a-form-item>
</a-form>
@ -71,6 +75,13 @@
const formRef = ref();
const labelCol = { span: 5 };
const wrapperCol = { span: 19 };
const disabledDate = (current: moment.Moment | null) => {
if (formState.value.reportPeriod === '2') {
const year = current.year();
return year === Number(formState.value.reportYear) ? false : true;
}
};
const selectChange = (value) => {};
// form
const rules: Record<string, Rule[]> = {
reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }],
@ -107,6 +118,8 @@
const data = ref([]);
const mainRef = ref();
const reportId = ref();
const startTime = ref();
const endTime = ref();
const year = ref();
const tableConfig = ref({
title: '数据库',
@ -178,6 +191,8 @@
fillInPage.value = true;
reportId.value = record.id;
year.value = record.reportYear;
startTime.value = record.startTime;
endTime.value = record.endTime;
},
},
{

6
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue

@ -14,6 +14,10 @@
<div class="contant">
<div class="chartsPart">
<div class="electricityConsumption" ref="ydlChart"></div>
<div class="electricityConsumption" ref="ydlChart"></div>
<div class="electricityConsumption" ref="ydlChart"></div>
<div class="electricityConsumption" ref="ydlChart"></div>
<div class="electricityConsumption" ref="ydlChart"></div>
</div>
<div class="tablePart">
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> </a-table>
@ -269,6 +273,8 @@
.chartsPart {
width: 100%;
height: 35%;
display: flex;
justify-content: space-between;
.electricityConsumption {
width: 19%;
height: 100%;

87
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue

@ -0,0 +1,87 @@
<template>
<div class="detailContant">
<div class="ns-form-title">
<div class="title">
<span>统计数据</span>
</div>
<div class="operation">
<a-button type="primary" @click="changeParentData">返回</a-button>
</div>
</div>
<div class="contant">
<div class="chartsPart">
</div>
<div class="tablePart">
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { defineEmits } from 'vue';
//
const emit = defineEmits(['change-data']);
const changeParentData = () => {
emit('change-data', true);
};
</script>
<style lang="less" scoped>
.detailContant {
height: 100%;
padding: 12px;
}
.ns-form-title {
font-weight: bold;
user-select: text;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 5vh;
.title {
text-align: left;
height: 32px;
line-height: 32px;
font-weight: bold;
user-select: text;
position: relative;
padding-left: 9px;
width: 50%;
}
.title::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
height: 13px;
width: 3px;
border-radius: 1px;
background-color: #2778ff;
}
.operation {
display: flex;
margin-right: 10px;
font-weight: 400;
height: 70%;
cursor: pointer;
width: 4%;
}
}
.contant {
width: 100%;
height: calc(100% - 5vh);
.chartsPart {
width: 100%;
height: 40%;
display: flex;
justify-content: space-between;
}
.tablePart {
height: calc(60% - 20px);
margin-top: 20px;
}
}
</style>

358
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue

@ -0,0 +1,358 @@
<template>
<div class="totalContant" v-if="electricTotal">
<div class="ns-form-title">
<div class="title">
<span>统计数据</span>
<a-button style="margin-left: 5%" type="primary" @click="addNode">新增节点</a-button>
<a-date-picker v-if="selectedTime" style="margin-left: 5%" :value="value5" picker="year" />
<a-date-picker v-else style="margin-left: 5%" :value="value5" picker="month" />
</div>
<div class="operation">
<div class="month" :style="monthStyles" @click="changeToMonth"><span></span></div>
<div class="year" :style="yearStyles" @click="changeToYear"><span></span></div>
</div>
</div>
<div class="contant">
<div class="chartsPart">
<div class="ballChart"></div>
<div class="pillarChart" ref="pillarChartRef"></div>
</div>
<div class="tablePart">
<a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.key === 'action'">
<span>
<a @click="detailData(record)">详情</a>
</span>
</template>
</template>
</a-table>
</div>
</div>
</div>
<div class="totalContant" v-else>
<categoryDeatil @change-data="updateData"/>
</div>
<!-- 新增节点 -->
<a-drawer :visible="visible" :width="500" @close="onClose" :footer-style="{ textAlign: 'right' }">
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
<template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onSubmit">确定</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import type { Dayjs } from 'dayjs';
import * as echarts from 'echarts';
import categoryDeatil from './categoryDeatil.vue';
defineOptions({
energyType: 'all', // name
});
const value5 = ref<Dayjs>();
const electricTotal = ref(true);
// /
const monthStyles = ref('background: #f2f2f2');
const yearStyles = ref('background: #2778ff');
const selectedTime = ref(true);
const changeToMonth = () => {
monthStyles.value = 'background: #2778ff';
yearStyles.value = 'background: #f2f2f2';
columns.value[2].title = '月份';
columns.value[2].dataIndex = 'month';
selectedTime.value = false;
};
const changeToYear = () => {
monthStyles.value = 'background: #f2f2f2';
yearStyles.value = 'background: #2778ff';
columns.value[2].title = '年份';
columns.value[2].dataIndex = 'year';
selectedTime.value = true;
};
// echarts
const pillarChartRef = ref(null);
let chartInstance: echarts.ECharts | null = null;
const drawPillarChart = () => {
chartInstance = echarts.init(pillarChartRef.value);
const option = {
backgroundColor: 'transparent',
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
label: {
show: true,
},
},
},
grid: {
left: '4%',
top: '18%',
right: '5%',
bottom: '10%',
},
legend: {
data: ['昨日总人数', '今日实时人数', '昨日使用率'],
top: '0',
left: '0',
textStyle: {
color: '#666',
fontSize: 12,
},
},
xAxis: {
data: ['2020', '2021', '2022', '2023', '2024'],
axisLine: {
show: true, //X线
lineStyle: {
color: '#d9d9d9',
width: 1,
},
},
axisTick: {
show: true, //X
alignWithLabel: true,
},
axisLabel: {
show: true,
textStyle: {
color: '#d9d9d9', //X
fontSize: 12,
},
interval: 0,
},
},
yAxis: [
{
type: 'value',
splitLine: {
show: true,
lineStyle: {
width: 1,
color: '#d9d9d9',
},
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
show: true,
textStyle: {
color: '#d9d9d9',
fontSize: 12,
},
},
},
],
series: [
{
name: '昨日总人数',
type: 'bar',
barWidth: 18,
itemStyle: {
normal: {
color: '#6395f9',
},
},
data: [24, 45, 43, 35, 76],
},
{
name: '今日实时人数',
type: 'bar',
barWidth: 18,
itemStyle: {
normal: {
color: '#62daab',
},
},
data: [133, 23, 114, 67, 89],
},
{
name: '昨日使用率',
type: 'line',
smooth: true, // 线
symbol: 'none', //
lineStyle: {
color: '#f4664a',
width: 2,
},
data: [4.2, 3.5, 2.9, 7.8, 2],
},
],
};
chartInstance = echarts.init(pillarChartRef.value);
chartInstance.setOption(option);
};
setTimeout(() => {
drawPillarChart();
}, 500);
//
const visible = ref(false);
const addNode = () => {
visible.value = true;
};
const onClose = () => {
visible.value = false;
};
//
const columns = ref([
{
title: '序号',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '分项名称',
dataIndex: 'name',
},
{
title: '年份',
dataIndex: 'name',
},
{
title: '实际用量',
dataIndex: 'money',
},
{
title: '预算量',
dataIndex: 'address',
},
{
title: '基准值',
dataIndex: 'address',
},
{
title: '节能量',
dataIndex: 'address',
},
{
title: '预算达成率',
dataIndex: 'address',
},
{
title: '操作',
key: 'action',
},
]);
const data = [
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park',
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park',
},
];
const detailData = () => {
electricTotal.value = false;
};
//
const updateData = (type) => {
electricTotal.value = type;
};
</script>
<style lang="less" scoped>
.totalContant {
height: 100%;
padding: 12px;
}
:deep(.ant-tabs-content) {
padding: 16px;
}
.ns-form-title {
font-weight: bold;
user-select: text;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 5vh;
.title {
text-align: left;
height: 32px;
line-height: 32px;
font-weight: bold;
user-select: text;
position: relative;
padding-left: 9px;
width: 50%;
}
.title::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
height: 13px;
width: 3px;
border-radius: 1px;
background-color: #2778ff;
}
.operation {
display: flex;
margin-right: 10px;
font-weight: 400;
height: 70%;
cursor: pointer;
width: 10%;
}
.month {
width: 70px;
display: flex;
align-items: center;
justify-content: center;
// background: #f2f2f2;
}
.year {
width: 70px;
display: flex;
align-items: center;
justify-content: center;
// background: #2778ff;
}
}
.contant {
width: 100%;
height: calc(100% - 5vh);
.chartsPart {
width: 100%;
height: 40%;
display: flex;
justify-content: space-between;
.ballChart {
width: 25%;
border: 1px solid red;
margin-right: 12px;
}
.pillarChart {
width: calc(75% - 12px);
}
}
.tablePart {
height: calc(60% - 20px);
margin-top: 20px;
}
}
</style>

5
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue

@ -3,7 +3,9 @@
<a-tab-pane key="1" tab="全部">
<all />
</a-tab-pane>
<a-tab-pane key="2" tab="用电量" force-render> </a-tab-pane>
<a-tab-pane key="2" tab="用电量" force-render>
<category />
</a-tab-pane>
<a-tab-pane key="3" tab="用水量"> </a-tab-pane>
<a-tab-pane key="4" tab="供水量"> </a-tab-pane>
<a-tab-pane key="5" tab="碳排"> </a-tab-pane>
@ -13,6 +15,7 @@
<script lang="ts" setup>
import { ref } from 'vue';
import all from './all/index.vue';
import category from './category/index.vue';
defineOptions({
name: 'carbonPlanning', // name
});

Loading…
Cancel
Save