@newview/ui 0.0.1

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.
@@ -0,0 +1,30 @@
1
+ import { BaseInstance } from "@newview/base-vue";
2
+
3
+ export declare class ControlGroupInstance extends BaseInstance {
4
+
5
+ }
6
+
7
+ import type { DefineComponent } from 'vue';
8
+
9
+ export declare const ControlGroup: DefineComponent<{
10
+ /**
11
+ * 宽度
12
+ */
13
+ width?: string,
14
+ /**
15
+ * 标签
16
+ */
17
+ label?: string,
18
+ /**
19
+ * 标签宽度
20
+ */
21
+ labelWidth?: number,
22
+ /**
23
+ * 图标
24
+ */
25
+ icon?: string,
26
+ /**
27
+ * 按钮点击事件
28
+ */
29
+ onClick?: () => any;
30
+ }>
@@ -0,0 +1,33 @@
1
+ import { BaseInstance } from "@newview/base-vue";
2
+ import * as monaco from "monaco-editor";
3
+
4
+ export declare class EditorInstance extends BaseInstance {
5
+ /**
6
+ * 设置值
7
+ * @param content
8
+ */
9
+ setData(content: any): void;
10
+
11
+ /**
12
+ * 获取值
13
+ * @returns
14
+ */
15
+ getData(): any[];
16
+ }
17
+
18
+ import type { DefineComponent } from 'vue';
19
+
20
+ export declare const Editor: DefineComponent<{
21
+ /**
22
+ * 宽度
23
+ */
24
+ language?: string;
25
+ /**
26
+ * 标签
27
+ */
28
+ theme?: string;
29
+ /**
30
+ * 标签宽度
31
+ */
32
+ option?: monaco.editor.IEditorOptions;
33
+ }>
@@ -0,0 +1,82 @@
1
+ import { BaseInstance } from "@newview/base-vue";
2
+
3
+ export declare class ExcelImportInstance extends BaseInstance {
4
+ /**
5
+ * 错误日志
6
+ * @param content
7
+ */
8
+ error(content: string): void;
9
+
10
+ /**
11
+ * 警告日志
12
+ * @param content
13
+ */
14
+ warning(content: string): void;
15
+
16
+ /**
17
+ * 信息日志
18
+ * @param content
19
+ */
20
+ messageInfo(content: string): void;
21
+ }
22
+
23
+
24
+ export declare class LogPanelInstance extends BaseInstance {
25
+ /**
26
+ * 清除日志
27
+ */
28
+ clearLog(): void;
29
+
30
+ /**
31
+ * 错误日志
32
+ * @param content
33
+ */
34
+ error(content: string): void;
35
+
36
+ /**
37
+ * 警告日志
38
+ * @param content
39
+ */
40
+ warning(content: string): void;
41
+
42
+ /**
43
+ * 信息日志
44
+ */
45
+ messageInfo(content: string): void;
46
+ }
47
+
48
+
49
+ import type { DefineComponent } from 'vue';
50
+
51
+ export declare const ExcelImport: DefineComponent<{
52
+ /**
53
+ * 是否按sheet页分组返回导入数据
54
+ * 传入true时则不提供选择sheet页下拉列表,会将所有sheet页数据全部返回
55
+ */
56
+ isSheetGroup?: boolean;
57
+ /**
58
+ * 是否显示导出模板
59
+ */
60
+ isExportTemplete?: boolean;
61
+ /**
62
+ * 模板地址
63
+ */
64
+ templeteUrl?: string;
65
+ /**
66
+ * 是否正在导入中
67
+ */
68
+ isImporting?: boolean;
69
+
70
+ onImport: (datas: any[]) => void;
71
+ }>
72
+
73
+ export declare const LogPanel: DefineComponent<{
74
+ /**
75
+ *
76
+ */
77
+ linkParam?: string;
78
+ /**
79
+ *
80
+ */
81
+ operates?: string;
82
+ }>
@@ -0,0 +1,588 @@
1
+ import { BaseInstance } from "@newview/base-vue";
2
+
3
+ import { ApiResult, BaseApi, QueryWrapper } from "@newview/infrastructure";
4
+ import { VNode } from "vue";
5
+ import { VxeColumnProps, VxeTableInstance, VxeTableListeners, VxeTablePropTypes } from "vxe-table";
6
+ import { SearchComOption } from "./SearchCom";
7
+ import { ToolbarOption } from "./Toolbar";
8
+
9
+ export const GloablValueType = {
10
+ /**
11
+ * 客户端 日期时间
12
+ */
13
+ $datetime: "$datetime",
14
+ /**
15
+ * 客户端 日期
16
+ */
17
+ $date: "$date",
18
+ /**
19
+ * 客户端 时间
20
+ */
21
+ $time: "$time",
22
+ /**
23
+ * 唯一标识
24
+ */
25
+ $guid: "$guid",
26
+ /**
27
+ * 登录用户Id
28
+ */
29
+ $LoginUserId: "@LoginUserId",
30
+ /**
31
+ * 登录用户真实名称
32
+ */
33
+ $LoginUserTrueName: "@LoginUserName",
34
+ /**
35
+ * 登录用户账号
36
+ */
37
+ $LoginUserAccount: "@LoginAccount",
38
+ /**
39
+ * 服务器 日期
40
+ */
41
+ $CurrentDate: "@CurrentDate"
42
+ };
43
+
44
+ /**
45
+ * Gird Option
46
+ */
47
+ export interface GridOptions {
48
+ /**
49
+ * api接口对应类
50
+ */
51
+ api?: BaseApi;
52
+
53
+ /**
54
+ * 基本属性
55
+ */
56
+ setting?: GridSetting;
57
+
58
+ /**
59
+ * 事件
60
+ */
61
+ event?: GridEvent;
62
+
63
+ /**
64
+ * 搜索条件配置参数
65
+ */
66
+ searchOptions?: SearchComOption[];
67
+
68
+ /**
69
+ * 工具栏按钮
70
+ */
71
+ toolbars?: ToolbarOption[];
72
+
73
+ /**
74
+ * 右侧按钮
75
+ */
76
+ rightToolbars?: ToolbarOption[];
77
+
78
+ /**
79
+ * 列参数
80
+ */
81
+ columns?: GridColumn[];
82
+ }
83
+
84
+ /**
85
+ * 按钮
86
+ */
87
+ export interface GridButton {
88
+ /**
89
+ * 名称,唯一标识
90
+ */
91
+ name: string;
92
+ /**
93
+ * 文本
94
+ */
95
+ text?: string;
96
+ /**
97
+ * 图标
98
+ */
99
+ icon?: string;
100
+ /**
101
+ * 点击方法
102
+ */
103
+ onclick?: (row: any, btn: GridButton) => void;
104
+ /**
105
+ * 按钮类型
106
+ */
107
+ type?: "default" | "primary" | "dashed" | "text" | "info" | "success" | "warning" | "error";
108
+ /**
109
+ * 样式
110
+ */
111
+ class?: string,
112
+ /**
113
+ * 是否显示
114
+ */
115
+ isShow?: boolean | ((row: any) => boolean);
116
+ /**
117
+ * 是否禁用
118
+ */
119
+ isEnable?: boolean | ((row: any) => boolean);
120
+ }
121
+
122
+ /**
123
+ * 日期选择参数
124
+ */
125
+ export interface GridDatePickerProp {
126
+ format?: string,
127
+ type?: "date" | "daterange" | "datetime" | "datetimerange" | "year" | "month"
128
+ }
129
+
130
+ /**
131
+ * 时间选择参数
132
+ */
133
+ export interface GridTimePickerProp {
134
+ type?: "time" | "timerange",
135
+ format?: string
136
+ }
137
+
138
+ /**
139
+ * InputNumber 参数
140
+ */
141
+ export interface GridInputNumberProp {
142
+ /**
143
+ * 最大值 默认值: Infinity
144
+ */
145
+ max?: number,
146
+ /**
147
+ * 最小值 默认值: -Infinity
148
+ */
149
+ min?: number,
150
+ /**
151
+ * 每次改变的步伐,可以是小数 默认值: 1
152
+ */
153
+ step?: number
154
+ }
155
+
156
+ /**
157
+ * Option
158
+ */
159
+ export interface GridSelectOptionProp {
160
+ value: any,
161
+ text: any
162
+ }
163
+
164
+ /**
165
+ * 下拉框配置
166
+ */
167
+ export interface GridSelectProp {
168
+ /**
169
+ * Option
170
+ */
171
+ data?: GridSelectOptionProp[],
172
+ multiple?: boolean,
173
+ clearable?: boolean
174
+ }
175
+
176
+ /**
177
+ * 自动完成组件参数
178
+ */
179
+ export interface GridAutoCompleteProp {
180
+ data?: string[],
181
+ filterMethod?: Function
182
+ }
183
+
184
+ /**
185
+ * 基本配置
186
+ */
187
+ export interface GridSetting {
188
+ /**
189
+ * 按钮权限控制参数
190
+ */
191
+ operates?: string;
192
+ /**
193
+ * 表格类型('view'只读,'edit'行内编辑)
194
+ */
195
+ mode?: "view" | "edit";
196
+ /**
197
+ * 是否分页
198
+ */
199
+ isPagination?: boolean;
200
+ /**
201
+ * 是否为Tree
202
+ */
203
+ isTree?: boolean;
204
+ /**
205
+ * 是否显示孩子节点
206
+ */
207
+ isShowChildren?: boolean;
208
+ /**
209
+ * 行Key
210
+ */
211
+ rowKey?: string;
212
+ /**
213
+ * 每页大小
214
+ */
215
+ pageSize?: number;
216
+ /**
217
+ * 删除提示语Key
218
+ */
219
+ delMsgKey?: string;
220
+ /**
221
+ * 开始时编辑
222
+ */
223
+ startEdit?: boolean;
224
+ /**
225
+ * 查询配置
226
+ */
227
+ searchConfig?: SearchConfig;
228
+ /**
229
+ * 按钮配置
230
+ */
231
+ toolbarConfig?: ToolbarConfig;
232
+ /**
233
+ * 编辑配置
234
+ */
235
+ editConfig?: VxeTablePropTypes.EditConfig;
236
+ /**
237
+ * 行配置
238
+ */
239
+ rowConfig?: VxeTablePropTypes.RowConfig;
240
+ /**
241
+ * 树配置
242
+ */
243
+ treeConfig?: VxeTablePropTypes.TreeConfig;
244
+ /**
245
+ * 是否显示边框
246
+ */
247
+ border?: boolean;
248
+ /**
249
+ * 显示标题
250
+ */
251
+ showHeader?: boolean;
252
+ /**
253
+ * 双切换展开树
254
+ */
255
+ dblClickToggleTreeExpand?: boolean;
256
+ }
257
+
258
+ /**
259
+ * Toolbar 配置
260
+ */
261
+ export interface ToolbarConfig {
262
+ /**
263
+ * 是否为按钮组
264
+ */
265
+ isButtonGroup?: boolean;
266
+ /**
267
+ * 最多显示格式
268
+ */
269
+ maxShow?: number;
270
+ }
271
+
272
+ /**
273
+ * 查询配置
274
+ */
275
+ export interface SearchConfig {
276
+ /**
277
+ * 按钮 Col Span
278
+ */
279
+ btnSpan?: number;
280
+ /**
281
+ * 标签宽度
282
+ */
283
+ labelWidth?: number;
284
+ /**
285
+ * 默认显示查询
286
+ */
287
+ defaultShowSearch?: boolean;
288
+ }
289
+
290
+ /**
291
+ * 事件
292
+ */
293
+ export interface GridEvent extends VxeTableListeners {
294
+
295
+ /**
296
+ * 保存前事件
297
+ */
298
+ event_saveBefore?: (datas: any[]) => boolean;
299
+
300
+ /**
301
+ * 保存后事件
302
+ */
303
+ event_saveAfter?: (datas: any[], result: any) => void;
304
+
305
+ /**
306
+ * 删除前事件
307
+ */
308
+ event_deleteBefore?: (id: number, row: any) => boolean;
309
+
310
+ /**
311
+ * 删除后事件
312
+ */
313
+ event_deleteAfter?: (id: number, apiResult: ApiResult, row: any) => void;
314
+
315
+ /**
316
+ * 查询事件
317
+ */
318
+ event_search?: (data: any) => void;
319
+
320
+ /**
321
+ * 行添加前事件, 可以修改要插入Row的数据
322
+ */
323
+ event_addRowBefore?: (row: any, parentRow: any) => any;
324
+
325
+ /**
326
+ * 编辑行之前事件
327
+ */
328
+ event_editRowBefore?: (row: any, parentRow: any) => any;
329
+ }
330
+
331
+ /**
332
+ * 列配置
333
+ */
334
+ export interface GridColumn extends VxeColumnProps {
335
+ // 扩展属性
336
+
337
+ /**
338
+ * 表头分组
339
+ */
340
+ children?: Array<GridColumn>;
341
+
342
+ /**
343
+ * 列类型
344
+ */
345
+ colType?: "ed" | "auto" | "num" | "select" | "date" | "time" | "ro" | 'seq' | 'radio' | 'checkbox' | 'expand';
346
+
347
+ /**
348
+ * 行按钮
349
+ */
350
+ rowButtons?: GridButton[];
351
+
352
+ /**
353
+ * 渲染函数
354
+ */
355
+ format?: (h: any, params: { row: any, column: any }) => VNode | any;
356
+
357
+ /**
358
+ * 列头渲染函数
359
+ */
360
+ titleFormat?: (h: any, column: any) => VNode | any;
361
+
362
+ /**
363
+ * 值改变事件
364
+ */
365
+ change?: Function;
366
+
367
+ /**
368
+ * 日期类型参数
369
+ */
370
+ datePicker?: GridDatePickerProp;
371
+
372
+ /**
373
+ * 时间类型参数
374
+ */
375
+ timePicker?: GridTimePickerProp;
376
+
377
+ /**
378
+ * 数字输入框参数
379
+ */
380
+ inputNumber?: GridInputNumberProp;
381
+
382
+ /**
383
+ * 下拉框参数
384
+ */
385
+ select?: GridSelectProp;
386
+
387
+ /**
388
+ * 自动完成组件参数
389
+ */
390
+ autoComplete?: GridAutoCompleteProp;
391
+
392
+ /**
393
+ * 默认值
394
+ */
395
+ defaultValue?: any;
396
+ }
397
+
398
+ /**
399
+ * 数据加载参数
400
+ */
401
+ export interface LoadDataOptions {
402
+ filter?: string;
403
+ page?: number;
404
+ pageSize?: number;
405
+ sort?: string;
406
+ /**
407
+ * 是否分页
408
+ */
409
+ isPagination?: boolean;
410
+ queryWrapper?: QueryWrapper;
411
+ success: (datas: any) => void;
412
+ }
413
+
414
+ export declare class GridInstance extends BaseInstance {
415
+ gloablValues: Array<any>;
416
+
417
+ /**
418
+ * 设置数据
419
+ * @param datas
420
+ */
421
+ setDatas(datas: any[]): void;
422
+
423
+ /**
424
+ * 获取最新数据
425
+ * @returns
426
+ */
427
+ getNewDatas(): any[];
428
+
429
+ /**
430
+ * 获取数据
431
+ * @returns
432
+ */
433
+ getDatas(): any[];
434
+
435
+ /**
436
+ * 获取复选框选中的数据
437
+ * @returns
438
+ */
439
+ getCheckboxDatas(): any[];
440
+
441
+ /**
442
+ * 获取当前记录行
443
+ * @returns
444
+ */
445
+ getCurrentRecord(): any;
446
+
447
+ /**
448
+ * 获取需要保存的数据
449
+ * @returns
450
+ */
451
+ getSaveDatas(): any[];
452
+
453
+ /**
454
+ * 获取XTable
455
+ */
456
+ getXTable(): VxeTableInstance;
457
+
458
+ /**
459
+ * 设置当前页
460
+ * @param pageIndex
461
+ */
462
+ setPageIndex(pageIndex: number): void;
463
+
464
+ /**
465
+ * 获取页
466
+ */
467
+ getPageIndex(): number;
468
+
469
+ /**
470
+ * 重新计算页
471
+ * @param deleteNumber
472
+ */
473
+ reCalcPageIndex(deleteNumber: number): void;
474
+
475
+ /**
476
+ * 设置每页尺寸
477
+ * @param pageSize
478
+ */
479
+ setPageSize(pageSize: number): void;
480
+
481
+ /**
482
+ * 移除行
483
+ * @param row
484
+ */
485
+ removeRow(row: any): void;
486
+
487
+ /**
488
+ * 新增行
489
+ * @param row
490
+ */
491
+ addRow(row: any): Promise<void>;
492
+
493
+ /**
494
+ * 修改行
495
+ */
496
+ updateRow(rowId, data: any): Promise<void>;
497
+
498
+ /**
499
+ * 组织查询参数
500
+ * @returns
501
+ */
502
+ getLoadDataOptions(): void;
503
+
504
+ /**
505
+ * 加载数据
506
+ * @param _readFunction
507
+ */
508
+ loadData(_readFunction: (options: LoadDataOptions) => Promise<void>): Promise<void>;
509
+
510
+ /**
511
+ * 加载数据
512
+ * @param _queryWrapper
513
+ */
514
+ loadDataByQuery(_queryWrapper: QueryWrapper): void;
515
+
516
+ /**
517
+ * 刷新数据
518
+ */
519
+ refreshData(): Promise<void>;
520
+
521
+ /**
522
+ * 设置当前行
523
+ * @param row
524
+ */
525
+ setCurrentRow(row: any): void;
526
+
527
+ /**
528
+ * 清除当前选中行
529
+ */
530
+ clearCurrentRow(): void;
531
+
532
+ /**
533
+ * 设置当前行为编辑状态
534
+ */
535
+ setEditRow(row: any): void;
536
+
537
+
538
+ /**
539
+ * 设置全局值
540
+ * @param key
541
+ * @param value
542
+ * @param isOnlyAddSetValue
543
+ */
544
+ setGloablValue(key: string, value: any, isOnlyAddSetValue: boolean = false): void;
545
+
546
+ /**
547
+ * 填充全局值到Row
548
+ * @param row row数据
549
+ */
550
+ intoGloablValue(row: any): void;
551
+
552
+ /**
553
+ * 获取添加的数据
554
+ * @param row
555
+ * @returns
556
+ */
557
+ getAddData(row: any): any;
558
+
559
+ /**
560
+ * 执行刷新
561
+ */
562
+ doRefresh(): void;
563
+
564
+ /**
565
+ * 执行删除
566
+ * @param row
567
+ */
568
+ doDelete(row: any): void;
569
+
570
+ /**
571
+ * 清除行Radio选中状态
572
+ */
573
+ doClearRadioRow(): void;
574
+
575
+ /**
576
+ * 清除行checkbox选中状态
577
+ */
578
+ doClearCheckboxRow(): void;
579
+ }
580
+
581
+ import type { DefineComponent } from 'vue';
582
+
583
+ export declare const Grid: DefineComponent<{
584
+ /**
585
+ * Gird 配置项
586
+ */
587
+ option?: GridOptions;
588
+ }>