|
@@ -275,6 +275,40 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="时间格式" prop="timeFormate">
|
|
|
+ <el-select
|
|
|
+ v-model="tableItemForm.timeFormate"
|
|
|
+ placeholder="请选择时间格式"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="val in dict.type.sys_time_format"
|
|
|
+ :key="val.value"
|
|
|
+ :label="val.label"
|
|
|
+ :value="val.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="排序依赖字段">
|
|
|
+ <el-select
|
|
|
+ v-model="tableItemForm.orderByColumn"
|
|
|
+ placeholder="请选择排序依赖"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="val in orderByFieldList"
|
|
|
+ :key="val.fieldName"
|
|
|
+ :label="val.fieldDescription"
|
|
|
+ :value="val.tableName + '.' + val.fieldName"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="排序方式" v-show="tableItemForm.orderByColumn">
|
|
|
+ <el-radio v-model="tableItemForm.isAsc" :label="false"
|
|
|
+ >升序</el-radio
|
|
|
+ >
|
|
|
+ <el-radio v-model="tableItemForm.isAsc" :label="true"
|
|
|
+ >降序</el-radio
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="展示字段:" prop="FieldList">
|
|
|
<el-table
|
|
|
:data="tableFieldList"
|
|
@@ -284,7 +318,6 @@
|
|
|
max-height="500px"
|
|
|
class="tablefiled"
|
|
|
>
|
|
|
-
|
|
|
<el-table-column
|
|
|
type="index"
|
|
|
label="序号"
|
|
@@ -382,7 +415,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="isSearch" label="是否包含查询">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-switch v-model="scope.row.isSearch"> </el-switch>
|
|
|
+ <el-switch v-model="scope.row.isSearch" @change="isSearchChange($event, scope.row, scope.$index)"> </el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -394,6 +427,37 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 是否包含查询字段 -->
|
|
|
+ <div class="isSearch">
|
|
|
+ <el-dialog
|
|
|
+ title="包含查询依赖值"
|
|
|
+ :visible.sync="isSearchDialog">
|
|
|
+ <el-select v-model="relyOption" placeholder="请选择依赖方式">
|
|
|
+ <el-option
|
|
|
+ v-for="item in relyOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input v-show="relyOption === '0'" v-model="relaVal" placeholder="请输入依赖内容"></el-input>
|
|
|
+
|
|
|
+ <el-select v-show="relyOption === '1'" v-model="relaVal" placeholder="请选择依赖字段">
|
|
|
+ <el-option
|
|
|
+ v-for="item in relyFileds.tableFieldList"
|
|
|
+ :key="item.fieldName"
|
|
|
+ :label="item.fieldDescription"
|
|
|
+ :value="item.fieldName">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isSearchCancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="isSearchBtn">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -414,9 +478,28 @@ import json from "highlight.js/lib/languages/json";
|
|
|
export default {
|
|
|
name: "relateTable",
|
|
|
components: { Treeselect },
|
|
|
-
|
|
|
+ dicts: ["sys_time_format", "table_statistic_type"],
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 包含查询依赖字段dialog
|
|
|
+ isSearchDialog: false,
|
|
|
+ isSearchIndex: null,
|
|
|
+ // 依赖方式
|
|
|
+ relyOption: null,
|
|
|
+ relyOptions:[
|
|
|
+ {
|
|
|
+ value: '0',
|
|
|
+ label: '自定义依赖值'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label: '依赖其他字段'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 依赖值
|
|
|
+ relaVal: '',
|
|
|
+ // 上个表格名称及字段
|
|
|
+ relyFileds: {},
|
|
|
addDragData:[],
|
|
|
// 创建data需要的参数
|
|
|
// data: {
|
|
@@ -474,6 +557,8 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
searchFieldList: [],
|
|
|
+ // 依赖字段
|
|
|
+ relyFiledsList: [],
|
|
|
// 修改row
|
|
|
updataGroupRow:{},
|
|
|
// 遮罩层
|
|
@@ -537,6 +622,9 @@ export default {
|
|
|
title: "",
|
|
|
tableName: "",
|
|
|
selectFields: "",
|
|
|
+ isAsc: false,
|
|
|
+ timeFormate: "",
|
|
|
+ orderByColumn: "",
|
|
|
},
|
|
|
tableGroupList: [],
|
|
|
// 成员表格提示
|
|
@@ -563,6 +651,9 @@ export default {
|
|
|
databaseType: (state) => state.user.dataSource.databaseType,
|
|
|
username: (state) => state.user.dataSource.username,
|
|
|
}),
|
|
|
+ orderByFieldList() {
|
|
|
+ return this.tableFieldList;
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
'tableItemForm.tableName': function (val) {
|
|
@@ -585,6 +676,34 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 是否包含查询switch
|
|
|
+ isSearchChange(status, row,index){
|
|
|
+ this.isSearchDialog = status
|
|
|
+ this.isSearchIndex = index
|
|
|
+ },
|
|
|
+ // 添加依赖字段取消
|
|
|
+ isSearchCancel(){
|
|
|
+ this.relyOption = null
|
|
|
+ this.relaVal = ''
|
|
|
+ this.isSearchDialog = false
|
|
|
+ this.tableFieldList[this.isSearchIndex].isSearch = false
|
|
|
+ },
|
|
|
+ isSearchBtn(){
|
|
|
+ console.log(this.relaVal);
|
|
|
+ console.log(this.relyFileds.tableName);
|
|
|
+ if(this.relyFileds.tableName !== undefined){
|
|
|
+ this.relyFiledsList.push({
|
|
|
+ tableName:this.relyFileds.tableName,
|
|
|
+ relaVal: this.relaVal
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.relyFiledsList.push({
|
|
|
+ relaVal: this.relaVal
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(this.relyFiledsList);
|
|
|
+ this.isSearchDialog = false
|
|
|
+ },
|
|
|
// 获取路由表单数据
|
|
|
async getMenuList() {
|
|
|
let res = await listGroup();
|
|
@@ -837,6 +956,15 @@ export default {
|
|
|
columns,
|
|
|
searchFieldList,
|
|
|
);
|
|
|
+ this.relyFiledsList.forEach((item,index)=>{
|
|
|
+ if(item.tableName){
|
|
|
+ searchFieldList[index] = searchFieldList[index]+':' + item.tableName+'.'+ item.relaVal
|
|
|
+ } else {
|
|
|
+ searchFieldList[index] = searchFieldList[index] + ':' + item.relaVal
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(searchFieldList);
|
|
|
+ // console.log(searchFieldList);
|
|
|
// 判断是否有包含查询字段
|
|
|
if (!searchFieldList.length) {
|
|
|
this.$message.warning("请至少选择一个包含查询字段");
|
|
@@ -849,7 +977,9 @@ export default {
|
|
|
formData: this.groupForm,
|
|
|
}
|
|
|
// 判断修改还是新增
|
|
|
- if(this.relateTitle){
|
|
|
+ if(this.relateTitle){
|
|
|
+ this.relyFileds.tableFieldList = this.tableFieldList
|
|
|
+ this.relyFileds.tableName = this.tableItemForm.tableName
|
|
|
this.tableItemForm.rowId = Date.now();
|
|
|
|
|
|
this.groupList.push({tableFieldList: this.tableFieldList, tableItemForm: this.tableItemForm})
|
|
@@ -865,8 +995,8 @@ export default {
|
|
|
tableKey: tableKey,
|
|
|
dtTableName: this.tableItemForm.tableName,
|
|
|
primaryKey: this.tableItemForm.selectFields,
|
|
|
- orderByColumn: '',
|
|
|
- sortOrder: false,
|
|
|
+ orderByColumn: this.tableItemForm.orderByColumn,
|
|
|
+ sortOrder: this.tableItemForm.isAsc,
|
|
|
sqlKey: sqlKey,
|
|
|
dtColumnName: columns,
|
|
|
timeFormat: 'yyyy-MM-dd',
|
|
@@ -897,13 +1027,16 @@ export default {
|
|
|
this.isShowForm = false
|
|
|
this.tableItemForm = {}
|
|
|
this.tableFieldList = []
|
|
|
-
|
|
|
+ this.relyFiledsList = []
|
|
|
} else {
|
|
|
this.$message.error("请完善表单信息");
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // confirmAddHandler(){
|
|
|
+ // console.log(this.tableFieldList)
|
|
|
+ // },
|
|
|
// 修改一个表格数据
|
|
|
relateOne(row){
|
|
|
// console.log(row);
|
|
@@ -1243,6 +1376,14 @@ export default {
|
|
|
::v-deep .el-dialog:not(.is-fullscreen){
|
|
|
width: 900px !important;
|
|
|
}
|
|
|
+.isSearch {
|
|
|
+ ::v-deep .el-dialog:not(.is-fullscreen){
|
|
|
+ width: 320px !important;
|
|
|
+ }
|
|
|
+ ::v-deep .el-input--medium .el-input__inner{
|
|
|
+ margin-bottom: 10px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
.tablefiled{
|
|
|
::v-deep .el-input--medium .el-input__inner{
|
|
|
width: 70px !important;
|