@gonsin/gview 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +6 -1
  2. package/dist/{index-189a45ed.mjs → index-07825e29.mjs} +1 -1
  3. package/dist/{index-0837cd29.mjs → index-f621b646.mjs} +1145 -1126
  4. package/dist/index.mjs +1 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +1 -1
  7. package/dist/types/components/GLayout/index.d.ts +0 -2
  8. package/dist/types/components/GLogin/index.d.ts +0 -2
  9. package/dist/types/components/common/GCommonDialog/index.d.ts +0 -2
  10. package/dist/types/components/common/GCommonForm/index.d.ts +0 -2
  11. package/dist/types/components/common/GCommonHeader/index.d.ts +0 -2
  12. package/dist/types/components/common/GCommonTable/index.d.ts +0 -2
  13. package/dist/types/components/common/index.d.ts +0 -4
  14. package/dist/types/components/index.d.ts +0 -5
  15. package/dist/types/constant/color.d.ts +0 -5
  16. package/dist/types/constant/common.d.ts +0 -1
  17. package/dist/types/constant/index.d.ts +0 -5
  18. package/dist/types/constant/local.d.ts +0 -11
  19. package/dist/types/constant/theme.d.ts +0 -4
  20. package/dist/types/constant/websocket.d.ts +0 -22
  21. package/dist/types/hooks/index.d.ts +0 -2
  22. package/dist/types/hooks/nanoid.d.ts +0 -2
  23. package/dist/types/hooks/nprogress.d.ts +0 -2
  24. package/dist/types/http/config.d.ts +0 -5
  25. package/dist/types/http/index.d.ts +0 -16
  26. package/dist/types/http/type.d.ts +0 -5
  27. package/dist/types/index.d.ts +0 -18
  28. package/dist/types/stores/index.d.ts +0 -4
  29. package/dist/types/stores/props.d.ts +0 -6
  30. package/dist/types/stores/setting.d.ts +0 -74
  31. package/dist/types/stores/socket.d.ts +0 -16
  32. package/dist/types/stores/tabMenu.d.ts +0 -18
  33. package/dist/types/types/common.d.ts +0 -24
  34. package/dist/types/types/view.d.ts +0 -290
  35. package/dist/types/utils/color.d.ts +0 -2
  36. package/dist/types/utils/eval.d.ts +0 -12
  37. package/dist/types/utils/index.d.ts +0 -8
  38. package/dist/types/utils/is.d.ts +0 -77
  39. package/dist/types/utils/menu.d.ts +0 -20
  40. package/dist/types/utils/storage.d.ts +0 -13
  41. package/dist/types/utils/table.d.ts +0 -3
  42. package/dist/types/utils/url.d.ts +0 -1
  43. package/dist/types/utils/withInstall.d.ts +0 -6
  44. package/dist/types/views/GMenuManage/index.d.ts +0 -2
  45. package/dist/types/views/index.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonsin/gview",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "main": "dist/index.mjs",
5
5
  "typings": "dist/types/index.d.ts",
