mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix(models): 模型创建对话框支持连续添加
创建模式下提交后保持对话框打开,方便批量添加模型; 编辑模式提交后仍正常关闭对话框。按钮文案调整为"添加"。
This commit is contained in:
@@ -338,7 +338,7 @@
|
||||
v-if="submitting"
|
||||
class="w-4 h-4 mr-2 animate-spin"
|
||||
/>
|
||||
{{ isEditMode ? '保存' : '创建' }}
|
||||
{{ isEditMode ? '保存' : '添加' }}
|
||||
</Button>
|
||||
<Button
|
||||
v-if="selectedModel && !isEditMode"
|
||||
@@ -859,6 +859,9 @@ async function handleSubmit() {
|
||||
}
|
||||
await createGlobalModel(createData)
|
||||
success('模型创建成功')
|
||||
clearSelection()
|
||||
emit('success')
|
||||
return
|
||||
}
|
||||
emit('update:open', false)
|
||||
emit('success')
|
||||
|
||||
@@ -1165,8 +1165,11 @@ function handleModelDialogUpdate(value: boolean) {
|
||||
|
||||
// 处理模型表单提交成功
|
||||
async function handleModelFormSuccess() {
|
||||
createModelDialogOpen.value = false
|
||||
editingModel.value = null
|
||||
// 编辑模式关闭对话框,创建模式保持打开以便连续添加
|
||||
if (editingModel.value) {
|
||||
createModelDialogOpen.value = false
|
||||
editingModel.value = null
|
||||
}
|
||||
await loadGlobalModels()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user