Commit 14e565a0 authored by erio's avatar erio
Browse files

fix(channel): 分组加载时序修复 — 预加载 + await 确保分组数据就绪

parent ce694701
...@@ -839,14 +839,14 @@ function resetForm() { ...@@ -839,14 +839,14 @@ function resetForm() {
showPlatformMenu.value = false showPlatformMenu.value = false
} }
function openCreateDialog() { async function openCreateDialog() {
editingChannel.value = null editingChannel.value = null
resetForm() resetForm()
loadGroups() await loadGroups()
showDialog.value = true showDialog.value = true
} }
function openEditDialog(channel: Channel) { async function openEditDialog(channel: Channel) {
editingChannel.value = channel editingChannel.value = channel
form.name = channel.name form.name = channel.name
form.description = channel.description || '' form.description = channel.description || ''
...@@ -854,9 +854,8 @@ function openEditDialog(channel: Channel) { ...@@ -854,9 +854,8 @@ function openEditDialog(channel: Channel) {
form.restrict_models = channel.restrict_models || false form.restrict_models = channel.restrict_models || false
form.billing_model_source = channel.billing_model_source || 'requested' form.billing_model_source = channel.billing_model_source || 'requested'
// Must load groups first so apiToForm can map groupID → platform // Must load groups first so apiToForm can map groupID → platform
loadGroups().then(() => { await loadGroups()
form.platforms = apiToForm(channel) form.platforms = apiToForm(channel)
})
showDialog.value = true showDialog.value = true
} }
...@@ -948,6 +947,7 @@ async function confirmDelete() { ...@@ -948,6 +947,7 @@ async function confirmDelete() {
// ── Lifecycle ── // ── Lifecycle ──
onMounted(() => { onMounted(() => {
loadChannels() loadChannels()
loadGroups()
}) })
onUnmounted(() => { onUnmounted(() => {
......
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