参数模板管理;未符合项;参数导出模板管理 表格排序问题

This commit is contained in:
zyx.net
2022-12-23 10:59:20 +08:00
parent 4f8f1626b6
commit 8c0b7bf0c0
4 changed files with 60 additions and 0 deletions
@@ -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:[
@@ -159,6 +162,7 @@ export default {
align: 'center',
width: 160,
ellipsis: true,
sorter:true,
dataIndex: 'region_dictText',
},
{
@@ -166,6 +170,7 @@ export default {
align: 'center',
width: 180,
ellipsis: true,
sorter:true,
dataIndex: 'paramsTemplateName',
scopedSlots: { customRender: 'projectName' }
},
@@ -181,6 +186,7 @@ export default {
align: 'center',
dataIndex: 'createTime',
width: 160,
sorter:true,
ellipsis: true,
},
{
@@ -188,6 +194,7 @@ export default {
align: 'center',
width: 160,
ellipsis: true,
sorter:true,
dataIndex: 'updateTime'
},
{
@@ -354,10 +361,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
@@ -40,6 +40,7 @@
:scroll="{x: '100%',y:'calc(100vh - 160px)'}"
rowKey="id"
:data-source="dataSource"
@change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
@@ -115,6 +116,8 @@ export default {
selectedRowKeys: [],
selectedRowKeysArray: '',
formInline: {},
orderBy: '1',
orderByField: '',
rules: {
paramsTemplateName:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('templateName'), trigger: 'change' },
@@ -150,6 +153,7 @@ export default {
title: this.$t('templateName'),
align: 'center',
dataIndex: 'templateName',
sorter:true,
ellipsis: true,
width: 300,
scopedSlots: { customRender: 'templateName' }
@@ -181,6 +185,7 @@ export default {
align: 'center',
width: 180,
ellipsis: true,
sorter:true,
dataIndex: 'updateTime'
},
{
@@ -334,10 +339,23 @@ export default {
this.queryParam[value] = id
this.queryParam = { ...this.queryParam }
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
if(sorter.columnKey == 'templateName') {
this.orderByField = 'template_name'
} 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
@@ -1511,6 +1511,8 @@
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
if(sorter.columnKey == 'attestationRank_dictText'){
this.orderByField = 'attestationRank'
} else if(sorter.columnKey == 'dutyTerritory_dictText'){
this.orderByField = 'dutyTerritory'
} else{
this.orderByField = sorter.columnKey
}
@@ -56,6 +56,7 @@
:pagination="false"
:scroll="{x: '100%'}"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
@change="tableOnChange"
:data-source="dataSource"
:columns="columns"
>
@@ -91,6 +92,8 @@
return {
queryParam: {},
loading: false,
orderBy: '1',
orderByField: '',
dataSource: [],
selectedRowKeys: [],
columns: [
@@ -100,6 +103,7 @@
dataIndex: 'serialNumber',
scopedSlots: { customRender: 'standard' },
ellipsis: true,
sorter:true,
width: 180
},
{
@@ -115,6 +119,7 @@
align: 'center',
dataIndex: 'flowType',
ellipsis: true,
sorter:true,
width: 180
},
{
@@ -122,6 +127,7 @@
align: 'center',
dataIndex: 'dutyTerritory',
ellipsis: true,
sorter:true,
width: 180
},
{
@@ -129,6 +135,7 @@
align: 'center',
dataIndex: 'problemType',
ellipsis: true,
sorter:true,
width: 180
},
{
@@ -136,6 +143,7 @@
align: 'center',
dataIndex: 'initiator',
ellipsis: true,
sorter:true,
width: 140
},
{
@@ -143,6 +151,7 @@
align: 'center',
dataIndex: 'duty',
ellipsis: true,
sorter:true,
width: 140
}
],
@@ -218,11 +227,18 @@
}
downloadFilePost(this.url.exportData, this.$t('NonConformance') + '.xls', query, this.Deselect)
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.getList()
},
getList() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
projectLibraryId: this.$route.query.id,
orderBy: this.orderBy,
orderByField: this.orderByField,
...this.queryParam
}
this.loading = true