|
@ -280,6 +280,21 @@ |
|
|
</a-row> |
|
|
</a-row> |
|
|
<a-row v-if="automatic"> |
|
|
<a-row v-if="automatic"> |
|
|
<a-col :span="24"> |
|
|
<a-col :span="24"> |
|
|
|
|
|
<a-form-item label="能耗类型"> |
|
|
|
|
|
<a-select |
|
|
|
|
|
v-model:value="editFormState.energyConsumptionType" |
|
|
|
|
|
@change="changeEnergyType" |
|
|
|
|
|
placeholder="请选择能耗类型"> |
|
|
|
|
|
<a-select-option |
|
|
|
|
|
v-for="(item, index) in energyTypeOptions" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
:value="item.dicKey"> |
|
|
|
|
|
{{ item.cnValue }} |
|
|
|
|
|
</a-select-option> |
|
|
|
|
|
</a-select> |
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
</a-col> |
|
|
|
|
|
<a-col :span="24"> |
|
|
<a-form-item ref="name" label="采集节点" name="collectionNode"> |
|
|
<a-form-item ref="name" label="采集节点" name="collectionNode"> |
|
|
<a-tree-select |
|
|
<a-tree-select |
|
|
v-model:value="editFormState.collectionNode" |
|
|
v-model:value="editFormState.collectionNode" |
|
@ -374,6 +389,7 @@ |
|
|
} from '/@/api/carbonEmissionFactorLibrary'; |
|
|
} from '/@/api/carbonEmissionFactorLibrary'; |
|
|
import { group } from '/@/api/deviceManage'; |
|
|
import { group } from '/@/api/deviceManage'; |
|
|
import { debug, log } from 'node:console'; |
|
|
import { debug, log } from 'node:console'; |
|
|
|
|
|
import { dict } from '/@/api'; |
|
|
defineOptions({ |
|
|
defineOptions({ |
|
|
energyType: 'fillInPage', // 与页面路由name一致缓存才可生效 |
|
|
energyType: 'fillInPage', // 与页面路由name一致缓存才可生效 |
|
|
components: { |
|
|
components: { |
|
@ -927,9 +943,13 @@ |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 5, |
|
|
pageSize: 5, |
|
|
}); |
|
|
}); |
|
|
const edit = (record) => { |
|
|
const energyTypeOptions = ref([]); |
|
|
getDictList(); |
|
|
const acquisitionDate = ref(); |
|
|
// queryData.value.emissionSources = record.emissionFactors; |
|
|
const edit = async (record) => { |
|
|
|
|
|
acquisitionDate.value = record.acquisitionDate; |
|
|
|
|
|
// 获取能耗类型 |
|
|
|
|
|
const options = await dict({ params: { dicKey: 'ENERGY_TYPE' } }); |
|
|
|
|
|
energyTypeOptions.value = options.data.data; |
|
|
getNewTable(); |
|
|
getNewTable(); |
|
|
editFormState.value.id = record.id; |
|
|
editFormState.value.id = record.id; |
|
|
editFormState.value.dataSources = record.dataSources; |
|
|
editFormState.value.dataSources = record.dataSources; |
|
@ -971,10 +991,11 @@ |
|
|
}; |
|
|
}; |
|
|
// 定义采集节点数的变量 |
|
|
// 定义采集节点数的变量 |
|
|
const collectingNodes = ref<TreeSelectProps['treeData']>([]); |
|
|
const collectingNodes = ref<TreeSelectProps['treeData']>([]); |
|
|
const getDictList = () => { |
|
|
const getTypeConsume = ref(); |
|
|
|
|
|
const changeEnergyType = (value) => { |
|
|
|
|
|
getTypeConsume.value = value; |
|
|
// 获取自动采集节点的数据 |
|
|
// 获取自动采集节点的数据 |
|
|
fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE', orgId: orgId.value }).then( |
|
|
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => { |
|
|
(res) => { |
|
|
|
|
|
collectingNodes.value = res.data; |
|
|
collectingNodes.value = res.data; |
|
|
collectingNodes.value = collectingNodes.value.map((item) => ({ |
|
|
collectingNodes.value = collectingNodes.value.map((item) => ({ |
|
|
value: item.id, |
|
|
value: item.id, |
|
@ -986,8 +1007,18 @@ |
|
|
})) |
|
|
})) |
|
|
: [], |
|
|
: [], |
|
|
})); |
|
|
})); |
|
|
}, |
|
|
}); |
|
|
); |
|
|
}; |
|
|
|
|
|
const selectNode = (value) => { |
|
|
|
|
|
const getConsumeData = ref({ |
|
|
|
|
|
acquisitionDate: acquisitionDate.value, |
|
|
|
|
|
collectionNode: value, |
|
|
|
|
|
orgId: orgId.value, |
|
|
|
|
|
energyConsumptionType: getTypeConsume.value, |
|
|
|
|
|
}); |
|
|
|
|
|
fetch(carbonInventoryCheck.nodeCancellationConsumption, getConsumeData.value).then((res) => { |
|
|
|
|
|
editFormState.value.consumption = res.data; |
|
|
|
|
|
}); |
|
|
}; |
|
|
}; |
|
|
// 上传附件 |
|
|
// 上传附件 |
|
|
const fileList = ref<UploadProps['fileList']>([]); |
|
|
const fileList = ref<UploadProps['fileList']>([]); |
|
@ -1006,9 +1037,9 @@ |
|
|
const handleChange = (info: UploadChangeParam) => { |
|
|
const handleChange = (info: UploadChangeParam) => { |
|
|
// fileList.value = [...info.fileList]; |
|
|
// fileList.value = [...info.fileList]; |
|
|
const { fileList: newFileList } = info; |
|
|
const { fileList: newFileList } = info; |
|
|
delIds.value.push(info.fileList[0].uid); |
|
|
|
|
|
// 删除fileList中的第一条数据 |
|
|
// 删除fileList中的第一条数据 |
|
|
if (newFileList.length > 1) { |
|
|
if (newFileList.length > 1) { |
|
|
|
|
|
delIds.value.push(info.fileList[0].uid); |
|
|
newFileList.shift(); // 删除第一条数据 |
|
|
newFileList.shift(); // 删除第一条数据 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|