test #47

Merged
gtz217 merged 273 commits from test into master 2023-10-17 08:53:54 +08:00
Showing only changes of commit 8dc5bbb4d8 - Show all commits

View File

@ -142,8 +142,6 @@
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts';
var data = [];
var categories = [];
var types = [ var types = [
{ name: '运行', color: '#5ad8a6' }, { name: '运行', color: '#5ad8a6' },
{ name: '故障', color: '#fc9c91' }, { name: '故障', color: '#fc9c91' },
@ -156,8 +154,9 @@ function renderItem(params, api) {
var categoryIndex = api.value(0); var categoryIndex = api.value(0);
var start = api.coord([api.value(1), categoryIndex]); var start = api.coord([api.value(1), categoryIndex]);
var end = api.coord([api.value(2), 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 = api.size([0, 1])[1] * 0.8;
var height = 56; // var height = 56;
var rectShape = echarts.graphic.clipRectByRect( var rectShape = echarts.graphic.clipRectByRect(
{ {
x: start[0], 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 { export default {
name: 'SGStatus', name: 'SGStatus',
components: {}, components: {},
@ -333,7 +322,8 @@ export default {
splitLine: { splitLine: {
show: true, show: true,
}, },
data: [], // <==== // data: [], // <====
data: ['设备1', '设备2', '设备3', '设备4'],
}, },
{ {
axisLine: { axisLine: {
@ -356,7 +346,93 @@ export default {
x: [1, 2], x: [1, 2],
y: 0, 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() { handleGraphList() {
console.log('in handleGraphList:', this.graphList); console.log('in handleGraphList:', this.graphList);
return;
const min = this.queryParams.recordTime const min = this.queryParams.recordTime
? new Date(this.queryParams.recordTime).getTime() ? new Date(this.queryParams.recordTime).getTime()
: this.findMin(); : this.findMin();
@ -419,7 +496,7 @@ export default {
}, },
}); });
}); });
console.log("chartOptions", this.chartOption) console.log('chartOptions', this.chartOption);
}); });
}, },