diff --git a/ui/src/views/workflow/components/default-model-setting/DefaultModelSettingDrawer.vue b/ui/src/views/workflow/components/default-model-setting/DefaultModelSettingDrawer.vue
index 16a2d9c6a82..d10ccf5b040 100644
--- a/ui/src/views/workflow/components/default-model-setting/DefaultModelSettingDrawer.vue
+++ b/ui/src/views/workflow/components/default-model-setting/DefaultModelSettingDrawer.vue
@@ -176,15 +176,6 @@ function handleClosed() {
emit('closed')
}
-function resetData() {
- savedSettings.value = {}
- modelSettings.value = normalizeSettings({})
- models.value = []
- providerOptions.value = []
- loading.value = false
- applying.value = false
-}
-
function handleBeforeClose(
done = () => {
visible.value = false
@@ -207,6 +198,14 @@ function handleBeforeClose(
if (action === 'cancel') done()
})
}
+function resetData() {
+ savedSettings.value = {}
+ modelSettings.value = normalizeSettings({})
+ models.value = []
+ providerOptions.value = []
+ loading.value = false
+ applying.value = false
+}
defineExpose({ open })
@@ -217,6 +216,7 @@ defineExpose({ open })
size="420"
class="top-header! h-layout-content! max-w-full rounded-tl-xl!"
:modal="false"
+ modal-penetrable
:lock-scroll="false"
:before-close="handleBeforeClose"
@closed="handleClosed"
diff --git a/ui/src/views/workflow/components/publish-history/ButtonPublishHistory.vue b/ui/src/views/workflow/components/publish-history/ButtonPublishHistory.vue
deleted file mode 100644
index 53ecf46450f..00000000000
--- a/ui/src/views/workflow/components/publish-history/ButtonPublishHistory.vue
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
- 发布历史
-
-
-
-
-
-
diff --git a/ui/src/views/workflow/components/publish-history/DescriptionDialog.vue b/ui/src/views/workflow/components/publish-history/DescriptionDialog.vue
new file mode 100644
index 00000000000..6062c2f4e56
--- /dev/null
+++ b/ui/src/views/workflow/components/publish-history/DescriptionDialog.vue
@@ -0,0 +1,23 @@
+
+
+
+
+ {{ description || '暂无更新说明' }}
+
+
+
+
diff --git a/ui/src/views/workflow/components/publish-history/EditPublishVersionDialog.vue b/ui/src/views/workflow/components/publish-history/EditPublishVersionDialog.vue
index f034304f237..a8a995c488c 100644
--- a/ui/src/views/workflow/components/publish-history/EditPublishVersionDialog.vue
+++ b/ui/src/views/workflow/components/publish-history/EditPublishVersionDialog.vue
@@ -2,95 +2,61 @@
import { reactive, ref, useTemplateRef } from 'vue'
import type { FormInstance, FormRules } from 'element-plus'
import type { WorkflowVersion, WorkflowVersionPayload } from '@/api/types'
-import type WorkflowVersionApi from '@/api/admin/workspace/application/workflow-version'
import { datetimeFormat } from '@/utils/time'
-import { MsgSuccess } from '@/utils/message'
defineOptions({ name: 'EditPublishVersionDialog' })
-const props = defineProps<{ resourceId: string; api: typeof WorkflowVersionApi }>()
-const emit = defineEmits<{ saved: [version: WorkflowVersion] }>()
+const props = defineProps<{ saving?: boolean }>()
+const emit = defineEmits<{ submit: [payload: WorkflowVersionPayload] }>()
const visible = ref(false)
-const saving = ref(false)
-const versionId = ref('')
const versionForm = reactive
({ name: '', description: '' })
const formRef = useTemplateRef('formRef')
const rules: FormRules = {
- name: [
- { required: true, whitespace: true, message: '请输入标题', trigger: 'blur' },
- { max: 64, message: '标题最多 64 个字符', trigger: 'blur' },
- ],
- description: [{ max: 1000, message: '更新说明最多 1000 个字符', trigger: 'blur' }],
+ name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
}
-/* 版本编辑:只保存副本,接口成功后通知历史列表更新。 */
+/* 编辑副本并校验,接口提交和成功关闭由业务组件处理。 */
function open(version: WorkflowVersion) {
- versionId.value = version.id
versionForm.name = version.name || datetimeFormat(version.create_time)
versionForm.description = version.description ?? ''
visible.value = true
}
function handleSubmit() {
- if (saving.value) return
+ if (props.saving) return
formRef.value?.validate((valid) => {
- if (!valid) return
- saving.value = true
- return props.api
- .putWorkflowVersion(props.resourceId, versionId.value, {
- name: versionForm.name.trim(),
- description: versionForm.description,
- })
- .then((version) => {
- emit('saved', version)
- visible.value = false
- MsgSuccess('修改成功')
- })
- .finally(() => {
- saving.value = false
- })
+ if (!valid || props.saving) return
+ emit('submit', { name: versionForm.name.trim(), description: versionForm.description })
})
}
-function handleClose(done: () => void) {
- if (!saving.value) done()
+function close() {
+ visible.value = false
}
function resetForm() {
- versionId.value = ''
versionForm.name = ''
versionForm.description = ''
formRef.value?.clearValidate()
}
-defineExpose({ open })
+defineExpose({ open, close })
-
+
-
+
-
+
@@ -103,10 +69,4 @@ defineExpose({ open })
-
+
diff --git a/ui/src/views/workflow/components/publish-history/PublishHistory.vue b/ui/src/views/workflow/components/publish-history/PublishHistory.vue
deleted file mode 100644
index b71be5619ee..00000000000
--- a/ui/src/views/workflow/components/publish-history/PublishHistory.vue
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
diff --git a/ui/src/views/workflow/components/publish-history/PublishHistoryDrawer.vue b/ui/src/views/workflow/components/publish-history/PublishHistoryDrawer.vue
new file mode 100644
index 00000000000..a36b63b9e40
--- /dev/null
+++ b/ui/src/views/workflow/components/publish-history/PublishHistoryDrawer.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/views/workflow/components/publish-history/UpdateDescriptionDialog.vue b/ui/src/views/workflow/components/publish-history/UpdateDescriptionDialog.vue
deleted file mode 100644
index f6eee3df48e..00000000000
--- a/ui/src/views/workflow/components/publish-history/UpdateDescriptionDialog.vue
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
- {{ description || '暂无更新说明' }}
-
-
-
-