@@ -61,19 +61,29 @@
diff --git a/web/src/components/KuSelect.vue b/web/src/components/KuSelect.vue
index 2eb92b6..93f02c8 100644
--- a/web/src/components/KuSelect.vue
+++ b/web/src/components/KuSelect.vue
@@ -6,7 +6,7 @@
-
+
@@ -54,7 +54,13 @@ export default {
...this.prop
}
},
- ops: v => v.dict ? v.$dict.getDict(v.dict) : v.selectList
+ ops: v => {
+ if (v.dict) {
+ const options = {}
+ v.$dict.getDict(v.dict).map(e => options[e.dictValue] = e.dictName)
+ return options
+ } else return v.selectList
+ }
},
methods: {
getOptions() {
diff --git a/web/src/components/sliderNav.vue b/web/src/components/sliderNav.vue
index 46bc6cb..4de02b5 100644
--- a/web/src/components/sliderNav.vue
+++ b/web/src/components/sliderNav.vue
@@ -14,7 +14,8 @@
-
+
@@ -59,8 +60,12 @@ export default {
this.menus = this.$arr2tree(menus, {parent: "parent"})
}
}).finally(() => {
+ //超管才有的初始化菜单
if (this.menus.length == 0 && this.user.level == 1) {
- this.menus = [{id: '202302071139', label: "菜单管理", route: "AppMenu"}]
+ this.menus = [
+ {id: '202302071139', label: "菜单管理", route: "AppMenu"},
+ {id: '202302102232', label: "字典管理", route: "AppDictionary"},
+ ]
}
})
},
diff --git a/web/src/utils/dict.js b/web/src/utils/dict.js
index 99eef24..c06883b 100644
--- a/web/src/utils/dict.js
+++ b/web/src/utils/dict.js
@@ -4,7 +4,6 @@ import http from "./axios";
* 封装字典工具类
*/
const $dict = {
- url: "/api/dict/listByCodes",
loading: [],
resolves: [],
getStorage() {
@@ -13,9 +12,15 @@ const $dict = {
},
getData(codeList) {
codeList = [codeList].flat().filter(Boolean).toString()
- return http.post(this.url, null, {
+ return http.post("/api/dict/listByCodes", null, {
withoutToken: true, params: {codeList}
}).then(res => res?.data && this.setStorage(res.data))
+ .finally(() => this.setStorage({
+ key: "yesOrNo", values: [
+ {dictValue: '0', dictName: "否"},
+ {dictValue: '1', dictName: "是"}
+ ]
+ }))
},
load(...code) {
return new Promise(resolve => {
@@ -32,8 +37,8 @@ const $dict = {
})
},
setStorage(data) {
- let ds = this.getStorage()
- data.map(p => {
+ let ds = this.getStorage();
+ [data].flat().map(p => {
if (ds.some(d => d.key == p.key)) {
const index = ds.findIndex(d => d.key == p.key)
ds.splice(index, 1, p)
diff --git a/web/src/utils/router.js b/web/src/utils/router.js
index 4ab20f3..426e991 100644
--- a/web/src/utils/router.js
+++ b/web/src/utils/router.js
@@ -6,7 +6,7 @@ import {mainStore} from "./store";
let home = {name: "工作台", path: "/", component: () => import('../views/home')},
routes = [{name: "登录", path: "/login", component: () => import('../views/login')}]
const loadApps = () => {
- const files = import.meta.glob('../apps/App*.vue'), apps = []
+ const files = import.meta.glob('../apps/**/App*.vue'), apps = []
return Promise.all(Object.keys(files).map(path => {
return files?.[path]()?.then(file => {
if (file.default) {