diff --git a/hx-ai-intelligent/src/api/monitor.ts b/hx-ai-intelligent/src/api/monitor.ts new file mode 100644 index 0000000..62f5064 --- /dev/null +++ b/hx-ai-intelligent/src/api/monitor.ts @@ -0,0 +1,13 @@ +export enum deviceMonitor { + // getTableList = '/carbon/emission/factor/queryCarbonFactorPage', + // addNewData = '/carbon/emission/factor/creatOrUpdate', + // editUser = '/carbon-smart/api/user/edit', + // frozen = '/carbon-smart/api/user/frozen', + // resetPwd = '/carbon-smart/api/user/resetPwd', + // del = '/carbon-smart/api/user/del', + // batchDel = '/carbon-smart/api/user/batchDel', + // getCarbonFactorTree = '/carbon/emission/type/getCarbonFactorTree', + // queryDeptTree = '/carbon-smart/api/user/queryDeptTree', + // queryUserPerList = '/carbon-smart/api/user/queryUserPerList', + getDeviceGraph = '/carbon-smart/api/monitor/getDeviceGraph', +} diff --git a/hx-ai-intelligent/src/view/monitor/deviceMonitor/graph/index.vue b/hx-ai-intelligent/src/view/monitor/deviceMonitor/graph/index.vue index bce9c0e..194ded6 100644 --- a/hx-ai-intelligent/src/view/monitor/deviceMonitor/graph/index.vue +++ b/hx-ai-intelligent/src/view/monitor/deviceMonitor/graph/index.vue @@ -17,6 +17,7 @@ tableList: any[]; tableColumns: any[]; graphList: any[]; + XData: any[]; } const pageData = inject('pageData'); @@ -37,32 +38,40 @@ const draw = () => { data.value = pageData.graphList; + let XData = pageData.XData; if (chartInstance) { chartInstance.dispose(); } chartInstance = echarts.init(graphChart.value); var seriesList = []; - var date = []; + // var date = []; var legendList: string | any[] = []; for (let i = 0; i < data.value.length; i++) { - date.push(data.value[i].date); + seriesList.push({ + name: data.value[i].deviceName, + data: data.value[i].data, + type: 'line', + smooth: true, + }); + legendList.push(data.value[i].deviceName); + // date.push(data.value[i].date); - for (let j = 0; j < data.value[i].data.length; j++) { - if (seriesList.length < j + 1) { - seriesList.push({ - name: data.value[i].data[j].name, - data: [data.value[i].data[j].value], - type: 'line', - smooth: true, - }); - } else { - seriesList[j].data.push(data.value[i].data[j].value); - } - if (legendList.length == 0 || legendList.length < j + 1) { - legendList.push(data.value[i].data[j].name); - } - } + // for (let j = 0; j < data.value[i].data.length; j++) { + // if (seriesList.length < j + 1) { + // seriesList.push({ + // name: data.value[i].data[j].name, + // data: [data.value[i].data[j].value], + // type: 'line', + // smooth: true, + // }); + // } else { + // seriesList[j].data.push(data.value[i].data[j].value); + // } + // if (legendList.length == 0 || legendList.length < j + 1) { + // legendList.push(data.value[i].data[j].name); + // } + // } } const option = { legend: { @@ -76,7 +85,7 @@ const date = params[0].name; const values = params .map((param: any) => { - const unit = data.value.find((d) => d.date === date)?.unit || ''; + const unit = data.value.find((d) => d.date === date)?.devicePositionUnit || ''; return ` ${param.marker}${param.seriesName} ${param.value} ${unit} @@ -88,7 +97,7 @@ }, xAxis: { type: 'category', - data: date, + data: XData, }, yAxis: { type: 'value', diff --git a/hx-ai-intelligent/src/view/monitor/deviceMonitor/index.vue b/hx-ai-intelligent/src/view/monitor/deviceMonitor/index.vue index 71bf86b..909b319 100644 --- a/hx-ai-intelligent/src/view/monitor/deviceMonitor/index.vue +++ b/hx-ai-intelligent/src/view/monitor/deviceMonitor/index.vue @@ -12,6 +12,7 @@ tableList: [], tableColumns: [], graphList: [], + XData: [], }); // 使用 provide 函数来提供这个响应式对象 diff --git a/hx-ai-intelligent/src/view/monitor/deviceMonitor/page.vue b/hx-ai-intelligent/src/view/monitor/deviceMonitor/page.vue index d406f8c..4cbf1e7 100644 --- a/hx-ai-intelligent/src/view/monitor/deviceMonitor/page.vue +++ b/hx-ai-intelligent/src/view/monitor/deviceMonitor/page.vue @@ -16,7 +16,7 @@ - + diff --git a/hx-ai-intelligent/src/view/monitor/deviceMonitor/table/index.vue b/hx-ai-intelligent/src/view/monitor/deviceMonitor/table/index.vue index c205a2d..60f77cc 100644 --- a/hx-ai-intelligent/src/view/monitor/deviceMonitor/table/index.vue +++ b/hx-ai-intelligent/src/view/monitor/deviceMonitor/table/index.vue @@ -1,5 +1,10 @@ + + diff --git a/hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/config.ts b/hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/config.ts new file mode 100644 index 0000000..6fdccb4 --- /dev/null +++ b/hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/config.ts @@ -0,0 +1,20 @@ +export const tableColumns = [ + { + title: '序号', + customRender: (text: any) => { + return text.index + 1; + }, + }, + { + title: '区域名称', + dataIndex: 'areaName', + }, + { + title: '点位', + dataIndex: 'point', + }, + { + title: '日期', + dataIndex: 'date', + }, +]; diff --git a/hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/index.vue b/hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/index.vue new file mode 100644 index 0000000..a9342ab --- /dev/null +++ b/hx-ai-intelligent/src/view/monitor/environmentMonitor/historyData/index.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue b/hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue index 48caad7..485a9d9 100644 --- a/hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue +++ b/hx-ai-intelligent/src/view/monitor/environmentMonitor/index.vue @@ -4,14 +4,16 @@ Content of Tab Pane 2 Content of Tab Pane 3 - + +