|
@@ -52,7 +52,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- v-for="(item, index) in columns"
|
|
|
+ v-for="item in columns"
|
|
|
:prop="item.key"
|
|
|
:key="item.key"
|
|
|
:label="item.value"
|
|
@@ -240,11 +240,13 @@ export default {
|
|
|
this.templateInfo.template.primaryKey;
|
|
|
|
|
|
this.$nextTick(async () => {
|
|
|
+ console.log(this.preRow);
|
|
|
if (this.newsort == 0) {
|
|
|
// 第一张表请求表数据不需要条件
|
|
|
await this.getDataHandler();
|
|
|
} else {
|
|
|
- if (this.myContion) {
|
|
|
+ if (this.myContion && this.preRow) {
|
|
|
+ console.log("111", this.myContion, this.preRow);
|
|
|
await this.getDataHandler(this.myContion, this.preRow);
|
|
|
console.log(this.myContion, this.preRow);
|
|
|
}
|
|
@@ -274,14 +276,21 @@ export default {
|
|
|
this.preRow = list;
|
|
|
// console.log(list);
|
|
|
// 处理请求下一张表数据的依赖条件
|
|
|
- if (contion) {
|
|
|
+ let tableLists;
|
|
|
+ console.log(this.newsort);
|
|
|
+ if (contion && list) {
|
|
|
+ console.log(contion);
|
|
|
let key = contion.split(".");
|
|
|
this.queryParams.queryMap["#{" + contion] = "'" + list[key[1]] + "'";
|
|
|
- }
|
|
|
- this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
|
|
|
|
|
|
- this.tableList = [];
|
|
|
- let tableLists = await unionListTableData(this.queryParams);
|
|
|
+ this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
|
|
|
+
|
|
|
+ this.tableList = [];
|
|
|
+ tableLists = await unionListTableData(this.queryParams);
|
|
|
+ } else if (this.newsort == 0) {
|
|
|
+ console.log(contion);
|
|
|
+ tableLists = await unionListTableData(this.queryParams);
|
|
|
+ }
|
|
|
if (tableLists.code == 200) {
|
|
|
// 默认根据这张表的第一条数据请求下一张表的数据
|
|
|
this.$emit("getDefaultCardData", this.index);
|
|
@@ -300,7 +309,9 @@ export default {
|
|
|
});
|
|
|
// console.log(this.tableList);
|
|
|
}
|
|
|
+
|
|
|
this.total = tableLists.total;
|
|
|
+
|
|
|
this.loading = false;
|
|
|
},
|
|
|
// 处理列表信息
|
|
@@ -439,7 +450,9 @@ export default {
|
|
|
this.queryFromWhere.forEach((item) => {
|
|
|
let { conditionDefaultValue, conditionField } = item;
|
|
|
res[camelCase(conditionField.split(".")[1])] =
|
|
|
- this.preRow[conditionDefaultValue.split(".")[1]];
|
|
|
+ conditionDefaultValue.includes(".")
|
|
|
+ ? this.preRow[conditionDefaultValue.split(".")[1]]
|
|
|
+ : conditionDefaultValue;
|
|
|
});
|
|
|
return res;
|
|
|
},
|