修改测试问题
This commit is contained in:
BIN
hx-ai-intelligent/public/asset/file/carbonAssets.xlsx
Normal file
BIN
hx-ai-intelligent/public/asset/file/carbonAssets.xlsx
Normal file
Binary file not shown.
@@ -48,68 +48,27 @@
|
||||
</div>
|
||||
<div style="display: flex; margin-top: 20px; height: calc(84% - 20px)">
|
||||
<div class="detailTable">
|
||||
<div class="ns-form-title">
|
||||
<div class="title">交易明细</div>
|
||||
<div class="operation" style="display: flex">
|
||||
<a-button type="primary" @click="addDetail">新增</a-button>
|
||||
<a-upload
|
||||
v-model:file-list="importFileList"
|
||||
name="file"
|
||||
accept=".xlsx"
|
||||
:showUploadList="false"
|
||||
:custom-request="importFile">
|
||||
<a-button type="primary" style="margin-left: 6px">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" style="margin-left: 6px" @click="exportFile">导出</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
style="margin-left: 6px"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
@click="deleteMore"
|
||||
>批量删除</a-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
rowKey="id"
|
||||
@change="onChange"
|
||||
:rowSelection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: onSelectionChange,
|
||||
}"
|
||||
:scroll="{ x: 1500, y: 400 }"
|
||||
:pagination="false">
|
||||
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000 }">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.dataIndex === 'accountType'">
|
||||
<span v-if="record.accountType">{{ record.accountType.label }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<span>
|
||||
<a @click="editData(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="delData(record)">删除</a>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-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" />
|
||||
</ns-view-list-table>
|
||||
</div>
|
||||
<div class="total">
|
||||
<div class="ns-form-title">
|
||||
<div class="title">配额统计</div>
|
||||
<div class="operation" style="display: flex; justify-content: space-around; width: 63%">
|
||||
<a-button type="primary" @click="getTotalTable(1)">全国配额</a-button>
|
||||
<a-button type="primary" @click="getTotalTable(2)">地方配额</a-button>
|
||||
<a-button type="primary" @click="getTotalTable(3)">CCER配额</a-button>
|
||||
<div class="operation" style="display: flex; justify-content: flex-end; width: 63%">
|
||||
<a-button type="primary" v-if="parentId === 1" @click="getTotalTable(1)"
|
||||
>全国配额</a-button
|
||||
>
|
||||
<a-button type="primary" v-if="parentId === 2" @click="getTotalTable(2)"
|
||||
>地方配额</a-button
|
||||
>
|
||||
<a-button type="primary" v-if="parentId === 3" @click="getTotalTable(3)"
|
||||
>CCER配额</a-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<a-table :columns="totalColumns" :data-source="totalData" bordered :pagination="false">
|
||||
@@ -155,13 +114,25 @@
|
||||
<a-date-picker v-model:value="formState.transactionDate" valueFormat="YYYY-MM-DD" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="交易数量" name="transactionQuantity">
|
||||
<a-input v-model:value="formState.transactionQuantity" placeholder="请输入交易数量" />
|
||||
<a-input-number
|
||||
v-model:value="formState.transactionQuantity"
|
||||
:maxlength="11"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入交易数量" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="发生金额" name="amountIncurred">
|
||||
<a-input v-model:value="formState.amountIncurred" placeholder="请输入发生金额" />
|
||||
<a-input-number
|
||||
v-model:value="formState.amountIncurred"
|
||||
:maxlength="16"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入发生金额" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="交易对象" name="tradingPartner">
|
||||
<a-input v-model:value="formState.tradingPartner" placeholder="请输入交易对象" />
|
||||
<a-input
|
||||
v-model:value="formState.tradingPartner"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入交易对象" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="交易凭证">
|
||||
<a-upload
|
||||
@@ -221,16 +192,20 @@
|
||||
selectedRowKeys.value = selectedKeys;
|
||||
};
|
||||
const total = ref<number>();
|
||||
const thisYear = ref(new Date().getFullYear().toString());
|
||||
const year = ref(new Date().getFullYear().toString());
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orgId: orgId.value,
|
||||
accountType: props.parentId,
|
||||
year: thisYear.value,
|
||||
year: year.value,
|
||||
});
|
||||
const searchTableList = () => {
|
||||
getDetailList();
|
||||
year.value = queryParams.value.year;
|
||||
transactionType.value = queryParams.value.transactionType;
|
||||
accountType.value = queryParams.value.accountType;
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
// getDetailList();
|
||||
};
|
||||
// 获取左侧列表数据
|
||||
const getDetailList = () => {
|
||||
@@ -239,10 +214,11 @@
|
||||
total.value = res.data.total;
|
||||
});
|
||||
};
|
||||
getDetailList();
|
||||
// getDetailList();
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
@@ -298,9 +274,14 @@
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orgId: orgId.value,
|
||||
year: new Date().getFullYear(),
|
||||
accountType: props.parentId,
|
||||
year: new Date().getFullYear().toString(),
|
||||
};
|
||||
getDetailList();
|
||||
accountType.value = props.parentId;
|
||||
year.value = new Date().getFullYear();
|
||||
transactionType.value = '';
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
// getDetailList();
|
||||
};
|
||||
const editData = (record) => {
|
||||
getDictList();
|
||||
@@ -378,6 +359,196 @@
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const mainRef = ref();
|
||||
const transactionType = ref();
|
||||
const accountType = ref();
|
||||
accountType.value = props.parentId;
|
||||
const tableConfig = ref({
|
||||
title: '数据库',
|
||||
api: carbonAssets.carbonDetailsList,
|
||||
params: {
|
||||
orgId,
|
||||
accountType,
|
||||
year,
|
||||
},
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'userAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
text.value = '新增';
|
||||
visible.value = true;
|
||||
getDictList();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '导入',
|
||||
type: 'primary',
|
||||
name: 'carbonAssetsImport',
|
||||
extra: {
|
||||
api: carbonAssets.import, // 导入接口名
|
||||
params: {
|
||||
orgId,
|
||||
},
|
||||
title: '碳资产', // 弹窗title
|
||||
templateName: 'carbonAssets', // 所使用的文件名称
|
||||
indexName: '碳资产', // 匹配类型字段
|
||||
message: [
|
||||
{ label: '1、若必填项未填写,则不能进行导入操作' },
|
||||
{ label: `2、当重复时,则更新数据。` },
|
||||
{ label: '3、数据将从模版的第五行进行导入。' },
|
||||
{ label: '4、文件导入勿超过5MB。' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
const exportQuery = ref({
|
||||
orgId: orgId.value,
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
year: queryParams.value.year,
|
||||
ids: selectedRowKeys.value,
|
||||
});
|
||||
const config = {
|
||||
responseType: 'blob',
|
||||
};
|
||||
fetch(carbonAssets.export, exportQuery.value, 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', 'carbonTradeDetails.xlsx'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 清理 URL 对象
|
||||
window.URL.revokeObjectURL(url);
|
||||
selectedRowKeys.value = [];
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('下载失败:', error);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '批量删除',
|
||||
type: 'primary',
|
||||
name: 'userBatchDel',
|
||||
dynamicDisabled: (data: any) => {
|
||||
return data.list.length === 0;
|
||||
},
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
isClearCheck: true,
|
||||
api: carbonAssets.delete,
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '资产类别',
|
||||
dataIndex: 'accountType',
|
||||
},
|
||||
{
|
||||
title: '交易方式',
|
||||
dataIndex: 'transactionTypeName',
|
||||
},
|
||||
{
|
||||
title: '交易日期',
|
||||
dataIndex: 'transactionDate',
|
||||
sorter: (a, b) => a.transactionDate - b.transactionDate,
|
||||
},
|
||||
{
|
||||
title: '本期收入(tCO2)',
|
||||
dataIndex: 'income',
|
||||
sorter: (a, b) => a.income - b.income,
|
||||
},
|
||||
{
|
||||
title: '本期支出(tCO2)',
|
||||
dataIndex: 'expenditure',
|
||||
sorter: (a, b) => a.expenditure - b.expenditure,
|
||||
},
|
||||
{
|
||||
title: '发生金额(¥)',
|
||||
dataIndex: 'amountIncurredValue',
|
||||
},
|
||||
{
|
||||
title: '交易对象',
|
||||
dataIndex: 'tradingPartner',
|
||||
},
|
||||
{
|
||||
title: '更新人',
|
||||
dataIndex: 'updateUser',
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
dataIndex: 'updateTime',
|
||||
},
|
||||
],
|
||||
columnActions: {
|
||||
title: '操作',
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'userEdit',
|
||||
handle: (record: any) => {
|
||||
getDictList();
|
||||
text.value = '编辑';
|
||||
visible.value = true;
|
||||
formState.value.id = record.id;
|
||||
fetch(uploadPic.select, { bizId: record.id, bizType: 1 }).then((res) => {
|
||||
fileList.value = res.data.map((item) => ({
|
||||
uid: item.id.toString(), // 使用文件的id作为唯一标识
|
||||
name: item.fileName, // 文件名
|
||||
status: 'done', // 设置默认状态为已完成
|
||||
type: 'done',
|
||||
url: item.filePath, // 文件的URL,这里假设用示例的URL格式
|
||||
}));
|
||||
});
|
||||
formState.value = JSON.parse(JSON.stringify(record));
|
||||
if (formState.value.expenditure === 0) {
|
||||
formState.value.transactionQuantity = formState.value.income;
|
||||
} else {
|
||||
formState.value.transactionQuantity = formState.value.expenditure;
|
||||
}
|
||||
setTimeout(() => {
|
||||
let selectDevice = ref([Number(formState.value.transactionType)]);
|
||||
findParentIds(options.value, formState.value.transactionType, selectDevice.value);
|
||||
formState.value.transactionType = selectDevice;
|
||||
formState.value.transactionType = formState.value.transactionType;
|
||||
}, 500);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
name: 'userDelete',
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
api: carbonAssets.delete,
|
||||
},
|
||||
],
|
||||
},
|
||||
formConfig: {
|
||||
schemas: [],
|
||||
params: {},
|
||||
},
|
||||
rowKey: 'id',
|
||||
});
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number, size: number) => {
|
||||
queryParams.value.pageNum = pageNumber;
|
||||
@@ -492,6 +663,12 @@
|
||||
});
|
||||
fileList.value = newFileList;
|
||||
};
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
// Check if the pressed key is a space
|
||||
if (event.code === 'Space') {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
@@ -625,7 +802,7 @@
|
||||
height: 16%;
|
||||
}
|
||||
.detailTable {
|
||||
width: 65%;
|
||||
width: 70%;
|
||||
margin-right: 20px;
|
||||
height: 100%;
|
||||
background: white;
|
||||
@@ -633,10 +810,27 @@
|
||||
padding: 16px;
|
||||
}
|
||||
.total {
|
||||
width: calc(35% - 20px);
|
||||
width: calc(30% - 20px);
|
||||
height: 100%;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
}
|
||||
:deep(.ns-table-search) {
|
||||
display: none;
|
||||
}
|
||||
:deep(.ns-table-header) {
|
||||
padding-top: unset !important;
|
||||
align-items: unset !important;
|
||||
padding-bottom: 10px;
|
||||
height: unset !important;
|
||||
}
|
||||
:deep(.ns-basic-table) {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
:deep(.ns-table-main) {
|
||||
padding: unset !important;
|
||||
margin: unset !important;
|
||||
border-radius: unset !important;
|
||||
}
|
||||
</style>
|
||||
|
@@ -48,8 +48,60 @@
|
||||
</div>
|
||||
<div style="display: flex; margin-top: 20px; height: calc(84% - 20px)">
|
||||
<div class="detailTable">
|
||||
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000 }">
|
||||
</ns-view-list-table>
|
||||
<div class="ns-form-title">
|
||||
<div class="title">交易明细</div>
|
||||
<div class="operation" style="display: flex">
|
||||
<a-button type="primary" @click="addDetail">新增</a-button>
|
||||
<a-upload
|
||||
v-model:file-list="importFileList"
|
||||
name="file"
|
||||
accept=".xlsx"
|
||||
:showUploadList="false"
|
||||
:custom-request="importFile">
|
||||
<a-button type="primary" style="margin-left: 6px">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" style="margin-left: 6px" @click="exportFile">导出</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
style="margin-left: 6px"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
@click="deleteMore"
|
||||
>批量删除</a-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
rowKey="id"
|
||||
@change="onChange"
|
||||
:rowSelection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: onSelectionChange,
|
||||
}"
|
||||
:scroll="{ x: 1500, y: 400 }"
|
||||
:pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.dataIndex === 'accountType'">
|
||||
<span v-if="record.accountType">{{ record.accountType.label }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<span>
|
||||
<a @click="editData(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="delData(record)">删除</a>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-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" />
|
||||
</div>
|
||||
<div class="total">
|
||||
<div class="ns-form-title">
|
||||
@@ -187,7 +239,7 @@
|
||||
total.value = res.data.total;
|
||||
});
|
||||
};
|
||||
// getDetailList();
|
||||
getDetailList();
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -326,129 +378,6 @@
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const mainRef = ref();
|
||||
const tableConfig = ref({
|
||||
title: '数据库',
|
||||
api: carbonAssets.carbonDetailsList,
|
||||
params: {
|
||||
orgId,
|
||||
},
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'userAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '导入',
|
||||
type: 'primary',
|
||||
name: 'carbonEmissionFactorLibraryImport',
|
||||
extra: {
|
||||
api: carbonEmissionFactorLibrary.import, // 导入接口名
|
||||
params: {
|
||||
orgId,
|
||||
},
|
||||
title: '排放源', // 弹窗title
|
||||
templateName: 'emissionSource', // 所使用的文件名称
|
||||
indexName: '设备id', // 匹配类型字段
|
||||
message: [
|
||||
{ label: '1、若必填项未填写,则不能进行导入操作' },
|
||||
{ label: `2、当重复时,则更新数据。` },
|
||||
{ label: '3、数据将从模版的第五行进行导入。' },
|
||||
{ label: '4、文件导入勿超过5MB。' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '批量删除',
|
||||
type: 'primary',
|
||||
name: 'userBatchDel',
|
||||
dynamicDisabled: (data: any) => {
|
||||
return data.list.length === 0;
|
||||
},
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
isClearCheck: true,
|
||||
api: carbonEmissionFactorLibrary.del,
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '资产类别',
|
||||
dataIndex: 'accountType',
|
||||
},
|
||||
{
|
||||
title: '交易方式',
|
||||
dataIndex: 'transactionTypeName',
|
||||
},
|
||||
{
|
||||
title: '交易日期',
|
||||
dataIndex: 'transactionDate',
|
||||
sorter: (a, b) => a.transactionDate - b.transactionDate,
|
||||
},
|
||||
{
|
||||
title: '本期收入(tCO2)',
|
||||
dataIndex: 'income',
|
||||
sorter: (a, b) => a.income - b.income,
|
||||
},
|
||||
{
|
||||
title: '本期支出(tCO2)',
|
||||
dataIndex: 'expenditure',
|
||||
sorter: (a, b) => a.expenditure - b.expenditure,
|
||||
},
|
||||
{
|
||||
title: '发生金额(¥)',
|
||||
dataIndex: 'amountIncurredValue',
|
||||
},
|
||||
{
|
||||
title: '交易对象',
|
||||
dataIndex: 'tradingPartner',
|
||||
},
|
||||
{
|
||||
title: '更新人',
|
||||
dataIndex: 'updateUser',
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
dataIndex: 'updateTime',
|
||||
},
|
||||
],
|
||||
columnActions: {
|
||||
title: '操作',
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'userEdit',
|
||||
handle: (record: any) => {},
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
name: 'userDelete',
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
api: carbonEmissionFactorLibrary.del,
|
||||
},
|
||||
],
|
||||
},
|
||||
rowKey: 'id',
|
||||
});
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number, size: number) => {
|
||||
queryParams.value.pageNum = pageNumber;
|
@@ -15,7 +15,7 @@ export const formConfig = (disabled) => {
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入排放源',
|
||||
maxLength: 20,
|
||||
maxLength: 5,
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
@@ -92,7 +92,7 @@ export const formConfig = (disabled) => {
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入排放环节',
|
||||
maxLength: 20,
|
||||
maxLength: 5,
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
@@ -107,7 +107,7 @@ export const formConfig = (disabled) => {
|
||||
component: 'NsInputNumber',
|
||||
componentProps: {
|
||||
placeholder: '请输入排放因子值',
|
||||
maxLength: 20,
|
||||
maxLength: 5,
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
@@ -154,7 +154,7 @@ export const formConfig = (disabled) => {
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入碳排后缀',
|
||||
maxLength: 20,
|
||||
maxLength: 10,
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
|
@@ -27,6 +27,7 @@
|
||||
:tree-data="gData"
|
||||
:checkedKeys="checkedTreeNodeKeys"
|
||||
:selectedKeys="selectedKeys"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
@dragenter="onDragEnter"
|
||||
@drop="onDrop"
|
||||
@check="checkTreeNode"
|
||||
@@ -164,6 +165,7 @@
|
||||
:expanded-keys="unitExpandedKeys"
|
||||
:selectedKeys="unitSelectedKeys"
|
||||
:tree-data="unitTreeData"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
v-if="unitTreeData && unitTreeData.length > 0"
|
||||
class="draggable-tree"
|
||||
block-node>
|
||||
@@ -198,7 +200,11 @@
|
||||
</template>
|
||||
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="分组名称" name="cnValue" :required="true">
|
||||
<a-input v-model:value="formState.cnValue" placeholder="请输入分组名称" />
|
||||
<a-input
|
||||
v-model:value="formState.cnValue"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入分组名称" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ns-modal>
|
||||
@@ -211,7 +217,11 @@
|
||||
</template>
|
||||
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="单位名称" name="cnValue" :required="true">
|
||||
<a-input v-model:value="formState.cnValue" placeholder="请输入单位名称" />
|
||||
<a-input
|
||||
v-model:value="formState.cnValue"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入单位名称" />
|
||||
</a-form-item>
|
||||
<a-form-item label="选择分组" name="parentId" :required="true">
|
||||
<a-select
|
||||
@@ -866,7 +876,7 @@
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入排放源',
|
||||
maxLength: 30,
|
||||
maxLength: 20,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -930,7 +940,7 @@
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入文献关键字',
|
||||
maxLength: 30,
|
||||
maxLength: 20,
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -1040,6 +1050,12 @@
|
||||
grpDesc: '计量单位',
|
||||
};
|
||||
};
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
// Check if the pressed key is a space
|
||||
if (event.code === 'Space') {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
const unitOrGroupOk = () => {
|
||||
unitFormRef.value
|
||||
.validate()
|
||||
|
@@ -76,7 +76,7 @@ export const tableColumns = [
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 130
|
||||
width: 130,
|
||||
},
|
||||
];
|
||||
// 碳排速算表表头
|
||||
@@ -119,7 +119,7 @@ export const columns = [
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 130
|
||||
width: 130,
|
||||
},
|
||||
];
|
||||
// 碳排速算新增页中表头
|
||||
@@ -131,6 +131,7 @@ export const drawerColumns = [
|
||||
{
|
||||
title: '因子值',
|
||||
dataIndex: 'emissionFactors',
|
||||
key: 'emissionFactors',
|
||||
},
|
||||
{
|
||||
title: '排放环节',
|
||||
@@ -142,4 +143,4 @@ export const drawerColumns = [
|
||||
className: 'dataSources',
|
||||
dataIndex: 'dataSources',
|
||||
},
|
||||
];
|
||||
];
|
||||
|
@@ -22,7 +22,11 @@
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-form-item ref="name" label="能耗名称" name="energyType">
|
||||
<a-input v-model:value="formState.energyType" placeholder="请输入能源种类" />
|
||||
<a-input
|
||||
v-model:value="formState.energyType"
|
||||
@keydown="handleKeyDown"
|
||||
:maxlength="10"
|
||||
placeholder="请输入能源种类" />
|
||||
</a-form-item>
|
||||
<a-form-item label="计量单位" name="unit">
|
||||
<a-cascader v-model:value="formState.unit" :options="measurementUnit" />
|
||||
@@ -250,6 +254,12 @@
|
||||
isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }],
|
||||
unit: [{ required: true, message: '请选择计量单位', trigger: 'change' }],
|
||||
};
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
// Check if the pressed key is a space
|
||||
if (event.code === 'Space') {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
// 排放类型的变量
|
||||
const emissionTypeDic = ref();
|
||||
// 计量单位的变量
|
||||
@@ -259,15 +269,15 @@
|
||||
// 年份选择改变触发
|
||||
const changeYearData = () => {
|
||||
queryParams.value.year = selectYear.value;
|
||||
getTableList();
|
||||
// getTableList();
|
||||
};
|
||||
const mainRef = ref();
|
||||
const year = selectYear.value.format('YYYY');
|
||||
const tableConfig = ref({
|
||||
title: '能耗统计',
|
||||
api: energyConsumption.pageList,
|
||||
rowSelection: null,
|
||||
params: queryParams.value,
|
||||
rowSelection: null,
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
@@ -690,10 +700,10 @@
|
||||
field: 'year',
|
||||
label: '年份',
|
||||
component: 'NsDatePicker',
|
||||
defaultValue: selectYear.value.format('YYYY'),
|
||||
componentProps: {
|
||||
picker: 'year',
|
||||
valueFormat: 'YYYY',
|
||||
defaultValue: selectYear.value.format('YYYY'),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@@ -130,6 +130,11 @@
|
||||
type: 'radio',
|
||||
}"
|
||||
:pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.key === 'emissionFactors'">
|
||||
<span>{{ record.emissionFactors + record.emissionFactorUnits }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
||||
|
@@ -29,6 +29,7 @@ export const drawerColumns = [
|
||||
{
|
||||
title: '因子值',
|
||||
dataIndex: 'emissionFactors',
|
||||
key: 'emissionFactors',
|
||||
},
|
||||
{
|
||||
title: '排放环节',
|
||||
|
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; height: 100%">
|
||||
<div style="display: flex; height: 90%">
|
||||
<div class="left">
|
||||
<div class="top">
|
||||
<a-form style="width: 100%; margin: 0 auto">
|
||||
@@ -57,6 +57,7 @@
|
||||
:selectedKeys="selectedKeysL"
|
||||
:auto-expand-parent="autoExpandParent"
|
||||
:tree-data="gData"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
v-if="gData && gData.length > 0"
|
||||
:height="233"
|
||||
show-line
|
||||
@@ -95,6 +96,7 @@
|
||||
:expandedKeys="expandedKeysR"
|
||||
:selectedKeys="selectedKeysR"
|
||||
:checkedKeys="checkedKeys"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
:tree-data="treeData"
|
||||
@select="onSelectR"
|
||||
block-node>
|
||||
@@ -106,16 +108,20 @@
|
||||
<div class="actionMore">
|
||||
<EditOutlined @click="editUnit(data)" />
|
||||
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" />
|
||||
<PlusCircleOutlined
|
||||
v-if="data.emissionSource === '全部'"
|
||||
style="margin-left: 6px"
|
||||
@click="addTreeNodeData" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-tree>
|
||||
<a-empty v-else />
|
||||
<div class="addTreeNode">
|
||||
<!-- <div class="addTreeNode">
|
||||
<a-button type="primary" style="width: 100%" @click="addTreeNodeData">
|
||||
新增
|
||||
</a-button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="mainRight">
|
||||
<a-table
|
||||
@@ -125,7 +131,7 @@
|
||||
:pagination="false"
|
||||
bordered
|
||||
size="middle"
|
||||
:scroll="{ y: 500 }">
|
||||
:scroll="{ y: 380 }">
|
||||
<template #title>
|
||||
<a-button type="primary" @click="downLoadVoucher">凭证</a-button>
|
||||
</template>
|
||||
@@ -162,7 +168,7 @@
|
||||
<a-empty v-else />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="碳排流向">
|
||||
<div v-if="showChart" ref="tplxChart" style="width: 100%; height: 68vh"></div>
|
||||
<div v-if="showChart" ref="tplxChart" style="width: 100%; height: 100%"></div>
|
||||
<a-empty v-else />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
@@ -193,6 +199,7 @@
|
||||
:selectedKeys="categorySelectedKeys"
|
||||
:checkedKeys="categoryCheckedKeys"
|
||||
:tree-data="categoryTreeData"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
v-if="categoryTreeData && categoryTreeData.length > 0"
|
||||
class="draggable-tree"
|
||||
@check="checkTreeNode"
|
||||
@@ -230,7 +237,11 @@
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-form-item ref="name" label="排放源" name="emissionSource">
|
||||
<a-input v-model:value="formState.emissionSource" placeholder="请输入排放源" />
|
||||
<a-input
|
||||
v-model:value="formState.emissionSource"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入排放源" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="计量单位" name="unitId">
|
||||
<a-cascader v-model:value="formState.unitId" :options="measurementUnit" />
|
||||
@@ -317,7 +328,11 @@
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="消耗量" name="consumption">
|
||||
<ns-input v-model:value="editFormState.consumption" :disabled="canEdit" />
|
||||
<ns-input
|
||||
v-model:value="editFormState.consumption"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
:disabled="canEdit" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -351,7 +366,10 @@
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="因子值" name="emissionFactors">
|
||||
<ns-input v-model:value="editFormState.emissionFactors" />
|
||||
<ns-input
|
||||
v-model:value="editFormState.emissionFactors"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@@ -381,6 +399,11 @@
|
||||
type: 'radio',
|
||||
}"
|
||||
:pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.key === 'emissionFactors'">
|
||||
<span>{{ record.emissionFactors + record.emissionFactorUnits }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<a-pagination
|
||||
:current="queryData.pageNum"
|
||||
@@ -603,9 +626,10 @@
|
||||
fetch(carbonInventoryCheck.getInventoryTree, { categoryId: categoryId.value }).then((res) => {
|
||||
treeData.value = res.data;
|
||||
if (changeSelectedKeys.value) {
|
||||
selectedKeysR.value = [`0-${treeData.value.length - 1}`];
|
||||
selectedKeysR.value = [`0-0-${treeData.value[0].children.length - 1}`];
|
||||
changeSelectedKeys.value = false;
|
||||
getTableId.value = res.data[res.data.length - 1].id;
|
||||
getTableId.value = res.data[0].children[res.data[0].children.length - 1].id;
|
||||
bizId.value = res.data[0].children[res.data[0].children.length - 1].id;
|
||||
if (res.data.length != 0) {
|
||||
getPFYTableList(getTableId.value);
|
||||
getTableHeardUnit(getTableId.value);
|
||||
@@ -616,8 +640,9 @@
|
||||
columns.value[3].title = '排放量';
|
||||
}
|
||||
} else {
|
||||
selectedKeysR.value = ['0-0'];
|
||||
getTableId.value = res.data[0].id;
|
||||
selectedKeysR.value = ['0-0-0'];
|
||||
getTableId.value = res.data[0].children[0].id;
|
||||
bizId.value = res.data[0].children[0].id;
|
||||
if (res.data.length != 0) {
|
||||
getPFYTableList(getTableId.value);
|
||||
getTableHeardUnit(getTableId.value);
|
||||
@@ -634,6 +659,7 @@
|
||||
const onSelectR = (selectedKey: string[], info: any) => {
|
||||
selectedKeysR.value = selectedKey;
|
||||
getTableId.value = info.selectedNodes[0].id;
|
||||
bizId.value = info.selectedNodes[0].id;
|
||||
getPFYTableList(getTableId.value);
|
||||
getTableHeardUnit(getTableId.value);
|
||||
};
|
||||
@@ -647,8 +673,8 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
const expandedKeysR = ref<string[]>([]);
|
||||
const selectedKeysR = ref<string[]>(['0-0']);
|
||||
const expandedKeysR = ref<string[]>(['0-0']);
|
||||
const selectedKeysR = ref<string[]>(['0-0-0']);
|
||||
const checkedKeys = ref<string[]>([]);
|
||||
watch(expandedKeysR, () => {
|
||||
console.log('expandedKeysR', expandedKeysR);
|
||||
@@ -778,6 +804,12 @@
|
||||
groupData.value = res.data;
|
||||
});
|
||||
};
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
// Check if the pressed key is a space
|
||||
if (event.code === 'Space') {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
@@ -945,10 +977,13 @@
|
||||
};
|
||||
// 点击凭证弹出框
|
||||
const openVoucher = ref(false);
|
||||
const bizId = ref();
|
||||
const downLoadVoucher = () => {
|
||||
fetch(carbonInventoryCheck.voucherDownloadList, { bizType: 2 }).then((res) => {
|
||||
voucherData.value = res.data;
|
||||
});
|
||||
fetch(carbonInventoryCheck.voucherDownloadList, { bizType: 2, bizId: bizId.value }).then(
|
||||
(res) => {
|
||||
voucherData.value = res.data;
|
||||
},
|
||||
);
|
||||
openVoucher.value = true;
|
||||
};
|
||||
const selectedRowKeys = ref([]);
|
||||
@@ -1061,6 +1096,7 @@
|
||||
canEdit.value = true;
|
||||
automatic.value = true;
|
||||
} else {
|
||||
canEdit.value = false;
|
||||
automatic.value = false;
|
||||
}
|
||||
};
|
||||
@@ -1220,6 +1256,8 @@
|
||||
reportId: props.reportId,
|
||||
year: props.year,
|
||||
categoryId: categoryId.value,
|
||||
startTime: props.startTime,
|
||||
endTime: props.endTime,
|
||||
});
|
||||
const linksData = ref([]);
|
||||
const datalist = ref([]);
|
||||
@@ -1243,6 +1281,8 @@
|
||||
reportId: props.reportId,
|
||||
year: props.year,
|
||||
categoryId: categoryId.value,
|
||||
startTime: props.startTime,
|
||||
endTime: props.endTime,
|
||||
});
|
||||
const tableHeader = ref([]);
|
||||
const getEmissionStatistic = () => {
|
||||
@@ -1556,7 +1596,7 @@
|
||||
width: 300px;
|
||||
margin-right: @ns-gap;
|
||||
min-width: fit-content;
|
||||
height: 93%;
|
||||
height: 100%;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
|
||||
@@ -1645,7 +1685,7 @@
|
||||
.right {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 93%;
|
||||
height: 100%;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
|
||||
|
@@ -20,7 +20,9 @@
|
||||
:footer-style="{ textAlign: 'right' }"
|
||||
destroyOnClose
|
||||
@close="onClose">
|
||||
<div class="ns-form-title"><div class="title">{{text}}</div></div>
|
||||
<div class="ns-form-title"
|
||||
><div class="title">{{ text }}</div></div
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formState"
|
||||
@@ -28,13 +30,21 @@
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-form-item ref="name" label="报告名称" name="reportName">
|
||||
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" />
|
||||
<a-input
|
||||
v-model:value="formState.reportName"
|
||||
:maxlength="15"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入报告名称" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="报告年度" name="reportYear">
|
||||
<a-date-picker v-model:value="formState.reportYear" picker="year" valueFormat="YYYY" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="适用标准" name="genericStandard">
|
||||
<a-input v-model:value="formState.genericStandard" placeholder="请输入适用标准" />
|
||||
<a-input
|
||||
v-model:value="formState.genericStandard"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
placeholder="请输入适用标准" />
|
||||
</a-form-item>
|
||||
<a-form-item label="报告周期" name="reportPeriod">
|
||||
<a-select
|
||||
@@ -81,7 +91,7 @@
|
||||
const formRef = ref();
|
||||
const labelCol = { span: 4 };
|
||||
const wrapperCol = { span: 20 };
|
||||
const text = ref('新增报告')
|
||||
const text = ref('新增报告');
|
||||
const disabledDate = (current: moment.Moment | null) => {
|
||||
if (formState.value.reportPeriod === '2') {
|
||||
const year = current.year();
|
||||
@@ -105,6 +115,12 @@
|
||||
formState.value = {};
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
// Check if the pressed key is a space
|
||||
if (event.code === 'Space') {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
// 点击确定提交
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
@@ -142,7 +158,7 @@
|
||||
name: 'userAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
text.value = '新增报告'
|
||||
text.value = '新增报告';
|
||||
visible.value = true;
|
||||
},
|
||||
},
|
||||
@@ -186,7 +202,7 @@
|
||||
label: '编辑',
|
||||
name: 'userEdit',
|
||||
handle: (record: any) => {
|
||||
text.value = '编辑报告'
|
||||
text.value = '编辑报告';
|
||||
visible.value = true;
|
||||
fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => {
|
||||
formState.value = res.data;
|
||||
@@ -252,7 +268,7 @@
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入报告名称',
|
||||
maxLength: 30,
|
||||
maxLength: 20,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@@ -15,7 +15,13 @@
|
||||
margin-bottom: 1%;
|
||||
">
|
||||
<div>
|
||||
<a-button v-if="selectedTime" type="primary" @click="changeYear(-1)">上一年</a-button>
|
||||
<a-button
|
||||
v-if="selectedTime"
|
||||
type="primary"
|
||||
style="border-radius: 5px 0 0 5px; border-right: none"
|
||||
@click="changeYear(-1)"
|
||||
>上一年</a-button
|
||||
>
|
||||
<a-date-picker
|
||||
v-if="selectedTime"
|
||||
valueFormat="YYYY"
|
||||
@@ -23,7 +29,13 @@
|
||||
v-model:value="selectYear"
|
||||
@change="changeYear"
|
||||
picker="year" />
|
||||
<a-button v-if="selectedTime" type="primary" @click="changeYear(1)">下一年</a-button>
|
||||
<a-button
|
||||
v-if="selectedTime"
|
||||
type="primary"
|
||||
style="border-radius: 0 5px 5px 0; border-left: none"
|
||||
@click="changeYear(1)"
|
||||
>下一年</a-button
|
||||
>
|
||||
<a-date-picker
|
||||
v-else
|
||||
valueFormat="YYYY-MM"
|
||||
@@ -344,7 +356,6 @@
|
||||
border: 1px solid rgba(39, 120, 255, 1);
|
||||
}
|
||||
:deep(.ant-btn-primary) {
|
||||
border-radius: unset !important;
|
||||
border-color: #d7d7d7 !important;
|
||||
background: #f2f2f2 !important;
|
||||
color: black !important;
|
||||
|
@@ -102,17 +102,27 @@
|
||||
<!-- 批量设置 -->
|
||||
<a-modal :visible="open" title="批量设置" @ok="handleOk" @cancel="onCancel">
|
||||
<a-form ref="formRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="是否按去年折算">
|
||||
<a-form-item label="是否按去年折算" :required="true">
|
||||
<a-select ref="select" v-model:value="formState.isLastYear" @change="selectChange">
|
||||
<a-select-option :value="1">是</a-select-option>
|
||||
<a-select-option :value="0">否</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="折算率">
|
||||
<a-input v-model:value="formState.conversionRate" suffix="%" :disabled="disabled" />
|
||||
<a-form-item label="折算率" :required="true">
|
||||
<a-input-number
|
||||
v-model:value="formState.conversionRate"
|
||||
:maxlength="15"
|
||||
@keydown="handleKeyDown"
|
||||
suffix="%"
|
||||
:disabled="disabled" />
|
||||
</a-form-item>
|
||||
<a-form-item label="预算值">
|
||||
<a-input v-model:value="formState.budget" suffix="kWh" :disabled="!disabled" />
|
||||
<a-form-item label="预算值" :required="true">
|
||||
<a-input-number
|
||||
v-model:value="formState.budget"
|
||||
:maxlength="15"
|
||||
@keydown="handleKeyDown"
|
||||
suffix="kWh"
|
||||
:disabled="!disabled" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
@@ -336,6 +346,12 @@
|
||||
disabled.value = true;
|
||||
}
|
||||
};
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
// Check if the pressed key is a space
|
||||
if (event.code === 'Space') {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
const handleOk = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
@@ -710,6 +726,7 @@
|
||||
<style lang="less" scoped>
|
||||
.detailContant {
|
||||
height: 100%;
|
||||
margin: 12px;
|
||||
}
|
||||
.ns-form-title {
|
||||
font-weight: bold;
|
||||
@@ -855,6 +872,12 @@
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
:deep(
|
||||
.ant-form-item-label
|
||||
> label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before
|
||||
) {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.editable-row-operations a {
|
||||
|
@@ -1,39 +1,40 @@
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 5%;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1%;
|
||||
">
|
||||
<a-date-picker
|
||||
v-if="selectedTime"
|
||||
v-model:value="selectYearValue"
|
||||
:disabled-date="disabledDate"
|
||||
valueFormat="YYYY"
|
||||
@change="changeYear"
|
||||
picker="year" />
|
||||
<a-date-picker
|
||||
v-else
|
||||
v-model:value="selectMonthValue"
|
||||
valueFormat="YYYY-MM"
|
||||
@change="changeMonth"
|
||||
picker="month" />
|
||||
<div class="operation">
|
||||
<div class="month" :style="monthStyles" @click="changeToMonth">
|
||||
<span :style="monthText">本月</span>
|
||||
<div style="padding: 12px">
|
||||
<div class="ns-form-title">
|
||||
<div class="title">
|
||||
<span>统计数据</span>
|
||||
<a-button style="margin-left: 5%" type="primary" @click="addNode">新增节点</a-button>
|
||||
</div>
|
||||
<div class="year" :style="yearStyles" @click="changeToYear">
|
||||
<span :style="yearText">本年</span>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 5%;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
">
|
||||
<a-date-picker
|
||||
v-if="selectedTime"
|
||||
v-model:value="selectYearValue"
|
||||
:disabled-date="disabledDate"
|
||||
valueFormat="YYYY"
|
||||
@change="changeYear"
|
||||
picker="year" />
|
||||
<a-date-picker
|
||||
v-else
|
||||
v-model:value="selectMonthValue"
|
||||
valueFormat="YYYY-MM"
|
||||
@change="changeMonth"
|
||||
picker="month" />
|
||||
<div class="operation">
|
||||
<div class="month" :style="monthStyles" @click="changeToMonth">
|
||||
<span :style="monthText">本月</span>
|
||||
</div>
|
||||
<div class="year" :style="yearStyles" @click="changeToYear">
|
||||
<span :style="yearText">本年</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,6 +81,7 @@
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkedKeys="treeCheckedKeys"
|
||||
:tree-data="treeData"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
v-if="treeData && treeData.length > 0"
|
||||
class="draggable-tree"
|
||||
@check="checkTreeNode"
|
||||
@@ -206,6 +208,14 @@
|
||||
chartInstance = echarts.init(pillarChartRef.value);
|
||||
const option = {
|
||||
backgroundColor: 'transparent',
|
||||
title: {
|
||||
text: '历年用电量分析',
|
||||
x: '0',
|
||||
textStyle: {
|
||||
color: 'rgba(51, 51, 51, 1)',
|
||||
fontSize: '16',
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
@@ -217,14 +227,14 @@
|
||||
},
|
||||
grid: {
|
||||
left: '4%',
|
||||
top: '18%',
|
||||
right: '5%',
|
||||
top: '20%',
|
||||
right: '3%',
|
||||
bottom: '10%',
|
||||
},
|
||||
legend: {
|
||||
data: ['实际用量', '预算量', '基准线'],
|
||||
top: '0',
|
||||
left: '0',
|
||||
right: '3%', // 图例居右
|
||||
textStyle: {
|
||||
color: '#666',
|
||||
fontSize: 12,
|
||||
@@ -361,7 +371,7 @@
|
||||
type: 'liquidFill',
|
||||
radius: '78.1%',
|
||||
center: ['50%', '50%'],
|
||||
color: selectedTime.value
|
||||
color: !selectedTime.value
|
||||
? ['#ecf3fe', '#c8dcfe', '#5594fa']
|
||||
: ['rgba(12, 168, 126, 0.5)', 'rgba(12, 168, 126, 0.1)', 'rgba(12, 168, 126, 1)'],
|
||||
data: [ballData, ballData, ballData], // data个数代表波浪数
|
||||
@@ -374,7 +384,7 @@
|
||||
label: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
color: selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
|
||||
color: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
|
||||
insideColor: '#12786f',
|
||||
fontSize: 40,
|
||||
},
|
||||
@@ -390,7 +400,7 @@
|
||||
show: true,
|
||||
borderDistance: 5,
|
||||
itemStyle: {
|
||||
borderColor: selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
|
||||
borderColor: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
|
||||
borderWidth: 2,
|
||||
},
|
||||
},
|
||||
@@ -572,7 +582,6 @@
|
||||
<style lang="less" scoped>
|
||||
.totalContant {
|
||||
height: 100%;
|
||||
padding: 12px;
|
||||
}
|
||||
:deep(.ant-tabs-content) {
|
||||
padding: 16px;
|
||||
@@ -612,7 +621,6 @@
|
||||
}
|
||||
.operation {
|
||||
display: flex;
|
||||
margin-right: 10px;
|
||||
font-weight: 400;
|
||||
height: 90%;
|
||||
cursor: pointer;
|
||||
@@ -636,21 +644,29 @@
|
||||
width: 100%;
|
||||
height: calc(94% - 5vh);
|
||||
overflow-y: auto;
|
||||
padding: 12px;
|
||||
.chartsPart {
|
||||
width: 99%;
|
||||
height: 40%;
|
||||
width: 100%;
|
||||
height: 45%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.ballChart {
|
||||
width: 25%;
|
||||
width: 20%;
|
||||
margin-right: 12px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.pillarChart {
|
||||
width: calc(75% - 12px);
|
||||
width: calc(80% - 12px);
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
|
||||
border-radius: 8px;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
.tablePart {
|
||||
height: calc(60% - 20px);
|
||||
height: calc(55% - 20px);
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user