表单查询完善

zzq
zzq 2024-06-07 17:16:15 +08:00
parent fc245231f3
commit 52c8aa536c
2 changed files with 36 additions and 9 deletions

View File

@ -224,6 +224,11 @@
}
itemColumnChild.colProps.span = itemColumn.span;
arr.push(itemColumnChild);
// arr.push({
// parentValue: index,
// ...itemColumnChild,
// show: index == 0 ? true : false,
// });
val.children.push(itemColumnChild);
});
});
@ -235,6 +240,11 @@
}
if (opt.ptype !== 'gridlayout') {
arr.push(opt);
// arr.push({
// parentValue: index,
// ...opt,
// show: index == 0 ? true : false,
// });
}
formColumns.value = arr;
@ -388,7 +398,7 @@
}
});
function tabsChange(e) {
async function tabsChange(e) {
const columns: FormSchema[] = [];
tabsColumns.value.forEach((item) => {
item.children.forEach((val) => {
@ -398,13 +408,18 @@
tabsColumns.value[e].children.forEach((item) => {
item.itemProps.hidden = false;
});
// formColumns.value.forEach((element) => {
// element.show = false;
// if (element.parentValue == e) {
// element.show = true;
// }
// });
tabsColumns.value.forEach((item) => {
item.children.forEach((val) => {
columns.push(val);
});
});
const obj = getFieldsValue();
const obj = await validate();
setTimeout(() => {
updateSchema(columns);
resetFields();

View File

@ -616,12 +616,24 @@
}
if (columnObj.table.querys) {
columnObj.table.querys.forEach((item) => {
searchFormSchema.push({
field: item.key,
component: item.type || 'Input',
label: item.label,
colProps: { span: 6 },
});
if (item.options) {
searchFormSchema.push({
field: item.key,
component: item.type || 'Input',
label: item.label,
colProps: { span: 6 },
componentProps: {
options: item.options,
},
});
} else {
searchFormSchema.push({
field: item.key,
component: item.type || 'Input',
label: item.label,
colProps: { span: 6 },
});
}
});
}
callColumns.forEach((item) => {