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