|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="filters-container">
|
|
|
-
|
|
|
+ <el-button v-if="$route.query.column" @click="goBackPage"> 返回</el-button>
|
|
|
<el-input v-if="isModulesShow('search')" placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
|
|
|
|
|
|
<el-button v-if="isModulesShow('search')" @click="getData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
|
|
|
@@ -10,7 +10,7 @@
|
|
|
<el-button v-if="isModulesShow('query')" @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
|
|
|
</el-button>
|
|
|
|
|
|
- <el-button v-if="isModulesShow('add')" @click="$router.push({path:'/commonQuery',query:{code:$route.query.code,column:$route.query.column}})" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
|
|
|
+ <el-button v-if="isModulesShow('add')" @click="addRow" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
|
|
|
</el-button>
|
|
|
|
|
|
<el-button v-if="isModulesShow('excel')" @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
|
|
|
@@ -27,7 +27,7 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
|
- <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table" @sort-change="changeTableSort">
|
|
|
+ <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table" @sort-change="changeTableSort" border>
|
|
|
<el-table-column type="index" min-width="50" align="center">
|
|
|
</el-table-column>
|
|
|
<template v-for="item in tableColumns" v-if="isColumnShow(item.name)">
|
|
|
@@ -45,13 +45,22 @@
|
|
|
<el-table-column v-else sortable="custom" :prop="item.name" :label="item.remark" min-width="100">
|
|
|
</el-table-column>
|
|
|
</template>
|
|
|
- <el-table-column label="操作" align="center" fixed="right" v-if="isModulesShow('edit')">
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" v-if="isModulesShow('edit')" min-width="240">
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
- <template v-for="subtable in subtables">
|
|
|
- <el-button @click="$router.push({path:'/commonQuerys',query:{code:subtable.subCode,column:scope.row[subtable.column]+','+subtable.subColumn}})" type="primary" size="small" plain>{{subtable.name}}
|
|
|
+ <el-dropdown>
|
|
|
+ <el-button type="primary" size="mini" plain>
|
|
|
+ 更多
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
|
- </template>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <template v-for="subtable in subtables">
|
|
|
+ <el-button @click="goSubtable(scope.row,subtable)" type="primary" size="mini" plain>{{subtable.name}}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+
|
|
|
<el-button v-if="isModulesShow('edit')" @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
|
|
|
<el-button v-if="isModulesShow('del')" @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
|
|
|
</template>
|
|
|
@@ -122,6 +131,9 @@ import zh from 'date-fns/locale/zh_cn'
|
|
|
|
|
|
export default {
|
|
|
created() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.getTableBase();
|
|
|
},
|
|
|
data() {
|
|
|
@@ -166,6 +178,25 @@ export default {
|
|
|
this.orderByStr = '';
|
|
|
this.subtables = [];
|
|
|
|
|
|
+ this.totalNumber = 0;
|
|
|
+ this.totalPage = 10;
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.pageSize = 20;
|
|
|
+
|
|
|
+
|
|
|
+ if (this.$route.query.currentPage) {
|
|
|
+ this.currentPage = this.$route.query.currentPage;
|
|
|
+ this.pageNumber = this.$route.query.pageNumber;
|
|
|
+ }
|
|
|
+ if (this.$route.query.advancedQuery) {
|
|
|
+ this.advancedQuerySearchKey = this.$route.query.advancedQuery;
|
|
|
+ }
|
|
|
+ if (this.$route.query.searchKey) {
|
|
|
+ this.searchKey = this.$route.query.searchKey;
|
|
|
+ }
|
|
|
+ if (this.$route.query.orderByStr) {
|
|
|
+ this.orderByStr = this.$route.query.orderByStr;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
this.$http.get({
|
|
|
@@ -380,6 +411,41 @@ export default {
|
|
|
id: row.id || row.ID,
|
|
|
code: this.$route.query.code,
|
|
|
column: this.$route.query.column,
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ pageNumber: this.pageSize,
|
|
|
+ advancedQuery: this.advancedQuerySearchKey,
|
|
|
+ searchKey: this.filter1,
|
|
|
+ orderByStr: this.orderByStr,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goSubtable(row, subtable) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/commonQuerys',
|
|
|
+ query: {
|
|
|
+ code: subtable.subCode,
|
|
|
+ column: row[subtable.column] + ',' + subtable.subColumn,
|
|
|
+ // fatherCurrentPage: this.currentPage,
|
|
|
+ // fatherPageNumber: this.pageSize,
|
|
|
+ // fatherAdvancedQuery: this.advancedQuerySearchKey,
|
|
|
+ // fatherSearchKey: this.filter1,
|
|
|
+ // fatherOrderByStr: this.orderByStr,
|
|
|
+ // fatherCode: this.$route.query.code,
|
|
|
+ // fatherColumn: this.$route.query.column,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addRow() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/commonQuery',
|
|
|
+ query: {
|
|
|
+ code: this.$route.query.code,
|
|
|
+ column: this.$route.query.column,
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ pageNumber: this.pageSize,
|
|
|
+ advancedQuery: this.advancedQuerySearchKey,
|
|
|
+ searchKey: this.filter1,
|
|
|
+ orderByStr: this.orderByStr,
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -408,10 +474,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
exportExcel() {
|
|
|
- window.location.href = this.$baseUrl + "/commonQuery/exportExcel?advancedQuery="
|
|
|
- + this.advancedQuerySearchKey + "&tableName=" + this.tableName + "&databasetype=" + this.databasetype
|
|
|
- + "&searchColumn=" + this.searchColumn+ "&searchKey=" + this.filter1+ "&orderByStr=" + this.orderByStr
|
|
|
- + "&dataSourceCode=" + this.dataSourceCode;
|
|
|
+ window.location.href = this.$baseUrl + "/commonQuery/exportExcel?advancedQuery="
|
|
|
+ + this.advancedQuerySearchKey + "&tableName=" + this.tableName + "&databasetype=" + this.databasetype
|
|
|
+ + "&searchColumn=" + this.searchColumn + "&searchKey=" + this.filter1 + "&orderByStr=" + this.orderByStr
|
|
|
+ + "&dataSourceCode=" + this.dataSourceCode;
|
|
|
+ },
|
|
|
+ goBackPage() {
|
|
|
+ this.$router.go(-1);
|
|
|
},
|
|
|
},
|
|
|
watch: {
|