国际化排序
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
7b90715953
commit
21dab27e0b
38
src/App.vue
38
src/App.vue
|
@ -62,12 +62,14 @@
|
||||||
v-adaptive="{ bottomOffset: 50 }"
|
v-adaptive="{ bottomOffset: 50 }"
|
||||||
height="100"
|
height="100"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@sort-change="handleSortByColumn"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="Code"
|
prop="Code"
|
||||||
:label="$t('il8n:table:label')"
|
:label="$t('il8n:table:label')"
|
||||||
width="300"
|
width="300"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
|
sortable="custom"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column-->
|
<!-- <el-table-column-->
|
||||||
|
@ -79,7 +81,11 @@
|
||||||
<!-- {{scope.row.Description}}-->
|
<!-- {{scope.row.Description}}-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<el-table-column prop="Value" :label="$t('il8n:table:en')">
|
<el-table-column
|
||||||
|
prop="Value"
|
||||||
|
:label="$t('il8n:table:en')"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.Value"
|
v-model="scope.row.Value"
|
||||||
|
@ -92,7 +98,11 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="ValueCN" :label="$t('il8n:table:cn')">
|
<el-table-column
|
||||||
|
prop="ValueCN"
|
||||||
|
:label="$t('il8n:table:cn')"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.ValueCN"
|
v-model="scope.row.ValueCN"
|
||||||
|
@ -105,7 +115,11 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="ValueCN" :label="$t('il8n:table:state')">
|
<el-table-column
|
||||||
|
prop="ValueCN"
|
||||||
|
:label="$t('il8n:table:state')"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="scope.row.State"
|
v-model="scope.row.State"
|
||||||
|
@ -122,7 +136,11 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="Version" :label="$t('il8n:table:Version')">
|
<el-table-column
|
||||||
|
prop="Version"
|
||||||
|
:label="$t('il8n:table:Version')"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div style="text-align: right; padding-top: 10px; padding-right: 10px">
|
<div style="text-align: right; padding-top: 10px; padding-right: 10px">
|
||||||
|
@ -195,6 +213,18 @@ export default {
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
methods: {
|
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])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
handleStateChange() {
|
handleStateChange() {
|
||||||
this.tableData.forEach((item) => {
|
this.tableData.forEach((item) => {
|
||||||
item.State = this.State
|
item.State = this.State
|
||||||
|
|
Loading…
Reference in New Issue