【类 型】:feat topbar的刷新按钮 让esp向飞控刷新请求功能

【原  因】:
【过  程】:发布refreshRequest主题
【影  响】:
This commit is contained in:
tk 2024-07-26 23:51:31 +08:00
parent 0149d4be59
commit f98d53769e
2 changed files with 4 additions and 5 deletions

View File

@ -153,6 +153,7 @@ import Breadcrumb from '@/components/Breadcrumb'
import QuestTabs from '@/components/QuestTabs' import QuestTabs from '@/components/QuestTabs'
import SelectionShopId from '@/components/SelectionShopId' import SelectionShopId from '@/components/SelectionShopId'
import { speakText } from '@/utils/index' import { speakText } from '@/utils/index'
import mqtt from '@/utils/mqtt'
export default { export default {
name: 'Headbar', name: 'Headbar',
@ -305,7 +306,7 @@ export default {
* @description: 刷新当前页面 * @description: 刷新当前页面
*/ */
refreshPage () { refreshPage () {
/* init */ /* init 数据接口 */
this.$store.commit('app/setIsMobile') // this.$store.commit('app/setIsMobile') //
this.$store.dispatch('fetchAirList') // this.$store.dispatch('fetchAirList') //
this.$store.dispatch('fetchShopList') // this.$store.dispatch('fetchShopList') //
@ -314,6 +315,8 @@ export default {
this.$store.dispatch('fetchRouteList') // 线 this.$store.dispatch('fetchRouteList') // 线
this.$store.dispatch('fetchCategoryList') // this.$store.dispatch('fetchCategoryList') //
this.$store.dispatch('fetchPaidOrderList') // this.$store.dispatch('fetchPaidOrderList') //
/* 向飞发送 让飞控刷新各种请求 */
mqtt.publishFun(`cmd/${this.plane.macadd}`, '{"refreshRequest":1}')
}, },
/** /**
* @description: 登出 * @description: 登出

View File

@ -11,7 +11,6 @@
</template> </template>
<script> <script>
import mqtt from '@/utils/mqtt'
import MapBox from '@/components/MapBox' import MapBox from '@/components/MapBox'
import ControllerTabs from '@/components/ControllerTabs' import ControllerTabs from '@/components/ControllerTabs'
import BatteryStatus from '@/components/BatteryStatus' import BatteryStatus from '@/components/BatteryStatus'
@ -99,9 +98,6 @@ export default {
mounted () { mounted () {
if (this.plane) { if (this.plane) {
this.makePlane(this.plane) // this.makePlane(this.plane) //
if (!this.plane.planeState.battCapacity) {
mqtt.publishFun(`cmd/${this.plane.macadd}`, '{"getBattCapacity":1}')//
}
} }
}, },
watch: { watch: {