fix: 优化变量列表组件

This commit is contained in:
JiangQiming 2023-01-28 16:25:31 +08:00
parent 11fe52ce49
commit b45f6f087a
2 changed files with 3 additions and 4 deletions

View File

@ -113,14 +113,12 @@ const dataSource = computed({
watch( watch(
() => dataSource.value, () => dataSource.value,
(val) => { (val) => {
console.log('dataSource.value : ', val); emit('update:variableDefinitions', val);
emit('update:variableDefinitions', val)
}, },
{ deep: true }, { deep: true },
); );
const handleTypeChange = (record: IVariable) => { const handleTypeChange = (record: IVariable) => {
console.log('record.type: ', record.type);
switch (record.type) { switch (record.type) {
case 'string': case 'string':
record.format = '%s'; record.format = '%s';

View File

@ -534,7 +534,7 @@ watch(
); );
computed(() => { computed(() => {
console.log('formData.value.type: ', formData.value.type); // console.log('formData.value.type: ', formData.value.type);
Object.assign( Object.assign(
formData.value.template, formData.value.template,
TEMPLATE_FIELD_MAP[formData.value.type][formData.value.provider], TEMPLATE_FIELD_MAP[formData.value.type][formData.value.provider],
@ -576,6 +576,7 @@ const { resetFields, validate, validateInfos, clearValidate } = useForm(
watch( watch(
() => formData.value.type, () => formData.value.type,
() => { () => {
formData.value.variableDefinitions = []
clearValidate(); clearValidate();
}, },
{ deep: true }, { deep: true },