diff --git a/ui/src/locales/lang/en-US/views/function-lib.ts b/ui/src/locales/lang/en-US/views/function-lib.ts index 1ca7103b3..05f5f60a8 100644 --- a/ui/src/locales/lang/en-US/views/function-lib.ts +++ b/ui/src/locales/lang/en-US/views/function-lib.ts @@ -33,6 +33,7 @@ export default { form: { functionName: { label: 'Name', + name: 'Function Name', placeholder: 'Please enter the function name', requiredMessage: 'Please enter the function name' }, diff --git a/ui/src/locales/lang/zh-CN/views/function-lib.ts b/ui/src/locales/lang/zh-CN/views/function-lib.ts index b0767b644..573d7b57e 100644 --- a/ui/src/locales/lang/zh-CN/views/function-lib.ts +++ b/ui/src/locales/lang/zh-CN/views/function-lib.ts @@ -31,6 +31,7 @@ export default { form: { functionName: { label: '名称', + name: '函数名称', placeholder: '请输入函数名称', requiredMessage: '请输入函数名称' }, @@ -63,7 +64,7 @@ export default { paramInfo2: '使用函数时不显示', code: '函数内容(Python)', selectPlaceholder: '请选择参数', - inputPlaceholder: '请输入参数值', + inputPlaceholder: '请输入参数值' }, debug: { run: '运行', diff --git a/ui/src/locales/lang/zh-Hant/views/function-lib.ts b/ui/src/locales/lang/zh-Hant/views/function-lib.ts index 789cbf0ec..f39fea51a 100644 --- a/ui/src/locales/lang/zh-Hant/views/function-lib.ts +++ b/ui/src/locales/lang/zh-Hant/views/function-lib.ts @@ -31,6 +31,7 @@ export default { form: { functionName: { label: '名稱', + name: '函數名稱', placeholder: '請輸入函數名稱', requiredMessage: '請輸入函數名稱' }, @@ -63,7 +64,7 @@ export default { paramInfo2: '使用函數時不顯示', code: '函数内容(Python)', selectPlaceholder: '請选择參數', - inputPlaceholder: '請輸入參數值', + inputPlaceholder: '請輸入參數值' }, debug: { run: '運行', diff --git a/ui/src/views/function-lib/component/AddInternalFunctionDialog.vue b/ui/src/views/function-lib/component/AddInternalFunctionDialog.vue index 5f604404c..2f6514bc4 100644 --- a/ui/src/views/function-lib/component/AddInternalFunctionDialog.vue +++ b/ui/src/views/function-lib/component/AddInternalFunctionDialog.vue @@ -1,6 +1,6 @@ @@ -39,6 +39,7 @@ const emit = defineEmits(['refresh']) const fieldFormRef = ref() const loading = ref(false) +const isEdit = ref(false) const form = ref({ name: '' @@ -64,11 +65,11 @@ watch(dialogVisible, (bool) => { } }) -const open = (row: any) => { +const open = (row: any, edit: boolean) => { if (row) { form.value = cloneDeep(row) } - + isEdit.value = edit || false dialogVisible.value = true } @@ -76,7 +77,7 @@ const submit = async (formEl: FormInstance | undefined) => { if (!formEl) return await formEl.validate((valid) => { if (valid) { - emit('refresh', form.value) + emit('refresh', form.value, isEdit.value) dialogVisible.value = false } }) diff --git a/ui/src/views/function-lib/index.vue b/ui/src/views/function-lib/index.vue index 6969d18c1..eb41c2c64 100644 --- a/ui/src/views/function-lib/index.vue +++ b/ui/src/views/function-lib/index.vue @@ -1,12 +1,6 @@