mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
优化字典
This commit is contained in:
parent
66580ada12
commit
376b8d8b13
@ -1,4 +1,3 @@
|
|||||||
import { sortBy } from "lodash";
|
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { computed, reactive } from "vue";
|
import { computed, reactive } from "vue";
|
||||||
import { isDev, useCool } from "/@/cool";
|
import { isDev, useCool } from "/@/cool";
|
||||||
@ -28,7 +27,7 @@ export const useDictStore = defineStore("dict", () => {
|
|||||||
const d: any = {};
|
const d: any = {};
|
||||||
|
|
||||||
for (const i in res) {
|
for (const i in res) {
|
||||||
d[i] = sortBy(res[i], "orderNum").map((e) => {
|
d[i] = res[i].map((e: any) => {
|
||||||
return {
|
return {
|
||||||
label: e.name,
|
label: e.name,
|
||||||
value: e.id
|
value: e.id
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
ref="Table"
|
ref="Table"
|
||||||
:default-sort="{
|
:default-sort="{
|
||||||
prop: 'orderNum',
|
prop: 'orderNum',
|
||||||
order: 'descending'
|
order: 'ascending'
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
Loading…
Reference in New Issue
Block a user