6
6
  "files": [
@@ -1,2 +0,0 @@
1
- export declare const GLayout: any;
2
- export default GLayout;
@@ -1,2 +0,0 @@
1
- export declare const GLogin: any;
2
- export default GLogin;
@@ -1,2 +0,0 @@
1
- export declare const GCommonDialog: any;
2
- export default GCommonDialog;
@@ -1,2 +0,0 @@
1
- export declare const GCommonForm: any;
2
- export default GCommonForm;
@@ -1,2 +0,0 @@
1
- export declare const GCommonHeader: any;
2
- export default GCommonHeader;
@@ -1,2 +0,0 @@
1
- export declare const GCommonTable: any;
2
- export default GCommonTable;
@@ -1,4 +0,0 @@
1
- export * from "./GCommonDialog";
2
- export * from "./GCommonForm";
3
- export * from "./GCommonHeader";
4
- export * from "./GCommonTable";
@@ -1,5 +0,0 @@
1
- import GView from "./GView/index.vue";
2
- export * from "./common";
3
- export * from "./GLayout";
4
- export * from "./GLogin";
5
- export default GView;
@@ -1,5 +0,0 @@
1
- export declare type ColorToken = Record<string, string>;
2
- export declare type ColorSeries = Record<string, ColorToken>;
3
- export declare const DEFAULT_LIGHT_COLOR: string[];
4
- export declare const DEFAULT_DARK_COLOR: string[];
5
- export declare const COLOR_TOKEN: ColorSeries;
@@ -1 +0,0 @@
1
- export declare const PROJECT_PREFIX = "GView";
@@ -1,5 +0,0 @@
1
- export * from "./color";
2
- export * from "./common";
3
- export * from "./local";
4
- export * from "./theme";
5
- export * from "./websocket";
@@ -1,11 +0,0 @@
1
- export declare const LOCAL_CONFIG = "config";
2
- export declare const LOCAL_THEME_CONFIG = "themeConfig";
3
- export declare const LOCAL_USER = "user";
4
- export declare const LOCAL_MENU = "menu";
5
- export declare const LOCAL_INIT_TAB_MENU_LIST = "initTabMenuList";
6
- export declare const LOCAL_TAB_MENU = "tabMenu";
7
- export declare const LOCAL_SIDE_MENU_CONFIG = "sideMenuConfig";
8
- export declare const TOKEN_NAME = "token";
9
- export declare const TOKEN_EXPIRED_TIME = "tokenExpiredTime";
10
- export declare const LOCAL_DATA_ID = "dataId";
11
- export declare const LOCAL_SESSION_ID = "sessionId";
@@ -1,4 +0,0 @@
1
- export declare const DEFAULT_THEME_CONFIG: {
2
- brandTheme: string;
3
- displayMode: string;
4
- };
@@ -1,22 +0,0 @@
1
- export declare const WS_SERVICE_URL: string;
2
- export declare const INIT_WS_MODEL: (subcmd: string, dataId?: string) => {
3
- head: string;
4
- cmd: {
5
- cmd: string;
6
- subcmd: string;
7
- response: number;
8
- };
9
- args?: undefined;
10
- } | {
11
- head: string;
12
- cmd: {
13
- cmd: string;
14
- subcmd: string;
15
- response?: undefined;
16
- };
17
- args: {
18
- dataId: string;
19
- };
20
- };
21
- export declare const WS_INTERVAL_TIMEOUT = 30000;
22
- export declare const WS_RESET_TIMEOUT = 3000;
@@ -1,2 +0,0 @@
1
- export * from "./nanoid";
2
- export * from "./nprogress";
@@ -1,2 +0,0 @@
1
- export declare function nanoid(length: number): string;
2
- export declare function loadNanoId(): string;
@@ -1,2 +0,0 @@
1
- import NProgress from "nprogress";
2
- export { NProgress };
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- timeout: number;
3
- withCredentials: boolean;
4
- };
5
- export default _default;
@@ -1,16 +0,0 @@
1
- import type { AxiosInstance, AxiosRequestConfig } from "axios";
2
- import type { Router } from "vue-router";
3
- import type { ResultData } from "./type";
4
- declare class RequestHttp {
5
- sessionId: () => string | null;
6
- service: AxiosInstance;
7
- router: Router | null;
8
- constructor(config: AxiosRequestConfig);
9
- get<T>(url: string, params?: object, _object?: {}): Promise<ResultData<T>>;
10
- post<T>(url: string, params?: object, _object?: {}): Promise<ResultData<T>>;
11
- put<T>(url: string, params?: object, _object?: {}): Promise<ResultData<T>>;
12
- delete<T>(url: string, params?: any, _object?: {}): Promise<ResultData<T>>;
13
- initRouter(router: Router): void;
14
- }
15
- declare const _default: RequestHttp;
16
- export default _default;
@@ -1,5 +0,0 @@
1
- export interface ResultData<T = any> {
2
- state: number;
3
- message: string;
4
- data: T;
5
- }
@@ -1,18 +0,0 @@
1
- import type { Pinia } from "pinia";
2
- import type { App } from "vue";
3
- import http from "./http";
4
- declare function install(Vue: App, userConfig?: any): void;
5
- declare function setupStore(pinia: Pinia): void;
6
- export * from "./components";
7
- export * from "./constant";
8
- export * from "./hooks";
9
- export * from "./stores";
10
- export * from "./utils";
11
- export * from "./views";
12
- export * from "./types/common";
13
- export * from "./types/view";
14
- export { http, setupStore };
15
- declare const _default: {
16
- install: typeof install;
17
- };
18
- export default _default;
@@ -1,4 +0,0 @@
1
- export * from "./setting";
2
- export * from "./tabMenu";
3
- export * from "./socket";
4
- export * from "./props";
@@ -1,6 +0,0 @@
1
- export declare const usePropsStore: import("pinia").StoreDefinition<"props", {
2
- propsSource: any;
3
- }, {}, {
4
- initPropsSource(source: any): void;
5
- getPropsByPropsKey(propsKeys: any[]): any;
6
- }>;
@@ -1,74 +0,0 @@
1
- import { DEFAULT_THEME_CONFIG } from "~/constant/theme";
2
- import type { SideMenu } from "~/types/menu";
3
- interface UserConfig {
4
- userInfo: any;
5
- userToken: {
6
- token: string;
7
- tokenExpiredTime: string;
8
- };
9
- userMenu: any;
10
- homeUrl?: string;
11
- uploadApi: string;
12
- }
13
- declare type ThemeConfigType = typeof DEFAULT_THEME_CONFIG;
14
- interface SettingState {
15
- isUserLogin: boolean;
16
- isGlobalLoaded: boolean;
17
- isSideMenuCollapse: boolean;
18
- isSettingPanelShow: boolean;
19
- userConfig: UserConfig;
20
- themeConfig: ThemeConfigType;
21
- sideMenuTree: SideMenu[];
22
- }
23
- export declare const useSettingStore: import("pinia").StoreDefinition<"setting", SettingState, {
24
- userRealName: (state: SettingState) => any;
25
- userEdificeKey: (state: SettingState) => any;
26
- token: (state: SettingState) => string;
27
- tokenExpiredTime: (state: SettingState) => string;
28
- uploadApi: (state: SettingState) => string;
29
- homeUrl: (state: SettingState) => any;
30
- displayMode: (state: SettingState) => any;
31
- }, {
32
- /**
33
- * @description 设置用户登录状态
34
- */
35
- setUserLoginStatus(status: boolean): void;
36
- /**
37
- * @description 切换显示侧边菜单
38
- */
39
- toggleSideMenuCollapse(): void;
40
- /**
41
- * @description 切换显示侧边设置面板
42
- */
43
- toggleSettingPanel(): void;
44
- /**
45
- * @description 全局重新加载标识
46
- */
47
- toggleGlobalReload(): void;
48
- setSideMenuConfig(menus: SideMenu[]): void;
49
- /**
50
- * @description 用户登录后初始化配置
51
- */
52
- initUserConfig(userConfig: UserConfig): Promise<void>;
53
- /**
54
- * @description 用户退出
55
- */
56
- userLogout(): void;
57
- /**
58
- * @description 更改主题
59
- */
60
- changeTheme(themeConfig: any): void;
61
- /**
62
- * @description 更改颜色模式
63
- */
64
- changeMode(themeConfig: any): void;
65
- /**
66
- * @description 更改主题颜色
67
- */
68
- changeBrandTheme(themeConfig: any): void;
69
- /**
70
- * @description 加载主题配置
71
- */
72
- loadLocalThemeConfig(): void;
73
- }>;
74
- export {};
@@ -1,16 +0,0 @@
1
- interface SocketState {
2
- socket: WebSocket | null;
3
- socketInterval?: any;
4
- socketTimeout?: any;
5
- isSocketLinked: boolean;
6
- isSocketResetting: boolean;
7
- }
8
- export declare const useSocketStore: import("pinia").StoreDefinition<"socket", SocketState, {}, {
9
- /**
10
- * @description 初始化websocket连接
11
- */
12
- initSocket(): void;
13
- sendRegisterMessage(dataId: string): void;
14
- sendUnregisterMessage(dataId: string): void;
15
- }>;
16
- export {};
@@ -1,18 +0,0 @@
1
- import type { TabMenuItem } from "~/types/menu";
2
- export declare const useTabMenuStore: import("pinia").StoreDefinition<"tabMenu", {
3
- tabMenuList: TabMenuItem[];
4
- initTabMenuList: TabMenuItem[];
5
- }, {}, {
6
- setInitTabMenuList(initTabMenuList: TabMenuItem[]): void;
7
- setTabMenuList(tabMenuList: TabMenuItem[]): void;
8
- /**
9
- * @description 初始化tab菜单列表
10
- */
11
- initTabMenu(): void;
12
- appendTabMenuItem(newItem: TabMenuItem): void;
13
- subtractCurrentTabMenuItem(newItem: TabMenuItem): void;
14
- subtractTabMenuItemBehind(newItem: TabMenuItem): void;
15
- subtractTabMenuItemAhead(newItem: TabMenuItem): void;
16
- subtractTabMenuItemOther(newItem: TabMenuItem): void;
17
- clearTabMenuItem(): void;
18
- }>;
@@ -1,24 +0,0 @@
1
- export interface UserInfo {
2
- admin: boolean;
3
- audit: boolean;
4
- createTime: string;
5
- departmentKey: string;
6
- edificeKey: string;
7
- email: string;
8
- freeAudit: boolean;
9
- groupKey: string;
10
- groupName: string;
11
- imageUrl: string;
12
- language: string;
13
- permissions: string[];
14
- phone: string;
15
- realName: string;
16
- root: boolean;
17
- rootUrl: string;
18
- rootUserKey: string;
19
- updateTime: string;
20
- userKey: string;
21
- userMessageKey: string;
22
- username: string;
23
- version: number;
24
- }
@@ -1,290 +0,0 @@
1
- import type { PrimaryTableCol } from "tdesign-vue-next";
2
- /**
3
- * @description 视图信息 一个页面的总描述
4
- */
5
- export interface ViewInfo {
6
- /**
7
- * 页面名字,必须唯一,跳转页面时需要用到
8
- */
9
- viewName: string;
10
- /**
11
- * 页面标题
12
- */
13
- title: string;
14
- /**
15
- * 页面所拥有的 board
16
- */
17
- boards: ViewBoard[];
18
- /**
19
- * 该页面所需的参数
20
- */
21
- props: string[];
22
- }
23
- export interface ViewBoardData {
24
- /**
25
- * @description 用于调用接口
26
- */
27
- dataId: string;
28
- /**
29
- * @description 获取数据之后主键的名字
30
- */
31
- keyName: string;
32
- /**
33
- * @description 获取数据之后,value字段的名字(用于显示)
34
- */
35
- valueName: string;
36
- /**
37
- * @description 获取数据之后,父字段的名字(用于显示)
38
- */
39
- parentKeyName?: string;
40
- /**
41
- * @description 获取数据之后,value字段的名字(用于显示?)
42
- */
43
- titleName: string;
44
- }
45
- /**
46
- * @description 区域为每个View(视图)中显示的具体内容的描述
47
- */
48
- export interface ViewBoard {
49
- /**
50
- * @description 区域类型
51
- */
52
- boardType?: "table" | "form" | "tab" | "dialog";
53
- /**
54
- * @description 标题栏的描述
55
- */
56
- header?: ViewHeader;
57
- /**
58
- * @description 表格列的描述
59
- */
60
- columns?: TableColumn[];
61
- /**
62
- * @description 用于显示多个board作为一个board
63
- */
64
- tabs?: ViewTab[];
65
- /**
66
- * 通用数据源
67
- */
68
- data?: ViewBoardData;
69
- /**
70
- * @description 表格数据源
71
- */
72
- tableData?: ViewBoardData;
73
- /**
74
- * @description 表单类型含有的表单项
75
- */
76
- formItems?: FormItem[];
77
- /**
78
- * @description ok按钮的描述
79
- */
80
- okButton?: ViewButton;
81
- /**
82
- * @description 取消按钮的描述
83
- */
84
- cancelButton?: ViewButton;
85
- }
86
- export interface ViewPaginationProps {
87
- /**
88
- * @description 每页数量
89
- */
90
- count: number;
91
- /**
92
- * @description 当前页数
93
- */
94
- page: number;
95
- /**
96
- * @description 总页数
97
- */
98
- pageCount: number;
99
- /**
100
- * @description 总数量
101
- */
102
- totalCount: number;
103
- }
104
- /**
105
- * @description 用于显示多个board作为一个board
106
- */
107
- export interface ViewTab {
108
- /**
109
- * @description tab标题
110
- */
111
- title: string;
112
- /**
113
- * @description 包含一个board
114
- */
115
- board: ViewBoard;
116
- }
117
- /**
118
- * @description: 标题栏
119
- */
120
- export interface ViewHeader {
121
- /**
122
- * @description: 标题栏上显示的按钮
123
- */
124
- buttons: ViewButton[];
125
- /**
126
- * @description: 搜索栏
127
- */
128
- searchBar: {
129
- /**
130
- * @description:过滤器列表
131
- */
132
- filters: FormItem[];
133
- };
134
- }
135
- /**
136
- * @description: 表格列
137
- */
138
- export declare type TableColumn = {
139
- /**
140
- * @description 列的标题
141
- */
142
- name?: string;
143
- /**
144
- * @description: 对应数据源里的字段名
145
- */
146
- keyName: string;
147
- value: string;
148
- /**
149
- * @description: 宽度占比
150
- */
151
- weight?: number;
152
- /**
153
- * @description: 列显示的格式
154
- */
155
- columnType?: "TEXT" | "ENUMS" | "BUTTONS" | "FORM_ITEM";
156
- /**
157
- * @description: 枚举范围
158
- */
159
- enums?: TableColumnEnums[];
160
- /**
161
- * @description: 日期格式
162
- */
163
- format?: string;
164
- /**
165
- * @description: 表格显示按钮
166
- */
167
- buttons?: ViewButton[];
168
- /**
169
- * @description: 表格表单类型
170
- */
171
- formItems?: FormItem[];
172
- } & PrimaryTableCol;
173
- export interface TableColumnEnums {
174
- value: string;
175
- type: string;
176
- text: string;
177
- }
178
- /**
179
- * @description 用于不同区域之间传递的参数
180
- */
181
- export interface ViewProps {
182
- /**
183
- * @description 传递的key
184
- */
185
- keyName?: string;
186
- /**
187
- * @description 传递的值
188
- */
189
- valueName?: string;
190
- }
191
- export declare type ViewButtonAction = "NONE" | "LINK" | "VIEW" | "VIEW_BY_DIALOG" | "UPLOAD_FILE" | "DOWNLOAD" | "CONFIRM" | "BATCH" | "CLOSE_DIALOG" | "CONFIRM_AND_CLOSE" | "RESET" | "RECOVER";
192
- export interface ViewButton {
193
- /**
194
- * @description 按钮显示的名字
195
- */
196
- name?: string;
197
- /**
198
- * @description 按钮显示的图标
199
- */
200
- icon?: string;
201
- /**
202
- * @description 按钮的唯一标识,用于请求后台
203
- */
204
- buttonId?: string;
205
- /**
206
- * @description 按钮文本的颜色
207
- */
208
- textColor?: string;
209
- /**
210
- * @description 按钮的类型
211
- */
212
- buttonType?: "default" | "primary" | "success" | "info" | "warning" | "danger";
213
- /**
214
- * @description 按钮的形状
215
- */
216
- buttonStyle?: "default" | "plain" | "round" | "circle";
217
- props?: ViewProps[];
218
- /**
219
- * @description 按钮执行的内容
220
- */
221
- action?: ViewButtonAction;
222
- showIf?: string;
223
- disableIf?: string;
224
- /**
225
- * @description 确认信息
226
- */
227
- confirmMessage?: string;
228
- /**
229
- * @description 跳转到其他view
230
- */
231
- view: string;
232
- /**
233
- * @description 跳转到某个页面(直接url跳转)
234
- */
235
- link?: string;
236
- /**
237
- * @description 下载文件的路径
238
- */
239
- downloadUrl?: string;
240
- }
241
- /**
242
- * @description: 表单项类型
243
- */
244
- export declare type FormItemType = "hidden" | "line" | "text_input" | "check_box" | "selector" | "label" | "file" | "multi_selector" | "date_time_selector" | "date_selector" | "time_selector" | "multi_tree_selector" | "tree_selector" | "tree_check_box" | "radio" | "switch" | "rich_text" | "block_start" | "block_end";
245
- /**
246
- * @description: 表单项结构
247
- */
248
- export interface FormItem {
249
- itemType: FormItemType;
250
- inputType?: string;
251
- /**
252
- * @description: 是否必选
253
- */
254
- required?: boolean;
255
- /**
256
- * @description: 查询或提交表单时的key
257
- */
258
- keyName: string;
259
- /**
260
- * @description: 显示的名字
261
- */
262
- name: string;
263
- /**
264
- * @description: 提交表单时id
265
- */
266
- buttonId: string;
267
- value?: string;
268
- /**
269
- * @description: 提示语
270
- */
271
- placeholder?: string;
272
- showIf: string;
273
- disableIf?: string;
274
- /**
275
- * @description: 选择器数据相关
276
- */
277
- listData: ViewBoardData;
278
- /**
279
- * @description: 树选择器数据相关
280
- */
281
- treeData: ViewBoardData;
282
- /**
283
- * @description: 日期时间选择相关
284
- */
285
- format: string;
286
- limit: number;
287
- maxSize: number;
288
- accept: string;
289
- filenameKeyName: string;
290
- }
@@ -1,2 +0,0 @@
1
- import type { ColorSeries, ColorToken } from "~/constant/color";
2
- export declare function getBrandColor(type: string, colorList: ColorSeries): ColorToken;
@@ -1,12 +0,0 @@
1
- export declare function evalContext(text: string, context?: {}): any;
2
- /**
3
- * @description: 处理showIf可能出现的值
4
- * @param {any} value
5
- * @return {any}
6
- */
7
- export declare function v(value: any): any;
8
- declare global {
9
- interface Window {
10
- v: Function;
11
- }
12
- }
@@ -1,8 +0,0 @@
1
- export * from "./color";
2
- export * from "./eval";
3
- export * from "./is";
4
- export * from "./menu";
5
- export * from "./storage";
6
- export * from "./table";
7
- export * from "./url";
8
- export * from "./withInstall";