Commit bb2189c0 authored by 谢章伟's avatar 谢章伟

安全质量大屏

parent 2e28047b
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<tbody> <tbody>
<tr v-for="(row, idx) in $props.rows" :key="idx" :style="{height: 100 / rows.length + '%'}"> <tr v-for="(row, idx) in $props.rows" :key="idx" :style="{height: 100 / rows.length + '%'}">
<td v-if="showIcon"><div class="col_number">{{ idx + 1 }}</div></td> <td v-if="showIcon"><div class="col_number">{{ idx + 1 }}</div></td>
<td class="winner_span" :style="columnsStyle['title']">{{ row.title }}</td> <td class="winner_span" :style="titleIndependentStyle?row.titleStyle:columnsStyle['title']">{{ row.title }}</td>
<td v-for="(col, idz) in row.column" :key="idz" :style="columnsStyle[col.key]"> <td v-for="(col, idz) in row.column" :key="idz" :style="columnsStyle[col.key]">
<p class="key_span">{{ col.key }}</p> <p class="key_span">{{ col.key }}</p>
<p class="value_span" :style="col.valStyle">{{colFormatter[''+idz]?colFormatter[''+idz](col.value):col.value }}</p> <p class="value_span" :style="col.valStyle">{{colFormatter[''+idz]?colFormatter[''+idz](col.value):col.value }}</p>
...@@ -23,6 +23,10 @@ export default { ...@@ -23,6 +23,10 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
titleIndependentStyle:{
type: Boolean,
default: false
},
columnsStyle:{ columnsStyle:{
type: Object, type: Object,
default: function () { default: function () {
...@@ -33,9 +37,9 @@ export default { ...@@ -33,9 +37,9 @@ export default {
type: Array, type: Array,
default:function(){ default:function(){
return [ return [
{title: '标题列', column: [{key: '字段', value: '0'}]}, {title: '标题列',titleStyle:{}, column: [{key: '字段', value: '0'}]},
{title: '标题列', column: [{key: '字段', value: '0'}]}, {title: '标题列',titleStyle:{}, column: [{key: '字段', value: '0'}]},
{title: '标题列', column: [{key: '字段', value: '0'}]} {title: '标题列',titleStyle:{}, column: [{key: '字段', value: '0'}]}
]; ];
} }
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="trade_left" style="width: 20%"> <div class="trade_left" style="width: 20%">
<div style="height: 37%;" > <div style="height: 37%;" >
<display-board style="height: 98%;" title="安全"> <display-board style="height: 98%;" title="安全">
<winners-list style="height: 96%;overflow: auto;" :mouseHand="true" id="safe_list" :rows="arSafeList"/> <winners-list style="height: 96%;overflow: auto;" :mouseHand="true" id="safe_list" :rows="arSafeList" :title-independent-style="true"/>
</display-board> </display-board>
</div> </div>
<div style="height: 37%;" > <div style="height: 37%;" >
...@@ -380,7 +380,15 @@ export default { ...@@ -380,7 +380,15 @@ export default {
if(safetyArray.length>0){ if(safetyArray.length>0){
safetyArray.forEach(function (row) { safetyArray.forEach(function (row) {
var item={}; var item={};
item.title=row; item.title=row.data;
if(row.type==='10'){
item.titleStyle=[{color:'yellow'}];
}else if(row.type==='20'){
item.titleStyle=[{color:'red'}];
}else{
item.titleStyle=[{color:'white'}];
}
safetyArr.push(item); safetyArr.push(item);
}); });
this.arSafeList=safetyArr; this.arSafeList=safetyArr;
...@@ -484,16 +492,25 @@ export default { ...@@ -484,16 +492,25 @@ export default {
seryCar.data.push(car[2]); seryCar.data.push(car[2]);
this.car_options.series=[]; this.car_options.series=[];
this.car_options.series.push(seryCar); this.car_options.series.push(seryCar);
// 最大高度
var maxDataCar = Math.max.apply(null, seryCar.data);
this.car_options.yAxis.max=maxDataCar*1.1;
this.car.setOption(this.car_options); this.car.setOption(this.car_options);
var seryShip=this.getcarShipTrainCss(); var seryShip=this.getcarShipTrainCss();
seryShip.data=ship; seryShip.data=ship;
this.ship_options.series=[]; this.ship_options.series=[];
this.ship_options.series.push(seryShip); this.ship_options.series.push(seryShip);
// 最大高度
var maxDataShip = Math.max.apply(null, seryShip.data);
this.ship_options.yAxis.max=maxDataShip*1.1;
this.ship.setOption(this.ship_options); this.ship.setOption(this.ship_options);
var seryTrain=this.getcarShipTrainCss(); var seryTrain=this.getcarShipTrainCss();
seryTrain.data=train; seryTrain.data=train;
this.train_options.series=[]; this.train_options.series=[];
this.train_options.series.push(seryTrain); this.train_options.series.push(seryTrain);
// 最大高度
var maxDataTrain = Math.max.apply(null, seryTrain.data);
this.train_options.yAxis.max=maxDataTrain*1.1;
this.train.setOption(this.train_options); this.train.setOption(this.train_options);
// 当班车数 // 当班车数
this.arCarSum[0].value=countToday.car; this.arCarSum[0].value=countToday.car;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment