zzz-pc-view 0.0.40 → 0.0.41
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/package.json +3 -1
- package/src/api/own +1 -1
- package/src/decorators/CurdKey/CurdApi.d.ts +2 -2
- package/src/decorators/CurdKey/index.d.ts +62 -22
- package/src/decorators/DeclareType.d.ts +1 -1
- package/src/decorators/FilterKey/index.d.ts +5 -5
- package/src/index.es.js +1257 -135
- package/src/index.umd.js +2 -2
- package/src/pcViews/components/curd/CreateBtnView.vue.d.ts +16 -0
- package/src/pcViews/components/curd/CurdFormOperatorView.vue.d.ts +20 -0
- package/src/pcViews/components/curd/CurdFormView.vue.d.ts +16 -0
- package/src/pcViews/components/curd/CurdTableOperatorView.vue.d.ts +21 -0
- package/src/pcViews/components/curd/CurdView.vue.d.ts +3 -1
- package/src/pcViews/components/curd/CurdViewHandler.d.ts +171 -6
- package/src/pcViews/components/curd/CurdViewType.d.ts +4 -0
- package/src/pcViews/components/curd/DialogEditorView.vue.d.ts +21 -0
- package/src/pcViews/components/curd/DrawerEditorView.vue.d.ts +16 -0
- package/src/pcViews/components/curd/SearchBtnView.vue.d.ts +9 -0
- package/src/pcViews/components/curd/index.d.ts +6 -0
- package/src/pcViews/components/forms/MyInputView.vue.d.ts +21 -0
- package/src/pcViews/components/forms/index.d.ts +1 -0
- package/src/pcViews/components/layout/DataWrapperView.vue.d.ts +4 -0
- package/src/pcViews/components/layout/LayoutMainView.vue.d.ts +7 -0
- package/src/pcViews/components/layout/LayoutNavView.vue.d.ts +4 -0
- package/src/pcViews/components/layout/LayoutProfileView.vue.d.ts +9 -0
- package/src/pcViews/components/layout/LayoutViewDeclare.d.ts +29 -0
- package/src/pcViews/components/utils.d.ts +10 -6
- package/src/webUtils/icons/index.d.ts +1 -0
- package/src/webUtils/index.d.ts +1 -0
- package/src/webUtils/useNavStore.d.ts +136 -0
- package/src/webUtils/useSkeletonRow.d.ts +4 -0
- package/src/zzz-frame.css +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zzz-pc-view",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"main": "src/index.umd.js",
|
|
5
5
|
"module": "src/index.es.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"echarts": "^5.5.1",
|
|
24
24
|
"element-plus": "^2.9.1",
|
|
25
25
|
"color-hash": "^2.0.2",
|
|
26
|
+
"@types/sortablejs": "^1.15.8",
|
|
27
|
+
"sortablejs": "^1.15.6",
|
|
26
28
|
"animate.css": "^4.1.1",
|
|
27
29
|
"mitt": "^3.0.1",
|
|
28
30
|
"@types/mockjs": "^1.0.10",
|
package/src/api/own
CHANGED
|
@@ -9,7 +9,7 @@ import { Reactive } from 'vue';
|
|
|
9
9
|
export declare enum EditTypeEnum {
|
|
10
10
|
CREATE = 1,
|
|
11
11
|
DETAIL = 2,
|
|
12
|
-
UPDATE =
|
|
12
|
+
UPDATE = 3
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* 定义编辑类型映射的常量对象。
|
|
@@ -48,7 +48,7 @@ export declare const editTypeMap: {
|
|
|
48
48
|
* @property {string} label - 操作的标签,为'修改'。
|
|
49
49
|
* @property {string} method - 操作的HTTP方法,为'PUT'。
|
|
50
50
|
*/
|
|
51
|
-
readonly
|
|
51
|
+
readonly 3: {
|
|
52
52
|
readonly id: EditTypeEnum.UPDATE;
|
|
53
53
|
readonly label: "修改";
|
|
54
54
|
readonly method: "PUT";
|
|
@@ -5,7 +5,7 @@ import { EditTypeEnum, CurdApi, EditType, PaginationResponse } from './CurdApi';
|
|
|
5
5
|
import { Config as PrimaryKeyConfig } from './../PrimaryKey';
|
|
6
6
|
import { Config as NameKeyConfig } from './../NameKey';
|
|
7
7
|
import { RequestUtilResponse } from '../useRequestUtil';
|
|
8
|
-
import {
|
|
8
|
+
import { ZNavButton } from '../../webUtils';
|
|
9
9
|
export * from './CurdApi';
|
|
10
10
|
export * from './useCurdMock';
|
|
11
11
|
/**
|
|
@@ -123,20 +123,32 @@ interface FormParam extends ComponentParam {
|
|
|
123
123
|
steps?: FormStep[];
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* @template T - 对象类型,默认为 object。
|
|
130
|
-
* @interface CurdHandlerParam
|
|
131
|
-
* @property {string} label - CURD 操作的标签。
|
|
132
|
-
* @property {CurdApi<T>} api - CURD API 实例。
|
|
133
|
-
* @property {PaginationRequest} [pagination] - 可选的分页请求。
|
|
134
|
-
* @property {(this: CurdHandler<T>) => { tableParam?: ComponentParam; formParam?: FormParam }} [componentCreator] - 可选的组件创建器函数,用于创建表格和表单的参数。
|
|
126
|
+
* 定义一个泛型接口 CurdHandlerParam,用于配置 CURD 处理程序的参数。
|
|
127
|
+
* @template T - 数据对象的类型,默认为 object。
|
|
128
|
+
* @template P - 分页响应的类型,默认为 PaginationResponse<T>。
|
|
135
129
|
*/
|
|
136
130
|
export interface CurdHandlerParam<T extends object = object, P extends PaginationResponse<T> = PaginationResponse<T>> {
|
|
131
|
+
/**
|
|
132
|
+
* 用于显示的标签,通常用于标题或描述。
|
|
133
|
+
*/
|
|
137
134
|
label: string;
|
|
135
|
+
/**
|
|
136
|
+
* 权限配置,记录了每个操作对应的导航按钮。
|
|
137
|
+
*/
|
|
138
|
+
permission: Record<string, ZNavButton>;
|
|
139
|
+
/**
|
|
140
|
+
* 用于 CURD 操作的 API 实例,包含了与服务器交互的方法。
|
|
141
|
+
*/
|
|
138
142
|
api: CurdApi<T, P>;
|
|
143
|
+
/**
|
|
144
|
+
* 可选的分页请求配置,包含当前页码和每页显示的记录数。
|
|
145
|
+
*/
|
|
139
146
|
pagination?: PaginationRequest;
|
|
147
|
+
/**
|
|
148
|
+
* 可选的组件创建函数,用于动态创建表格和表单的参数。
|
|
149
|
+
* @param {CurdHandler<T, P>} this - 上下文对象,指向当前的 CurdHandler 实例。
|
|
150
|
+
* @returns {{ tableParam?: TableParam; formParam?: FormParam }} - 返回一个包含表格和表单参数的对象。
|
|
151
|
+
*/
|
|
140
152
|
componentCreator?(this: CurdHandler<T, P>): {
|
|
141
153
|
tableParam?: TableParam;
|
|
142
154
|
formParam?: FormParam;
|
|
@@ -209,6 +221,13 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
209
221
|
* @description 它会在组件初始化时被设置,并且在组件的整个生命周期中保持不变。
|
|
210
222
|
*/
|
|
211
223
|
readonly label: string;
|
|
224
|
+
/**
|
|
225
|
+
* 定义一个只读属性,用于存储权限配置。
|
|
226
|
+
* 该属性是一个记录类型,键为字符串,值为 ZNavButton 类型。
|
|
227
|
+
* 它用于存储每个操作对应的导航按钮,以实现权限控制。
|
|
228
|
+
* 这个属性在组件初始化时被设置,并且在组件的整个生命周期中保持不变。
|
|
229
|
+
*/
|
|
230
|
+
readonly permission: Record<string, ZNavButton>;
|
|
212
231
|
/**
|
|
213
232
|
* 创建一个浅引用,用于存储 CURD 操作的配置。
|
|
214
233
|
* 这个引用将用于在组件中存储和更新 CURD 配置。
|
|
@@ -288,7 +307,9 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
288
307
|
label?: string;
|
|
289
308
|
desc?: string;
|
|
290
309
|
index: number;
|
|
291
|
-
|
|
310
|
+
formItemsGroup: (FormItemParam & {
|
|
311
|
+
propertyKey: KeyMatch<T, unknown>;
|
|
312
|
+
})[][];
|
|
292
313
|
}[]>;
|
|
293
314
|
/**
|
|
294
315
|
* 获取显示的表单项的分组配置。
|
|
@@ -299,7 +320,9 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
299
320
|
label?: string;
|
|
300
321
|
desc?: string;
|
|
301
322
|
index: number;
|
|
302
|
-
|
|
323
|
+
formItemsGroup: (FormItemParam & {
|
|
324
|
+
propertyKey: KeyMatch<T, unknown>;
|
|
325
|
+
})[][];
|
|
303
326
|
}[];
|
|
304
327
|
/**
|
|
305
328
|
* 定义一个只读属性,用于存储 CURD 操作的 API 实例。
|
|
@@ -382,7 +405,7 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
382
405
|
* @param {T} data - 包含名称的对象。
|
|
383
406
|
* @returns {string} - 数据的名称,如果没有配置名称键,则返回一个空字符串。
|
|
384
407
|
*/
|
|
385
|
-
getDataName(data: T): "" | T[KeyMatch<T,
|
|
408
|
+
getDataName(data: T): "" | T[KeyMatch<T, import('../../utils').KeyValType>];
|
|
386
409
|
/**
|
|
387
410
|
* 获取名称键配置。
|
|
388
411
|
* 这个方法返回 nameKeyConfig 属性的值,它包含了名称键的配置信息。
|
|
@@ -577,6 +600,16 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
577
600
|
* @description 它会确保 formStepIndex 的值在 0 和 displayStepFormItemsGroup.length - 1 之间,以防止越界。
|
|
578
601
|
*/
|
|
579
602
|
set formStepIndex(formStepIndex: number);
|
|
603
|
+
/**
|
|
604
|
+
* 更改表单步骤索引。
|
|
605
|
+
* 根据传入的方向参数(1 或 -1),决定是向前还是向后移动表单步骤。
|
|
606
|
+
* 如果方向为 1(向前),则先验证编辑器数据,验证通过后将步骤索引加 1。
|
|
607
|
+
* 如果方向为 -1(向后),则直接将步骤索引减 1。
|
|
608
|
+
*
|
|
609
|
+
* @param { -1 | 1 } direction - 方向参数,1 表示向前,-1 表示向后。
|
|
610
|
+
* @returns { void }
|
|
611
|
+
*/
|
|
612
|
+
changeFormStepIndex(direction: -1 | 1): void;
|
|
580
613
|
/**
|
|
581
614
|
* 创建一个浅引用,用于存储编辑类型。
|
|
582
615
|
* 这个引用将用于在组件中存储和更新编辑类型。
|
|
@@ -636,13 +669,13 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
636
669
|
*/
|
|
637
670
|
get editorDataLoadStatus(): boolean;
|
|
638
671
|
/**
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
* @type {
|
|
642
|
-
* @description
|
|
672
|
+
* 创建一个响应式引用,用于存储编辑器的数据。
|
|
673
|
+
* 这个引用将用于在组件中存储和更新编辑器的数据。
|
|
674
|
+
* @type {Ref<T | undefined>}
|
|
675
|
+
* @description 这个引用是响应式的,意味着它会在数据发生变化时自动更新。
|
|
643
676
|
* @description 这对于性能优化很重要,因为它避免了不必要的更新。
|
|
644
677
|
*/
|
|
645
|
-
protected readonly editorDataRef: import('vue').
|
|
678
|
+
protected readonly editorDataRef: import('vue').Ref<T | undefined, T | undefined>;
|
|
646
679
|
/**
|
|
647
680
|
* 获取编辑器数据。
|
|
648
681
|
* 这个方法返回 editorDataRef 引用的值,它包含了编辑器当前的数据。
|
|
@@ -681,6 +714,12 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
681
714
|
*/
|
|
682
715
|
closeEditor(): void;
|
|
683
716
|
protected saveEditorDataRequestUtil: RequestUtilResponse;
|
|
717
|
+
/**
|
|
718
|
+
* 获取保存编辑器数据请求的加载状态。
|
|
719
|
+
* 该方法返回 `saveEditorDataRequestUtil` 的 `loadStatus` 属性值,用于判断保存编辑器数据的请求是否正在加载。
|
|
720
|
+
* @returns {boolean} - 保存编辑器数据请求的加载状态,true 表示正在加载,false 表示加载完成。
|
|
721
|
+
*/
|
|
722
|
+
get saveEditorDataLoadStatus(): boolean;
|
|
684
723
|
/**
|
|
685
724
|
* 抽象方法,用于验证编辑器数据的有效性。
|
|
686
725
|
* 这个方法会在打开编辑器之前被调用,用于执行一些验证逻辑。
|
|
@@ -688,7 +727,7 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
688
727
|
* @description 它会返回一个 Promise,如果验证通过,则继续打开编辑器;否则,抛出错误。
|
|
689
728
|
* @returns {Promise<any>} - 返回一个 Promise,表示验证的结果。
|
|
690
729
|
*/
|
|
691
|
-
|
|
730
|
+
abstract validEditorData(): Promise<any>;
|
|
692
731
|
/**
|
|
693
732
|
* 定义一个抽象方法,用于在保存编辑器数据成功后执行的操作。
|
|
694
733
|
* 这个方法会在编辑器数据成功保存到服务器后被调用,用于执行一些后续操作,例如提示用户保存成功、更新UI等。
|
|
@@ -707,9 +746,10 @@ export declare abstract class CurdHandler<T extends object = object, P extends P
|
|
|
707
746
|
*/
|
|
708
747
|
saveEditorData(callback?: (data: T) => void): void;
|
|
709
748
|
/**
|
|
710
|
-
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
749
|
+
* 保存编辑器数据并继续创建新数据。
|
|
750
|
+
* 此方法会调用 `saveEditorData` 方法保存当前编辑器中的数据,
|
|
751
|
+
* 当保存成功后,将表单步骤索引重置为 0,并使用新创建的实例重置编辑器数据,以便用户继续创建新数据。
|
|
752
|
+
*
|
|
713
753
|
* @returns {void}
|
|
714
754
|
*/
|
|
715
755
|
editorDataSaveAndContinue(): void;
|
|
@@ -28,7 +28,7 @@ export type ComponentProps = Record<PropertyKey, unknown>;
|
|
|
28
28
|
* 定义一个类型别名,用于描述事件处理函数映射。
|
|
29
29
|
* 该类型别名是一个记录类型,键为字符串,值为函数类型,函数接受任意数量的未知类型参数,并且不返回任何值。
|
|
30
30
|
*/
|
|
31
|
-
export type EventHandlerMap = Record<string, (...args:
|
|
31
|
+
export type EventHandlerMap = Record<string, (...args: any[]) => void>;
|
|
32
32
|
/**
|
|
33
33
|
* 导出一个空对象,用于确保该模块有一个默认导出。
|
|
34
34
|
*/
|
|
@@ -210,12 +210,12 @@ export declare abstract class FilterHandler<Q extends object> extends ConfigsCre
|
|
|
210
210
|
*/
|
|
211
211
|
protected validateQuery(): Promise<void>;
|
|
212
212
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
213
|
+
* 执行搜索操作,该方法会先验证查询的有效性,然后根据验证结果执行相应的回调函数。
|
|
214
|
+
* 此方法是过滤器处理程序的核心逻辑之一,用于确保在进行搜索操作之前,查询数据是有效的。
|
|
215
|
+
*
|
|
216
|
+
* @returns {void}
|
|
217
217
|
*/
|
|
218
|
-
|
|
218
|
+
search(): void;
|
|
219
219
|
/**
|
|
220
220
|
* 获取查询加载状态存储对象。
|
|
221
221
|
* 该方法返回全局的加载状态存储对象 `loadStore`。
|