1.修改 设备管理 - 分组管理 页面

2.修改 监控中心 - 能耗监测 初始化时间bug
This commit is contained in:
fks-yangshouda
2024-08-27 13:53:56 +08:00
parent 15811933c3
commit 30a76a5cc3
4 changed files with 128 additions and 52 deletions

View File

@@ -48,17 +48,18 @@ const tableCarbonKeyMap = [
// textEllipsis: true,
textNumber: 5,
},
{
title: '设备名称',
textNumber: 10,
dataIndex: 'deviceName',
// textEllipsis: true,
},
{
title: '设备id',
dataIndex: 'deviceInfoCode',
textNumber: 10,
},
{
title: '设备编号',
textNumber: 10,
dataIndex: 'deviceName',
// textEllipsis: true,
},
{
textNumber: 5,
title: '碳排因子值',
@@ -77,14 +78,22 @@ const tableCarbonKeyMap = [
{
title: '分组名称',
textNumber: 10,
dataIndex: 'deviceNameType',
dataIndex: 'pointName',
},
{
textNumber: 5,
title: '设备状态',
dataIndex: 'status',
customRender: ({ value }) => {
return value === '0' ? '启用' : '停用';
if (value) {
if (value === '0') {
return '启用';
} else if (value === '1') {
return '停用';
}
} else {
return '';
}
},
},
];
@@ -219,7 +228,7 @@ export const editCalTreeConfig = (orgId) => ({
],
},
});
export const treeConfig = (orgId) => {
export const treeConfig = (orgId, editCarbonEquipmentRef, tableRef) => {
return {
defaultExpandAll: true,
header: {
@@ -233,6 +242,8 @@ export const treeConfig = (orgId) => {
return [{ pointName: '全部', id: 'all', selectable: false, children: data }];
},
formConfig: {
callList: true, // 刷新列表
// defaultSelection: true, //树默认选择第一个
schemas: [
{
field: 'energyType',
@@ -248,6 +259,12 @@ export const treeConfig = (orgId) => {
valueField: 'dicKey',
placeholder: '请选择能耗种类',
autoSelectFirst: true,
onSelect: async (cur, record) => {
editCarbonEquipmentRef.value.changeEnergyType(cur);
tableRef.value?.nsTableRef.clearCheck();
tableRef.value?.nsTableRef.reload();
// value.value = cur;
},
},
},
{
@@ -402,12 +419,12 @@ export const tableConfigCal = (
label: '编辑',
name: 'GroupPointEdit',
type: 'primary',
handle: (a, b) => {
if (isCarbon) {
editCarbonEquipmentRef.value.toggle();
} else {
el.value.toggle();
}
handle: async (a, b) => {
// if (isCarbon) {
editCarbonEquipmentRef.value.toggle();
// } else {
// el.value.toggle();
// }
},
},
{
@@ -656,7 +673,7 @@ export const tableConfigCal = (
};
};
export const editCarbonEquipmentConfig = (orgId) => {
export const editCarbonEquipmentConfig = (orgId, props) => {
return ref({
title: '设备信息',
api: device.queryDevicePage,
@@ -673,22 +690,6 @@ export const editCarbonEquipmentConfig = (orgId) => {
fieldNames: { title: 'deviceType', key: 'code' },
formConfig: {
schemas: [
{
field: 'energyType',
label: '',
component: 'NsSelectApi',
autoSubmit: true,
componentProps: {
api: () => dict({ params: { dicKey: 'ENERGY_TYPE' } }),
// params: { dicKey: 'ENERGY_TYPE' },
immediate: true,
// resultField: 'data.ENERGY_TYPE',
labelField: 'cnValue',
valueField: 'dicKey',
placeholder: '请选择能耗种类',
autoSelectFirst: true,
},
},
{
field: 'deviceType',
label: '设备名称',
@@ -742,6 +743,26 @@ export const editCarbonEquipmentConfig = (orgId) => {
],
formConfig: {
schemas: [
{
field: 'energyType',
label: '',
component: 'NsSelectApi',
// autoSubmit: true,
defaultValue: props.params.energyType,
componentProps: {
api: () => dict({ params: { dicKey: 'ENERGY_TYPE' } }),
// params: { dicKey: 'ENERGY_TYPE' },
immediate: true,
// resultField: 'data.ENERGY_TYPE',
labelField: 'cnValue',
valueField: 'dicKey',
placeholder: '请选择能耗种类',
// autoSelectFirst: true,
},
dynamicDisabled: (data: any) => {
return props.params.energyType !== 'CARBON_EMISSIONS';
},
},
{
field: 'areas',
label: '设备区域',