优化字典

This commit is contained in:
icssoa 2022-07-06 16:29:27 +08:00
parent 66580ada12
commit 376b8d8b13
2 changed files with 2 additions and 3 deletions

View File

@ -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

View File

@ -24,7 +24,7 @@
ref="Table" ref="Table"
:default-sort="{ :default-sort="{
prop: 'orderNum', prop: 'orderNum',
order: 'descending' order: 'ascending'
}" }"
/> />
</el-row> </el-row>