@gonsin/gview 2.1.12 → 2.1.14
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.
- package/dist/index.mjs +2377 -2372
- package/dist/style.css +1 -1
- package/dist/types/components/GConfigProvider/index.d.ts +2 -0
- package/dist/types/components/GLayout/index.d.ts +2 -0
- package/dist/types/components/Result/index.d.ts +3 -0
- package/dist/types/components/common/GColumnController/index.d.ts +2 -0
- package/dist/types/components/common/GCommonDialog/index.d.ts +2 -0
- package/dist/types/components/common/GCommonForm/index.d.ts +2 -0
- package/dist/types/components/common/GCommonHeader/index.d.ts +2 -0
- package/dist/types/components/common/GCommonTable/index.d.ts +2 -0
- package/dist/types/components/common/GSettingDialog/index.d.ts +2 -0
- package/dist/types/components/common/GUploader/index.d.ts +2 -0
- package/dist/types/components/common/index.d.ts +7 -0
- package/dist/types/components/index.d.ts +6 -0
- package/dist/types/constant/className.d.ts +15 -0
- package/dist/types/constant/color.d.ts +5 -0
- package/dist/types/constant/common.d.ts +1 -0
- package/dist/types/constant/index.d.ts +6 -0
- package/dist/types/constant/local.d.ts +23 -0
- package/dist/types/constant/theme.d.ts +4 -0
- package/dist/types/constant/websocket.d.ts +23 -0
- package/dist/types/directives/index.d.ts +5 -0
- package/dist/types/directives/permission.d.ts +5 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/nanoid.d.ts +2 -0
- package/dist/types/hooks/nprogress.d.ts +2 -0
- package/dist/types/http/config.d.ts +4 -0
- package/dist/types/http/index.d.ts +33 -0
- package/dist/types/http/type.d.ts +5 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/stores/cache.d.ts +22 -0
- package/dist/types/stores/column.d.ts +26 -0
- package/dist/types/stores/index.d.ts +7 -0
- package/dist/types/stores/props.d.ts +6 -0
- package/dist/types/stores/setting.d.ts +112 -0
- package/dist/types/stores/socket.d.ts +19 -0
- package/dist/types/stores/tabMenu.d.ts +68 -0
- package/dist/types/stores/website.d.ts +124 -0
- package/dist/types/types/common.d.ts +24 -0
- package/dist/types/types/view.d.ts +326 -0
- package/dist/types/utils/color.d.ts +2 -0
- package/dist/types/utils/download.d.ts +11 -0
- package/dist/types/utils/eval.d.ts +12 -0
- package/dist/types/utils/form.d.ts +52 -0
- package/dist/types/utils/index.d.ts +11 -0
- package/dist/types/utils/is.d.ts +77 -0
- package/dist/types/utils/menu.d.ts +25 -0
- package/dist/types/utils/message.d.ts +21 -0
- package/dist/types/utils/storage.d.ts +13 -0
- package/dist/types/utils/table.d.ts +8 -0
- package/dist/types/utils/url.d.ts +4 -0
- package/dist/types/utils/withInstall.d.ts +5 -0
- package/dist/types/views/GLogin/index.d.ts +2 -0
- package/dist/types/views/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,326 @@
|
|
|
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
|
+
* 2023 11 20 新增
|
|
24
|
+
* 后台传递到前端预设值 props,默认为空
|
|
25
|
+
*/
|
|
26
|
+
serverPorps: object;
|
|
27
|
+
}
|
|
28
|
+
export interface ViewBoardData {
|
|
29
|
+
/**
|
|
30
|
+
* @description 用于调用接口
|
|
31
|
+
*/
|
|
32
|
+
dataId: string;
|
|
33
|
+
/**
|
|
34
|
+
* @description 获取数据之后主键的名字
|
|
35
|
+
*/
|
|
36
|
+
keyName: string;
|
|
37
|
+
/**
|
|
38
|
+
* @description 获取数据之后,value字段的名字(用于显示)
|
|
39
|
+
*/
|
|
40
|
+
valueName: string;
|
|
41
|
+
/**
|
|
42
|
+
* @description 获取数据之后,父字段的名字(用于显示)
|
|
43
|
+
*/
|
|
44
|
+
parentKeyName?: string;
|
|
45
|
+
/**
|
|
46
|
+
* @description 获取数据之后,value字段的名字(用于显示?)
|
|
47
|
+
*/
|
|
48
|
+
titleName: string;
|
|
49
|
+
/**
|
|
50
|
+
* @description: 当 dataId为空,直接使用该数据
|
|
51
|
+
*/
|
|
52
|
+
data: any;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @description 区域为每个View(视图)中显示的具体内容的描述
|
|
56
|
+
*/
|
|
57
|
+
export interface ViewBoard {
|
|
58
|
+
/**
|
|
59
|
+
* @description 区域类型
|
|
60
|
+
*/
|
|
61
|
+
boardType?: "table" | "form" | "tab" | "dialog";
|
|
62
|
+
/**
|
|
63
|
+
* @description 标题栏的描述
|
|
64
|
+
*/
|
|
65
|
+
header?: ViewHeader;
|
|
66
|
+
/**
|
|
67
|
+
* @description 表格列的描述
|
|
68
|
+
*/
|
|
69
|
+
columns?: TableColumn[];
|
|
70
|
+
/**
|
|
71
|
+
* @description 用于显示多个board作为一个board
|
|
72
|
+
*/
|
|
73
|
+
tabs?: ViewTab[];
|
|
74
|
+
/**
|
|
75
|
+
* 通用数据源
|
|
76
|
+
*/
|
|
77
|
+
data?: ViewBoardData;
|
|
78
|
+
/**
|
|
79
|
+
* @description 表格数据源
|
|
80
|
+
*/
|
|
81
|
+
tableData?: ViewBoardData;
|
|
82
|
+
/**
|
|
83
|
+
* @description 表单类型含有的表单项
|
|
84
|
+
*/
|
|
85
|
+
formItems?: FormItem[];
|
|
86
|
+
/**
|
|
87
|
+
* @description ok按钮的描述
|
|
88
|
+
*/
|
|
89
|
+
okButton?: ViewButton;
|
|
90
|
+
/**
|
|
91
|
+
* @description 取消按钮的描述
|
|
92
|
+
*/
|
|
93
|
+
cancelButton?: ViewButton;
|
|
94
|
+
}
|
|
95
|
+
export interface ViewPaginationProps {
|
|
96
|
+
/**
|
|
97
|
+
* @description 每页数量
|
|
98
|
+
*/
|
|
99
|
+
count: number;
|
|
100
|
+
/**
|
|
101
|
+
* @description 当前页数
|
|
102
|
+
*/
|
|
103
|
+
page: number;
|
|
104
|
+
/**
|
|
105
|
+
* @description 总页数
|
|
106
|
+
*/
|
|
107
|
+
pageCount: number;
|
|
108
|
+
/**
|
|
109
|
+
* @description 总数量
|
|
110
|
+
*/
|
|
111
|
+
totalCount: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @description 用于显示多个board作为一个board
|
|
115
|
+
*/
|
|
116
|
+
export interface ViewTab {
|
|
117
|
+
/**
|
|
118
|
+
* @description tab标题
|
|
119
|
+
*/
|
|
120
|
+
title: string;
|
|
121
|
+
/**
|
|
122
|
+
* @description 包含一个board
|
|
123
|
+
*/
|
|
124
|
+
board: ViewBoard;
|
|
125
|
+
/**
|
|
126
|
+
* 新增服务器预定义 props
|
|
127
|
+
*/
|
|
128
|
+
serverProps: any;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @description: 标题栏
|
|
132
|
+
*/
|
|
133
|
+
export interface ViewHeader {
|
|
134
|
+
/**
|
|
135
|
+
* @description: 标题栏上显示的按钮
|
|
136
|
+
*/
|
|
137
|
+
buttons: ViewButton[];
|
|
138
|
+
/**
|
|
139
|
+
* @description: 搜索栏
|
|
140
|
+
*/
|
|
141
|
+
searchBar: {
|
|
142
|
+
/**
|
|
143
|
+
* @description:过滤器列表
|
|
144
|
+
*/
|
|
145
|
+
filters: FormItem[];
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @description: 表格列
|
|
150
|
+
*/
|
|
151
|
+
export declare type TableColumn = {
|
|
152
|
+
/**
|
|
153
|
+
* @description 列的标题
|
|
154
|
+
*/
|
|
155
|
+
name?: string;
|
|
156
|
+
/**
|
|
157
|
+
* @description: 对应数据源里的字段名
|
|
158
|
+
*/
|
|
159
|
+
keyName: string;
|
|
160
|
+
value: string;
|
|
161
|
+
/**
|
|
162
|
+
* @description: 宽度占比
|
|
163
|
+
*/
|
|
164
|
+
weight?: number;
|
|
165
|
+
/**
|
|
166
|
+
* @description: 列显示的格式
|
|
167
|
+
*/
|
|
168
|
+
columnType?: "TEXT" | "ENUMS" | "BUTTONS" | "FORM_ITEM" | "DATE" | "QR_CODE" | "IMAGE";
|
|
169
|
+
/**
|
|
170
|
+
* @description: 枚举范围
|
|
171
|
+
*/
|
|
172
|
+
enums?: TableColumnEnums[];
|
|
173
|
+
/**
|
|
174
|
+
* @description: 日期格式
|
|
175
|
+
*/
|
|
176
|
+
format?: string;
|
|
177
|
+
/**
|
|
178
|
+
* @description: 表格显示按钮
|
|
179
|
+
*/
|
|
180
|
+
buttons?: ViewButton[];
|
|
181
|
+
/**
|
|
182
|
+
* @description: 表格表单类型
|
|
183
|
+
*/
|
|
184
|
+
formItems?: FormItem[];
|
|
185
|
+
} & PrimaryTableCol;
|
|
186
|
+
export interface TableColumnEnums {
|
|
187
|
+
value: string;
|
|
188
|
+
type: string;
|
|
189
|
+
text: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @description 用于不同区域之间传递的参数
|
|
193
|
+
*/
|
|
194
|
+
export interface ViewProps {
|
|
195
|
+
/**
|
|
196
|
+
* @description 传递的key
|
|
197
|
+
*/
|
|
198
|
+
keyName?: string;
|
|
199
|
+
/**
|
|
200
|
+
* @description 传递的值
|
|
201
|
+
*/
|
|
202
|
+
valueName?: string;
|
|
203
|
+
}
|
|
204
|
+
export declare type ViewButtonAction = "NONE" | "LINK" | "VIEW" | "VIEW_BY_DIALOG" | "UPLOAD_FILE" | "DOWNLOAD" | "CONFIRM" | "BATCH" | "CLOSE_DIALOG" | "CONFIRM_AND_CLOSE" | "RESET" | "RECOVER";
|
|
205
|
+
export interface ViewButton {
|
|
206
|
+
/**
|
|
207
|
+
* @description 按钮显示的名字
|
|
208
|
+
*/
|
|
209
|
+
name?: string;
|
|
210
|
+
/**
|
|
211
|
+
* @description 按钮显示的图标
|
|
212
|
+
*/
|
|
213
|
+
icon?: string;
|
|
214
|
+
/**
|
|
215
|
+
* @description 按钮的唯一标识,用于请求后台
|
|
216
|
+
*/
|
|
217
|
+
buttonId?: string;
|
|
218
|
+
/**
|
|
219
|
+
* @description 按钮文本的颜色
|
|
220
|
+
*/
|
|
221
|
+
textColor?: string;
|
|
222
|
+
/**
|
|
223
|
+
* @description 按钮的类型
|
|
224
|
+
*/
|
|
225
|
+
buttonType?: "default" | "primary" | "success" | "info" | "warning" | "danger";
|
|
226
|
+
/**
|
|
227
|
+
* @description 按钮的形状
|
|
228
|
+
*/
|
|
229
|
+
buttonStyle?: "default" | "plain" | "round" | "circle";
|
|
230
|
+
props?: ViewProps[];
|
|
231
|
+
/**
|
|
232
|
+
* @description 按钮执行的内容
|
|
233
|
+
*/
|
|
234
|
+
action?: ViewButtonAction;
|
|
235
|
+
showIf?: string;
|
|
236
|
+
disableIf?: string;
|
|
237
|
+
/**
|
|
238
|
+
* @description 确认信息
|
|
239
|
+
*/
|
|
240
|
+
confirmMessage?: string;
|
|
241
|
+
/**
|
|
242
|
+
* @description 跳转到其他view
|
|
243
|
+
*/
|
|
244
|
+
view: string;
|
|
245
|
+
/**
|
|
246
|
+
* @description 跳转到某个页面(直接url跳转)
|
|
247
|
+
*/
|
|
248
|
+
link?: string;
|
|
249
|
+
/**
|
|
250
|
+
* @description: 是否跳转到外部
|
|
251
|
+
*/
|
|
252
|
+
outLink: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* @description 下载文件的路径
|
|
255
|
+
*/
|
|
256
|
+
downloadUrl?: string;
|
|
257
|
+
/**
|
|
258
|
+
* @description: 上传文件类型
|
|
259
|
+
* @value: 'path' - 文件夹; 'file' 单文件
|
|
260
|
+
*/
|
|
261
|
+
fileUploadType?: "path" | "file";
|
|
262
|
+
/**
|
|
263
|
+
* @description: 上传文件格式限制
|
|
264
|
+
*/
|
|
265
|
+
accept?: string;
|
|
266
|
+
permission?: any[];
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @description: 表单项类型
|
|
270
|
+
*/
|
|
271
|
+
export declare type FormItemType = "hidden" | "line" | "text_input" | "check_box" | "selector" | "label" | "file" | "multi_selector" | "date_time_selector" | "date_selector" | "delay_selector" | "time_selector" | "multi_tree_selector" | "tree_selector" | "tree_check_box" | "radio" | "switch" | "rich_text" | "tag" | "block_start" | "block_end";
|
|
272
|
+
/**
|
|
273
|
+
* @description: 表单项结构
|
|
274
|
+
*/
|
|
275
|
+
export interface FormItem {
|
|
276
|
+
itemType: FormItemType;
|
|
277
|
+
inputType?: string;
|
|
278
|
+
/**
|
|
279
|
+
* @description: 是否必选
|
|
280
|
+
*/
|
|
281
|
+
required?: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* @description: 查询或提交表单时的key
|
|
284
|
+
*/
|
|
285
|
+
keyName: string;
|
|
286
|
+
/**
|
|
287
|
+
* @description: 显示的名字
|
|
288
|
+
*/
|
|
289
|
+
name: string;
|
|
290
|
+
/**
|
|
291
|
+
* @description: 提交表单时id
|
|
292
|
+
*/
|
|
293
|
+
buttonId: string;
|
|
294
|
+
value?: string;
|
|
295
|
+
/**
|
|
296
|
+
* @description: hidden类型时有效
|
|
297
|
+
*/
|
|
298
|
+
valueName?: string;
|
|
299
|
+
/**
|
|
300
|
+
* @description: 提示语
|
|
301
|
+
*/
|
|
302
|
+
placeholder?: string;
|
|
303
|
+
showIf: string;
|
|
304
|
+
disableIf?: string;
|
|
305
|
+
/**
|
|
306
|
+
* @description: 选择器数据相关
|
|
307
|
+
*/
|
|
308
|
+
listData?: ViewBoardData;
|
|
309
|
+
/**
|
|
310
|
+
* @description: 树选择器数据相关
|
|
311
|
+
*/
|
|
312
|
+
treeData?: ViewBoardData;
|
|
313
|
+
/**
|
|
314
|
+
* @description: 日期时间选择相关
|
|
315
|
+
*/
|
|
316
|
+
format?: string;
|
|
317
|
+
limit?: number;
|
|
318
|
+
maxSize?: number;
|
|
319
|
+
accept?: string;
|
|
320
|
+
filenameKeyName?: string;
|
|
321
|
+
/**
|
|
322
|
+
* @description: 上传文件类型
|
|
323
|
+
* @value: 'path' - 文件夹; 'file' 单文件
|
|
324
|
+
*/
|
|
325
|
+
fileUploadType?: "path" | "file";
|
|
326
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 获取文件名
|
|
3
|
+
* @param {string} disposition
|
|
4
|
+
*/
|
|
5
|
+
export declare function getFileNameFromContentDisposition(disposition: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* @description: 下载文件方法
|
|
8
|
+
* @param {string} url
|
|
9
|
+
* @param {string} filename
|
|
10
|
+
*/
|
|
11
|
+
export declare function downloadFile(url: string, downloadFilename?: string, type?: "file" | "blob", props?: any): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { FormItem, FormItemType } from "~/types/view";
|
|
2
|
+
/**
|
|
3
|
+
* @description 初始化表单项的数值,返回对应的表单类型的初始值
|
|
4
|
+
* @param itemType
|
|
5
|
+
*/
|
|
6
|
+
export declare function initEmptyFormItems(itemType: FormItemType, isHeaderForm?: boolean): false | any[] | "" | "all";
|
|
7
|
+
/**
|
|
8
|
+
* @description 初始化表单数据
|
|
9
|
+
* @return 表单模型数据
|
|
10
|
+
*/
|
|
11
|
+
export declare function initFormModel(formData: any, formItems: FormItem[], isHeaderForm?: boolean): any;
|
|
12
|
+
/**
|
|
13
|
+
* @description: 初始化处理树形选择列表数据
|
|
14
|
+
* @param {*} config
|
|
15
|
+
* @return {*}
|
|
16
|
+
*/
|
|
17
|
+
export declare function initTreeSelectorData(config: {
|
|
18
|
+
list: any[];
|
|
19
|
+
keyName: string;
|
|
20
|
+
valueName: string;
|
|
21
|
+
titleName: string;
|
|
22
|
+
parentKey: string | null;
|
|
23
|
+
parentKeyName: string;
|
|
24
|
+
}): any;
|
|
25
|
+
interface OptionNode {
|
|
26
|
+
key: string;
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
children: OptionNode[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @description: 过滤在收到的值中,包含的子元素选项并没有完全选中时的父元素
|
|
33
|
+
* @param {*} options
|
|
34
|
+
* @param {*} values
|
|
35
|
+
*/
|
|
36
|
+
export declare function filterTreeValues(options: OptionNode[], values: string[]): string[];
|
|
37
|
+
/**
|
|
38
|
+
* @description: 检查输入框placeholder是否省略显示 如果省略显示则hover显示完整内容
|
|
39
|
+
* @param {any} formItemRef
|
|
40
|
+
*/
|
|
41
|
+
export declare function checkPlaceholderIfHidden(formItemRef: any): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @description: 比较对象数据的属性差异
|
|
44
|
+
* @param {object} obj1
|
|
45
|
+
* @param {object} obj2
|
|
46
|
+
*/
|
|
47
|
+
export declare function deepCompareObjects(obj1: {
|
|
48
|
+
[x: string]: any;
|
|
49
|
+
}, obj2: {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
}, excludeKeys?: string[]): Record<string, any>;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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";
|
|
9
|
+
export * from "./download";
|
|
10
|
+
export * from "./form";
|
|
11
|
+
export * from "./message";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 判断值是否未某个类型
|
|
3
|
+
*/
|
|
4
|
+
export declare function is(val: unknown, type: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* @description: 是否为函数
|
|
7
|
+
*/
|
|
8
|
+
export declare function isFunction<T = Function>(val: unknown): val is T;
|
|
9
|
+
/**
|
|
10
|
+
* @description: 是否已定义
|
|
11
|
+
*/
|
|
12
|
+
export declare const isDef: <T = unknown>(val?: T) => val is T;
|
|
13
|
+
export declare const isUnDef: <T = unknown>(val?: T) => val is T;
|
|
14
|
+
/**
|
|
15
|
+
* @description: 是否为对象
|
|
16
|
+
*/
|
|
17
|
+
export declare const isObject: (val: any) => val is Record<any, any>;
|
|
18
|
+
/**
|
|
19
|
+
* @description: 是否为时间
|
|
20
|
+
*/
|
|
21
|
+
export declare function isDate(val: unknown): val is Date;
|
|
22
|
+
/**
|
|
23
|
+
* @description: 是否为数值
|
|
24
|
+
*/
|
|
25
|
+
export declare function isNumber(val: unknown): val is number;
|
|
26
|
+
/**
|
|
27
|
+
* @description: 是否为AsyncFunction
|
|
28
|
+
*/
|
|
29
|
+
export declare function isAsyncFunction<T = any>(val: unknown): val is Promise<T>;
|
|
30
|
+
/**
|
|
31
|
+
* @description: 是否为promise
|
|
32
|
+
*/
|
|
33
|
+
export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
34
|
+
/**
|
|
35
|
+
* @description: 是否为字符串
|
|
36
|
+
*/
|
|
37
|
+
export declare function isString(val: unknown): val is string;
|
|
38
|
+
/**
|
|
39
|
+
* @description: 是否为boolean类型
|
|
40
|
+
*/
|
|
41
|
+
export declare function isBoolean(val: unknown): val is boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @description: 是否为数组
|
|
44
|
+
*/
|
|
45
|
+
export declare function isArray(val: any): val is Array<any>;
|
|
46
|
+
/**
|
|
47
|
+
* @description: 是否客户端
|
|
48
|
+
*/
|
|
49
|
+
export declare const isClient: () => boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @description: 是否为浏览器
|
|
52
|
+
*/
|
|
53
|
+
export declare const isWindow: (val: any) => val is Window;
|
|
54
|
+
/**
|
|
55
|
+
* @description: 是否为元素
|
|
56
|
+
*/
|
|
57
|
+
export declare const isElement: (val: unknown) => val is Element;
|
|
58
|
+
/**
|
|
59
|
+
* @description: 判断当前运行环境
|
|
60
|
+
*/
|
|
61
|
+
export declare const isServer: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @description: 判断是否为null
|
|
64
|
+
*/
|
|
65
|
+
export declare function isNull(val: unknown): val is null;
|
|
66
|
+
/**
|
|
67
|
+
* @description: 判断是否为null和未定义
|
|
68
|
+
*/
|
|
69
|
+
export declare function isNullAndUnDef(val: unknown): val is null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* @description: 判断是否为null或未定义
|
|
72
|
+
*/
|
|
73
|
+
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* @description: 判断表单数据是否为空
|
|
76
|
+
*/
|
|
77
|
+
export declare function isFormVoid(val: unknown): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SideMenu } from "~/types/menu";
|
|
2
|
+
/**
|
|
3
|
+
* 递归生成菜单树
|
|
4
|
+
* @param data 原始菜单树数据
|
|
5
|
+
* @param parent 标记父菜单
|
|
6
|
+
* @param level 标记当前菜单层级
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateMenuTree(data: SideMenu[], parent: string | null, level: number): SideMenu[];
|
|
10
|
+
/**
|
|
11
|
+
* @description: 保存时转换url到path属性
|
|
12
|
+
* @param {SideMenu} tree
|
|
13
|
+
*/
|
|
14
|
+
export declare function urlToPath(tree: SideMenu[]): SideMenu[];
|
|
15
|
+
/**
|
|
16
|
+
* 扁平化菜单树
|
|
17
|
+
*/
|
|
18
|
+
export declare const flattenMenuData: (tree: SideMenu[]) => SideMenu[];
|
|
19
|
+
/**
|
|
20
|
+
* 获取首页菜单 第一个url不为空的菜单信息
|
|
21
|
+
* @param menus
|
|
22
|
+
* @param url
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare const getHomeUrl: (menus: SideMenu[], url?: string) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface MessageOptions {
|
|
2
|
+
duration?: number;
|
|
3
|
+
maxCount?: number;
|
|
4
|
+
}
|
|
5
|
+
declare class MessageManagerConstructor {
|
|
6
|
+
private messageQueue;
|
|
7
|
+
private displayedMessages;
|
|
8
|
+
private options;
|
|
9
|
+
constructor(options?: MessageOptions);
|
|
10
|
+
private showMessage;
|
|
11
|
+
private processQueue;
|
|
12
|
+
private addToQueue;
|
|
13
|
+
success(content: string): void;
|
|
14
|
+
error(content: string): void;
|
|
15
|
+
info(content: string): void;
|
|
16
|
+
warning(content: string): void;
|
|
17
|
+
loading(content: string): void;
|
|
18
|
+
question(content: string): void;
|
|
19
|
+
}
|
|
20
|
+
declare const MessageManager: MessageManagerConstructor;
|
|
21
|
+
export { MessageManager };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class StorageUtils {
|
|
2
|
+
/**
|
|
3
|
+
* 存储实例: 默认为 local
|
|
4
|
+
*/
|
|
5
|
+
storage: Storage;
|
|
6
|
+
constructor(type?: "local" | "session");
|
|
7
|
+
setItem(key: string, value: any): void;
|
|
8
|
+
getItem(key: string): any | null;
|
|
9
|
+
removeItem(key: string): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const sessionStorageUtils: StorageUtils;
|
|
13
|
+
export declare const localStorageUtils: StorageUtils;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TableColumn } from "../types/view";
|
|
2
|
+
import type { PrimaryTableCol } from "tdesign-vue-next";
|
|
3
|
+
export declare function initTableColumns(tableColumns: TableColumn[]): Array<PrimaryTableCol>;
|
|
4
|
+
export declare function initTableDisplayColumns(tableColumns: TableColumn[]): {
|
|
5
|
+
colKey: string;
|
|
6
|
+
title: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare function highlightSearchResult(data: any, filterProps: any): any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getUrlQuery(url: string): any;
|
|
2
|
+
export declare function resolveUrl(url: string, queryParams: any, checkOuter?: boolean): string;
|
|
3
|
+
export declare function isOuterUrl(str: string): boolean;
|
|
4
|
+
export declare function isResourceUrl(str: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./GLogin";
|