Commit fc750fe1 authored by 李玲燕's avatar 李玲燕

增加左下角消息置顶

parent 833874f9
......@@ -7,8 +7,8 @@ set (CMAKE_CXX_STANDARD 11)
# Version.
set (MAJOR_VERSION "1")
set (MINOR_VERSION "2")
set (PATCH_VERSION "9")
set (MINOR_VERSION "3")
set (PATCH_VERSION "0")
# Import cmake modules.
list (APPEND CMAKE_MODULE_PATH "$ENV{HT_BUILDSYS_CMAKE_MODULES}")
......
......@@ -19,6 +19,7 @@ const TOPIC_CLASS = {
'/vehicle/errorCode', // 车辆故障码信息
'/vehicle/pairinfo', // 车辆配对信息
'/info/commandInfo', // 车辆提示信息(左下角)
'/info/commandTopInfo', // 车辆提示信息(顶部)
'/info/tipInfo', // 车辆弹框提示信息
'/vehicle/paraminfo', // 车辆全局参数信息
'/command/debugack', //
......
......@@ -13,6 +13,7 @@ export const useVehicleStore = defineStore('vehicle', {
vehicleErrorList: [],
pairinfo: {}, // 车辆关系配对表
commandInfo: null, // 车辆提示信息(左下角)
commandTopInfo: null, // 车辆提示信息(顶部)
tipInfo: null, // 车辆弹框信息
paraminfo: {}, // 车辆全局参数信息
debugack: null, // debug
......@@ -56,6 +57,9 @@ export const useVehicleStore = defineStore('vehicle', {
getCommand() {
return this.commandInfo
},
getCommandTop() {
return this.commandTopInfo
},
getPositionInfo() {
return this.positioninfo
},
......
<template>
<div class="information-box">
<ul>
<li class="top" v-for="item in topList" :key="item.index">{{ item }}</li>
<li v-for="item in list" :key="item.index">{{ item }}</li>
</ul>
</div>
......@@ -12,12 +13,23 @@
import { storeToRefs } from 'pinia';
let data = reactive({
topList: [],
list: []
})
const { list } = toRefs(data)
const { topList, list } = toRefs(data)
const vehicleStore = useVehicleStore()
const vehicleStoreToRefs = storeToRefs(vehicleStore)
const { getCommand } = vehicleStoreToRefs
const { getCommand, getCommandTop } = vehicleStoreToRefs
watch (getCommandTop, (value) => {
if (typeof value === 'string') {
data.topList.unshift(value)
} else {
data.topList = JSON.parse(JSON.stringify(value)).reverse()
}
}, {
deep: true
})
watch(getCommand, (value) => {
if (typeof value === 'string') {
......@@ -49,6 +61,9 @@
li:nth-child(1) {
color: #02d9df;
}
.top {
color: #edaa57;
}
}
}
@media screen and (min-width: 1700px) {
......
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