From 6137aaa4b63194bd8e3eb5a2151defa3cd64e00e Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Thu, 11 Jul 2024 15:53:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=90=8C=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=99=BB=E5=BD=95=E4=BF=A1=E6=81=AF=E6=B1=A1=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/App.vue | 4 +- hx-ai-intelligent/src/api/deviceManage.ts | 4 + hx-ai-intelligent/src/config/app.config.ts | 2 +- .../carbonEmissionFactorLibrary/index.vue | 2 +- .../energyConsumption/index.vue | 2 +- .../src/view/equipmentManage/group/config.ts | 75 ++++++++++------- .../src/view/equipmentManage/group/edit.vue | 98 +++++++++++++--------- .../src/view/equipmentManage/group/index.vue | 27 ++++-- .../organizationManage/departmentManage/index.vue | 2 +- .../view/organizationManage/usermanage/config.ts | 2 +- .../view/organizationManage/usermanage/index.vue | 4 +- lib/component/drawer/drawer.vue | 1 + lib/saas/config/router.config.ts | 2 +- lib/saas/router/guard/permission-guard.ts | 30 ++++--- lib/saas/view/service/updatePassWord.vue | 2 +- lib/saas/view/system/layout/customHeader.vue | 15 ++-- lib/saas/view/system/layout/header.vue | 17 ++-- lib/saas/view/system/login.vue | 9 +- lib/util/http/axios.ts | 6 +- 19 files changed, 188 insertions(+), 116 deletions(-) diff --git a/hx-ai-intelligent/src/App.vue b/hx-ai-intelligent/src/App.vue index 35a2db5..9c90247 100644 --- a/hx-ai-intelligent/src/App.vue +++ b/hx-ai-intelligent/src/App.vue @@ -21,12 +21,12 @@ // watch( // () => router.currentRoute.value, // (e) => { - // // if (Cookies.get('nervsid') === undefined && e.fullPath !== '/login') { + // // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) === undefined && e.fullPath !== '/login') { // // message.warn('登陆信息已过期,请重新登录!', 1); // // router.push('/login'); // // } // // } else { - // // if (Cookies.get('nervsid') !== undefined && e === '/login') { + // // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) !== undefined && e === '/login') { // // let url = window.sessionStorage.getItem('url'); // // url === null ? window.sessionStorage.setItem('url', '/doorway/visitor/audit') : ''; // // router.push(url === null ? '/doorway' : url); diff --git a/hx-ai-intelligent/src/api/deviceManage.ts b/hx-ai-intelligent/src/api/deviceManage.ts index f598951..7ae63d2 100644 --- a/hx-ai-intelligent/src/api/deviceManage.ts +++ b/hx-ai-intelligent/src/api/deviceManage.ts @@ -11,4 +11,8 @@ export enum group { creatOrUpdate = `${BASE_URL}/deviceGroup/creatOrUpdate`, // 左侧树节点新增编辑 del = `${BASE_URL}/deviceGroup/del`, move = `${BASE_URL}/deviceGroup/move`, + queryEditGroup = `${BASE_URL}/deviceGroup/queryEditGroup`, // 分组树 + queryGroupPage = `${BASE_URL}/deviceGroup/queryGroupPage`, // 分组列表 + saveGroupList = `${BASE_URL}/deviceGroup/saveGroupList`, // 分组保存 + delGroupList = `${BASE_URL}/deviceGroup/delGroupList`, // 分组删除 } diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts index 5215705..a0db2b8 100644 --- a/hx-ai-intelligent/src/config/app.config.ts +++ b/hx-ai-intelligent/src/config/app.config.ts @@ -71,7 +71,7 @@ export const appConfig = { // 解决初始化登录select无初始值的问题 selectDefaultValue.value = finalId; - const userInfo = JSON.parse(sessionStorage.getItem('userInfo')!); + const userInfo = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)!); const ownOrgInfo = userInfo.linkList?.filter(({ orgId: id }) => id === finalId)[0]; return http.post('/carbon-smart/user/login/logInPermission', ownOrgInfo).then((res) => { diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index 3c651cf..f2397f7 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -135,7 +135,7 @@ import { log } from 'node:console'; const casData = ref([]); const treeData = ref([]); const userAuthList = ref([]); - const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId; + const orgId = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgId; const dynamicDisabled = computed(() => { return formRef.value?.validateResult && userAuthList.value?.length; }); diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue index 3100688..f13ffe3 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue @@ -104,7 +104,7 @@ name: 'EnergyConsumption', // 与页面路由name一致缓存才可生效 }); - const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId; + const orgId = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgId; const fetch = (api, params = { orgId }) => { return http.post(api, params); }; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index 082faf5..4a51f89 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -4,10 +4,13 @@ import { http } from '/nerv-lib/util'; import { ref } from 'vue'; import { group } from '/@/api/deviceManage'; import { dict } from '/@/api'; -const tableKeyMap = [ +import { origanizemanage } from '/@/api/origanizemanage'; +const tableCalKeyMap = [ { title: '来源企业', - dataIndex: 'id', + dataIndex: 'orgName', + // textEllipsis: true, + // textNumber: 4, }, { title: '设备id', @@ -32,20 +35,18 @@ const tableKeyMap = [ dataIndex: 'position', }, ]; -const tableCalKeyMap = [ +const tableKeyMap = [ { title: '来源企业', - dataIndex: 'id', + dataIndex: 'orgName', }, { title: '节点编号', - dataIndex: 'deviceName', - textNumber: 8, - textEllipsis: true, + dataIndex: 'pointNum', }, { title: '节点路径', - dataIndex: 'position', + dataIndex: 'routeName', }, ]; const doWnload = (url) => { @@ -125,6 +126,26 @@ export const formSchema = [ ], }, ]; +export const editTreeConfig = (orgId) => ({ + selectedKeys: ['0-0'], + defaultExpandAll: true, + api: group.queryEditGroup, + params: { orgId }, + resultField: 'data.orgInfos', + fieldNames: { title: 'orgName', key: 'orgId' }, + formConfig: { + schemas: [ + { + field: 'orgName', + component: 'NsInput', + autoSubmit: true, + componentProps: { + placeholder: '请输入企业名称', + }, + }, + ], + }, +}); export const treeConfig = (orgId) => { return { defaultExpandAll: true, @@ -133,15 +154,8 @@ export const treeConfig = (orgId) => { title: '能耗分组', }, params: { orgId }, - showLine: { showLeafIcon: false }, + api: group.queryDeviceGroupTree, - // api: () => { - // return new Promise((resolve) => { - // setTimeout(() => { - // resolve({ data: [{ title: '全部', key: 'all', children: data.data }] }); - // }, 100); - // }); - // }, transform: (data) => { return [{ pointName: '全部', id: 'all', selectable: false, children: data }]; }, @@ -176,12 +190,11 @@ export const treeConfig = (orgId) => { }, }; }; -export const tableConfig = (el, elGroup, elFormula) => { +export const tableConfig = (el, elGroup, elFormula, defaultParams) => { return { title: '点位信息', - // api: '/carbon_emission/device/getDeviceList', - value: mockData.value, - + api: group.queryGroupPage, + params: defaultParams.value, headerActions: [ { label: '编辑', @@ -193,7 +206,7 @@ export const tableConfig = (el, elGroup, elFormula) => { }, { label: '批量删除', - name: 'groupTemDownload', + name: 'groupBatDelete', type: 'primary', dynamicDisabled: (data: any) => { return data.list.length === 0; @@ -244,7 +257,7 @@ export const tableConfig = (el, elGroup, elFormula) => { { label: '批量分组', - name: 'groupTemDownload', + name: 'groupBatGroup', type: 'primary', handle: () => { elGroup.value.toggle(); @@ -252,7 +265,7 @@ export const tableConfig = (el, elGroup, elFormula) => { }, { label: '公式编辑', - name: 'groupTemDownload', + name: 'groupFormulaEdit', type: 'primary', handle: () => { elFormula.value.toggle(); @@ -265,7 +278,7 @@ export const tableConfig = (el, elGroup, elFormula) => { actions: [ { label: '删除', - name: 'FeedBackDetail', + name: 'groupDelete', dynamicParams: ['uuid', 'appealType'], confirm: true, handle: () => { @@ -341,11 +354,13 @@ export const tableConfig = (el, elGroup, elFormula) => { }; }; -export const tableConfigCal = (el, elGroup, elFormula) => { +export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { + // 分组节点 return { title: '点位信息', // api: '/carbon_emission/device/getDeviceList', value: mockData.value, + params: defaultParams, headerActions: [ { @@ -413,12 +428,12 @@ export const tableConfigCal = (el, elGroup, elFormula) => { actions: [ { label: '删除', - name: 'FeedBackDetail', - dynamicParams: ['uuid', 'appealType'], + name: 'groupDelete', + dynamicParams: 'id', confirm: true, - handle: () => { - mockData.value.splice(0, 1); - }, + isReload: true, + isClearCheck: true, + api: group.delGroupList, }, ], }, diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue index 669dc6b..d43c189 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue @@ -1,53 +1,72 @@ \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue index d26c745..c9f361a 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue @@ -33,7 +33,7 @@ -
+
@@ -43,9 +43,14 @@ + diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/treeData.ts b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/treeData.ts new file mode 100644 index 0000000..b764b47 --- /dev/null +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/treeData.ts @@ -0,0 +1,88 @@ +import { ref } from 'vue'; +export const treeData = ref([ + { + label: '站厅', + id: '1', + // 前端遍历后添加,属前端属性 + selected: false, + children: [{ + label: '站厅1区', + id: '1-1', + // 前端属性 + selected: false, + // 后端属性(表示禁用了一个设备) + stop: false, + // 当前的控制模式 + type: 3 + },{ + label: '站厅2区', + id: '1-2', + selected: false, + stop: false, + type: 1 + }] + }, + { + label: '站台', + id: '2', + selected: false, + children: [{ + label: '站台1区', + id: '2-1', + selected: false, + stop: false, + type: 1 + },{ + label: '站台2区', + id: '2-2', + selected: false, + stop: false, + type: 2 + },{ + label: '站台3区', + id: '2-3', + selected: false, + stop: false, + type: 3 + },{ + label: '站台4区', + id: '2-4', + selected: false, + stop: false, + type: 1 + }] + },{ + label: '办公室', + id: '3', + selected: false, + children: [{ + label: '办公室1区', + id: '3-1', + selected: false, + stop: false, + type: 2 + }] + },{ + label: '楼道', + id: '4', + selected: false, + children: [{ + label: '楼道1区', + id: '4-1', + selected: false, + stop: false, + type: 3 + }] + }, +]); + +export const controlType = ref([{ + name: '托管', + type: 1, +},{ + name: 'AI', + type: 2, +},{ + name: '手动', + type: 3, +}]) \ No newline at end of file From 533f0cc63333ced666d3a8b25f2b8bfd720d1c52 Mon Sep 17 00:00:00 2001 From: fks-xuxinyue <2822784518@qq.com> Date: Thu, 11 Jul 2024 16:23:42 +0800 Subject: [PATCH 3/3] taskid:083 remark:commit --- .../carbonEmissionFactorLibrary/index.vue | 26 ++- .../carbonEmissionStatistics/config.ts | 38 ++-- .../energyConsumption/index.vue | 195 +++++++++++++++------ 3 files changed, 187 insertions(+), 72 deletions(-) diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index f2397f7..6f07629 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -135,7 +135,7 @@ import { log } from 'node:console'; const casData = ref([]); const treeData = ref([]); const userAuthList = ref([]); - const orgId = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgId; + const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId; const dynamicDisabled = computed(() => { return formRef.value?.validateResult && userAuthList.value?.length; }); @@ -493,7 +493,7 @@ import { log } from 'node:console'; isReload: true, isClearCheck: true, api: carbonEmissionFactorLibrary.del, - dynamicParams: { id: 'id[]' }, + dynamicParams: { ids: 'id[]' }, }, ], columns: [ @@ -573,7 +573,7 @@ import { log } from 'node:console'; { label: '删除', name: 'userDelete', - dynamicParams: 'id', + dynamicParams: { ids: 'id[]' }, confirm: true, isReload: true, api: carbonEmissionFactorLibrary.del, @@ -617,11 +617,27 @@ import { log } from 'node:console'; options: [ { label: 'CO2', - value: 0, + value: 'CO2', }, { label: 'CO2e', - value: 1, + value: 'CO2e', + }, + { + label: 'SF6', + value:'SF6', + }, + { + label: 'CH4', + value: 'CH4', + }, + { + label: 'PFCs', + value: 'PFCs', + }, + { + label: 'HFCs', + value: 'HFCs', }, ], }, diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts index e12f23a..d3bc6e8 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts @@ -7,64 +7,70 @@ export const tableColumns = [ }, { title: '能源种类', - dataIndex: 'money', + dataIndex: 'energyType', }, { title: '计量单位', - className: 'column-money', - dataIndex: 'money', + className: 'unit', + dataIndex: 'unit', }, { title: '全年', - dataIndex: 'address', + dataIndex: 'yearly', }, { title: '1月', - dataIndex: 'address', + dataIndex: 'jan', + customRender: ({ text, record }) => ({ + children: text, + attrs: { + style: record.janFlag === 1 ? 'color: red' : 'color: blue' + } + }) }, { title: '2月', - dataIndex: 'address', + dataIndex: 'feb', }, { title: '3月', - dataIndex: 'address', + dataIndex: 'mar', }, { title: '4月', - dataIndex: 'address', + dataIndex: 'apr', }, { title: '5月', - dataIndex: 'address', + dataIndex: 'may', }, { title: '6月', - dataIndex: 'address', + dataIndex: 'jun', }, { title: '7月', - dataIndex: 'address', + dataIndex: 'jul', }, { title: '8月', - dataIndex: 'address', + dataIndex: 'aug', }, { title: '9月', - dataIndex: 'address', + dataIndex: 'sep', }, { title: '10月', - dataIndex: 'address', + dataIndex: 'oct', }, { title: '11月', - dataIndex: 'address', + dataIndex: 'nov', }, { title: '12月', - dataIndex: 'address', + dataIndex: 'dec', }, { title: '操作', diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue index f13ffe3..a209ff2 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue @@ -16,7 +16,7 @@ - + - - + + - - + + - + - - - - - + + + + - - - Zone one - Zone two + + + 直接排放 + 间接排放 + 其他 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +