|
@@ -438,7 +438,7 @@
|
|
|
:filterDataEcho="filterDataEcho"
|
|
|
></DataFilterPanel>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="按钮配置" name="classificationQuery">
|
|
|
+ <el-tab-pane label="联合查询" name="classificationQuery">
|
|
|
<ClassificationQueryPanel
|
|
|
ref="classificationQueryRef"
|
|
|
:tableFieldList="tableFieldList"
|
|
@@ -965,7 +965,6 @@ export default {
|
|
|
// menuOrderNum() {
|
|
|
// if (!this.formData.routePath) return 0;
|
|
|
// let targetMenu = this.getTargetMenu(this.menus);
|
|
|
- // console.log(targetMenu);
|
|
|
// if (targetMenu.children?.length) {
|
|
|
// return targetMenu.children.length;
|
|
|
// } else {
|
|
@@ -1001,11 +1000,9 @@ export default {
|
|
|
if (res.code == 200) {
|
|
|
this.btnTemplate = res.data.map((item) => JSON.parse(item.remark));
|
|
|
} else {
|
|
|
- console.log(res);
|
|
|
this.$message.error("获取按钮模板数据失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log(error);
|
|
|
this.$message.error("获取按钮模板数据失败");
|
|
|
}
|
|
|
},
|
|
@@ -1047,7 +1044,6 @@ export default {
|
|
|
treeSelectChange(val) {
|
|
|
// await this.getMenuList();
|
|
|
//没有change事件
|
|
|
- console.log("val", val);
|
|
|
},
|
|
|
async treeSelectFocus() {
|
|
|
await this.getMenuList();
|
|
@@ -1075,7 +1071,6 @@ export default {
|
|
|
let tableComment = this.getTableCommont(this.tableName, this.tableList);
|
|
|
// 获取当前表单结构信息
|
|
|
getListName(data).then((res) => {
|
|
|
- // console.log(res);
|
|
|
this.tableFieldList = res.map((item, index) => {
|
|
|
return {
|
|
|
id: this.tableName + "_" + item.fieldName,
|
|
@@ -1098,7 +1093,6 @@ export default {
|
|
|
relationFieldList: [],
|
|
|
};
|
|
|
});
|
|
|
- // console.log(this.tableFieldList);
|
|
|
});
|
|
|
},
|
|
|
// 关联表变化回调
|
|
@@ -1578,7 +1572,6 @@ export default {
|
|
|
// isRelationFieldAll: false,
|
|
|
// };
|
|
|
// this.validateField(this.tableFieldList, validateParams);
|
|
|
- // console.log(validateParams);
|
|
|
// if (validateParams.isFieldDescrib) {
|
|
|
// this.$message.error("需要显示的字段描述不能为空");
|
|
|
// return;
|
|
@@ -1634,29 +1627,28 @@ export default {
|
|
|
// });
|
|
|
},
|
|
|
|
|
|
- // 处理配置的条件查询按钮数据
|
|
|
+ // 联合查询条件
|
|
|
getBtnData(searchArr = []) {
|
|
|
// 按钮条件list
|
|
|
- let classificationData =
|
|
|
- this.$refs.classificationQueryRef.getConditions();
|
|
|
- let res = searchArr
|
|
|
- .map((item) => {
|
|
|
- return {
|
|
|
- conditionField: item,
|
|
|
- conditionName: "超级查询",
|
|
|
- conditionType: "SuperQuery",
|
|
|
- };
|
|
|
- })
|
|
|
- // .filter((item) => {
|
|
|
- // return !classificationData.some((v) => {
|
|
|
- // return v.conditionField == item.conditionField;
|
|
|
- // });
|
|
|
- // });
|
|
|
+ let classificationData = this.$refs.classificationQueryRef.getConditions();
|
|
|
+ let res = searchArr.map((item) => {
|
|
|
+ return {
|
|
|
+ conditionField: item,
|
|
|
+ conditionName: "超级查询",
|
|
|
+ conditionType: "SuperQuery",
|
|
|
+ };
|
|
|
+ })
|
|
|
+ let list = Object.assign([], classificationData);
|
|
|
+ // 校验 填写不完整删除查询条件
|
|
|
+ classificationData.forEach((item, index) => {
|
|
|
+ if (item.conditionName == "" || item.conditionField == "" || item.conditionType == "") {
|
|
|
+ classificationData.splice(index, 1);
|
|
|
+ }
|
|
|
+ })
|
|
|
return [...res, ...classificationData];
|
|
|
},
|
|
|
// 创建回调
|
|
|
async createHandle() {
|
|
|
- // console.log(123);
|
|
|
// this.sqlKey = uuidv4();
|
|
|
this.isInputInvalid = true;
|
|
|
this.$refs.formData.validate(async (valid) => {
|
|
@@ -1692,27 +1684,11 @@ export default {
|
|
|
this.$message.warning("请至少选择一个包含查询字段");
|
|
|
return false;
|
|
|
}
|
|
|
- // let validateParams = {
|
|
|
- // isFieldDescrib: false,
|
|
|
- // isRelationFieldAll: false,
|
|
|
- // };
|
|
|
- // this.validateField(this.tableFieldList, validateParams);
|
|
|
- // console.log(validateParams);
|
|
|
- // if (validateParams.isFieldDescrib) {
|
|
|
- // this.$message.error("需要显示的字段描述不能为空");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if (validateParams.isRelationFieldAll) {
|
|
|
- // this.$message.error("请补全关联条件");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // console.log("123", columns);
|
|
|
this.uuid = uuidv4();
|
|
|
this.tableKey = uuidv4();
|
|
|
// 表单
|
|
|
let result;
|
|
|
let btnTemplate = this.formateBtnTemplate();
|
|
|
- console.log(btnTemplate);
|
|
|
|
|
|
// if (this.tId && this.menuId) {
|
|
|
if (this.menuId && !this.isNeedNewMenu) {
|
|
@@ -1780,6 +1756,8 @@ export default {
|
|
|
if (result.code == 200) {
|
|
|
// 更新路由
|
|
|
this.reloadRouter();
|
|
|
+
|
|
|
+ // 得到联合查询数组
|
|
|
let conditions = this.$refs.dataFilterRef?.getConditions();
|
|
|
let conditionDefaultValueMap = {};
|
|
|
conditions.map((item) => {
|
|
@@ -1787,9 +1765,10 @@ export default {
|
|
|
" " + item.condition + " " + item.refValue
|
|
|
);
|
|
|
});
|
|
|
-
|
|
|
// let isAsc = this.formData.isAsc == "ASC" ? 0 : 1;
|
|
|
let btnData = this.getBtnData(searchFieldList);
|
|
|
+
|
|
|
+
|
|
|
let data = {
|
|
|
conditionDefaultValueMap, //数据筛选条件
|
|
|
tId: this.tId,
|
|
@@ -1856,7 +1835,6 @@ export default {
|
|
|
this.dragTableStatisticList.forEach((item) => {
|
|
|
item.tableKey = this.editData.tableKey;
|
|
|
});
|
|
|
- // console.log(res);
|
|
|
res1 = await updateStatistic({
|
|
|
tableKey: this.editData.tableKey,
|
|
|
dragTableStatisticList: this.dragTableStatisticList,
|
|
@@ -1870,7 +1848,6 @@ export default {
|
|
|
data.tableKey
|
|
|
);
|
|
|
res = await addDragTable(data);
|
|
|
- // console.log('123456789', res)
|
|
|
this.dragTableStatisticList.forEach((item) => {
|
|
|
item.tableKey = this.uuid;
|
|
|
});
|
|
@@ -1890,7 +1867,6 @@ export default {
|
|
|
btnTemplate.menuID = result.data;
|
|
|
let btnRes = await insertByDefaultBtn(btnTemplate);
|
|
|
if (btnRes.code == 200) {
|
|
|
- console.log(btnRes);
|
|
|
// 发送权限请求
|
|
|
let payload = btnRes.data.map((item) => {
|
|
|
return {
|
|
@@ -2032,15 +2008,12 @@ export default {
|
|
|
this.isShowAddData = true;
|
|
|
this.dataType = await this.getDicts("table_statistic_type");
|
|
|
this.dataType = this.dataType.data;
|
|
|
- // console.log(this.dataType)
|
|
|
},
|
|
|
async updataDialog() {
|
|
|
- // console.log(this.dataType)
|
|
|
},
|
|
|
// 修改数据字段
|
|
|
upadtaData() {
|
|
|
this.dragTableStatisticList.forEach((item, index) => {
|
|
|
- // console.log(this.dataCountFormData);
|
|
|
if (item.id !== undefined && item.id == this.dataCountFormData.id) {
|
|
|
this.dragTableStatisticList[index] = this.dataCountFormData;
|
|
|
} else if (item.xid == this.dataCountFormData.xid) {
|
|
@@ -2048,12 +2021,10 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.isShowAddData = false;
|
|
|
- // console.log(this.dragTableStatisticList)
|
|
|
this.dataCountFormData = {};
|
|
|
},
|
|
|
// 添加数据字段
|
|
|
addData() {
|
|
|
- // console.log(this.dataCountFormData);
|
|
|
this.dataCountFormData.xid = Date.now();
|
|
|
this.dataCountFormData.tableKey = this.tableKey;
|
|
|
this.dragTableStatisticList.push(this.dataCountFormData);
|
|
@@ -2073,20 +2044,16 @@ export default {
|
|
|
searchFieldList: this.searchFieldList,
|
|
|
dtTableName: this.tableName,
|
|
|
}).then((res) => {
|
|
|
- // console.log(res)
|
|
|
});
|
|
|
},
|
|
|
// 修改统计信息
|
|
|
async handleUpdateStat(row) {
|
|
|
- // console.log(row);
|
|
|
this.dataCountFormData = row;
|
|
|
this.dataCountFormData.xid = Date.now();
|
|
|
this.staictitle = "修改统计数据字段";
|
|
|
this.dataType = await this.getDicts("table_statistic_type");
|
|
|
this.dataType = this.dataType.data;
|
|
|
this.isShowAddData = true;
|
|
|
- // console.log(this.dataCountFormData)
|
|
|
- // console.log(this.dragTableStatisticList);
|
|
|
},
|
|
|
// 删除统计信息
|
|
|
handleDeleteStat(row) {
|