Browse Source

冲突的一个文件修改

temp
duyufeng 3 months ago
parent
commit
d31cc213cb
  1. 10
      hx-ai-intelligent/src/api/index.ts
  2. 2
      hx-ai-intelligent/src/api/planManage.ts
  3. 13
      hx-ai-intelligent/src/api/waterSystem.ts
  4. 19
      hx-ai-intelligent/src/router/equipmentControl.ts
  5. 220
      hx-ai-intelligent/src/util/Export2Excel.js
  6. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  7. 39
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue
  8. 642
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index1.vue
  9. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue
  10. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts
  11. 56
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  12. 106
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts
  13. 49
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  14. 63
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  15. 1632
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index copy.vue
  16. 187
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  17. 59
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  18. 3
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
  19. 122
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
  20. 133
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue
  21. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue
  22. 4
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs2.vue
  23. 2
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue
  24. 71
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts
  25. 181
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue
  26. 966
      hx-ai-intelligent/src/view/equipmentControl/coldAndHeatSources/index.vue
  27. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/airSourceThermalCollapse.png
  28. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/blue.gif
  29. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/blue.png
  30. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/coldWater.png
  31. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/diluteCoolingPump.png
  32. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/green.gif
  33. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/green.png
  34. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/manifold.png
  35. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/pressureWater.png
  36. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/screwGeothermalHeatPump.png
  37. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/softenedWaterTank.png
  38. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/soilCoupler.png
  39. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/waterProcessor.png
  40. BIN
      hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/waterPump.png
  41. 4
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  42. 3
      hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue
  43. 77
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanControl.vue
  44. 4
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanPlant.vue
  45. 38
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue
  46. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/alarm1.png
  47. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/alarm2.png
  48. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/back.gif
  49. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/back.png
  50. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/device1.png
  51. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/device2.png
  52. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/edit.png
  53. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/type1off.png
  54. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/type2off.png
  55. BIN
      hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/type3off.png
  56. 85
      hx-ai-intelligent/src/view/equipmentManage/group/config.ts
  57. 55
      hx-ai-intelligent/src/view/equipmentManage/group/editCarbonEquipment.vue
  58. 18
      hx-ai-intelligent/src/view/equipmentManage/group/index.vue
  59. 22
      hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue
  60. 63
      hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/index.vue
  61. 19
      hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue

10
hx-ai-intelligent/src/api/index.ts

