mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-12-30 12:05:57 +08:00
发布代码生成、更新20+表单组件,优化数据字典,gf版本更新到2.3.1
This commit is contained in:
58
web/src/views/permission/menu/model.ts
Normal file
58
web/src/views/permission/menu/model.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
export interface State {
|
||||
id: number;
|
||||
pid: number;
|
||||
title: string;
|
||||
name: string;
|
||||
path: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
type: number;
|
||||
redirect: string;
|
||||
permissions: string;
|
||||
permissionName: string;
|
||||
component: string;
|
||||
alwaysShow: number;
|
||||
activeMenu: string;
|
||||
isRoot: number;
|
||||
isFrame: number;
|
||||
frameSrc: string;
|
||||
keepAlive: number;
|
||||
hidden: number;
|
||||
affix: number;
|
||||
status: number;
|
||||
sort: number;
|
||||
}
|
||||
|
||||
export const defaultState = {
|
||||
id: 0,
|
||||
pid: 0,
|
||||
title: '',
|
||||
name: '',
|
||||
path: '',
|
||||
label: '',
|
||||
icon: '',
|
||||
type: 1,
|
||||
redirect: '',
|
||||
permissions: '',
|
||||
permissionName: '',
|
||||
component: '',
|
||||
alwaysShow: 1,
|
||||
activeMenu: '',
|
||||
isRoot: 0,
|
||||
isFrame: 2,
|
||||
frameSrc: '',
|
||||
keepAlive: 0,
|
||||
hidden: 0,
|
||||
affix: 0,
|
||||
status: 1,
|
||||
sort: 10,
|
||||
};
|
||||
|
||||
export function newState(state: State | null): State {
|
||||
if (state !== null) {
|
||||
return cloneDeep(state);
|
||||
}
|
||||
return cloneDeep(defaultState);
|
||||
}
|
||||
Reference in New Issue
Block a user