diff --git a/ui/src/components/mk-dynamics-form/constructor/visibility/index.vue b/ui/src/components/mk-dynamics-form/constructor/visibility/index.vue index 16119f6b045..1944a39cbed 100644 --- a/ui/src/components/mk-dynamics-form/constructor/visibility/index.vue +++ b/ui/src/components/mk-dynamics-form/constructor/visibility/index.vue @@ -43,7 +43,7 @@ function validate(): Promise { hasError = true } if (!cond.compare) { - cond._compareError = '请选择比较方式' + cond._compareError = '请选择' hasError = true } const isEmpty = Array.isArray(cond.value) ? cond.value.length === 0 : !cond.value && cond.value !== 0 diff --git a/ui/src/workflow-canvas/config/constants.ts b/ui/src/workflow-canvas/config/constants.ts index d61288b9fa4..3fc690a373f 100644 --- a/ui/src/workflow-canvas/config/constants.ts +++ b/ui/src/workflow-canvas/config/constants.ts @@ -22,4 +22,4 @@ export const compareList = [ { value: 'wildcard', label: '通配符匹配' }, ] -export const fileTooltip = JSON.stringify([{ name: 'File Name', url: './oss/file/019d8ac3-e2c6-7ff2-8956-c9c98f0e11f4', file_id: '019d8ac3-e2c6-7ff2-8956-c9c98f0e11f4' }], null, 2) +export const fileTooltip = `示例:\n${JSON.stringify([{ name: 'File Name', url: './oss/file/019d8ac3-e2c6-7ff2-8956-c9c98f0e11f4', file_id: '019d8ac3-e2c6-7ff2-8956-c9c98f0e11f4' }], null, 2)}` diff --git a/ui/src/workflow-canvas/nodes/ai-chat-node/index.vue b/ui/src/workflow-canvas/nodes/ai-chat-node/index.vue index 4360c7773ab..f4e17046b27 100644 --- a/ui/src/workflow-canvas/nodes/ai-chat-node/index.vue +++ b/ui/src/workflow-canvas/nodes/ai-chat-node/index.vue @@ -24,7 +24,6 @@ const model = getModel() const store = useWorkflowStore(apiType) const formRef = useTemplateRef('formRef') -const imageCascaderRef = useTemplateRef>('imageCascaderRef') const promptGenerateDialogRef = useTemplateRef>('promptGenerateDialogRef') const reasoningSettingDialogRef = useTemplateRef>('reasoningSettingDialogRef') @@ -132,11 +131,8 @@ function validateModel(_rule: unknown, _value: unknown, callback: (error?: Error callback(model_id ? undefined : new Error(model_id_type === 'default' ? '请在默认模型设置中选择 AI 模型' : '请选择 AI 模型')) } -function validate() { - // TODO 图片选择需要必填?为什么没有必填标记? - return Promise.all([formData.value.vision ? imageCascaderRef.value?.validate() : Promise.resolve(), formRef.value?.validate()]).catch((error) => - Promise.reject({ node: model, errMessage: error }), - ) +async function validate() { + return formRef.value?.validate().catch((error) => Promise.reject({ node: model, errMessage: error })) } onMounted(() => { diff --git a/ui/src/workflow-canvas/nodes/base-node/index.vue b/ui/src/workflow-canvas/nodes/base-node/index.vue index bd3396a01ca..03bc5818029 100644 --- a/ui/src/workflow-canvas/nodes/base-node/index.vue +++ b/ui/src/workflow-canvas/nodes/base-node/index.vue @@ -157,22 +157,6 @@ const providerOptions = ref([]) // 节点统一校验 function validate() { - // TODO v2没有标记必填 但是需要校验 需要核对一下 - if (formData.value.tts_model_enable && formData.value.tts_type === 'CUSTOM' && !formData.value.tts_model_id) { - return Promise.reject({ node: model, errMessage: '请选择语音播放模型' }) - } - if (formData.value.tts_model_enable && formData.value.tts_type === 'DEFAULT' && !defaultTtsModelSetting.value?.model_id) { - return Promise.reject({ node: model, errMessage: '请在默认模型设置中选择语音合成模型' }) - } - if (formData.value.stt_model_enable && formData.value.stt_model_id_type === 'custom' && !formData.value.stt_model_id) { - return Promise.reject({ node: model, errMessage: '请选择语音输入模型' }) - } - if (formData.value.stt_model_enable && formData.value.stt_model_id_type === 'default' && !defaultSttModelSetting.value?.model_id) { - return Promise.reject({ node: model, errMessage: '请在默认模型设置中选择语音识别模型' }) - } - if (formData.value.long_term_enable && formData.value.long_term_model_id_type === 'custom' && !formData.value.long_term_model_id) { - return Promise.reject({ node: model, errMessage: '请选择长期记忆模型' }) - } return Promise.all([validateUserFieldReferences(), formRef.value?.validate()]).catch((error) => Promise.reject({ node: model, errMessage: error })) } @@ -211,40 +195,58 @@ onMounted(() => { -
- - 长期记忆 - - - - - - - - - - - -
+ + + + + + + + @@ -261,13 +263,31 @@ onMounted(() => {
- 语音输入 + 语音输入 自动发送
- + 默认模型 自定义 @@ -293,14 +313,32 @@ onMounted(() => {
- 语音播放 + 语音播放 自动播放
- + 浏览器播放(免费) 默认模型 diff --git a/ui/src/workflow-canvas/nodes/condition-node/index.vue b/ui/src/workflow-canvas/nodes/condition-node/index.vue index b96e117ba63..70787102510 100644 --- a/ui/src/workflow-canvas/nodes/condition-node/index.vue +++ b/ui/src/workflow-canvas/nodes/condition-node/index.vue @@ -52,11 +52,6 @@ const formData = computed(() => model.properties.node_data as { branch: BranchIt const conditionNodeFormRef = useTemplateRef('conditionNodeFormRef') const nodeCascaderRefs = useTemplateRef[]>('nodeCascaderRefs') -function validate() { - return Promise.all([conditionNodeFormRef.value?.validate(), ...(nodeCascaderRefs.value ?? []).map((cascader) => cascader.validate())]).catch( - (error) => Promise.reject({ node: model, errMessage: error }), - ) -} // 新分支插入 ELSE 之前,并保留稳定的锚点 ID。 function addBranch() { @@ -103,6 +98,14 @@ const vBranchResize: Directive = { }, } + +async function validate() { + return conditionNodeFormRef.value?.validate().catch( + (error) => Promise.reject({ node: model, errMessage: error }), + ) +} + + const anchorGuard = createAnchorGuard(model) onMounted(() => { model.validate = validate @@ -153,12 +156,12 @@ onBeforeUnmount(() => { + dialogue_type: 'NODE' | 'WORKFLOW' } const formRef = useTemplateRef('formRef') @@ -46,6 +47,7 @@ const defaultForm: QuestionNodeForm = { dialogue_number: 1, is_result: false, model_params_setting: {}, + dialogue_type: 'NODE', } const savedForm = model.properties.node_data as Partial | undefined model.properties.node_data = { @@ -57,6 +59,7 @@ model.properties.node_data = { system: savedForm?.system ?? defaultForm.system, prompt: savedForm?.prompt ?? defaultForm.prompt, dialogue_number: savedForm?.dialogue_number ?? defaultForm.dialogue_number, + dialogue_type: savedForm?.dialogue_type ?? defaultForm.dialogue_type, is_result: savedForm ? savedForm.is_result : defaultForm.is_result, } @@ -198,7 +201,16 @@ onMounted(() => { - + +