no commit message

This commit is contained in:
西城念云 2020-01-06 17:15:16 +08:00
parent 2cd9764caf
commit d3e2f67c2f
3 changed files with 24 additions and 7 deletions

View File

@ -86,10 +86,10 @@
<el-table v-loading="loading" stripe border fit highlight-current-row :data="companyList" @selection-change="handleSelectionChange" @sort-change='tableSortChange'>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="号" width="80" align="center">
<el-table-column label="号" width="80" align="center">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column label="UUID" align="center" prop="id" v-if = "show" />
<el-table-column label="UUID" align="center" prop="id" v-if = "false" />
<el-table-column label="排序" align="center" prop="sort" sortable='custom' :sort-orders="['ascending', 'descending']" />
<el-table-column label="公司代码" align="center" prop="codeid" sortable='custom' :sort-orders="['ascending', 'descending']" />
<el-table-column label="公司简称" align="center" prop="name" sortable='custom' :sort-orders="['ascending', 'descending']" />
@ -225,7 +225,7 @@ export default {
},
methods: {
/** 公司管理排序 */
tableSortChange(column, prop, order) {
tableSortChange(column) {
this.queryParams.pageNum = 1;
if (column.order === 'descending') {
this.queryParams.orderByColumn = column.prop;

View File

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://101.200.41.149:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源

View File

@ -97,8 +97,11 @@
</el-col>
</el-row>
<el-table v-loading="loading" :data="${businessName}List" stripe height @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table v-loading="loading" :data="${businessName}List" stripe height @selection-change="handleSelectionChange" @sort-change='tableSortChange'>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="行号" width="80" align="center">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
#foreach($column in $columns)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
@ -118,7 +121,7 @@
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}" :formatter="${javaField}Format" />
#elseif($column.list && "" != $javaField)
<el-table-column label="${comment}" align="center" prop="${javaField}" />
<el-table-column label="${comment}" align="center" prop="${javaField}" sortable='custom' :sort-orders="['ascending', 'descending']" />
#end
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -265,6 +268,8 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
orderByColumn: undefined,
isAsc: undefined,
#foreach ($column in $columns)
#if($column.query)
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
@ -304,6 +309,18 @@ export default {
#end
},
methods: {
/** 通用${functionName}排序 */
tableSortChange(column) {
this.queryParams.pageNum = 1;
if (column.order === 'descending') {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = 'desc';
} else {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = 'asc';
}
this.getList();
},
/** 查询${functionName}列表 */
getList() {
this.loading = true;