修改卡片因为数据的问题, 高度变化

This commit is contained in:
peak.jiang 2023-11-12 15:21:19 +08:00
parent 8c0293e3a1
commit 32809e9e37
2 changed files with 20 additions and 6 deletions

View File

@ -96,6 +96,7 @@ export default {
methods: {
drawLine(newVal, title, timeMode) {
// console.log('newVal == ', newVal)
let myChart = this.$echarts.getInstanceByDom(this.$refs.lineChart);
if (myChart == null) {
myChart = this.$echarts.init(this.$refs.lineChart);
@ -277,7 +278,7 @@ export default {
if (val.speed == -1) {
return '-';
}
return val.speed;
return Math.abs(val.speed);
});
} else if (title === '流量') {
this.name = '辆';

View File

@ -52,7 +52,7 @@
</el-card>
</div>
</div>
<el-card v-show="echartArr.includes('数值')" style="width: 150px; margin-bottom: 20px; text-align: center">
<el-card v-show="echartArr.includes('数值')" class="spacialCard">
<div v-if="cycleAccumulateDataArr && cycleAccumulateDataArr.length > 0">
<div v-if="title == '类型'">
<span style="font-size: 15px">类型数量总和</span><br />
@ -154,12 +154,12 @@
<span style="font-size: 15px">速度</span><br />
<!-- <span style="font-size: 30px; font-weight: bold">{{ typeValue.speed }}</span> -->
<div style="font-size: 30px; font-weight: bold">
<span style="font-size: 30px; font-weight: bold">
<span v-if="(newDataArr[0].speed && newDataArr[0].speed != -1) || newDataArr[0].speed === 0">
{{ Math.abs(newDataArr[0].speed) }}
</span>
<span v-else> - </span>
</div>
</span>
<span style="font-size: 20px; font-weight: 200">
<span v-if="(newDataArr[0].speed && newDataArr[0].speed != -1) || newDataArr[0].speed === 0">
{{ newDataArr[0].speed > 0 || newDataArr[0].speed === 0 ? 'km/h' : 'pix/s' }}
@ -208,8 +208,10 @@
<span style="font-size: 20px; font-weight: 200"></span>
</div>
<div>
<div>
{{ newDataArr[0].time ? newDataArr[0].time : '' }}
<div v-if="newDataArr[0].time">
<!-- {{ newDataArr[0].time ? newDataArr[0].time : '' }} -->
<div>{{newDataArr[0].time.slice(0, 11)}}</div>
<div>{{newDataArr[0].time.slice(11)}}</div>
</div>
</div>
</div>
@ -521,6 +523,17 @@ export default {
};
</script>
<style scoped>
.spacialCard {
width: 150px;
margin-bottom: 20px;
text-align: center;
}
::v-deep.spacialCard .el-card__body{
padding: 10px;
}
.tableTitle {
background: #f7f8fa;
margin-bottom: 5px;