完善选项卡

main
zzq 1 year ago
parent 5b8c369dde
commit cb118e72b3

@ -207,7 +207,7 @@
) {
receivedData.value.formInfo.schemas = receivedData.value.formInfo.tabList[0].schemas;
}
delete receivedData.value.formInfo.tabList;
//
const editorJsonData = receivedData.value.formInfo as IFormConfig;

@ -126,29 +126,56 @@
let tableData = await getTableColumnData(schems);
let tabArr: any = [];
let tabLabelArr: any = [];
console.log('designTab.schemas', designTab.schemas)
designTab.schemas.forEach((item) => {
if (item.componentProps.defaultValue) {
item.defaultValue = item.componentProps.defaultValue;
}
if (item.componentProps.fieldName) {
tableData.forEach((element) => {
if (element.name == item.componentProps.dataTable) {
var currentIndex = element.data.findIndex(
(childItem) => childItem.dbColumnName === item.componentProps.fieldName,
);
item.csType = element.data[currentIndex].csType;
}
});
}
// csType
if (item.type == 'subTable') {
item.columns = changeCloums(item.columns, tableData);
}
if (item.component != 'Tabs') {
if (item.component !== 'Tabs') {
if (item.componentProps.defaultValue) {
item.defaultValue = item.componentProps.defaultValue;
}
if (item.componentProps.fieldName) {
tableData.forEach((element) => {
if (element.name == item.componentProps.dataTable) {
var currentIndex = element.data.findIndex(
(childItem) => childItem.dbColumnName === item.componentProps.fieldName,
);
item.csType = element.data[currentIndex].csType;
}
});
}
// csType
if (item.type == 'subTable') {
item.columns = changeCloums(item.columns, tableData);
}
tabArr.push(item.componentProps.fieldName);
}
if (!item.componentProps.fieldName) {
tabLabelArr.push(item.label);
if (!item.componentProps.fieldName) {
tabLabelArr.push(item.label);
}
} else {
item.componentProps.options.forEach((val) => {
val.children.forEach((list) => {
if (list.componentProps && list.componentProps.defaultValue) {
list.defaultValue = list.componentProps.defaultValue;
}
if (list.componentProps && list.componentProps.fieldName) {
tableData.forEach((element) => {
if (element.name == list.componentProps.dataTable) {
var currentIndex = element.data.findIndex(
(childItem) => childItem.dbColumnName === list.componentProps.fieldName,
);
list.csType = element.data[currentIndex].csType;
}
});
}
// csType
if (list.type == 'subTable') {
list.columns = changeCloums(item.columns, tableData);
}
tabArr.push(list.componentProps.fieldName);
if (!list.componentProps.fieldName) {
tabLabelArr.push(list.label);
}
});
});
}
});

Loading…
Cancel
Save