冲突的一个文件修改
@@ -59,4 +59,14 @@ export const getEnum = async ({
|
||||
}: dictHttpConfig) => {
|
||||
const res = await http.get(api, params);
|
||||
return Promise.resolve(res);
|
||||
};
|
||||
};
|
||||
/**
|
||||
* 获取谈规划单位(需传参,参数 enumType)
|
||||
*/
|
||||
export const getEnumEnergy = async ({
|
||||
api = `${BASE_URL}/operation/enum/getEnumEnergy`,
|
||||
params = {},
|
||||
}: dictHttpConfig) => {
|
||||
const res = await http.get(api, params);
|
||||
return Promise.resolve(res);
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ const prefix = '/carbon-smart/api';
|
||||
// 照明系统及相关接口
|
||||
export enum planManage {
|
||||
/**
|
||||
* @param deviceType 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
* @param deviceType 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||
*/
|
||||
// 获得未激活的计划
|
||||
getTransData = prefix + '/deviceCtrlPlan/getDeActivatedPlanList',
|
||||
|
||||
13
hx-ai-intelligent/src/api/waterSystem.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// 前缀
|
||||
const prefix = '/carbon-smart/api';
|
||||
// 通风系统相关接口
|
||||
export enum waterSys {
|
||||
// 获得污水池状态
|
||||
getPool1 = prefix + '/waterSysCtrl/getSewagePoolState',
|
||||
// 获得阀门状态
|
||||
getValve = prefix + '/waterSysCtrl/getValveState',
|
||||
// 获得集水池状态
|
||||
getPool2 = prefix + '/waterSysCtrl/getCollectPoolState',
|
||||
// 获得水泵状态
|
||||
getPump = prefix + '/waterSysCtrl/getPumpState',
|
||||
}
|
||||
@@ -157,6 +157,25 @@ const equipmentControl = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'coldAndHeatSources',
|
||||
name: 'coldAndHeatSources',
|
||||
meta: { title: '冷热源', hideChildren: true, icon: 'shebeiqunkong' },
|
||||
component: Base,
|
||||
redirect: { name: 'coldAndHeatSourcesIndex' },
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'coldAndHeatSourcesIndex',
|
||||
component: () => import('/@/view/equipmentControl/coldAndHeatSources/index.vue'),
|
||||
meta: {
|
||||
title: '冷热源',
|
||||
keepAlive: false,
|
||||
// backApi: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
export default equipmentControl;
|
||||
|
||||
220
hx-ai-intelligent/src/util/Export2Excel.js
Normal file
@@ -0,0 +1,220 @@
|
||||
/* eslint-disable */
|
||||
import { saveAs } from 'file-saver'
|
||||
import XLSX from 'xlsx'
|
||||
|
||||
function generateArray(table) {
|
||||
var out = [];
|
||||
var rows = table.querySelectorAll('tr');
|
||||
var ranges = [];
|
||||
for (var R = 0; R < rows.length; ++R) {
|
||||
var outRow = [];
|
||||
var row = rows[R];
|
||||
var columns = row.querySelectorAll('td');
|
||||
for (var C = 0; C < columns.length; ++C) {
|
||||
var cell = columns[C];
|
||||
var colspan = cell.getAttribute('colspan');
|
||||
var rowspan = cell.getAttribute('rowspan');
|
||||
var cellValue = cell.innerText;
|
||||
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
|
||||
|
||||
//Skip ranges
|
||||
ranges.forEach(function (range) {
|
||||
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
|
||||
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
|
||||
}
|
||||
});
|
||||
|
||||
//Handle Row Span
|
||||
if (rowspan || colspan) {
|
||||
rowspan = rowspan || 1;
|
||||
colspan = colspan || 1;
|
||||
ranges.push({
|
||||
s: {
|
||||
r: R,
|
||||
c: outRow.length
|
||||
},
|
||||
e: {
|
||||
r: R + rowspan - 1,
|
||||
c: outRow.length + colspan - 1
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//Handle Value
|
||||
outRow.push(cellValue !== "" ? cellValue : null);
|
||||
|
||||
//Handle Colspan
|
||||
if (colspan)
|
||||
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
|
||||
}
|
||||
out.push(outRow);
|
||||
}
|
||||
return [out, ranges];
|
||||
};
|
||||
|
||||
function datenum(v, date1904) {
|
||||
if (date1904) v += 1462;
|
||||
var epoch = Date.parse(v);
|
||||
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
|
||||
}
|
||||
|
||||
function sheet_from_array_of_arrays(data, opts) {
|
||||
var ws = {};
|
||||
var range = {
|
||||
s: {
|
||||
c: 10000000,
|
||||
r: 10000000
|
||||
},
|
||||
e: {
|
||||
c: 0,
|
||||
r: 0
|
||||
}
|
||||
};
|
||||
for (var R = 0; R != data.length; ++R) {
|
||||
for (var C = 0; C != data[R].length; ++C) {
|
||||
if (range.s.r > R) range.s.r = R;
|
||||
if (range.s.c > C) range.s.c = C;
|
||||
if (range.e.r < R) range.e.r = R;
|
||||
if (range.e.c < C) range.e.c = C;
|
||||
var cell = {
|
||||
v: data[R][C]
|
||||
};
|
||||
if (cell.v == null) continue;
|
||||
var cell_ref = XLSX.utils.encode_cell({
|
||||
c: C,
|
||||
r: R
|
||||
});
|
||||
|
||||
if (typeof cell.v === 'number') cell.t = 'n';
|
||||
else if (typeof cell.v === 'boolean') cell.t = 'b';
|
||||
else if (cell.v instanceof Date) {
|
||||
cell.t = 'n';
|
||||
cell.z = XLSX.SSF._table[14];
|
||||
cell.v = datenum(cell.v);
|
||||
} else cell.t = 's';
|
||||
|
||||
ws[cell_ref] = cell;
|
||||
}
|
||||
}
|
||||
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
|
||||
return ws;
|
||||
}
|
||||
|
||||
function Workbook() {
|
||||
if (!(this instanceof Workbook)) return new Workbook();
|
||||
this.SheetNames = [];
|
||||
this.Sheets = {};
|
||||
}
|
||||
|
||||
function s2ab(s) {
|
||||
var buf = new ArrayBuffer(s.length);
|
||||
var view = new Uint8Array(buf);
|
||||
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
|
||||
return buf;
|
||||
}
|
||||
|
||||
export function export_table_to_excel(id) {
|
||||
var theTable = document.getElementById(id);
|
||||
var oo = generateArray(theTable);
|
||||
var ranges = oo[1];
|
||||
|
||||
/* original data */
|
||||
var data = oo[0];
|
||||
var ws_name = "SheetJS";
|
||||
|
||||
var wb = new Workbook(),
|
||||
ws = sheet_from_array_of_arrays(data);
|
||||
|
||||
/* add ranges to worksheet */
|
||||
// ws['!cols'] = ['apple', 'banan'];
|
||||
ws['!merges'] = ranges;
|
||||
|
||||
/* add worksheet to workbook */
|
||||
wb.SheetNames.push(ws_name);
|
||||
wb.Sheets[ws_name] = ws;
|
||||
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: 'xlsx',
|
||||
bookSST: false,
|
||||
type: 'binary'
|
||||
});
|
||||
|
||||
saveAs(new Blob([s2ab(wbout)], {
|
||||
type: "application/octet-stream"
|
||||
}), "test.xlsx")
|
||||
}
|
||||
|
||||
export function export_json_to_excel({
|
||||
multiHeader = [],
|
||||
header,
|
||||
data,
|
||||
filename,
|
||||
merges = [],
|
||||
autoWidth = true,
|
||||
bookType = 'xlsx'
|
||||
} = {}) {
|
||||
/* original data */
|
||||
filename = filename || 'excel-list'
|
||||
data = [...data]
|
||||
data.unshift(header);
|
||||
|
||||
for (let i = multiHeader.length - 1; i > -1; i--) {
|
||||
data.unshift(multiHeader[i])
|
||||
}
|
||||
|
||||
var ws_name = "SheetJS";
|
||||
var wb = new Workbook(),
|
||||
ws = sheet_from_array_of_arrays(data);
|
||||
|
||||
if (merges.length > 0) {
|
||||
if (!ws['!merges']) ws['!merges'] = [];
|
||||
merges.forEach(item => {
|
||||
ws['!merges'].push(XLSX.utils.decode_range(item))
|
||||
})
|
||||
}
|
||||
|
||||
if (autoWidth) {
|
||||
/*设置worksheet每列的最大宽度*/
|
||||
const colWidth = data.map(row => row.map(val => {
|
||||
/*先判断是否为null/undefined*/
|
||||
if (val == null) {
|
||||
return {
|
||||
'wch': 10
|
||||
};
|
||||
}
|
||||
/*再判断是否为中文*/
|
||||
else if (val.toString().charCodeAt(0) > 255) {
|
||||
return {
|
||||
'wch': val.toString().length * 2
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'wch': val.toString().length
|
||||
};
|
||||
}
|
||||
}))
|
||||
/*以第一行为初始值*/
|
||||
let result = colWidth[0];
|
||||
for (let i = 1; i < colWidth.length; i++) {
|
||||
for (let j = 0; j < colWidth[i].length; j++) {
|
||||
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||
}
|
||||
}
|
||||
}
|
||||
ws['!cols'] = result;
|
||||
}
|
||||
|
||||
/* add worksheet to workbook */
|
||||
wb.SheetNames.push(ws_name);
|
||||
wb.Sheets[ws_name] = ws;
|
||||
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: bookType,
|
||||
bookSST: false,
|
||||
type: 'binary'
|
||||
});
|
||||
saveAs(new Blob([s2ab(wbout)], {
|
||||
type: "application/octet-stream"
|
||||
}), `${filename}.${bookType}`);
|
||||
}
|
||||
@@ -84,7 +84,7 @@
|
||||
<!-- 配置设备告警-->
|
||||
<configureDeviceAlarms v-show="!equipmentAlarm" ref="configureDeviceAlarms" />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="能耗告警">
|
||||
<a-tab-pane key="3" tab="能碳告警">
|
||||
<ns-view-list-table
|
||||
v-bind="energyAlarmConfig"
|
||||
v-show="energyAlarm"
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
style="width: 200px"
|
||||
v-model:value="queryParams.year"
|
||||
placeholder="请选择账期"
|
||||
:allowClear="false"
|
||||
picker="year"
|
||||
valueFormat="YYYY" />
|
||||
</a-form-item>
|
||||
@@ -60,15 +61,15 @@
|
||||
<div class="ns-form-title">
|
||||
<div class="title">配额统计</div>
|
||||
<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
|
||||
>
|
||||
<a-button type="primary" v-if="queryParams.accountType === 1" @click="getTotalTable(1)">
|
||||
全国配额
|
||||
</a-button>
|
||||
<a-button type="primary" v-if="queryParams.accountType === 2" @click="getTotalTable(2)">
|
||||
地方配额
|
||||
</a-button>
|
||||
<a-button type="primary" v-if="queryParams.accountType === 3" @click="getTotalTable(3)">
|
||||
CCER配额
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<a-table :columns="totalColumns" :data-source="totalData" bordered :pagination="false">
|
||||
@@ -205,6 +206,7 @@
|
||||
year.value = queryParams.value.year;
|
||||
transactionType.value = queryParams.value.transactionType;
|
||||
accountType.value = queryParams.value.accountType;
|
||||
getTotalTable(queryParams.value.accountType);
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
// getDetailList();
|
||||
};
|
||||
@@ -299,11 +301,11 @@
|
||||
}));
|
||||
});
|
||||
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;
|
||||
}
|
||||
// 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);
|
||||
@@ -427,7 +429,7 @@
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'carbonTradeDetails.xlsx'); // 设置下载的文件名
|
||||
link.setAttribute('download', '碳资产导出.xlsx'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
@@ -523,11 +525,6 @@
|
||||
}));
|
||||
});
|
||||
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);
|
||||
@@ -702,6 +699,7 @@
|
||||
.then((res) => {
|
||||
message.success('操作成功!');
|
||||
visible.value = false;
|
||||
formState.value = {};
|
||||
delIds.value = [];
|
||||
// getDetailList();
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
@@ -714,6 +712,7 @@
|
||||
message.success('操作成功!');
|
||||
visible.value = false;
|
||||
delIds.value = [];
|
||||
formState.value = {};
|
||||
// getDetailList();
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
}
|
||||
|
||||
@@ -1,642 +0,0 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<a-card style="border-radius: 12px">
|
||||
<div class="ns-form-title">
|
||||
<div class="title">查询</div>
|
||||
<div class="operation">
|
||||
<a-button type="primary" @click="changeParentData"> 返回 </a-button>
|
||||
</div>
|
||||
</div>
|
||||
<a-form layout="inline">
|
||||
<a-form-item>
|
||||
<a-select
|
||||
v-model:value="queryParams.accountType"
|
||||
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-cascader
|
||||
v-model:value="queryParams.transactionType"
|
||||
multiple
|
||||
style="width: 200px"
|
||||
:options="options"
|
||||
placeholder="请选择交易类型"
|
||||
suffix-icon="Shopping Around">
|
||||
<template #tagRender="data">
|
||||
<a-tag :key="data.value" color="blue">{{ data.label }}</a-tag>
|
||||
</template>
|
||||
</a-cascader>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-date-picker
|
||||
style="width: 200px"
|
||||
v-model:value="queryParams.year"
|
||||
placeholder="请选择账期"
|
||||
picker="year"
|
||||
valueFormat="YYYY" />
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" @click="searchTableList">查询</a-button>
|
||||
<a-button html-type="submit" style="margin-left: 6px" @click="reset">重置</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</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">
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
<a-table :columns="totalColumns" :data-source="totalData" bordered :pagination="false">
|
||||
<template #bodyCell="{ column, text }">
|
||||
<template v-if="column.dataIndex === 'name'">
|
||||
<a>{{ text }}</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 新增报告弹窗 -->
|
||||
<a-drawer
|
||||
:width="500"
|
||||
:visible="visible"
|
||||
:body-style="{ paddingBottom: '80px' }"
|
||||
:footer-style="{ textAlign: 'right' }"
|
||||
destroyOnClose
|
||||
@close="onClose">
|
||||
<div class="ns-form-title" style="display: flex">
|
||||
<div class="title">{{ text }}</div>
|
||||
</div>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formState"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-form-item ref="name" label="账户类型" name="accountType">
|
||||
<a-select v-model:value="formState.accountType" placeholder="请输入账户类型">
|
||||
<a-select-option value="1">全国账户</a-select-option>
|
||||
<a-select-option value="2">地方账户</a-select-option>
|
||||
<a-select-option value="3">CCER</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="交易类型" name="transactionType">
|
||||
<a-cascader
|
||||
v-model:value="formState.transactionType"
|
||||
:options="options"
|
||||
placeholder="请选择交易类型" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="交易日期" name="transactionDate">
|
||||
<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-form-item>
|
||||
<a-form-item ref="name" label="发生金额" name="amountIncurred">
|
||||
<a-input v-model:value="formState.amountIncurred" placeholder="请输入发生金额" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="交易对象" name="tradingPartner">
|
||||
<a-input v-model:value="formState.tradingPartner" placeholder="请输入交易对象" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="交易凭证">
|
||||
<a-upload
|
||||
:file-list="fileList"
|
||||
name="file"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf"
|
||||
@remove="handleFileRemove"
|
||||
:before-upload="beforeUpload"
|
||||
@change="handleChange">
|
||||
<a-button>
|
||||
<upload-outlined></upload-outlined>
|
||||
上传
|
||||
</a-button>
|
||||
</a-upload>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
||||
<a-button type="primary" @click="onSubmit">确定</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, defineEmits, toRaw } from 'vue';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { UploadOutlined } from '@ant-design/icons-vue';
|
||||
import type { UploadChangeParam, UploadProps } from 'ant-design-vue';
|
||||
import { Pagination, Modal, message } from 'ant-design-vue';
|
||||
import {
|
||||
carbonAssets,
|
||||
carbonEmissionFactorLibrary,
|
||||
uploadPic,
|
||||
} from '/@/api/carbonEmissionFactorLibrary';
|
||||
import { log } from 'console';
|
||||
defineOptions({
|
||||
energyType: 'carbonAssets', // 与页面路由name一致缓存才可生效
|
||||
components: {
|
||||
'a-pagination': Pagination,
|
||||
},
|
||||
});
|
||||
// 父组件id
|
||||
const props = defineProps({
|
||||
parentId: {
|
||||
type: Number,
|
||||
},
|
||||
});
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
const fetch = (api, params = { orgId }, config) => {
|
||||
return http.post(api, params, config);
|
||||
};
|
||||
// 详情部分变量
|
||||
const selectedRowKeys = ref([]);
|
||||
const onSelectionChange = (selectedKeys, selectedRows) => {
|
||||
selectedRowKeys.value = selectedKeys;
|
||||
};
|
||||
const total = ref<number>();
|
||||
const thisYear = ref(new Date().getFullYear().toString());
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orgId: orgId.value,
|
||||
accountType: props.parentId,
|
||||
year: thisYear.value,
|
||||
});
|
||||
const searchTableList = () => {
|
||||
getDetailList();
|
||||
};
|
||||
// 获取左侧列表数据
|
||||
const getDetailList = () => {
|
||||
fetch(carbonAssets.carbonDetailsList, queryParams.value).then((res) => {
|
||||
data.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
};
|
||||
getDetailList();
|
||||
const 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',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 130,
|
||||
},
|
||||
];
|
||||
const data = ref([]);
|
||||
const reset = () => {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orgId: orgId.value,
|
||||
year: new Date().getFullYear(),
|
||||
};
|
||||
getDetailList();
|
||||
};
|
||||
const editData = (record) => {
|
||||
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);
|
||||
};
|
||||
// 定义一个递归函数来查找每一级的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 id = [record.id];
|
||||
Modal.confirm({
|
||||
title: '警告',
|
||||
content: '确定要删除吗?',
|
||||
okText: '确定',
|
||||
okType: 'primary',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
fetch(carbonAssets.delete, { ids: id }).then((res) => {
|
||||
message.success('操作成功!');
|
||||
getDetailList();
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
};
|
||||
const deleteMore = () => {
|
||||
Modal.confirm({
|
||||
title: '警告',
|
||||
content: '确定要删除吗?',
|
||||
okText: '确定',
|
||||
okType: 'primary',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
fetch(carbonAssets.delete, { ids: selectedRowKeys.value }).then((res) => {
|
||||
message.success('操作成功!');
|
||||
getDetailList();
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
};
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number, size: number) => {
|
||||
queryParams.value.pageNum = pageNumber;
|
||||
queryParams.value.pageSize = size;
|
||||
getDetailList();
|
||||
};
|
||||
// 新增相关数据
|
||||
const visible = ref(false);
|
||||
const text = ref('新增');
|
||||
const formState = ref({
|
||||
orgId: orgId.value,
|
||||
});
|
||||
const formRef = ref();
|
||||
const labelCol = { span: 5 };
|
||||
const wrapperCol = { span: 19 };
|
||||
const options = ref([]);
|
||||
// 获取字典值
|
||||
const getDictList = () => {
|
||||
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'TRANSACTION_TYPE' }).then(
|
||||
(res) => {
|
||||
options.value = res.data;
|
||||
options.value = options.value.map((item) => ({
|
||||
value: item.id,
|
||||
label: item.cnValue,
|
||||
children: item.children
|
||||
? item.children.map((child) => ({
|
||||
value: child.id,
|
||||
label: child.cnValue,
|
||||
}))
|
||||
: [],
|
||||
}));
|
||||
},
|
||||
);
|
||||
};
|
||||
getDictList();
|
||||
// 点击新增
|
||||
const addDetail = () => {
|
||||
text.value = '新增';
|
||||
visible.value = true;
|
||||
getDictList();
|
||||
};
|
||||
const importFileList = ref<UploadProps['fileList']>([]);
|
||||
const importFile = (options: UploadRequestOption) => {
|
||||
const { file, onSuccess, onError } = options;
|
||||
const formData = ref(new FormData());
|
||||
formData.value.append('file', file as any);
|
||||
formData.value.append('orgId', orgId.value);
|
||||
formData.value.append('year', queryParams.value.year);
|
||||
fetch(carbonAssets.import, formData.value)
|
||||
.then((res) => {
|
||||
message.success('操作成功!');
|
||||
getDetailList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error', error);
|
||||
});
|
||||
};
|
||||
const exportFile = () => {
|
||||
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);
|
||||
});
|
||||
};
|
||||
// 上传附件
|
||||
const fileList = ref<UploadProps['fileList']>([]);
|
||||
const beforeUpload: UploadProps['beforeUpload'] = (file) => {
|
||||
return false;
|
||||
};
|
||||
const handleChange = (info: UploadChangeParam) => {
|
||||
fileList.value = [...info.fileList];
|
||||
if (info.file.status !== 'uploading') {
|
||||
console.log(info.file, info.fileList);
|
||||
}
|
||||
if (info.file.status === 'done') {
|
||||
message.success(`${info.file.name} 文件上传成功`);
|
||||
} else if (info.file.status === 'error') {
|
||||
message.error(`${info.file.name} 文件上传失败`);
|
||||
}
|
||||
};
|
||||
const delIds = ref([]);
|
||||
const handleFileRemove = (file) => {
|
||||
delIds.value.push(file.uid);
|
||||
const newFileList = [];
|
||||
fileList.value.forEach((item) => {
|
||||
if (item.uid !== file.uid) {
|
||||
newFileList.push(item);
|
||||
}
|
||||
});
|
||||
fileList.value = newFileList;
|
||||
};
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
console.log('values', formState, toRaw(formState));
|
||||
if (formState.value.transactionType) {
|
||||
formState.value.transactionType = formState.value.transactionType.join(',').split(',')[1];
|
||||
}
|
||||
if (formState.value.accountType.value) {
|
||||
formState.value.accountType = formState.value.accountType.value;
|
||||
}
|
||||
fetch(carbonAssets.createOrUpdate, formState.value).then((res) => {
|
||||
if (res.data.id && fileList.value.length !== 0) {
|
||||
// uploadQuery.value.bizId = res.data.id;
|
||||
const formData = ref(new FormData());
|
||||
fileList.value.forEach((file) => {
|
||||
if (file.type !== 'done') {
|
||||
formData.value.append('files', file.originFileObj);
|
||||
}
|
||||
});
|
||||
formData.value.append('bizType', 1);
|
||||
formData.value.append('bizId', res.data.id);
|
||||
delIds.value.forEach((item) => {
|
||||
formData.value.append('deleteList', item);
|
||||
});
|
||||
fetch(uploadPic.uploadfiles, formData.value)
|
||||
.then((res) => {
|
||||
message.success('操作成功!');
|
||||
visible.value = false;
|
||||
delIds.value = [];
|
||||
getDetailList();
|
||||
getTotalTable();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error', error);
|
||||
});
|
||||
} else {
|
||||
message.success('操作成功!');
|
||||
visible.value = false;
|
||||
delIds.value = [];
|
||||
getDetailList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error', error);
|
||||
});
|
||||
};
|
||||
// 定义form表单的必填
|
||||
const rules: Record<string, Rule[]> = {
|
||||
accountType: [{ required: true, message: '请输入账户类型', trigger: 'change' }],
|
||||
transactionType: [{ required: true, message: '请选择交易类型', trigger: 'change' }],
|
||||
transactionDate: [{ required: true, message: '请选择交易日期', trigger: 'change' }],
|
||||
transactionQuantity: [{ required: true, message: '请输入交易数量', trigger: 'change' }],
|
||||
amountIncurred: [{ required: true, message: '请输入发生金额', trigger: 'change' }],
|
||||
tradingPartner: [{ required: true, message: '请输入交易对象', trigger: 'change' }],
|
||||
};
|
||||
// 关闭新增抽屉
|
||||
const onClose = () => {
|
||||
visible.value = false;
|
||||
delIds.value = [];
|
||||
formState.value = {};
|
||||
fileList.value = [];
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
// 统计表格
|
||||
const getTotalTable = (type) => {
|
||||
if (type) {
|
||||
queryParams.value.accountType = type;
|
||||
}
|
||||
fetch(carbonAssets.quotaStatistics, queryParams.value).then((res) => {
|
||||
totalData.value = res.data;
|
||||
});
|
||||
};
|
||||
getTotalTable();
|
||||
const totalColumns = [
|
||||
{
|
||||
title: '统计类型',
|
||||
dataIndex: 'statisticType',
|
||||
},
|
||||
{
|
||||
title: '小计',
|
||||
dataIndex: 'subtotal',
|
||||
},
|
||||
{
|
||||
title: '合计',
|
||||
dataIndex: 'amountTo',
|
||||
},
|
||||
];
|
||||
|
||||
const totalData = ref([]);
|
||||
// 点击返回
|
||||
const emit = defineEmits(['change-data']);
|
||||
const changeParentData = () => {
|
||||
emit('change-data', true);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ns-form-title {
|
||||
font-weight: bold;
|
||||
user-select: text;
|
||||
padding-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.title {
|
||||
text-align: left;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
font-weight: bold;
|
||||
user-select: text;
|
||||
position: relative;
|
||||
padding-left: 9px;
|
||||
}
|
||||
.title::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
height: 13px;
|
||||
width: 3px;
|
||||
border-radius: 1px;
|
||||
background-color: #2778ff;
|
||||
}
|
||||
:deep(.ant-card-body) {
|
||||
padding: 16px;
|
||||
}
|
||||
.search {
|
||||
height: 16%;
|
||||
}
|
||||
.detailTable {
|
||||
width: 65%;
|
||||
margin-right: 20px;
|
||||
height: 100%;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
}
|
||||
.total {
|
||||
width: calc(35% - 20px);
|
||||
height: 100%;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -129,7 +129,7 @@
|
||||
</div>
|
||||
<div class="title">
|
||||
<img width="24" height="24" src="../../../../src/icon/carbonAssetsTitle-3.svg" />
|
||||
<span>全国碳账户余额</span>
|
||||
<span>CCER账户余额</span>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="calculation BLCard">
|
||||
|
||||
@@ -167,7 +167,7 @@ export const formConfig = (disabled) => {
|
||||
label: '已引用数',
|
||||
field: 'numberOfReferences',
|
||||
component: 'NsInput',
|
||||
show:disabled,
|
||||
show: disabled,
|
||||
componentProps: {
|
||||
defaultValue: '',
|
||||
disabled: true,
|
||||
|
||||
@@ -299,13 +299,7 @@
|
||||
const x = 3;
|
||||
const y = 2;
|
||||
const z = 1;
|
||||
const genData: TreeProps['treeData'] = [
|
||||
{
|
||||
emissionName: '全部',
|
||||
key: '0-0',
|
||||
children: [],
|
||||
},
|
||||
];
|
||||
const genData: TreeProps['treeData'] = [];
|
||||
const checkedTreeNodeKeys = ref<string[]>();
|
||||
const selectedKeys = ref<string[]>();
|
||||
|
||||
@@ -532,7 +526,7 @@
|
||||
const getOrgTree = () => {
|
||||
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, getClassificationTree.value).then(
|
||||
(res) => {
|
||||
gData.value[0].children = res.data;
|
||||
gData.value = res.data;
|
||||
// 找到匹配的节点数据
|
||||
// const selectedNodes = [];
|
||||
// checkedTreeNodeKeys.value.forEach(key => {
|
||||
@@ -564,10 +558,12 @@
|
||||
const onSelectKeys = ref([]);
|
||||
const onSelect = (selectedKey: string[], info: any) => {
|
||||
if (selectedKey.length === 1) {
|
||||
if (info.selectedNodes[0].emissionName === '全部') {
|
||||
onSelectKeys.value = [];
|
||||
} else {
|
||||
onSelectKeys.value = [info.selectedNodes[0].id];
|
||||
}
|
||||
selectedKeys.value = selectedKey;
|
||||
}
|
||||
if (info.selected) {
|
||||
// showOperation.value = true;
|
||||
editTreeNode.value = {
|
||||
id: info.selectedNodes[0].id,
|
||||
level: info.selectedNodes[0].level,
|
||||
@@ -575,15 +571,18 @@
|
||||
sortNumber: info.selectedNodes[0].sortNumber,
|
||||
parentEmissionId: info.selectedNodes[0].parentEmissionId,
|
||||
};
|
||||
onSelectKeys.value = [info.selectedNodes[0].id];
|
||||
emissionList.value = [...onSelectKeys.value, ...checkedIds.value];
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
} else {
|
||||
editTreeNode.value = {};
|
||||
onSelectKeys.value = [];
|
||||
emissionList.value = [...onSelectKeys.value, ...checkedIds.value];
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
}
|
||||
// if (info.selected) {
|
||||
// // showOperation.value = true;
|
||||
|
||||
// } else {
|
||||
// editTreeNode.value = {};
|
||||
// onSelectKeys.value = [];
|
||||
// emissionList.value = [...onSelectKeys.value, ...checkedIds.value];
|
||||
// mainRef.value?.nsTableRef.reload();
|
||||
// }
|
||||
};
|
||||
|
||||
const onSearch = () => {
|
||||
@@ -705,12 +704,17 @@
|
||||
label: '导出',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
// console.log( mainRef.value.nsTableRef.tableState.selectedRowKeys)
|
||||
// console.log(mainRef.value.nsTableRef.formParamsRef)
|
||||
const exportQuery = {
|
||||
orgId: orgId.value,
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
ids: mainRef.value.nsTableRef.tableState.selectedRowKeys,
|
||||
bibliography:mainRef.value.nsTableRef.formParamsRef.bibliography,
|
||||
emissionGas:mainRef.value.nsTableRef.formParamsRef.emissionGas,
|
||||
carbonDatabase:mainRef.value.nsTableRef.formParamsRef.carbonDatabase,
|
||||
emissionProcess:mainRef.value.nsTableRef.formParamsRef.emissionProcess,
|
||||
emissionSources:mainRef.value.nsTableRef.formParamsRef.emissionSources,
|
||||
};
|
||||
const config = {
|
||||
responseType: 'blob',
|
||||
@@ -722,7 +726,7 @@
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'carbonFactor.xlsx'); // 设置下载的文件名
|
||||
link.setAttribute('download', '碳排因子库导出.xlsx'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
@@ -1242,8 +1246,10 @@
|
||||
flex-direction: column;
|
||||
border-radius: 12px;
|
||||
overflow: auto;
|
||||
align-items: center;
|
||||
:deep(.ant-tree) {
|
||||
height: 90%;
|
||||
width: 90%;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
@@ -1257,12 +1263,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(
|
||||
.ant-form-item-label
|
||||
> label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before
|
||||
) {
|
||||
display: none !important;
|
||||
}
|
||||
// :deep(
|
||||
// .ant-form-item-label
|
||||
// > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before
|
||||
// ) {
|
||||
// display: none !important;
|
||||
// }
|
||||
:deep(.ant-form-item-label) {
|
||||
z-index: 20;
|
||||
text-align: right;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { quickCalculation, carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
||||
import { ref } from 'vue';
|
||||
// 能耗统计表表头
|
||||
export const tableColumns = [
|
||||
{
|
||||
@@ -144,3 +146,107 @@ export const drawerColumns = [
|
||||
dataIndex: 'dataSources',
|
||||
},
|
||||
];
|
||||
export const setFactorConfig = (orgId) => {
|
||||
return ref({
|
||||
api: carbonEmissionFactorLibrary.getTableList,
|
||||
params: { orgId, pageNum: 1, pageSize: 9999, emissionList: [0] },
|
||||
treeConfig: {
|
||||
header: {
|
||||
icon: 'deviceType',
|
||||
title: '排放分类',
|
||||
},
|
||||
params: { orgId},
|
||||
dynamicParams: { emissionList: 'id[]' },
|
||||
defaultExpandAll: true,
|
||||
// checkable:true,
|
||||
api: carbonEmissionFactorLibrary.getCarbonFactorTree,
|
||||
fieldNames: { title: 'emissionName', key: 'id' },
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'deviceType',
|
||||
label: '设备名称',
|
||||
component: 'NsInput',
|
||||
autoSubmit: true,
|
||||
componentProps: {
|
||||
placeholder: '请输入关键字',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
rowSelection: { type: 'radio' },
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
textNumber: 2,
|
||||
dataIndex: 'address',
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'emissionSources',
|
||||
textNumber: 3,
|
||||
},
|
||||
{
|
||||
title: '排放因子',
|
||||
dataIndex: 'emissionFactors',
|
||||
textNumber: 4,
|
||||
textEllipsis: true,
|
||||
},
|
||||
{
|
||||
title: '排放因子单位',
|
||||
dataIndex: 'emissionFactorUnits',
|
||||
width: 100,
|
||||
textEllipsis: true,
|
||||
},
|
||||
{
|
||||
title: '排放环节',
|
||||
dataIndex: 'emissionProcess',
|
||||
textWidth: 88,
|
||||
textEllipsis: true,
|
||||
},
|
||||
{
|
||||
title: '数据来源',
|
||||
dataIndex: 'dataSources',
|
||||
textNumber: 5,
|
||||
textEllipsis: true,
|
||||
},
|
||||
],
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'emissionSources',
|
||||
label: '排放源',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入排放源',
|
||||
maxLength: 20,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'emissionProcess',
|
||||
label: '排放环节',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
placeholder: '请选择排放环节',
|
||||
api: carbonEmissionFactorLibrary.gasAndDatabase,
|
||||
resultField: 'data',
|
||||
params: {
|
||||
orgId: orgId.value,
|
||||
type: 'emissionProcess',
|
||||
},
|
||||
immediate: true,
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
},
|
||||
},
|
||||
],
|
||||
params: {},
|
||||
},
|
||||
// pagination: { pageSizeOptions: false },
|
||||
rowKey: 'id',
|
||||
});
|
||||
};
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<a-radio :value="1">否</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="排放类型" name="emissionType" :required="isRequired">
|
||||
<a-form-item label="排放类型" name="emissionType" :required="isRequired" v-if="isRequired">
|
||||
<a-select
|
||||
v-model:value="formState.emissionType"
|
||||
placeholder="请选择排放类型"
|
||||
@@ -330,7 +330,7 @@
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'carbonStats.xlsx'); // 设置下载的文件名
|
||||
link.setAttribute('download', '能耗统计导出.xlsx'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
@@ -342,13 +342,13 @@
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '模板下载',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
doWnload('/hx-ai-intelligent/asset/file/energyConsumption.xlsx');
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '模板下载',
|
||||
// type: 'primary',
|
||||
// handle: () => {
|
||||
// doWnload('/hx-ai-intelligent/asset/file/energyConsumption.xlsx');
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// label: '上传凭证',
|
||||
// type: 'primary',
|
||||
@@ -782,24 +782,18 @@
|
||||
// 获取自动采集节点的数据
|
||||
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,
|
||||
children: child.children
|
||||
? child.children.map((childs) => ({
|
||||
value: childs.id,
|
||||
label: childs.pointName,
|
||||
}))
|
||||
: [],
|
||||
}))
|
||||
: [],
|
||||
}));
|
||||
treeData.value = transformData(treeData.value);
|
||||
});
|
||||
};
|
||||
// 将数据转换为树形结构
|
||||
const transformData = (data: any[]) => {
|
||||
return data.map((item) => ({
|
||||
title: item.pointName,
|
||||
value: item.id,
|
||||
key: item.id,
|
||||
children: item.children ? transformData(item.children) : [],
|
||||
}));
|
||||
};
|
||||
// 计算碳排切换
|
||||
const emissionType = ref();
|
||||
const changeRadio = (e) => {
|
||||
@@ -819,7 +813,9 @@
|
||||
.validate()
|
||||
.then(() => {
|
||||
console.log('values', formState, toRaw(formState));
|
||||
formState.value.year = selectYear.value.format('YYYY');
|
||||
formState.value.year = mainRef.value.nsTableRef.formParamsRef.year
|
||||
? mainRef.value.nsTableRef.formParamsRef.year
|
||||
: selectYear.value.format('YYYY');
|
||||
if (formState.value.unit) {
|
||||
formState.value.unit = formState.value.unit.join(',').split(',')[1];
|
||||
}
|
||||
@@ -973,6 +969,7 @@
|
||||
formState.value = {
|
||||
orgId: orgId.value,
|
||||
};
|
||||
fileList.value = [];
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
// 点击上传凭证按钮
|
||||
|
||||
@@ -40,40 +40,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<!-- <a-table
|
||||
:columns="columns"
|
||||
:data-source="tableData"
|
||||
bordered
|
||||
:pagination="false">
|
||||
<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>
|
||||
<div class="ns-table-title"><span>排放因子库</span></div>
|
||||
<div class="buttonGroup">
|
||||
<a-button type="primary" @click="addNewData">新增</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-table> -->
|
||||
<ns-view-list-table
|
||||
v-bind="tableConfig"
|
||||
:model="tableData"
|
||||
ref="mainRef"
|
||||
:scroll="{ x: 1000 }" />
|
||||
<!-- <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"
|
||||
@@ -93,20 +64,20 @@
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="日期范围" name="dateRange">
|
||||
<a-form-item ref="name" label="适用日期" name="dateRange">
|
||||
<a-range-picker
|
||||
v-model:value="formState.dateRange"
|
||||
picker="month"
|
||||
valueFormat="YYYY-MM" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-item ref="name" label="排放因子" name="emissionFactors">
|
||||
<ns-input v-model:value="formState.emissionFactors" disabled />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-col> -->
|
||||
</a-row>
|
||||
<span
|
||||
<!-- <span
|
||||
key=""
|
||||
style="font-size: 16px; font-weight: 700; color: rgba(51, 51, 51, 1); text-align: left">
|
||||
因子列表
|
||||
@@ -117,8 +88,11 @@
|
||||
<ns-input style="margin-top: 5px" v-model:value="selectData" @change="keyChange" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-row> -->
|
||||
</a-form>
|
||||
<a-button type="primary" style="margin-bottom: 10px" @click="selectFactor"
|
||||
>选择因子</a-button
|
||||
>
|
||||
<a-table
|
||||
:columns="drawerColumns"
|
||||
:data-source="newTableData"
|
||||
@@ -142,6 +116,15 @@
|
||||
</template>
|
||||
</a-drawer>
|
||||
</div>
|
||||
<!-- 选择因子 -->
|
||||
<a-modal
|
||||
v-model:visible="openVisible"
|
||||
width="60%"
|
||||
title="选择因子"
|
||||
@ok="onSubmit"
|
||||
@cancel="onClose">
|
||||
<ns-view-list-table v-bind="config" ref="setFactorRef" style="height: 500px" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -156,6 +139,7 @@
|
||||
carbonEmissionFactorLibrary,
|
||||
} from '/@/api/carbonEmissionFactorLibrary';
|
||||
import { or } from '@vueuse/core';
|
||||
import { setFactorConfig } from '../config';
|
||||
defineOptions({
|
||||
energyType: 'quickCalculation', // 与页面路由name一致缓存才可生效
|
||||
components: {
|
||||
@@ -499,6 +483,11 @@
|
||||
},
|
||||
});
|
||||
};
|
||||
const openVisible = ref(false);
|
||||
const config = setFactorConfig(orgId.value);
|
||||
const selectFactor = () => {
|
||||
openVisible.value = true;
|
||||
};
|
||||
// 关闭新增抽屉
|
||||
const onClose = () => {
|
||||
visible.value = false;
|
||||
@@ -611,6 +600,12 @@
|
||||
:deep(.ant-table-container) {
|
||||
padding: unset;
|
||||
}
|
||||
:deep(.ant-modal-header) {
|
||||
border-bottom: 10px solid #f0f0f0 !important;
|
||||
}
|
||||
:deep(.ant-modal-footer) {
|
||||
border-top: 10px solid #f0f0f0 !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
th.column-money,
|
||||
|
||||
@@ -308,80 +308,82 @@
|
||||
<div class="ns-form-title-edit">
|
||||
<div class="title">编辑</div>
|
||||
</div>
|
||||
<a-form
|
||||
ref="editFormRef"
|
||||
:model="editFormState"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="数据来源" name="dataSources">
|
||||
<a-select
|
||||
ref="select"
|
||||
v-model:value="editFormState.dataSources"
|
||||
@change="changeSelect">
|
||||
<a-select-option value="1">自行推估</a-select-option>
|
||||
<a-select-option value="2">定期量测</a-select-option>
|
||||
<a-select-option value="3">自动测量</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="消耗量" name="consumption">
|
||||
<ns-input-number
|
||||
v-model:value="editFormState.consumption"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
:disabled="canEdit" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row v-if="automatic">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="能耗类型">
|
||||
<a-select
|
||||
v-model:value="editFormState.energyConsumptionType"
|
||||
@change="changeEnergyType"
|
||||
placeholder="请选择能耗类型">
|
||||
<a-select-option
|
||||
v-for="(item, index) in energyTypeOptions"
|
||||
:key="index"
|
||||
:value="item.dicKey">
|
||||
{{ item.cnValue }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="采集节点" name="collectionNode">
|
||||
<a-tree-select
|
||||
v-model:value="editFormState.collectionNode"
|
||||
:tree-line="true"
|
||||
@select="selectNode"
|
||||
:tree-data="collectingNodes">
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="因子值" name="emissionFactors">
|
||||
<ns-input
|
||||
v-model:value="editFormState.emissionFactors"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="关键字" name="key">
|
||||
<a-input-search
|
||||
v-model:value="editFormState.key"
|
||||
@search="searchKey"
|
||||
placeholder="请输入关键字" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-spin :spinning="spinning">
|
||||
<a-form
|
||||
ref="editFormRef"
|
||||
:model="editFormState"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="数据来源" name="dataSources">
|
||||
<a-select
|
||||
ref="select"
|
||||
v-model:value="editFormState.dataSources"
|
||||
@change="changeSelect">
|
||||
<a-select-option value="1">自行推估</a-select-option>
|
||||
<a-select-option value="2">定期量测</a-select-option>
|
||||
<a-select-option value="3">自动测量</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="消耗量" name="consumption">
|
||||
<ns-input-number
|
||||
v-model:value="editFormState.consumption"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown"
|
||||
:disabled="canEdit" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row v-if="automatic">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="能耗类型">
|
||||
<a-select
|
||||
v-model:value="editFormState.energyConsumptionType"
|
||||
@change="changeEnergyType"
|
||||
placeholder="请选择能耗类型">
|
||||
<a-select-option
|
||||
v-for="(item, index) in energyTypeOptions"
|
||||
:key="index"
|
||||
:value="item.dicKey">
|
||||
{{ item.cnValue }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="采集节点" name="collectionNode">
|
||||
<a-tree-select
|
||||
v-model:value="editFormState.collectionNode"
|
||||
:tree-line="true"
|
||||
@select="selectNode"
|
||||
:tree-data="collectingNodes">
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="因子值" name="emissionFactors">
|
||||
<ns-input
|
||||
v-model:value="editFormState.emissionFactors"
|
||||
:maxlength="20"
|
||||
@keydown="handleKeyDown" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item ref="name" label="关键字" name="key">
|
||||
<a-input-search
|
||||
v-model:value="editFormState.key"
|
||||
@search="searchKey"
|
||||
placeholder="请输入关键字" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<div class="ns-form-title-edit" style="display: flex">
|
||||
<div class="titleEdit">因子列表</div>
|
||||
</div>
|
||||
@@ -1121,19 +1123,21 @@
|
||||
// 获取自动采集节点的数据
|
||||
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
|
||||
collectingNodes.value = res.data;
|
||||
collectingNodes.value = collectingNodes.value.map((item) => ({
|
||||
value: item.id,
|
||||
label: item.pointName,
|
||||
children: item.children
|
||||
? item.children.map((child) => ({
|
||||
value: child.id,
|
||||
label: child.pointName,
|
||||
}))
|
||||
: [],
|
||||
}));
|
||||
collectingNodes.value = collectingNodes.value = transformData(collectingNodes.value);
|
||||
});
|
||||
};
|
||||
// 将数据转换为树形结构
|
||||
const transformData = (data: any[]) => {
|
||||
return data.map((item) => ({
|
||||
title: item.pointName,
|
||||
value: item.id,
|
||||
key: item.id,
|
||||
children: item.children ? transformData(item.children) : [],
|
||||
}));
|
||||
};
|
||||
const spinning = ref(false);
|
||||
const selectNode = (value) => {
|
||||
spinning.value = true;
|
||||
const getConsumeData = ref({
|
||||
acquisitionDate: acquisitionDate.value,
|
||||
collectionNode: value,
|
||||
@@ -1142,6 +1146,7 @@
|
||||
});
|
||||
fetch(carbonInventoryCheck.nodeCancellationConsumption, getConsumeData.value).then((res) => {
|
||||
editFormState.value.consumption = res.data;
|
||||
spinning.value = false;
|
||||
});
|
||||
};
|
||||
// 上传附件
|
||||
@@ -1696,6 +1701,13 @@
|
||||
background: #c9e4ff;
|
||||
}
|
||||
}
|
||||
:deep(.ant-empty) {
|
||||
height: 80%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
flex: 1;
|
||||
@@ -1811,4 +1823,11 @@
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
}
|
||||
:deep(.ant-empty) {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -39,7 +39,11 @@
|
||||
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-date-picker
|
||||
v-model:value="formState.reportYear"
|
||||
@openChange="openChange"
|
||||
picker="year"
|
||||
valueFormat="YYYY" />
|
||||
</a-form-item>
|
||||
<a-form-item ref="name" label="适用标准" name="genericStandard">
|
||||
<a-input
|
||||
@@ -60,6 +64,7 @@
|
||||
<a-form-item ref="name" label="报告范围" name="reportScope">
|
||||
<a-range-picker
|
||||
v-model:value="formState.reportScope"
|
||||
:defaultPickerValue="defaultPickerValue"
|
||||
picker="month"
|
||||
:disabledDate="disabledDate"
|
||||
valueFormat="YYYY-MM" />
|
||||
@@ -78,6 +83,8 @@
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary';
|
||||
import fillIn from './fillInPage/index.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
defineOptions({ name: 'CarbonInventoryCheck' });
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
@@ -104,6 +111,17 @@
|
||||
const selectChange = (value) => {
|
||||
formState.value.reportScope = '';
|
||||
};
|
||||
const defaultPickerValue = ref([
|
||||
dayjs('2020'), // 默认开始日期
|
||||
dayjs('2020'), // 默认结束日期
|
||||
]);
|
||||
const openChange = (status) => {
|
||||
if (status === false) {
|
||||
if (formState.value.reportYear) {
|
||||
defaultPickerValue.value = [dayjs('2022'), dayjs('2022')];
|
||||
}
|
||||
}
|
||||
};
|
||||
// 定义form表单的必填
|
||||
const rules: Record<string, Rule[]> = {
|
||||
reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }],
|
||||
@@ -241,17 +259,21 @@
|
||||
};
|
||||
fetch(carbonInventoryCheck.downloadZip, deleteId.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', '碳盘查凭证.zip'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
if (res.type === 'application/json') {
|
||||
handlerResponseError(res);
|
||||
} else {
|
||||
// 创建一个 URL 对象,指向图片数据的 blob
|
||||
const url = window.URL.createObjectURL(new Blob([res]));
|
||||
// 创建一个 <a> 标签,用于触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', '碳盘查凭证.zip'); // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 清理 URL 对象
|
||||
window.URL.revokeObjectURL(url);
|
||||
// 清理 URL 对象
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('下载图片失败:', error);
|
||||
@@ -295,6 +317,21 @@
|
||||
},
|
||||
rowKey: 'id',
|
||||
});
|
||||
const handlerResponseError = (data) => {
|
||||
const fileReader = new FileReader();
|
||||
fileReader.onload = function () {
|
||||
try {
|
||||
const jsonData = JSON.parse(fileReader.result); // 说明是普通对象数据,后台转换失败
|
||||
console.log('后台返回的信息', jsonData.data);
|
||||
message.warning(jsonData.data);
|
||||
// dosomething……
|
||||
} catch (err) {
|
||||
// 解析成对象失败,说明是正常的文件流
|
||||
console.log('success...');
|
||||
}
|
||||
};
|
||||
fileReader.readAsText(data);
|
||||
};
|
||||
// 填报页点击返回
|
||||
const updateData = (newDataOne, newDataTwo) => {
|
||||
isMainPage.value = newDataOne;
|
||||
|
||||
@@ -360,6 +360,9 @@
|
||||
background: #f2f2f2 !important;
|
||||
color: black !important;
|
||||
}
|
||||
:deep(.ant-picker) {
|
||||
border-radius: unset;
|
||||
}
|
||||
.month {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
|
||||
@@ -96,28 +96,32 @@
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
<!-- <template #summary>
|
||||
<template #summary>
|
||||
<a-table-summary-row>
|
||||
<a-table-summary-cell></a-table-summary-cell>
|
||||
<a-table-summary-cell>合计</a-table-summary-cell>
|
||||
<a-table-summary-cell :colSpan="2">合计</a-table-summary-cell>
|
||||
<a-table-summary-cell></a-table-summary-cell>
|
||||
<a-table-summary-cell>
|
||||
<a-typography-text type="danger">{{ 111 }}</a-typography-text>
|
||||
<a-typography-text>{{ totalLastYearActualUsage + unit }}</a-typography-text>
|
||||
</a-table-summary-cell>
|
||||
<a-table-summary-cell>
|
||||
<a-typography-text>{{ 222 }}</a-typography-text>
|
||||
<a-typography-text>{{ totalActualUsage + unit }}</a-typography-text>
|
||||
</a-table-summary-cell>
|
||||
<a-table-summary-cell>
|
||||
<a-typography-text>{{ 222 }}</a-typography-text>
|
||||
<a-typography-text>{{ totalReferenceValue + unit }}</a-typography-text>
|
||||
</a-table-summary-cell>
|
||||
<a-table-summary-cell></a-table-summary-cell>
|
||||
<a-table-summary-cell></a-table-summary-cell>
|
||||
<a-table-summary-cell>
|
||||
<a-typography-text>{{ 222 }}</a-typography-text>
|
||||
<a-typography-text>-</a-typography-text>
|
||||
</a-table-summary-cell>
|
||||
<a-table-summary-cell>
|
||||
<a-typography-text>-</a-typography-text>
|
||||
</a-table-summary-cell>
|
||||
<a-table-summary-cell>
|
||||
<a-typography-text>{{ totalBudget + unit }}</a-typography-text>
|
||||
</a-table-summary-cell>
|
||||
<a-table-summary-cell></a-table-summary-cell>
|
||||
</a-table-summary-row>
|
||||
</template> -->
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</div>
|
||||
@@ -135,16 +139,16 @@
|
||||
v-model:value="formState.conversionRate"
|
||||
:maxlength="15"
|
||||
@keydown="handleKeyDown"
|
||||
suffix="%"
|
||||
:disabled="disabled" />
|
||||
<span class="unit">%</span>
|
||||
</a-form-item>
|
||||
<a-form-item label="预算值" :required="true">
|
||||
<a-input-number
|
||||
v-model:value="formState.budget"
|
||||
:maxlength="15"
|
||||
@keydown="handleKeyDown"
|
||||
suffix="kWh"
|
||||
:disabled="!disabled" />
|
||||
<span class="unit">kWh</span>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
@@ -247,6 +251,7 @@
|
||||
QuestionCircleOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary';
|
||||
import { getEnumEnergy } from '/@/api';
|
||||
import * as echarts from 'echarts';
|
||||
import { any, string } from 'vue-types';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
@@ -265,8 +270,10 @@
|
||||
nodeName: {
|
||||
type: string,
|
||||
},
|
||||
resourceType: {
|
||||
type: string,
|
||||
},
|
||||
});
|
||||
console.log(props, 'xxy');
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
@@ -291,11 +298,29 @@
|
||||
itemizeId: props.parentId,
|
||||
type: props.type,
|
||||
});
|
||||
console.log(props.type, '6666');
|
||||
const ids = ref([]);
|
||||
const lastActualUsageList = ref([]);
|
||||
// 获取单位
|
||||
const unit = ref();
|
||||
const totalActualUsage = ref();
|
||||
const totalBudget = ref();
|
||||
const totalLastYearActualUsage = ref();
|
||||
const totalReferenceValue = ref();
|
||||
const getTableData = () => {
|
||||
fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then((res) => {
|
||||
data.value = res.data;
|
||||
ids.value = data.value.map((item) => item.id);
|
||||
fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then(async (res) => {
|
||||
let resUnit = await getEnumEnergy({ params: { code: props.resourceType } });
|
||||
unit.value = resUnit.data.unit;
|
||||
data.value = res.data.list;
|
||||
totalActualUsage.value = res.data.actualUsage;
|
||||
totalBudget.value = res.data.budget;
|
||||
totalLastYearActualUsage.value = res.data.lastYearActualUsage;
|
||||
totalReferenceValue.value = res.data.referenceValue;
|
||||
if (data.value.length > 0) {
|
||||
ids.value = data.value.map((item) => item.id);
|
||||
lastActualUsageList.value = data.value.map((item) => item.lastYearActualUsage);
|
||||
formState.value.lastYearList = lastActualUsageList.value;
|
||||
}
|
||||
});
|
||||
};
|
||||
getTableData();
|
||||
@@ -313,14 +338,17 @@
|
||||
{
|
||||
title: Number(props.year) - 1 + '年实际用量',
|
||||
dataIndex: 'lastYearActualUsage',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: props.year + '年实际用量',
|
||||
dataIndex: 'actualUsage',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '基准值',
|
||||
dataIndex: 'referenceValue',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '是否按去年折算',
|
||||
@@ -329,10 +357,12 @@
|
||||
{
|
||||
title: '折算率',
|
||||
dataIndex: 'conversionRate',
|
||||
customRender: ({ text }: { text: number }) => `${text}%`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '2024年预算',
|
||||
dataIndex: 'budget',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -346,10 +376,10 @@
|
||||
const formRef = ref();
|
||||
const formState = ref({});
|
||||
const labelCol = { span: 6 };
|
||||
const wrapperCol = { span: 18 };
|
||||
const wrapperCol = { span: 17 };
|
||||
const editData = (record) => {
|
||||
open.value = true;
|
||||
if (record.isLastYear) {
|
||||
if (record.isLastYear !== undefined) {
|
||||
formState.value.ids = [record.id];
|
||||
if (record.lastYear === '是') {
|
||||
formState.value.isLastYear = 1;
|
||||
@@ -357,6 +387,7 @@
|
||||
formState.value.isLastYear = 0;
|
||||
}
|
||||
formState.value.conversionRate = record.conversionRate;
|
||||
formState.value.lastYearList = [record.lastYearActualUsage];
|
||||
formState.value.budget = record.budget;
|
||||
}
|
||||
};
|
||||
@@ -593,7 +624,7 @@
|
||||
'基准值',
|
||||
],
|
||||
top: '0',
|
||||
left: '0',
|
||||
right: '0',
|
||||
textStyle: {
|
||||
color: '#666',
|
||||
fontSize: 12,
|
||||
@@ -649,6 +680,30 @@
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: props.year + '年预算',
|
||||
type: 'line',
|
||||
// smooth: true, // 开启平滑曲线
|
||||
symbol: 'emptyCircle', //标记的图形为实心圆
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: 'rgba(255, 188, 70, 1)',
|
||||
},
|
||||
},
|
||||
data: budgetList.value,
|
||||
},
|
||||
{
|
||||
name: '基准值',
|
||||
type: 'line',
|
||||
// smooth: true, // 开启平滑曲线
|
||||
symbol: 'emptyCircle', //标记的图形为实心圆
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: 'rgba(195, 142, 255, 1)',
|
||||
},
|
||||
},
|
||||
data: referenceValueList.value,
|
||||
},
|
||||
{
|
||||
name: Number(props.year) - 1 + '年实际用量',
|
||||
type: 'bar',
|
||||
@@ -707,28 +762,6 @@
|
||||
},
|
||||
data: actualUsageList.value,
|
||||
},
|
||||
{
|
||||
name: props.year + '年预算',
|
||||
type: 'line',
|
||||
smooth: true, // 开启平滑曲线
|
||||
symbol: 'none', //标记的图形为实心圆
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 188, 70, 1)',
|
||||
width: 2,
|
||||
},
|
||||
data: budgetList.value,
|
||||
},
|
||||
{
|
||||
name: '基准值',
|
||||
type: 'line',
|
||||
smooth: true, // 开启平滑曲线
|
||||
symbol: 'none', //标记的图形为实心圆
|
||||
lineStyle: {
|
||||
color: 'rgba(195, 142, 255, 1)',
|
||||
width: 2,
|
||||
},
|
||||
data: referenceValueList.value,
|
||||
},
|
||||
],
|
||||
};
|
||||
chartInstance = echarts.init(chartRef.value);
|
||||
@@ -827,8 +860,8 @@
|
||||
background: #f7f9ff;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(222, 255, 246, 1) 100%);
|
||||
border: 1px solid rgba(18, 174, 132, 1);
|
||||
background: linear-gradient(180deg, #ffffff 0%, #defff663 100%);
|
||||
border: 1px solid #12ae8424;
|
||||
.quantity {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
@@ -900,6 +933,11 @@
|
||||
) {
|
||||
display: none !important;
|
||||
}
|
||||
.unit {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 5px;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.editable-row-operations a {
|
||||
|
||||
@@ -69,7 +69,8 @@
|
||||
:parentId="parentId"
|
||||
:year="year"
|
||||
:type="type"
|
||||
:nodeName="nodeName" />
|
||||
:nodeName="nodeName"
|
||||
:resourceType="resourceType" />
|
||||
</div>
|
||||
<!-- 新增节点 -->
|
||||
<a-drawer :visible="visible" :width="500" @close="onClose" :footer-style="{ textAlign: 'right' }">
|
||||
@@ -81,6 +82,7 @@
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkedKeys="treeCheckedKeys"
|
||||
:tree-data="treeData"
|
||||
:checkStrictly="true"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
v-if="treeData && treeData.length > 0"
|
||||
class="draggable-tree"
|
||||
@@ -110,6 +112,7 @@
|
||||
import categoryDeatil from './categoryDeatil.vue';
|
||||
import { group } from '/@/api/deviceManage';
|
||||
import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary';
|
||||
import { getEnumEnergy } from '/@/api';
|
||||
import type { TreeProps } from 'ant-design-vue';
|
||||
import 'echarts-liquidfill';
|
||||
defineOptions({
|
||||
@@ -124,8 +127,6 @@
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
console.log(props, 'xxy');
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
@@ -155,6 +156,9 @@
|
||||
selectedTime.value = false;
|
||||
getMonthData();
|
||||
getBallQuery.value.yearAndMonth = 'month';
|
||||
getBallQuery.value.itemizeIds = [];
|
||||
getBallQuery.value.itemizeId = '';
|
||||
getPillarQuery.value.itemizeId = '';
|
||||
// getMonthPillarData();
|
||||
};
|
||||
const changeToYear = () => {
|
||||
@@ -167,6 +171,9 @@
|
||||
selectedTime.value = true;
|
||||
getYearData();
|
||||
getBallQuery.value.yearAndMonth = 'year';
|
||||
getBallQuery.value.itemizeIds = [];
|
||||
getBallQuery.value.itemizeId = '';
|
||||
getPillarQuery.value.itemizeId = '';
|
||||
// getYearPillarData();
|
||||
};
|
||||
// echarts图
|
||||
@@ -299,8 +306,8 @@
|
||||
symbolSize: [14, 4],
|
||||
symbolMargin: 0.5,
|
||||
symbolPosition: 'start',
|
||||
z: -20,
|
||||
data: actualUsage.value,
|
||||
barGap: '5%',
|
||||
label: {
|
||||
normal: {
|
||||
show: false,
|
||||
@@ -320,8 +327,8 @@
|
||||
symbolSize: [14, 4],
|
||||
symbolMargin: 0.5,
|
||||
symbolPosition: 'start',
|
||||
z: -20,
|
||||
data: budget.value,
|
||||
barGap: '5%',
|
||||
label: {
|
||||
normal: {
|
||||
show: false,
|
||||
@@ -339,7 +346,8 @@
|
||||
color: '#f4664a',
|
||||
width: 2,
|
||||
},
|
||||
data: referenceValue.value,
|
||||
// data: referenceValue.value,
|
||||
data: [600],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -386,7 +394,7 @@
|
||||
textStyle: {
|
||||
color: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
|
||||
insideColor: '#12786f',
|
||||
fontSize: 40,
|
||||
fontSize: Number(ballData) > 1000 ? 20 : 40,
|
||||
},
|
||||
formatter: (params) => {
|
||||
// return `${(params.value * 100).toFixed(2)}%`;
|
||||
@@ -431,7 +439,7 @@
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const treeCheckedKeys = ref<string[]>([]);
|
||||
const checkTreeNode = (checkedKeys, info) => {
|
||||
treeCheckedKeys.value = checkedKeys;
|
||||
treeCheckedKeys.value = checkedKeys.checked;
|
||||
addTreeNode.value.itemizeIds = treeCheckedKeys.value;
|
||||
};
|
||||
const formatTreeData = (treeData) => {
|
||||
@@ -450,7 +458,9 @@
|
||||
year: selectYearValue.value.format('YYYY'),
|
||||
});
|
||||
const onSubmit = () => {
|
||||
fetch(carbonPlanning.addNodes, addTreeNode.value).then((res) => {
|
||||
fetch(carbonPlanning.addNodes, addTreeNode.value).then(async (res) => {
|
||||
let resUnit = await getEnumEnergy({ params: { code: props.energyType } });
|
||||
unit.value = resUnit.data.unit;
|
||||
data.value = res.data;
|
||||
visible.value = false;
|
||||
changeToYear();
|
||||
@@ -459,49 +469,6 @@
|
||||
const onClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
// 表格
|
||||
const columns = ref([
|
||||
{
|
||||
title: '序号',
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '分项名称',
|
||||
dataIndex: 'itemizeName',
|
||||
},
|
||||
{
|
||||
title: '年份',
|
||||
dataIndex: 'year',
|
||||
},
|
||||
{
|
||||
title: '实际用量',
|
||||
dataIndex: 'actualUsage',
|
||||
},
|
||||
{
|
||||
title: '预算量',
|
||||
dataIndex: 'budget',
|
||||
},
|
||||
{
|
||||
title: '基准值',
|
||||
dataIndex: 'referenceValue',
|
||||
},
|
||||
{
|
||||
title: '节能量',
|
||||
dataIndex: 'energyConservation',
|
||||
},
|
||||
{
|
||||
title: '预算达成率',
|
||||
dataIndex: 'budgetAchievement',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
},
|
||||
]);
|
||||
|
||||
const data = ref([]);
|
||||
// 获取年数据
|
||||
const yearQueryParams = ref({
|
||||
orgId: orgId.value,
|
||||
@@ -515,8 +482,13 @@
|
||||
addTreeNode.value.year = selectYearValue.value;
|
||||
getYearData();
|
||||
};
|
||||
// 获取单位
|
||||
const unit = ref();
|
||||
const getYearData = () => {
|
||||
fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then((res) => {
|
||||
treeCheckedKeys.value = [];
|
||||
fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then(async (res) => {
|
||||
let resUnit = await getEnumEnergy({ params: { code: props.energyType } });
|
||||
unit.value = resUnit.data.unit;
|
||||
data.value = res.data;
|
||||
res.data.forEach((item) => {
|
||||
treeCheckedKeys.value.push(item.itemizeId.toString());
|
||||
@@ -540,7 +512,9 @@
|
||||
getMonthData();
|
||||
};
|
||||
const getMonthData = () => {
|
||||
fetch(carbonPlanning.searchListByMonth, monthQueryParams.value).then((res) => {
|
||||
fetch(carbonPlanning.searchListByMonth, monthQueryParams.value).then(async (res) => {
|
||||
let resUnit = await getEnumEnergy({ params: { code: props.energyType } });
|
||||
unit.value = resUnit.data.unit;
|
||||
data.value = res.data;
|
||||
getMonthPillarData();
|
||||
});
|
||||
@@ -553,17 +527,68 @@
|
||||
const year = ref(selectYearValue.value.format('YYYY'));
|
||||
const type = ref();
|
||||
const nodeName = ref();
|
||||
const resourceType = ref();
|
||||
const detailData = (record) => {
|
||||
electricTotal.value = false;
|
||||
parentId.value = record.itemizeId;
|
||||
type.value = props.tabId;
|
||||
nodeName.value = record.itemizeName;
|
||||
resourceType.value = props.energyType;
|
||||
};
|
||||
// 表格
|
||||
const columns = ref([
|
||||
{
|
||||
title: '序号',
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '分项名称',
|
||||
dataIndex: 'itemizeName',
|
||||
},
|
||||
{
|
||||
title: '年份',
|
||||
dataIndex: 'year',
|
||||
},
|
||||
{
|
||||
title: '实际用量',
|
||||
dataIndex: 'actualUsage',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '预算量',
|
||||
dataIndex: 'budget',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '基准值',
|
||||
dataIndex: 'referenceValue',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '节能量',
|
||||
dataIndex: 'energyConservation',
|
||||
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
|
||||
},
|
||||
{
|
||||
title: '预算达成率',
|
||||
dataIndex: 'budgetAchievement',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
},
|
||||
]);
|
||||
|
||||
const data = ref([]);
|
||||
const customRow = (record) => {
|
||||
return {
|
||||
//点击 行 进行查看详情
|
||||
onClick: (event) => {
|
||||
getPillarQuery.value.itemizeIds = [record.itemizeId];
|
||||
getPillarQuery.value.itemizeId = record.itemizeId;
|
||||
getBallQuery.value.itemizeIds = [record.itemizeId];
|
||||
getBallQuery.value.itemizeId = record.itemizeId;
|
||||
if (selectedTime.value) {
|
||||
getYearPillarData();
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
});
|
||||
} else if (key === '4') {
|
||||
tabId.value = 6;
|
||||
energyType.value = 'gongshuiliang';
|
||||
energyType.value = 'GAS_USAGE';
|
||||
nextTick(() => {
|
||||
if (provideWaterRef.value) {
|
||||
provideWaterRef.value.electricTotal = true;
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
.get(planManage.getTableData, {
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||
ctrlType: 2,
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -235,7 +235,7 @@
|
||||
.get(planManage.getTransData, {
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||
ctrlType: 2,
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
class="box-center-button"
|
||||
:style="{
|
||||
backgroundColor: item.title === selectConditioning.title ? '#a7e5ff' : '#b5cdd9',
|
||||
color: item.title === selectConditioning.title ? 'rgb(0, 61, 90)' : '#fff',
|
||||
}"
|
||||
@click="selectConditioningData(item, index)">
|
||||
{{ item.title }}
|
||||
@@ -28,6 +29,7 @@
|
||||
class="box-center-button"
|
||||
:style="{
|
||||
backgroundColor: item.title === selectConditioning.title ? '#a7e5ff' : '#b5cdd9',
|
||||
color: item.title === selectConditioning.title ? 'rgb(0, 61, 90)' : '#fff',
|
||||
}"
|
||||
@click="selectConditioningData(item, index)">
|
||||
{{ item.title }}
|
||||
|
||||
@@ -19,7 +19,13 @@ export const newTrendPosition = [
|
||||
//空调箱
|
||||
export const airConditioningPosition = [
|
||||
{
|
||||
styleText: { left: '13%', bottom: '30%', width: '120px', color: 'rgba(165, 209, 123, 0.5)' },
|
||||
styleText: {
|
||||
left: '13%',
|
||||
bottom: '30%',
|
||||
width: '120px',
|
||||
color: 'rgba(96, 241, 125, 0.2)',
|
||||
border: '1px solid rgba(96, 241, 125, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
{
|
||||
@@ -28,7 +34,8 @@ export const airConditioningPosition = [
|
||||
bottom: '38%',
|
||||
mLeft: '120px',
|
||||
width: '100px',
|
||||
color: 'rgba(217, 223, 179, 0.5)',
|
||||
color: 'rgba(249, 214, 76, 0.2)',
|
||||
border: '1px solid rgba(249, 214, 76, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
@@ -37,17 +44,44 @@ export const airConditioningPosition = [
|
||||
left: '41%',
|
||||
bottom: '55.5%',
|
||||
width: '300px',
|
||||
height: '150px',
|
||||
color: 'rgba(168, 226, 233, 0.5)',
|
||||
height: '160px',
|
||||
color: 'rgba(38, 255, 255, 0.2)',
|
||||
border: '1px solid rgba(38, 255, 255, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
{
|
||||
styleText: {
|
||||
left: '60%',
|
||||
bottom: '63%',
|
||||
width: '315px',
|
||||
height: '180px',
|
||||
color: 'rgba(255, 118, 54, 0.2)',
|
||||
border: '1px solid rgba(255, 118, 54, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
{
|
||||
styleText: {
|
||||
left: '76%',
|
||||
bottom: '63%',
|
||||
width: '90px',
|
||||
color: 'rgba(92, 77, 245, 0.2)',
|
||||
border: '1px solid rgba(92, 77, 245, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
{ styleText: { left: '60%', bottom: '63%' }, lineType: 1 },
|
||||
{ styleText: { left: '76%', bottom: '63%' }, lineType: 1 },
|
||||
{
|
||||
styleText: {
|
||||
left: '71%',
|
||||
bottom: '48%',
|
||||
width: '315px',
|
||||
height: '120px',
|
||||
color: 'rgba(103, 255, 0, 0.2)',
|
||||
border: '1px solid rgba(103, 255, 0, 1)',
|
||||
position: 'absolute',
|
||||
top: '185px',
|
||||
abLeft: '650px',
|
||||
},
|
||||
lineType: '',
|
||||
},
|
||||
@@ -57,8 +91,11 @@ export const airConditioningPosition = [
|
||||
bottom: '32%',
|
||||
width: '300px',
|
||||
height: '150px',
|
||||
mTop: '150px',
|
||||
color: 'rgba(168, 226, 233, 0.5)',
|
||||
color: 'rgba(155, 216, 224, 0.2)',
|
||||
border: '1px solid rgba(155, 216, 224, 1)',
|
||||
position: 'absolute',
|
||||
top: '163px',
|
||||
abLeft: '343px',
|
||||
},
|
||||
lineType: '',
|
||||
},
|
||||
@@ -70,7 +107,8 @@ export const floorHeatingPosition = [
|
||||
left: '13.4%',
|
||||
bottom: '44%',
|
||||
width: '120px',
|
||||
color: 'rgba(242, 209, 156, 0.5)',
|
||||
color: 'rgba(242, 209, 156, 0.2)',
|
||||
border: '1px solid rgba(242, 209, 156, 1)',
|
||||
},
|
||||
lineType: '',
|
||||
},
|
||||
@@ -79,7 +117,8 @@ export const floorHeatingPosition = [
|
||||
left: '21%',
|
||||
bottom: '48%',
|
||||
width: '115px',
|
||||
color: 'rgba(224, 244, 102,0.5)',
|
||||
color: 'rgba(224, 244, 102, 0.2)',
|
||||
border: '1px solid rgba(224, 244, 102, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
@@ -88,7 +127,8 @@ export const floorHeatingPosition = [
|
||||
left: '34.5%',
|
||||
bottom: '53.5%',
|
||||
width: '355px',
|
||||
color: 'rgba(167, 128, 244, 0.5)',
|
||||
color: 'rgba(167, 128, 244, 0.2)',
|
||||
border: '1px solid rgba(167, 128, 244, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
@@ -97,7 +137,8 @@ export const floorHeatingPosition = [
|
||||
left: '47.5%',
|
||||
bottom: '60.3%',
|
||||
width: '90px',
|
||||
color: 'rgba(155, 216, 224, 0.5)',
|
||||
color: 'rgba(155, 216, 224, 0.2)',
|
||||
border: '1px solid rgba(155, 216, 224, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
@@ -106,7 +147,8 @@ export const floorHeatingPosition = [
|
||||
left: '60.5%',
|
||||
bottom: '65.5%',
|
||||
width: '350px',
|
||||
color: 'rgba(222, 111, 141, 0.5)',
|
||||
color: 'rgba(222, 111, 141, 0.2)',
|
||||
border: '1px solid rgba(222, 111, 141, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
@@ -115,7 +157,8 @@ export const floorHeatingPosition = [
|
||||
left: '73%',
|
||||
bottom: '72%',
|
||||
width: '140px',
|
||||
color: 'rgba(152, 190, 162, 0.5)',
|
||||
color: 'rgba(152, 190, 162, 0.2)',
|
||||
border: '1px solid rgba(152, 190, 162, 1)',
|
||||
},
|
||||
lineType: 1,
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="map-box">
|
||||
<!-- 温度 -->
|
||||
<div v-if="selectIndex === 1">
|
||||
<div v-if="selectIndex === 0">
|
||||
<template v-for="(item, index) in sensorData" :key="index">
|
||||
<div
|
||||
style="position: absolute"
|
||||
@@ -76,7 +76,7 @@
|
||||
<newTrendModel :dataSource="newTrend" />
|
||||
</a-drawer>
|
||||
<!-- 空调箱 -->
|
||||
<div v-if="selectIndex === 0">
|
||||
<div v-if="selectIndex === 3">
|
||||
<template v-for="(item, index) in conditioningData" :key="index">
|
||||
<div
|
||||
style="position: absolute; z-index: 2"
|
||||
@@ -116,7 +116,7 @@
|
||||
ref="conditioningModels"
|
||||
@selectConditioningData="selectConditioningData" />
|
||||
</a-drawer>
|
||||
<div v-if="selectIndex === 0" class="area">
|
||||
<div v-if="selectIndex === 3" class="area-air">
|
||||
<div
|
||||
v-for="(item, index) in airConditioningPosition"
|
||||
:key="index"
|
||||
@@ -126,7 +126,10 @@
|
||||
height: item.styleText.height,
|
||||
background: item.styleText.color,
|
||||
marginLeft: item.styleText.mLeft,
|
||||
marginTop: item.styleText.mTop,
|
||||
position: item.styleText.position,
|
||||
top: item.styleText.top,
|
||||
left: item.styleText.abLeft,
|
||||
border: item.styleText.border,
|
||||
}">
|
||||
</div>
|
||||
</div>
|
||||
@@ -165,12 +168,16 @@
|
||||
src="../image/airConditioningSystem/floorHeatingIcon.png" />
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="selectIndex === 4" class="area">
|
||||
<div v-if="selectIndex === 4" class="area-air">
|
||||
<div
|
||||
v-for="(item, index) in floorHeatingData"
|
||||
:key="index"
|
||||
style="display: flex"
|
||||
:style="{ width: item.styleText.width, background: item.styleText.color }">
|
||||
:style="{
|
||||
width: item.styleText.width,
|
||||
background: item.styleText.color,
|
||||
border: item.styleText.border,
|
||||
}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 地暖详情 -->
|
||||
@@ -223,8 +230,6 @@
|
||||
} from './devicePosition';
|
||||
// 全局变量
|
||||
const state = items();
|
||||
onMounted(() => {});
|
||||
onUnmounted(() => {});
|
||||
//图例
|
||||
const legend = ref([
|
||||
{ url: temperature, name: '温度' },
|
||||
@@ -240,105 +245,9 @@
|
||||
//人流
|
||||
const peopleData = ref([]);
|
||||
//新风主机
|
||||
const newTrend = ref([
|
||||
{
|
||||
title: 'D区新风主机',
|
||||
styleText: { left: '43%', bottom: '44%' },
|
||||
type: '新风主机',
|
||||
unit: '℃',
|
||||
number: 10,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: 'C区新风主机',
|
||||
styleText: { left: '45%', bottom: '23%' },
|
||||
type: '新风主机',
|
||||
number: 20,
|
||||
unit: '℃',
|
||||
},
|
||||
{
|
||||
title: 'B区新风主机',
|
||||
styleText: { left: '61.5%', bottom: '54%' },
|
||||
type: '新风主机',
|
||||
unit: '℃',
|
||||
number: 20,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: 'A区新风主机',
|
||||
styleText: { left: '63%', bottom: '36%' },
|
||||
type: '新风主机',
|
||||
number: 30,
|
||||
unit: '℃',
|
||||
},
|
||||
]);
|
||||
const newTrend = ref([]);
|
||||
//空调箱
|
||||
const conditioningData = ref([
|
||||
{
|
||||
title: '走廊区',
|
||||
styleText: { left: '13%', bottom: '23%' },
|
||||
type: '空调箱',
|
||||
lineType: 1,
|
||||
enableRules: 1,
|
||||
unit: '℃',
|
||||
number: 20,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: '西区',
|
||||
styleText: { left: '28%', bottom: '28%' },
|
||||
type: '空调箱',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
number: 34,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: '西北区',
|
||||
styleText: { left: '38%', bottom: '45.5%' },
|
||||
type: '空调箱',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
number: 34,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: '东北区',
|
||||
styleText: { left: '57%', bottom: '53%' },
|
||||
lineType: 1,
|
||||
type: '空调箱',
|
||||
unit: '℃',
|
||||
number: 34,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: '东区',
|
||||
styleText: { left: '73%', bottom: '53%' },
|
||||
lineType: 1,
|
||||
type: '空调箱',
|
||||
unit: '℃',
|
||||
number: 34,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: '东南区',
|
||||
styleText: { left: '68%', bottom: '38%' },
|
||||
lineType: 2,
|
||||
type: '空调箱',
|
||||
unit: '℃',
|
||||
number: 15,
|
||||
url: freshAir,
|
||||
},
|
||||
{
|
||||
title: '西南区',
|
||||
styleText: { left: '43.5%', bottom: '22%' },
|
||||
lineType: 2,
|
||||
type: '空调箱',
|
||||
unit: '℃',
|
||||
number: 15,
|
||||
url: freshAir,
|
||||
},
|
||||
]);
|
||||
const conditioningData = ref([]);
|
||||
const conditioningModels = ref(null);
|
||||
//选择的空调箱
|
||||
const selectConditioning = ref({});
|
||||
@@ -350,61 +259,7 @@
|
||||
}, 100);
|
||||
};
|
||||
// 地暖
|
||||
const floorHeatingData = ref([
|
||||
{
|
||||
title: '走廊西地暖',
|
||||
styleText: { left: '13.5%', bottom: '34%' },
|
||||
type: '地暖',
|
||||
unit: '℃',
|
||||
number: 10,
|
||||
setUpNumber: 12,
|
||||
},
|
||||
{
|
||||
title: '站厅西地暖',
|
||||
styleText: { left: '19.5%', bottom: '38.5%' },
|
||||
type: '地暖',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
number: 10,
|
||||
setUpNumber: 14,
|
||||
},
|
||||
{
|
||||
title: '站厅西地暖',
|
||||
styleText: { left: '33%', bottom: '43%' },
|
||||
type: '地暖',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
number: 24,
|
||||
setUpNumber: 16,
|
||||
},
|
||||
{
|
||||
title: '安检区地暖',
|
||||
styleText: { left: '46%', bottom: '49.5%' },
|
||||
type: '地暖',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
number: 40,
|
||||
setUpNumber: 18,
|
||||
},
|
||||
{
|
||||
title: '站厅东地暖',
|
||||
styleText: { left: '57.5%', bottom: '56%' },
|
||||
type: '地暖',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
number: 10,
|
||||
setUpNumber: 20,
|
||||
},
|
||||
{
|
||||
title: '办公东地暖',
|
||||
styleText: { left: '69.5%', bottom: '62%' },
|
||||
type: '地暖',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
number: 10,
|
||||
setUpNumber: 22,
|
||||
},
|
||||
]);
|
||||
const floorHeatingData = ref([]);
|
||||
// 选择的图例
|
||||
const selectIndex = ref(0);
|
||||
const selectLegend = (item: any, index: any) => {
|
||||
@@ -567,7 +422,7 @@
|
||||
clearInterval(intervalId);
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
<style lang="less">
|
||||
.legend-box {
|
||||
width: 80px;
|
||||
height: 100%;
|
||||
@@ -619,7 +474,7 @@
|
||||
perspective-origin: 900px 43px;
|
||||
}
|
||||
|
||||
.map-box .area {
|
||||
.map-box .area-air {
|
||||
position: absolute;
|
||||
bottom: 230px;
|
||||
left: 250px;
|
||||
|
||||
@@ -0,0 +1,966 @@
|
||||
<template>
|
||||
<div class="box-cold">
|
||||
<!-- 空气源热泵 -->
|
||||
<template v-for="(item, index) in airSourceThermalCollapse" :key="index">
|
||||
<div
|
||||
style="
|
||||
width: 135px;
|
||||
height: 200px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
color: #ffff80;
|
||||
z-index: 2;
|
||||
"
|
||||
:style="{ left: item.style.mLeft, bottom: item.style.mBottom }">
|
||||
<div style="width: 100%; height: 20px; color: rgb(128, 255, 255)">
|
||||
{{ item.deviceInfoName }}
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
模式: <span style="color: #fff">{{ item.type }}</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
设定温度: <span style="color: #fff">{{ item.number }}</span>
|
||||
</div>
|
||||
<img
|
||||
style="position: absolute; width: 135px; height: 130px; left: -20px; top: 40px"
|
||||
:src="item.url" />
|
||||
</div>
|
||||
</template>
|
||||
<!-- 水泵 -->
|
||||
<div
|
||||
style="
|
||||
width: 111px;
|
||||
height: 110px;
|
||||
position: relative;
|
||||
left: 1%;
|
||||
bottom: 50%;
|
||||
position: absolute;
|
||||
">
|
||||
<a-switch
|
||||
:checked="selectAllCheckbox === 1 ? true : false"
|
||||
size="small"
|
||||
:disabled="true"
|
||||
style="top: 20px; left: -10px; position: absolute"
|
||||
:class="{
|
||||
'blue-background': selectAllCheckbox === 1 ? true : false,
|
||||
'grey-background': selectAllCheckbox === 1 ? false : true,
|
||||
}"
|
||||
@change="toggleAllSelection" />
|
||||
<img style="display: flex; width: 111px; height: 100px" :src="waterPumpSrc" />
|
||||
<div style="width: 100%; height: 20px; color: rgb(128, 255, 255)"> 水泵 </div>
|
||||
</div>
|
||||
<!-- 螺杆式地源热泵 -->
|
||||
<template v-for="(item, index) in screwGeothermalHeatPump" :key="index">
|
||||
<div
|
||||
style="
|
||||
width: 101.21px;
|
||||
height: 101.21px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
color: #ffff80;
|
||||
z-index: 2;
|
||||
"
|
||||
:style="{ left: item.style.mLeft, bottom: item.style.mBottom }">
|
||||
<img
|
||||
style="position: absolute; width: 101.21px; height: 101.21px; left: 42%; top: -80%"
|
||||
:src="item.url" />
|
||||
<div style="width: 100%; height: 20px; color: rgb(128, 255, 255); z-index: 2">
|
||||
{{ item.deviceInfoName }}
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
模式: <span style="color: #fff">{{ item.type }}</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
设定温度: <span style="color: #fff">{{ item.number }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 稀冷泵 -->
|
||||
<template v-for="(item, index) in diluteCoolingPump" :key="index">
|
||||
<div
|
||||
style="
|
||||
width: 135px;
|
||||
height: 200px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
color: #ffff80;
|
||||
z-index: 2;
|
||||
"
|
||||
:style="{ left: item.style.mLeft, bottom: item.style.mBottom }">
|
||||
<div style="width: 100%; height: 20px; color: rgb(128, 255, 255)">
|
||||
{{ item.deviceInfoName }}
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
出水温度: <span style="color: #fff">{{ item.number }}</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
流量: <span style="color: #fff">{{ item.lNumber }}</span>
|
||||
</div>
|
||||
<img
|
||||
style="position: absolute; width: 117.42px; height: 106.31px; left: -20px; top: 60px"
|
||||
:src="item.url" />
|
||||
</div>
|
||||
</template>
|
||||
<!-- 冷热水双蓄储能罐 -->
|
||||
<template v-for="(item, index) in coldWater" :key="index">
|
||||
<div
|
||||
style="
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
color: #ffff80;
|
||||
z-index: 2;
|
||||
"
|
||||
:style="{ left: item.style.mLeft, bottom: item.style.mBottom }">
|
||||
<div style="width: 100%; height: 20px; color: rgb(128, 255, 255)">
|
||||
{{ item.deviceInfoName }}
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
出水温度: <span style="color: #fff">{{ item.number }}</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
容量: <span style="color: #fff">{{ item.rNumber }}</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 20px">
|
||||
流量: <span style="color: #fff">{{ item.lNumber }}</span>
|
||||
</div>
|
||||
<img
|
||||
style="position: absolute; width: 110px; height: 110px; left: -20px; top: 80px"
|
||||
:src="item.url" />
|
||||
</div>
|
||||
</template>
|
||||
<!-- 用户水泵 -->
|
||||
<template v-for="(item, index) in userWaterPump" :key="index">
|
||||
<div
|
||||
style="
|
||||
width: 70.85px;
|
||||
height: 70.85px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
"
|
||||
:style="{ left: item.style.mLeft, bottom: item.style.mBottom }">
|
||||
<a-switch
|
||||
:checked="item.user === 1 ? true : false"
|
||||
size="small"
|
||||
:disabled="true"
|
||||
style="position: absolute; left: 30px; bottom: 0px; z-index: 2"
|
||||
:class="{
|
||||
'blue-background': item.user === 1 ? true : false,
|
||||
'grey-background': item.user === 1 ? false : true,
|
||||
}" />
|
||||
<img
|
||||
style="
|
||||
display: flex;
|
||||
width: 70.85px;
|
||||
height: 70.85px;
|
||||
transform: rotateX(-4deg) rotateY(180deg) rotateZ(1deg);
|
||||
"
|
||||
:src="waterPumpSrc" />
|
||||
<div
|
||||
style="
|
||||
color: rgb(128, 255, 255);
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: -40px;
|
||||
top: 30px;
|
||||
transform: rotateZ(-24deg);
|
||||
"
|
||||
>{{ item.deviceInfoName }}</div
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 集水器 -->
|
||||
<div
|
||||
style="
|
||||
width: 226.19px;
|
||||
height: 186.19px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: 66%;
|
||||
bottom: 54%;
|
||||
z-index: 2;
|
||||
">
|
||||
<div style="position: absolute; left: 24%; color: rgb(128, 255, 255)">集水器</div>
|
||||
<img
|
||||
style="width: 226.19px; height: 176.19px; transform: rotateY(13deg)"
|
||||
:src="manifoldSrc" />
|
||||
</div>
|
||||
<!-- 定压补水装置 -->
|
||||
<template v-for="(item, index) in pressureWater" :key="index">
|
||||
<div
|
||||
style="width: 137px; height: 137px; position: relative; position: absolute; z-index: 2"
|
||||
:style="{ left: item.style.mLeft, bottom: item.style.mBottom }">
|
||||
<img style="width: 137px; height: 127px; transform: rotateY(157deg)" :src="item.url" />
|
||||
<a-switch
|
||||
:checked="item.user === 1 ? true : false"
|
||||
size="small"
|
||||
:disabled="true"
|
||||
style="position: absolute; left: 40px; bottom: 0px"
|
||||
:class="{
|
||||
'blue-background': item.user === 1 ? true : false,
|
||||
'grey-background': item.user === 1 ? false : true,
|
||||
}" />
|
||||
<div
|
||||
style="
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
color: rgb(128, 255, 255);
|
||||
position: absolute;
|
||||
bottom: -40px;
|
||||
font-size: 12px;
|
||||
">
|
||||
<div> {{ item.deviceInfoName }}</div>
|
||||
<div style="width: 100%; height: 20px; color: #ffff80">
|
||||
压差: <span style="color: #fff">{{ item.yc }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 软化水箱 -->
|
||||
<div
|
||||
style="
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
left: 40%;
|
||||
bottom: 2%;
|
||||
z-index: 2;
|
||||
">
|
||||
<img
|
||||
style="
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
transform: rotateX(3deg) rotateY(157deg) rotateZ(356deg);
|
||||
"
|
||||
:src="softenedWaterTankSrc" />
|
||||
<div style="color: rgb(128, 255, 255); font-size: 12px; position: absolute; bottom: -10px"
|
||||
>软化水箱</div
|
||||
>
|
||||
</div>
|
||||
<!-- 软化水装置 -->
|
||||
<div
|
||||
style="
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
left: 47%;
|
||||
bottom: 11%;
|
||||
z-index: 2;
|
||||
">
|
||||
<img style="width: 110px; height: 110px" :src="coldWaterSrc" />
|
||||
<div style="color: rgb(128, 255, 255); font-size: 12px; position: absolute; left: 20px"
|
||||
>软化水装置</div
|
||||
>
|
||||
</div>
|
||||
<!-- 循环水处理器 -->
|
||||
<div
|
||||
style="
|
||||
width: 116.39px;
|
||||
height: 116.39px;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
left: 54%;
|
||||
bottom: 15%;
|
||||
font-size: 12px;
|
||||
z-index: 2;
|
||||
">
|
||||
<img
|
||||
style="
|
||||
width: 116.39px;
|
||||
height: 116.39px;
|
||||
transform: rotateX(3deg) rotateY(157deg) rotateZ(356deg);
|
||||
"
|
||||
:src="waterProcessorSrc" />
|
||||
<div style="position: absolute; left: 24%; color: rgb(128, 255, 255)">循环水处理器</div>
|
||||
</div>
|
||||
<!-- 地源水泵 -->
|
||||
<template v-for="(item, index) in waterPump" :key="index">
|
||||
<div
|
||||
style="
|
||||
width: 70.85px;
|
||||
height: 70.85px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
"
|
||||
:style="{ left: item.style.mLeft, bottom: item.style.mBottom }">
|
||||
<a-switch
|
||||
:checked="item.user === 1 ? true : false"
|
||||
size="small"
|
||||
:disabled="true"
|
||||
style="position: absolute; left: 30px; bottom: 0px; z-index: 2"
|
||||
:class="{
|
||||
'blue-background': item.user === 1 ? true : false,
|
||||
'grey-background': item.user === 1 ? false : true,
|
||||
}" />
|
||||
<img
|
||||
style="
|
||||
display: flex;
|
||||
width: 70.85px;
|
||||
height: 70.85px;
|
||||
transform: rotateX(-4deg) rotateY(180deg) rotateZ(1deg);
|
||||
"
|
||||
:src="waterPumpSrc" />
|
||||
<div
|
||||
style="
|
||||
color: rgb(128, 255, 255);
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: -40px;
|
||||
top: 30px;
|
||||
transform: rotateZ(-24deg);
|
||||
"
|
||||
>{{ item.deviceInfoName }}</div
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 分水器 -->
|
||||
<div
|
||||
style="
|
||||
width: 216.19px;
|
||||
height: 186.19px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: 80%;
|
||||
bottom: 38%;
|
||||
z-index: 2;
|
||||
">
|
||||
<div style="position: absolute; left: 24%; color: rgb(128, 255, 255)">分水器</div>
|
||||
<img
|
||||
style="width: 226.19px; height: 176.19px; transform: rotateY(13deg)"
|
||||
:src="manifoldSrc" />
|
||||
</div>
|
||||
<!-- 土壤耦合器 -->
|
||||
<div
|
||||
style="
|
||||
width: 290.75px;
|
||||
height: 215.29px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: 77%;
|
||||
bottom: 6.5%;
|
||||
">
|
||||
<div style="position: absolute; left: 60%; color: rgb(128, 255, 255); bottom: 5%"
|
||||
>土壤耦合器</div
|
||||
>
|
||||
<img style="width: 290.75px; height: 215.29px" :src="soilCouplerSrc" />
|
||||
</div>
|
||||
<!-- 线 -->
|
||||
<template v-for="(item, index) in line" :key="index">
|
||||
<div
|
||||
style="height: 12px; position: absolute; border-radius: 4px"
|
||||
:style="{
|
||||
'background-image': 'url(' + item.url + ')',
|
||||
left: item.style.mLeft,
|
||||
width: item.style.width,
|
||||
bottom: item.style.mBottom,
|
||||
transform: item.style.transform,
|
||||
'z-index': item.style.zIndex,
|
||||
}">
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted } from 'vue';
|
||||
//图片资源
|
||||
import airSourceThermalCollapseSrc from '../image/coldAndHeatSources/airSourceThermalCollapse.png';
|
||||
import waterPumpSrc from '../image/coldAndHeatSources/waterPump.png';
|
||||
import screwGeothermalHeatPumpSrc from '../image/coldAndHeatSources/screwGeothermalHeatPump.png';
|
||||
import diluteCoolingPumpSrc from '../image/coldAndHeatSources/diluteCoolingPump.png';
|
||||
import coldWaterSrc from '../image/coldAndHeatSources/coldWater.png';
|
||||
import manifoldSrc from '../image/coldAndHeatSources/manifold.png';
|
||||
import pressureWaterSrc from '../image/coldAndHeatSources/pressureWater.png';
|
||||
import softenedWaterTankSrc from '../image/coldAndHeatSources/softenedWaterTank.png';
|
||||
import waterProcessorSrc from '../image/coldAndHeatSources/waterProcessor.png';
|
||||
import soilCouplerSrc from '../image/coldAndHeatSources/soilCoupler.png';
|
||||
import blueGif from '../image/coldAndHeatSources/blue.gif';
|
||||
import bluePng from '../image/coldAndHeatSources/blue.png';
|
||||
import greenGif from '../image/coldAndHeatSources/green.gif';
|
||||
import greenPng from '../image/coldAndHeatSources/green.png';
|
||||
const line = ref([
|
||||
//水泵线-热泵
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '36%',
|
||||
mLeft: '1%',
|
||||
mBottom: '77%',
|
||||
transform: 'rotateZ(-23deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '35%',
|
||||
mLeft: '15%',
|
||||
mBottom: '56%',
|
||||
transform: 'rotateZ(-23deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '16.5%',
|
||||
mLeft: '13%',
|
||||
mBottom: '62.5%',
|
||||
transform: 'rotateZ(-144deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '16.5%',
|
||||
mLeft: '19%',
|
||||
mBottom: '67.5%',
|
||||
transform: 'rotateZ(-144deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '16.5%',
|
||||
mLeft: '25%',
|
||||
mBottom: '73.5%',
|
||||
transform: 'rotateZ(-144deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '16.5%',
|
||||
mLeft: '33.5%',
|
||||
mBottom: '81.5%',
|
||||
transform: 'rotateZ(-144deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
//水泵 - 定压补水
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '41%',
|
||||
mLeft: '3%',
|
||||
mBottom: '27.5%',
|
||||
transform: 'rotateZ(213deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
// 线 - 稀冷泵
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '9%',
|
||||
mLeft: '23.5%',
|
||||
mBottom: '31%',
|
||||
transform: 'rotateZ(-23deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
//热泵 - 冷热水双蓄储能罐
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '12.5%',
|
||||
mLeft: '25.5%',
|
||||
mBottom: '37%',
|
||||
transform: 'rotateZ(213deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
//冷热水双蓄储能罐 - 用户水泵
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '10%',
|
||||
mLeft: '47%',
|
||||
mBottom: '47.8%',
|
||||
transform: 'rotateZ(203deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '20%',
|
||||
mLeft: '37%',
|
||||
mBottom: '41.5%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '4%',
|
||||
mLeft: '47%',
|
||||
mBottom: '54%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '4%',
|
||||
mLeft: '56%',
|
||||
mBottom: '46%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
//第二段线
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '17.5%',
|
||||
mLeft: '53%',
|
||||
mBottom: '70%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '2%',
|
||||
mLeft: '68.2%',
|
||||
mBottom: '77%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '16.5%',
|
||||
mLeft: '57.9%',
|
||||
mBottom: '65%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '1%',
|
||||
mLeft: '72.8%',
|
||||
mBottom: '72%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '15%',
|
||||
mLeft: '62%',
|
||||
mBottom: '60.3%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '1%',
|
||||
mLeft: '75%',
|
||||
mBottom: '68%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
//软水箱 - 地源水泵
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '34.5%',
|
||||
mLeft: '38.5%',
|
||||
mBottom: '20%',
|
||||
transform: 'rotateZ(-27deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '4%',
|
||||
mLeft: '62%',
|
||||
mBottom: '40%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '4%',
|
||||
mLeft: '72%',
|
||||
mBottom: '30%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '11.5%',
|
||||
mLeft: '62%',
|
||||
mBottom: '33%',
|
||||
transform: 'rotateZ(203deg)',
|
||||
},
|
||||
},
|
||||
//第二段线
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '16.5%',
|
||||
mLeft: '68%',
|
||||
mBottom: '55%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '2.5%',
|
||||
mLeft: '82%',
|
||||
mBottom: '61.3%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '15.5%',
|
||||
mLeft: '73%',
|
||||
mBottom: '49.5%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '1.5%',
|
||||
mLeft: '86.5%',
|
||||
mBottom: '56.3%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '13%',
|
||||
mLeft: '78%',
|
||||
mBottom: '44.5%',
|
||||
transform: 'rotateZ(-32deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '1%',
|
||||
mLeft: '89%',
|
||||
mBottom: '52.3%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
zIndex: 3,
|
||||
},
|
||||
},
|
||||
//回温水线段
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '2.5%',
|
||||
mLeft: '71.5%',
|
||||
mBottom: '61.5%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '11.5%',
|
||||
mLeft: '72%',
|
||||
mBottom: '65%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '22%',
|
||||
mLeft: '80.5%',
|
||||
mBottom: '58%',
|
||||
transform: 'rotateZ(213deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: greenPng,
|
||||
style: {
|
||||
width: '9%',
|
||||
mLeft: '92.5%',
|
||||
mBottom: '38%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
//供水水线段
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '2.5%',
|
||||
mLeft: '85.5%',
|
||||
mBottom: '44.5%',
|
||||
transform: 'rotateZ(-28deg) rotatez(-63deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '8%',
|
||||
mLeft: '86%',
|
||||
mBottom: '46%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '5%',
|
||||
mLeft: '92.5%',
|
||||
mBottom: '47%',
|
||||
transform: 'rotateZ(213deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '23%',
|
||||
mLeft: '75.5%',
|
||||
mBottom: '32.5%',
|
||||
transform: 'rotateZ(-28deg)',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: bluePng,
|
||||
style: {
|
||||
width: '7%',
|
||||
mLeft: '76%',
|
||||
mBottom: '17%',
|
||||
transform: 'rotateZ(213deg) rotateY(180deg)',
|
||||
},
|
||||
},
|
||||
]);
|
||||
const airSourceThermalCollapse = ref([
|
||||
{
|
||||
deviceInfoName: '1#空气源热泵',
|
||||
type: '制热',
|
||||
number: '40℃',
|
||||
style: {
|
||||
mLeft: '17%',
|
||||
mBottom: '54%',
|
||||
},
|
||||
url: airSourceThermalCollapseSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '2#空气源热泵',
|
||||
type: '制热',
|
||||
number: '40℃',
|
||||
style: {
|
||||
mLeft: '24%',
|
||||
mBottom: '59%',
|
||||
},
|
||||
url: airSourceThermalCollapseSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '3#空气源热泵',
|
||||
type: '制热',
|
||||
number: '40℃',
|
||||
style: {
|
||||
mLeft: '31%',
|
||||
mBottom: '66%',
|
||||
},
|
||||
url: airSourceThermalCollapseSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '4#空气源热泵',
|
||||
type: '制热',
|
||||
number: '40℃',
|
||||
style: {
|
||||
mLeft: '38%',
|
||||
mBottom: '73%',
|
||||
},
|
||||
url: airSourceThermalCollapseSrc,
|
||||
},
|
||||
]);
|
||||
//螺杆式地源热泵
|
||||
const screwGeothermalHeatPump = ref([
|
||||
{
|
||||
deviceInfoName: '1#螺杆式地源热泵',
|
||||
type: '制热',
|
||||
number: '40℃',
|
||||
style: {
|
||||
mLeft: '9.5%',
|
||||
mBottom: '22.5%',
|
||||
},
|
||||
url: screwGeothermalHeatPumpSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '2#螺杆式地源热泵',
|
||||
type: '制热',
|
||||
number: '40℃',
|
||||
style: {
|
||||
mLeft: '18.5%',
|
||||
mBottom: '31.5%',
|
||||
},
|
||||
url: screwGeothermalHeatPumpSrc,
|
||||
},
|
||||
]);
|
||||
//稀冷泵
|
||||
const diluteCoolingPump = ref([
|
||||
{
|
||||
deviceInfoName: '稀冷泵',
|
||||
number: '40℃',
|
||||
lNumber: '139 m3/h',
|
||||
style: {
|
||||
mLeft: '30%',
|
||||
mBottom: '29%',
|
||||
},
|
||||
url: diluteCoolingPumpSrc,
|
||||
},
|
||||
]);
|
||||
//冷热水双蓄储能罐
|
||||
const coldWater = ref([
|
||||
{
|
||||
deviceInfoName: '冷热水双蓄储能罐',
|
||||
number: '40℃',
|
||||
lNumber: '139 m3/h',
|
||||
rNumber: '135L',
|
||||
style: {
|
||||
mLeft: '36%',
|
||||
mBottom: '39%',
|
||||
},
|
||||
url: coldWaterSrc,
|
||||
},
|
||||
]);
|
||||
//用户水泵
|
||||
const userWaterPump = ref([
|
||||
{
|
||||
deviceInfoName: '1#用户水泵',
|
||||
number: '40℃',
|
||||
user: 1,
|
||||
style: {
|
||||
mLeft: '50%',
|
||||
mBottom: '55.5%',
|
||||
},
|
||||
url: waterPumpSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '2#用户水泵',
|
||||
number: '40℃',
|
||||
user: 1,
|
||||
style: {
|
||||
mLeft: '55%',
|
||||
mBottom: '51%',
|
||||
},
|
||||
url: waterPumpSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '3#用户水泵',
|
||||
number: '40℃',
|
||||
user: 1,
|
||||
style: {
|
||||
mLeft: '59%',
|
||||
mBottom: '47%',
|
||||
},
|
||||
url: waterPumpSrc,
|
||||
},
|
||||
]);
|
||||
//地源水泵
|
||||
const waterPump = ref([
|
||||
{
|
||||
deviceInfoName: '1#地源水泵',
|
||||
number: '40℃',
|
||||
user: 1,
|
||||
style: {
|
||||
mLeft: '65%',
|
||||
mBottom: '41%',
|
||||
},
|
||||
url: waterPumpSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '2#地源水泵',
|
||||
number: '40℃',
|
||||
user: 1,
|
||||
style: {
|
||||
mLeft: '70%',
|
||||
mBottom: '36%',
|
||||
},
|
||||
url: waterPumpSrc,
|
||||
},
|
||||
{
|
||||
deviceInfoName: '3#地源水泵',
|
||||
number: '40℃',
|
||||
user: 1,
|
||||
style: {
|
||||
mLeft: '75%',
|
||||
mBottom: '31%',
|
||||
},
|
||||
url: waterPumpSrc,
|
||||
},
|
||||
]);
|
||||
// 定压补水装置
|
||||
const pressureWater = ref([
|
||||
{
|
||||
deviceInfoName: '定压补水装置',
|
||||
yc: '0.05 Bar',
|
||||
user: 1,
|
||||
style: {
|
||||
mLeft: '29.4%',
|
||||
mBottom: '8.4%',
|
||||
},
|
||||
url: pressureWaterSrc,
|
||||
},
|
||||
]);
|
||||
const selectAllCheckbox = ref(1);
|
||||
onMounted(() => {});
|
||||
onUnmounted(() => {});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box-cold {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 10, 48, 1);
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
position: relative;
|
||||
color: white;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ant-switch-checked {
|
||||
background-color: #04d919 !important;
|
||||
}
|
||||
.grey-background.ant-switch .ant-switch-handle {
|
||||
background-color: rgba(238, 238, 238, 1) !important;
|
||||
}
|
||||
|
||||
.grey-background.ant-switch {
|
||||
background-color: grey !important;
|
||||
}
|
||||
:deep(.ant-switch-handle::before) {
|
||||
background-color: rgba(0, 0, 0, 1) !important;
|
||||
}
|
||||
|
||||
.grey-background.ant-switch .ant-switch-handle {
|
||||
background-color: grey !important;
|
||||
}
|
||||
:deep(.ant-switch-disabled) {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 409 B |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 18 KiB |
@@ -162,7 +162,7 @@
|
||||
.get(planManage.getTableData, {
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||
ctrlType: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -236,7 +236,7 @@
|
||||
.get(planManage.getTransData, {
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||
ctrlType: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -166,6 +166,7 @@
|
||||
name: 'energyAlarmEdit',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
handle: (data: any) => {
|
||||
console.log(mainRef.value, '数据');
|
||||
if (data?.executeStatus?.value === 2) {
|
||||
NsMessage.warning('当前计划正在执行,无法进行编辑。如需编辑,请先停止计划.');
|
||||
} else {
|
||||
@@ -191,7 +192,7 @@
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: (data: any) => {
|
||||
http.post(planToAddApi.updPlan, { id: data.id, isDeleted: 1 }).then((res) => {
|
||||
http.post(planToAddApi.updPlan, [data.id]).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
NsMessage.success('操作成功');
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
|
||||
@@ -1,18 +1,52 @@
|
||||
<template>
|
||||
<!-- 分区部分 -->
|
||||
<div>
|
||||
<div class="light-area">
|
||||
<div class="light-area-tab"></div>
|
||||
<span class="light-area-text"> 设备分区 </span>
|
||||
</div>
|
||||
<!-- 照明区域按钮部分 -->
|
||||
<div class="area">
|
||||
<template v-if="!showAllButtonsArea">
|
||||
<button
|
||||
v-for="(button, index) in limitedButtons1"
|
||||
:key="index"
|
||||
:class="{ btn: true, selected: button.selected }"
|
||||
@click="changeArea(button)">
|
||||
{{ button.name }}
|
||||
</button>
|
||||
<div style="margin-top: 10px">
|
||||
<span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<button
|
||||
v-for="(button, index) in props.treeData"
|
||||
:key="index"
|
||||
:class="{ btn: true, selected: button.selected }"
|
||||
@click="changeArea(button)">
|
||||
{{ button.name }}
|
||||
</button>
|
||||
<div style="margin-top: 10px">
|
||||
<span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 设备部分 -->
|
||||
<div>
|
||||
<div class="circuit-area">
|
||||
<div class="circuit-tab"></div>
|
||||
<span class="circuit-text">{{ props.type }}</span>
|
||||
<div class="btn2">
|
||||
<a-badge :offset="[-10, 2]" :count="lockList.length">
|
||||
<!-- <a-badge :offset="[-10, 2]" :count="lockList.length">
|
||||
<button
|
||||
class="openPlan"
|
||||
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }"
|
||||
@click="togglePlan2">
|
||||
{{ isPlanEnabled2 ? '启用开关' : '禁用开关' }}
|
||||
</button>
|
||||
</a-badge>
|
||||
</a-badge> -->
|
||||
<a-switch
|
||||
v-model:checked="selectAllCheckbox"
|
||||
:disabled="singleSelection"
|
||||
@@ -35,9 +69,9 @@
|
||||
:class="{ btn: true, selected: button.selected }"
|
||||
class="zmhlbtn"
|
||||
@click="changeLine(button)">
|
||||
<div v-if="button.lockStatus" class="btn-back">
|
||||
<!-- <div v-if="button.lockStatus" class="btn-back">
|
||||
<stop-outlined />
|
||||
</div>
|
||||
</div> -->
|
||||
{{ button.name }}
|
||||
</button>
|
||||
<div style="margin-top: 10px">
|
||||
@@ -147,9 +181,13 @@
|
||||
<div class="btn-item">
|
||||
<div class="left">控制模式</div>
|
||||
<div class="right">
|
||||
<span>{{ item.stateBefore.autoStatus.label.replace('模式', '') }}</span>
|
||||
<span>{{
|
||||
item.stateBefore.autoStatus.label ? item.stateBefore.autoStatus.label : '--'
|
||||
}}</span>
|
||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||
<span>{{ item.stateAfter.autoStatus.label.replace('模式', '') }}</span></div
|
||||
<span>{{
|
||||
item.stateAfter.autoStatus.label ? item.stateAfter.autoStatus.label : '--'
|
||||
}}</span></div
|
||||
>
|
||||
</div>
|
||||
<div class="btn-item">
|
||||
@@ -297,6 +335,29 @@
|
||||
*/
|
||||
const emit = defineEmits(['reset', 'reload', 'resetAll']);
|
||||
|
||||
// 设备分区业务 =====================================================================
|
||||
|
||||
// 按钮区展开与收起状态
|
||||
const showAllButtonsArea = ref(false);
|
||||
// 被选中的分区 默认为1 用于选中样式渲染
|
||||
const selectedButton = ref<string | undefined>('1');
|
||||
|
||||
// 分区切换
|
||||
const changeArea = (button: any) => {
|
||||
// 当前选中按钮
|
||||
selectedButton.value = button.id;
|
||||
// 设置当前选中的回路
|
||||
buttons2.value = button.childList;
|
||||
// 重置按钮状态
|
||||
emit('reset');
|
||||
// 设置选中按钮状态
|
||||
button.selected = true;
|
||||
// 当前选中回路 - 置空
|
||||
resetMode();
|
||||
};
|
||||
// 默认最多展示8个按钮
|
||||
const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
|
||||
|
||||
// 照明回路业务 ======================================================================
|
||||
|
||||
// 开关启用/禁用状态
|
||||
@@ -374,7 +435,6 @@
|
||||
const selectAllCheckbox = ref(false);
|
||||
// 全选切换事件(switch)
|
||||
const toggleAllSelection = () => {
|
||||
let arr = [];
|
||||
// 全选
|
||||
if (selectAllCheckbox.value) {
|
||||
buttons2.value.forEach((item: any, index: number) => {
|
||||
@@ -383,7 +443,6 @@
|
||||
thisButton2.value = item;
|
||||
}
|
||||
item.selected = true;
|
||||
arr.push(item.id);
|
||||
});
|
||||
// 全不选
|
||||
} else {
|
||||
@@ -618,6 +677,8 @@
|
||||
const refresh = (reload = false) => {
|
||||
// 关闭执行弹窗
|
||||
executeVisible.value = false;
|
||||
// 设置当前选中的序列
|
||||
selectedButton.value = '1';
|
||||
// 重置选中样式 和 按钮选中状态
|
||||
emit('reset');
|
||||
// 如果是中途刷新,需要将所有修改改回
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
.get(planManage.getTableData, {
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||
ctrlType: props.type,
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -249,7 +249,7 @@
|
||||
.get(planManage.getTransData, {
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||
ctrlType: props.type,
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
<a-tab-pane key="1" tab="控制面板">
|
||||
<fanControl
|
||||
ref="tabs1Ref"
|
||||
@reset="reset"
|
||||
@reset-all="resetDrawer"
|
||||
:treeData="treeData"
|
||||
:type="`排风扇`" />
|
||||
@@ -200,6 +201,7 @@
|
||||
<a-tab-pane key="1" tab="控制面板">
|
||||
<fanControl
|
||||
ref="tabs1Ref"
|
||||
@reset="reset"
|
||||
@reset-all="resetDrawer"
|
||||
:treeData="treeData"
|
||||
:type="`风幕机`" />
|
||||
@@ -260,6 +262,7 @@
|
||||
<a-tab-pane key="1" tab="控制面板">
|
||||
<fanControl
|
||||
ref="tabs1Ref"
|
||||
@reset="reset"
|
||||
@reset-all="resetDrawer"
|
||||
:treeData="treeData"
|
||||
:type="`电动窗`" />
|
||||
@@ -374,8 +377,18 @@
|
||||
// 刷新当前的树形结构数据
|
||||
const reload = () => {
|
||||
http.get(url, { projectId: state.projectId, siteId: state.siteId }).then((res) => {
|
||||
const data = res.data;
|
||||
treeData.value = data[0].childList;
|
||||
const data = res.data[0].childList;
|
||||
// 默认选中第一个分区
|
||||
data.forEach((item: any, index: number) => {
|
||||
if (index === 0) {
|
||||
item.selected = true;
|
||||
} else {
|
||||
item.selected = false;
|
||||
}
|
||||
});
|
||||
treeData.value = data;
|
||||
// 楼层信息
|
||||
// selectIndex.value = index;
|
||||
// 反向刷新
|
||||
try {
|
||||
tabs1Ref.value.setButtons2(treeData.value[0].childList);
|
||||
@@ -398,8 +411,16 @@
|
||||
url = ventilating.getTree3;
|
||||
}
|
||||
http.get(url, { projectId: state.projectId, siteId: state.siteId }).then((res) => {
|
||||
const data = res.data;
|
||||
treeData.value = data[0].childList;
|
||||
const data = res.data[0].childList;
|
||||
// 默认选中第一个分区
|
||||
data.forEach((item: any, index: number) => {
|
||||
if (index === 0) {
|
||||
item.selected = true;
|
||||
} else {
|
||||
item.selected = false;
|
||||
}
|
||||
});
|
||||
treeData.value = data;
|
||||
selectIndex.value = index;
|
||||
});
|
||||
};
|
||||
@@ -442,6 +463,15 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
// 重置分区树所有当前选项
|
||||
const reset = () => {
|
||||
treeData.value.forEach((item: any) => {
|
||||
item.selected = false;
|
||||
item.childList.forEach((i: any) => {
|
||||
i.selected = false;
|
||||
});
|
||||
});
|
||||
};
|
||||
// 温度数组
|
||||
const sensorData = ref<any>([]);
|
||||
// 湿度数组
|
||||
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 440 B |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -48,17 +48,18 @@ const tableCarbonKeyMap = [
|
||||
// textEllipsis: true,
|
||||
textNumber: 5,
|
||||
},
|
||||
{
|
||||
title: '设备名称',
|
||||
textNumber: 10,
|
||||
dataIndex: 'deviceName',
|
||||
// textEllipsis: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: '设备id',
|
||||
dataIndex: 'deviceInfoCode',
|
||||
textNumber: 10,
|
||||
},
|
||||
{
|
||||
title: '设备编号',
|
||||
textNumber: 10,
|
||||
dataIndex: 'deviceName',
|
||||
// textEllipsis: true,
|
||||
},
|
||||
{
|
||||
textNumber: 5,
|
||||
title: '碳排因子值',
|
||||
@@ -77,14 +78,22 @@ const tableCarbonKeyMap = [
|
||||
{
|
||||
title: '分组名称',
|
||||
textNumber: 10,
|
||||
dataIndex: 'deviceNameType',
|
||||
dataIndex: 'pointName',
|
||||
},
|
||||
{
|
||||
textNumber: 5,
|
||||
title: '设备状态',
|
||||
dataIndex: 'status',
|
||||
customRender: ({ value }) => {
|
||||
return value === '0' ? '启用' : '停用';
|
||||
if (value) {
|
||||
if (value === '0') {
|
||||
return '启用';
|
||||
} else if (value === '1') {
|
||||
return '停用';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -219,7 +228,7 @@ export const editCalTreeConfig = (orgId) => ({
|
||||
],
|
||||
},
|
||||
});
|
||||
export const treeConfig = (orgId) => {
|
||||
export const treeConfig = (orgId, editCarbonEquipmentRef, tableRef) => {
|
||||
return {
|
||||
defaultExpandAll: true,
|
||||
header: {
|
||||
@@ -233,6 +242,8 @@ export const treeConfig = (orgId) => {
|
||||
return [{ pointName: '全部', id: 'all', selectable: false, children: data }];
|
||||
},
|
||||
formConfig: {
|
||||
callList: true, // 刷新列表
|
||||
// defaultSelection: true, //树默认选择第一个
|
||||
schemas: [
|
||||
{
|
||||
field: 'energyType',
|
||||
@@ -248,6 +259,12 @@ export const treeConfig = (orgId) => {
|
||||
valueField: 'dicKey',
|
||||
placeholder: '请选择能耗种类',
|
||||
autoSelectFirst: true,
|
||||
onSelect: async (cur, record) => {
|
||||
editCarbonEquipmentRef.value.changeEnergyType(cur);
|
||||
tableRef.value?.nsTableRef.clearCheck();
|
||||
tableRef.value?.nsTableRef.reload();
|
||||
// value.value = cur;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -402,12 +419,12 @@ export const tableConfigCal = (
|
||||
label: '编辑',
|
||||
name: 'GroupPointEdit',
|
||||
type: 'primary',
|
||||
handle: (a, b) => {
|
||||
if (isCarbon) {
|
||||
editCarbonEquipmentRef.value.toggle();
|
||||
} else {
|
||||
el.value.toggle();
|
||||
}
|
||||
handle: async (a, b) => {
|
||||
// if (isCarbon) {
|
||||
editCarbonEquipmentRef.value.toggle();
|
||||
// } else {
|
||||
// el.value.toggle();
|
||||
// }
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -457,7 +474,7 @@ export const tableConfigCal = (
|
||||
return data.list.length === 0;
|
||||
},
|
||||
extra: {
|
||||
xlsxMap: tableKeyMap,
|
||||
xlsxMap: isCarbon ? tableCarbonKeyMap : tableCalKeyMap,
|
||||
xlsxName: '分组信息YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
@@ -656,7 +673,7 @@ export const tableConfigCal = (
|
||||
};
|
||||
};
|
||||
|
||||
export const editCarbonEquipmentConfig = (orgId) => {
|
||||
export const editCarbonEquipmentConfig = (orgId, props) => {
|
||||
return ref({
|
||||
title: '设备信息',
|
||||
api: device.queryDevicePage,
|
||||
@@ -673,22 +690,6 @@ export const editCarbonEquipmentConfig = (orgId) => {
|
||||
fieldNames: { title: 'deviceType', key: 'code' },
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'energyType',
|
||||
label: '',
|
||||
component: 'NsSelectApi',
|
||||
autoSubmit: true,
|
||||
componentProps: {
|
||||
api: () => dict({ params: { dicKey: 'ENERGY_TYPE' } }),
|
||||
// params: { dicKey: 'ENERGY_TYPE' },
|
||||
immediate: true,
|
||||
// resultField: 'data.ENERGY_TYPE',
|
||||
labelField: 'cnValue',
|
||||
valueField: 'dicKey',
|
||||
placeholder: '请选择能耗种类',
|
||||
autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceType',
|
||||
label: '设备名称',
|
||||
@@ -742,6 +743,26 @@ export const editCarbonEquipmentConfig = (orgId) => {
|
||||
],
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'energyType',
|
||||
label: '',
|
||||
component: 'NsSelectApi',
|
||||
// autoSubmit: true,
|
||||
defaultValue: props.params.energyType,
|
||||
componentProps: {
|
||||
api: () => dict({ params: { dicKey: 'ENERGY_TYPE' } }),
|
||||
// params: { dicKey: 'ENERGY_TYPE' },
|
||||
immediate: true,
|
||||
// resultField: 'data.ENERGY_TYPE',
|
||||
labelField: 'cnValue',
|
||||
valueField: 'dicKey',
|
||||
placeholder: '请选择能耗种类',
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
dynamicDisabled: (data: any) => {
|
||||
return props.params.energyType !== 'CARBON_EMISSIONS';
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'areas',
|
||||
label: '设备区域',
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<a-select
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
v-model:value="linkOrgId"
|
||||
:options="linkList"
|
||||
:field-names="{ label: 'orgName', value: 'orgId' }"
|
||||
@change="handleChange" />
|
||||
@@ -44,33 +45,46 @@
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { group, device } from '/@/api/deviceManage';
|
||||
const orgId = ref('');
|
||||
|
||||
const key = ref(Date.now());
|
||||
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
|
||||
const linkOrgId = ref('');
|
||||
|
||||
// const selectOrgId = ref(orgId.value);
|
||||
const props = defineProps({ params: Object });
|
||||
|
||||
const linkList = JSON.parse(sessionStorage.getItem('LINKLIST')!);
|
||||
let config = editCarbonEquipmentConfig(orgId.value);
|
||||
linkOrgId.value = linkList[0].orgId;
|
||||
let config = editCarbonEquipmentConfig(orgId.value, props);
|
||||
const visible = ref(false);
|
||||
const carbonEquipment = ref();
|
||||
// defineOptions({
|
||||
// name: 'LedgerIndex', // 与页面路由name一致缓存才可生效
|
||||
// });
|
||||
|
||||
const changeEnergyType = (val) => {
|
||||
props.params.energyType = val;
|
||||
config = editCarbonEquipmentConfig(linkOrgId.value, props);
|
||||
key.value = Date.now();
|
||||
};
|
||||
const handleChange = (value: string) => {
|
||||
// selectOrgId.value = value;
|
||||
config = editCarbonEquipmentConfig(value);
|
||||
debugger;
|
||||
config = editCarbonEquipmentConfig(value, props);
|
||||
key.value = Date.now();
|
||||
// carbonEquipment.value?.nsTableRef.reload();
|
||||
// carbonEquipment.value?.nsTableRef.treeReload();
|
||||
};
|
||||
|
||||
const props = defineProps({ params: Object });
|
||||
const emit = defineEmits(['sure']);
|
||||
const toggle = () => {
|
||||
const toggle = (val) => {
|
||||
if (val) {
|
||||
config = editCarbonEquipmentConfig(linkOrgId.value, props);
|
||||
key.value = Date.now();
|
||||
}
|
||||
|
||||
visible.value = !visible.value;
|
||||
// clearData();
|
||||
// visible.value && getData(currentId.value);
|
||||
@@ -93,14 +107,35 @@
|
||||
deviceInfoCode: selectedRowKeys[i],
|
||||
});
|
||||
}
|
||||
http.post(group.addCarbonDevice, params).then(() => {
|
||||
emit('sure');
|
||||
NsMessage.success('操作成功');
|
||||
toggle();
|
||||
});
|
||||
if (props.params.energyType && props.params.energyType == 'CARBON_EMISSIONS') {
|
||||
http.post(group.addCarbonDevice, params).then(() => {
|
||||
emit('sure');
|
||||
NsMessage.success('操作成功');
|
||||
toggle(null);
|
||||
});
|
||||
} else if (props.params.energyType && props.params.energyType != 'CARBON_EMISSIONS') {
|
||||
// if (!currentId.value) {
|
||||
// NsMessage.warn('请先选择公司');
|
||||
// return;
|
||||
// }
|
||||
http
|
||||
.post(group.saveComputeList, {
|
||||
energyType: props.params.energyType,
|
||||
orgId: props.params?.orgId,
|
||||
hxDeviceGroupId: props.params?.hxDeviceGroupId,
|
||||
saveOrgId: linkOrgId.value,
|
||||
saveDeviceInfoCodes: selectedRowKeys,
|
||||
})
|
||||
.then(() => {
|
||||
emit('sure');
|
||||
NsMessage.success('操作成功');
|
||||
toggle(null);
|
||||
});
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
toggle,
|
||||
changeEnergyType,
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
v-show="!defaultType && isCarbon"
|
||||
class="table"
|
||||
v-bind="configCarbon"
|
||||
ref="tableCalRef" />
|
||||
ref="tableCalRef2" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@@ -80,6 +80,7 @@
|
||||
const modalFormRef = ref();
|
||||
const tableRef = ref();
|
||||
const tableCalRef = ref();
|
||||
const tableCalRef2 = ref();
|
||||
const editDrawerRef = ref();
|
||||
const editDrawerCalRef = ref();
|
||||
const editGroupRef = ref();
|
||||
@@ -89,7 +90,7 @@
|
||||
|
||||
const treeRef = ref();
|
||||
const defaultType = ref(true);
|
||||
const isCarbon = ref(true);
|
||||
const isCarbon = ref(false);
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
const defaultParams = ref({
|
||||
orgId: result,
|
||||
@@ -119,7 +120,7 @@
|
||||
setFactorRef,
|
||||
);
|
||||
|
||||
const tConfig = treeConfig(result);
|
||||
const tConfig = treeConfig(result, editCarbonEquipmentRef, tableRef);
|
||||
const nsModalFormConfig = ref({
|
||||
api: group.creatOrUpdate,
|
||||
data: {},
|
||||
@@ -219,6 +220,7 @@
|
||||
//清除选中行数据
|
||||
tableRef.value?.nsTableRef.clearCheck();
|
||||
tableCalRef.value?.nsTableRef.clearCheck();
|
||||
tableCalRef2.value?.nsTableRef.clearCheck();
|
||||
const {
|
||||
node: { pointType, id, energyType },
|
||||
} = record;
|
||||
@@ -226,20 +228,24 @@
|
||||
defaultParams.value.id = id;
|
||||
defaultParams.value.hxDeviceGroupId = id;
|
||||
defaultType.value = pointType === 'GROUPING_NODE';
|
||||
defaultType.value
|
||||
? tableRef.value?.nsTableRef.reload()
|
||||
: tableCalRef.value?.nsTableRef.reload();
|
||||
|
||||
if (energyType == 'CARBON_EMISSIONS') {
|
||||
isCarbon.value = true;
|
||||
} else {
|
||||
isCarbon.value = false;
|
||||
}
|
||||
defaultType.value
|
||||
? tableRef.value?.nsTableRef.reload()
|
||||
: isCarbon.value
|
||||
? tableCalRef2.value?.nsTableRef.reload()
|
||||
: tableCalRef.value?.nsTableRef.reload();
|
||||
};
|
||||
|
||||
const handleOk = () => {
|
||||
defaultType.value
|
||||
? tableRef.value?.nsTableRef.reload()
|
||||
: isCarbon.value
|
||||
? tableCalRef2.value?.nsTableRef.reload()
|
||||
: tableCalRef.value?.nsTableRef.reload();
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -340,11 +340,25 @@
|
||||
// 获取当天的时间
|
||||
const today = new Date();
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0'); // getMonth() 返回的月份是0-11
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
const month = Number(String(today.getMonth() + 1).padStart(2, '0')); // getMonth() 返回的月份是0-11
|
||||
const day = Number(String(today.getDate()).padStart(2, '0'));
|
||||
|
||||
startTime = year + '-' + month + '-' + day;
|
||||
endTime = year + '-' + month + '-' + day;
|
||||
if (dateTypeValue.value == 'month') {
|
||||
startTime = year + '-' + month + '-01';
|
||||
// 创建下一个月的第一天
|
||||
const date = new Date(year, month, 1);
|
||||
|
||||
// 减去一天得到当月的最后一天
|
||||
// date.setDate(date.getDate() - 1);
|
||||
endTime = date.toISOString().split('T')[0];
|
||||
// endTime = endDate.value + '-01';
|
||||
} else if (dateTypeValue.value == 'year') {
|
||||
startTime = year + '-01-01';
|
||||
endTime = year + '-12-31';
|
||||
} else {
|
||||
startTime = year + '-' + month + '-' + day;
|
||||
endTime = year + '-' + month + '-' + day;
|
||||
}
|
||||
}
|
||||
|
||||
// 图表数据
|
||||
|
||||
@@ -59,7 +59,10 @@
|
||||
查询
|
||||
</a-button>
|
||||
</div>
|
||||
<a-button type="primary" style="position: absolute; right: 40px; top: -45px">
|
||||
<a-button
|
||||
type="primary"
|
||||
style="position: absolute; right: 40px; top: -45px"
|
||||
@click="exportExcel()">
|
||||
导出
|
||||
</a-button>
|
||||
</div>
|
||||
@@ -84,6 +87,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import XLSX from 'xlsx';
|
||||
// import Export2Excel from '/@/util/Export2Excel.js';
|
||||
|
||||
import { ref, onMounted, defineOptions } from 'vue';
|
||||
// import { http } from '/nerv-lib/util/http';
|
||||
import { Pagination, SelectProps, TreeSelectProps, TableColumnType } from 'ant-design-vue';
|
||||
@@ -346,6 +352,61 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
// 导出excel
|
||||
/**导出按钮点击事件函数
|
||||
* @前期准备 npm install -S xlsx file-saver 及 Export2Excel.js
|
||||
*/
|
||||
const exportExcel = () => {
|
||||
import('/@/util/Export2Excel.js').then((excel) => {
|
||||
// 导出的表头名
|
||||
let tHeader = [];
|
||||
let filterVal = [];
|
||||
for (let i = 0; i < tableColumns.value.length; i++) {
|
||||
if (tableColumns.value[i].dataIndex) {
|
||||
tHeader.push(tableColumns.value[i].title);
|
||||
filterVal.push(tableColumns.value[i].dataIndex);
|
||||
}
|
||||
}
|
||||
// const tHeader = [
|
||||
// 'ID',
|
||||
// '名称',
|
||||
// '视频ID',
|
||||
// '视频标题',
|
||||
// '发布',
|
||||
// '视频类型',
|
||||
// '播放量',
|
||||
// '上传时间',
|
||||
// ];
|
||||
// // 导出的表头字段名
|
||||
// const filterVal = [
|
||||
// 'id',
|
||||
// 'name',
|
||||
// 'videoId',
|
||||
// 'videoTitle',
|
||||
// 'release',
|
||||
// 'videoType',
|
||||
// 'playVolume',
|
||||
// 'updateTime',
|
||||
// ];
|
||||
//传入的数据
|
||||
const list = data.value;
|
||||
|
||||
const datas = formatJson(filterVal, list);
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader, // 表格头部
|
||||
data: datas, // 表格数据
|
||||
filename: '表格导出测试', // excel文件名
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 格式化表格数据
|
||||
* @filterVal 格式头
|
||||
* @jsonData 用来格式化的表格数据
|
||||
*/
|
||||
const formatJson = (filterVal: any, jsonData: any) => {
|
||||
return jsonData.map((v: any) => filterVal.map((j: any) => v[j]));
|
||||
};
|
||||
onMounted(async () => {
|
||||
// 获取频率
|
||||
let frequency = await getEnum({ params: { enumType: 'TimeFlagEnum' } });
|
||||
|
||||
@@ -65,6 +65,13 @@
|
||||
:unCheckedValue="0"
|
||||
@change="(checked) => updateShowed(record)" />
|
||||
</template>
|
||||
<template
|
||||
v-if="column.dataIndex === 'device1Area' || column.dataIndex === 'device2Area'">
|
||||
<a-tooltip v-if="text.length > 15" :title="text">
|
||||
{{ text.slice(0, 15) }}...
|
||||
</a-tooltip>
|
||||
<span v-else>{{ text }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #title>
|
||||
<div
|
||||
@@ -171,7 +178,7 @@
|
||||
const typeList = ref();
|
||||
|
||||
const quyuvalue = ref<string[]>([]);
|
||||
const useFlag = ref<Number>();
|
||||
const useFlag = ref<Number | null>();
|
||||
const useFlagList = ref();
|
||||
useFlagList.value = [
|
||||
{
|
||||
@@ -218,6 +225,7 @@
|
||||
// 重置
|
||||
const resetting = () => {
|
||||
quyuvalue.value = [];
|
||||
useFlag.value = null;
|
||||
areaName.value = '';
|
||||
};
|
||||
// 修改是否显示状态
|
||||
@@ -296,6 +304,8 @@
|
||||
// quyuvalue.value = [treeData2.value[0].childList[0].id];
|
||||
// }
|
||||
});
|
||||
|
||||
queryDeviceInfoListPage();
|
||||
};
|
||||
onMounted(async () => {
|
||||
// 获取环境参数
|
||||
@@ -360,6 +370,13 @@
|
||||
{
|
||||
title: '设备一级区域',
|
||||
dataIndex: 'device1Area',
|
||||
// width: 300,
|
||||
// ellipsis: true,
|
||||
// textNumber: 15,
|
||||
// textEllipsis: true,
|
||||
// ellipsis: {
|
||||
// showTitle: false, // 设置为 false 在悬浮时显示 tooltip
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '设备二级区域',
|
||||
|
||||