任务清单;法规清单 表格排序问题

This commit is contained in:
zyx.net
2022-12-16 17:01:15 +08:00
parent e3922c9f23
commit 87ee7e6df0
2 changed files with 40 additions and 1 deletions
@@ -109,6 +109,7 @@
:scroll="{x: true,y:'calc(100vh - 335px)'}"
:data-source="dataSource"
rowKey="id"
@change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
@@ -255,12 +256,14 @@
align: 'center',
dataIndex: 'standard',
width: 202,
sorter:true,
scopedSlots: { customRender: 'standardInformation' }
},
{
title: this.$t('areaOfResponsibility'),
align: 'center',
width: 180,
sorter:true,
dataIndex: 'areaOfResponsibility',
scopedSlots: { customRender: 'areaOfResponsibility' }
},
@@ -268,6 +271,7 @@
title: this.$t('confirmationOfDesignConformity'),
align: 'center',
width: 240,
sorter:true,
dataIndex: 'confirmationOfDesignConformity',
scopedSlots: { customRender: 'confirmationOfDesignConformity' }
},
@@ -275,6 +279,7 @@
title: this.$t('PrehomoConfirmation'),
align: 'center',
width: 240,
sorter:true,
dataIndex: 'PrehomoConfirmation',
scopedSlots: { customRender: 'PrehomoConfirmation' }
},
@@ -282,6 +287,7 @@
title: this.$t('verificationAndConformityconfirmation'),
align: 'center',
width: 240,
sorter:true,
dataIndex: 'verificationAndConformityconfirmation',
scopedSlots: { customRender: 'verificationAndConformityconfirmation' }
},
@@ -289,6 +295,7 @@
title: this.$t('CertificationProgress'),
align: 'center',
width: 150,
sorter:true,
dataIndex: 'CertificationProgress',
scopedSlots: { customRender: 'CertificationProgress' }
},
@@ -296,11 +303,14 @@
title: this.$t('CurrentStatus'),
align: 'center',
width: 150,
sorter:true,
dataIndex: 'CurrentProjectStatusEvaluation',
scopedSlots: { customRender: 'CurrentProjectStatusEvaluation' }
}
],
selectedRowKeys: [],
orderBy: '1',
orderByField: '',
status: {
'NotDone': '待办',
@@ -535,7 +545,11 @@
CertificationDirectory() {
this.$refs.certificationDirectoryRef.addModel()
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.getList()
},
getList() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam))
Object.keys(queryParam).forEach(val => {
@@ -548,6 +562,8 @@
}
let query = {
projectLibraryId: this.$route.query.id,
orderBy: this.orderBy,
orderByField: this.orderByField,
...queryParam
}
this.loading = true
@@ -208,6 +208,7 @@
:scroll="{x: '100%',y:'calc(100vh - 356px)'}"
rowKey="id"
:data-source="dataSource"
@change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
@@ -488,6 +489,8 @@
return {
roleSwitchingList: [],
listTitle: '',
orderBy: '1',
orderByField: '',
columnsAll: [
{
title: this.$t('standard'),
@@ -495,6 +498,7 @@
dataIndex: 'serialNumber',
width: 180,
fixed: 'left',
sorter:true,
scopedSlots: { customRender: 'standard' }
},
{
@@ -517,11 +521,13 @@
align: 'center',
dataIndex: 'inventoryAffirmStatusName',
width: 240,
sorter:true,
ellipsis: true
},
{
title: this.$t('taskAffirmStatus'),
align: 'center',
sorter:true,
dataIndex: 'taskAffirmStatusName',
width: 240,
ellipsis: true
@@ -578,6 +584,7 @@
align: 'center',
dataIndex: 'attestationRank_dictText',
width: 180,
sorter:true,
ellipsis: true
},
{
@@ -592,12 +599,14 @@
align: 'center',
dataIndex: 'wvtaId',
width: 180,
sorter:true,
ellipsis: true
},
{
title: this.$t('areaOfResponsibility'),
align: 'center',
ellipsis: true,
sorter:true,
dataIndex: 'dutyTerritory_dictText',
width: 180
},
@@ -605,6 +614,7 @@
title: this.$t('regulatoryEngineer'),
align: 'center',
ellipsis: true,
sorter:true,
dataIndex: 'regulationOwnerName',
width: 180
},
@@ -612,6 +622,7 @@
title: this.$t('certifiedEngineer'),
align: 'center',
ellipsis: true,
sorter:true,
dataIndex: 'homologationEngineerName',
width: 180
},
@@ -619,6 +630,7 @@
title: this.$t('engineeringInterfacePerson'),
align: 'center',
ellipsis: true,
sorter:true,
dataIndex: 'engineeringInterfacePersonName',
width: 180
},
@@ -1495,6 +1507,15 @@
this.queryParamQuery = sqp
this.getList()
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
if(sorter.columnKey == 'attestationRank_dictText'){
this.orderByField = 'attestationRank'
} else{
this.orderByField = sorter.columnKey
}
this.getList()
},
getList() {
let roleCode
if (this.isDisplay) {
@@ -1520,6 +1541,8 @@
...this.queryParamQuery,
...queryParam,
projectLibraryId: this.$route.query.id,
orderBy: this.orderBy,
orderByField: this.orderByField,
roleCode: roleCode
}
this.loading = true