feat: 💯 页面调整
This commit is contained in:
parent
4f248fa355
commit
f7304edf60
35
src/main/java/cc/niushuai/gasweb/entity/ChartResp.java
Normal file
35
src/main/java/cc/niushuai/gasweb/entity/ChartResp.java
Normal file
@ -0,0 +1,35 @@
|
||||
package cc.niushuai.gasweb.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* data
|
||||
*
|
||||
* @author niushuai233
|
||||
* @date: 2022/12/16 21:36
|
||||
*/
|
||||
@Data
|
||||
public class ChartResp {
|
||||
|
||||
private String title;
|
||||
private List<Data> data = new ArrayList<>();
|
||||
|
||||
public ChartResp(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@lombok.Data
|
||||
@AllArgsConstructor
|
||||
public static class Data {
|
||||
private String x;
|
||||
private String y;
|
||||
|
||||
public String getY() {
|
||||
return y.replace("ppm", "").replace("°C", "");
|
||||
}
|
||||
}
|
||||
}
|
42
src/main/resources/static/chart/options.js
Normal file
42
src/main/resources/static/chart/options.js
Normal file
@ -0,0 +1,42 @@
|
||||
// 包装options
|
||||
function getOption(title, xData, yData, unit) {
|
||||
return {
|
||||
title: {
|
||||
text: title
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'item',
|
||||
formatter: '时间点: {b0}<br />当前值: {c0}' + unit,
|
||||
},
|
||||
dataZoom: [{
|
||||
id: "slider",
|
||||
type: 'slider'
|
||||
}],
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: yData,
|
||||
type: 'line',
|
||||
smooth: true
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function rebuildChart(instance, data, unit) {
|
||||
|
||||
var xData = data.data.map(item => item.x);
|
||||
var yData = data.data.map(item => item.y);
|
||||
|
||||
// coChart.setOption(getOption('CO浓度', ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], [820, 932, 901, 934, 1290, 1330, 1320]));
|
||||
instance.setOption(getOption(data.title, xData, yData, unit));
|
||||
console.log('rebuild chart', instance, data.title);
|
||||
}
|
1
src/main/resources/static/datepicker/datepicker.all.min.js
vendored
Normal file
1
src/main/resources/static/datepicker/datepicker.all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/static/datepicker/datepicker.css
Normal file
1
src/main/resources/static/datepicker/datepicker.css
Normal file
File diff suppressed because one or more lines are too long
26
src/main/resources/static/datepicker/datepicker.en.js
Normal file
26
src/main/resources/static/datepicker/datepicker.en.js
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Simplified Chinese translation for bootstrap-datetimepicker
|
||||
* Yuan Cheung <advanimal@gmail.com>
|
||||
*/
|
||||
;(function ($) {
|
||||
$.fn.datePicker.dates['en'] = {
|
||||
days: ["Sun", 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
||||
months: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||
now: "now",
|
||||
clear: 'clear',
|
||||
headerYearLink: '',
|
||||
units: ['-', ''],
|
||||
button: ["confirm", "cancel"],
|
||||
confirm: 'confirm',
|
||||
cancel: 'cancel',
|
||||
chooseDay: 'Choose Day',
|
||||
chooseTime: 'Choose Time',
|
||||
begin: 'Start Time',
|
||||
end: 'End Time',
|
||||
prevYear: 'prevYear',
|
||||
prevMonth: 'prevMonth',
|
||||
nextYear: 'nextYear',
|
||||
nextMonth: 'nextMonth',
|
||||
zero: '0:00'
|
||||
};
|
||||
}(jQuery));
|
3196
src/main/resources/static/datepicker/moment.min.js
vendored
Normal file
3196
src/main/resources/static/datepicker/moment.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user