Browse Source

默认配置增加保存验证

master
王梦远 2 weeks ago
parent
commit
2bb0e8e57b
  1. 7
      src/components/formula/SettingFormulaConfig.vue

7
src/components/formula/SettingFormulaConfig.vue

@ -39,12 +39,14 @@ watchEffect(() => {
formData.value = convertValuesToString(formData.value, 'name')
// formData.value = convertValuesToInt(formData.value)
})
const settingFormRef = ref()
/**
* 处理表单提交
* 根据不同的type属性值执行不同的保存逻辑
*/
const handleSubmit = () => {
settingFormRef.value.validate((valid: any) => {
if (valid) {
//
const diff = compareJSON(formulaStore.defaultFormulaInfo, formData.value)
const diffKeys = Object.keys(diff)
@ -58,6 +60,8 @@ const handleSubmit = () => {
}
formulaStore.getFormualDefaultData()
}
})
}
const size = 'default'
const validatePass = (rule: any, value: any, callback: any, config: Formula.FormulaConfig) => {
if (!value && value !== 0 && value !== '0') {
@ -76,6 +80,7 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form
<template>
<div class="formula-form">
<el-form
ref="settingFormRef"
:disabled="!props.editable"
:model="formData"
label-width="auto"

Loading…
Cancel
Save