Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
391e696d8a
24
src/App.vue
24
src/App.vue
|
|
@ -63,7 +63,7 @@
|
|||
" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ValueCN" :label="$t('il8n:table:state')" sortable="custom">
|
||||
<el-table-column prop="State" :label="$t('il8n:table:state')" sortable="custom">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.State" clearable filterable size="mini">
|
||||
<el-option v-for="item of $d.InternationalizationKeyState"
|
||||
|
|
@ -150,15 +150,21 @@ export default {
|
|||
methods: {
|
||||
// 排序
|
||||
handleSortByColumn(column) {
|
||||
if (column.order === 'ascending') {
|
||||
this.tableData.sort((a, b) =>
|
||||
a[column.prop].localeCompare(b[column.prop])
|
||||
)
|
||||
} else {
|
||||
this.tableData.sort((a, b) =>
|
||||
b[column.prop].localeCompare(a[column.prop])
|
||||
)
|
||||
const { prop, order } = column
|
||||
if (!prop || !order) {
|
||||
this.tableData = [...this.tableData]
|
||||
return
|
||||
}
|
||||
|
||||
const collator = new Intl.Collator('zh-Hans-CN', {
|
||||
numeric: true,
|
||||
sensitivity: 'base',
|
||||
})
|
||||
|
||||
this.tableData.sort((a, b) => {
|
||||
const result = collator.compare(a[prop], b[prop])
|
||||
return order === 'ascending' ? result : -result
|
||||
})
|
||||
},
|
||||
handleStateChange() {
|
||||
this.tableData.forEach((item) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue