|
|
@ -48,16 +48,17 @@ const tableCarbonKeyMap = [ |
|
|
|
// textEllipsis: true,
|
|
|
|
textNumber: 5, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
title: '设备名称', |
|
|
|
title: '设备id', |
|
|
|
dataIndex: 'deviceInfoCode', |
|
|
|
textNumber: 10, |
|
|
|
dataIndex: 'deviceName', |
|
|
|
// textEllipsis: true,
|
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '设备id', |
|
|
|
dataIndex: 'deviceInfoCode', |
|
|
|
title: '设备编号', |
|
|
|
textNumber: 10, |
|
|
|
dataIndex: 'deviceName', |
|
|
|
// textEllipsis: true,
|
|
|
|
}, |
|
|
|
{ |
|
|
|
textNumber: 5, |
|
|
@ -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) { |
|
|
|
handle: async (a, b) => { |
|
|
|
// if (isCarbon) {
|
|
|
|
editCarbonEquipmentRef.value.toggle(); |
|
|
|
} else { |
|
|
|
el.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, |
|
|
@ -674,22 +691,6 @@ export const editCarbonEquipmentConfig = (orgId) => { |
|
|
|
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: '设备名称', |
|
|
|
component: 'NsInput', |
|
|
@ -743,6 +744,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: '设备区域', |
|
|
|
component: 'NsCascader', |
|
|
|