We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f17a738 commit deb32faCopy full SHA for deb32fa
server/resource/autocode_template/web/table.vue.tpl
@@ -452,7 +452,22 @@ const searchInfo = ref({})
452
{{- if .NeedSort}}
453
// 排序
454
const sortChange = ({ prop, order }) => {
455
- searchInfo.value.sort = prop
+ const sortMap = {
456
+ {{- range .Fields}}
457
+ {{- if and .Sort}}
458
+ {{- if not (eq .ColumnName "")}}
459
+ {{.FieldJson}}: '{{.ColumnName}}',
460
+ {{- end}}
461
462
463
+ }
464
+
465
+ let sort = sortMap[prop]
466
+ if(!sort){
467
+ sort = prop.replace(/[A-Z]/g, match => _${match.toLowerCase()})
468
469
470
+ searchInfo.value.sort = sort
471
searchInfo.value.order = order
472
getTableData()
473
}
0 commit comments