From 4fcdae08de241ac0e704e1e8d7022ad46699cd57 Mon Sep 17 00:00:00 2001 From: fks-yangshouda Date: Fri, 12 Jul 2024 17:05:41 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E8=83=BD=E8=80=97=E7=9B=91=E6=B5=8B=20?= =?UTF-8?q?=E5=88=86=E6=9E=90=20=E5=8F=B3=E4=BE=A7=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/monitor/deviceMonitor/tree/index.vue | 1 + .../monitor/energyMonitor/analysisGraph/index.vue | 337 +++++++++++++++++++-- .../src/view/monitor/energyMonitor/page.vue | 8 +- .../src/view/monitor/energyMonitor/tree/index.vue | 72 ++++- 4 files changed, 389 insertions(+), 29 deletions(-) diff --git a/hx-ai-intelligent/src/view/monitor/deviceMonitor/tree/index.vue b/hx-ai-intelligent/src/view/monitor/deviceMonitor/tree/index.vue index a3c572f..dda707f 100644 --- a/hx-ai-intelligent/src/view/monitor/deviceMonitor/tree/index.vue +++ b/hx-ai-intelligent/src/view/monitor/deviceMonitor/tree/index.vue @@ -474,6 +474,7 @@ onMounted(() => { getDianWeiList(); changeDeviceType(null, null); + getSelect(); }); return { 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 385fc40..b3948fa 100644 --- a/hx-ai-intelligent/src/view/monitor/energyMonitor/analysisGraph/index.vue +++ b/hx-ai-intelligent/src/view/monitor/energyMonitor/analysisGraph/index.vue @@ -1,16 +1,47 @@ @@ -52,11 +83,24 @@ ); const changeMode = () => {}; const analysisGraphchart = ref(null); + const analysisGraphRingchart = ref(null); + const analysisGraphBarchart = ref(null); + // 左侧柱状图 let chartInstance: echarts.ECharts | null = null; + // 圆环图 + let chartRight1: echarts.ECharts | null = null; + + // 右下角柱状图 + let chartRight2: echarts.ECharts | null = null; const draw = () => { data.value = pageData.analysisGraphList; + // 绘制左侧图 + drawLeft(); + drawRight1(); + }; + const drawLeft = () => { if (data.value && data.value.length > 0) { if (chartInstance) { chartInstance.dispose(); @@ -65,7 +109,6 @@ var seriesdata = []; var dateX = []; - // var legendList: string | any[] = []; for (let i = 0; i < data.value.length; i++) { dateX.push(data.value[i].name); @@ -81,26 +124,39 @@ show: true, formatter: '{b}', }, + barWidth: '25%', }, ]; const option = { - // tooltip: { - // trigger: 'axis', - // formatter: (params: any) => { - // const date = params[0].name; - // const values = params - // .map((param: any) => { - // const unit = data.value.find((d) => d.name === date)?.unit || ''; - // return ` - // ${param.marker}${param.seriesName} - // ${param.value} ${unit} - // `; - // }) - // .join(''); - // return `
${date}
${values}
`; - // }, - // }, + grid: { + top: 60, + bottom: 20, + }, + dataZoom: [ + { + show: true, + type: 'slider', + zoomLock: true, + startValue: 0, // 从头开始。 + endValue: 4, + showDetail: false, + width: 5, + yAxisIndex: [0, 1], // 控制y轴滚动对象 + }, + { + show: true, + type: 'inside', + // width: 0, + startValue: 0, + endValue: 10, + minValueSpan: 10, + yAxisIndex: [0], + zoomOnMouseWheel: false, // 关闭滚轮缩放 + moveOnMouseWheel: true, // 开启滚轮平移 + moveOnMouseMove: true, // 鼠标移动能触发数据窗口平移 + }, + ], yAxis: { type: 'category', axisLine: { show: false }, @@ -125,6 +181,233 @@ chartInstance.setOption(option); } }; + const drawRight1 = () => { + if (data.value && data.value.length > 0) { + if (chartRight1) { + chartRight1.dispose(); + } + chartRight1 = echarts.init(analysisGraphRingchart.value); + + var seriesdata = []; + var dateX = []; + // var legendList: string | any[] = []; + for (let i = 0; i < data.value.length; i++) { + dateX.push(data.value[i].name); + + seriesdata.push({ value: data.value[i].ringValue, name: data.value[i].name }); + } + var seriesList = [ + { + // name: data.value[0].energyType, + data: seriesdata, + type: 'pie', + // 圆环内径和外径 + radius: ['70%', '90%'], + center: ['30%', '50%'], // 调整环形图的位置,百分比表示相对于容器的宽高 + // 显示折线 + labelLine: { + show: true, + length: 10, // 调整第一个折线段的长度 + length2: 30, // 调整第二个折线段的长度 + }, + label: { + show: true, + // formatter: '{b}', + position: 'outside', // 确保标签在环形图外部 + // alignTo: 'edge', + formatter: '{c}' + data.value[0].energyUnit + '\n{d}%', + alignTo: 'labelLine', + distanceToLabelLine: 5, // 调整标签和引导线之间的距离 + distance: 10, // 调整标签距离图形的距离 + }, + itemStyle: { + normal: { + // 白色间距 + borderWidth: 2, + borderColor: '#ffffff', + }, + }, + }, + ]; + + const option = { + tooltip: { + trigger: 'item', + }, + + // 图例 + legend: { + top: 'center', + left: '60%', + // 排列方式 垂直 + orient: 'vertical', + }, + yAxis: { + type: 'category', + axisLine: { show: false }, + axisLabel: { show: false }, + axisTick: { show: false }, + splitLine: { show: false }, + data: dateX, + }, + xAxis: { + type: 'value', + position: 'top', + splitLine: { + lineStyle: { + type: 'dashed', + }, + }, + }, + series: seriesList, + }; + + chartRight1 = echarts.init(analysisGraphRingchart.value); + chartRight1.setOption(option); + + // 默认点击第一个 + if (seriesdata.length > 0) { + drawRight2(seriesdata[0]); + } + chartRight1.on('click', function (params) { + // 控制台输出数据的名称 + console.log(params.name + ' 被点击了'); + drawRight2(params); + }); + } + }; + // 右下角柱状图 + // chartRight2 + // analysisGraphBarchart + const drawRight2 = (auxiliary: any) => { + if (chartRight2) { + chartRight2.dispose(); + } + // 辅助线 + var compareData: any[] = []; + // 展示数据 + var showData: any[] = []; + // X轴 + var dateX: any[] = []; + data.value.forEach((item) => { + if (item.name !== auxiliary.name) { + dateX.push(item.name); + showData.push(item.ringValue); + compareData.push(auxiliary.value); + } + }); + + const option = { + // 图例 + legend: { + data: [ + { name: '对比值', icon: 'rect' }, // 对比值使用矩形图标 + { + name: '参考线', + icon: 'path://M234.666667 490.666667h-153.6a25.6 25.6 0 1 0 0 51.2h153.6a25.6 25.6 0 1 0 0-51.2zM473.6 490.666667h-153.6a25.6 25.6 0 1 0 0 51.2h153.6a25.6 25.6 0 1 0 0-51.2zM934.4 490.666667h-136.533333a25.6 25.6 0 1 0 0 51.2h136.533333a25.6 25.6 0 1 0 0-51.2zM712.533333 490.666667h-153.6a25.6 25.6 0 1 0 0 51.2h153.6a25.6 25.6 0 1 0 0-51.2z', + }, // 参考线使用自定义路径图标,只显示线条 + ], + orient: 'horizontal', + bottom: 10, + left: 60, + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow', + lineStyle: { + color: 'red', // 设置 tooltip 的线颜色 + }, + }, + }, + grid: { + top: 20, + bottom: 60, + }, + xAxis: { + type: 'category', + axisLine: { show: false }, + axisLabel: { show: true }, + axisTick: { show: false }, + splitLine: { show: false }, + data: dateX, + }, + yAxis: { + type: 'value', + position: 'top', + splitLine: { + lineStyle: { + type: 'dashed', + }, + }, + }, + dataZoom: [ + { + show: true, + type: 'slider', + zoomLock: true, + startValue: 0, // 从头开始。 + endValue: 5, + bottom: '0%', + height: 10, + showDetail: false, + }, + { + show: true, + type: 'inside', + xAxisIndex: 0, + zoomOnMouseWheel: false, // 滚轮是否触发缩放 + moveOnMouseMove: true, // 鼠标滚轮触发滚动 + moveOnMouseWheel: true, + }, + ], + series: [ + { + name: '对比值', + type: 'bar', + stack: 'Total', + label: { + // show: true, + position: 'right', + formatter: '{b}', + }, + data: showData, + barWidth: 30, // 设置柱状图的宽度 + }, + { + name: '参考线', + type: 'line', + data: compareData, + markLine: { + symbol: 'none', + label: { + show: false, + }, + lineStyle: { + type: 'dashed', + color: 'red', + }, + }, + itemStyle: { + color: 'red', // 设置参考线的小圆点颜色 + }, + emphasis: { + itemStyle: { + opacity: 0, // 隐藏鼠标悬停时的节点 + }, + }, + showSymbol: false, // 隐藏数据点 + lineStyle: { + type: 'dashed', // 虚线样式 + color: 'red', + }, + }, + ], + }; + chartRight2 = echarts.init(analysisGraphBarchart.value); + chartRight2.setOption(option); + }; + onMounted(() => { draw(); }); @@ -145,6 +428,8 @@ return { analysisGraphchart, + analysisGraphRingchart, + analysisGraphBarchart, downloadChart, mode, changeMode, diff --git a/hx-ai-intelligent/src/view/monitor/energyMonitor/page.vue b/hx-ai-intelligent/src/view/monitor/energyMonitor/page.vue index 0f8df1c..3818385 100644 --- a/hx-ai-intelligent/src/view/monitor/energyMonitor/page.vue +++ b/hx-ai-intelligent/src/view/monitor/energyMonitor/page.vue @@ -24,7 +24,7 @@
- +
@@ -44,6 +44,8 @@ const treeRef = ref(); const graphRef = ref(); + const analysisGraphRef = ref(); + const tableRef = ref(); const analysisTableRef = ref(); @@ -59,6 +61,10 @@ if (graphRef.value) { graphRef.value.downloadChart(); } + } else { + if (analysisGraphRef.value) { + analysisGraphRef.value.downloadChart(); + } } }; diff --git a/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue b/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue index d776a25..f6e8062 100644 --- a/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue +++ b/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue @@ -93,7 +93,7 @@ const options2 = ref([]); const mode = ref('1'); // 能耗类型 - const selectedValue = ref(); + const selectedValue = ref(); // 采集频率 const frequencyValue = ref(); // 时间 @@ -107,6 +107,9 @@ (item.value = item.cnValue), (item.label = item.cnValue); }); options1.value = options.data.data; // 根据返回数据的结构来更新 options1.value + if (options1.value) { + selectedValue.value = options1.value[0].value; + } } catch (error) { console.error('Failed to fetch options:', error); } @@ -148,7 +151,7 @@ // 选择能耗类型 const changeEnergyType = () => { - if (selectedValue.value == '8') { + if (selectedValue.value == '碳排量') { shebei.value = true; mode.value = '2'; } else { @@ -337,7 +340,9 @@ { name: 'AC_002(暖通电表)', value: -21, + ringValue: 21, energyType: selectedValue.value, + energyUnit: 'kWh', unit: 'V', labelRight: { position: 'right', @@ -346,6 +351,7 @@ { name: 'AC_003(照明电表)', value: 36, + ringValue: 36, energyType: selectedValue.value, unit: 'V', labelRight: { @@ -355,6 +361,67 @@ { name: 'AC_004(给排水电表)', value: -5, + ringValue: 5, + energyType: selectedValue.value, + unit: 'V', + labelRight: { + position: 'right', + }, + }, + { + name: 'AC_005(给排水电表)', + value: -25, + ringValue: 15, + energyType: selectedValue.value, + unit: 'V', + labelRight: { + position: 'right', + }, + }, + { + name: 'AC_006(给排水电表)', + value: 35, + ringValue: 30, + energyType: selectedValue.value, + unit: 'V', + labelRight: { + position: 'insideLeft', + }, + }, + { + name: 'AC_007(给排水电表)', + value: 15, + ringValue: 18, + energyType: selectedValue.value, + unit: 'V', + labelRight: { + position: 'insideLeft', + }, + }, + { + name: 'AC_008(给排水电表)', + value: -25, + ringValue: 41, + energyType: selectedValue.value, + unit: 'V', + labelRight: { + position: 'right', + }, + }, + { + name: 'AC_009(给排水电表)', + value: -5, + ringValue: 55, + energyType: selectedValue.value, + unit: 'V', + labelRight: { + position: 'right', + }, + }, + { + name: 'AC_0090(给排水电表)', + value: -5, + ringValue: 55, energyType: selectedValue.value, unit: 'V', labelRight: { @@ -634,6 +701,7 @@ onMounted(() => { getOptionsList(); changeMode(); + getSelect(); }); return { From d8cc8293bcaa13c77c3bc6111c72ae0a325e8c1f Mon Sep 17 00:00:00 2001 From: fks-xuxinyue <2822784518@qq.com> Date: Fri, 12 Jul 2024 17:06:23 +0800 Subject: [PATCH 02/24] taskid:083 remark:'commit' --- .../src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index bbc926e..54cee22 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -82,6 +82,7 @@ @close="onClose"> Date: Fri, 12 Jul 2024 17:17:32 +0800 Subject: [PATCH 03/24] =?UTF-8?q?feat:=20=E5=88=86=E7=BB=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=89=B9=E9=87=8F=E5=88=86=E7=BB=84=EF=BC=8C=E5=85=AC?= =?UTF-8?q?=E5=BC=8F=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/api/deviceManage.ts | 11 + .../src/view/equipmentManage/group/config.ts | 199 ++++++------ .../src/view/equipmentManage/group/edit.vue | 28 +- .../src/view/equipmentManage/group/editCal.vue | 123 ++++++++ .../src/view/equipmentManage/group/editFormula.vue | 157 ++++++---- .../src/view/equipmentManage/group/editGroup.vue | 344 ++++++++++++++------- .../src/view/equipmentManage/group/index.vue | 26 +- lib/component/form/form/form-item.vue | 4 +- lib/saas/theme/global-antd.less | 1 + 9 files changed, 618 insertions(+), 275 deletions(-) create mode 100644 hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue diff --git a/hx-ai-intelligent/src/api/deviceManage.ts b/hx-ai-intelligent/src/api/deviceManage.ts index 7ae63d2..878ab00 100644 --- a/hx-ai-intelligent/src/api/deviceManage.ts +++ b/hx-ai-intelligent/src/api/deviceManage.ts @@ -15,4 +15,15 @@ export enum group { queryGroupPage = `${BASE_URL}/deviceGroup/queryGroupPage`, // 分组列表 saveGroupList = `${BASE_URL}/deviceGroup/saveGroupList`, // 分组保存 delGroupList = `${BASE_URL}/deviceGroup/delGroupList`, // 分组删除 + queryGroupInfoPage = `${BASE_URL}/deviceGroup/queryGroupInfoPage`, // 计算列表 + queryEditCompute = `${BASE_URL}/deviceGroup/queryEditCompute`, // 计算树 + saveComputeList = `${BASE_URL}/deviceGroup/saveComputeList`, // 计算保存 + delComputeList = `${BASE_URL}/deviceGroup/delComputeList`, // 计算删除 + queryComputeGroup = `${BASE_URL}/deviceGroup/queryComputeGroup`, // 计算分组列表 + saveComputeGroup = `${BASE_URL}/deviceGroup/saveComputeGroup`, // 计算分组新增 + saveComputeGroupInfo = `${BASE_URL}/deviceGroup/saveComputeGroupInfo`, // 批量分组 + delComputeGroup = `${BASE_URL}/deviceGroup/delComputeGroup`, // 分组删除 + computeGroupNum = `${BASE_URL}/deviceGroup/computeGroupNum`, // 分组删除 + formula = `${BASE_URL}/deviceGroup/formula`, // 编辑公式 + queryFormula = `${BASE_URL}/deviceGroup/queryFormula`, // 公式查询 } diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index 4a51f89..4b9fff1 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -8,29 +8,32 @@ import { origanizemanage } from '/@/api/origanizemanage'; const tableCalKeyMap = [ { title: '来源企业', - dataIndex: 'orgName', - // textEllipsis: true, - // textNumber: 4, + dataIndex: 'linkOrgName', + textEllipsis: true, + textNumber: 10, }, { title: '设备id', + textNumber: 10, dataIndex: 'deviceCode', + textEllipsis: true, }, { title: '设备编号', - dataIndex: 'deviceName', - textNumber: 8, - textEllipsis: true, + dataIndex: 'deviceNum', }, { + textNumber: 10, title: '分组名称', - dataIndex: 'position', + dataIndex: 'groupName', }, { title: '设备品牌/型号', - dataIndex: 'position', + textNumber: 10, + dataIndex: 'deviceNameType', }, { + textNumber: 10, title: '设备状态', dataIndex: 'position', }, @@ -146,6 +149,26 @@ export const editTreeConfig = (orgId) => ({ ], }, }); +export const editCalTreeConfig = (orgId) => ({ + selectedKeys: ['0-0'], + defaultExpandAll: true, + api: group.queryEditCompute, + 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, @@ -211,9 +234,11 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { dynamicDisabled: (data: any) => { return data.list.length === 0; }, - handle: () => { - mockData.value.splice(0, 2); - }, + dynamicParams: { linkIds: 'linkId[]' }, + confirm: true, + isClearCheck: true, + isReload: true, + api: group.delGroupList, }, { label: '批量导出', @@ -254,23 +279,6 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx'); }, }, - - { - label: '批量分组', - name: 'groupBatGroup', - type: 'primary', - handle: () => { - elGroup.value.toggle(); - }, - }, - { - label: '公式编辑', - name: 'groupFormulaEdit', - type: 'primary', - handle: () => { - elFormula.value.toggle(); - }, - }, ], columns: tableKeyMap, columnActions: { @@ -279,11 +287,11 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { { label: '删除', name: 'groupDelete', - dynamicParams: ['uuid', 'appealType'], + dynamicParams: { linkIds: 'linkId[]' }, confirm: true, - handle: () => { - mockData.value.splice(0, 1); - }, + isClearCheck: true, + isReload: true, + api: group.delGroupList, }, ], }, @@ -291,60 +299,17 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { formConfig: { schemas: [ { - field: 'name', - label: '设备名称', + field: 'orgName', component: 'NsInput', componentProps: { - placeholder: '请输入', + placeholder: '请选择公司', }, }, { - field: 'provider', - label: '设备厂商', + field: 'pointNum', component: 'NsInput', componentProps: { - placeholder: '请输入', - }, - }, - { - field: 'payWay', - label: '设备区域', - component: 'NsSelect', - componentProps: { - placeholder: '请选择', - options: [ - { - label: '全部', - value: '', - }, - ], - }, - }, - { - field: 'createTime', - label: '生产日期', - component: 'NsRangePicker', - fieldMap: ['queryStartDate', 'queryEndDate'], - componentProps: { - valueFormat: 'YYYY-MM-DD', - }, - }, - { - field: 'createTime1', - label: '采购日期', - component: 'NsRangePicker', - fieldMap: ['queryStartDate', 'queryEndDate'], - componentProps: { - valueFormat: 'YYYY-MM-DD', - }, - }, - { - field: 'createTime2', - label: '启用日期', - component: 'NsRangePicker', - fieldMap: ['queryStartDate', 'queryEndDate'], - componentProps: { - valueFormat: 'YYYY-MM-DD', + placeholder: '请输入节点编号', }, }, ], @@ -355,13 +320,11 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { }; export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { - // 分组节点 + // 计算节点 return { title: '点位信息', - // api: '/carbon_emission/device/getDeviceList', - value: mockData.value, - params: defaultParams, - + api: group.queryGroupInfoPage, + params: defaultParams.value, headerActions: [ { label: '编辑', @@ -378,9 +341,11 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { dynamicDisabled: (data: any) => { return data.list.length === 0; }, - handle: () => { - mockData.value.splice(0, 2); - }, + dynamicParams: { ids: 'id[]' }, + confirm: true, + isReload: true, + isClearCheck: true, + api: group.delComputeList, }, { label: '批量导出', @@ -421,7 +386,31 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx'); }, }, + + { + label: '批量分组', + name: 'groupBatGroup', + type: 'primary', + dynamicDisabled: (data: any) => { + return data.list.length === 0; + }, + handle: ({ list }) => { + const ids = list.map(({ id }) => id); + + defaultParams.value['saveDeviceInfoIds'] = ids; + elGroup.value.toggle(); + }, + }, + { + label: '公式编辑', + name: 'groupFormulaEdit', + type: 'primary', + handle: () => { + elFormula.value.toggle(); + }, + }, ], + scroll: { x: 1400 }, columns: tableCalKeyMap, columnActions: { title: '操作', @@ -429,11 +418,11 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { { label: '删除', name: 'groupDelete', - dynamicParams: 'id', + dynamicParams: { ids: 'id[]' }, confirm: true, isReload: true, isClearCheck: true, - api: group.delGroupList, + api: group.delComputeList, }, ], }, @@ -442,17 +431,45 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { schemas: [ { field: 'name', - label: '设备名称', + label: '公司', component: 'NsInput', componentProps: { placeholder: '请选择公司', }, }, { + field: 'deviceCode', + component: 'NsInput', + componentProps: { + placeholder: '请输入设备id', + }, + }, + { + field: 'deviceNum', + component: 'NsInput', + componentProps: { + placeholder: '请输入设备编号', + }, + }, + { field: 'provider', component: 'NsInput', componentProps: { - placeholder: '请输入节点编号', + placeholder: '请输入设备状态', + }, + }, + { + field: 'deviceNameType', + component: 'NsInput', + componentProps: { + placeholder: '请输入设备型号', + }, + }, + { + field: 'provider', + component: 'NsInput', + componentProps: { + placeholder: '请输入分组名称', }, }, ], diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue index d43c189..78cd18b 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue @@ -14,12 +14,10 @@ v-model:target-keys="targetKeys" :data-source="dataSource" style="height: 100%; width: 66%" - oneWay :listStyle="listStyle" show-search :render="(item) => item.title" - :filter-option="filterOption" - @change="handleChange" /> + :filter-option="filterOption" /> @@ -29,12 +27,13 @@ import { editTreeConfig } from './config'; import { group } from '/@/api/deviceManage'; import { http } from '/nerv-lib/util/http'; + const emit = defineEmits(['sure']); const props = defineProps({ params: Object }); const result = JSON.parse(sessionStorage.getItem('ORGID')!); const config = computed(() => { return editTreeConfig(result); }); - const visible = ref(true); + const visible = ref(false); const dataSource = ref([]); const listStyle = { height: '100%', @@ -42,14 +41,19 @@ }; const targetKeys = ref([]); const currentId = ref(''); + + const clearData = () => { + dataSource.value = []; + targetKeys.value = []; + }; const toggle = () => { visible.value = !visible.value; + clearData(); }; - const handleChange = (nextTargetKeys: string[], direction: string, moveKeys: string[]) => { - console.log('targetKeys: ', nextTargetKeys); - console.log('direction: ', direction); - console.log('moveKeys: ', moveKeys); - }; + + onMounted(() => { + getData(currentId.value); + }); const filterOption = (inputValue: string, option: any) => { return option?.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1; @@ -65,7 +69,9 @@ saveGroupIds: targetKeys.value, }) .then(() => { + emit('sure'); NsMessage.success('操作成功'); + toggle(); }); }; function treeSelect( @@ -98,8 +104,8 @@ item['key'] = item.id.toString(); return item; }); - targetKeys.value = res.data.linkGroups.map((item) => { - return item.id; + targetKeys.value = res.data.linkGroups?.map((item) => { + return item.id.toString(); }); }); }; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue new file mode 100644 index 0000000..9301f50 --- /dev/null +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue @@ -0,0 +1,123 @@ + + + diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue index df02997..905f7fa 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue @@ -7,29 +7,67 @@ :cancel="() => (visible = false)" placement="right"> +
+ 分组列表 +
+ 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 07/24] =?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 @@ - - @@ -77,7 +77,11 @@ const op = () => { inputDisabled.value = !inputDisabled.value; - add(); + }; + + const clearData = () => { + model.value = {}; + selectedRowKeys.value = []; }; const editGroup = () => { @@ -97,6 +101,7 @@ http.post(group.saveComputeGroup, finalParams).then(() => { getTableData(); NsMessage.success('操作成功'); + op(); }); }); }; @@ -105,6 +110,7 @@ http.post(group.delComputeGroup, { id }).then(() => { getTableData(); NsMessage.success('操作成功'); + clearData(); }); }; const rowSelectChange = (selected, selectedRows) => { From 8091bc10cccde4264db893fc2308350117902c7e Mon Sep 17 00:00:00 2001 From: zhaohy <1695786511@qq.com> Date: Mon, 15 Jul 2024 16:40:03 +0800 Subject: [PATCH 12/24] =?UTF-8?q?fix:=E8=83=BD=E6=BA=90=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=8D=A2=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/alarmManagement/alarmSettings/index.vue | 9 +++++++++ .../view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue index 157605a..6f59342 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue @@ -83,6 +83,15 @@ clickSwitch({ type: 3, enableRules: record.enableRules, record: record }) " /> + + + { + data.monitorFrequency = data.monitorFrequency.value; + data.priority = data.priority.value; + data.repetitions = data.repetitions.value; editeEnergyAlarm.value.toggle(data); }, }, From de0ce4ec2dc82bef40f6d75f2fff30d0e1345368 Mon Sep 17 00:00:00 2001 From: zhaohy <1695786511@qq.com> Date: Mon, 15 Jul 2024 16:41:03 +0800 Subject: [PATCH 13/24] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notificationManagement/linkPeople/index.vue | 55 ++++++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue index dd498ad..4e6498d 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue @@ -1,15 +1,58 @@ @@ -24,6 +67,7 @@ // 处理确定按钮的逻辑 console.log('点击了确定按钮'); }; + const searchValue = ref(''); const getData = () => { show.value = true; }; @@ -38,6 +82,7 @@ handleOk, show, getData, + searchValue, handleCancel, }; }, From 58300c60e26047b61ea2b4d4069766e1a6d21c64 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Mon, 15 Jul 2024 16:58:50 +0800 Subject: [PATCH 14/24] =?UTF-8?q?fix=EF=BC=9A=E8=AE=BE=E5=A4=87=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E8=A1=A5=E5=85=85=E7=AD=9B=E9=80=89=E9=A1=B9=E5=8E=BB?= =?UTF-8?q?=E9=87=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/equipmentManage/group/index.vue | 4 +++- .../src/view/equipmentManage/ledger/config.ts | 28 +++++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue index 8ddb9c9..7eb9cd3 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue @@ -170,7 +170,9 @@ { title: '删除', key: 'deleteNode', func: (data) => deleteNode(data) }, ]; const handleSelect = (key, record) => { - console.log(record); + //清除选中行数据 + tableRef.value?.nsTableRef.clearCheck(); + tableCalRef.value?.nsTableRef.clearCheck(); const { node: { pointType, id, energyType }, } = record; diff --git a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts index cd2d05b..6ceee63 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts @@ -141,11 +141,19 @@ export const tableConfig = (orgId) => { component: 'NsSelectApi', componentProps: { placeholder: '请选择设备名称', - api: device.dropArea, + api: (params) => { + return http.post(device.dropArea, params).then((res) => { + const result = res.data?.reduce((pre, cur) => { + !pre.includes(cur.deviceName) && pre.push(cur.deviceName); + return pre; + }, []); + return { data: result }; + }); + }, resultField: 'data', params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, - labelField: 'deviceName', - valueField: 'deviceName', + // labelField: 'deviceName', + // valueField: 'deviceName', filterOption: (input: string, option: any) => { return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; }, @@ -205,11 +213,19 @@ export const tableConfig = (orgId) => { component: 'NsSelectApi', componentProps: { placeholder: '请选择设备厂商', - api: device.dropArea, + api: (params) => { + return http.post(device.dropArea, params).then((res) => { + const result = res.data?.reduce((pre, cur) => { + !pre.includes(cur.manufacturer) && pre.push(cur.manufacturer); + return pre; + }, []); + return { data: result }; + }); + }, resultField: 'data', params: { orgId, filterField: 'DEVICE_NAME_FACTORY' }, - labelField: 'manufacturer', - valueField: 'manufacturer', + // labelField: 'manufacturer', + // valueField: 'manufacturer', filterOption: (input: string, option: any) => { return option.manufacturer.toLowerCase().indexOf(input.toLowerCase()) >= 0; }, From 0e9743f5989b3500fced3d1f5abf0670c9c572d8 Mon Sep 17 00:00:00 2001 From: zhaohy <1695786511@qq.com> Date: Mon, 15 Jul 2024 17:02:42 +0800 Subject: [PATCH 15/24] =?UTF-8?q?fix:=E6=8D=A2=E6=88=90=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../energyAlarm/editConfigureEnergyAlarm.vue | 9 ++++++++ .../equipmentAlarm/editConfigureDeviceAlarm.vue | 9 ++++++++ .../notificationManagement/linkPeople/index.vue | 24 ++++++++++++++++++++-- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue index 2c50eb6..2043200 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue @@ -316,6 +316,15 @@ delete infoObject.value.dataSourcesWay; infoObject.value.comparisonType = infoObject.value.comparisonType.split(','); infoObject.value.ruleType = infoObject.value.ruleType + ''; + //枚举 需要重新赋值 + if ( + infoObject.value.hxAlarmRuleLogicList && + infoObject.value.hxAlarmRuleLogicList.length > 0 + ) { + infoObject.value.hxAlarmRuleLogicList.forEach((item: any) => { + item.logic = item.logic.value; + }); + } infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || []; delete infoObject.value.hxAlarmRuleLogicList; //获取设备/节点 diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue index bf0395f..39920f9 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue @@ -320,6 +320,15 @@ getDevicePoint({ id: infoObject.value.deviceName }); // 回显 选择设备类型 findParentIds(deviceTypeTreeData.value, infoObject.value.deviceType, selectDevice.value); + //枚举 需要重新赋值 + if ( + infoObject.value.hxAlarmRuleLogicList && + infoObject.value.hxAlarmRuleLogicList.length > 0 + ) { + infoObject.value.hxAlarmRuleLogicList.forEach((item: any) => { + item.logic = item.logic.value; + }); + } infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || []; delete infoObject.value.hxAlarmRuleLogicList; infoObject.value.deviceType = selectDevice; diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue index 4e6498d..dfa6878 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue @@ -7,7 +7,7 @@ @ok="handleOk" @cancel="handleCancel">
-
+
2
+
+
+
+ 人员列表 +
+
From dac2e095e190046110a0b282b9d2219012840228 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Mon, 15 Jul 2024 17:15:59 +0800 Subject: [PATCH 16/24] =?UTF-8?q?fix=EF=BC=9A=E5=88=86=E7=BB=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/view/equipmentManage/group/edit.vue | 1 + hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue | 1 + hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue index 9ce1621..f9785ef 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue @@ -45,6 +45,7 @@ const clearData = () => { dataSource.value = []; targetKeys.value = []; + currentId.value = ''; }; const toggle = () => { visible.value = !visible.value; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue index 2f2ca8f..5d29b12 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue @@ -45,6 +45,7 @@ const clearData = () => { dataSource.value = []; targetKeys.value = []; + currentId.value = ''; }; const toggle = () => { visible.value = !visible.value; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue index 97bb5fd..85ef207 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue @@ -16,8 +16,8 @@ @@ -161,6 +161,7 @@ () => [ createVNode(DeleteOutlined, { style: { color: 'red', cursor: 'pointer' }, + title: '删除', // onClick: () => delGroup(record.id), }), ], From 1aa294b998d8672f3422a7efbf7f87509330f1a8 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Mon, 15 Jul 2024 17:51:30 +0800 Subject: [PATCH 17/24] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E5=9E=8B?= =?UTF-8?q?=E5=8F=B7=E5=8F=96=E6=B6=88=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/view/equipmentManage/group/config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index abd7710..5288eeb 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -497,7 +497,6 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { defaultParams: defaultParams.value, componentProps: { placeholder: '请选择设备型号', - mode: 'multiple', api: (params: any) => { return http.post(group.dropGroupInfoFilter, params).then((res: any) => { const result = [...new Set(res.data)]; From dc0f2a164b32fb9a991ce8c80bc1cdbb8b53621f Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Tue, 16 Jul 2024 10:48:10 +0800 Subject: [PATCH 18/24] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=A4=9A=E9=87=8Dsubmit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/saas/view/system/login.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/saas/view/system/login.vue b/lib/saas/view/system/login.vue index 187327a..83bc5be 100644 --- a/lib/saas/view/system/login.vue +++ b/lib/saas/view/system/login.vue @@ -131,6 +131,8 @@ }); validator(null, value?.code) .then(() => { + console.log('登录'); + // 记住密码 rememberFunc(data); loading.value = true; @@ -257,13 +259,13 @@ created() { const _this = this; window.sessionStorage.clear(); - document.onkeydown = function (e) { - const key = window.event === undefined ? e.keyCode : window.event.keyCode; - key === 13 ? _this.submit() : ''; - }; + // document.onkeydown = function (e) { + // const key = window.event === undefined ? e.keyCode : window.event.keyCode; + // key === 13 ? _this.submit() : ''; + // }; }, beforeUnmount() { - document.onkeydown = function (e) {}; + // document.onkeydown = function (e) {}; }, mounted() { From 48569345aa99beb9ef24aee584843128f4da3acc Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Tue, 16 Jul 2024 14:31:27 +0800 Subject: [PATCH 19/24] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=AF=86?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/config/app.config.ts | 2 +- hx-op/src/config/app.config.ts | 4 ++-- lib/saas/view/service/updatePassWord.vue | 26 ++++++++++++-------------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts index 9f2881a..11df6ca 100644 --- a/hx-ai-intelligent/src/config/app.config.ts +++ b/hx-ai-intelligent/src/config/app.config.ts @@ -103,7 +103,7 @@ export const appConfig = { updatePassWordInfo: { title: '修改密码', subtitle: 'huaxing平台', - api: '/carbon-smart/api/user/password', + api: '/carbon-smart/api/user/update/password', }, // headerBellInfo: { // isShow: true, diff --git a/hx-op/src/config/app.config.ts b/hx-op/src/config/app.config.ts index b5bd1b2..4dff0a0 100644 --- a/hx-op/src/config/app.config.ts +++ b/hx-op/src/config/app.config.ts @@ -89,8 +89,8 @@ export const appConfig = { // 修改密码配置 updatePassWordInfo: { title: '修改密码', - subtitle: 'huaxing平台', - api: '/api/web/objs/User/changePassword', + subtitle: 'huaxing管理平台', + api: '/carbon-smart/api/user/update/password', }, // headerBellInfo: { // isShow: true, diff --git a/lib/saas/view/service/updatePassWord.vue b/lib/saas/view/service/updatePassWord.vue index e75810f..6743c02 100644 --- a/lib/saas/view/service/updatePassWord.vue +++ b/lib/saas/view/service/updatePassWord.vue @@ -19,7 +19,7 @@
@@ -32,8 +32,6 @@
- 登录已有豪恩账号 > -
@@ -69,7 +67,7 @@ const { navigateBackV2: navigateBack } = useNavigate(); const formSchema = reactive([ { - field: 'oldPassword', + field: 'originPassword', label: '原密码', component: 'NsInputPassword', componentProps: { @@ -86,7 +84,7 @@ }, { - field: 'newPassword', + field: 'password', label: '新密码', component: 'NsInputPassword', componentProps: { @@ -147,7 +145,7 @@ if (!value) { return; } - if (value !== data.newPassword) { + if (value !== data.password) { return Promise.reject('两次密码不一致'); } }, @@ -166,14 +164,14 @@ async function update() { try { const res = await http.post(configStore.updatePassWordInfo?.api, data); - if (res.success) { - NsMessage.success('修改成功,需重新登陆', 1, () => { - Cookies.remove(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`); - sessionStorage.clear(); - router.push('/login'); - authorizationStore.clearAuthorization(); - }); - } + // if (res.success) { + NsMessage.success('修改成功,需重新登陆', 1, () => { + Cookies.remove(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`); + sessionStorage.clear(); + router.replace('/login'); + authorizationStore.clearAuthorization(); + }); + // } loading.value = false; } catch (err) { loading.value = false; From 0b619fe937c6d39dac5e4a67258df688b73ad16e Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Tue, 16 Jul 2024 15:22:29 +0800 Subject: [PATCH 20/24] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=85=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/view/equipmentManage/group/config.ts | 1 + hx-ai-intelligent/src/view/equipmentManage/group/edit.vue | 5 ++++- hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue | 5 ++++- hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue | 6 +++++- hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue | 4 ++++ hx-ai-intelligent/src/view/equipmentManage/group/index.vue | 4 ---- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index 5288eeb..be69c2c 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -227,6 +227,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { label: '编辑', name: 'groupEdit', type: 'primary', + dynamicDisabled: () => !defaultParams.value?.id, handle: (a, b) => { el.value.toggle(); }, diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue index f9785ef..455cc0f 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/edit.vue @@ -59,7 +59,10 @@ const btnClick = () => { // visible.value = false; - + if (!currentId.value) { + NsMessage.warn('请先选择公司'); + return; + } http .post(group.saveGroupList, { ...props.params, diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue index 5d29b12..f60b997 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue @@ -60,7 +60,10 @@ }; const btnClick = () => { - // visible.value = false; + if (!currentId.value) { + NsMessage.warn('请先选择公司'); + return; + } http .post(group.saveComputeList, { diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue index 905f7fa..8ab2a97 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue @@ -2,7 +2,7 @@ @@ -140,6 +140,10 @@ ]; const btnClick = () => { + if (!model.value?.formula) { + NsMessage.warn('请填写公式'); + return; + } http .post(group.formula, { ...props.params, diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue index 85ef207..6240169 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue @@ -267,6 +267,10 @@ }; const btnClick = () => { + if (!selectedRowKeys.value[0]) { + NsMessage.warn('请选择分组'); + return; + } http .post(group.saveComputeGroupInfo, { ...props.params, diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue index 7eb9cd3..0ee490a 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue @@ -5,10 +5,6 @@ - -
From 6278e3ff1763bf2db40563ff1e7fdbdc43e2db8c Mon Sep 17 00:00:00 2001 From: fks-yangshouda Date: Tue, 16 Jul 2024 15:31:05 +0800 Subject: [PATCH 21/24] =?UTF-8?q?1.=E7=9B=91=E6=8E=A7=E4=B8=AD=E5=BF=83=20?= =?UTF-8?q?-=20=E7=8E=AF=E5=A2=83=E7=9B=91=E6=B5=8B=20=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E5=88=86=E6=9E=90=E6=B7=BB=E5=8A=A0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=83=A8=E5=88=86=202.=E4=BF=AE=E6=94=B9=20=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E4=B8=AD=E5=BF=83=20-=20=E8=83=BD=E8=80=97=E7=9B=91?= =?UTF-8?q?=E6=B5=8B=E5=B7=A6=E4=BE=A7=E6=A0=91=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/view/monitor/energyMonitor/tree/index.vue | 48 +++---- .../environmentMonitor/aggregateData/index.vue | 160 ++++++++++++++++++++- 2 files changed, 178 insertions(+), 30 deletions(-) diff --git a/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue b/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue index f6e8062..b599c83 100644 --- a/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue +++ b/hx-ai-intelligent/src/view/monitor/energyMonitor/tree/index.vue @@ -40,18 +40,22 @@
- + 查询 @@ -89,15 +93,15 @@ // 能耗类型list const options1 = ref([]); - // 采集频率list + // 日期类型list const options2 = ref([]); const mode = ref('1'); // 能耗类型 const selectedValue = ref(); - // 采集频率 - const frequencyValue = ref(); + // 日期类型 + const dateTypeValue = ref(); // 时间 - const dateRange = ref<[Dayjs, Dayjs] | undefined>(); + const dateValue = ref<[Dayjs, Dayjs] | undefined>(); // 页面初始化参数 const getOptionsList = async () => { @@ -115,20 +119,12 @@ } options2.value = [ { - value: '1', - label: '5分钟', - }, - { - value: '2', - label: '10分钟', + value: 'month', + label: '月', }, { - value: '3', - label: '30分钟', - }, - { - value: '4', - label: '1小时', + value: 'year', + label: '年', }, ]; }; @@ -691,9 +687,9 @@ } }; - const onChange = (val: RangeValue) => { - dateRange.value = val; - }; + // const onChange = (val: RangeValue) => { + // dateRange.value = val; + // }; const onCalendarChange = (val: RangeValue) => { dates.value = val; @@ -716,8 +712,8 @@ options2, mode, selectedValue, - frequencyValue, - dateRange, + dateTypeValue, + dateValue, getOptionsList, getSelect, getSelect11, @@ -725,7 +721,7 @@ disabledDate, onCalendarChange, onOpenChange, - onChange, + // onChange, hackValue, treeLoading, changeEnergyType, diff --git a/hx-ai-intelligent/src/view/monitor/environmentMonitor/aggregateData/index.vue b/hx-ai-intelligent/src/view/monitor/environmentMonitor/aggregateData/index.vue index 1536c37..1831fc5 100644 --- a/hx-ai-intelligent/src/view/monitor/environmentMonitor/aggregateData/index.vue +++ b/hx-ai-intelligent/src/view/monitor/environmentMonitor/aggregateData/index.vue @@ -1,3 +1,4 @@ +