|
@@ -1059,114 +1059,119 @@ export default {
|
|
|
}
|
|
|
let echoData = {};
|
|
|
// 判断修改还是新增
|
|
|
+
|
|
|
+ echoData = {
|
|
|
+ tableName: this.tableItemForm.tableName,
|
|
|
+ tableFieldData: this.tableFieldList,
|
|
|
+ };
|
|
|
+ console.log(echoData);
|
|
|
+ let tableKey = uuidv4();
|
|
|
+ let sqlKey = uuidv4();
|
|
|
+
|
|
|
+ this.relyFileds.tableFieldList = this.tableFieldList;
|
|
|
+ this.relyFileds.tableName = this.tableItemForm.tableName;
|
|
|
+ this.tableItemForm.rowId = Date.now();
|
|
|
+ let newTableData = {
|
|
|
+ //收集到的表格编辑结果
|
|
|
+ dtName: this.tableItemForm.title,
|
|
|
+ dtTableName: this.tableItemForm.tableName,
|
|
|
+ rowId: this.tableItemForm.rowId,
|
|
|
+ selectFields: this.tableItemForm.selectFields,
|
|
|
+ orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
+ timeFormate: this.tableItemForm.timeFormate,
|
|
|
+ primaryKey: this.tableItemForm.selectFields,
|
|
|
+ rowId: this.tableItemForm.rowId,
|
|
|
+ tId: this.tId,
|
|
|
+ tableKey: tableKey,
|
|
|
+ sortOrder: this.tableItemForm.isAsc,
|
|
|
+ sqlKey: sqlKey,
|
|
|
+ dtColumnName: columns,
|
|
|
+ // timeFormat: "yyyy-MM-dd",
|
|
|
+ searchFieldList: searchFieldList,
|
|
|
+ conditionDefaultValueMap: this.conditionDefault,
|
|
|
+ tableSql: this.getSQLStr(),
|
|
|
+ tableExportField: "",
|
|
|
+ echoData: JSON.stringify(echoData),
|
|
|
+ };
|
|
|
if (this.relateTitle) {
|
|
|
- echoData = {
|
|
|
- tableName: this.tableItemForm.tableName,
|
|
|
- tableFieldData: this.tableFieldList,
|
|
|
- };
|
|
|
- console.log(echoData);
|
|
|
- let tableKey = uuidv4();
|
|
|
- let sqlKey = uuidv4();
|
|
|
+ this.tableDataList.push(newTableData);
|
|
|
+ } else {
|
|
|
+ this.$set(this.tableDataList, this.editIndex, newTableData);
|
|
|
+ }
|
|
|
|
|
|
- this.relyFileds.tableFieldList = this.tableFieldList;
|
|
|
- this.relyFileds.tableName = this.tableItemForm.tableName;
|
|
|
- this.tableItemForm.rowId = Date.now();
|
|
|
+ // 选择依赖字段
|
|
|
+ this.groupList.push({
|
|
|
+ tableFieldList: this.tableFieldList,
|
|
|
+ tableItemForm: this.tableItemForm,
|
|
|
+ conditionDefaultValueMap: this.conditionDefaultValueMap,
|
|
|
+ });
|
|
|
|
|
|
- this.tableDataList.push({
|
|
|
- dtName: this.tableItemForm.title,
|
|
|
- dtTableName: this.tableItemForm.tableName,
|
|
|
- rowId: this.tableItemForm.rowId,
|
|
|
- selectFields: this.tableItemForm.selectFields,
|
|
|
- orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
- timeFormate: this.tableItemForm.timeFormate,
|
|
|
- primaryKey: this.tableItemForm.selectFields,
|
|
|
+ if (this.groupTitle) {
|
|
|
+ this.addDragData.push({
|
|
|
rowId: this.tableItemForm.rowId,
|
|
|
tId: this.tId,
|
|
|
+ dtName: this.tableItemForm.title,
|
|
|
tableKey: tableKey,
|
|
|
+ dtTableName: this.tableItemForm.tableName,
|
|
|
+ primaryKey: this.tableItemForm.selectFields,
|
|
|
+ orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
sortOrder: this.tableItemForm.isAsc,
|
|
|
sqlKey: sqlKey,
|
|
|
dtColumnName: columns,
|
|
|
- timeFormat: "yyyy-MM-dd",
|
|
|
+ timeFormate: this.tableItemForm.timeFormate,
|
|
|
searchFieldList: searchFieldList,
|
|
|
conditionDefaultValueMap: this.conditionDefault,
|
|
|
tableSql: this.getSQLStr(),
|
|
|
tableExportField: "",
|
|
|
echoData: JSON.stringify(echoData),
|
|
|
});
|
|
|
+ }
|
|
|
|
|
|
- // 选择依赖字段
|
|
|
- this.groupList.push({
|
|
|
- tableFieldList: this.tableFieldList,
|
|
|
- tableItemForm: this.tableItemForm,
|
|
|
- conditionDefaultValueMap: this.conditionDefaultValueMap,
|
|
|
- });
|
|
|
+ // echoData = {
|
|
|
+ // tableName: this.tableItemForm.tableName,
|
|
|
+ // tableFieldData: this.tableFieldList,
|
|
|
+ // };
|
|
|
+ // console.log("123456", echoData);
|
|
|
+ // this.tableDataList.forEach((item, index) => {
|
|
|
+ // console.log(item, this.tableItemForm);
|
|
|
+ // if (item.tId == this.tableItemForm.tId) {
|
|
|
+ // item.conditionDefaultValueMap = this.conditionDefault;
|
|
|
+ // console.log(this.conditionDefault);
|
|
|
+ // item.echoData = JSON.stringify(echoData);
|
|
|
+ // item.sortOrder = this.tableItemForm.isAsc;
|
|
|
+ // item.orderByColumn = this.tableItemForm.orderByColumn;
|
|
|
+ // item.primaryKey = this.tableItemForm.selectFields;
|
|
|
+ // item.dtTableName = this.tableItemForm.tableName;
|
|
|
+ // item.dtName = this.tableItemForm.title;
|
|
|
+ // item.dtColumnName = JSON.stringify(columns);
|
|
|
+ // item.searchFieldList = searchFieldList;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // console.log("保存表格信息", this.tableDataList, this.editIndex);
|
|
|
+ // this.tableDataList[this.editIndex] = {
|
|
|
+ // iconditionDefaultValueMap: this.conditionDefault,
|
|
|
+ // echoData: JSON.stringify(echoData),
|
|
|
+ // sortOrder: this.tableItemForm.isAsc,
|
|
|
+ // orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
+ // primaryKey: this.tableItemForm.selectFields,
|
|
|
+ // dtTableName: this.tableItemForm.tableName,
|
|
|
+ // dtName: this.tableItemForm.title,
|
|
|
+ // dtColumnName: JSON.stringify(columns),
|
|
|
+ // searchFieldList: searchFieldList,
|
|
|
+ // };
|
|
|
|
|
|
- if (this.groupTitle) {
|
|
|
- this.addDragData.push({
|
|
|
- rowId: this.tableItemForm.rowId,
|
|
|
- tId: this.tId,
|
|
|
- dtName: this.tableItemForm.title,
|
|
|
- tableKey: tableKey,
|
|
|
- dtTableName: this.tableItemForm.tableName,
|
|
|
- primaryKey: this.tableItemForm.selectFields,
|
|
|
- orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
- sortOrder: this.tableItemForm.isAsc,
|
|
|
- sqlKey: sqlKey,
|
|
|
- dtColumnName: columns,
|
|
|
- timeFormat: "yyyy-MM-dd",
|
|
|
- searchFieldList: searchFieldList,
|
|
|
- conditionDefaultValueMap: this.conditionDefault,
|
|
|
- tableSql: this.getSQLStr(),
|
|
|
- tableExportField: "",
|
|
|
- echoData: JSON.stringify(echoData),
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- echoData = {
|
|
|
- tableName: this.tableItemForm.tableName,
|
|
|
- tableFieldData: this.tableFieldList,
|
|
|
- };
|
|
|
- console.log("123456", echoData);
|
|
|
- // this.tableDataList.forEach((item, index) => {
|
|
|
- // console.log(item, this.tableItemForm);
|
|
|
- // if (item.tId == this.tableItemForm.tId) {
|
|
|
- // item.conditionDefaultValueMap = this.conditionDefault;
|
|
|
- // console.log(this.conditionDefault);
|
|
|
- // item.echoData = JSON.stringify(echoData);
|
|
|
- // item.sortOrder = this.tableItemForm.isAsc;
|
|
|
- // item.orderByColumn = this.tableItemForm.orderByColumn;
|
|
|
- // item.primaryKey = this.tableItemForm.selectFields;
|
|
|
- // item.dtTableName = this.tableItemForm.tableName;
|
|
|
- // item.dtName = this.tableItemForm.title;
|
|
|
- // item.dtColumnName = JSON.stringify(columns);
|
|
|
- // item.searchFieldList = searchFieldList;
|
|
|
- // }
|
|
|
- // });
|
|
|
- console.log(this.tableDataList, this.editIndex);
|
|
|
- // this.tableDataList[this.editIndex] = {
|
|
|
- // iconditionDefaultValueMap: this.conditionDefault,
|
|
|
- // echoData: JSON.stringify(echoData),
|
|
|
- // sortOrder: this.tableItemForm.isAsc,
|
|
|
- // orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
- // primaryKey: this.tableItemForm.selectFields,
|
|
|
- // dtTableName: this.tableItemForm.tableName,
|
|
|
- // dtName: this.tableItemForm.title,
|
|
|
- // dtColumnName: JSON.stringify(columns),
|
|
|
- // searchFieldList: searchFieldList,
|
|
|
- // };
|
|
|
- this.$set(this.tableDataList, this.editIndex, {
|
|
|
- iconditionDefaultValueMap: this.conditionDefault,
|
|
|
- echoData: JSON.stringify(echoData),
|
|
|
- sortOrder: this.tableItemForm.isAsc,
|
|
|
- orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
- primaryKey: this.tableItemForm.selectFields,
|
|
|
- dtTableName: this.tableItemForm.tableName,
|
|
|
- dtName: this.tableItemForm.title,
|
|
|
- dtColumnName: JSON.stringify(columns),
|
|
|
- searchFieldList: searchFieldList,
|
|
|
- timeFormate: this.tableItemForm.timeFormate,
|
|
|
- });
|
|
|
- }
|
|
|
+ // this.$set(this.tableDataList, this.editIndex, {
|
|
|
+ // iconditionDefaultValueMap: this.conditionDefault,
|
|
|
+ // echoData: JSON.stringify(echoData),
|
|
|
+ // sortOrder: this.tableItemForm.isAsc,
|
|
|
+ // orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
+ // primaryKey: this.tableItemForm.selectFields,
|
|
|
+ // dtTableName: this.tableItemForm.tableName,
|
|
|
+ // dtName: this.tableItemForm.title,
|
|
|
+ // dtColumnName: JSON.stringify(columns),
|
|
|
+ // searchFieldList: searchFieldList,
|
|
|
+ // timeFormate: this.tableItemForm.timeFormate,
|
|
|
+ // });
|
|
|
this.isShowForm = false;
|
|
|
echoData = {};
|
|
|
this.tableItemForm = {};
|
|
@@ -1207,20 +1212,23 @@ export default {
|
|
|
this.tableFieldList = echoData.tableFieldData;
|
|
|
this.tableItemForm.tId = row.tId;
|
|
|
this.tableItemForm.rowId = row.tableKey;
|
|
|
- this.tableItemForm.isAsc = false;
|
|
|
+ console.log(typeof row.sortOrder);
|
|
|
+ this.$set(this.tableItemForm, "isAsc", row.sortOrder);
|
|
|
+ // this.tableItemForm.isAsc = row.sortOrder;
|
|
|
this.tableItemForm.orderByColumn = row.orderByColumn;
|
|
|
this.tableItemForm.title = row.dtName;
|
|
|
this.tableItemForm.tableName = row.dtTableName;
|
|
|
this.tableItemForm.selectFields = row.primaryKey;
|
|
|
- this.tableItemForm.timeFormate = row.timeFormat;
|
|
|
+ this.tableItemForm.timeFormate = row.timeFormate;
|
|
|
} else {
|
|
|
this.tableItemForm.rowId = row.rowId; //未知字段
|
|
|
this.tableItemForm.title = row.dtName;
|
|
|
this.tableItemForm.selectFields = row.selectFields;
|
|
|
this.tableItemForm.tableName = row.dtTableName;
|
|
|
this.tableItemForm.orderByColumn = row.orderByColumn;
|
|
|
- this.tableItemForm.timeFormate = row.timeFormat;
|
|
|
- this.tableItemForm.isAsc = row.sortOrder;
|
|
|
+ this.tableItemForm.timeFormate = row.timeFormate;
|
|
|
+ // this.tableItemForm.isAsc = row.sortOrder;
|
|
|
+ this.$set(this.tableItemForm, "isAsc", row.sortOrder);
|
|
|
this.tableItemForm.selectFields = row.primaryKey;
|
|
|
|
|
|
this.getList();
|