Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp
This commit is contained in:
@@ -9,13 +9,16 @@
|
||||
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{
|
||||
nationwide.valuation
|
||||
}}</div>
|
||||
<div class="moneyDetail"
|
||||
><img
|
||||
@click="viewDetail(1)"
|
||||
width="34px"
|
||||
height="34px"
|
||||
src="../../../../src/icon/carbonAssetsSearch-1.svg"
|
||||
/></div>
|
||||
<div class="moneyDetail">
|
||||
<div class="detailClick" @click="viewDetail(1)" style="border: 1px solid rgba(229, 102, 22, 1);">
|
||||
<img
|
||||
width="20px"
|
||||
height="20px"
|
||||
src="../../../../src/icon/carbonAssetsToDetail-1.svg"
|
||||
alt="" />
|
||||
<span style="color: rgba(229, 102, 22, 1);">交易明细</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img width="24px" height="24px" src="../../../../src/icon/carbonAssetsTitle-1.svg" />
|
||||
@@ -56,13 +59,16 @@
|
||||
/></div>
|
||||
<div class="moneyTitle">地方碳账户估值(CNY)</div>
|
||||
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{ place.valuation }}</div>
|
||||
<div class="moneyDetail"
|
||||
><img
|
||||
width="34px"
|
||||
height="34px"
|
||||
@click="viewDetail(2)"
|
||||
src="../../../../src/icon/carbonAssetsSearch-2.svg"
|
||||
/></div>
|
||||
<div class="moneyDetail">
|
||||
<div class="detailClick" @click="viewDetail(2)" style="border: 1px solid rgba(230, 51, 44, 1);">
|
||||
<img
|
||||
width="20px"
|
||||
height="20px"
|
||||
src="../../../../src/icon/carbonAssetsToDetail-2.svg"
|
||||
alt="" />
|
||||
<span style="color: rgba(230, 51, 44, 1);">交易明细</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img width="24px" height="24px" src="../../../../src/icon/carbonAssetsTitle-2.svg" />
|
||||
@@ -103,13 +109,16 @@
|
||||
/></div>
|
||||
<div class="moneyTitle">CCER资产估值(CNY)</div>
|
||||
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{ ccer.valuation }}</div>
|
||||
<div class="moneyDetail"
|
||||
><img
|
||||
width="34px"
|
||||
height="34px"
|
||||
@click="viewDetail(3)"
|
||||
src="../../../../src/icon/carbonAssetsSearch-3.svg"
|
||||
/></div>
|
||||
<div class="moneyDetail" >
|
||||
<div class="detailClick" @click="viewDetail(3)" style="border: 1px solid rgba(56, 157, 220, 1);">
|
||||
<img
|
||||
width="20px"
|
||||
height="20px"
|
||||
src="../../../../src/icon/carbonAssetsToDetail-3.svg"
|
||||
alt="" />
|
||||
<span style="color: rgba(56, 157, 220, 1);">交易明细</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img width="24px" height="24px" src="../../../../src/icon/carbonAssetsTitle-3.svg" />
|
||||
@@ -259,7 +268,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.moneyImg {
|
||||
width: 20%;
|
||||
width: 18%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -275,7 +284,7 @@
|
||||
vertical-align: top;
|
||||
}
|
||||
.moneyTotal {
|
||||
width: 35%;
|
||||
width: 33%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
opacity: 1;
|
||||
@@ -285,10 +294,17 @@
|
||||
text-align: left;
|
||||
}
|
||||
.moneyDetail {
|
||||
width: 10%;
|
||||
width: 14%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
.detailClick {
|
||||
border-radius: 4px;
|
||||
padding: 3px;
|
||||
> span {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.title {
|
||||
|
@@ -125,12 +125,14 @@
|
||||
:body-style="{ paddingBottom: '80px' }"
|
||||
:footer-style="{ textAlign: 'right' }"
|
||||
destroyOnClose
|
||||
title="单位管理"
|
||||
@close="closeUnitManag">
|
||||
<div class="addButton">
|
||||
<div class="ns-form-title titleUnit">
|
||||
<div class="title">单位管理</div>
|
||||
<a-button type="primary" @click="addGroup">新增分组</a-button>
|
||||
<a-button type="primary" @click="addUnit">新增单位</a-button>
|
||||
</div>
|
||||
<!-- <div class="addButton">
|
||||
</div> -->
|
||||
<div class="treePart">
|
||||
<div
|
||||
style="
|
||||
@@ -245,8 +247,8 @@
|
||||
const dynamicDisabled = computed(() => {
|
||||
return formRef.value?.validateResult && userAuthList.value?.length;
|
||||
});
|
||||
const fetch = (api, params = { orgId }) => {
|
||||
return http.post(api, params);
|
||||
const fetch = (api, params = { orgId }, config) => {
|
||||
return http.post(api, params, config);
|
||||
};
|
||||
const selectTreeDataValue = ref<string>('');
|
||||
const mainRef = ref();
|
||||
@@ -640,7 +642,7 @@
|
||||
type: 'primary',
|
||||
name: 'carbonEmissionFactorLibraryImport',
|
||||
extra: {
|
||||
api: carbonEmissionFactorLibrary.excel, // 导入接口名
|
||||
api: carbonEmissionFactorLibrary.import, // 导入接口名
|
||||
params: {
|
||||
orgId,
|
||||
},
|
||||
@@ -659,7 +661,31 @@
|
||||
label: '导出',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx');
|
||||
const exportQuery = {
|
||||
orgId: orgId.value,
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
};
|
||||
const config = {
|
||||
responseType: 'blob',
|
||||
};
|
||||
fetch(carbonEmissionFactorLibrary.export, exportQuery, config)
|
||||
.then((res) => {
|
||||
// 创建一个 URL 对象,指向图片数据的 blob
|
||||
const url = window.URL.createObjectURL(new Blob([res]));
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'carbonFactor.xlsx'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 清理 URL 对象
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('下载失败:', error);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1101,6 +1127,20 @@
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.titleUnit {
|
||||
font-weight: bold;
|
||||
user-select: text;
|
||||
padding: unset;
|
||||
margin-bottom: unset;
|
||||
padding-bottom: unset;
|
||||
border-bottom: unset;
|
||||
width: 70%;
|
||||
height: 5vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-left: 10%;
|
||||
}
|
||||
.title {
|
||||
text-align: left;
|
||||
height: 32px;
|
||||
@@ -1140,6 +1180,7 @@
|
||||
border: 1px solid #bfbfbf;
|
||||
margin-left: 10%;
|
||||
flex-direction: column;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.actionMore {
|
||||
display: none;
|
||||
|
@@ -1,52 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <a-table
|
||||
:columns="tableColumns"
|
||||
:data-source="data"
|
||||
bordered
|
||||
:pagination="false"
|
||||
:scroll="{ x: 2000 }">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<span>
|
||||
<a @click="editData(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="delData(record)">删除</a>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #title>
|
||||
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" valueFormat="YYYY" />
|
||||
<div class="buttonGroup">
|
||||
<a-button type="primary" @click="addNewData">新增</a-button>
|
||||
<a-button type="primary">导入</a-button>
|
||||
<a-button type="primary">导出</a-button>
|
||||
<a-button type="primary">模板下载</a-button>
|
||||
<a-button type="primary" @click="uploadVoucher">上传凭证</a-button>
|
||||
<a-button type="primary">凭证下载</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-table> -->
|
||||
<ns-view-list-table
|
||||
v-bind="tableConfig"
|
||||
:model="data"
|
||||
ref="mainRef"
|
||||
:scroll="{ x: 1500, y: 350 }">
|
||||
<!-- <template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.dataIndex === 'janFlag'">
|
||||
<span v-if="record.janFlag===1" style="color: rgba(243, 97, 99, 1);">{{text}}</span>
|
||||
<span v-else style="color: rgba(57, 215, 287, 1);">{{text}}</span>
|
||||
</template>
|
||||
</template> -->
|
||||
</ns-view-list-table>
|
||||
<!-- <a-pagination
|
||||
:current="queryParams.pageNum"
|
||||
:total="total"
|
||||
:page-size="queryParams.pageSize"
|
||||
style="display: flex;justify-content: center;margin-top: 16px;"
|
||||
:show-size-changer="true"
|
||||
:show-quick-jumper="true"
|
||||
@change="onChange" /> -->
|
||||
<!-- 新增数据库数据 -->
|
||||
<a-drawer
|
||||
:width="500"
|
||||
@@ -68,8 +27,11 @@
|
||||
<a-form-item label="计量单位" name="unit">
|
||||
<a-cascader v-model:value="formState.unit" :options="measurementUnit" />
|
||||
</a-form-item>
|
||||
<a-form-item label="能耗类型" name="emissionType" :required="isRequired">
|
||||
<a-select v-model:value="formState.emissionType" placeholder="请选择能耗类型">
|
||||
<a-form-item label="能耗类型">
|
||||
<a-select
|
||||
v-model:value="formState.energyConsumptionType"
|
||||
@change="changeEnergyType"
|
||||
placeholder="请选择能耗类型">
|
||||
<a-select-option
|
||||
v-for="(item, index) in energyTypeOptions"
|
||||
:key="index"
|
||||
@@ -230,14 +192,19 @@
|
||||
</a-col>
|
||||
</a-row> -->
|
||||
<div class="ns-form-title"><div class="title">能耗统计</div></div>
|
||||
<a-table :columns="addColumns" :data-source="addData" size="small" :pagination="false">
|
||||
<a-table
|
||||
:columns="addColumns"
|
||||
:data-source="addData"
|
||||
size="small"
|
||||
:pagination="false"
|
||||
:scroll="{ y: 200 }">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-switch
|
||||
:checked="record.age === 1 ? true : false"
|
||||
:checked="record.type === 1 ? true : false"
|
||||
:class="{
|
||||
'blue-background': record.age === 1 ? true : false,
|
||||
'grey-background': record.age === 1 ? false : true,
|
||||
'blue-background': record.type === 1 ? true : false,
|
||||
'grey-background': record.type === 1 ? false : true,
|
||||
}"
|
||||
@click="changeSwitch(record)" />
|
||||
</template>
|
||||
@@ -256,6 +223,10 @@
|
||||
上传
|
||||
</a-button>
|
||||
</a-upload>
|
||||
<div style="display: flex; flex-direction: column">
|
||||
<span>1.仅支持pdf格式文件或文件夹</span>
|
||||
<span>2.文件名命名规则为【能源种类_年份】</span>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
||||
@@ -316,7 +287,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, toRaw, defineExpose } from 'vue';
|
||||
import { ref, toRaw, defineExpose, createVNode } from 'vue';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { Pagination, message, Modal } from 'ant-design-vue';
|
||||
import { UploadOutlined } from '@ant-design/icons-vue';
|
||||
@@ -406,6 +377,7 @@
|
||||
const tableConfig = ref({
|
||||
title: '能耗统计',
|
||||
api: energyConsumption.pageList,
|
||||
rowSelection: null,
|
||||
params: queryParams.value,
|
||||
headerActions: [
|
||||
{
|
||||
@@ -421,17 +393,62 @@
|
||||
{
|
||||
label: '导入',
|
||||
type: 'primary',
|
||||
name: 'userImport',
|
||||
handle: () => {},
|
||||
name: 'energyConsumptionImport',
|
||||
extra: {
|
||||
api: energyConsumption.import, // 导入接口名
|
||||
params: {
|
||||
orgId,
|
||||
year,
|
||||
},
|
||||
title: '碳排统计', // 弹窗title
|
||||
templateName: 'energyConsumption', // 所使用的文件名称
|
||||
indexName: '能源种类', // 匹配类型字段
|
||||
message: [
|
||||
{ label: '1、若必填项未填写,则不能进行导入操作' },
|
||||
{ label: `2、当重复时,则更新数据。` },
|
||||
{ label: '3、数据将从模版的第五行进行导入。' },
|
||||
{ label: '4、文件导入勿超过5MB。' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
type: 'primary',
|
||||
name: 'userExports',
|
||||
handle: () => {
|
||||
const exportQuery = {
|
||||
orgId: orgId.value,
|
||||
year: mainRef.value.nsTableRef.formParamsRef.year
|
||||
? mainRef.value.nsTableRef.formParamsRef.year
|
||||
: selectYear.value.format('YYYY'),
|
||||
};
|
||||
const config = {
|
||||
responseType: 'blob',
|
||||
};
|
||||
fetch(energyConsumption.export, exportQuery, config)
|
||||
.then((res) => {
|
||||
// 创建一个 URL 对象,指向图片数据的 blob
|
||||
const url = window.URL.createObjectURL(new Blob([res]));
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'carbonStats.xlsx'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 清理 URL 对象
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('下载失败:', error);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '模板下载',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
doWnload('/hx-ai-intelligent/asset/file/energyConsumption.xlsx');
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '上传凭证',
|
||||
@@ -474,53 +491,242 @@
|
||||
{
|
||||
title: '1月',
|
||||
dataIndex: 'jan',
|
||||
// customRender: ({ text }: { text: string }) => {
|
||||
// return <span :style="{ color: getColor(text) }">{text}</span>;
|
||||
// }
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.janFlag) {
|
||||
case 1:
|
||||
text = value.record.jan ? value.record.jan : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.jan ? value.record.jan : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '2月',
|
||||
dataIndex: 'feb',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.febFlag) {
|
||||
case 1:
|
||||
text = value.record.feb ? value.record.feb : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.feb ? value.record.feb : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '3月',
|
||||
dataIndex: 'mar',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.marFlag) {
|
||||
case 1:
|
||||
text = value.record.mar ? value.record.mar : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.mar ? value.record.mar : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '4月',
|
||||
dataIndex: 'apr',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.aprFlag) {
|
||||
case 1:
|
||||
text = value.record.apr ? value.record.apr : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.apr ? value.record.apr : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '5月',
|
||||
dataIndex: 'may',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.mayFlag) {
|
||||
case 1:
|
||||
text = value.record.may ? value.record.may : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.may ? value.record.may : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '6月',
|
||||
dataIndex: 'jun',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.junFlag) {
|
||||
case 1:
|
||||
text = value.record.jun ? value.record.jun : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.jun ? value.record.jun : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '7月',
|
||||
dataIndex: 'jul',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.julFlag) {
|
||||
case 1:
|
||||
text = value.record.jul ? value.record.jul : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.jul ? value.record.jul : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '8月',
|
||||
dataIndex: 'aug',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.augFlag) {
|
||||
case 1:
|
||||
text = value.record.aug ? value.record.aug : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.aug ? value.record.aug : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '9月',
|
||||
dataIndex: 'sep',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.sepFlag) {
|
||||
case 1:
|
||||
text = value.record.sep ? value.record.sep : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.sep ? value.record.sep : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '10月',
|
||||
dataIndex: 'oct',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.octFlag) {
|
||||
case 1:
|
||||
text = value.record.oct ? value.record.oct : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.oct ? value.record.oct : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '11月',
|
||||
dataIndex: 'nov',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.novFlag) {
|
||||
case 1:
|
||||
text = value.record.nov ? value.record.nov : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.nov ? value.record.nov : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '12月',
|
||||
dataIndex: 'dec',
|
||||
customRender: (value) => {
|
||||
let text;
|
||||
let color;
|
||||
switch (value.record.decFlag) {
|
||||
case 1:
|
||||
text = value.record.dec ? value.record.dec : '';
|
||||
color = 'rgba(243, 97, 99, 1)';
|
||||
break;
|
||||
case 0:
|
||||
text = value.record.dec ? value.record.dec : '';
|
||||
color = 'rgba(57, 215, 287, 1)';
|
||||
break;
|
||||
}
|
||||
// 使用内联样式设置颜色
|
||||
return createVNode('div', { style: { color: color } }, text);
|
||||
},
|
||||
},
|
||||
],
|
||||
columnActions: {
|
||||
@@ -531,6 +737,7 @@
|
||||
name: 'userEdit',
|
||||
handle: (record: any) => {
|
||||
getDictList();
|
||||
getSummaryMethod(record.id);
|
||||
visible.value = true;
|
||||
fetch(energyConsumption.findById, { id: record.id }).then((res) => {
|
||||
if (res.data.emissionType) {
|
||||
@@ -588,38 +795,39 @@
|
||||
},
|
||||
rowKey: 'id',
|
||||
});
|
||||
const getColor = (value: string | number): string => {
|
||||
if (typeof value === 'string') {
|
||||
switch (value) {
|
||||
case 'active':
|
||||
return 'green';
|
||||
case 'inactive':
|
||||
return 'red';
|
||||
default:
|
||||
return 'black';
|
||||
}
|
||||
} else if (typeof value === 'number') {
|
||||
return value > 30 ? 'blue' : 'purple'; // 示例:根据年龄设置颜色
|
||||
}
|
||||
return 'black';
|
||||
const doWnload = (url) => {
|
||||
const a = document.createElement('a');
|
||||
document.body.appendChild(a);
|
||||
a.href = encodeURI(url);
|
||||
//设置下载的文件名
|
||||
// a.download = fileName.value;
|
||||
//触发a标签的点击事件,进行下载
|
||||
a.click();
|
||||
};
|
||||
const getSummaryMethod = () => {
|
||||
fetch(energyConsumption.energyAcquisition, { orgId: orgId.value }).then((res) => {
|
||||
addData.value = res.data.records;
|
||||
const getSummaryMethod = (id) => {
|
||||
const queryData = {
|
||||
orgId: orgId.value,
|
||||
};
|
||||
if (id) {
|
||||
queryData.id = id;
|
||||
}
|
||||
fetch(energyConsumption.energyAcquisition, queryData).then((res) => {
|
||||
addData.value = res.data;
|
||||
});
|
||||
};
|
||||
const addColumns = [
|
||||
{ title: '月份', dataIndex: 'key' },
|
||||
{ title: '汇总方式', dataIndex: 'name' },
|
||||
{ title: '操作', key: 'action', dataIndex: 'age' },
|
||||
{ title: '月份', dataIndex: 'month', align: 'center' },
|
||||
{ title: '汇总方式', dataIndex: 'access', align: 'center' },
|
||||
{ title: '操作', key: 'action', dataIndex: 'type', align: 'center' },
|
||||
];
|
||||
const addData = ref([]);
|
||||
//开关
|
||||
const changeSwitch = (data: any) => {
|
||||
data.age = data.age === 1 ? 0 : 1;
|
||||
data.name = data.age === 1 ? '自动' : '手动';
|
||||
data.type = data.type === 1 ? 0 : 1;
|
||||
data.access = data.type === 1 ? '自动' : '手动';
|
||||
addData.value = [...addData.value];
|
||||
console.log(addData.value);
|
||||
formState.value.summaryMethodList = addData.value;
|
||||
};
|
||||
defineExpose({
|
||||
mainRef,
|
||||
@@ -648,6 +856,22 @@
|
||||
queryParams.value.pageSize = size;
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
};
|
||||
const changeEnergyType = (value) => {
|
||||
// 获取自动采集节点的数据
|
||||
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
|
||||
treeData.value = res.data;
|
||||
treeData.value = treeData.value.map((item) => ({
|
||||
value: item.id,
|
||||
label: item.pointName,
|
||||
children: item.children
|
||||
? item.children.map((child) => ({
|
||||
value: child.id,
|
||||
label: child.pointName,
|
||||
}))
|
||||
: [],
|
||||
}));
|
||||
});
|
||||
};
|
||||
// 计算碳排切换
|
||||
const emissionType = ref();
|
||||
const changeRadio = (e) => {
|
||||
@@ -778,22 +1002,6 @@
|
||||
}));
|
||||
},
|
||||
);
|
||||
// 获取自动采集节点的数据
|
||||
fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE', orgId: orgId.value }).then(
|
||||
(res) => {
|
||||
treeData.value = res.data;
|
||||
treeData.value = treeData.value.map((item) => ({
|
||||
value: item.id,
|
||||
label: item.pointName,
|
||||
children: item.children
|
||||
? item.children.map((child) => ({
|
||||
value: child.id,
|
||||
label: child.pointName,
|
||||
}))
|
||||
: [],
|
||||
}));
|
||||
},
|
||||
);
|
||||
};
|
||||
// 点击新增按钮
|
||||
const addNewData = () => {
|
||||
@@ -911,13 +1119,10 @@
|
||||
const deleteId = ref(new FormData());
|
||||
deleteId.value.append('id', record.id);
|
||||
const config = {
|
||||
headers: {
|
||||
responseType: 'blob',
|
||||
},
|
||||
responseType: 'blob',
|
||||
};
|
||||
fetch(uploadPic.download, deleteId.value, config)
|
||||
.then((res) => {
|
||||
debugger
|
||||
// 创建一个 URL 对象,指向图片数据的 blob
|
||||
const url = window.URL.createObjectURL(new Blob([res]));
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
@@ -939,14 +1144,17 @@
|
||||
selectedRowKeysSet.value.forEach((item) => {
|
||||
deleteIds.value.append('ids', item);
|
||||
});
|
||||
fetch(uploadPic.downloadZip, deleteIds.value)
|
||||
const config = {
|
||||
responseType: 'blob',
|
||||
};
|
||||
fetch(uploadPic.downloadZip, deleteIds.value, config)
|
||||
.then((res) => {
|
||||
// 创建一个 URL 对象,指向图片数据的 blob
|
||||
const url = window.URL.createObjectURL(new Blob([res.data]));
|
||||
const url = window.URL.createObjectURL(new Blob([res]));
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', ''); // 设置下载的文件名
|
||||
link.setAttribute('download', '能耗统计凭证.zip'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
|
@@ -61,7 +61,11 @@
|
||||
</div>
|
||||
</template>
|
||||
</a-table> -->
|
||||
<ns-view-list-table v-bind="tableConfig" :model="tableData" ref="mainRef" />
|
||||
<ns-view-list-table
|
||||
v-bind="tableConfig"
|
||||
:model="tableData"
|
||||
ref="mainRef"
|
||||
:scroll="{ x: 1000 }" />
|
||||
<a-pagination
|
||||
:current="queryParams.pageNum"
|
||||
:total="total"
|
||||
@@ -107,7 +111,7 @@
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="name">
|
||||
<ns-input style="margin-top: 5px;" v-model:value="selectData" @change="keyChange" />
|
||||
<ns-input style="margin-top: 5px" v-model:value="selectData" @change="keyChange" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -271,7 +275,7 @@
|
||||
orgId: orgId.value,
|
||||
});
|
||||
const tableData = ref([]);
|
||||
|
||||
const emissionSources = ref();
|
||||
const tableConfig = ref({
|
||||
title: '排放因子库',
|
||||
api: quickCalculation.queryCarbonEmissionPage,
|
||||
@@ -310,6 +314,7 @@
|
||||
title: '更新时间',
|
||||
className: 'updateTime',
|
||||
dataIndex: 'updateTime',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '启用时间',
|
||||
@@ -340,6 +345,8 @@
|
||||
formState.value.dateRange = [record.startTime, record.endTime];
|
||||
formState.value.factorId = record.factorId;
|
||||
visible.value = true;
|
||||
emissionSources.value = record.emissionSources;
|
||||
queryData.value.emissionSources = emissionSources.value;
|
||||
getNewTable();
|
||||
},
|
||||
},
|
||||
@@ -411,7 +418,11 @@
|
||||
};
|
||||
const selectData = ref();
|
||||
const keyChange = () => {
|
||||
queryData.value.emissionSources = selectData.value;
|
||||
if (selectData.value === '') {
|
||||
queryData.value.emissionSources = emissionSources.value;
|
||||
} else {
|
||||
queryData.value.emissionSources = selectData.value;
|
||||
}
|
||||
getNewTable();
|
||||
};
|
||||
// 点击编辑按钮
|
||||
|
@@ -56,6 +56,12 @@
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="right">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="changeParentData"
|
||||
style="position: absolute; right: 25px; top: 10px; z-index: 99">
|
||||
返回
|
||||
</a-button>
|
||||
<a-tabs v-model:activeKey="activeKey" @change="handleTabChange" style="height: 100%">
|
||||
<a-tab-pane key="1" tab="排放源">
|
||||
<div style="display: flex; height: 100%">
|
||||
@@ -305,7 +311,8 @@
|
||||
:data-source="newTableData"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:scroll="{ y: 400 }"
|
||||
:scroll="{ y: 300 }"
|
||||
size="small"
|
||||
style="margin-bottom: 10px"
|
||||
:rowSelection="{
|
||||
selectedRowKeys: selectedRowKeysEdit,
|
||||
@@ -315,14 +322,14 @@
|
||||
:pagination="false">
|
||||
</a-table>
|
||||
<a-pagination
|
||||
:current="queryParams.pageNum"
|
||||
:current="queryData.pageNum"
|
||||
:total="total"
|
||||
:page-size="queryParams.pageSize"
|
||||
:page-size="queryData.pageSize"
|
||||
style="display: flex; justify-content: center; margin-top: 16px"
|
||||
:show-size-changer="true"
|
||||
:show-quick-jumper="true"
|
||||
@change="onChange" />
|
||||
<a-upload
|
||||
<!-- <a-upload
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf"
|
||||
@@ -333,7 +340,20 @@
|
||||
<upload-outlined></upload-outlined>
|
||||
点击上传凭证
|
||||
</a-button>
|
||||
</a-upload>
|
||||
</a-upload> -->
|
||||
<a-upload-dragger
|
||||
v-model:fileList="fileList"
|
||||
name="file"
|
||||
@remove="handleFileRemove"
|
||||
:before-upload="beforeUpload"
|
||||
@change="handleChange">
|
||||
<p class="ant-upload-drag-icon">
|
||||
<inbox-outlined></inbox-outlined>
|
||||
</p>
|
||||
<p class="ant-upload-hint">1.仅支持pdf格式文件或文件夹</p>
|
||||
<p class="ant-upload-hint">2.文件名命名规则为【能源种类_年份】</p>
|
||||
<p class="ant-upload-hint">3.每次上传自动覆盖</p>
|
||||
</a-upload-dragger>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onCloseEditData">取消</a-button>
|
||||
<a-button type="primary" @click="submitEditData">确定</a-button>
|
||||
@@ -352,6 +372,7 @@
|
||||
PlusCircleOutlined,
|
||||
MinusCircleOutlined,
|
||||
UploadOutlined,
|
||||
InboxOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { voucherColumns, drawerColumns } from '../config';
|
||||
@@ -388,8 +409,8 @@
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
const fetch = (api, params = { orgId: orgId.value }) => {
|
||||
return http.post(api, params);
|
||||
const fetch = (api, params = { orgId: orgId.value }, config) => {
|
||||
return http.post(api, params, config);
|
||||
};
|
||||
// 左侧树结构
|
||||
const x = 3;
|
||||
@@ -867,15 +888,17 @@
|
||||
selectedRowKeys.value.forEach((item) => {
|
||||
deleteIds.value.append('ids', item);
|
||||
});
|
||||
fetch(uploadPic.downloadZip, deleteIds.value)
|
||||
const config = {
|
||||
responseType: 'blob',
|
||||
};
|
||||
fetch(uploadPic.downloadZip, deleteIds.value, config)
|
||||
.then((res) => {
|
||||
// 创建一个 URL 对象,指向图片数据的 blob
|
||||
const url = window.URL.createObjectURL(new Blob([res.data]));
|
||||
const url = window.URL.createObjectURL(new Blob([res]));
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
debugger;
|
||||
link.setAttribute('download', ''); // 设置下载的文件名
|
||||
link.setAttribute('download', '碳盘查凭证.zip'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
@@ -912,10 +935,11 @@
|
||||
const queryData = ref({
|
||||
orgId: orgId.value,
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
pageSize: 10,
|
||||
});
|
||||
const edit = (record) => {
|
||||
getDictList();
|
||||
// queryData.value.emissionSources = record.emissionFactors;
|
||||
getNewTable();
|
||||
editFormState.value.id = record.id;
|
||||
editFormState.value.dataSources = record.dataSources;
|
||||
@@ -1064,8 +1088,8 @@
|
||||
};
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number, size: number) => {
|
||||
queryParams.value.pageNum = pageNumber;
|
||||
queryParams.value.pageSize = size;
|
||||
queryData.value.pageNum = pageNumber;
|
||||
queryData.value.pageSize = size;
|
||||
getNewTable();
|
||||
};
|
||||
// 点击切换排放统计/碳排流向
|
||||
@@ -1511,6 +1535,7 @@
|
||||
background-color: @white;
|
||||
border-radius: @ns-border-radius;
|
||||
box-shadow: @ns-content-box-shadow;
|
||||
position: relative;
|
||||
:deep(.ant-tabs-content-holder) {
|
||||
padding: 20px;
|
||||
}
|
||||
@@ -1570,4 +1595,8 @@
|
||||
margin-left: 10%;
|
||||
flex-direction: column;
|
||||
}
|
||||
:deep(.ant-upload.ant-upload-drag) {
|
||||
height: 18vh;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user