diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts index 59520f1..50665a4 100644 --- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts +++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts @@ -1,12 +1,10 @@ export enum carbonEmissionFactorLibrary { getTableList = '/carbon-smart/api/carbon/emission/factor/queryCarbonFactorPage', - addNewData = '/carbon-smart/api/carbon/emission/factor/creatOrUpdate', - editUser = '/carbon-smart/api/user/edit', - frozen = '/carbon-smart/api/user/frozen', - resetPwd = '/carbon-smart/api/user/resetPwd', - del = '/carbon-smart/api/user/del', - batchDel = '/carbon-smart/api/user/batchDel', + creatOrUpdate = '/carbon-smart/api/carbon/emission/factor/creatOrUpdate', + del = '/carbon-smart/api/carbon/emission/factor/del', + getEmissionProcess = '/carbon-smart/api/carbon/emission/factor/getEmissionProcess', + findById = '/carbon-smart/api/carbon/emission/factor/findById', getCarbonFactorTree = '/carbon-smart/api/carbon/emission/type/getCarbonFactorTree', - queryDeptTree = '/carbon-smart/api/user/queryDeptTree', - queryUserPerList = '/carbon-smart/api/user/queryUserPerList', + creat = '/carbon-smart/api/carbon/emission/type/creatOrUpdate', + delTreeNode = '/carbon-smart/api/carbon/emission/type/del', } diff --git a/hx-ai-intelligent/src/icon/tanpaiguanli.svg b/hx-ai-intelligent/src/icon/tanpaiguanli.svg index 61d50ee..c88f03b 100644 --- a/hx-ai-intelligent/src/icon/tanpaiguanli.svg +++ b/hx-ai-intelligent/src/icon/tanpaiguanli.svg @@ -1,4 +1,4 @@ - + diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts index a8e2083..58964de 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts @@ -1,21 +1,21 @@ import { ref } from 'vue'; import { http } from '/nerv-lib/util'; import { origanizemanage } from '/@/api/origanizemanage'; +import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary'; export const formConfig = (disabled) => { return ref([ { - field: 'field111', + field: 'fields', component: 'NsChildForm', componentProps: { schemas: [ { label: '排放源', - field: 'accountNo', + field: 'emissionSources', component: 'NsInput', componentProps: { placeholder: '请输入排放源', maxLength: 20, - disabled, }, rules: [ { @@ -25,7 +25,25 @@ export const formConfig = (disabled) => { ], }, { - field: 'userStatus', + field: 'emissionType', + label: '排放分类', + component: 'NsCascader', + fieldMap: ['emissionType'], + componentProps: { + placeholder: '请选择排放分类', + api: carbonEmissionFactorLibrary.getCarbonFactorTree, + fieldNames: { label: 'emissionName', value: 'id' }, + showSearch: true, + }, + rules: [ + { + required: true, + message: '请选择排放分类', + }, + ], + }, + { + field: 'emissionGas', label: '排放气体', component: 'NsSelect', componentProps: { @@ -33,12 +51,28 @@ export const formConfig = (disabled) => { placeholder: '请选择排放气体', options: [ { - label: '正常', - value: 0, + label: 'CO2', + value: 'CO2', + }, + { + label: 'CO2e', + value: 'CO2e', + }, + { + label: 'SF6', + value:'SF6', + }, + { + label: 'CH4', + value: 'CH4', }, { - label: '冻结', - value: 1, + label: 'PFCs', + value: 'PFCs', + }, + { + label: 'HFCs', + value: 'HFCs', }, ], }, @@ -50,55 +84,61 @@ export const formConfig = (disabled) => { ], }, { - field: 'userStatus', + field: 'emissionProcess', label: '排放环节', - component: 'NsSelect', + component: 'NsSelectApi', componentProps: { - allowClear: true, - placeholder: '请选择排放环节', - options: [ - { - label: '正常', - value: 0, - }, - { - label: '冻结', - value: 1, - }, - ], + 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: 'accountNo', - component: 'NsInput', + field: 'emissionFactors', + component: 'NsInputNumber', componentProps: { placeholder: '请输入排放因子值', maxLength: 20, - disabled, }, rules: [ { required: true, message: '请输入排放因子值', + trigger: 'change', }, ], }, { - field: 'userStatus', + field: 'carbonEmissionPrefix', label: '碳排前缀', component: 'NsSelect', componentProps: { + disabled: true, allowClear: true, + defaultValue: 't', placeholder: '请选择碳排前缀', options: [ { - label: '正常', - value: 0, + label: 'g', + value: 'g', + }, + { + label: 'kg', + value: 'kg', }, { - label: '冻结', - value: 1, + label: 't', + value: 't', }, ], }, @@ -111,12 +151,11 @@ export const formConfig = (disabled) => { }, { label: '碳排后缀', - field: 'accountNo', + field: 'carbonEmissionSuffix', component: 'NsInput', componentProps: { placeholder: '请输入碳排后缀', maxLength: 20, - disabled, }, rules: [ { @@ -127,21 +166,21 @@ export const formConfig = (disabled) => { }, { label: '已引用数', - field: 'accountNo', + field: 'numberOfReferences', component: 'NsInput', componentProps: { + defaultValue: 10, disabled: true, maxLength: 20, }, }, { label: '参考文献', - field: 'accountNo', + field: 'reference', component: 'NsTextarea', componentProps: { placeholder: '请输入参考文献', maxLength: 20, - disabled, }, }, ], diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index 4778be2..1d62e7e 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -19,6 +19,7 @@ + @expand="onExpand"> - + @@ -62,10 +68,9 @@ + placeholder="请输入排放类型"/>