diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts index df67ea8..52e3b68 100644 --- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts +++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts @@ -11,6 +11,7 @@ export enum carbonEmissionFactorLibrary { move = '/carbon-smart/api/carbon/emission/type/move', import = '/carbon-smart/api/carbon/emission/factor/import', export = '/carbon-smart/api/carbon/emission/factor/export', + gasAndDatabase = '/carbon-smart/api/carbon/emission/factor/gasAndDatabase', // 单位管理 dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement', findOutermost = '/carbon-smart/client/dict/findOutermost', @@ -64,6 +65,7 @@ export enum carbonInventoryCheck { getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList', updateTable = '/carbon-smart/api/carbon/inventory/details/update', voucherDownloadList = '/carbon-smart/api/carbon/inventory/details/voucherDownloadList', + nodeCancellationConsumption = '/carbon-smart/api/carbon/inventory/details/nodeCancellationConsumption', // 排放统计接口 emissionStatistic = '/carbon-smart/api/carbon/inventory/emissionStatistic', // 碳排流向 diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts index 5044eff..c6cf00c 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts @@ -17,12 +17,12 @@ export const formConfig = (disabled) => { placeholder: '请输入排放源', maxLength: 20, }, - rules: [ - { - required: true, - message: '请输入排放源', - }, - ], + // rules: [ + // { + // required: true, + // message: '请输入排放源', + // }, + // ], }, { field: 'emissionType', @@ -32,15 +32,18 @@ export const formConfig = (disabled) => { componentProps: { placeholder: '请选择排放分类', api: carbonEmissionFactorLibrary.getCarbonFactorTree, + defaultParams: { + orgId: sessionStorage.getItem('ORGID'), + }, fieldNames: { label: 'emissionName', value: 'id' }, showSearch: true, }, - rules: [ - { - required: true, - message: '请选择排放分类', - }, - ], + // rules: [ + // { + // required: true, + // message: '请选择排放分类', + // }, + // ], }, { field: 'emissionGas', @@ -76,32 +79,13 @@ export const formConfig = (disabled) => { }, ], }, - rules: [ - { - required: true, - message: '请选择排放气体', - }, - ], + // rules: [ + // { + // required: true, + // message: '请选择排放气体', + // }, + // ], }, - // { - // field: 'emissionProcess', - // label: '排放环节', - // component: 'NsSelectApi', - // componentProps: { - // api: carbonEmissionFactorLibrary.getEmissionProcess, - // params: { - // emissionType: sessionStorage.getItem('checkedTreeNode'), - // }, - // resultField: 'data', - // labelField: 'emissionProcess', - // valueField: 'emissionProcess', - // immediate: true, - // autoSelectFirst: false, - // filterOption:false, - // showSearch:true, - // autoClearSearchValue:false - // }, - // }, { label: '排放环节', field: 'emissionProcess', @@ -110,12 +94,12 @@ export const formConfig = (disabled) => { placeholder: '请输入排放环节', maxLength: 20, }, - rules: [ - { - required: true, - message: '请输入排放环节', - }, - ], + // rules: [ + // { + // required: true, + // message: '请输入排放环节', + // }, + // ], }, { label: '排放因子', @@ -125,13 +109,13 @@ export const formConfig = (disabled) => { placeholder: '请输入排放因子值', maxLength: 20, }, - rules: [ - { - required: true, - message: '请输入排放因子值', - trigger: 'change', - }, - ], + // rules: [ + // { + // required: true, + // message: '请输入排放因子值', + // trigger: 'change', + // }, + // ], }, { field: 'carbonEmissionPrefix', @@ -157,12 +141,12 @@ export const formConfig = (disabled) => { }, ], }, - rules: [ - { - required: true, - message: '请选择碳排前缀', - }, - ], + // rules: [ + // { + // required: true, + // message: '请选择碳排前缀', + // }, + // ], }, { label: '碳排后缀', @@ -172,25 +156,25 @@ export const formConfig = (disabled) => { placeholder: '请输入碳排后缀', maxLength: 20, }, - rules: [ - { - required: true, - message: '请输入碳排后缀', - }, - ], + // rules: [ + // { + // required: true, + // message: '请输入碳排后缀', + // }, + // ], }, { label: '已引用数', field: 'numberOfReferences', component: 'NsInput', componentProps: { - defaultValue: 10, + defaultValue: '', disabled: true, maxLength: 20, }, }, { - label: '参考文献', + label: '参考文献(选填)', field: 'bibliography', component: 'NsTextarea', componentProps: { diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index c310738..ce9bb82 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -621,7 +621,7 @@ setTimeout(() => { formData.value = { carbonEmissionPrefix: 't', - numberOfReferences: '10', + numberOfReferences: '', orgId: orgId.value, }; userAuthList.value.splice(0); @@ -778,17 +778,23 @@ userAuthList.value.splice(0); setTimeout(() => { const measurementUnit = ref([]); - http.post(carbonEmissionFactorLibrary.getCarbonFactorTree, {}).then((res) => { - measurementUnit.value = res.data; - http.post(carbonEmissionFactorLibrary.findById, { id: record.id }).then((res) => { - if (res.data.emissionType) { - let selectDevice = ref([Number(res.data.emissionType)]); - findParentIds(measurementUnit.value, res.data.emissionType, selectDevice.value); - res.data.emissionType = selectDevice; - } - formData.value = res.data; + http + .post(carbonEmissionFactorLibrary.getCarbonFactorTree, { orgId: orgId.value }) + .then((res) => { + measurementUnit.value = res.data; + http.post(carbonEmissionFactorLibrary.findById, { id: record.id }).then((res) => { + if (res.data.emissionType) { + let selectDevice = ref([Number(res.data.emissionType)]); + findParentIds( + measurementUnit.value, + res.data.emissionType, + selectDevice.value, + ); + res.data.emissionType = selectDevice; + } + formData.value = res.data; + }); }); - }); }, 10); opMap.value.type = 'edit'; opMap.value.fuc = (formData: any) => { @@ -846,56 +852,36 @@ { field: 'emissionGas', label: '排放气体', - component: 'NsSelect', + component: 'NsSelectApi', componentProps: { - allowClear: true, placeholder: '请选择排放气体', - options: [ - { - label: 'CO2', - value: 1, - }, - { - label: 'CO2e', - value: 2, - }, - { - label: 'SF6', - value: 3, - }, - { - label: 'CH4', - value: 4, - }, - { - label: 'PFCs', - value: 5, - }, - { - label: 'HFCs', - value: 6, - }, - ], + api: carbonEmissionFactorLibrary.gasAndDatabase, + params: { + orgId: orgId.value, + emissionList, + type: 'gas', + }, + immediate: true, + labelField: 'label', + valueField: 'value', }, }, { field: 'carbonDatabase', label: '数据库名称', - component: 'NsSelect', + component: 'NsSelectApi', componentProps: { allowClear: true, placeholder: '请选择数据库名称', - showSearch: true, - options: [ - { - label: '正常', - value: '正常', - }, - { - label: '冻结', - value: '冻结', - }, - ], + api: carbonEmissionFactorLibrary.gasAndDatabase, + params: { + orgId: orgId.value, + emissionList, + type: 'database', + }, + immediate: true, + labelField: 'label', + valueField: 'value', }, }, { diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue index a5b9204..7e797b7 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue @@ -3,7 +3,7 @@