|
@@ -403,17 +403,6 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="表格样式" name="tableStyle">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="inline-large-button"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="addDataDialog"
|
|
|
- >
|
|
|
- 添加样式
|
|
|
- </el-button>
|
|
|
- </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -859,27 +848,6 @@ export default {
|
|
|
isShowAddData: false,
|
|
|
dataType: [],
|
|
|
uuid: "",
|
|
|
-
|
|
|
- // 表格样式数据
|
|
|
- styleTableData: [],
|
|
|
- styleFormData: {
|
|
|
- styleName: "",
|
|
|
- tableKey: "",
|
|
|
- styleCode: "",
|
|
|
- styleCondtion: "",
|
|
|
- styleCondtionObj: {
|
|
|
- styleRow: false, //当前行生效
|
|
|
- styleField: "", //样式生效字段
|
|
|
- styleCondtionField: "", //样式条件依赖字段
|
|
|
- styleCondtionList: [], //条件列表
|
|
|
- // 行样式
|
|
|
- rowBgColor: "", //行背景色
|
|
|
- // 字段样式
|
|
|
- fontColor: "", //字体颜色
|
|
|
- tagType: "", //tag类型
|
|
|
- isNeedBgColor: false, //是否需要背景色
|
|
|
- },
|
|
|
- },
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -995,7 +963,7 @@ export default {
|
|
|
relationFieldList: [],
|
|
|
};
|
|
|
});
|
|
|
- console.log(this.tableFieldList);
|
|
|
+ // console.log(this.tableFieldList);
|
|
|
});
|
|
|
},
|
|
|
// 关联表变化回调
|
|
@@ -1605,81 +1573,65 @@ export default {
|
|
|
echoData: JSON.stringify(echoData),
|
|
|
};
|
|
|
|
|
|
- this.dragTableStatisticList?.forEach(item => {
|
|
|
- if(this.tId == ''){
|
|
|
- item.tableKey = this.tableKey
|
|
|
- this.staticSqlKey = uuidv4()
|
|
|
- item.sqlKey = this.staticSqlKey
|
|
|
+ this.dragTableStatisticList?.forEach((item) => {
|
|
|
+ if (this.tId == "") {
|
|
|
+ item.tableKey = this.tableKey;
|
|
|
+ this.staticSqlKey = uuidv4();
|
|
|
+ item.sqlKey = this.staticSqlKey;
|
|
|
}
|
|
|
- if(item.sqlKey){
|
|
|
- this.staticSqlKey = item.sqlKey
|
|
|
+ if (item.sqlKey) {
|
|
|
+ this.staticSqlKey = item.sqlKey;
|
|
|
} else {
|
|
|
- this.staticSqlKey = uuidv4()
|
|
|
- item.sqlKey = this.staticSqlKey
|
|
|
+ this.staticSqlKey = uuidv4();
|
|
|
+ item.sqlKey = this.staticSqlKey;
|
|
|
}
|
|
|
|
|
|
- let key = item.statisticType + '(' + item.statisticField + ')'+ ' as result'
|
|
|
+ let key =
|
|
|
+ item.statisticType +
|
|
|
+ "(" +
|
|
|
+ item.statisticField +
|
|
|
+ ")" +
|
|
|
+ " as result";
|
|
|
|
|
|
this.tableSqlList.push({
|
|
|
tableSql: this.getStaticSQL(key),
|
|
|
sqlKey: this.staticSqlKey,
|
|
|
- })
|
|
|
- this.searchFieldList = searchFieldList
|
|
|
- })
|
|
|
+ });
|
|
|
+ this.searchFieldList = searchFieldList;
|
|
|
+ });
|
|
|
let res;
|
|
|
+ let res1;
|
|
|
if (this.tId) {
|
|
|
data.menuId = this.menuId;
|
|
|
data.sqlKey = this.editData.sqlKey;
|
|
|
+ data.tableKey = this.editData.tableKey;
|
|
|
res = await editTable(data);
|
|
|
- this.dragTableStatisticList.forEach(item => {
|
|
|
- item.tableKey = this.editData.tableKey
|
|
|
- })
|
|
|
+ this.dragTableStatisticList.forEach((item) => {
|
|
|
+ item.tableKey = this.editData.tableKey;
|
|
|
+ });
|
|
|
res1 = await updateStatistic({
|
|
|
- tableKey: this.editData.tableKey,
|
|
|
- dragTableStatisticList: this.dragTableStatisticList,
|
|
|
- tableSqlList: this.tableSqlList,
|
|
|
- searchFieldList: this.searchFieldList,
|
|
|
- dtTableName: this.tableName
|
|
|
- })
|
|
|
-
|
|
|
+ tableKey: this.editData.tableKey,
|
|
|
+ dragTableStatisticList: this.dragTableStatisticList,
|
|
|
+ tableSqlList: this.tableSqlList,
|
|
|
+ searchFieldList: this.searchFieldList,
|
|
|
+ dtTableName: this.tableName,
|
|
|
+ });
|
|
|
} else {
|
|
|
data.menuId = result.data;
|
|
|
res = await addDragTable(data);
|
|
|
- }
|
|
|
- this.staticSqlKey = uuidv4();
|
|
|
- this.dragTableStatisticList.forEach((item) => {
|
|
|
- console.log(item);
|
|
|
- let key =
|
|
|
- item.statisticType +
|
|
|
- "(" +
|
|
|
- item.statisticField +
|
|
|
- ")" +
|
|
|
- " as result";
|
|
|
- this.tableSqlList.push({
|
|
|
- tableSql: this.getStaticSQL(key),
|
|
|
- sqlKey: this.staticSqlKey,
|
|
|
- });
|
|
|
- this.searchFieldList = searchFieldList;
|
|
|
- item.sqlKey = this.staticSqlKey;
|
|
|
- item.tableKey = this.tableKey;
|
|
|
- });
|
|
|
|
|
|
- if (res.code == 200 && this.dragTableStatisticList.length !== 0) {
|
|
|
- this.countHandle();
|
|
|
- }
|
|
|
-
|
|
|
- this.dragTableStatisticList.forEach(item => {
|
|
|
- item.tableKey = this.tableKey
|
|
|
- })
|
|
|
- if(res.code == 200 && this.dragTableStatisticList.length !== 0){
|
|
|
+ this.dragTableStatisticList.forEach((item) => {
|
|
|
+ item.tableKey = this.tableKey;
|
|
|
+ });
|
|
|
+ if (res.code == 200 && this.dragTableStatisticList.length !== 0) {
|
|
|
// 新增统计数据
|
|
|
res1 = addStatistic({
|
|
|
tableKey: this.tableKey,
|
|
|
dragTableStatisticList: this.dragTableStatisticList,
|
|
|
tableSqlList: this.tableSqlList,
|
|
|
searchFieldList: this.searchFieldList,
|
|
|
- dtTableName: this.tableName
|
|
|
- })
|
|
|
+ dtTableName: this.tableName,
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1702,7 +1654,7 @@ export default {
|
|
|
}
|
|
|
this.isShowPreview = false;
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$message.warning("请完善表单");
|
|
|
return false;
|
|
@@ -1782,57 +1734,37 @@ export default {
|
|
|
},
|
|
|
// 添加数据字段对话框
|
|
|
async addDataDialog() {
|
|
|
- this.staictitle = '添加统计数据字段'
|
|
|
+ this.staictitle = "添加统计数据字段";
|
|
|
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() {
|
|
|
- console.log(this.dataCountFormData);
|
|
|
- // this.dragTableStatisticList = this.dragTableStatisticList.map(value => value.xid == this.dataCountFormData.xid || value.id == this.dataCountFormData.id ? this.dataCountFormData : value)
|
|
|
- upadtaData(){
|
|
|
this.dragTableStatisticList.forEach((item, index) => {
|
|
|
- console.log(this.dataCountFormData);
|
|
|
- if (item?.id == this.dataCountFormData?.id) {
|
|
|
+ // 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) {
|
|
|
+ } else if (item.xid == this.dataCountFormData.xid) {
|
|
|
this.dragTableStatisticList[index] = this.dataCountFormData;
|
|
|
- // 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){
|
|
|
- this.dragTableStatisticList[index] = this.dataCountFormData
|
|
|
}
|
|
|
});
|
|
|
this.isShowAddData = false;
|
|
|
- console.log(this.dragTableStatisticList);
|
|
|
- this.dataCountFormData = {};
|
|
|
- })
|
|
|
- this.isShowAddData = false
|
|
|
// console.log(this.dragTableStatisticList)
|
|
|
- this.dataCountFormData = {}
|
|
|
+ this.dataCountFormData = {};
|
|
|
},
|
|
|
// 添加数据字段
|
|
|
addData() {
|
|
|
- console.log(this.dataCountFormData);
|
|
|
+ // console.log(this.dataCountFormData);
|
|
|
this.dataCountFormData.xid = Date.now();
|
|
|
this.dataCountFormData.tableKey = this.tableKey;
|
|
|
this.dragTableStatisticList.push(this.dataCountFormData);
|
|
|
this.isShowAddData = false;
|
|
|
this.dataCountFormData = {};
|
|
|
- addData(){
|
|
|
- // console.log(this.dataCountFormData);
|
|
|
- this.dataCountFormData.xid = Date.now()
|
|
|
- this.dataCountFormData.tableKey = this.tableKey
|
|
|
- this.dragTableStatisticList.push(this.dataCountFormData)
|
|
|
- this.isShowAddData = false
|
|
|
- this.dataCountFormData = {}
|
|
|
},
|
|
|
// 关闭添加数据字段
|
|
|
closeAddDialog() {
|
|
@@ -1851,32 +1783,21 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 修改统计信息
|
|
|
- handleUpdateStat(row) {
|
|
|
- console.log(row);
|
|
|
- this.staictitle = "修改统计数据字段";
|
|
|
+ async handleUpdateStat(row) {
|
|
|
+ // console.log(row);
|
|
|
this.dataCountFormData = row;
|
|
|
this.dataCountFormData.xid = Date.now();
|
|
|
- this.addDataDialog();
|
|
|
- this.isShowAddData = true;
|
|
|
- console.log(this.dataCountFormData);
|
|
|
- console.log(this.dragTableStatisticList);
|
|
|
- async handleUpdateStat(row){
|
|
|
- // console.log(row);
|
|
|
- this.dataCountFormData = row
|
|
|
- this.dataCountFormData.xid = Date.now()
|
|
|
- this.staictitle = '修改统计数据字段'
|
|
|
+ this.staictitle = "修改统计数据字段";
|
|
|
this.dataType = await this.getDicts("table_statistic_type");
|
|
|
this.dataType = this.dataType.data;
|
|
|
- this.isShowAddData = true
|
|
|
+ this.isShowAddData = true;
|
|
|
// console.log(this.dataCountFormData)
|
|
|
// console.log(this.dragTableStatisticList);
|
|
|
},
|
|
|
// 删除统计信息
|
|
|
handleDeleteStat(row) {
|
|
|
this.dragTableStatisticList.forEach((item, index) => {
|
|
|
- console.log(item);
|
|
|
if (item.id == row.id) {
|
|
|
- if(item.id == row.id){
|
|
|
this.dragTableStatisticList.splice(index, 1);
|
|
|
}
|
|
|
});
|