fix: 修复模型参数保存未校验
This commit is contained in:
parent
5d726cf538
commit
00f8645cd9
@ -87,6 +87,7 @@ const rander = (form_data: any) => {
|
||||
defineExpose({ getData, rander })
|
||||
onMounted(() => {
|
||||
formValue.value.option_list = []
|
||||
formValue.value.default_value = ''
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -108,8 +108,10 @@ const validate_rules = (rule: any, value: any, callback: any) => {
|
||||
JSON.parse(model_value.value)
|
||||
} catch (e) {
|
||||
callback(new Error('JSON格式不正确'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
defineExpose({ validate_rules: validate_rules })
|
||||
|
||||
@ -80,8 +80,10 @@ const reset_default = (model_id: string, application_id?: string) => {
|
||||
}
|
||||
|
||||
const submit = async () => {
|
||||
dynamicsFormRef.value?.validate().then(() => {
|
||||
emit('refresh', form_data.value)
|
||||
dialogVisible.value = false
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open, reset_default })
|
||||
|
||||
@ -98,15 +98,12 @@ const reset_default = (model_id: string, application_id?: string) => {
|
||||
}
|
||||
|
||||
const submit = async () => {
|
||||
dynamicsFormRef.value?.validate().then((ok) => {
|
||||
if (ok) {
|
||||
dynamicsFormRef.value?.validate().then(() => {
|
||||
emit('refresh', form_data.value)
|
||||
dialogVisible.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const audioPlayer = ref<HTMLAudioElement | null>(null)
|
||||
const testPlay = () => {
|
||||
const data = {
|
||||
@ -117,7 +114,7 @@ const testPlay = () => {
|
||||
.playDemoText(id as string, data, playLoading)
|
||||
.then(async (res: any) => {
|
||||
if (res.type === 'application/json') {
|
||||
const text = await res.text();
|
||||
const text = await res.text()
|
||||
MsgError(text)
|
||||
return
|
||||
}
|
||||
@ -138,10 +135,8 @@ const testPlay = () => {
|
||||
.catch((err) => {
|
||||
console.log('err: ', err)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open, reset_default })
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user