zhaohy 4 months ago
parent
commit
8b40268bd1
  1. 26
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  2. 9
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  3. 7
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  4. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  5. 61
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue

26
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue

@ -230,10 +230,21 @@
import { log } from 'node:console'; import { log } from 'node:console';
defineOptions({ name: 'OrderListIndex' }); defineOptions({ name: 'OrderListIndex' });
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const dynamicDisabled = computed(() => {
return formRef.value?.validateResult && userAuthList.value?.length;
});
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
const selectTreeDataValue = ref<string>(''); const selectTreeDataValue = ref<string>('');
const mainRef = ref(); const mainRef = ref();
const data = reactive({}); const data = reactive({});
let formData = ref({}); let formData = ref({
orgId: orgId.value,
});
const formRef = ref(); const formRef = ref();
const visible = ref(false); const visible = ref(false);
const unitManagement = ref(false); const unitManagement = ref(false);
@ -256,15 +267,6 @@
const casData = ref([]); const casData = ref([]);
const treeData = ref([]); const treeData = ref([]);
const userAuthList = ref([]); const userAuthList = ref([]);
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const dynamicDisabled = computed(() => {
return formRef.value?.validateResult && userAuthList.value?.length;
});
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
// //
const x = 3; const x = 3;
@ -476,8 +478,8 @@
treeNodeAdd.value = false; treeNodeAdd.value = false;
}; };
// //
const getOrgTree = (params?) => { const getOrgTree = () => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, params).then((res) => { fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, { orgId: orgId.value }).then((res) => {
gData.value = res.data; gData.value = res.data;
// //
// const selectedNodes = []; // const selectedNodes = [];

9
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue

@ -165,19 +165,16 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref,reactive, toRaw } from 'vue'; import { ref, toRaw } from 'vue';
import type { UnwrapRef } from 'vue';
import type { Rule } from 'ant-design-vue/es/form'; import type { Rule } from 'ant-design-vue/es/form';
import { Pagination,message,Modal } from 'ant-design-vue'; import { Pagination,message,Modal } from 'ant-design-vue';
import { InboxOutlined } from '@ant-design/icons-vue'; import type { TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
import type { CascaderProps,TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import dayjs, { Dayjs } from 'dayjs'; import dayjs, { Dayjs } from 'dayjs';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { tableColumns } from '../config'; import { tableColumns } from '../config';
import { energyConsumption,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary'; import { energyConsumption,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
import { group } from '/@/api/deviceManage'; import { group } from '/@/api/deviceManage';
import { dict } from '/@/api';
defineOptions({ defineOptions({
energyType: 'EnergyConsumption', // name energyType: 'EnergyConsumption', // name
components: { components: {

7
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue

@ -138,6 +138,7 @@
quickCalculation, quickCalculation,
carbonEmissionFactorLibrary, carbonEmissionFactorLibrary,
} from '/@/api/carbonEmissionFactorLibrary'; } from '/@/api/carbonEmissionFactorLibrary';
import { or } from '@vueuse/core';
defineOptions({ defineOptions({
energyType: 'quickCalculation', // name energyType: 'quickCalculation', // name
components: { components: {
@ -249,7 +250,7 @@
const statsId = ref(); const statsId = ref();
// //
const getTreeData = () => { const getTreeData = () => {
fetch(quickCalculation.carbonQuickTree).then((res) => { fetch(quickCalculation.carbonQuickTree, { orgId: orgId.value }).then((res) => {
gData.value = res.data; gData.value = res.data;
energyType.value = gData.value[0].children[0].id; energyType.value = gData.value[0].children[0].id;
statsId.value = gData.value[0].children[0].id; statsId.value = gData.value[0].children[0].id;
@ -366,7 +367,9 @@
const formRef = ref(); const formRef = ref();
const labelCol = { span: 6 }; const labelCol = { span: 6 };
const wrapperCol = { span: 18 }; const wrapperCol = { span: 18 };
const formState = ref({}); const formState = ref({
orgId: orgId.value,
});
const visible = ref(false); const visible = ref(false);
// form // form

2
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue

@ -340,7 +340,7 @@
import { ref, watch, toRaw, defineEmits } from 'vue'; import { ref, watch, toRaw, defineEmits } from 'vue';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { Pagination, Modal, message } from 'ant-design-vue'; import { Pagination, Modal, message } from 'ant-design-vue';
import type { TreeProps, TableColumnsType, UploadChangeParam } from 'ant-design-vue'; import type { TreeProps, UploadChangeParam } from 'ant-design-vue';
import { import {
EditOutlined, EditOutlined,
PlusCircleOutlined, PlusCircleOutlined,

61
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue

@ -20,8 +20,7 @@
:model="formState" :model="formState"
:rules="rules" :rules="rules"
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol">
>
<a-form-item ref="name" label="报告名称" name="reportName"> <a-form-item ref="name" label="报告名称" name="reportName">
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" /> <a-input v-model:value="formState.reportName" placeholder="请输入报告名称" />
</a-form-item> </a-form-item>
@ -38,7 +37,10 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item ref="name" label="报告范围" name="reportScope"> <a-form-item ref="name" label="报告范围" name="reportScope">
<a-range-picker v-model:value="formState.reportScope" picker="month" valueFormat="YYYY-MM" /> <a-range-picker
v-model:value="formState.reportScope"
picker="month"
valueFormat="YYYY-MM" />
</a-form-item> </a-form-item>
</a-form> </a-form>
<template #footer> <template #footer>
@ -49,7 +51,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref,toRaw } from 'vue'; import { ref, toRaw } from 'vue';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary'; import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary';
import fillIn from './fillInPage/index.vue'; import fillIn from './fillInPage/index.vue';
@ -65,7 +67,7 @@
const fillInPage = ref(false); const fillInPage = ref(false);
// //
const visible = ref(false); const visible = ref(false);
const formState = ref({}) const formState = ref({});
const formRef = ref(); const formRef = ref();
const labelCol = { span: 5 }; const labelCol = { span: 5 };
const wrapperCol = { span: 19 }; const wrapperCol = { span: 19 };
@ -80,7 +82,7 @@
// //
const onClose = () => { const onClose = () => {
visible.value = false; visible.value = false;
formState.value = {} formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
}; };
// //
@ -89,15 +91,15 @@
.validate() .validate()
.then(() => { .then(() => {
console.log('values', formState, toRaw(formState)); console.log('values', formState, toRaw(formState));
formState.value.enterpriseOrgId = orgId.value formState.value.enterpriseOrgId = orgId.value;
formState.value.startTime = formState.value.reportScope[0] formState.value.startTime = formState.value.reportScope[0];
formState.value.endTime = formState.value.reportScope[1] formState.value.endTime = formState.value.reportScope[1];
fetch(carbonInventoryCheck.createOrUpdate,formState.value).then((res) => { fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {
visible.value = false visible.value = false;
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
}) })
.catch(error => { .catch((error) => {
console.log('error', error); console.log('error', error);
}); });
}; };
@ -110,7 +112,7 @@
title: '数据库', title: '数据库',
api: carbonInventoryCheck.carbonInventoryList, api: carbonInventoryCheck.carbonInventoryList,
params: { params: {
orgId orgId,
}, },
headerActions: [ headerActions: [
{ {
@ -118,7 +120,7 @@
name: 'userAdd', name: 'userAdd',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
visible.value = true visible.value = true;
}, },
}, },
], ],
@ -161,10 +163,10 @@
label: '编辑', label: '编辑',
name: 'userEdit', name: 'userEdit',
handle: (record: any) => { handle: (record: any) => {
visible.value = true visible.value = true;
fetch(carbonInventoryCheck.findById,{id:record.id}).then((res) => { fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => {
formState.value = res.data formState.value = res.data;
formState.value.reportScope = [res.data.startTime,res.data.endTime] formState.value.reportScope = [res.data.startTime, res.data.endTime];
}); });
}, },
}, },
@ -172,17 +174,16 @@
label: '填报', label: '填报',
name: 'fillIn', name: 'fillIn',
handle: (record: any) => { handle: (record: any) => {
isMainPage.value = false isMainPage.value = false;
fillInPage.value = true fillInPage.value = true;
reportId.value = record.id reportId.value = record.id;
year.value = record.reportYear year.value = record.reportYear;
}, },
}, },
{ {
label: '下载', label: '下载',
name: 'download', name: 'download',
handle: (record: any) => { handle: (record: any) => {},
},
}, },
{ {
label: '删除', label: '删除',
@ -213,7 +214,7 @@
componentProps: { componentProps: {
valueFormat: 'YYYY', valueFormat: 'YYYY',
placeholder: ['报告年度', '报告年度'], placeholder: ['报告年度', '报告年度'],
picker:"year" picker: 'year',
}, },
}, },
], ],
@ -222,12 +223,10 @@
rowKey: 'id', rowKey: 'id',
}); });
// //
const updateData = (newDataOne,newDataTwo) => { const updateData = (newDataOne, newDataTwo) => {
isMainPage.value = newDataOne isMainPage.value = newDataOne;
fillInPage.value = newDataTwo fillInPage.value = newDataTwo;
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>

Loading…
Cancel
Save