|
@@ -26,7 +26,9 @@
|
|
|
:label="item.tableComment"
|
|
|
:value="item.tableName"
|
|
|
>
|
|
|
- <span style="float: left">{{ item.tableComment }}</span>
|
|
|
+ <span class="discribe" style="float: left">{{
|
|
|
+ item.tableComment
|
|
|
+ }}</span>
|
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{
|
|
|
item.tableName
|
|
|
}}</span>
|
|
@@ -58,9 +60,13 @@
|
|
|
class-name="allowDrag"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="fieldName" label="数据字段">
|
|
|
+ <el-table-column align="center" prop="fieldName" label="数据字段">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="fieldDescription" label="字段描述">
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="fieldDescription"
|
|
|
+ label="字段描述"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-form-item size="normal" prop="fieldDescription"> -->
|
|
|
<input
|
|
@@ -79,7 +85,7 @@
|
|
|
<!-- </el-form-item> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="relationTable" label="关联表">
|
|
|
+ <el-table-column align="center" prop="relationTable" label="关联表">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
|
v-model="scope.row.relationTable"
|
|
@@ -107,7 +113,11 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="relationFieldName" label="关联条件字段">
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="relationFieldName"
|
|
|
+ label="关联条件字段"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
|
v-model="scope.row.relationFieldName"
|
|
@@ -126,7 +136,11 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="relationType" label="关联方式">
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="relationType"
|
|
|
+ label="关联方式"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
|
v-model="scope.row.relationType"
|
|
@@ -165,21 +179,32 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column prop="isShow" label="是否显示">
|
|
|
+ <el-table-column align="center" prop="isShow" label="是否显示">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch v-model="scope.row.isShow"> </el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="isSearch" label="是否包含查询">
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="isSearch"
|
|
|
+ label="是否包含查询"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch v-model="scope.row.isSearch"> </el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="isExport" label="是否导出">
|
|
|
+ <el-table-column align="center" prop="isExport" label="是否导出">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch v-model="scope.row.isExport"> </el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
+ prop="defaultValue"
|
|
|
+ label="筛选条件"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column> -->
|
|
|
+
|
|
|
<!-- <el-table-column prop="isCount" label="是否统计">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch v-model="scope.row.isCount"> </el-switch>
|
|
@@ -405,6 +430,18 @@
|
|
|
:dragTableStyleList="dragTableStyleList"
|
|
|
/>
|
|
|
</el-tab-pane>
|
|
|
+ <el-tab-pane label="数据筛选" name="dataFilter">
|
|
|
+ <!-- <StyleFormPanel
|
|
|
+ ref="styleTableRef"
|
|
|
+ :tableFieldList="tableFieldList"
|
|
|
+ :dragTableStyleList="dragTableStyleList"
|
|
|
+ /> -->
|
|
|
+ <DataFilterPanel
|
|
|
+ ref="dataFilterRef"
|
|
|
+ :tableFieldList="tableFieldList"
|
|
|
+ :filterDataEcho="filterDataEcho"
|
|
|
+ ></DataFilterPanel>
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -621,7 +658,7 @@
|
|
|
:label="item.fieldName"
|
|
|
:value="item.tableName + '.' + item.fieldName"
|
|
|
>
|
|
|
- <span style="float: left; margin-right: 5px"
|
|
|
+ <span class="discribe" style="float: left; margin-right: 5px"
|
|
|
>{{ isShowTableName }}
|
|
|
</span>
|
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{
|
|
@@ -693,13 +730,15 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import { v4 as uuidv4 } from "uuid";
|
|
|
import { listBtn } from "@/api/system/btn";
|
|
|
import StyleFormPanel from "./components/StyleFormPanel.vue";
|
|
|
+import DataFilterPanel from "./components/DataFilterPanel.vue";
|
|
|
export default {
|
|
|
name: "tableMange",
|
|
|
dicts: ["sys_time_format", "table_statistic_type"],
|
|
|
props: [],
|
|
|
- components: { Queryfrom, Treeselect, StyleFormPanel },
|
|
|
+ components: { Queryfrom, Treeselect, StyleFormPanel, DataFilterPanel },
|
|
|
data() {
|
|
|
return {
|
|
|
+ filterDataEcho: "", //数据过滤回显数据
|
|
|
staictitle: "添加统计数据字段",
|
|
|
isInputInvalid: false,
|
|
|
// 修改表格时的menuId
|
|
@@ -1306,6 +1345,7 @@ export default {
|
|
|
if (relaTypeArr.length) {
|
|
|
sql += " " + relaTypeArr.join(" ");
|
|
|
}
|
|
|
+
|
|
|
return sql;
|
|
|
},
|
|
|
getStaticSQL(key) {
|
|
@@ -1519,6 +1559,9 @@ export default {
|
|
|
tableName: this.tableName,
|
|
|
tableFieldData: this.tableFieldList,
|
|
|
formData: this.formData,
|
|
|
+ filterData: encodeURIComponent(
|
|
|
+ this.$refs.dataFilterRef?.getEchoData()
|
|
|
+ ),
|
|
|
};
|
|
|
if (!searchFieldList.length) {
|
|
|
this.$message.warning("请至少选择一个包含查询字段");
|
|
@@ -1543,7 +1586,8 @@ export default {
|
|
|
this.tableKey = uuidv4();
|
|
|
// 表单
|
|
|
let result;
|
|
|
- if (this.tId && this.menuId) {
|
|
|
+ // if (this.tId && this.menuId) {
|
|
|
+ if (this.menuId) {
|
|
|
let payLoad = {
|
|
|
menuId: this.menuId,
|
|
|
menuName: this.formData.menuName,
|
|
@@ -1585,9 +1629,18 @@ export default {
|
|
|
if (result.code == 200) {
|
|
|
// 更新路由
|
|
|
this.reloadRouter();
|
|
|
+ let conditions = this.$refs.dataFilterRef?.getConditions();
|
|
|
+ console.log(conditions);
|
|
|
+ let conditionDefaultValueMap = {};
|
|
|
+ conditions.map((item) => {
|
|
|
+ conditionDefaultValueMap[item.fieldName] = encodeURIComponent(
|
|
|
+ " " + item.condition + " " + item.refValue
|
|
|
+ );
|
|
|
+ });
|
|
|
|
|
|
// let isAsc = this.formData.isAsc == "ASC" ? 0 : 1;
|
|
|
let data = {
|
|
|
+ conditionDefaultValueMap, //数据筛选条件
|
|
|
tId: this.tId,
|
|
|
dtName: this.formData.menuName,
|
|
|
menuId: this.formData.routePath,
|
|
@@ -1637,8 +1690,9 @@ export default {
|
|
|
|
|
|
let res;
|
|
|
let res1;
|
|
|
- if (this.tId && this.menuId) {
|
|
|
- data.menuId = this.menuId;
|
|
|
+ // if (this.tId && this.menuId) {
|
|
|
+ if (this.tId) {
|
|
|
+ data.menuId = this.menuId || result.data;
|
|
|
data.sqlKey = this.editData.sqlKey;
|
|
|
data.tableKey = this.editData.tableKey;
|
|
|
data.dragTableBtnRelevanceList = this.getBtnMapList(
|
|
@@ -1726,6 +1780,7 @@ export default {
|
|
|
let echoData = JSON.parse(res.data.echoData);
|
|
|
this.tableName = echoData.tableName;
|
|
|
this.tableFieldList = echoData.tableFieldData;
|
|
|
+ this.filterDataEcho = echoData.filterData;
|
|
|
let {
|
|
|
isShowList,
|
|
|
timeFormate,
|
|
@@ -1888,6 +1943,13 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+.discribe {
|
|
|
+ display: block;
|
|
|
+ max-width: 200px;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
.ipt {
|
|
|
height: 36px;
|
|
|
line-height: 36px;
|