|
@@ -8,7 +8,7 @@
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" style="width: 200px; margin-right: 10px">
|
|
value-format="yyyy-MM-dd HH:mm:ss" style="width: 200px; margin-right: 10px">
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
<el-button type="primary" icon="el-icon-refresh" @click="refreshData">刷新</el-button>
|
|
<el-button type="primary" icon="el-icon-refresh" @click="refreshData">刷新</el-button>
|
|
|
- <el-checkbox v-model="autoRefresh" style="margin-left: 10px">自动刷新</el-checkbox>
|
|
|
|
|
|
|
+ <!-- <el-checkbox v-model="autoRefresh" style="margin-left: 10px">自动刷新</el-checkbox> -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -21,23 +21,16 @@
|
|
|
<h3>指标分类数据获取情况</h3>
|
|
<h3>指标分类数据获取情况</h3>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-body">
|
|
<div class="card-body">
|
|
|
- <el-tabs v-model="activeCategoryTab" @tab-click="handleTabClick">
|
|
|
|
|
- <el-tab-pane label="内容类" name="content">
|
|
|
|
|
- <div class="chart-wrapper">
|
|
|
|
|
- <div ref="contentChart"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tab-pane>
|
|
|
|
|
- <el-tab-pane label="阈值类" name="threshold">
|
|
|
|
|
- <div class="chart-wrapper">
|
|
|
|
|
- <div ref="thresholdChart"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tab-pane>
|
|
|
|
|
- <el-tab-pane label="存在性" name="existence">
|
|
|
|
|
- <div class="chart-wrapper">
|
|
|
|
|
- <div ref="existenceChart"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tab-pane>
|
|
|
|
|
- </el-tabs>
|
|
|
|
|
|
|
+ <div class="category-charts-container">
|
|
|
|
|
+ <div class="chart-item">
|
|
|
|
|
+ <div ref="contentChart" class="chart"></div>
|
|
|
|
|
+ <div class="chart-title">内容类</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="chart-item">
|
|
|
|
|
+ <div ref="thresholdChart" class="chart"></div>
|
|
|
|
|
+ <div class="chart-title">阈值类</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -129,7 +122,7 @@ import { getRealTimeAlarm, getAlarmDashboard } from '@/api/newApi/driving'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- currentDate: new Date().toISOString().slice(0, 19).replace('T', ' '),
|
|
|
|
|
|
|
+ currentDate: new Date(),
|
|
|
autoRefresh: false,
|
|
autoRefresh: false,
|
|
|
refreshInterval: null,
|
|
refreshInterval: null,
|
|
|
activeCategoryTab: 'content',
|
|
activeCategoryTab: 'content',
|
|
@@ -259,8 +252,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
initCategoryCharts() {
|
|
initCategoryCharts() {
|
|
|
- // 初始化当前激活的选项卡对应的图表
|
|
|
|
|
- this.initCategoryChart(this.activeCategoryTab)
|
|
|
|
|
|
|
+ // 同时初始化内容类和阈值类图表
|
|
|
|
|
+ this.initCategoryChart('content')
|
|
|
|
|
+ this.initCategoryChart('threshold')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
initDistributionChart() {
|
|
initDistributionChart() {
|
|
@@ -350,6 +344,7 @@ export default {
|
|
|
legend: {
|
|
legend: {
|
|
|
data: Object.keys(this.alarmTrend)
|
|
data: Object.keys(this.alarmTrend)
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
grid: {
|
|
grid: {
|
|
|
left: '3%',
|
|
left: '3%',
|
|
|
right: '4%',
|
|
right: '4%',
|
|
@@ -368,6 +363,15 @@ export default {
|
|
|
type: 'value'
|
|
type: 'value'
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
|
|
+ // dataZoom: [
|
|
|
|
|
+ // {
|
|
|
|
|
+ // type: 'slider',
|
|
|
|
|
+ // orient: 'horizontal',
|
|
|
|
|
+ // xAxisIndex: 0,
|
|
|
|
|
+ // start: 0,
|
|
|
|
|
+ // end: 50
|
|
|
|
|
+ // }
|
|
|
|
|
+ // ],
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
|
name: '内容类',
|
|
name: '内容类',
|
|
@@ -469,6 +473,15 @@ export default {
|
|
|
type: 'value'
|
|
type: 'value'
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
|
|
+ dataZoom: [
|
|
|
|
|
+ {
|
|
|
|
|
+ type: 'slider',
|
|
|
|
|
+ orient: 'horizontal',
|
|
|
|
|
+ xAxisIndex: 0,
|
|
|
|
|
+ start: 0,
|
|
|
|
|
+ end: 50
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
|
name: '内容类',
|
|
name: '内容类',
|
|
@@ -570,9 +583,15 @@ export default {
|
|
|
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
|
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- orient: 'vertical',
|
|
|
|
|
- left: 10,
|
|
|
|
|
- data: ['正常', '无数据', '未配置']
|
|
|
|
|
|
|
+ orient: 'horizontal',
|
|
|
|
|
+ bottom: 0,
|
|
|
|
|
+ data: ['正常', '无数据', '未配置'],
|
|
|
|
|
+ width: '100%',
|
|
|
|
|
+ itemWidth: 10,
|
|
|
|
|
+ itemHeight: 10,
|
|
|
|
|
+ textStyle: {
|
|
|
|
|
+ fontSize: 12
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
@@ -581,31 +600,28 @@ export default {
|
|
|
radius: ['40%', '70%'],
|
|
radius: ['40%', '70%'],
|
|
|
avoidLabelOverlap: false,
|
|
avoidLabelOverlap: false,
|
|
|
itemStyle: {
|
|
itemStyle: {
|
|
|
- borderRadius: 10,
|
|
|
|
|
|
|
+ borderRadius: 0,
|
|
|
borderColor: '#fff',
|
|
borderColor: '#fff',
|
|
|
- borderWidth: 2
|
|
|
|
|
|
|
+ borderWidth: 0
|
|
|
},
|
|
},
|
|
|
label: {
|
|
label: {
|
|
|
- show: false,
|
|
|
|
|
- position: 'center'
|
|
|
|
|
|
|
+ show: false
|
|
|
},
|
|
},
|
|
|
emphasis: {
|
|
emphasis: {
|
|
|
label: {
|
|
label: {
|
|
|
- show: true,
|
|
|
|
|
- fontSize: '18',
|
|
|
|
|
- fontWeight: 'bold'
|
|
|
|
|
|
|
+ show: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
labelLine: {
|
|
labelLine: {
|
|
|
show: false
|
|
show: false
|
|
|
},
|
|
},
|
|
|
data:
|
|
data:
|
|
|
- // this.indicatorStatus['内容类']
|
|
|
|
|
- [
|
|
|
|
|
- { value: 15, name: '正常' },
|
|
|
|
|
- { value: 3, name: '无数据' },
|
|
|
|
|
- { value: 2, name: '未配置' }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ this.indicatorStatus['内容类'] || [
|
|
|
|
|
+ { value: 3, name: '正常' },
|
|
|
|
|
+ { value: 1, name: '无数据' },
|
|
|
|
|
+ { value: 4, name: '未配置' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ color: ['#F44336', '#BDBDBD', '#8BC34A']
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
@@ -616,9 +632,15 @@ export default {
|
|
|
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
|
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- orient: 'vertical',
|
|
|
|
|
- left: 10,
|
|
|
|
|
- data: ['正常', '无数据', '未配置']
|
|
|
|
|
|
|
+ orient: 'horizontal',
|
|
|
|
|
+ bottom: 0,
|
|
|
|
|
+ data: ['正常', '无数据', '未配置'],
|
|
|
|
|
+ width: '100%',
|
|
|
|
|
+ itemWidth: 10,
|
|
|
|
|
+ itemHeight: 10,
|
|
|
|
|
+ textStyle: {
|
|
|
|
|
+ fontSize: 12
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
@@ -627,25 +649,29 @@ export default {
|
|
|
radius: ['40%', '70%'],
|
|
radius: ['40%', '70%'],
|
|
|
avoidLabelOverlap: false,
|
|
avoidLabelOverlap: false,
|
|
|
itemStyle: {
|
|
itemStyle: {
|
|
|
- borderRadius: 10,
|
|
|
|
|
|
|
+ borderRadius: 0,
|
|
|
borderColor: '#fff',
|
|
borderColor: '#fff',
|
|
|
- borderWidth: 2
|
|
|
|
|
|
|
+ borderWidth: 0
|
|
|
},
|
|
},
|
|
|
label: {
|
|
label: {
|
|
|
- show: false,
|
|
|
|
|
- position: 'center'
|
|
|
|
|
|
|
+ show: false
|
|
|
},
|
|
},
|
|
|
emphasis: {
|
|
emphasis: {
|
|
|
label: {
|
|
label: {
|
|
|
- show: true,
|
|
|
|
|
- fontSize: '18',
|
|
|
|
|
- fontWeight: 'bold'
|
|
|
|
|
|
|
+ show: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
labelLine: {
|
|
labelLine: {
|
|
|
show: false
|
|
show: false
|
|
|
},
|
|
},
|
|
|
- data: this.indicatorStatus['阈值类']
|
|
|
|
|
|
|
+ data:
|
|
|
|
|
+ this.indicatorStatus['阈值类'] || [
|
|
|
|
|
+ { value: 4, name: '正常' },
|
|
|
|
|
+ { value: 0, name: '无数据' },
|
|
|
|
|
+ { value: 6, name: '未配置' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ color: ['#F44336', '#BDBDBD', '#8BC34A']
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
@@ -812,6 +838,35 @@ export default {
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
min-width: 0;
|
|
min-width: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.category-charts-container {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 20px;
|
|
|
|
|
+ padding: 10px;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ min-height: 250px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.chart-item {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.chart {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ min-height: 200px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.chart-title {
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #333;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
}
|
|
}
|