Browse Source

规范代码

temp
fks-xuxinyue 2 months ago
parent
commit
61dcbfeacd
  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';
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 mainRef = ref();
const data = reactive({});
let formData = ref({});
let formData = ref({
orgId: orgId.value,
});
const formRef = ref();
const visible = ref(false);
const unitManagement = ref(false);
@ -256,15 +267,6 @@
const casData = ref([]);
const treeData = 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;
@ -476,8 +478,8 @@
treeNodeAdd.value = false;
};
//
const getOrgTree = (params?) => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, params).then((res) => {
const getOrgTree = () => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, { orgId: orgId.value }).then((res) => {
gData.value = res.data;
//
// const selectedNodes = [];

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

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

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

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

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

@ -340,7 +340,7 @@
import { ref, watch, toRaw, defineEmits } from 'vue';
import { http } from '/nerv-lib/util/http';
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 {
EditOutlined,
PlusCircleOutlined,

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

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

Loading…
Cancel
Save