@ -60,3 +60,13 @@ export const getEnum = async ({
const res = await http.get(api, params); const res = await http.get(api, params);
return Promise.resolve(res); 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
hx-ai-intelligent/src/api/planManage.ts

@ -2,7 +2,7 @@ const prefix = '/carbon-smart/api';
// 照明系统及相关接口 // 照明系统及相关接口
export enum planManage { export enum planManage {
/** /**
* @param deviceType (1,2,3,4,5,6,7) * @param deviceType (1,2,3,4,5,6)
*/ */
// 获得未激活的计划 // 获得未激活的计划
getTransData = prefix + '/deviceCtrlPlan/getDeActivatedPlanList', getTransData = prefix + '/deviceCtrlPlan/getDeActivatedPlanList',

13
hx-ai-intelligent/src/api/waterSystem.ts

@ -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',
}

19
hx-ai-intelligent/src/router/equipmentControl.ts

@ -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; export default equipmentControl;

220
hx-ai-intelligent/src/util/Export2Excel.js

@ -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}`);
}

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue

@ -84,7 +84,7 @@
<!-- 配置设备告警--> <!-- 配置设备告警-->
<configureDeviceAlarms v-show="!equipmentAlarm" ref="configureDeviceAlarms" /> <configureDeviceAlarms v-show="!equipmentAlarm" ref="configureDeviceAlarms" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="3" tab="能告警"> <a-tab-pane key="3" tab="能告警">
<ns-view-list-table <ns-view-list-table
v-bind="energyAlarmConfig" v-bind="energyAlarmConfig"
v-show="energyAlarm" v-show="energyAlarm"

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

@ -36,6 +36,7 @@
style="width: 200px" style="width: 200px"
v-model:value="queryParams.year" v-model:value="queryParams.year"
placeholder="请选择账期" placeholder="请选择账期"
:allowClear="false"
picker="year" picker="year"
valueFormat="YYYY" /> valueFormat="YYYY" />
</a-form-item> </a-form-item>
@ -60,15 +61,15 @@
<div class="ns-form-title"> <div class="ns-form-title">
<div class="title">配额统计</div> <div class="title">配额统计</div>
<div class="operation" style="display: flex; justify-content: flex-end; width: 63%"> <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 type="primary" v-if="queryParams.accountType === 1" @click="getTotalTable(1)">
>全国配额</a-button 全国配额
> </a-button>
<a-button type="primary" v-if="parentId === 2" @click="getTotalTable(2)" <a-button type="primary" v-if="queryParams.accountType === 2" @click="getTotalTable(2)">
>地方配额</a-button 地方配额
> </a-button>
<a-button type="primary" v-if="parentId === 3" @click="getTotalTable(3)" <a-button type="primary" v-if="queryParams.accountType === 3" @click="getTotalTable(3)">
>CCER配额</a-button CCER配额
> </a-button>
</div> </div>
</div> </div>
<a-table :columns="totalColumns" :data-source="totalData" bordered :pagination="false"> <a-table :columns="totalColumns" :data-source="totalData" bordered :pagination="false">
@ -205,6 +206,7 @@
year.value = queryParams.value.year; year.value = queryParams.value.year;
transactionType.value = queryParams.value.transactionType; transactionType.value = queryParams.value.transactionType;
accountType.value = queryParams.value.accountType; accountType.value = queryParams.value.accountType;
getTotalTable(queryParams.value.accountType);
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
// getDetailList(); // getDetailList();
}; };
@ -299,11 +301,11 @@
})); }));
}); });
formState.value = JSON.parse(JSON.stringify(record)); formState.value = JSON.parse(JSON.stringify(record));
if (formState.value.expenditure === 0) { // if (formState.value.expenditure === 0) {
formState.value.transactionQuantity = formState.value.income; // formState.value.transactionQuantity = formState.value.income;
} else { // } else {
formState.value.transactionQuantity = formState.value.expenditure; // formState.value.transactionQuantity = formState.value.expenditure;
} // }
setTimeout(() => { setTimeout(() => {
let selectDevice = ref([Number(formState.value.transactionType)]); let selectDevice = ref([Number(formState.value.transactionType)]);
findParentIds(options.value, formState.value.transactionType, selectDevice.value); findParentIds(options.value, formState.value.transactionType, selectDevice.value);
@ -427,7 +429,7 @@
// <a> // <a>
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.setAttribute('download', 'carbonTradeDetails.xlsx'); // link.setAttribute('download', '碳资产导出.xlsx'); //
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
@ -523,11 +525,6 @@
})); }));
}); });
formState.value = JSON.parse(JSON.stringify(record)); 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(() => { setTimeout(() => {
let selectDevice = ref([Number(formState.value.transactionType)]); let selectDevice = ref([Number(formState.value.transactionType)]);
findParentIds(options.value, formState.value.transactionType, selectDevice.value); findParentIds(options.value, formState.value.transactionType, selectDevice.value);
@ -702,6 +699,7 @@
.then((res) => { .then((res) => {
message.success('操作成功!'); message.success('操作成功!');
visible.value = false; visible.value = false;
formState.value = {};
delIds.value = []; delIds.value = [];
// getDetailList(); // getDetailList();
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
@ -714,6 +712,7 @@
message.success('操作成功!'); message.success('操作成功!');
visible.value = false; visible.value = false;
delIds.value = []; delIds.value = [];
formState.value = {};
// getDetailList(); // getDetailList();
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
} }

642
hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index1.vue

@ -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, // URLURL
}));
});
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>

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

@ -129,7 +129,7 @@
</div> </div>
<div class="title"> <div class="title">
<img width="24" height="24" src="../../../../src/icon/carbonAssetsTitle-3.svg" /> <img width="24" height="24" src="../../../../src/icon/carbonAssetsTitle-3.svg" />
<span>全国碳账户余额</span> <span>CCER账户余额</span>
</div> </div>
<div class="bottom"> <div class="bottom">
<div class="calculation BLCard"> <div class="calculation BLCard">

2
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts

@ -167,7 +167,7 @@ export const formConfig = (disabled) => {
label: '已引用数', label: '已引用数',
field: 'numberOfReferences', field: 'numberOfReferences',
component: 'NsInput', component: 'NsInput',
show:disabled, show: disabled,
componentProps: { componentProps: {
defaultValue: '', defaultValue: '',
disabled: true, disabled: true,

56
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue

@ -299,13 +299,7 @@
const x = 3; const x = 3;
const y = 2; const y = 2;
const z = 1; const z = 1;
const genData: TreeProps['treeData'] = [ const genData: TreeProps['treeData'] = [];
{
emissionName: '全部',
key: '0-0',
children: [],
},
];
const checkedTreeNodeKeys = ref<string[]>(); const checkedTreeNodeKeys = ref<string[]>();
const selectedKeys = ref<string[]>(); const selectedKeys = ref<string[]>();
@ -532,7 +526,7 @@
const getOrgTree = () => { const getOrgTree = () => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, getClassificationTree.value).then( fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, getClassificationTree.value).then(
(res) => { (res) => {
gData.value[0].children = res.data; gData.value = res.data;
// //
// const selectedNodes = []; // const selectedNodes = [];
// checkedTreeNodeKeys.value.forEach(key => { // checkedTreeNodeKeys.value.forEach(key => {
@ -564,10 +558,12 @@
const onSelectKeys = ref([]); const onSelectKeys = ref([]);
const onSelect = (selectedKey: string[], info: any) => { const onSelect = (selectedKey: string[], info: any) => {
if (selectedKey.length === 1) { if (selectedKey.length === 1) {
if (info.selectedNodes[0].emissionName === '全部') {
onSelectKeys.value = [];
} else {
onSelectKeys.value = [info.selectedNodes[0].id];
}
selectedKeys.value = selectedKey; selectedKeys.value = selectedKey;
}
if (info.selected) {
// showOperation.value = true;
editTreeNode.value = { editTreeNode.value = {
id: info.selectedNodes[0].id, id: info.selectedNodes[0].id,
level: info.selectedNodes[0].level, level: info.selectedNodes[0].level,
@ -575,15 +571,18 @@
sortNumber: info.selectedNodes[0].sortNumber, sortNumber: info.selectedNodes[0].sortNumber,
parentEmissionId: info.selectedNodes[0].parentEmissionId, 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]; emissionList.value = [...onSelectKeys.value, ...checkedIds.value];
mainRef.value?.nsTableRef.reload(); 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 = () => { const onSearch = () => {
@ -705,12 +704,17 @@
label: '导出', label: '导出',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
// console.log( mainRef.value.nsTableRef.tableState.selectedRowKeys) // console.log(mainRef.value.nsTableRef.formParamsRef)
const exportQuery = { const exportQuery = {
orgId: orgId.value, orgId: orgId.value,
pageNum: 1, pageNum: 1,
pageSize: 999, pageSize: 999,
ids: mainRef.value.nsTableRef.tableState.selectedRowKeys, 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 = { const config = {
responseType: 'blob', responseType: 'blob',
@ -722,7 +726,7 @@
// <a> // <a>
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.setAttribute('download', 'carbonFactor.xlsx'); // link.setAttribute('download', '碳排因子库导出.xlsx'); //
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
@ -1242,8 +1246,10 @@
flex-direction: column; flex-direction: column;
border-radius: 12px; border-radius: 12px;
overflow: auto; overflow: auto;
align-items: center;
:deep(.ant-tree) { :deep(.ant-tree) {
height: 90%; height: 90%;
width: 90%;
overflow: auto; overflow: auto;
} }
} }
@ -1257,12 +1263,12 @@
} }
} }
} }
:deep( // :deep(
.ant-form-item-label // .ant-form-item-label
> label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before // > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before
) { // ) {
display: none !important; // display: none !important;
} // }
:deep(.ant-form-item-label) { :deep(.ant-form-item-label) {
z-index: 20; z-index: 20;
text-align: right; text-align: right;

106
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts

@ -1,3 +1,5 @@
import { quickCalculation, carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
import { ref } from 'vue';
// 能耗统计表表头 // 能耗统计表表头
export const tableColumns = [ export const tableColumns = [
{ {
@ -144,3 +146,107 @@ export const drawerColumns = [
dataIndex: 'dataSources', 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',
});
};

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

@ -57,7 +57,7 @@
<a-radio :value="1"></a-radio> <a-radio :value="1"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="排放类型" name="emissionType" :required="isRequired"> <a-form-item label="排放类型" name="emissionType" :required="isRequired" v-if="isRequired">
<a-select <a-select
v-model:value="formState.emissionType" v-model:value="formState.emissionType"
placeholder="请选择排放类型" placeholder="请选择排放类型"
@ -330,7 +330,7 @@
// <a> // <a>
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.setAttribute('download', 'carbonStats.xlsx'); // link.setAttribute('download', '能耗统计导出.xlsx'); //
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
@ -342,13 +342,13 @@
}); });
}, },
}, },
{ // {
label: '模板下载', // label: '',
type: 'primary', // type: 'primary',
handle: () => { // handle: () => {
doWnload('/hx-ai-intelligent/asset/file/energyConsumption.xlsx'); // doWnload('/hx-ai-intelligent/asset/file/energyConsumption.xlsx');
}, // },
}, // },
// { // {
// label: '', // label: '',
// type: 'primary', // type: 'primary',
@ -782,24 +782,18 @@
// //
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => { fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
treeData.value = res.data; treeData.value = res.data;
treeData.value = treeData.value.map((item) => ({ treeData.value = transformData(treeData.value);
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,
}))
: [],
}))
: [],
}));
}); });
}; };
//
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 emissionType = ref();
const changeRadio = (e) => { const changeRadio = (e) => {
@ -819,7 +813,9 @@
.validate() .validate()
.then(() => { .then(() => {
console.log('values', formState, toRaw(formState)); 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) { if (formState.value.unit) {
formState.value.unit = formState.value.unit.join(',').split(',')[1]; formState.value.unit = formState.value.unit.join(',').split(',')[1];
} }
@ -973,6 +969,7 @@
formState.value = { formState.value = {
orgId: orgId.value, orgId: orgId.value,
}; };
fileList.value = [];
formRef.value.resetFields(); formRef.value.resetFields();
}; };
// //

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

@ -40,40 +40,11 @@
</div> </div>
</div> </div>
<div class="right"> <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 <ns-view-list-table
v-bind="tableConfig" v-bind="tableConfig"
:model="tableData" :model="tableData"
ref="mainRef" ref="mainRef"
:scroll="{ x: 1000 }" /> :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 <a-drawer
:width="500" :width="500"
@ -93,20 +64,20 @@
:wrapper-col="wrapperCol"> :wrapper-col="wrapperCol">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-item ref="name" label="日期范围" name="dateRange"> <a-form-item ref="name" label="适用日期" name="dateRange">
<a-range-picker <a-range-picker
v-model:value="formState.dateRange" v-model:value="formState.dateRange"
picker="month" picker="month"
valueFormat="YYYY-MM" /> valueFormat="YYYY-MM" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <!-- <a-col :span="24">
<a-form-item ref="name" label="排放因子" name="emissionFactors"> <a-form-item ref="name" label="排放因子" name="emissionFactors">
<ns-input v-model:value="formState.emissionFactors" disabled /> <ns-input v-model:value="formState.emissionFactors" disabled />
</a-form-item> </a-form-item>
</a-col> </a-col> -->
</a-row> </a-row>
<span <!-- <span
key="" key=""
style="font-size: 16px; font-weight: 700; color: rgba(51, 51, 51, 1); text-align: left"> 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" /> <ns-input style="margin-top: 5px" v-model:value="selectData" @change="keyChange" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row> -->
</a-form> </a-form>
<a-button type="primary" style="margin-bottom: 10px" @click="selectFactor"
>选择因子</a-button
>
<a-table <a-table
:columns="drawerColumns" :columns="drawerColumns"
:data-source="newTableData" :data-source="newTableData"
@ -142,6 +116,15 @@
</template> </template>
</a-drawer> </a-drawer>
</div> </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> </div>
</template> </template>
@ -156,6 +139,7 @@
carbonEmissionFactorLibrary, carbonEmissionFactorLibrary,
} from '/@/api/carbonEmissionFactorLibrary'; } from '/@/api/carbonEmissionFactorLibrary';
import { or } from '@vueuse/core'; import { or } from '@vueuse/core';
import { setFactorConfig } from '../config';
defineOptions({ defineOptions({
energyType: 'quickCalculation', // name energyType: 'quickCalculation', // name
components: { components: {
@ -499,6 +483,11 @@
}, },
}); });
}; };
const openVisible = ref(false);
const config = setFactorConfig(orgId.value);
const selectFactor = () => {
openVisible.value = true;
};
// //
const onClose = () => { const onClose = () => {
visible.value = false; visible.value = false;
@ -611,6 +600,12 @@
:deep(.ant-table-container) { :deep(.ant-table-container) {
padding: unset; padding: unset;
} }
:deep(.ant-modal-header) {
border-bottom: 10px solid #f0f0f0 !important;
}
:deep(.ant-modal-footer) {
border-top: 10px solid #f0f0f0 !important;
}
</style> </style>
<style scoped> <style scoped>
th.column-money, th.column-money,

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

File diff suppressed because it is too large

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

@ -308,80 +308,82 @@
<div class="ns-form-title-edit"> <div class="ns-form-title-edit">
<div class="title">编辑</div> <div class="title">编辑</div>
</div> </div>
<a-form <a-spin :spinning="spinning">
ref="editFormRef" <a-form
:model="editFormState" ref="editFormRef"
:label-col="labelCol" :model="editFormState"
:wrapper-col="wrapperCol"> :label-col="labelCol"
<a-row> :wrapper-col="wrapperCol">
<a-col :span="24"> <a-row>
<a-form-item ref="name" label="数据来源" name="dataSources"> <a-col :span="24">
<a-select <a-form-item ref="name" label="数据来源" name="dataSources">
ref="select" <a-select
v-model:value="editFormState.dataSources" ref="select"
@change="changeSelect"> v-model:value="editFormState.dataSources"
<a-select-option value="1">自行推估</a-select-option> @change="changeSelect">
<a-select-option value="2">定期量测</a-select-option> <a-select-option value="1">自行推估</a-select-option>
<a-select-option value="3">自动测量</a-select-option> <a-select-option value="2">定期量测</a-select-option>
</a-select> <a-select-option value="3">自动测量</a-select-option>
</a-form-item> </a-select>
</a-col> </a-form-item>
<a-col :span="24"> </a-col>
<a-form-item ref="name" label="消耗量" name="consumption"> <a-col :span="24">
<ns-input-number <a-form-item ref="name" label="消耗量" name="consumption">
v-model:value="editFormState.consumption" <ns-input-number
:maxlength="20" v-model:value="editFormState.consumption"
@keydown="handleKeyDown" :maxlength="20"
:disabled="canEdit" /> @keydown="handleKeyDown"
</a-form-item> :disabled="canEdit" />
</a-col> </a-form-item>
</a-row> </a-col>
<a-row v-if="automatic"> </a-row>
<a-col :span="24"> <a-row v-if="automatic">
<a-form-item label="能耗类型"> <a-col :span="24">
<a-select <a-form-item label="能耗类型">
v-model:value="editFormState.energyConsumptionType" <a-select
@change="changeEnergyType" v-model:value="editFormState.energyConsumptionType"
placeholder="请选择能耗类型"> @change="changeEnergyType"
<a-select-option placeholder="请选择能耗类型">
v-for="(item, index) in energyTypeOptions" <a-select-option
:key="index" v-for="(item, index) in energyTypeOptions"
:value="item.dicKey"> :key="index"
{{ item.cnValue }} :value="item.dicKey">
</a-select-option> {{ item.cnValue }}
</a-select> </a-select-option>
</a-form-item> </a-select>
</a-col> </a-form-item>
<a-col :span="24"> </a-col>
<a-form-item ref="name" label="采集节点" name="collectionNode"> <a-col :span="24">
<a-tree-select <a-form-item ref="name" label="采集节点" name="collectionNode">
v-model:value="editFormState.collectionNode" <a-tree-select
:tree-line="true" v-model:value="editFormState.collectionNode"
@select="selectNode" :tree-line="true"
:tree-data="collectingNodes"> @select="selectNode"
</a-tree-select> :tree-data="collectingNodes">
</a-form-item> </a-tree-select>
</a-col> </a-form-item>
</a-row> </a-col>
<a-row> </a-row>
<a-col :span="24"> <a-row>
<a-form-item ref="name" label="因子值" name="emissionFactors"> <a-col :span="24">
<ns-input <a-form-item ref="name" label="因子值" name="emissionFactors">
v-model:value="editFormState.emissionFactors" <ns-input
:maxlength="20" v-model:value="editFormState.emissionFactors"
@keydown="handleKeyDown" /> :maxlength="20"
</a-form-item> @keydown="handleKeyDown" />
</a-col> </a-form-item>
<a-col :span="24"> </a-col>
<a-form-item ref="name" label="关键字" name="key"> <a-col :span="24">
<a-input-search <a-form-item ref="name" label="关键字" name="key">
v-model:value="editFormState.key" <a-input-search
@search="searchKey" v-model:value="editFormState.key"
placeholder="请输入关键字" /> @search="searchKey"
</a-form-item> placeholder="请输入关键字" />
</a-col> </a-form-item>
</a-row> </a-col>
</a-form> </a-row>
</a-form>
</a-spin>
<div class="ns-form-title-edit" style="display: flex"> <div class="ns-form-title-edit" style="display: flex">
<div class="titleEdit">因子列表</div> <div class="titleEdit">因子列表</div>
</div> </div>
@ -1121,19 +1123,21 @@
// //
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => { fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
collectingNodes.value = res.data; collectingNodes.value = res.data;
collectingNodes.value = collectingNodes.value.map((item) => ({ collectingNodes.value = collectingNodes.value = transformData(collectingNodes.value);
value: item.id,
label: item.pointName,
children: item.children
? item.children.map((child) => ({
value: child.id,
label: child.pointName,
}))
: [],
}));
}); });
}; };
//
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) => { const selectNode = (value) => {
spinning.value = true;
const getConsumeData = ref({ const getConsumeData = ref({
acquisitionDate: acquisitionDate.value, acquisitionDate: acquisitionDate.value,
collectionNode: value, collectionNode: value,
@ -1142,6 +1146,7 @@
}); });
fetch(carbonInventoryCheck.nodeCancellationConsumption, getConsumeData.value).then((res) => { fetch(carbonInventoryCheck.nodeCancellationConsumption, getConsumeData.value).then((res) => {
editFormState.value.consumption = res.data; editFormState.value.consumption = res.data;
spinning.value = false;
}); });
}; };
// //
@ -1696,6 +1701,13 @@
background: #c9e4ff; background: #c9e4ff;
} }
} }
:deep(.ant-empty) {
height: 80%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
} }
.right { .right {
flex: 1; flex: 1;
@ -1811,4 +1823,11 @@
display: flex; display: flex;
justify-content: right; justify-content: right;
} }
:deep(.ant-empty) {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
</style> </style>

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

@ -39,7 +39,11 @@
placeholder="请输入报告名称" /> placeholder="请输入报告名称" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="报告年度" name="reportYear"> <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>
<a-form-item ref="name" label="适用标准" name="genericStandard"> <a-form-item ref="name" label="适用标准" name="genericStandard">
<a-input <a-input
@ -60,6 +64,7 @@
<a-form-item ref="name" label="报告范围" name="reportScope"> <a-form-item ref="name" label="报告范围" name="reportScope">
<a-range-picker <a-range-picker
v-model:value="formState.reportScope" v-model:value="formState.reportScope"
:defaultPickerValue="defaultPickerValue"
picker="month" picker="month"
:disabledDate="disabledDate" :disabledDate="disabledDate"
valueFormat="YYYY-MM" /> valueFormat="YYYY-MM" />
@ -78,6 +83,8 @@
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary'; import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary';
import fillIn from './fillInPage/index.vue'; import fillIn from './fillInPage/index.vue';
import { message } from 'ant-design-vue';
import dayjs, { Dayjs } from 'dayjs';
defineOptions({ name: 'CarbonInventoryCheck' }); defineOptions({ name: 'CarbonInventoryCheck' });
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -104,6 +111,17 @@
const selectChange = (value) => { const selectChange = (value) => {
formState.value.reportScope = ''; 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 // form
const rules: Record<string, Rule[]> = { const rules: Record<string, Rule[]> = {
reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }], reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }],
@ -241,17 +259,21 @@
}; };
fetch(carbonInventoryCheck.downloadZip, deleteId.value, config) fetch(carbonInventoryCheck.downloadZip, deleteId.value, config)
.then((res) => { .then((res) => {
// URL blob if (res.type === 'application/json') {
const url = window.URL.createObjectURL(new Blob([res])); handlerResponseError(res);
// <a> } else {
const link = document.createElement('a'); // URL blob
link.href = url; const url = window.URL.createObjectURL(new Blob([res]));
link.setAttribute('download', '碳盘查凭证.zip'); // // <a>
document.body.appendChild(link); const link = document.createElement('a');
link.click(); link.href = url;
link.setAttribute('download', '碳盘查凭证.zip'); //
document.body.appendChild(link);
link.click();
// URL // URL
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
}
}) })
.catch((error) => { .catch((error) => {
console.error('下载图片失败:', error); console.error('下载图片失败:', error);
@ -295,6 +317,21 @@
}, },
rowKey: 'id', 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) => { const updateData = (newDataOne, newDataTwo) => {
isMainPage.value = newDataOne; isMainPage.value = newDataOne;

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

@ -360,6 +360,9 @@
background: #f2f2f2 !important; background: #f2f2f2 !important;
color: black !important; color: black !important;
} }
:deep(.ant-picker) {
border-radius: unset;
}
.month { .month {
width: 50%; width: 50%;
display: flex; display: flex;

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

@ -96,28 +96,32 @@
</span> </span>
</template> </template>
</template> </template>
<!-- <template #summary> <template #summary>
<a-table-summary-row> <a-table-summary-row>
<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-table-summary-cell :colSpan="2">合计</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-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-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-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-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-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>{{ totalBudget + 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-table-summary-row> </a-table-summary-row>
</template> --> </template>
</a-table> </a-table>
</a-card> </a-card>
</div> </div>
@ -135,16 +139,16 @@
v-model:value="formState.conversionRate" v-model:value="formState.conversionRate"
:maxlength="15" :maxlength="15"
@keydown="handleKeyDown" @keydown="handleKeyDown"
suffix="%"
:disabled="disabled" /> :disabled="disabled" />
<span class="unit">%</span>
</a-form-item> </a-form-item>
<a-form-item label="预算值" :required="true"> <a-form-item label="预算值" :required="true">
<a-input-number <a-input-number
v-model:value="formState.budget" v-model:value="formState.budget"
:maxlength="15" :maxlength="15"
@keydown="handleKeyDown" @keydown="handleKeyDown"
suffix="kWh"
:disabled="!disabled" /> :disabled="!disabled" />
<span class="unit">kWh</span>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
@ -247,6 +251,7 @@
QuestionCircleOutlined, QuestionCircleOutlined,
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary'; import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary';
import { getEnumEnergy } from '/@/api';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { any, string } from 'vue-types'; import { any, string } from 'vue-types';
import type { Dayjs } from 'dayjs'; import type { Dayjs } from 'dayjs';
@ -265,8 +270,10 @@
nodeName: { nodeName: {
type: string, type: string,
}, },
resourceType: {
type: string,
},
}); });
console.log(props, 'xxy');
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result; orgId.value = result;
@ -291,11 +298,29 @@
itemizeId: props.parentId, itemizeId: props.parentId,
type: props.type, type: props.type,
}); });
console.log(props.type, '6666');
const ids = ref([]); const ids = ref([]);
const lastActualUsageList = ref([]);
//
const unit = ref();
const totalActualUsage = ref();
const totalBudget = ref();
const totalLastYearActualUsage = ref();
const totalReferenceValue = ref();
const getTableData = () => { const getTableData = () => {
fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then((res) => { fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then(async (res) => {
data.value = res.data; let resUnit = await getEnumEnergy({ params: { code: props.resourceType } });
ids.value = data.value.map((item) => item.id); 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(); getTableData();
@ -313,14 +338,17 @@
{ {
title: Number(props.year) - 1 + '年实际用量', title: Number(props.year) - 1 + '年实际用量',
dataIndex: 'lastYearActualUsage', dataIndex: 'lastYearActualUsage',
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, //
}, },
{ {
title: props.year + '年实际用量', title: props.year + '年实际用量',
dataIndex: 'actualUsage', dataIndex: 'actualUsage',
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, //
}, },
{ {
title: '基准值', title: '基准值',
dataIndex: 'referenceValue', dataIndex: 'referenceValue',
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, //
}, },
{ {
title: '是否按去年折算', title: '是否按去年折算',
@ -329,10 +357,12 @@
{ {
title: '折算率', title: '折算率',
dataIndex: 'conversionRate', dataIndex: 'conversionRate',
customRender: ({ text }: { text: number }) => `${text}%`, //
}, },
{ {
title: '2024年预算', title: '2024年预算',
dataIndex: 'budget', dataIndex: 'budget',
customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, //
}, },
{ {
title: '操作', title: '操作',
@ -346,10 +376,10 @@
const formRef = ref(); const formRef = ref();
const formState = ref({}); const formState = ref({});
const labelCol = { span: 6 }; const labelCol = { span: 6 };
const wrapperCol = { span: 18 }; const wrapperCol = { span: 17 };
const editData = (record) => { const editData = (record) => {
open.value = true; open.value = true;
if (record.isLastYear) { if (record.isLastYear !== undefined) {
formState.value.ids = [record.id]; formState.value.ids = [record.id];
if (record.lastYear === '是') { if (record.lastYear === '是') {
formState.value.isLastYear = 1; formState.value.isLastYear = 1;
@ -357,6 +387,7 @@
formState.value.isLastYear = 0; formState.value.isLastYear = 0;
} }
formState.value.conversionRate = record.conversionRate; formState.value.conversionRate = record.conversionRate;
formState.value.lastYearList = [record.lastYearActualUsage];
formState.value.budget = record.budget; formState.value.budget = record.budget;
} }
}; };
@ -593,7 +624,7 @@
'基准值', '基准值',
], ],
top: '0', top: '0',
left: '0', right: '0',
textStyle: { textStyle: {
color: '#666', color: '#666',
fontSize: 12, fontSize: 12,
@ -650,6 +681,30 @@
], ],
series: [ 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 + '年实际用量', name: Number(props.year) - 1 + '年实际用量',
type: 'bar', type: 'bar',
barWidth: 18, barWidth: 18,
@ -707,28 +762,6 @@
}, },
data: actualUsageList.value, 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); chartInstance = echarts.init(chartRef.value);
@ -827,8 +860,8 @@
background: #f7f9ff; background: #f7f9ff;
padding: 12px; padding: 12px;
border-radius: 12px; border-radius: 12px;
background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(222, 255, 246, 1) 100%); background: linear-gradient(180deg, #ffffff 0%, #defff663 100%);
border: 1px solid rgba(18, 174, 132, 1); border: 1px solid #12ae8424;
.quantity { .quantity {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
@ -900,6 +933,11 @@
) { ) {
display: none !important; display: none !important;
} }
.unit {
position: absolute;
right: 10px;
top: 5px;
}
</style> </style>
<style scoped> <style scoped>
.editable-row-operations a { .editable-row-operations a {

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

@ -69,7 +69,8 @@
:parentId="parentId" :parentId="parentId"
:year="year" :year="year"
:type="type" :type="type"
:nodeName="nodeName" /> :nodeName="nodeName"
:resourceType="resourceType" />
</div> </div>
<!-- 新增节点 --> <!-- 新增节点 -->
<a-drawer :visible="visible" :width="500" @close="onClose" :footer-style="{ textAlign: 'right' }"> <a-drawer :visible="visible" :width="500" @close="onClose" :footer-style="{ textAlign: 'right' }">
@ -81,6 +82,7 @@
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:checkedKeys="treeCheckedKeys" :checkedKeys="treeCheckedKeys"
:tree-data="treeData" :tree-data="treeData"
:checkStrictly="true"
:show-line="{ showLeafIcon: false }" :show-line="{ showLeafIcon: false }"
v-if="treeData && treeData.length > 0" v-if="treeData && treeData.length > 0"
class="draggable-tree" class="draggable-tree"
@ -110,6 +112,7 @@
import categoryDeatil from './categoryDeatil.vue'; import categoryDeatil from './categoryDeatil.vue';
import { group } from '/@/api/deviceManage'; import { group } from '/@/api/deviceManage';
import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary'; import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary';
import { getEnumEnergy } from '/@/api';
import type { TreeProps } from 'ant-design-vue'; import type { TreeProps } from 'ant-design-vue';
import 'echarts-liquidfill'; import 'echarts-liquidfill';
defineOptions({ defineOptions({
@ -124,8 +127,6 @@
type: String, type: String,
}, },
}); });
console.log(props, 'xxy');
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result; orgId.value = result;
@ -155,6 +156,9 @@
selectedTime.value = false; selectedTime.value = false;
getMonthData(); getMonthData();
getBallQuery.value.yearAndMonth = 'month'; getBallQuery.value.yearAndMonth = 'month';
getBallQuery.value.itemizeIds = [];
getBallQuery.value.itemizeId = '';
getPillarQuery.value.itemizeId = '';
// getMonthPillarData(); // getMonthPillarData();
}; };
const changeToYear = () => { const changeToYear = () => {
@ -167,6 +171,9 @@
selectedTime.value = true; selectedTime.value = true;
getYearData(); getYearData();
getBallQuery.value.yearAndMonth = 'year'; getBallQuery.value.yearAndMonth = 'year';
getBallQuery.value.itemizeIds = [];
getBallQuery.value.itemizeId = '';
getPillarQuery.value.itemizeId = '';
// getYearPillarData(); // getYearPillarData();
}; };
// echarts // echarts
@ -299,8 +306,8 @@
symbolSize: [14, 4], symbolSize: [14, 4],
symbolMargin: 0.5, symbolMargin: 0.5,
symbolPosition: 'start', symbolPosition: 'start',
z: -20,
data: actualUsage.value, data: actualUsage.value,
barGap: '5%',
label: { label: {
normal: { normal: {
show: false, show: false,
@ -320,8 +327,8 @@
symbolSize: [14, 4], symbolSize: [14, 4],
symbolMargin: 0.5, symbolMargin: 0.5,
symbolPosition: 'start', symbolPosition: 'start',
z: -20,
data: budget.value, data: budget.value,
barGap: '5%',
label: { label: {
normal: { normal: {
show: false, show: false,
@ -339,7 +346,8 @@
color: '#f4664a', color: '#f4664a',
width: 2, width: 2,
}, },
data: referenceValue.value, // data: referenceValue.value,
data: [600],
}, },
], ],
}; };
@ -386,7 +394,7 @@
textStyle: { textStyle: {
color: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)', color: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
insideColor: '#12786f', insideColor: '#12786f',
fontSize: 40, fontSize: Number(ballData) > 1000 ? 20 : 40,
}, },
formatter: (params) => { formatter: (params) => {
// return `${(params.value * 100).toFixed(2)}%`; // return `${(params.value * 100).toFixed(2)}%`;
@ -431,7 +439,7 @@
const selectedKeys = ref<string[]>([]); const selectedKeys = ref<string[]>([]);
const treeCheckedKeys = ref<string[]>([]); const treeCheckedKeys = ref<string[]>([]);
const checkTreeNode = (checkedKeys, info) => { const checkTreeNode = (checkedKeys, info) => {
treeCheckedKeys.value = checkedKeys; treeCheckedKeys.value = checkedKeys.checked;
addTreeNode.value.itemizeIds = treeCheckedKeys.value; addTreeNode.value.itemizeIds = treeCheckedKeys.value;
}; };
const formatTreeData = (treeData) => { const formatTreeData = (treeData) => {
@ -450,7 +458,9 @@
year: selectYearValue.value.format('YYYY'), year: selectYearValue.value.format('YYYY'),
}); });
const onSubmit = () => { 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; data.value = res.data;
visible.value = false; visible.value = false;
changeToYear(); changeToYear();
@ -459,49 +469,6 @@
const onClose = () => { const onClose = () => {
visible.value = false; 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({ const yearQueryParams = ref({
orgId: orgId.value, orgId: orgId.value,
@ -515,8 +482,13 @@
addTreeNode.value.year = selectYearValue.value; addTreeNode.value.year = selectYearValue.value;
getYearData(); getYearData();
}; };
//
const unit = ref();
const getYearData = () => { 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; data.value = res.data;
res.data.forEach((item) => { res.data.forEach((item) => {
treeCheckedKeys.value.push(item.itemizeId.toString()); treeCheckedKeys.value.push(item.itemizeId.toString());
@ -540,7 +512,9 @@
getMonthData(); getMonthData();
}; };
const 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; data.value = res.data;
getMonthPillarData(); getMonthPillarData();
}); });
@ -553,17 +527,68 @@
const year = ref(selectYearValue.value.format('YYYY')); const year = ref(selectYearValue.value.format('YYYY'));
const type = ref(); const type = ref();
const nodeName = ref(); const nodeName = ref();
const resourceType = ref();
const detailData = (record) => { const detailData = (record) => {
electricTotal.value = false; electricTotal.value = false;
parentId.value = record.itemizeId; parentId.value = record.itemizeId;
type.value = props.tabId; type.value = props.tabId;
nodeName.value = record.itemizeName; 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) => { const customRow = (record) => {
return { return {
// //
onClick: (event) => { onClick: (event) => {
getPillarQuery.value.itemizeIds = [record.itemizeId];
getPillarQuery.value.itemizeId = record.itemizeId; getPillarQuery.value.itemizeId = record.itemizeId;
getBallQuery.value.itemizeIds = [record.itemizeId];
getBallQuery.value.itemizeId = record.itemizeId; getBallQuery.value.itemizeId = record.itemizeId;
if (selectedTime.value) { if (selectedTime.value) {
getYearPillarData(); getYearPillarData();

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

@ -70,7 +70,7 @@
}); });
} else if (key === '4') { } else if (key === '4') {
tabId.value = 6; tabId.value = 6;
energyType.value = 'gongshuiliang'; energyType.value = 'GAS_USAGE';
nextTick(() => { nextTick(() => {
if (provideWaterRef.value) { if (provideWaterRef.value) {
provideWaterRef.value.electricTotal = true; provideWaterRef.value.electricTotal = true;

4
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs2.vue

@ -161,7 +161,7 @@
.get(planManage.getTableData, { .get(planManage.getTableData, {
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6)
ctrlType: 2, ctrlType: 2,
}) })
.then((res) => { .then((res) => {
@ -235,7 +235,7 @@
.get(planManage.getTransData, { .get(planManage.getTransData, {
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6)
ctrlType: 2, ctrlType: 2,
}) })
.then((res) => { .then((res) => {

2
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue

@ -11,6 +11,7 @@
class="box-center-button" class="box-center-button"
:style="{ :style="{
backgroundColor: item.title === selectConditioning.title ? '#a7e5ff' : '#b5cdd9', backgroundColor: item.title === selectConditioning.title ? '#a7e5ff' : '#b5cdd9',
color: item.title === selectConditioning.title ? 'rgb(0, 61, 90)' : '#fff',
}" }"
@click="selectConditioningData(item, index)"> @click="selectConditioningData(item, index)">
{{ item.title }} {{ item.title }}
@ -28,6 +29,7 @@
class="box-center-button" class="box-center-button"
:style="{ :style="{
backgroundColor: item.title === selectConditioning.title ? '#a7e5ff' : '#b5cdd9', backgroundColor: item.title === selectConditioning.title ? '#a7e5ff' : '#b5cdd9',
color: item.title === selectConditioning.title ? 'rgb(0, 61, 90)' : '#fff',
}" }"
@click="selectConditioningData(item, index)"> @click="selectConditioningData(item, index)">
{{ item.title }} {{ item.title }}

71
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts

@ -19,7 +19,13 @@ export const newTrendPosition = [
//空调箱 //空调箱
export const airConditioningPosition = [ 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, lineType: 1,
}, },
{ {
@ -28,7 +34,8 @@ export const airConditioningPosition = [
bottom: '38%', bottom: '38%',
mLeft: '120px', mLeft: '120px',
width: '100px', 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, lineType: 1,
}, },
@ -37,17 +44,44 @@ export const airConditioningPosition = [
left: '41%', left: '41%',
bottom: '55.5%', bottom: '55.5%',
width: '300px', width: '300px',
height: '150px', height: '160px',
color: 'rgba(168, 226, 233, 0.5)', 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, lineType: 1,
}, },
{ styleText: { left: '60%', bottom: '63%' }, lineType: 1 },
{ styleText: { left: '76%', bottom: '63%' }, lineType: 1 },
{ {
styleText: { styleText: {
left: '71%', left: '71%',
bottom: '48%', 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: '', lineType: '',
}, },
@ -57,8 +91,11 @@ export const airConditioningPosition = [
bottom: '32%', bottom: '32%',
width: '300px', width: '300px',
height: '150px', height: '150px',
mTop: '150px', color: 'rgba(155, 216, 224, 0.2)',
color: 'rgba(168, 226, 233, 0.5)', border: '1px solid rgba(155, 216, 224, 1)',
position: 'absolute',
top: '163px',
abLeft: '343px',
}, },
lineType: '', lineType: '',
}, },
@ -70,7 +107,8 @@ export const floorHeatingPosition = [
left: '13.4%', left: '13.4%',
bottom: '44%', bottom: '44%',
width: '120px', 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: '', lineType: '',
}, },
@ -79,7 +117,8 @@ export const floorHeatingPosition = [
left: '21%', left: '21%',
bottom: '48%', bottom: '48%',
width: '115px', 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, lineType: 1,
}, },
@ -88,7 +127,8 @@ export const floorHeatingPosition = [
left: '34.5%', left: '34.5%',
bottom: '53.5%', bottom: '53.5%',
width: '355px', 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, lineType: 1,
}, },
@ -97,7 +137,8 @@ export const floorHeatingPosition = [
left: '47.5%', left: '47.5%',
bottom: '60.3%', bottom: '60.3%',
width: '90px', 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, lineType: 1,
}, },
@ -106,7 +147,8 @@ export const floorHeatingPosition = [
left: '60.5%', left: '60.5%',
bottom: '65.5%', bottom: '65.5%',
width: '350px', 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, lineType: 1,
}, },
@ -115,7 +157,8 @@ export const floorHeatingPosition = [
left: '73%', left: '73%',
bottom: '72%', bottom: '72%',
width: '140px', 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, lineType: 1,
}, },

181
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue

@ -18,7 +18,7 @@
</div> </div>
<div class="map-box"> <div class="map-box">
<!-- 温度 --> <!-- 温度 -->
<div v-if="selectIndex === 1"> <div v-if="selectIndex === 0">
<template v-for="(item, index) in sensorData" :key="index"> <template v-for="(item, index) in sensorData" :key="index">
<div <div
style="position: absolute" style="position: absolute"
@ -76,7 +76,7 @@
<newTrendModel :dataSource="newTrend" /> <newTrendModel :dataSource="newTrend" />
</a-drawer> </a-drawer>
<!-- 空调箱 --> <!-- 空调箱 -->
<div v-if="selectIndex === 0"> <div v-if="selectIndex === 3">
<template v-for="(item, index) in conditioningData" :key="index"> <template v-for="(item, index) in conditioningData" :key="index">
<div <div
style="position: absolute; z-index: 2" style="position: absolute; z-index: 2"
@ -116,7 +116,7 @@
ref="conditioningModels" ref="conditioningModels"
@selectConditioningData="selectConditioningData" /> @selectConditioningData="selectConditioningData" />
</a-drawer> </a-drawer>
<div v-if="selectIndex === 0" class="area"> <div v-if="selectIndex === 3" class="area-air">
<div <div
v-for="(item, index) in airConditioningPosition" v-for="(item, index) in airConditioningPosition"
:key="index" :key="index"
@ -126,7 +126,10 @@
height: item.styleText.height, height: item.styleText.height,
background: item.styleText.color, background: item.styleText.color,
marginLeft: item.styleText.mLeft, 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>
</div> </div>
@ -165,12 +168,16 @@
src="../image/airConditioningSystem/floorHeatingIcon.png" /> src="../image/airConditioningSystem/floorHeatingIcon.png" />
</template> </template>
</div> </div>
<div v-if="selectIndex === 4" class="area"> <div v-if="selectIndex === 4" class="area-air">
<div <div
v-for="(item, index) in floorHeatingData" v-for="(item, index) in floorHeatingData"
:key="index" :key="index"
style="display: flex" 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>
</div> </div>
<!-- 地暖详情 --> <!-- 地暖详情 -->
@ -223,8 +230,6 @@
} from './devicePosition'; } from './devicePosition';
// //
const state = items(); const state = items();
onMounted(() => {});
onUnmounted(() => {});
// //
const legend = ref([ const legend = ref([
{ url: temperature, name: '温度' }, { url: temperature, name: '温度' },
@ -240,105 +245,9 @@
// //
const peopleData = ref([]); const peopleData = ref([]);
// //
const newTrend = 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 conditioningData = 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 conditioningModels = ref(null); const conditioningModels = ref(null);
// //
const selectConditioning = ref({}); const selectConditioning = ref({});
@ -350,61 +259,7 @@
}, 100); }, 100);
}; };
// //
const floorHeatingData = ref([ 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 selectIndex = ref(0); const selectIndex = ref(0);
const selectLegend = (item: any, index: any) => { const selectLegend = (item: any, index: any) => {
@ -567,7 +422,7 @@
clearInterval(intervalId); clearInterval(intervalId);
}); });
</script> </script>
<style lang="less" scoped> <style lang="less">
.legend-box { .legend-box {
width: 80px; width: 80px;
height: 100%; height: 100%;
@ -619,7 +474,7 @@
perspective-origin: 900px 43px; perspective-origin: 900px 43px;
} }
.map-box .area { .map-box .area-air {
position: absolute; position: absolute;
bottom: 230px; bottom: 230px;
left: 250px; left: 250px;

966
hx-ai-intelligent/src/view/equipmentControl/coldAndHeatSources/index.vue

@ -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>

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/airSourceThermalCollapse.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/blue.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/blue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/coldWater.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/diluteCoolingPump.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/green.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/green.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/manifold.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/pressureWater.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/screwGeothermalHeatPump.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/softenedWaterTank.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/soilCoupler.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/waterProcessor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/image/coldAndHeatSources/waterPump.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

4
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue

@ -162,7 +162,7 @@
.get(planManage.getTableData, { .get(planManage.getTableData, {
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6)
ctrlType: 1, ctrlType: 1,
}) })
.then((res) => { .then((res) => {
@ -236,7 +236,7 @@
.get(planManage.getTransData, { .get(planManage.getTransData, {
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6)
ctrlType: 1, ctrlType: 1,
}) })
.then((res) => { .then((res) => {

3
hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue

@ -166,6 +166,7 @@
name: 'energyAlarmEdit', name: 'energyAlarmEdit',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
console.log(mainRef.value, '数据');
if (data?.executeStatus?.value === 2) { if (data?.executeStatus?.value === 2) {
NsMessage.warning('当前计划正在执行,无法进行编辑。如需编辑,请先停止计划.'); NsMessage.warning('当前计划正在执行,无法进行编辑。如需编辑,请先停止计划.');
} else { } else {
@ -191,7 +192,7 @@
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
confirm: true, confirm: true,
handle: (data: any) => { 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') { if (res.msg === 'success') {
NsMessage.success('操作成功'); NsMessage.success('操作成功');
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();

77
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanControl.vue

@ -1,18 +1,52 @@
<template> <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>
<div class="circuit-area"> <div class="circuit-area">
<div class="circuit-tab"></div> <div class="circuit-tab"></div>
<span class="circuit-text">{{ props.type }}</span> <span class="circuit-text">{{ props.type }}</span>
<div class="btn2"> <div class="btn2">
<a-badge :offset="[-10, 2]" :count="lockList.length"> <!-- <a-badge :offset="[-10, 2]" :count="lockList.length">
<button <button
class="openPlan" class="openPlan"
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" :class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }"
@click="togglePlan2"> @click="togglePlan2">
{{ isPlanEnabled2 ? '启用开关' : '禁用开关' }} {{ isPlanEnabled2 ? '启用开关' : '禁用开关' }}
</button> </button>
</a-badge> </a-badge> -->
<a-switch <a-switch
v-model:checked="selectAllCheckbox" v-model:checked="selectAllCheckbox"
:disabled="singleSelection" :disabled="singleSelection"
@ -35,9 +69,9 @@
:class="{ btn: true, selected: button.selected }" :class="{ btn: true, selected: button.selected }"
class="zmhlbtn" class="zmhlbtn"
@click="changeLine(button)"> @click="changeLine(button)">
<div v-if="button.lockStatus" class="btn-back"> <!-- <div v-if="button.lockStatus" class="btn-back">
<stop-outlined /> <stop-outlined />
</div> </div> -->
{{ button.name }} {{ button.name }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
@ -147,9 +181,13 @@
<div class="btn-item"> <div class="btn-item">
<div class="left">控制模式</div> <div class="left">控制模式</div>
<div class="right"> <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="" /> <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>
<div class="btn-item"> <div class="btn-item">
@ -297,6 +335,29 @@
*/ */
const emit = defineEmits(['reset', 'reload', 'resetAll']); 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); const selectAllCheckbox = ref(false);
// switch // switch
const toggleAllSelection = () => { const toggleAllSelection = () => {
let arr = [];
// //
if (selectAllCheckbox.value) { if (selectAllCheckbox.value) {
buttons2.value.forEach((item: any, index: number) => { buttons2.value.forEach((item: any, index: number) => {
@ -383,7 +443,6 @@
thisButton2.value = item; thisButton2.value = item;
} }
item.selected = true; item.selected = true;
arr.push(item.id);
}); });
// //
} else { } else {
@ -618,6 +677,8 @@
const refresh = (reload = false) => { const refresh = (reload = false) => {
// //
executeVisible.value = false; executeVisible.value = false;
//
selectedButton.value = '1';
// //
emit('reset'); emit('reset');
// //

4
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanPlant.vue

@ -176,7 +176,7 @@
.get(planManage.getTableData, { .get(planManage.getTableData, {
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6)
ctrlType: props.type, ctrlType: props.type,
}) })
.then((res) => { .then((res) => {
@ -249,7 +249,7 @@
.get(planManage.getTransData, { .get(planManage.getTransData, {
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6)
ctrlType: props.type, ctrlType: props.type,
}) })
.then((res) => { .then((res) => {

38
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue

@ -139,6 +139,7 @@
<a-tab-pane key="1" tab="控制面板"> <a-tab-pane key="1" tab="控制面板">
<fanControl <fanControl
ref="tabs1Ref" ref="tabs1Ref"
@reset="reset"
@reset-all="resetDrawer" @reset-all="resetDrawer"
:treeData="treeData" :treeData="treeData"
:type="`排风扇`" /> :type="`排风扇`" />
@ -200,6 +201,7 @@
<a-tab-pane key="1" tab="控制面板"> <a-tab-pane key="1" tab="控制面板">
<fanControl <fanControl
ref="tabs1Ref" ref="tabs1Ref"
@reset="reset"
@reset-all="resetDrawer" @reset-all="resetDrawer"
:treeData="treeData" :treeData="treeData"
:type="`风幕机`" /> :type="`风幕机`" />
@ -260,6 +262,7 @@
<a-tab-pane key="1" tab="控制面板"> <a-tab-pane key="1" tab="控制面板">
<fanControl <fanControl
ref="tabs1Ref" ref="tabs1Ref"
@reset="reset"
@reset-all="resetDrawer" @reset-all="resetDrawer"
:treeData="treeData" :treeData="treeData"
:type="`电动窗`" /> :type="`电动窗`" />
@ -374,8 +377,18 @@
// //
const reload = () => { const reload = () => {
http.get(url, { projectId: state.projectId, siteId: state.siteId }).then((res) => { http.get(url, { projectId: state.projectId, siteId: state.siteId }).then((res) => {
const data = res.data; const data = res.data[0].childList;
treeData.value = 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 { try {
tabs1Ref.value.setButtons2(treeData.value[0].childList); tabs1Ref.value.setButtons2(treeData.value[0].childList);
@ -398,8 +411,16 @@
url = ventilating.getTree3; url = ventilating.getTree3;
} }
http.get(url, { projectId: state.projectId, siteId: state.siteId }).then((res) => { http.get(url, { projectId: state.projectId, siteId: state.siteId }).then((res) => {
const data = res.data; const data = res.data[0].childList;
treeData.value = 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; 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>([]); const sensorData = ref<any>([]);
// 湿 // 湿

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/alarm1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/alarm2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/back.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/device1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/device2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/edit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/type1off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/type2off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
hx-ai-intelligent/src/view/equipmentControl/waterSystem/images/type3off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

85
hx-ai-intelligent/src/view/equipmentManage/group/config.ts

@ -48,16 +48,17 @@ const tableCarbonKeyMap = [
// textEllipsis: true, // textEllipsis: true,
textNumber: 5, textNumber: 5,
}, },
{ {
title: '设备名称', title: '设备id',
dataIndex: 'deviceInfoCode',
textNumber: 10, textNumber: 10,
dataIndex: 'deviceName',
// textEllipsis: true,
}, },
{ {
title: '设备id', title: '设备编号',
dataIndex: 'deviceInfoCode',
textNumber: 10, textNumber: 10,
dataIndex: 'deviceName',
// textEllipsis: true,
}, },
{ {
textNumber: 5, textNumber: 5,
@ -77,14 +78,22 @@ const tableCarbonKeyMap = [
{ {
title: '分组名称', title: '分组名称',
textNumber: 10, textNumber: 10,
dataIndex: 'deviceNameType', dataIndex: 'pointName',
}, },
{ {
textNumber: 5, textNumber: 5,
title: '设备状态', title: '设备状态',
dataIndex: 'status', dataIndex: 'status',
customRender: ({ value }) => { 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 { return {
defaultExpandAll: true, defaultExpandAll: true,
header: { header: {
@ -233,6 +242,8 @@ export const treeConfig = (orgId) => {
return [{ pointName: '全部', id: 'all', selectable: false, children: data }]; return [{ pointName: '全部', id: 'all', selectable: false, children: data }];
}, },
formConfig: { formConfig: {
callList: true, // 刷新列表
// defaultSelection: true, //树默认选择第一个
schemas: [ schemas: [
{ {
field: 'energyType', field: 'energyType',
@ -248,6 +259,12 @@ export const treeConfig = (orgId) => {
valueField: 'dicKey', valueField: 'dicKey',
placeholder: '请选择能耗种类', placeholder: '请选择能耗种类',
autoSelectFirst: true, 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: '编辑', label: '编辑',
name: 'GroupPointEdit', name: 'GroupPointEdit',
type: 'primary', type: 'primary',
handle: (a, b) => { handle: async (a, b) => {
if (isCarbon) { // if (isCarbon) {
editCarbonEquipmentRef.value.toggle(); editCarbonEquipmentRef.value.toggle();
} else { // } else {
el.value.toggle(); // el.value.toggle();
} // }
}, },
}, },
{ {
@ -457,7 +474,7 @@ export const tableConfigCal = (
return data.list.length === 0; return data.list.length === 0;
}, },
extra: { extra: {
xlsxMap: tableKeyMap, xlsxMap: isCarbon ? tableCarbonKeyMap : tableCalKeyMap,
xlsxName: '分组信息YYYY-MM-DD', xlsxName: '分组信息YYYY-MM-DD',
}, },
}, },
@ -656,7 +673,7 @@ export const tableConfigCal = (
}; };
}; };
export const editCarbonEquipmentConfig = (orgId) => { export const editCarbonEquipmentConfig = (orgId, props) => {
return ref({ return ref({
title: '设备信息', title: '设备信息',
api: device.queryDevicePage, api: device.queryDevicePage,
@ -674,22 +691,6 @@ export const editCarbonEquipmentConfig = (orgId) => {
formConfig: { formConfig: {
schemas: [ 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', field: 'deviceType',
label: '设备名称', label: '设备名称',
component: 'NsInput', component: 'NsInput',
@ -743,6 +744,26 @@ export const editCarbonEquipmentConfig = (orgId) => {
formConfig: { formConfig: {
schemas: [ 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', field: 'areas',
label: '设备区域', label: '设备区域',
component: 'NsCascader', component: 'NsCascader',

55
hx-ai-intelligent/src/view/equipmentManage/group/editCarbonEquipment.vue

@ -28,6 +28,7 @@
<a-select <a-select
placeholder="请选择" placeholder="请选择"
style="width: 200px" style="width: 200px"
v-model:value="linkOrgId"
:options="linkList" :options="linkList"
:field-names="{ label: 'orgName', value: 'orgId' }" :field-names="{ label: 'orgName', value: 'orgId' }"
@change="handleChange" /> @change="handleChange" />
@ -44,33 +45,46 @@
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { group, device } from '/@/api/deviceManage'; import { group, device } from '/@/api/deviceManage';
const orgId = ref(''); const orgId = ref('');
const key = ref(Date.now()); const key = ref(Date.now());
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result; orgId.value = result;
const linkOrgId = ref('');
// const selectOrgId = ref(orgId.value); // const selectOrgId = ref(orgId.value);
const props = defineProps({ params: Object });
const linkList = JSON.parse(sessionStorage.getItem('LINKLIST')!); 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 visible = ref(false);
const carbonEquipment = ref(); const carbonEquipment = ref();
// defineOptions({ // defineOptions({
// name: 'LedgerIndex', // name // name: 'LedgerIndex', // name
// }); // });
const changeEnergyType = (val) => {
props.params.energyType = val;
config = editCarbonEquipmentConfig(linkOrgId.value, props);
key.value = Date.now();
};
const handleChange = (value: string) => { const handleChange = (value: string) => {
// selectOrgId.value = value; // selectOrgId.value = value;
config = editCarbonEquipmentConfig(value); config = editCarbonEquipmentConfig(value, props);
debugger;
key.value = Date.now(); key.value = Date.now();
// carbonEquipment.value?.nsTableRef.reload(); // carbonEquipment.value?.nsTableRef.reload();
// carbonEquipment.value?.nsTableRef.treeReload(); // carbonEquipment.value?.nsTableRef.treeReload();
}; };
const props = defineProps({ params: Object });
const emit = defineEmits(['sure']); const emit = defineEmits(['sure']);
const toggle = () => { const toggle = (val) => {
if (val) {
config = editCarbonEquipmentConfig(linkOrgId.value, props);
key.value = Date.now();
}
visible.value = !visible.value; visible.value = !visible.value;
// clearData(); // clearData();
// visible.value && getData(currentId.value); // visible.value && getData(currentId.value);
@ -93,14 +107,35 @@
deviceInfoCode: selectedRowKeys[i], deviceInfoCode: selectedRowKeys[i],
}); });
} }
http.post(group.addCarbonDevice, params).then(() => { if (props.params.energyType && props.params.energyType == 'CARBON_EMISSIONS') {
emit('sure'); http.post(group.addCarbonDevice, params).then(() => {
NsMessage.success('操作成功'); emit('sure');
toggle(); 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({ defineExpose({
toggle, toggle,
changeEnergyType,
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

18
hx-ai-intelligent/src/view/equipmentManage/group/index.vue

@ -54,7 +54,7 @@
v-show="!defaultType && isCarbon" v-show="!defaultType && isCarbon"
class="table" class="table"
v-bind="configCarbon" v-bind="configCarbon"
ref="tableCalRef" /> ref="tableCalRef2" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -80,6 +80,7 @@
const modalFormRef = ref(); const modalFormRef = ref();
const tableRef = ref(); const tableRef = ref();
const tableCalRef = ref(); const tableCalRef = ref();
const tableCalRef2 = ref();
const editDrawerRef = ref(); const editDrawerRef = ref();
const editDrawerCalRef = ref(); const editDrawerCalRef = ref();
const editGroupRef = ref(); const editGroupRef = ref();
@ -89,7 +90,7 @@
const treeRef = ref(); const treeRef = ref();
const defaultType = ref(true); const defaultType = ref(true);
const isCarbon = ref(true); const isCarbon = ref(false);
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
const defaultParams = ref({ const defaultParams = ref({
orgId: result, orgId: result,
@ -119,7 +120,7 @@
setFactorRef, setFactorRef,
); );
const tConfig = treeConfig(result); const tConfig = treeConfig(result, editCarbonEquipmentRef, tableRef);
const nsModalFormConfig = ref({ const nsModalFormConfig = ref({
api: group.creatOrUpdate, api: group.creatOrUpdate,
data: {}, data: {},
@ -219,6 +220,7 @@
// //
tableRef.value?.nsTableRef.clearCheck(); tableRef.value?.nsTableRef.clearCheck();
tableCalRef.value?.nsTableRef.clearCheck(); tableCalRef.value?.nsTableRef.clearCheck();
tableCalRef2.value?.nsTableRef.clearCheck();
const { const {
node: { pointType, id, energyType }, node: { pointType, id, energyType },
} = record; } = record;
@ -226,20 +228,24 @@
defaultParams.value.id = id; defaultParams.value.id = id;
defaultParams.value.hxDeviceGroupId = id; defaultParams.value.hxDeviceGroupId = id;
defaultType.value = pointType === 'GROUPING_NODE'; defaultType.value = pointType === 'GROUPING_NODE';
defaultType.value
? tableRef.value?.nsTableRef.reload()
: tableCalRef.value?.nsTableRef.reload();
if (energyType == 'CARBON_EMISSIONS') { if (energyType == 'CARBON_EMISSIONS') {
isCarbon.value = true; isCarbon.value = true;
} else { } else {
isCarbon.value = false; isCarbon.value = false;
} }
defaultType.value
? tableRef.value?.nsTableRef.reload()
: isCarbon.value
? tableCalRef2.value?.nsTableRef.reload()
: tableCalRef.value?.nsTableRef.reload();
}; };
const handleOk = () => { const handleOk = () => {
defaultType.value defaultType.value
? tableRef.value?.nsTableRef.reload() ? tableRef.value?.nsTableRef.reload()
: isCarbon.value
? tableCalRef2.value?.nsTableRef.reload()
: tableCalRef.value?.nsTableRef.reload(); : tableCalRef.value?.nsTableRef.reload();
}; };
</script> </script>

22
hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue

@ -340,11 +340,25 @@
// //
const today = new Date(); const today = new Date();
const year = today.getFullYear(); const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0'); // getMonth() 0-11 const month = Number(String(today.getMonth() + 1).padStart(2, '0')); // getMonth() 0-11
const day = String(today.getDate()).padStart(2, '0'); const day = Number(String(today.getDate()).padStart(2, '0'));
startTime = year + '-' + month + '-' + day; if (dateTypeValue.value == 'month') {
endTime = year + '-' + month + '-' + day; 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;
}
} }
// //

63
hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/index.vue

@ -59,7 +59,10 @@
查询 查询
</a-button> </a-button>
</div> </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> </a-button>
</div> </div>
@ -84,6 +87,9 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import XLSX from 'xlsx';
// import Export2Excel from '/@/util/Export2Excel.js';
import { ref, onMounted, defineOptions } from 'vue'; import { ref, onMounted, defineOptions } from 'vue';
// import { http } from '/nerv-lib/util/http'; // import { http } from '/nerv-lib/util/http';
import { Pagination, SelectProps, TreeSelectProps, TableColumnType } from 'ant-design-vue'; 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 () => { onMounted(async () => {
// //
let frequency = await getEnum({ params: { enumType: 'TimeFlagEnum' } }); let frequency = await getEnum({ params: { enumType: 'TimeFlagEnum' } });

19
hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue

@ -65,6 +65,13 @@
:unCheckedValue="0" :unCheckedValue="0"
@change="(checked) => updateShowed(record)" /> @change="(checked) => updateShowed(record)" />
</template> </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>
<template #title> <template #title>
<div <div
@ -171,7 +178,7 @@
const typeList = ref(); const typeList = ref();
const quyuvalue = ref<string[]>([]); const quyuvalue = ref<string[]>([]);
const useFlag = ref<Number>(); const useFlag = ref<Number | null>();
const useFlagList = ref(); const useFlagList = ref();
useFlagList.value = [ useFlagList.value = [
{ {
@ -218,6 +225,7 @@
// //
const resetting = () => { const resetting = () => {
quyuvalue.value = []; quyuvalue.value = [];
useFlag.value = null;
areaName.value = ''; areaName.value = '';
}; };
// //
@ -296,6 +304,8 @@
// quyuvalue.value = [treeData2.value[0].childList[0].id]; // quyuvalue.value = [treeData2.value[0].childList[0].id];
// } // }
}); });
queryDeviceInfoListPage();
}; };
onMounted(async () => { onMounted(async () => {
// //
@ -360,6 +370,13 @@
{ {
title: '设备一级区域', title: '设备一级区域',
dataIndex: 'device1Area', dataIndex: 'device1Area',
// width: 300,
// ellipsis: true,
// textNumber: 15,
// textEllipsis: true,
// ellipsis: {
// showTitle: false, // false tooltip
// },
}, },
{ {
title: '设备二级区域', title: '设备二级区域',

Loading…
Cancel
Save