|
@@ -831,29 +831,28 @@ export default {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
let columns = [],
|
|
|
- searchFieldList = []
|
|
|
- this.getCol(
|
|
|
- this.tableFieldList,
|
|
|
- columns,
|
|
|
- searchFieldList,
|
|
|
- );
|
|
|
-
|
|
|
+ searchFieldList = []
|
|
|
+ this.getCol(
|
|
|
+ this.tableFieldList,
|
|
|
+ columns,
|
|
|
+ searchFieldList,
|
|
|
+ );
|
|
|
// 判断是否有包含查询字段
|
|
|
if (!searchFieldList.length) {
|
|
|
this.$message.warning("请至少选择一个包含查询字段");
|
|
|
return false;
|
|
|
}
|
|
|
- console.log('新增表格标题等字段',this.tableItemForm)
|
|
|
- console.log(this.tableFieldList)
|
|
|
- let tableKey = uuidv4();
|
|
|
- let sqlKey = uuidv4();
|
|
|
- let echoData = {
|
|
|
- tableName: this.tableItemForm.tableName,
|
|
|
- tableFieldData: this.tableFieldList,
|
|
|
- formData: this.groupForm,
|
|
|
- }
|
|
|
-
|
|
|
- this.addDragData.push({
|
|
|
+ // 判断是新增还是修改 true新增
|
|
|
+ if(this.relateTitle){
|
|
|
+
|
|
|
+ let echoData = {
|
|
|
+ tableName: this.tableItemForm.tableName,
|
|
|
+ tableFieldData: this.tableFieldList,
|
|
|
+ formData: this.groupForm,
|
|
|
+ }
|
|
|
+ let tableKey = uuidv4();
|
|
|
+ let sqlKey = uuidv4();
|
|
|
+ this.addDragData.push({
|
|
|
tId: this.tId,
|
|
|
dtName: this.tableItemForm.title,
|
|
|
tableKey: tableKey,
|
|
@@ -868,25 +867,30 @@ export default {
|
|
|
tableSql: this.getSQLStr(),
|
|
|
tableExportField: '',
|
|
|
echoData: JSON.stringify(echoData),
|
|
|
- })
|
|
|
-
|
|
|
- // 判断是新增还是修改 true新增
|
|
|
- if(this.relateTitle){
|
|
|
+ })
|
|
|
|
|
|
this.tableItemForm.rowId = Date.now();
|
|
|
this.groupList.push({tableFieldList: this.tableFieldList, tableItemForm: this.tableItemForm})
|
|
|
|
|
|
this.tableDataList.push(this.tableItemForm);
|
|
|
-
|
|
|
- console.log(this.tableDataList)
|
|
|
} else {
|
|
|
- // this.tableDataList.forEach((item, index) => {
|
|
|
- // if(item.rowId == this.tableItemForm){
|
|
|
- // this.tableDataList[index] = this.tableItemForm
|
|
|
- // }
|
|
|
- // })
|
|
|
+ let columns = [],
|
|
|
+ searchFieldList = []
|
|
|
+ this.getCol(
|
|
|
+ this.tableFieldList,
|
|
|
+ columns,
|
|
|
+ searchFieldList,
|
|
|
+ );
|
|
|
+ let echoData = {
|
|
|
+ tableName: this.tableItemForm.tableName,
|
|
|
+ tableFieldData: this.tableFieldList,
|
|
|
+ formData: this.groupForm,
|
|
|
+ }
|
|
|
+ console.log(this.tableDataList)
|
|
|
+ console.log('修改')
|
|
|
}
|
|
|
- console.log(this.groupList);
|
|
|
+ console.log(this.addDragData);
|
|
|
+
|
|
|
this.isShowForm = false
|
|
|
this.tableItemForm = {}
|
|
|
this.tableFieldList = []
|
|
@@ -896,20 +900,6 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- // if(this.relateTitle){
|
|
|
- // this.tableItemForm.rowId = Date.now();
|
|
|
- // this.tableDataList.push(this.tableItemForm);
|
|
|
- // } else {
|
|
|
- // this.tableDataList.forEach((item, index) => {
|
|
|
- // if(item.rowId == this.tableItemForm){
|
|
|
- // this.tableDataList[index] = this.tableItemForm
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
-
|
|
|
- // this.isShowForm = false;
|
|
|
- // this.tableItemForm = {}
|
|
|
},
|
|
|
// 修改一个表格数据
|
|
|
relateOne(row){
|
|
@@ -971,11 +961,11 @@ export default {
|
|
|
this.$refs[formName].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
// console.log('groupList', this.groupList);
|
|
|
- let tableKeyObj = {
|
|
|
- tableKey: this.uuidv4(),
|
|
|
+ let groupKeyObj = {
|
|
|
+ groupKey: uuidv4(),
|
|
|
};
|
|
|
let payLoad = {
|
|
|
- component: "tablelist/commonTable/grouplistInfo",
|
|
|
+ component: "relateTable/relateTableEdit",
|
|
|
icon: "",
|
|
|
isCache: "0",
|
|
|
isFrame: "1",
|
|
@@ -983,8 +973,8 @@ export default {
|
|
|
menuType: "C",
|
|
|
orderNum: this.menuOrderNum,
|
|
|
parentId: this.groupForm.routePath,
|
|
|
- path: sqlKey,
|
|
|
- query: JSON.stringify(tableKeyObj),
|
|
|
+ path: groupKeyObj.groupKey,
|
|
|
+ query: JSON.stringify(groupKey),
|
|
|
status: "0",
|
|
|
visible: "0",
|
|
|
};
|
|
@@ -994,10 +984,10 @@ export default {
|
|
|
if(result.code == 200){
|
|
|
this.reloadRouter();
|
|
|
let data = {
|
|
|
- groupName: '',
|
|
|
- groupDescription: '',
|
|
|
- groupTableInfo: [],
|
|
|
- dragTables:[]
|
|
|
+ groupName: '',
|
|
|
+ groupDescription: '',
|
|
|
+ groupTableInfo: [],
|
|
|
+ dragTables:[]
|
|
|
}
|
|
|
this.addDragData.forEach((item, index) => {
|
|
|
item.menuId = result.data;
|