Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp
This commit is contained in:
@@ -60,9 +60,13 @@ export enum carbonInventoryCheck {
|
|||||||
// 碳排流向
|
// 碳排流向
|
||||||
carbonFlowDirection = '/carbon-smart/api/carbon/inventory/carbonFlowDirection',
|
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',
|
carbonDetailsList = '/carbon-smart/api/carbon/trade/details/carbonDetailsList',
|
||||||
createOrUpdate = '/carbon-smart/api/carbon/trade/details/createOrUpdate',
|
createOrUpdate = '/carbon-smart/api/carbon/trade/details/createOrUpdate',
|
||||||
delete = '/carbon-smart/api/carbon/trade/details/delete',
|
delete = '/carbon-smart/api/carbon/trade/details/delete',
|
||||||
|
quotaStatistics = '/carbon-smart/api/carbon/trade/details/quotaStatistics',
|
||||||
}
|
}
|
||||||
|
@@ -9,33 +9,39 @@
|
|||||||
</div>
|
</div>
|
||||||
<a-form layout="inline">
|
<a-form layout="inline">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-select
|
||||||
style="width: 200px"
|
|
||||||
v-model:value="queryParams.accountType"
|
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-form-item>
|
<a-form-item>
|
||||||
<a-select
|
<a-cascader
|
||||||
ref="select"
|
|
||||||
v-model:value="queryParams.transactionType"
|
v-model:value="queryParams.transactionType"
|
||||||
|
multiple
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
|
:options="options"
|
||||||
placeholder="请选择交易类型"
|
placeholder="请选择交易类型"
|
||||||
@focus="focus"
|
suffix-icon="Shopping Around">
|
||||||
@change="handleChange">
|
<template #tagRender="data">
|
||||||
<a-select-option value="jack">Jack</a-select-option>
|
<a-tag :key="data.value" color="blue">{{ data.label }}</a-tag>
|
||||||
<a-select-option value="lucy">Lucy</a-select-option>
|
</template>
|
||||||
</a-select>
|
</a-cascader>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-date-picker
|
<a-date-picker
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
v-model:value="queryParams.transactionDate"
|
v-model:value="queryParams.year"
|
||||||
placeholder="请选择账期"
|
placeholder="请选择账期"
|
||||||
picker="year" />
|
picker="year"
|
||||||
|
valueFormat="YYYY" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button type="primary">查询</a-button>
|
<a-button type="primary" @click="searchTableList">查询</a-button>
|
||||||
<a-button html-type="submit" style="margin-left: 6px">重置</a-button>
|
<a-button html-type="submit" style="margin-left: 6px" @click="reset">重置</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
@@ -110,7 +116,11 @@
|
|||||||
:label-col="labelCol"
|
:label-col="labelCol"
|
||||||
:wrapper-col="wrapperCol">
|
:wrapper-col="wrapperCol">
|
||||||
<a-form-item ref="name" label="账户类型" name="accountType">
|
<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>
|
||||||
<a-form-item ref="name" label="交易类型" name="transactionType">
|
<a-form-item ref="name" label="交易类型" name="transactionType">
|
||||||
<a-cascader
|
<a-cascader
|
||||||
@@ -130,6 +140,7 @@
|
|||||||
<a-form-item ref="name" label="交易对象" name="tradingPartner">
|
<a-form-item ref="name" label="交易对象" name="tradingPartner">
|
||||||
<a-input v-model:value="formState.tradingPartner" placeholder="请输入交易对象" />
|
<a-input v-model:value="formState.tradingPartner" placeholder="请输入交易对象" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item ref="name" label="交易凭证" name="tradingPartner">
|
||||||
<a-upload
|
<a-upload
|
||||||
v-model:file-list="fileList"
|
v-model:file-list="fileList"
|
||||||
name="file"
|
name="file"
|
||||||
@@ -138,9 +149,10 @@
|
|||||||
@change="handleChange">
|
@change="handleChange">
|
||||||
<a-button>
|
<a-button>
|
||||||
<upload-outlined></upload-outlined>
|
<upload-outlined></upload-outlined>
|
||||||
点击上传凭证
|
上传
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
||||||
@@ -155,13 +167,19 @@
|
|||||||
import { UploadOutlined } from '@ant-design/icons-vue';
|
import { UploadOutlined } from '@ant-design/icons-vue';
|
||||||
import type { UploadChangeParam } from 'ant-design-vue';
|
import type { UploadChangeParam } from 'ant-design-vue';
|
||||||
import { Pagination, Modal, message } from 'ant-design-vue';
|
import { Pagination, Modal, message } from 'ant-design-vue';
|
||||||
import { carbonAssetsDetail } from '/@/api/carbonEmissionFactorLibrary';
|
import { carbonAssets, carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
energyType: 'carbonAssetsDetail', // 与页面路由name一致缓存才可生效
|
energyType: 'carbonAssets', // 与页面路由name一致缓存才可生效
|
||||||
components: {
|
components: {
|
||||||
'a-pagination': Pagination,
|
'a-pagination': Pagination,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
// 父组件id
|
||||||
|
const props = defineProps({
|
||||||
|
parentId: {
|
||||||
|
type: Number,
|
||||||
|
},
|
||||||
|
});
|
||||||
const orgId = ref('');
|
const orgId = ref('');
|
||||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
orgId.value = result;
|
orgId.value = result;
|
||||||
@@ -174,14 +192,20 @@
|
|||||||
selectedRowKeys.value = selectedKeys;
|
selectedRowKeys.value = selectedKeys;
|
||||||
};
|
};
|
||||||
const total = ref<number>();
|
const total = ref<number>();
|
||||||
|
const thisYear = ref(new Date().getFullYear().toString());
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orgId: orgId.value,
|
orgId: orgId.value,
|
||||||
|
accountType: props.parentId,
|
||||||
|
year: thisYear.value,
|
||||||
});
|
});
|
||||||
|
const searchTableList = () => {
|
||||||
|
getDetailList();
|
||||||
|
};
|
||||||
// 获取左侧列表数据
|
// 获取左侧列表数据
|
||||||
const getDetailList = () => {
|
const getDetailList = () => {
|
||||||
fetch(carbonAssetsDetail.carbonDetailsList, queryParams.value).then((res) => {
|
fetch(carbonAssets.carbonDetailsList, queryParams.value).then((res) => {
|
||||||
data.value = res.data.records;
|
data.value = res.data.records;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -239,11 +263,39 @@
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
|
const reset = () => {
|
||||||
|
queryParams.value = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
orgId: orgId.value,
|
||||||
|
year: new Date().getFullYear(),
|
||||||
|
};
|
||||||
|
getDetailList();
|
||||||
|
};
|
||||||
const editData = (record) => {
|
const editData = (record) => {
|
||||||
|
getDictList();
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
formState.value.id = record.id;
|
formState.value.id = record.id;
|
||||||
|
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;
|
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) => {
|
const delData = (record) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '警告',
|
title: '警告',
|
||||||
@@ -252,7 +304,7 @@
|
|||||||
okType: 'primary',
|
okType: 'primary',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk() {
|
onOk() {
|
||||||
fetch(carbonAssetsDetail.delete, { id: record.id }).then((res) => {
|
fetch(carbonAssets.delete, { id: record.id }).then((res) => {
|
||||||
message.success('操作成功!');
|
message.success('操作成功!');
|
||||||
getDetailList();
|
getDetailList();
|
||||||
});
|
});
|
||||||
@@ -270,55 +322,48 @@
|
|||||||
};
|
};
|
||||||
// 新增相关数据
|
// 新增相关数据
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const formState = ref({});
|
const formState = ref({
|
||||||
|
orgId: orgId.value,
|
||||||
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const labelCol = { span: 5 };
|
const labelCol = { span: 5 };
|
||||||
const wrapperCol = { span: 19 };
|
const wrapperCol = { span: 19 };
|
||||||
const options: CascaderProps['options'] = [
|
const options = ref([]);
|
||||||
{
|
// 获取字典值
|
||||||
value: 'zhejiang',
|
const getDictList = () => {
|
||||||
label: 'Zhejiang',
|
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'TRANSACTION_TYPE' }).then(
|
||||||
children: [
|
(res) => {
|
||||||
{
|
options.value = res.data;
|
||||||
value: 'hangzhou',
|
options.value = options.value.map((item) => ({
|
||||||
label: 'Hangzhou',
|
value: item.id,
|
||||||
children: [
|
label: item.cnValue,
|
||||||
{
|
children: item.children
|
||||||
value: 'xihu',
|
? item.children.map((child) => ({
|
||||||
label: 'West Lake',
|
value: child.id,
|
||||||
|
label: child.cnValue,
|
||||||
|
}))
|
||||||
|
: [],
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
],
|
);
|
||||||
},
|
};
|
||||||
],
|
getDictList();
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'jiangsu',
|
|
||||||
label: 'Jiangsu',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
value: 'nanjing',
|
|
||||||
label: 'Nanjing',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
value: 'zhonghuamen',
|
|
||||||
label: 'Zhong Hua Men',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
// 点击新增
|
// 点击新增
|
||||||
const addDetail = () => {
|
const addDetail = () => {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
|
getDictList();
|
||||||
};
|
};
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
formRef.value
|
formRef.value
|
||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('values', formState, toRaw(formState));
|
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('操作成功!');
|
message.success('操作成功!');
|
||||||
|
visible.value = false;
|
||||||
getDetailList();
|
getDetailList();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -342,36 +387,28 @@
|
|||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
};
|
};
|
||||||
// 统计表格
|
// 统计表格
|
||||||
|
const getTotalTable = () => {
|
||||||
|
fetch(carbonAssets.quotaStatistics, queryParams.value).then((res) => {
|
||||||
|
totalData.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
getTotalTable();
|
||||||
const totalColumns = [
|
const totalColumns = [
|
||||||
{
|
{
|
||||||
title: '统计类型',
|
title: '统计类型',
|
||||||
dataIndex: 'name',
|
dataIndex: 'statisticType',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '小计',
|
title: '小计',
|
||||||
dataIndex: 'name',
|
dataIndex: 'subtotal',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '合计',
|
title: '合计',
|
||||||
dataIndex: 'name',
|
dataIndex: 'amountTo',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const totalData = [
|
const totalData = ref([]);
|
||||||
{
|
|
||||||
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 emit = defineEmits(['change-data']);
|
const emit = defineEmits(['change-data']);
|
||||||
const changeParentData = () => {
|
const changeParentData = () => {
|
||||||
|
@@ -1,15 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mainContant" v-if="homePage">
|
<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="top" style="background: rgba(252, 139, 78, 0.05)">
|
||||||
<div class="moneyImg"
|
<div class="moneyImg"
|
||||||
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-1.svg"
|
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-1.svg"
|
||||||
/></div>
|
/></div>
|
||||||
<div class="moneyTitle">全国碳账户估值(CNY)</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"
|
<div class="moneyDetail"
|
||||||
><img
|
><img
|
||||||
@click="viewDetail"
|
@click="viewDetail(1)"
|
||||||
width="34px"
|
width="34px"
|
||||||
height="34px"
|
height="34px"
|
||||||
src="../../../../src/icon/carbonAssetsSearch-1.svg"
|
src="../../../../src/icon/carbonAssetsSearch-1.svg"
|
||||||
@@ -21,12 +21,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="calculation TLCard">
|
<div class="calculation TLCard">
|
||||||
<div class="money">75,000.00</div>
|
<div class="money">{{nationwide.opening}}</div>
|
||||||
<div class="moneyType">期初余额(tCO2)</div>
|
<div class="moneyType">期初余额(tCO2)</div>
|
||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
||||||
<div class="calculation TLCard">
|
<div class="calculation TLCard">
|
||||||
<div class="money">20,000.00</div>
|
<div class="money">{{nationwide.income}}</div>
|
||||||
<div class="moneyType">
|
<div class="moneyType">
|
||||||
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
|
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
|
||||||
增加(tCO2)
|
增加(tCO2)
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
|
||||||
<div class="calculation TLCard">
|
<div class="calculation TLCard">
|
||||||
<div class="money">20,000.00</div>
|
<div class="money">{{nationwide.expenditure}}</div>
|
||||||
<div class="moneyType">
|
<div class="moneyType">
|
||||||
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
|
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
|
||||||
减少(tCO2)
|
减少(tCO2)
|
||||||
@@ -42,20 +42,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
|
||||||
<div class="calculation TLCard">
|
<div class="calculation TLCard">
|
||||||
<div class="money">75,000.00</div>
|
<div class="money">{{nationwide.period}}</div>
|
||||||
<div class="moneyType">期末余额(tCO2)</div>
|
<div class="moneyType">期末余额(tCO2)</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</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="top" style="background: rgba(234, 71, 54, 0.05)">
|
||||||
<div class="moneyImg"
|
<div class="moneyImg"
|
||||||
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-2.svg"
|
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-2.svg"
|
||||||
/></div>
|
/></div>
|
||||||
<div class="moneyTitle">地方碳账户估值(CNY)</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"
|
<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>
|
</div>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
@@ -64,12 +68,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="calculation TRCard">
|
<div class="calculation TRCard">
|
||||||
<div class="money">75,000.00</div>
|
<div class="money">{{place.opening}}</div>
|
||||||
<div class="moneyType">期初余额(tCO2)</div>
|
<div class="moneyType">期初余额(tCO2)</div>
|
||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
||||||
<div class="calculation TRCard">
|
<div class="calculation TRCard">
|
||||||
<div class="money">20,000.00</div>
|
<div class="money">{{place.income}}</div>
|
||||||
<div class="moneyType">
|
<div class="moneyType">
|
||||||
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
|
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
|
||||||
增加(tCO2)
|
增加(tCO2)
|
||||||
@@ -77,7 +81,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
|
||||||
<div class="calculation TRCard">
|
<div class="calculation TRCard">
|
||||||
<div class="money">20,000.00</div>
|
<div class="money">{{place.expenditure}}</div>
|
||||||
<div class="moneyType">
|
<div class="moneyType">
|
||||||
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
|
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
|
||||||
减少(tCO2)
|
减少(tCO2)
|
||||||
@@ -85,20 +89,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
|
||||||
<div class="calculation TRCard">
|
<div class="calculation TRCard">
|
||||||
<div class="money">75,000.00</div>
|
<div class="money">{{place.period}}</div>
|
||||||
<div class="moneyType">期末余额(tCO2)</div>
|
<div class="moneyType">期末余额(tCO2)</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</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="top" style="background: rgba(65, 163, 224, 0.05)">
|
||||||
<div class="moneyImg"
|
<div class="moneyImg"
|
||||||
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-3.svg"
|
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-3.svg"
|
||||||
/></div>
|
/></div>
|
||||||
<div class="moneyTitle">CCER资产估值(CNY)</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"
|
<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>
|
</div>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
@@ -107,12 +115,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="calculation BLCard">
|
<div class="calculation BLCard">
|
||||||
<div class="money">75,000.00</div>
|
<div class="money">{{ccer.opening}}</div>
|
||||||
<div class="moneyType">期初余额(tCO2)</div>
|
<div class="moneyType">期初余额(tCO2)</div>
|
||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
||||||
<div class="calculation BLCard">
|
<div class="calculation BLCard">
|
||||||
<div class="money">20,000.00</div>
|
<div class="money">{{ccer.income}}</div>
|
||||||
<div class="moneyType">
|
<div class="moneyType">
|
||||||
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
|
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
|
||||||
增加(tCO2)
|
增加(tCO2)
|
||||||
@@ -120,7 +128,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
|
||||||
<div class="calculation BLCard">
|
<div class="calculation BLCard">
|
||||||
<div class="money">20,000.00</div>
|
<div class="money">{{ccer.expenditure}}</div>
|
||||||
<div class="moneyType">
|
<div class="moneyType">
|
||||||
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
|
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
|
||||||
减少(tCO2)
|
减少(tCO2)
|
||||||
@@ -128,18 +136,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
|
||||||
<div class="calculation BLCard">
|
<div class="calculation BLCard">
|
||||||
<div class="money">75,000.00</div>
|
<div class="money">{{ccer.period}}</div>
|
||||||
<div class="moneyType">期末余额(tCO2)</div>
|
<div class="moneyType">期末余额(tCO2)</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</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="top" style="background: rgba(37, 192, 150, 0.05)">
|
||||||
<div class="moneyImg"
|
<div class="moneyImg"
|
||||||
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-4.svg"
|
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-4.svg"
|
||||||
/></div>
|
/></div>
|
||||||
<div class="moneyTitle">全国碳账户估值(CNY)</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>
|
||||||
<div class="title" style="justify-content: center">
|
<div class="title" style="justify-content: center">
|
||||||
<img
|
<img
|
||||||
@@ -150,38 +158,66 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="BRCard">
|
<div class="BRCard">
|
||||||
<div class="money">300,000.00</div>
|
<div class="money">{{whole.nationwide}}</div>
|
||||||
<div class="moneyType">全国碳账户资产估值</div>
|
<div class="moneyType">全国碳账户资产估值</div>
|
||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
||||||
<div class="BRCard">
|
<div class="BRCard">
|
||||||
<div class="money">300,000.00</div>
|
<div class="money">{{whole.place}}</div>
|
||||||
<div class="moneyType">地方碳账户资产估值</div>
|
<div class="moneyType">地方碳账户资产估值</div>
|
||||||
</div>
|
</div>
|
||||||
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
|
||||||
<div class="BRCard">
|
<div class="BRCard">
|
||||||
<div class="money">300,000.00</div>
|
<div class="money">{{whole.ccer}}</div>
|
||||||
<div class="moneyType">CCER碳资产估值</div>
|
<div class="moneyType">CCER碳资产估值</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="detail" v-else>
|
<div class="detail" v-else>
|
||||||
<carbonAssetsDetail @change-data="updateData" />
|
<carbonAssetsDetail @change-data="updateData" :parentId="parentId" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import carbonAssetsDetail from './carbonAssetsDetail/index.vue';
|
import carbonAssetsDetail from './carbonAssetsDetail/index.vue';
|
||||||
|
import { http } from '/nerv-lib/util/http';
|
||||||
|
import { carbonAssets } from '/@/api/carbonEmissionFactorLibrary';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
energyType: 'carbonAssets', // 与页面路由name一致缓存才可生效
|
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 homePage = ref(true);
|
||||||
// 点击跳转详情
|
// 点击跳转详情
|
||||||
const viewDetail = () => {
|
const parentId = ref(1);
|
||||||
|
const viewDetail = (data) => {
|
||||||
homePage.value = false;
|
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) => {
|
const updateData = (type) => {
|
||||||
homePage.value = type;
|
homePage.value = type;
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref, defineExpose } from 'vue';
|
||||||
import { http } from '/nerv-lib/util/http';
|
import { http } from '/nerv-lib/util/http';
|
||||||
import { Pagination } from 'ant-design-vue';
|
import { Pagination } from 'ant-design-vue';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
@@ -172,7 +172,9 @@
|
|||||||
total.value = res.data.length;
|
total.value = res.data.length;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getTableList();
|
defineExpose({
|
||||||
|
getTableList,
|
||||||
|
});
|
||||||
// 分页器
|
// 分页器
|
||||||
const onChange = (pageNumber: number, size: number) => {
|
const onChange = (pageNumber: number, size: number) => {
|
||||||
queryParams.value.pageNum = pageNumber;
|
queryParams.value.pageNum = pageNumber;
|
||||||
|
@@ -165,7 +165,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<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 type { Rule } from 'ant-design-vue/es/form';
|
||||||
import { Pagination,message,Modal } from 'ant-design-vue';
|
import { Pagination,message,Modal } from 'ant-design-vue';
|
||||||
import type { TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
|
import type { TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
|
||||||
@@ -382,6 +382,12 @@
|
|||||||
res.data.unit = selectDevice
|
res.data.unit = selectDevice
|
||||||
}
|
}
|
||||||
formState.value = res.data
|
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',
|
rowKey: 'id',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
mainRef,
|
||||||
|
});
|
||||||
// 定义一个递归函数来查找每一级的id 设备类型回显 层级方法
|
// 定义一个递归函数来查找每一级的id 设备类型回显 层级方法
|
||||||
function findParentIds(tree: any, targetId: number, result: any) {
|
function findParentIds(tree: any, targetId: number, result: any) {
|
||||||
for (let item of tree) {
|
for (let item of tree) {
|
||||||
@@ -438,11 +448,16 @@
|
|||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
};
|
};
|
||||||
// 计算碳排切换
|
// 计算碳排切换
|
||||||
|
const emissionType = ref()
|
||||||
const changeRadio = (e) => {
|
const changeRadio = (e) => {
|
||||||
if(e.target.value === 0){
|
if(e.target.value === 0){
|
||||||
isRequired.value = true
|
isRequired.value = true
|
||||||
|
if(emissionType.value){
|
||||||
|
formState.value.emissionType = emissionType.value
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
isRequired.value = false
|
isRequired.value = false
|
||||||
|
formState.value.emissionType = ''
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 点击确定提交
|
// 点击确定提交
|
||||||
|
@@ -18,16 +18,32 @@
|
|||||||
import quickCalculation from './quickCalculation/index.vue';
|
import quickCalculation from './quickCalculation/index.vue';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'CarbonEmissionStatisticsIndex', // 与页面路由name一致缓存才可生效
|
name: 'CarbonEmissionStatisticsIndex', // 与页面路由name一致缓存才可生效
|
||||||
|
components: {
|
||||||
|
energyConsumption,
|
||||||
|
carbonEmissions,
|
||||||
|
quickCalculation,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const activeKey = ref('1');
|
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页的回调
|
// 切换tab页的回调
|
||||||
const handleTabChange = (key) => {
|
const handleTabChange = (key) => {
|
||||||
console.log('Tab changed:', key);
|
console.log('Tab changed:', key);
|
||||||
// 在这里可以执行需要在页面切换时执行的逻辑
|
// 在这里可以执行需要在页面切换时执行的逻辑
|
||||||
// if(key==='1'){
|
if (key === '1') {
|
||||||
// if (energyConsumptionRef.value) {
|
if (energyConsumptionRef.value) {
|
||||||
// energyConsumptionRef.value.getTableList(); // 调用子组件的方法
|
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>
|
</script>
|
||||||
|
@@ -129,7 +129,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<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 type { TreeProps } from 'ant-design-vue';
|
||||||
import { Pagination, Modal } from 'ant-design-vue';
|
import { Pagination, Modal } from 'ant-design-vue';
|
||||||
import { columns, drawerColumns } from '../config';
|
import { columns, drawerColumns } from '../config';
|
||||||
@@ -350,6 +350,10 @@
|
|||||||
},
|
},
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
getTreeData,
|
||||||
|
});
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
const getTableList = () => {
|
const getTableList = () => {
|
||||||
fetch(quickCalculation.queryCarbonEmissionPage, queryParams.value).then((res) => {
|
fetch(quickCalculation.queryCarbonEmissionPage, queryParams.value).then((res) => {
|
||||||
|
@@ -60,7 +60,7 @@
|
|||||||
<div class="ns-table-title ns-title-extra-box">排放源</div>
|
<div class="ns-table-title ns-title-extra-box">排放源</div>
|
||||||
<a-button type="primary" style="margin-left: 12px" @click="changeParentData">返回</a-button>
|
<a-button type="primary" style="margin-left: 12px" @click="changeParentData">返回</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex" v-if="fillInPage">
|
<div style="display: flex; height: 100%" v-if="fillInPage">
|
||||||
<div class="mainLeft">
|
<div class="mainLeft">
|
||||||
<a-tree
|
<a-tree
|
||||||
:expandedKeys="expandedKeysR"
|
:expandedKeys="expandedKeysR"
|
||||||
@@ -370,8 +370,13 @@
|
|||||||
year: {
|
year: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
startTime: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
endTime: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
console.log(props, 'xxy');
|
|
||||||
|
|
||||||
const orgId = ref('');
|
const orgId = ref('');
|
||||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
@@ -624,6 +629,8 @@
|
|||||||
const formState = ref({
|
const formState = ref({
|
||||||
orgId: orgId.value,
|
orgId: orgId.value,
|
||||||
year: props.year,
|
year: props.year,
|
||||||
|
startTime: props.startTime,
|
||||||
|
endTime: props.endTime,
|
||||||
});
|
});
|
||||||
// 计量单位的变量
|
// 计量单位的变量
|
||||||
const measurementUnit = ref([]);
|
const measurementUnit = ref([]);
|
||||||
@@ -1018,13 +1025,13 @@
|
|||||||
year: props.year,
|
year: props.year,
|
||||||
categoryId: categoryId.value,
|
categoryId: categoryId.value,
|
||||||
});
|
});
|
||||||
const linksData = ref([])
|
const linksData = ref([]);
|
||||||
const datalist = ref([])
|
const datalist = ref([]);
|
||||||
const getCarbonFlowDirection = () => {
|
const getCarbonFlowDirection = () => {
|
||||||
fetch(carbonInventoryCheck.carbonFlowDirection, queryFlowDirection.value).then((res) => {
|
fetch(carbonInventoryCheck.carbonFlowDirection, queryFlowDirection.value).then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
linksData.value = res.data[0]
|
linksData.value = res.data[0];
|
||||||
datalist.value = res.data[1]
|
datalist.value = res.data[1];
|
||||||
drawEcharts();
|
drawEcharts();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -1431,6 +1438,7 @@
|
|||||||
margin-right: 1%;
|
margin-right: 1%;
|
||||||
border-right: 1px solid #f2f2f2;
|
border-right: 1px solid #f2f2f2;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
height: 96%;
|
||||||
.treeRow {
|
.treeRow {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 填报页 -->
|
<!-- 填报页 -->
|
||||||
<div v-if="fillInPage" style="height: 100%">
|
<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>
|
</div>
|
||||||
<!-- 新增报告弹窗 -->
|
<!-- 新增报告弹窗 -->
|
||||||
<a-drawer
|
<a-drawer
|
||||||
@@ -31,7 +31,10 @@
|
|||||||
<a-input v-model:value="formState.genericStandard" placeholder="请输入适用标准" />
|
<a-input v-model:value="formState.genericStandard" placeholder="请输入适用标准" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="报告周期" name="reportPeriod">
|
<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="1">年度</a-select-option>
|
||||||
<a-select-option value="2">月度</a-select-option>
|
<a-select-option value="2">月度</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
@@ -40,6 +43,7 @@
|
|||||||
<a-range-picker
|
<a-range-picker
|
||||||
v-model:value="formState.reportScope"
|
v-model:value="formState.reportScope"
|
||||||
picker="month"
|
picker="month"
|
||||||
|
:disabledDate="disabledDate"
|
||||||
valueFormat="YYYY-MM" />
|
valueFormat="YYYY-MM" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
@@ -71,6 +75,13 @@
|
|||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const labelCol = { span: 5 };
|
const labelCol = { span: 5 };
|
||||||
const wrapperCol = { span: 19 };
|
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表单的必填
|
// 定义form表单的必填
|
||||||
const rules: Record<string, Rule[]> = {
|
const rules: Record<string, Rule[]> = {
|
||||||
reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }],
|
reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }],
|
||||||
@@ -107,6 +118,8 @@
|
|||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
const mainRef = ref();
|
const mainRef = ref();
|
||||||
const reportId = ref();
|
const reportId = ref();
|
||||||
|
const startTime = ref();
|
||||||
|
const endTime = ref();
|
||||||
const year = ref();
|
const year = ref();
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
title: '数据库',
|
title: '数据库',
|
||||||
@@ -178,6 +191,8 @@
|
|||||||
fillInPage.value = true;
|
fillInPage.value = true;
|
||||||
reportId.value = record.id;
|
reportId.value = record.id;
|
||||||
year.value = record.reportYear;
|
year.value = record.reportYear;
|
||||||
|
startTime.value = record.startTime;
|
||||||
|
endTime.value = record.endTime;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -14,6 +14,10 @@
|
|||||||
<div class="contant">
|
<div class="contant">
|
||||||
<div class="chartsPart">
|
<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 class="electricityConsumption" ref="ydlChart"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tablePart">
|
<div class="tablePart">
|
||||||
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> </a-table>
|
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> </a-table>
|
||||||
@@ -269,6 +273,8 @@
|
|||||||
.chartsPart {
|
.chartsPart {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 35%;
|
height: 35%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
.electricityConsumption {
|
.electricityConsumption {
|
||||||
width: 19%;
|
width: 19%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@@ -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>
|
@@ -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>
|
@@ -3,7 +3,9 @@
|
|||||||
<a-tab-pane key="1" tab="全部">
|
<a-tab-pane key="1" tab="全部">
|
||||||
<all />
|
<all />
|
||||||
</a-tab-pane>
|
</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="3" tab="用水量"> </a-tab-pane>
|
||||||
<a-tab-pane key="4" tab="供水量"> </a-tab-pane>
|
<a-tab-pane key="4" tab="供水量"> </a-tab-pane>
|
||||||
<a-tab-pane key="5" tab="碳排"> </a-tab-pane>
|
<a-tab-pane key="5" tab="碳排"> </a-tab-pane>
|
||||||
@@ -13,6 +15,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import all from './all/index.vue';
|
import all from './all/index.vue';
|
||||||
|
import category from './category/index.vue';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'carbonPlanning', // 与页面路由name一致缓存才可生效
|
name: 'carbonPlanning', // 与页面路由name一致缓存才可生效
|
||||||
});
|
});
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
"dayjs": "^1.11.2",
|
"dayjs": "^1.11.2",
|
||||||
"echarts": "^5.3.2",
|
"echarts": "^5.3.2",
|
||||||
"echarts-gl": "^2.0.9",
|
"echarts-gl": "^2.0.9",
|
||||||
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"element-resize-detector": "^1.2.4",
|
"element-resize-detector": "^1.2.4",
|
||||||
"exceljs": "^4.3.0",
|
"exceljs": "^4.3.0",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
|
Reference in New Issue
Block a user