feat: 字典配置前端代码.

This commit is contained in:
lijiahang
2023-10-20 18:45:21 +08:00
parent 437614f026
commit bd02ce1dd0
34 changed files with 226 additions and 570 deletions

View File

@@ -1,7 +1,7 @@
import { defineStore } from 'pinia';
import { CacheState } from './types';
export type CacheType = 'menus' | 'roles' | 'hostTags' | 'hostKeys' | 'hostIdentities'
export type CacheType = 'menus' | 'roles' | 'hostTags' | 'hostKeys' | 'hostIdentities' | 'dictKeys' | string
export default defineStore('cache', {
state: (): CacheState => ({
@@ -10,6 +10,7 @@ export default defineStore('cache', {
hostTags: [],
hostKeys: [],
hostIdentities: [],
dictKeys: [],
}),
getters: {},

View File

@@ -3,6 +3,7 @@ import { RoleQueryResponse } from '@/api/user/role';
import { TagQueryResponse } from '@/api/meta/tag';
import { HostKeyQueryResponse } from '@/api/asset/host-key';
import { HostIdentityQueryResponse } from '@/api/asset/host-identity';
import { DictKeyQueryResponse } from '@/api/system/dict-key';
export interface CacheState {
menus: MenuQueryResponse[];
@@ -10,6 +11,7 @@ export interface CacheState {
hostTags: TagQueryResponse[];
hostKeys: HostKeyQueryResponse[];
hostIdentities: HostIdentityQueryResponse[];
dictKeys: DictKeyQueryResponse[];
[key: string]: unknown;
}