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

增加左下角消息置顶

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