This commit is contained in:
lb 2023-09-25 16:53:31 +08:00
parent c24d22aedd
commit 8dc5bbb4d8

View File

@ -142,8 +142,6 @@
<script>
import * as echarts from 'echarts';
var data = [];
var categories = [];
var types = [
{ name: '运行', color: '#5ad8a6' },
{ name: '故障', color: '#fc9c91' },
@ -156,8 +154,9 @@ function renderItem(params, api) {
var categoryIndex = api.value(0);
var start = api.coord([api.value(1), categoryIndex]);
var end = api.coord([api.value(2), categoryIndex]);
var height = api.size([0, 1])[1] * 1;
// var height = api.size([0, 1])[1] * 0.8;
var height = 56;
// var height = 56;
var rectShape = echarts.graphic.clipRectByRect(
{
x: start[0],
@ -182,16 +181,6 @@ function renderItem(params, api) {
);
}
data.push({
name: 'running',
value: [0, 1691568181000, 1691568181000 + 60 * 60 * 1000, 60],
itemStyle: {
normal: {
color: types[0].color,
},
},
});
export default {
name: 'SGStatus',
components: {},
@ -333,7 +322,8 @@ export default {
splitLine: {
show: true,
},
data: [], // <====
// data: [], // <====
data: ['设备1', '设备2', '设备3', '设备4'],
},
{
axisLine: {
@ -356,7 +346,93 @@ export default {
x: [1, 2],
y: 0,
},
data: [], // <===
// data: [], // <===
data: [
{
name: '运行',
value: [
0,
1691568181000,
1691568181000 + 60 * 60 * 1000,
60 * 10 * 1000,
],
itemStyle: {
normal: {
color: types[0].color,
},
},
},
{
name: '计划停机',
value: [
0,
1691578581000,
1691578581000 + 10 * 60 * 1000,
60 * 10 * 1000,
],
itemStyle: {
normal: {
color: types[2].color,
},
},
},
{
name: '运行',
value: [
1,
1691568181000,
1691568181000 + 60 * 60 * 1000,
60 * 10 * 1000,
],
itemStyle: {
normal: {
color: types[0].color,
},
},
},
{
name: '故障',
value: [
2,
1691538181000,
1691538181000 + 60 * 60 * 1000,
60 * 10 * 1000,
],
itemStyle: {
normal: {
color: types[1].color,
},
},
},
{
name: '运行',
value: [
2,
1691578181000,
1691578181000 + 90 * 60 * 1000,
90 * 10 * 1000,
],
itemStyle: {
normal: {
color: types[0].color,
},
},
},
{
name: '计划停机',
value: [
3,
1691528181000,
1691528181000 + 240 * 60 * 1000,
240 * 10 * 1000,
],
itemStyle: {
normal: {
color: types[2].color,
},
},
},
],
},
],
},
@ -394,6 +470,7 @@ export default {
handleGraphList() {
console.log('in handleGraphList:', this.graphList);
return;
const min = this.queryParams.recordTime
? new Date(this.queryParams.recordTime).getTime()
: this.findMin();
@ -419,7 +496,7 @@ export default {
},
});
});
console.log("chartOptions", this.chartOption)
console.log('chartOptions', this.chartOption);
});
},