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

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

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