feat(Home): 添加初始化完成状态控制头部标题显示 Fix #91
This commit is contained in:
@@ -10,6 +10,7 @@ interface Props {
|
|||||||
topTitle: string
|
topTitle: string
|
||||||
tableData: any[]
|
tableData: any[]
|
||||||
setDefaultPersonList: () => void
|
setDefaultPersonList: () => void
|
||||||
|
isInitialDone: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
@@ -26,7 +27,7 @@ const { t } = useI18n()
|
|||||||
>
|
>
|
||||||
{{ topTitle }}
|
{{ topTitle }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="flex gap-3">
|
<div v-if="isInitialDone" class="flex gap-3">
|
||||||
<button
|
<button
|
||||||
v-if="tableData.length <= 0" class="cursor-pointer btn btn-outline btn-secondary btn-lg"
|
v-if="tableData.length <= 0" class="cursor-pointer btn btn-outline btn-secondary btn-lg"
|
||||||
@click="router.push('config')"
|
@click="router.push('config')"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { useViewModel } from './useViewModel'
|
|||||||
import 'vue-toast-notification/dist/theme-sugar.css'
|
import 'vue-toast-notification/dist/theme-sugar.css'
|
||||||
|
|
||||||
const viewModel = useViewModel()
|
const viewModel = useViewModel()
|
||||||
const { setDefaultPersonList, tableData, currentStatus, enterLottery, stopLottery, containerRef, startLottery, continueLottery, quitLottery } = viewModel
|
const { setDefaultPersonList, tableData, currentStatus, enterLottery, stopLottery, containerRef, startLottery, continueLottery, quitLottery, isInitialDone } = viewModel
|
||||||
const globalConfig = useStore().globalConfig
|
const globalConfig = useStore().globalConfig
|
||||||
|
|
||||||
const { getTopTitle: topTitle, getTextColor: textColor, getTextSize: textSize, getBackground: homeBackground } = storeToRefs(globalConfig)
|
const { getTopTitle: topTitle, getTextColor: textColor, getTextSize: textSize, getBackground: homeBackground } = storeToRefs(globalConfig)
|
||||||
@@ -22,6 +22,7 @@ const { getTopTitle: topTitle, getTextColor: textColor, getTextSize: textSize, g
|
|||||||
:text-color="textColor"
|
:text-color="textColor"
|
||||||
:top-title="topTitle"
|
:top-title="topTitle"
|
||||||
:set-default-person-list="setDefaultPersonList"
|
:set-default-person-list="setDefaultPersonList"
|
||||||
|
:is-initial-done="isInitialDone"
|
||||||
/>
|
/>
|
||||||
<div id="container" ref="containerRef" class="3dContainer">
|
<div id="container" ref="containerRef" class="3dContainer">
|
||||||
<OptionButton
|
<OptionButton
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export function useViewModel() {
|
|||||||
const luckyCount = ref(10)
|
const luckyCount = ref(10)
|
||||||
const personPool = ref<IPersonConfig[]>([])
|
const personPool = ref<IPersonConfig[]>([])
|
||||||
const intervalTimer = ref<any>(null)
|
const intervalTimer = ref<any>(null)
|
||||||
|
const isInitialDone = ref<boolean>(false)
|
||||||
|
|
||||||
function initThreeJs() {
|
function initThreeJs() {
|
||||||
const felidView = 40
|
const felidView = 40
|
||||||
@@ -597,6 +598,7 @@ export function useViewModel() {
|
|||||||
containerRef.value!.style.color = `${textColor}`
|
containerRef.value!.style.color = `${textColor}`
|
||||||
randomBallData()
|
randomBallData()
|
||||||
window.addEventListener('keydown', listenKeyboard)
|
window.addEventListener('keydown', listenKeyboard)
|
||||||
|
isInitialDone.value = true
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log('等待人员列表数据...')
|
console.log('等待人员列表数据...')
|
||||||
@@ -634,5 +636,6 @@ export function useViewModel() {
|
|||||||
enterLottery,
|
enterLottery,
|
||||||
tableData,
|
tableData,
|
||||||
currentStatus,
|
currentStatus,
|
||||||
|
isInitialDone,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user