|
@@ -24,9 +24,9 @@ export default {
|
|
|
default: 4,
|
|
|
},
|
|
|
// 单位
|
|
|
- units: {
|
|
|
- type: Array,
|
|
|
- default: () => ["", ""],
|
|
|
+ unit: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
},
|
|
|
// 单位数据
|
|
|
unitDatas: {
|
|
@@ -98,10 +98,10 @@ export default {
|
|
|
// 当日0点时间
|
|
|
var timeStamp = [];
|
|
|
let stamp = new Date(new Date().setHours(0, 0, 0, 0)).getTime();
|
|
|
- for (let i = 0; i < 96; i++) {
|
|
|
+ for (let i = 0; i < 48; i++) {
|
|
|
timeStamp.push(dayjs(stamp).format("HH:mm"));
|
|
|
// this.emptyData.push("0");
|
|
|
- stamp = parseInt(stamp) + 15 * 60 * 1000;
|
|
|
+ stamp = parseInt(stamp) + 30 * 60 * 1000;
|
|
|
}
|
|
|
timeStamp.push("24:00");
|
|
|
return timeStamp;
|
|
@@ -166,95 +166,6 @@ export default {
|
|
|
});
|
|
|
return result;
|
|
|
},
|
|
|
- yAxis() {
|
|
|
- let result = [];
|
|
|
- let i = 0;
|
|
|
- this.units.forEach((value, index) => {
|
|
|
- var option = {
|
|
|
- type: "value",
|
|
|
- // name: this.units[index],
|
|
|
- nameTextStyle: {
|
|
|
- color: this.color[index],
|
|
|
- fontSize: 12,
|
|
|
- },
|
|
|
- splitNumber: 11,
|
|
|
- // position:'left',
|
|
|
- axisLabel: {
|
|
|
- formatter: "{value}",
|
|
|
- textStyle: {
|
|
|
- color: this.color[index],
|
|
|
- fontSize: util.vh(10),
|
|
|
- },
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- lineStyle: {
|
|
|
- color: this.color[this.unitDatas[index].codex],
|
|
|
- width: 1,
|
|
|
- },
|
|
|
- },
|
|
|
- boundaryGap: false,
|
|
|
- //分格线
|
|
|
- splitLine: {
|
|
|
- show: false,
|
|
|
- lineStyle: {
|
|
|
- color: "#2D3338",
|
|
|
- width: 1, //轴线的宽度
|
|
|
- type: "dashed",
|
|
|
- },
|
|
|
- },
|
|
|
- };
|
|
|
- if (this.unitDatas[index].flag) {
|
|
|
- i++;
|
|
|
- option.min = this.unitDatas[index].min;
|
|
|
- option.max = this.unitDatas[index].max;
|
|
|
- if (i % 2 != 0) {
|
|
|
- option.position = "left";
|
|
|
- option.offset = (i - 1) * 35;
|
|
|
- if (i >= 3) {
|
|
|
- option.offset = (i - 2) * 35;
|
|
|
- }
|
|
|
- if (i >= 5) {
|
|
|
- option.offset = (i - 3) * 35;
|
|
|
- }
|
|
|
- if (i >= 7) {
|
|
|
- option.offset = (i - 4) * 35;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (i >= 4) {
|
|
|
- option.offset = (i - 3) * 35;
|
|
|
- }
|
|
|
- if (i >= 6) {
|
|
|
- option.offset = (i - 4) * 35;
|
|
|
- }
|
|
|
- if (i >= 8) {
|
|
|
- option.offset = (i - 5) * 35;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- result.push(option);
|
|
|
- } else if (index == 0) {
|
|
|
- if (!this.unitDatas[0].flag) {
|
|
|
- option.axisLine.lineStyle.color = "#525252";
|
|
|
- option.axisLabel.textStyle.color = "#828484";
|
|
|
- }
|
|
|
- if (
|
|
|
- this.unitDatas[index].min == 0 &&
|
|
|
- this.unitDatas[index].max == 0
|
|
|
- ) {
|
|
|
- result.push(option);
|
|
|
- } else {
|
|
|
- option.min = this.unitDatas[index].min;
|
|
|
- option.max = this.unitDatas[index].max;
|
|
|
- result.push(option);
|
|
|
- }
|
|
|
- }
|
|
|
- this.leftOffset = 35;
|
|
|
- if (i == 0) {
|
|
|
- this.leftOffset = 35;
|
|
|
- }
|
|
|
- });
|
|
|
- return result;
|
|
|
- },
|
|
|
},
|
|
|
methods: {
|
|
|
childMethod(index) {
|
|
@@ -327,7 +238,30 @@ export default {
|
|
|
data: this.getTimeStanp,
|
|
|
},
|
|
|
],
|
|
|
- yAxis: this.yAxis,
|
|
|
+ yAxis: {
|
|
|
+ type: "value",
|
|
|
+ name: this.unit,
|
|
|
+ nameTextStyle: {
|
|
|
+ color: "#828484",
|
|
|
+ fontSize: 12,
|
|
|
+ },
|
|
|
+ splitNumber: 3,
|
|
|
+ splitLine: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ show: true,
|
|
|
+ textStyle: {
|
|
|
+ color: "#606769",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: "#606769", // y轴的颜色
|
|
|
+ width: 1, //y轴线的宽度
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
// dataZoom: [
|
|
|
// {
|
|
|
// type: "slider",
|