From 5d0e4bcaf5d44a9ce2ff196e38c77676aa8ea880 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Fri, 12 Jun 2026 16:37:15 +0800
Subject: [PATCH] 中科大支线—添加菜单、角色
---
src/store/modules/dict.js | 98 ++++++++++++++++++++++++------------------------
1 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js
index 27fc308..6b18f9c 100644
--- a/src/store/modules/dict.js
+++ b/src/store/modules/dict.js
@@ -1,57 +1,57 @@
const useDictStore = defineStore(
- 'dict',
- {
- state: () => ({
- dict: new Array()
- }),
- actions: {
- // 获取字典
- getDict(_key) {
- if (_key == null && _key == "") {
- return null;
- }
- try {
- for (let i = 0; i < this.dict.length; i++) {
- if (this.dict[i].key == _key) {
- return this.dict[i].value;
- }
+ 'dict',
+ {
+ state: () => ({
+ dict: new Array()
+ }),
+ actions: {
+ // 获取字典
+ getDict(_key) {
+ if (_key == null && _key == "") {
+ return null;
}
- } catch (e) {
- return null;
- }
- },
- // 设置字典
- setDict(_key, value) {
- if (_key !== null && _key !== "") {
- this.dict.push({
- key: _key,
- value: value
- });
- }
- },
- // 删除字典
- removeDict(_key) {
- var bln = false;
- try {
- for (let i = 0; i < this.dict.length; i++) {
- if (this.dict[i].key == _key) {
- this.dict.splice(i, 1);
- return true;
+ try {
+ for (let i = 0; i < this.dict.length; i++) {
+ if (this.dict[i].key == _key) {
+ return this.dict[i].value;
+ }
}
+ } catch (e) {
+ return null;
}
- } catch (e) {
- bln = false;
+ },
+ // 设置字典
+ setDict(_key, value) {
+ if (_key !== null && _key !== "") {
+ this.dict.push({
+ key: _key,
+ value: value
+ });
+ }
+ },
+ // 删除字典
+ removeDict(_key) {
+ var bln = false;
+ try {
+ for (let i = 0; i < this.dict.length; i++) {
+ if (this.dict[i].key == _key) {
+ this.dict.splice(i, 1);
+ return true;
+ }
+ }
+ } catch (e) {
+ bln = false;
+ }
+ return bln;
+ },
+ // 清空字典
+ cleanDict() {
+ this.dict = new Array();
+ },
+ // 初始字典
+ initDict() {
}
- return bln;
- },
- // 清空字典
- cleanDict() {
- this.dict = new Array();
- },
- // 初始字典
- initDict() {
}
- }
- })
+ })
export default useDictStore
--
Gitblit v1.9.2