From 0681836c0249f7d090e2d89c8d62734c9a81deb1 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Mon, 15 Jul 2024 10:22:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/equipmentManage/ledger/config.ts | 52 +++++++++++++++------- lib/saas/view/system/login.vue | 2 +- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts index d7954ff..cd2d05b 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts @@ -138,9 +138,21 @@ export const tableConfig = (orgId) => { { field: 'deviceName', label: '设备名称', - component: 'NsInput', + component: 'NsSelectApi', componentProps: { - placeholder: '请输入设备名称', + placeholder: '请选择设备名称', + api: device.dropArea, + resultField: 'data', + params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, + labelField: 'deviceName', + valueField: 'deviceName', + filterOption: (input: string, option: any) => { + return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + immediate: true, + dropdownReload: true, + allowClear: true, }, }, { @@ -166,7 +178,7 @@ export const tableConfig = (orgId) => { loadData: (selectedOptions, options) => { const targetOption = selectedOptions[selectedOptions.length - 1]; if (!selectedOptions.length) { - http.post(device.dropArea, { orgId }).then((res) => { + http.post(device.dropArea, { orgId, filterField: 'DEVICE_AREA' }).then((res) => { options.value = res.data?.map((item) => { return { label: item, value: item, children: [], isLeaf: false }; }); @@ -175,12 +187,14 @@ export const tableConfig = (orgId) => { const value = targetOption?.value; if (targetOption) { targetOption.loading = true; - http.post(device.dropArea, { device1Area: value, orgId }).then((res) => { - targetOption.loading = false; - targetOption.children = res.data?.map((item) => { - return { label: item, value: item, children: [], isLeaf: true }; + http + .post(device.dropArea, { device1Area: value, orgId, filterField: 'DEVICE_AREA' }) + .then((res) => { + targetOption.loading = false; + targetOption.children = res.data?.map((item) => { + return { label: item, value: item, children: [], isLeaf: true }; + }); }); - }); } }, }, @@ -188,15 +202,21 @@ export const tableConfig = (orgId) => { { field: 'manufacturer', label: '设备厂商', - component: 'NsInput', + component: 'NsSelectApi', componentProps: { - placeholder: '请输入设备厂商', - options: [ - { - label: '全部', - value: '', - }, - ], + placeholder: '请选择设备厂商', + api: device.dropArea, + resultField: 'data', + params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, + labelField: 'manufacturer', + valueField: 'manufacturer', + filterOption: (input: string, option: any) => { + return option.manufacturer.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + immediate: true, + dropdownReload: true, + allowClear: true, }, }, { diff --git a/lib/saas/view/system/login.vue b/lib/saas/view/system/login.vue index 8c59eab..187327a 100644 --- a/lib/saas/view/system/login.vue +++ b/lib/saas/view/system/login.vue @@ -129,7 +129,7 @@ accountNo: userName.value.trim(), password: password.value.trim(), }); - validator(null, value.code) + validator(null, value?.code) .then(() => { // 记住密码 rememberFunc(data); From 5deff41679ea3e4ff7cb32e4fb6452bdcaa5f05c Mon Sep 17 00:00:00 2001 From: fks-yangshouda Date: Mon, 15 Jul 2024 15:38:28 +0800 Subject: [PATCH 2/5] =?UTF-8?q?1.=E8=83=BD=E8=80=97=E7=9B=91=E6=B5=8B=20-?= =?UTF-8?q?=20=E5=88=86=E6=9E=90=20=E4=B8=8B=E8=BD=BD=E5=9B=BE=E8=A1=A8=20?= =?UTF-8?q?2.=E7=8E=AF=E5=A2=83=E7=9B=91=E6=B5=8B=20-=20=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=20=E5=89=8D=E5=8F=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/router/monitor.ts | 38 +- .../monitor/energyMonitor/analysisGraph/index.vue | 50 +- .../environmentMonitor/aggregateData/index.vue | 627 +++++++++++++++++++++ .../src/view/monitor/environmentMonitor/index.vue | 24 + 4 files changed, 710 insertions(+), 29 deletions(-) create mode 100644 hx-ai-intelligent/src/view/monitor/environmentMonitor/aggregateData/index.vue create mode 100644 hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue diff --git a/hx-ai-intelligent/src/router/monitor.ts b/hx-ai-intelligent/src/router/monitor.ts index 65d21c1..8a21dde 100644 --- a/hx-ai-intelligent/src/router/monitor.ts +++ b/hx-ai-intelligent/src/router/monitor.ts @@ -5,25 +5,25 @@ const equipment = { meta: { title: '监控中心', icon: 'jiankongzhongxin', index: 1 }, redirect: { name: 'EnvironmentMonitor' }, children: [ - // { - // path: 'environmentMonitor', - // name: 'EnvironmentMonitor', - // meta: { title: '环境监测', hideChildren: true, icon: 'huanjingjiance' }, - // component: Base, - // redirect: { name: 'EnvironmentMonitorIndex' }, - // children: [ - // { - // path: 'index', - // name: 'EnvironmentMonitorIndex', - // component: () => import('/@/view/monitor/environmentMonitor/index.vue'), - // meta: { - // title: '环境监测', - // keepAlive: true, - // // backApi: [], - // }, - // }, - // ], - // }, + { + path: 'environmentMonitor', + name: 'EnvironmentMonitor', + meta: { title: '环境监测', hideChildren: true, icon: 'huanjingjiance' }, + component: Base, + redirect: { name: 'EnvironmentMonitorIndex' }, + children: [ + { + path: 'index', + name: 'EnvironmentMonitorIndex', + component: () => import('/@/view/monitor/environmentMonitor/index.vue'), + meta: { + title: '环境监测', + keepAlive: true, + // backApi: [], + }, + }, + ], + }, { path: 'deviceMonitor', name: 'DeviceMonitor', diff --git a/hx-ai-intelligent/src/view/monitor/energyMonitor/analysisGraph/index.vue b/hx-ai-intelligent/src/view/monitor/energyMonitor/analysisGraph/index.vue index b3948fa..59f51b2 100644 --- a/hx-ai-intelligent/src/view/monitor/energyMonitor/analysisGraph/index.vue +++ b/hx-ai-intelligent/src/view/monitor/energyMonitor/analysisGraph/index.vue @@ -48,6 +48,8 @@ + + + diff --git a/hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue b/hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue new file mode 100644 index 0000000..48caad7 --- /dev/null +++ b/hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue @@ -0,0 +1,24 @@ + + + From 32d1a633b10d575db1e83efcab5081d13f380baa Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Mon, 15 Jul 2024 15:53:54 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E6=9F=A5=E8=AF=A2=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/api/deviceManage.ts | 2 + hx-ai-intelligent/src/config/app.config.ts | 3 +- hx-ai-intelligent/src/icon/common.svg | 4 + .../src/view/equipmentManage/group/config.ts | 73 ++- .../src/view/equipmentManage/group/editCal.vue | 2 +- .../src/view/equipmentManage/group/editGroup.vue | 24 +- .../src/view/equipmentManage/group/index.vue | 27 +- .../src/view/equipmentManage/ledger/mock.json | 506 --------------------- 8 files changed, 112 insertions(+), 529 deletions(-) create mode 100644 hx-ai-intelligent/src/icon/common.svg delete mode 100644 hx-ai-intelligent/src/view/equipmentManage/ledger/mock.json diff --git a/hx-ai-intelligent/src/api/deviceManage.ts b/hx-ai-intelligent/src/api/deviceManage.ts index 878ab00..29cfc9e 100644 --- a/hx-ai-intelligent/src/api/deviceManage.ts +++ b/hx-ai-intelligent/src/api/deviceManage.ts @@ -26,4 +26,6 @@ export enum group { computeGroupNum = `${BASE_URL}/deviceGroup/computeGroupNum`, // 分组删除 formula = `${BASE_URL}/deviceGroup/formula`, // 编辑公式 queryFormula = `${BASE_URL}/deviceGroup/queryFormula`, // 公式查询 + dropGroupFilter = `${BASE_URL}/deviceGroup/dropGroupFilter`, // 分组列表查询 + dropGroupInfoFilter = `${BASE_URL}/deviceGroup/dropGroupInfoFilter`, // 计算列表查询 } diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts index a0db2b8..9f2881a 100644 --- a/hx-ai-intelligent/src/config/app.config.ts +++ b/hx-ai-intelligent/src/config/app.config.ts @@ -27,6 +27,7 @@ export const appConfig = { themeConfig: { bgImageUrl: `${import.meta.env.VITE_PUBLIC_PATH}/asset/image/login/background.png`, logoLessUrl: `${import.meta.env.VITE_PUBLIC_PATH}/asset/image/headerIcon.png`, + logoUrl: `${import.meta.env.VITE_PUBLIC_PATH}/asset/image/headerIcon.png`, }, // userCustomRouterGuard: (to, from, next, whiteNameList, authorizationStore, appConfig) => { // console.log({ to, from, next, whiteNameList, authorizationStore, appConfig }, 'routeConfig'); @@ -102,7 +103,7 @@ export const appConfig = { updatePassWordInfo: { title: '修改密码', subtitle: 'huaxing平台', - api: '/api/web/objs/User/changePassword', + api: '/carbon-smart/api/user/password', }, // headerBellInfo: { // isShow: true, diff --git a/hx-ai-intelligent/src/icon/common.svg b/hx-ai-intelligent/src/icon/common.svg new file mode 100644 index 0000000..6e5cb9e --- /dev/null +++ b/hx-ai-intelligent/src/icon/common.svg @@ -0,0 +1,4 @@ + + + + diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index a009cd3..abd7710 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -1,8 +1,9 @@ +import { NsSelect } from './../../../../../lib/component/form/select/index'; import { dateUtil } from '/nerv-lib/util/date-util'; import data from './mock.json'; import { http } from '/nerv-lib/util'; import { ref } from 'vue'; -import { group } from '/@/api/deviceManage'; +import { device, group } from '/@/api/deviceManage'; import { dict } from '/@/api'; import { origanizemanage } from '/@/api/origanizemanage'; const tableCalKeyMap = [ @@ -122,7 +123,7 @@ export const formSchema = [ immediate: true, // resultField: 'data.COUNT_POINT', labelField: 'cnValue', - valueField: 'cnValue', + valueField: 'dicKey', }, rules: [ { @@ -198,7 +199,7 @@ export const treeConfig = (orgId) => { immediate: true, // resultField: 'data.ENERGY_TYPE', labelField: 'cnValue', - valueField: 'cnValue', + valueField: 'dicKey', placeholder: '请选择能耗种类', autoSelectFirst: true, }, @@ -303,9 +304,22 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { schemas: [ { field: 'orgName', - component: 'NsInput', + component: 'NsSelectApi', + defaultParams: defaultParams.value, componentProps: { placeholder: '请选择公司', + mode: 'multiple', + api: group.dropGroupFilter, + resultField: 'data', + params: { filterField: 'ORG' }, + labelField: 'orgName', + valueField: 'orgId', + filterOption: (input: string, option: any) => { + return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + dropdownReload: true, + allowClear: true, }, }, { @@ -433,11 +447,23 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { formConfig: { schemas: [ { - field: 'name', - label: '公司', - component: 'NsInput', + field: 'orgIds', + component: 'NsSelectApi', + defaultParams: defaultParams.value, componentProps: { placeholder: '请选择公司', + mode: 'multiple', + api: group.dropGroupInfoFilter, + resultField: 'data', + params: { filterField: 'ORG' }, + labelField: 'orgName', + valueField: 'orgId', + filterOption: (input: string, option: any) => { + return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + dropdownReload: true, + allowClear: true, }, }, { @@ -455,17 +481,40 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { }, }, { - field: 'provider', - component: 'NsInput', + field: 'deviceStatus', + component: 'NsSelectApi', componentProps: { - placeholder: '请输入设备状态', + placeholder: '请选择设备状态', + api: () => dict({ params: { dicKey: 'DEVICE_STATUS' } }), + immediate: true, + labelField: 'cnValue', + valueField: 'dicKey', }, }, { field: 'deviceNameType', - component: 'NsInput', + component: 'NsSelectApi', + defaultParams: defaultParams.value, componentProps: { - placeholder: '请输入设备型号', + placeholder: '请选择设备型号', + mode: 'multiple', + api: (params: any) => { + return http.post(group.dropGroupInfoFilter, params).then((res: any) => { + const result = [...new Set(res.data)]; + return { data: result }; + }); + }, + resultField: 'data', + + params: { filterField: 'DEVICE_TYPE' }, + // labelField: 'orgName', + // valueField: 'orgId', + filterOption: (input: string, option: any) => { + return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + dropdownReload: true, + allowClear: true, }, }, { diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue index 9a3e31d..2f2ca8f 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue @@ -104,7 +104,7 @@ item['key'] = item.id.toString(); return item; }); - targetKeys.value = res.data.linkGroups?.map((item) => { + targetKeys.value = res.data.linkDeviceInfos?.map((item) => { return item.id.toString(); }); }); diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue index 41be93e..176cfb0 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue @@ -7,6 +7,7 @@ :cancel="() => (visible = false)" placement="right"> @@ -53,6 +54,7 @@ const emit = defineEmits(['sure']); const props = defineProps({ params: Object }); const visible = ref(false); + const editGroupRef = ref(); const model = ref({}); const inputDisabled = ref(true); const selectedRowKeys = ref([]); @@ -63,6 +65,7 @@ }; const startCararcter = 65; + // 点击新增按钮新增分组 const addGroup = () => { opType = true; getCode(); @@ -71,19 +74,30 @@ model.value = { groupName: '' }; // if(mockDataSource.value.length) }; + const op = () => { inputDisabled.value = !inputDisabled.value; add(); }; - //新增 + + const editGroup = () => { + if (!selectedRowKeys.value?.length) { + NsMessage.warn('请先选择需要编辑的分组'); + return; + } + inputDisabled.value = false; + }; + //点击对钩按钮处理保存逻辑 const add = () => { const finalParams = { ...props.params, ...model.value }; if (opType) { delete finalParams.id; } - http.post(group.saveComputeGroup, finalParams).then(() => { - getTableData(); - NsMessage.success('操作成功'); + editGroupRef.value.triggerSubmit().then(() => { + http.post(group.saveComputeGroup, finalParams).then(() => { + getTableData(); + NsMessage.success('操作成功'); + }); }); }; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue index 389320f..8ddb9c9 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue @@ -16,7 +16,14 @@ diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts index f5bc524..09b276d 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts @@ -77,4 +77,46 @@ export const tableColumns = [ key: 'action', width: 130 }, +]; +export const columns = [ + { + title: '序号', + customRender: (text: any) => { + return text.index + 1; + }, + }, + { + title: '因子值', + dataIndex: 'energyType', + }, + { + title: '计量单位', + className: 'unit', + dataIndex: 'unit', + }, + { + title: '更新时间', + className: 'unit', + dataIndex: 'unit', + }, + { + title: '启用时间', + className: 'unit', + dataIndex: 'unit', + }, + { + title: '结束时间', + className: 'unit', + dataIndex: 'unit', + }, + { + title: '数据来源', + className: 'unit', + dataIndex: 'unit', + }, + { + title: '操作', + key: 'action', + width: 130 + }, ]; \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index copy.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index copy.vue new file mode 100644 index 0000000..81d30db --- /dev/null +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index copy.vue @@ -0,0 +1,401 @@ + + + + + + diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue index 2a74ad5..f9df2af 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue @@ -1,16 +1,14 @@ - -