|
|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|