趋势图前台代码提交

This commit is contained in:
zhanghan11 2024-04-09 16:28:49 +08:00
parent 6cdd1daecb
commit 62754e9163
6 changed files with 1269 additions and 813 deletions

View File

@ -1,10 +1,7 @@
package com.inspur.web.controller.ipc;
import com.inspur.common.constant.CacheConstants;
import com.inspur.common.core.domain.AjaxResult;
import com.inspur.common.core.redis.RedisCache;
import com.inspur.ipc.domain.IpcAlarmRecord;
import com.inspur.ipc.domain.IpcMonitorField;
import com.inspur.ipc.service.IIpcMonitorFieldService;
import com.inspur.ipc.utils.IpcConstant;
import com.serotonin.modbus4j.BatchRead;
@ -24,7 +21,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

View File

@ -113,7 +113,6 @@ public class IpcDataLogServiceImpl implements IIpcDataLogService {
*/
private List<Map<String, Object>> selectDataByParamNameandDate(String tableName, String part, String param, String startTime, String endTime) {
String sql = "select time," + param + " from " + tableName + " where part = '" + part + "' and time >= '" + startTime + "' and time <= '" + endTime + "'";
System.out.println(sql);
return influxDBService.queryResultProcess(influxDBService.query(sql));
}
@ -124,7 +123,6 @@ public class IpcDataLogServiceImpl implements IIpcDataLogService {
*/
private List<Map<String, Object>> selectLongTimeDataByParamNameandDate(String tableName, String part, String param, String startTime, String endTime, String interval) {
String sql = "select time, mean(" + param + ") from " + tableName + " where part = '" + part + "' and time >= '" + startTime + "' and time <= '" + endTime + "' group by time(" + interval + ")";
System.out.println(sql);
return influxDBService.queryResultProcess(influxDBService.query(sql));
}

View File

@ -17,3 +17,12 @@ export function getSensorDataLog(query) {
params: query,
});
}
// 查询趋势图谱数据
export function getTendencyData(query) {
return request({
url: "/ipc/dataLog/getTendencyData",
method: "get",
params: query,
});
}

View File

@ -64,11 +64,13 @@
@click="handleQuery"
>搜索</el-button>
<el-button
type="primary"
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
<el-button
type="primary"
icon="el-icon-download"
size="mini"
@click="exportData"

View File

@ -453,6 +453,30 @@ export default {
data: vz,
},
],
dataZoom: [
{
show: true,
type: "slider",
xAxisIndex: 0,
filterMode: "none",
start: 0,
end: xAxis.length,
bottom: "1%",
fillerColor: "rgba(167,183,204,0.4)", //
borderColor: "#3C506B",
},
{
show: true,
type: "inside",
xAxisIndex: 0,
filterMode: "none",
start: 0,
end: 10,
bottom: "1%",
fillerColor: "rgba(167,183,204,0.4)", //
borderColor: "#E0E6F3",
},
],
}),
true,
true

File diff suppressed because it is too large Load Diff