合并代码
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
rowKey="id"
|
||||
:data-source="dataSource"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
@change="tableOnChange"
|
||||
:columns="columns"
|
||||
>
|
||||
<span slot="projectName" slot-scope="text,record" :title="text">
|
||||
@@ -131,6 +132,8 @@ export default {
|
||||
toggleSearchStatus: false,
|
||||
selectedRowKeys: [],
|
||||
selectedRowKeysArray: '',
|
||||
orderBy: '1',
|
||||
orderByField: '',
|
||||
formInline: {},
|
||||
rules: {
|
||||
paramsTemplateName:[
|
||||
@@ -154,11 +157,20 @@ export default {
|
||||
pageNo: 1,
|
||||
title: '新增',
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('zoneOfApplication'),
|
||||
align: 'center',
|
||||
width: 160,
|
||||
ellipsis: true,
|
||||
sorter:true,
|
||||
dataIndex: 'region_dictText',
|
||||
},
|
||||
{
|
||||
title: this.$t('parameterTemplate'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
sorter:true,
|
||||
dataIndex: 'paramsTemplateName',
|
||||
scopedSlots: { customRender: 'projectName' }
|
||||
},
|
||||
@@ -181,6 +193,7 @@ export default {
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
width: 160,
|
||||
sorter:true,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
@@ -188,6 +201,7 @@ export default {
|
||||
align: 'center',
|
||||
width: 160,
|
||||
ellipsis: true,
|
||||
sorter:true,
|
||||
dataIndex: 'updateTime'
|
||||
},
|
||||
{
|
||||
@@ -354,10 +368,27 @@ export default {
|
||||
this.queryParam[value] = id
|
||||
this.queryParam = { ...this.queryParam }
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
if(sorter.columnKey == 'region_dictText'){
|
||||
this.orderByField = 'region'
|
||||
} else if(sorter.columnKey == 'paramsTemplateName') {
|
||||
this.orderByField = 'params_template_name'
|
||||
} else if(sorter.columnKey == 'createTime') {
|
||||
this.orderByField = 'create_time'
|
||||
} else if(sorter.columnKey == 'updateTime') {
|
||||
this.orderByField = 'update_time'
|
||||
} else{
|
||||
this.orderByField = sorter.columnKey
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
let query = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
orderBy: this.orderBy,
|
||||
orderByField: this.orderByField,
|
||||
...this.queryParam
|
||||
}
|
||||
this.loading = true
|
||||
|
||||
Reference in New Issue
Block a user