feat(dashboard): 首页应用下载新增数据大屏(Android TV)直接下载入口
This commit is contained in:
parent
ac66dce6cf
commit
a38529fa29
@ -7,6 +7,26 @@
|
||||
</template>
|
||||
|
||||
<div class="app-list">
|
||||
<!-- 数据大屏 APK(Android TV,直接下载、不做二维码) -->
|
||||
<div class="app-item" v-loading="loadingTv">
|
||||
<div class="app-icon">
|
||||
<el-icon :size="40" color="#409eff"><DataBoard /></el-icon>
|
||||
</div>
|
||||
<div class="app-info">
|
||||
<div class="app-name">数据大屏 (Android TV)</div>
|
||||
<div class="app-version" v-if="tvData">V {{ tvData.version }}</div>
|
||||
<div class="app-date" v-if="tvData">{{ formatDate(tvData.publishedAtUtc) }}</div>
|
||||
<div class="app-error" v-if="tvError">获取版本信息失败</div>
|
||||
</div>
|
||||
<div class="app-action">
|
||||
<el-button type="primary" size="small" :disabled="!tvData?.url" @click="download(tvData?.url)">
|
||||
下载
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-divider border-style="dashed" />
|
||||
|
||||
<!-- PDA APP -->
|
||||
<div class="app-item" v-loading="loadingPda">
|
||||
<div class="app-icon">
|
||||
@ -111,7 +131,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, nextTick } from 'vue'
|
||||
import { Cellphone, Monitor, Iphone } from '@element-plus/icons-vue'
|
||||
import { Cellphone, DataBoard, Monitor, Iphone } from '@element-plus/icons-vue'
|
||||
import dayjs from 'dayjs'
|
||||
import axios from 'axios'
|
||||
import QRCode from 'qrcode'
|
||||
@ -156,15 +176,19 @@ const pdaData = ref<PdaVersionInfo | null>(null)
|
||||
const printData = ref<PrintServerVersionInfo | null>(null)
|
||||
const androidData = ref<WorkerStationVersionInfo | null>(null)
|
||||
const windowsData = ref<WorkerStationVersionInfo | null>(null)
|
||||
/** 数据大屏(Android TV)版本信息,字段同 worker_station 的 latest.json */
|
||||
const tvData = ref<WorkerStationVersionInfo | null>(null)
|
||||
|
||||
const loadingPda = ref(true)
|
||||
const loadingPrint = ref(true)
|
||||
const loadingAndroid = ref(true)
|
||||
const loadingWindows = ref(true)
|
||||
const loadingTv = ref(true)
|
||||
const pdaError = ref(false)
|
||||
const printError = ref(false)
|
||||
const androidError = ref(false)
|
||||
const windowsError = ref(false)
|
||||
const tvError = ref(false)
|
||||
|
||||
const qrCodeVisible = ref(false)
|
||||
/** 二维码弹窗标题 / 目标地址(PDA、安卓工作台共用) */
|
||||
@ -271,6 +295,25 @@ const fetchWindowsInfo = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
/** 数据大屏(Android TV APK)版本信息 */
|
||||
const fetchTvInfo = async () => {
|
||||
try {
|
||||
loadingTv.value = true
|
||||
tvError.value = false
|
||||
const response = await axios.get('https://dl.wms.gztbyc.com/data_tv/latest.json', {
|
||||
params: { timestamp: new Date().getTime() }
|
||||
})
|
||||
if (response.data) {
|
||||
tvData.value = response.data
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch Data TV version info', error)
|
||||
tvError.value = true
|
||||
} finally {
|
||||
loadingTv.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const download = (url?: string) => {
|
||||
if (url) {
|
||||
window.open(url, '_blank')
|
||||
@ -278,6 +321,7 @@ const download = (url?: string) => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchTvInfo()
|
||||
fetchPdaInfo()
|
||||
fetchPrintServerInfo()
|
||||
fetchAndroidInfo()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user