|
@@ -27,6 +27,7 @@
|
|
<slot name="header">
|
|
<slot name="header">
|
|
<base-weather class="weather" mode="text"></base-weather>
|
|
<base-weather class="weather" mode="text"></base-weather>
|
|
<time-now class="timeNow"></time-now>
|
|
<time-now class="timeNow"></time-now>
|
|
|
|
+ <SyncOutlined class="refresh" @click="refresh" />
|
|
<user-dropdown class="userDropdown"></user-dropdown>
|
|
<user-dropdown class="userDropdown"></user-dropdown>
|
|
</slot>
|
|
</slot>
|
|
</a-layout-header>
|
|
</a-layout-header>
|
|
@@ -76,13 +77,19 @@ import type { Route } from 'ant-design-vue/es/breadcrumb/Breadcrumb'
|
|
import mqtt, { MqttClient } from 'mqtt'
|
|
import mqtt, { MqttClient } from 'mqtt'
|
|
import { useUserStore } from '@/stores/user'
|
|
import { useUserStore } from '@/stores/user'
|
|
import AlertModal from './components/alertModal/index.vue'
|
|
import AlertModal from './components/alertModal/index.vue'
|
|
-import { ArrowLeftOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
|
+import { ArrowLeftOutlined, SyncOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
const userId = ref(userStore?.userInfo?.userId || '')
|
|
const userId = ref(userStore?.userInfo?.userId || '')
|
|
const version = __APP_VERSION__
|
|
const version = __APP_VERSION__
|
|
// const buildTime = __BUILD_TIME__
|
|
// const buildTime = __BUILD_TIME__
|
|
|
|
|
|
|
|
+const emit = defineEmits(['refresh'])
|
|
|
|
+// 刷新
|
|
|
|
+const refresh = () => {
|
|
|
|
+ emit('refresh')
|
|
|
|
+}
|
|
|
|
+
|
|
let mqttClient: MqttClient | null = null
|
|
let mqttClient: MqttClient | null = null
|
|
// let mqttTimeout: number | null = null
|
|
// let mqttTimeout: number | null = null
|
|
// const MQTT_TIMEOUT_MS = 10000 // 10秒
|
|
// const MQTT_TIMEOUT_MS = 10000 // 10秒
|
|
@@ -415,6 +422,12 @@ const backHandler = async () => {
|
|
position: sticky;
|
|
position: sticky;
|
|
top: 0;
|
|
top: 0;
|
|
z-index: 1000;
|
|
z-index: 1000;
|
|
|
|
+
|
|
|
|
+ .refresh {
|
|
|
|
+ margin-right: 14px;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.ant-layout-content {
|
|
.ant-layout-content {
|
|
margin: 16px;
|
|
margin: 16px;
|