@guodun/antdv 1.4.4 → 1.4.6
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/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +85 -85
- package/dist/es/components/contract-signing-location/src/template-source.mjs +63 -4
- package/dist/es/components/dept-selector/src/dept.mjs +170 -142
- package/dist/es/components/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +372 -185
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +59 -42
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +218 -85
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.mjs +97 -0
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +914 -853
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +550 -245
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +214 -139
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +53 -35
- package/dist/es/components/pro-contract-template-designer/src/types.mjs +15 -2
- package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +91 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -65
- package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +23 -16
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-selector/src/components/org-tree.mjs +130 -89
- package/dist/es/components/pro-selector/src/components/user.mjs +34 -26
- package/dist/es/components/pro-selector/src/pro-user.mjs +86 -72
- package/dist/es/components/pro-selector/src/types.mjs +4 -1
- package/dist/es/components/pro-selector/src/utils/orgTree.mjs +5 -2
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +92 -65
- package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +3 -3
- package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +98 -73
- package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +12 -9
- package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +101 -72
- package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +39 -22
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +105 -83
- package/dist/es/components/pro-selector-group/src/utils/index.mjs +36 -0
- package/dist/es/components/role-selector/src/role.mjs +134 -120
- package/dist/es/index.mjs +50 -49
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
- package/dist/lib/components/dept-selector/src/dept.cjs +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +2 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-selector/src/components/org-tree.cjs +1 -1
- package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/pro-user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/hooks/useApi.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -0
- package/dist/lib/components/role-selector/src/role.cjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/dept-selector.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-selector-group.css +1 -1
- package/dist/theme/pro-selector.css +1 -1
- package/dist/theme/role-selector.css +1 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +7 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.d.ts +14 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +13 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +131 -2
- package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +10 -2
- package/dist/types/components/pro-selector/index.d.ts +9 -0
- package/dist/types/components/pro-selector/src/components/user.d.ts +9 -0
- package/dist/types/components/pro-selector/src/types.d.ts +2 -0
- package/dist/types/components/pro-selector/src/utils/orgTree.d.ts +4 -1
- package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +4 -4
- package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +6 -1
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +8 -0
- package/package.json +5 -3
package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContractSigningLocationError, ContractSigningLocationProps, ContractSigningLocationValue, ContractSigningPlacement, ContractSigningPlacementType } from './types';
|
|
1
|
+
import { ContractSigningFile, ContractSigningLocationError, ContractSigningLocationProps, ContractSigningLocationValue, ContractSigningPlacement, ContractSigningPlacementType } from './types';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<ContractSigningLocationProps, {
|
|
3
3
|
load: () => Promise<ContractSigningLocationValue | false>;
|
|
4
4
|
validate: () => ContractSigningLocationError[];
|
|
@@ -54,7 +54,7 @@ declare const _default: import('vue').DefineComponent<ContractSigningLocationPro
|
|
|
54
54
|
showInspector: boolean;
|
|
55
55
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
56
56
|
canvasRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
57
|
-
file?:
|
|
57
|
+
file?: ContractSigningFile;
|
|
58
58
|
pages: import('./types').ContractSigningPage[];
|
|
59
59
|
placements: ContractSigningPlacement[];
|
|
60
60
|
selectedPlacementId: string;
|
|
@@ -105,7 +105,7 @@ declare const _default: import('vue').DefineComponent<ContractSigningLocationPro
|
|
|
105
105
|
M: {};
|
|
106
106
|
Defaults: {};
|
|
107
107
|
}, Readonly<{
|
|
108
|
-
file?:
|
|
108
|
+
file?: ContractSigningFile;
|
|
109
109
|
pages: import('./types').ContractSigningPage[];
|
|
110
110
|
placements: ContractSigningPlacement[];
|
|
111
111
|
selectedPlacementId: string;
|
|
@@ -8,6 +8,7 @@ export * from './src/composables/use-template-draft-cache';
|
|
|
8
8
|
export * from './src/utils/template-renderer';
|
|
9
9
|
export * from './src/utils/signing-placement';
|
|
10
10
|
export * from './src/utils/content-image';
|
|
11
|
+
export * from './src/utils/advanced-controls';
|
|
11
12
|
export declare const GdAntProContractTemplateDesigner: SFCWithInstall<typeof ProContractTemplateDesigner>;
|
|
12
13
|
export declare const GdAntProContractTemplateRenderer: SFCWithInstall<typeof ProContractTemplateRenderer>;
|
|
13
14
|
export default GdAntProContractTemplateDesigner;
|
|
@@ -5,6 +5,7 @@ type __VLS_Props = {
|
|
|
5
5
|
showDraftCacheStatus: boolean;
|
|
6
6
|
showClearButton: boolean;
|
|
7
7
|
showSubmitDataViewer: boolean;
|
|
8
|
+
showVariableDataViewer: boolean;
|
|
8
9
|
readonly: boolean;
|
|
9
10
|
zoomPercent: string;
|
|
10
11
|
zoomOutDisabled: boolean;
|
|
@@ -39,6 +40,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
39
40
|
toggleFullscreen: () => any;
|
|
40
41
|
toggleImmersive: () => any;
|
|
41
42
|
submitData: () => any;
|
|
43
|
+
variableData: () => any;
|
|
42
44
|
togglePageDecorations: () => any;
|
|
43
45
|
toggleChrome: () => any;
|
|
44
46
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -52,6 +54,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
52
54
|
onToggleFullscreen?: (() => any) | undefined;
|
|
53
55
|
onToggleImmersive?: (() => any) | undefined;
|
|
54
56
|
onSubmitData?: (() => any) | undefined;
|
|
57
|
+
onVariableData?: (() => any) | undefined;
|
|
55
58
|
onTogglePageDecorations?: (() => any) | undefined;
|
|
56
59
|
onToggleChrome?: (() => any) | undefined;
|
|
57
60
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContractTemplateRenderValue, ContractTemplateValidationError, ContractTemplateVariable } from './types';
|
|
1
|
+
import { ContractTemplateControlOption, ContractTemplateControlRegistration, ContractTemplateRenderValue, ContractTemplateValidationError, ContractTemplateVariable } from './types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
variable: ContractTemplateVariable;
|
|
4
4
|
value: ContractTemplateRenderValue;
|
|
@@ -6,6 +6,12 @@ type __VLS_Props = {
|
|
|
6
6
|
active: boolean;
|
|
7
7
|
readonly: boolean;
|
|
8
8
|
disabled: boolean;
|
|
9
|
+
options?: ContractTemplateControlOption[];
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
loadError?: string;
|
|
12
|
+
registration?: ContractTemplateControlRegistration;
|
|
13
|
+
selectorHttp?: unknown;
|
|
14
|
+
selectorUrlPrefix?: string;
|
|
9
15
|
};
|
|
10
16
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
17
|
updateValue: (value: ContractTemplateRenderValue) => any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContractTemplateVariableData } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
data: ContractTemplateVariableData;
|
|
5
|
+
fileName?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
cancel: () => any;
|
|
9
|
+
"update:open": (value: boolean) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onCancel?: (() => any) | undefined;
|
|
12
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContractTemplateContentImage, ContractTemplateData, ContractTemplateFile, ContractTemplateFilesExportResult, ContractLocationRule, ContractTemplateDesignerProps, ContractTemplateDraftCacheStatus, ContractTemplateEditorCommand, ContractTemplateEditorState, ContractTemplateEditorTextAlign, ContractTemplateFieldStyle, ContractTemplateFieldType, ContractTemplatePageDecorations, ContractTemplatePageSize, ContractTemplateLocationRule, ContractTemplateLocationRuleOptions, ContractTemplateSigningPlacement, ContractTemplateSigningPlacementType, ContractTemplateTableInsertOptions, ContractTemplateTableCommandCapabilities, ContractTemplateValidationError, ContractTemplateVariable } from './types';
|
|
1
|
+
import { ContractTemplateContentImage, ContractTemplateData, ContractTemplateFile, ContractTemplateFilesExportResult, ContractLocationRule, ContractTemplateDesignerProps, ContractTemplateDraftCacheStatus, ContractTemplateEditorCommand, ContractTemplateEditorState, ContractTemplateEditorTextAlign, ContractTemplateFieldStyle, ContractTemplateFieldType, ContractTemplatePageDecorations, ContractTemplatePageSize, ContractTemplateLocationRule, ContractTemplateLocationRuleOptions, ContractTemplateSigningPlacement, ContractTemplateSigningPlacementType, ContractTemplateTableInsertOptions, ContractTemplateTableCommandCapabilities, ContractTemplateValidationError, ContractTemplateVariable, ContractTemplateVariableData } from './types';
|
|
2
2
|
import { ContractTemplateImageSource } from './utils/content-image';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<ContractTemplateDesignerProps, {
|
|
4
4
|
getValue: () => ContractTemplateData;
|
|
@@ -26,6 +26,9 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
26
26
|
closePreview: () => void;
|
|
27
27
|
openSubmitDataViewer: () => import('./types').ContractTemplateExportResult;
|
|
28
28
|
closeSubmitDataViewer: () => void;
|
|
29
|
+
getVariableData: () => ContractTemplateVariableData;
|
|
30
|
+
openVariableDataViewer: () => ContractTemplateVariableData;
|
|
31
|
+
closeVariableDataViewer: () => void;
|
|
29
32
|
setServerValidationErrors: (errors: ContractTemplateValidationError[]) => void;
|
|
30
33
|
clearValidationErrors: () => void;
|
|
31
34
|
scrollToVariable: (variableKey: string) => void;
|
|
@@ -89,9 +92,13 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
89
92
|
showDraftCacheStatus: boolean;
|
|
90
93
|
showClearButton: boolean;
|
|
91
94
|
showSubmitDataViewer: boolean;
|
|
95
|
+
showVariableDataViewer: boolean;
|
|
92
96
|
showSigningPlacementTools: boolean;
|
|
93
97
|
maxPages: number;
|
|
94
98
|
variableTypes: import('./types').ContractTemplateFieldTypeOption[];
|
|
99
|
+
showAdvancedChoiceControls: boolean;
|
|
100
|
+
showBuiltinSelectorControls: boolean;
|
|
101
|
+
showCustomControls: boolean;
|
|
95
102
|
defaultVariableStyle: ContractTemplateFieldStyle;
|
|
96
103
|
fontFamilies: import('./types').ContractTemplateFontFamilyOption[];
|
|
97
104
|
fontFamilyMode: import('./types').ContractTemplateFontFamilyMode;
|
|
@@ -109,6 +116,7 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
109
116
|
showDraftCacheStatus: boolean;
|
|
110
117
|
showClearButton: boolean;
|
|
111
118
|
showSubmitDataViewer: boolean;
|
|
119
|
+
showVariableDataViewer: boolean;
|
|
112
120
|
readonly: boolean;
|
|
113
121
|
zoomPercent: string;
|
|
114
122
|
zoomOutDisabled: boolean;
|
|
@@ -136,6 +144,7 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
136
144
|
onToggleFullscreen?: (() => any) | undefined;
|
|
137
145
|
onToggleImmersive?: (() => any) | undefined;
|
|
138
146
|
onSubmitData?: (() => any) | undefined;
|
|
147
|
+
onVariableData?: (() => any) | undefined;
|
|
139
148
|
onTogglePageDecorations?: (() => any) | undefined;
|
|
140
149
|
onToggleChrome?: (() => any) | undefined;
|
|
141
150
|
}>, {
|
|
@@ -153,6 +162,7 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
153
162
|
toggleFullscreen: () => any;
|
|
154
163
|
toggleImmersive: () => any;
|
|
155
164
|
submitData: () => any;
|
|
165
|
+
variableData: () => any;
|
|
156
166
|
togglePageDecorations: () => any;
|
|
157
167
|
toggleChrome: () => any;
|
|
158
168
|
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
@@ -171,6 +181,7 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
171
181
|
showDraftCacheStatus: boolean;
|
|
172
182
|
showClearButton: boolean;
|
|
173
183
|
showSubmitDataViewer: boolean;
|
|
184
|
+
showVariableDataViewer: boolean;
|
|
174
185
|
readonly: boolean;
|
|
175
186
|
zoomPercent: string;
|
|
176
187
|
zoomOutDisabled: boolean;
|
|
@@ -198,6 +209,7 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
198
209
|
onToggleFullscreen?: (() => any) | undefined;
|
|
199
210
|
onToggleImmersive?: (() => any) | undefined;
|
|
200
211
|
onSubmitData?: (() => any) | undefined;
|
|
212
|
+
onVariableData?: (() => any) | undefined;
|
|
201
213
|
onTogglePageDecorations?: (() => any) | undefined;
|
|
202
214
|
onToggleChrome?: (() => any) | undefined;
|
|
203
215
|
}>, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ContractTemplateRenderValues, ContractTemplateRendererFieldSlotProps, ContractTemplateRendererProps, ContractTemplateValidationError } from './types';
|
|
2
|
+
import { ContractTemplateRenderValues, ContractTemplateRendererFieldSlotProps, ContractTemplateRendererProps, ContractTemplateValidationError, ContractTemplateControlWarning } from './types';
|
|
3
3
|
declare function __VLS_template(): {
|
|
4
4
|
attrs: Partial<{}>;
|
|
5
5
|
slots: Readonly<{
|
|
@@ -35,12 +35,14 @@ declare const __VLS_component: import('vue').DefineComponent<ContractTemplateRen
|
|
|
35
35
|
submit: (value: ContractTemplateRenderValues) => any;
|
|
36
36
|
"update:zoom": (value: number) => any;
|
|
37
37
|
"update:values": (value: ContractTemplateRenderValues) => any;
|
|
38
|
+
"control-warning": (warning: ContractTemplateControlWarning) => any;
|
|
38
39
|
}, string, import('vue').PublicProps, Readonly<ContractTemplateRendererProps> & Readonly<{
|
|
39
40
|
onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
40
41
|
onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
41
42
|
onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
42
43
|
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
43
44
|
"onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
45
|
+
"onControl-warning"?: ((warning: ContractTemplateControlWarning) => any) | undefined;
|
|
44
46
|
}>, {
|
|
45
47
|
values: ContractTemplateRenderValues;
|
|
46
48
|
disabled: boolean;
|
|
@@ -50,12 +52,20 @@ declare const __VLS_component: import('vue').DefineComponent<ContractTemplateRen
|
|
|
50
52
|
zoom: number;
|
|
51
53
|
showToolbar: boolean;
|
|
52
54
|
showSubmitButton: boolean;
|
|
55
|
+
selectorHttp: undefined;
|
|
56
|
+
selectorUrlPrefix: string;
|
|
53
57
|
showValidateButton: boolean;
|
|
54
58
|
showResetButton: boolean;
|
|
55
59
|
interactionMode: import('./types').ContractTemplateRendererMode;
|
|
56
60
|
validateOnSubmit: boolean;
|
|
57
61
|
showPageMeta: boolean;
|
|
58
62
|
collapsiblePanel: boolean;
|
|
63
|
+
controlRegistry: import('./types').ContractTemplateControlRegistry;
|
|
64
|
+
optionResolver: import('./types').ContractTemplateOptionResolver;
|
|
65
|
+
requester: import('./types').ContractTemplateControlRequester;
|
|
66
|
+
allowedRemoteOrigins: string[];
|
|
67
|
+
remoteRequestTimeoutMs: number;
|
|
68
|
+
remoteOptionsCacheTtlMs: number;
|
|
59
69
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
60
70
|
rendererElement: HTMLElement;
|
|
61
71
|
pagesViewportElement: HTMLDivElement;
|
|
@@ -23,6 +23,10 @@ export declare function validateContractTemplateVariableKey(key: unknown, variab
|
|
|
23
23
|
export declare function normalizeContractTemplateMaxPages(value: unknown): number;
|
|
24
24
|
/** 正文可插入的变量类型及其默认尺寸。 */
|
|
25
25
|
export declare const DEFAULT_FIELD_TYPES: ContractTemplateFieldTypeOption[];
|
|
26
|
+
export declare const DEFAULT_ADVANCED_CHOICE_FIELD_TYPES: ContractTemplateFieldTypeOption[];
|
|
27
|
+
export declare const DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES: ContractTemplateFieldTypeOption[];
|
|
28
|
+
export declare const DEFAULT_CUSTOM_FIELD_TYPES: ContractTemplateFieldTypeOption[];
|
|
29
|
+
export declare const ALL_DEFAULT_FIELD_TYPES: ContractTemplateFieldTypeOption[];
|
|
26
30
|
/** 生成设计器内部 ID;时间戳加自增序号,保证同一次会话内不重复。 */
|
|
27
31
|
export declare function createDesignerId(prefix: string): string;
|
|
28
32
|
/** 深拷贝模板数据,切断与响应式对象的引用。 */
|
package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, Editor } from '@tiptap/core';
|
|
2
|
-
import { ContractTemplateFieldStyle, ContractTemplateFieldType, ContractTemplateVariable } from '../types';
|
|
2
|
+
import { ContractTemplateControlOption, ContractTemplateFieldStyle, ContractTemplateFieldType, ContractTemplateJsonObject, ContractTemplateRemoteDataSource, ContractTemplateVariable } from '../types';
|
|
3
3
|
/** 正文变量节点在 Tiptap 中持久化的全部属性;每一项都对应一个 `data-*`。 */
|
|
4
4
|
export interface TemplateVariableAttrs {
|
|
5
5
|
key: string;
|
|
@@ -15,6 +15,11 @@ export interface TemplateVariableAttrs {
|
|
|
15
15
|
useGrouping?: boolean;
|
|
16
16
|
checkedText: string;
|
|
17
17
|
uncheckedText: string;
|
|
18
|
+
options: ContractTemplateControlOption[];
|
|
19
|
+
dataSource?: ContractTemplateRemoteDataSource;
|
|
20
|
+
multiple: boolean;
|
|
21
|
+
componentKey: string;
|
|
22
|
+
componentConfig: ContractTemplateJsonObject;
|
|
18
23
|
multiline: boolean;
|
|
19
24
|
rows: number;
|
|
20
25
|
lineHeight: number;
|
|
@@ -52,6 +57,11 @@ export declare function buildTemplateVariableAttrs(variable: {
|
|
|
52
57
|
useGrouping?: boolean;
|
|
53
58
|
checkedText?: string;
|
|
54
59
|
uncheckedText?: string;
|
|
60
|
+
options?: ContractTemplateControlOption[];
|
|
61
|
+
dataSource?: ContractTemplateRemoteDataSource;
|
|
62
|
+
multiple?: boolean;
|
|
63
|
+
componentKey?: string;
|
|
64
|
+
componentConfig?: ContractTemplateJsonObject;
|
|
55
65
|
multiline?: boolean;
|
|
56
66
|
rows?: number;
|
|
57
67
|
lineHeight?: number;
|
|
@@ -1,8 +1,86 @@
|
|
|
1
1
|
import { JSONContent } from '@tiptap/core';
|
|
2
|
+
import { Component } from 'vue';
|
|
2
3
|
import { ContractTemplateImageCompression, ContractTemplateImageSource, ContractTemplateImageUploadHandler } from './utils/content-image';
|
|
3
4
|
/** 正文变量只描述文档流内的填写项;签署位置使用独立的 signingPlacements。 */
|
|
4
|
-
export type
|
|
5
|
+
export type ContractTemplateBasicFieldType = 'text' | 'date' | 'number' | 'image' | 'checkbox';
|
|
6
|
+
export type ContractTemplateAdvancedChoiceFieldType = 'select' | 'radio';
|
|
7
|
+
export type ContractTemplateBuiltinSelectorFieldType = 'user-selector' | 'dept-selector' | 'role-selector' | 'org-selector';
|
|
8
|
+
export type ContractTemplateFieldType = ContractTemplateBasicFieldType | ContractTemplateAdvancedChoiceFieldType | ContractTemplateBuiltinSelectorFieldType | 'custom';
|
|
5
9
|
export declare function isContractTemplateFieldType(value: unknown): value is ContractTemplateFieldType;
|
|
10
|
+
export declare function isContractTemplateAdvancedChoiceFieldType(value: unknown): value is ContractTemplateAdvancedChoiceFieldType;
|
|
11
|
+
export declare function isContractTemplateBuiltinSelectorFieldType(value: unknown): value is ContractTemplateBuiltinSelectorFieldType;
|
|
12
|
+
/** JSON 配置在边界处按纯数据处理;具体 schema 由注册表/宿主负责约束。 */
|
|
13
|
+
export type ContractTemplateJsonPrimitive = string | number | boolean | null;
|
|
14
|
+
export type ContractTemplateJsonValue = ContractTemplateJsonPrimitive | unknown[] | Record<string, unknown>;
|
|
15
|
+
export type ContractTemplateJsonObject = Record<string, ContractTemplateJsonValue>;
|
|
16
|
+
/** 高级控件统一使用可序列化对象,保证交互渲染、HTML/PDF 与服务端持久化口径一致。 */
|
|
17
|
+
export interface ContractTemplateSelectionValue {
|
|
18
|
+
value: string | number;
|
|
19
|
+
label: string;
|
|
20
|
+
type: string;
|
|
21
|
+
/** 宿主已解析出的展示文案;存在时优先于 label。 */
|
|
22
|
+
displayText?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 扩展字段必须保持 JSON 可序列化;显式可选属性(如 disabled)需要允许 undefined,
|
|
25
|
+
* 否则 TypeScript 会把可选字段判定为不符合索引签名。
|
|
26
|
+
*/
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
export interface ContractTemplateControlOption extends ContractTemplateSelectionValue {
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export type ContractTemplateRemoteDataSource = {
|
|
33
|
+
kind: 'resolver';
|
|
34
|
+
resolverKey: string;
|
|
35
|
+
params?: ContractTemplateJsonObject;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'url';
|
|
38
|
+
url: string;
|
|
39
|
+
method?: 'GET' | 'POST';
|
|
40
|
+
params?: ContractTemplateJsonObject;
|
|
41
|
+
headers?: Record<string, string>;
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
valueField?: string;
|
|
44
|
+
labelField?: string;
|
|
45
|
+
dataPath?: string;
|
|
46
|
+
};
|
|
47
|
+
export interface ContractTemplateControlRequest {
|
|
48
|
+
url: string;
|
|
49
|
+
method: 'GET' | 'POST';
|
|
50
|
+
params?: ContractTemplateJsonObject;
|
|
51
|
+
headers?: Record<string, string>;
|
|
52
|
+
timeoutMs: number;
|
|
53
|
+
signal: AbortSignal;
|
|
54
|
+
variable: ContractTemplateVariable;
|
|
55
|
+
}
|
|
56
|
+
export type ContractTemplateControlRequester = (request: ContractTemplateControlRequest) => Promise<unknown>;
|
|
57
|
+
export interface ContractTemplateOptionResolveContext {
|
|
58
|
+
resolverKey: string;
|
|
59
|
+
params?: ContractTemplateJsonObject;
|
|
60
|
+
variable: ContractTemplateVariable;
|
|
61
|
+
signal: AbortSignal;
|
|
62
|
+
}
|
|
63
|
+
export type ContractTemplateOptionResolver = (context: ContractTemplateOptionResolveContext) => Promise<ContractTemplateControlOption[]>;
|
|
64
|
+
export interface ContractTemplateControlAdapterContext {
|
|
65
|
+
variable: ContractTemplateVariable;
|
|
66
|
+
config: ContractTemplateJsonObject;
|
|
67
|
+
}
|
|
68
|
+
export interface ContractTemplateControlRegistration {
|
|
69
|
+
component: Component;
|
|
70
|
+
/** 可选 JSON Schema,供宿主设计器或配置平台校验 componentConfig。 */
|
|
71
|
+
schema?: ContractTemplateJsonObject;
|
|
72
|
+
normalizeValue?: (value: unknown, context: ContractTemplateControlAdapterContext) => ContractTemplateRenderValue;
|
|
73
|
+
toDisplayText?: (value: ContractTemplateRenderValue, context: ContractTemplateControlAdapterContext) => string;
|
|
74
|
+
resolveProps?: (context: ContractTemplateControlAdapterContext) => Record<string, unknown>;
|
|
75
|
+
}
|
|
76
|
+
export type ContractTemplateControlRegistry = Record<string, ContractTemplateControlRegistration>;
|
|
77
|
+
export interface ContractTemplateControlWarning {
|
|
78
|
+
code: 'CONTROL_OPTIONS_LOAD_FAILED' | 'CONTROL_COMPONENT_MISSING' | 'CONTROL_REMOTE_URL_BLOCKED';
|
|
79
|
+
variableKey: string;
|
|
80
|
+
componentKey?: string;
|
|
81
|
+
message: string;
|
|
82
|
+
cause?: unknown;
|
|
83
|
+
}
|
|
6
84
|
export type ContractTemplatePageFormat = 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'Letter' | 'Legal' | 'Custom';
|
|
7
85
|
export interface ContractTemplatePageSize {
|
|
8
86
|
/** 页面格式;常用预设会自动带出宽高 */
|
|
@@ -85,6 +163,16 @@ export interface ContractTemplateVariable {
|
|
|
85
163
|
useGrouping?: boolean;
|
|
86
164
|
checkedText?: string;
|
|
87
165
|
uncheckedText?: string;
|
|
166
|
+
/** 下拉/单选的本地选项;远程加载成功后由渲染器中的运行时选项覆盖。 */
|
|
167
|
+
options?: ContractTemplateControlOption[];
|
|
168
|
+
/** 远程数据声明。模板只保存声明,请求始终交给宿主注入的 resolver/requester。 */
|
|
169
|
+
dataSource?: ContractTemplateRemoteDataSource;
|
|
170
|
+
/** 下拉和内置选择器是否允许多选;单选框始终按单选处理。 */
|
|
171
|
+
multiple?: boolean;
|
|
172
|
+
/** 自定义控件注册键;模板不持久化 Vue 组件或函数。 */
|
|
173
|
+
componentKey?: string;
|
|
174
|
+
/** 自定义控件的纯 JSON 配置。 */
|
|
175
|
+
componentConfig?: ContractTemplateJsonObject;
|
|
88
176
|
/** 文本变量是否以多行下划线展示 */
|
|
89
177
|
multiline?: boolean;
|
|
90
178
|
/** 多行下划线行数,仅在 multiline 为 true 时生效 */
|
|
@@ -167,6 +255,13 @@ export interface ContractTemplateData {
|
|
|
167
255
|
/** 旧模板可缺省;配置后由设计器预览、填写渲染器和 PDF 服务共同消费。 */
|
|
168
256
|
pageDecorations?: ContractTemplatePageDecorations;
|
|
169
257
|
}
|
|
258
|
+
/** 当前活动合同文件可直接用于接口联调的变量快照。 */
|
|
259
|
+
export interface ContractTemplateVariableData {
|
|
260
|
+
/** 按变量 key 组织的请求示例值;每个变量都会保留一个 key。 */
|
|
261
|
+
values: Record<string, string | number | boolean>;
|
|
262
|
+
/** 当前文件完整变量定义,顺序与模板保持一致。 */
|
|
263
|
+
variables: ContractTemplateVariable[];
|
|
264
|
+
}
|
|
170
265
|
/** 多文件设计器中的一份独立合同文件;正文、变量和签署位置均在文件内隔离。 */
|
|
171
266
|
export interface ContractTemplateFile {
|
|
172
267
|
id: string;
|
|
@@ -370,7 +465,7 @@ export interface ContractTemplateValidationError {
|
|
|
370
465
|
/** 服务端返回的页面 id,用于定位具体页面 */
|
|
371
466
|
pageId?: string;
|
|
372
467
|
}
|
|
373
|
-
export type ContractTemplateRenderValue = string | number | boolean | undefined;
|
|
468
|
+
export type ContractTemplateRenderValue = string | number | boolean | ContractTemplateSelectionValue | ContractTemplateSelectionValue[] | null | undefined;
|
|
374
469
|
export type ContractTemplateRenderValues = Record<string, ContractTemplateRenderValue>;
|
|
375
470
|
export type ContractTemplateRendererMode = 'panel' | 'inline';
|
|
376
471
|
export interface ContractTemplateRendererFieldSlotProps {
|
|
@@ -380,6 +475,9 @@ export interface ContractTemplateRendererFieldSlotProps {
|
|
|
380
475
|
active: boolean;
|
|
381
476
|
readonly: boolean;
|
|
382
477
|
disabled: boolean;
|
|
478
|
+
options: ContractTemplateControlOption[];
|
|
479
|
+
loading: boolean;
|
|
480
|
+
loadError?: string;
|
|
383
481
|
updateValue: (value: ContractTemplateRenderValue) => void;
|
|
384
482
|
focusVariable: () => void;
|
|
385
483
|
}
|
|
@@ -448,6 +546,21 @@ export interface ContractTemplateRendererProps {
|
|
|
448
546
|
* @default 1
|
|
449
547
|
*/
|
|
450
548
|
zoom?: number;
|
|
549
|
+
/** 自定义控件注册表。模板仅通过 componentKey 引用,组件实例与适配器不会持久化。 */
|
|
550
|
+
controlRegistry?: ContractTemplateControlRegistry;
|
|
551
|
+
/** resolver 型远程数据源统一入口。 */
|
|
552
|
+
optionResolver?: ContractTemplateOptionResolver;
|
|
553
|
+
/** URL 型远程数据源统一入口;组件库本身不会发起网络请求。 */
|
|
554
|
+
requester?: ContractTemplateControlRequester;
|
|
555
|
+
/** 允许 URL 型数据源访问的绝对地址 origin;相对路径不受此项限制。 */
|
|
556
|
+
allowedRemoteOrigins?: string[];
|
|
557
|
+
/** 远程选项默认超时,变量级 timeoutMs 可缩短但不能超过该值。 */
|
|
558
|
+
remoteRequestTimeoutMs?: number;
|
|
559
|
+
/** 远程选项完成态缓存时长;设为 0 可关闭缓存。 */
|
|
560
|
+
remoteOptionsCacheTtlMs?: number;
|
|
561
|
+
/** 透传给内置用户/部门/角色选择器的宿主请求实例。 */
|
|
562
|
+
selectorHttp?: unknown;
|
|
563
|
+
selectorUrlPrefix?: string;
|
|
451
564
|
}
|
|
452
565
|
export interface ContractTemplateRendererEmits {
|
|
453
566
|
/** 填写值变化时同步 v-model:values */
|
|
@@ -460,6 +573,8 @@ export interface ContractTemplateRendererEmits {
|
|
|
460
573
|
submit: [value: ContractTemplateRenderValues];
|
|
461
574
|
/** 缩放比例变化时同步 v-model:zoom */
|
|
462
575
|
'update:zoom': [value: number];
|
|
576
|
+
/** 高级控件降级时抛出可定位告警;失败不会清空用户已有值。 */
|
|
577
|
+
'control-warning': [warning: ContractTemplateControlWarning];
|
|
463
578
|
}
|
|
464
579
|
export interface ContractTemplateRendererExpose {
|
|
465
580
|
/** 获取当前填写值快照 */
|
|
@@ -568,6 +683,12 @@ export interface ContractTemplateDesignerProps {
|
|
|
568
683
|
* @default 内置 text/date/number/image/checkbox
|
|
569
684
|
*/
|
|
570
685
|
variableTypes?: ContractTemplateFieldTypeOption[];
|
|
686
|
+
/** 展示下拉框与单选框工具;默认关闭,与组织选择器能力独立。 */
|
|
687
|
+
showAdvancedChoiceControls?: boolean;
|
|
688
|
+
/** 展示用户、部门、角色、组织架构工具;默认关闭。 */
|
|
689
|
+
showBuiltinSelectorControls?: boolean;
|
|
690
|
+
/** 展示通用自定义控件工具;默认关闭。 */
|
|
691
|
+
showCustomControls?: boolean;
|
|
571
692
|
/**
|
|
572
693
|
* 新增模板变量的默认样式
|
|
573
694
|
* @default 内置默认样式
|
|
@@ -585,6 +706,8 @@ export interface ContractTemplateDesignerProps {
|
|
|
585
706
|
* @default true
|
|
586
707
|
*/
|
|
587
708
|
showSubmitDataViewer?: boolean;
|
|
709
|
+
/** 是否展示控件变量查看入口;关闭后 expose 方法仍可用。 */
|
|
710
|
+
showVariableDataViewer?: boolean;
|
|
588
711
|
/**
|
|
589
712
|
* 是否展示内置清空模板按钮;关闭后仍可通过 expose 方法清空
|
|
590
713
|
* @default true
|
|
@@ -710,6 +833,12 @@ export interface ContractTemplateDesignerExpose {
|
|
|
710
833
|
openSubmitDataViewer: () => ContractTemplateExportResult;
|
|
711
834
|
/** 关闭提交数据查看弹窗 */
|
|
712
835
|
closeSubmitDataViewer: () => void;
|
|
836
|
+
/** 获取当前活动文件的变量请求示例与完整变量定义。 */
|
|
837
|
+
getVariableData: () => ContractTemplateVariableData;
|
|
838
|
+
/** 打开控件变量查看弹窗,并返回当前活动文件变量数据。 */
|
|
839
|
+
openVariableDataViewer: () => ContractTemplateVariableData;
|
|
840
|
+
/** 关闭控件变量查看弹窗。 */
|
|
841
|
+
closeVariableDataViewer: () => void;
|
|
713
842
|
/** 展示服务端校验错误,并复用组件内错误定位能力 */
|
|
714
843
|
setServerValidationErrors: (errors: ContractTemplateValidationError[]) => void;
|
|
715
844
|
/** 清空组件内与服务端校验错误 */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ContractTemplateControlOption, ContractTemplateJsonObject, ContractTemplateRenderValue, ContractTemplateRemoteDataSource, ContractTemplateSelectionValue } from '../types';
|
|
2
|
+
export declare function isContractTemplateSelectionValue(value: unknown): value is ContractTemplateSelectionValue;
|
|
3
|
+
/** 把高级控件脏值收敛成稳定 DTO;函数、Symbol 等宿主私有数据不会进入模板值。 */
|
|
4
|
+
export declare function normalizeContractTemplateSelectionValue(value: unknown, fallbackType: string): ContractTemplateSelectionValue | undefined;
|
|
5
|
+
export declare function normalizeContractTemplateSelectionValues(value: unknown, fallbackType: string, multiple: boolean): ContractTemplateRenderValue;
|
|
6
|
+
export declare function formatContractTemplateRenderValue(value: ContractTemplateRenderValue): string;
|
|
7
|
+
/** data-* 里使用 URI 编码承载 JSON,避免引号与无 DOM 正则解析互相冲突。 */
|
|
8
|
+
export declare function encodeContractTemplateJsonAttribute(value: unknown): string;
|
|
9
|
+
export declare function decodeContractTemplateJsonAttribute<T>(value: unknown): T | undefined;
|
|
10
|
+
export declare function normalizeContractTemplateControlOptions(payload: unknown, source: Extract<ContractTemplateRemoteDataSource, {
|
|
11
|
+
kind: 'url';
|
|
12
|
+
}> | undefined, fallbackType: string): ContractTemplateControlOption[];
|
|
13
|
+
export declare function isAllowedContractTemplateRemoteUrl(url: string, allowedOrigins: readonly string[]): boolean;
|
|
14
|
+
export declare function normalizeContractTemplateRequestTimeout(value: unknown, maximum?: number): number;
|
|
15
|
+
export declare function normalizeContractTemplateJsonObject(value: unknown): ContractTemplateJsonObject;
|
package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { ContractTemplateData, ContractTemplatePageFormat, ContractTemplatePageDecorations, ContractTemplateRenderValue, ContractTemplateRenderValues, ContractTemplateValidationError, ContractTemplateVariable } from '../types';
|
|
1
|
+
import { ContractTemplateData, ContractTemplatePageFormat, ContractTemplatePageDecorations, ContractTemplateRenderValue, ContractTemplateRenderValues, ContractTemplateValidationError, ContractTemplateVariable, ContractTemplateControlOption, ContractTemplateVariableData } from '../types';
|
|
2
2
|
import { isSafeContractImageUrl } from './image-url';
|
|
3
3
|
export { isSafeContractImageUrl };
|
|
4
|
+
/**
|
|
5
|
+
* 生成当前模板变量的接口联调快照。
|
|
6
|
+
*
|
|
7
|
+
* 这个快照刻意与填写渲染器的 `undefined` 语义分离:远程请求通常需要一个
|
|
8
|
+
* 可直接序列化且字段完整的对象,因此没有默认值的变量统一使用空字符串。
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildTemplateVariableData(template: ContractTemplateData | undefined): ContractTemplateVariableData;
|
|
4
11
|
export type ContractTemplateRenderHtmlMode = 'control' | 'display';
|
|
5
12
|
export interface ContractTemplateRenderHtmlOptions {
|
|
6
13
|
readonly?: boolean;
|
|
7
14
|
disabled?: boolean;
|
|
8
15
|
mode?: ContractTemplateRenderHtmlMode;
|
|
9
16
|
activeKey?: string;
|
|
17
|
+
optionsByKey?: ReadonlyMap<string, ContractTemplateControlOption[]>;
|
|
10
18
|
}
|
|
11
19
|
export interface ContractTemplateRenderPage {
|
|
12
20
|
id: string;
|
|
@@ -34,7 +42,7 @@ export declare function buildTemplateRenderPages(template: ContractTemplateData
|
|
|
34
42
|
/** 把整个模板拼成单段 HTML,页面尺寸写进 section 内联样式。 */
|
|
35
43
|
export declare function buildTemplateRenderHtml(template: ContractTemplateData | undefined, values: ContractTemplateRenderValues, options?: ContractTemplateRenderHtmlOptions): string;
|
|
36
44
|
/** 空值判定与 required 校验共用;`false` 是有效的复选值,不算空。 */
|
|
37
|
-
export declare function isEmptyRenderValue(value: ContractTemplateRenderValue):
|
|
45
|
+
export declare function isEmptyRenderValue(value: ContractTemplateRenderValue): boolean;
|
|
38
46
|
/**
|
|
39
47
|
* 净化不可信正文 HTML。
|
|
40
48
|
*
|
|
@@ -114,6 +114,10 @@ export declare const GdAntUserSelectorCheckbox: import('../utils/install').SFCWi
|
|
|
114
114
|
type: BooleanConstructor;
|
|
115
115
|
default: boolean;
|
|
116
116
|
};
|
|
117
|
+
selectionType: {
|
|
118
|
+
type: import('vue').PropType<"checkbox" | "radio">;
|
|
119
|
+
default: string;
|
|
120
|
+
};
|
|
117
121
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
118
122
|
'delete-user': (id: string) => string;
|
|
119
123
|
'change-checked': (checked: boolean, _info: import('.').DeptMember) => boolean;
|
|
@@ -130,6 +134,10 @@ export declare const GdAntUserSelectorCheckbox: import('../utils/install').SFCWi
|
|
|
130
134
|
type: BooleanConstructor;
|
|
131
135
|
default: boolean;
|
|
132
136
|
};
|
|
137
|
+
selectionType: {
|
|
138
|
+
type: import('vue').PropType<"checkbox" | "radio">;
|
|
139
|
+
default: string;
|
|
140
|
+
};
|
|
133
141
|
}>> & Readonly<{
|
|
134
142
|
"onDelete-user"?: ((id: string) => any) | undefined;
|
|
135
143
|
"onChange-checked"?: ((checked: boolean, _info: import('.').DeptMember) => any) | undefined;
|
|
@@ -137,6 +145,7 @@ export declare const GdAntUserSelectorCheckbox: import('../utils/install').SFCWi
|
|
|
137
145
|
userInfo: import('.').DeptMember;
|
|
138
146
|
isChecked: boolean;
|
|
139
147
|
isDelete: boolean;
|
|
148
|
+
selectionType: "checkbox" | "radio";
|
|
140
149
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>>;
|
|
141
150
|
export { ProUserSelector };
|
|
142
151
|
export { ProUserSelectorCheckbox };
|
|
@@ -13,6 +13,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
13
13
|
type: BooleanConstructor;
|
|
14
14
|
default: boolean;
|
|
15
15
|
};
|
|
16
|
+
selectionType: {
|
|
17
|
+
type: PropType<"checkbox" | "radio">;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
16
20
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
21
|
'delete-user': (id: string) => string;
|
|
18
22
|
'change-checked': (checked: boolean, _info: DeptMember) => boolean;
|
|
@@ -29,6 +33,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
29
33
|
type: BooleanConstructor;
|
|
30
34
|
default: boolean;
|
|
31
35
|
};
|
|
36
|
+
selectionType: {
|
|
37
|
+
type: PropType<"checkbox" | "radio">;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
32
40
|
}>> & Readonly<{
|
|
33
41
|
"onDelete-user"?: ((id: string) => any) | undefined;
|
|
34
42
|
"onChange-checked"?: ((checked: boolean, _info: DeptMember) => any) | undefined;
|
|
@@ -36,5 +44,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
36
44
|
userInfo: DeptMember;
|
|
37
45
|
isChecked: boolean;
|
|
38
46
|
isDelete: boolean;
|
|
47
|
+
selectionType: "checkbox" | "radio";
|
|
39
48
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
40
49
|
export default _default;
|
|
@@ -5,6 +5,7 @@ export declare const selectUserContextKey: InjectionKey<{
|
|
|
5
5
|
http?: any;
|
|
6
6
|
isBuiltInRequest?: boolean;
|
|
7
7
|
prefix?: string;
|
|
8
|
+
type?: 'checkbox' | 'radio';
|
|
8
9
|
}>;
|
|
9
10
|
export declare const UserSelectorProps: {
|
|
10
11
|
readonly visible: {
|
|
@@ -99,3 +100,4 @@ export interface SelectUserType {
|
|
|
99
100
|
export interface InstanceExpose {
|
|
100
101
|
deleteCheckedUser: (id: string) => void;
|
|
101
102
|
}
|
|
103
|
+
export declare function resolveUserSelectorMaxCount(type: 'checkbox' | 'radio', maxCount: number): number;
|
|
@@ -11,7 +11,10 @@ export declare function debounce(func: (...args: any[]) => void, wait: number):
|
|
|
11
11
|
(this: any, ...args: any[]): void;
|
|
12
12
|
cancel(): void;
|
|
13
13
|
};
|
|
14
|
-
export declare function uniqueById
|
|
14
|
+
export declare function uniqueById<T extends {
|
|
15
|
+
id?: string;
|
|
16
|
+
userId?: string;
|
|
17
|
+
}>(array: T[]): T[];
|
|
15
18
|
/**
|
|
16
19
|
* 初始化树形数据,需要递归,给deptType属性为department增加一个属性微 checkedUserIds,值为空数组
|
|
17
20
|
* 然后返回修改完的数据
|
|
@@ -5,11 +5,11 @@ type __VLS_PublicProps = {
|
|
|
5
5
|
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
6
|
"update:modelValue": (value: Options[]) => any;
|
|
7
7
|
} & {
|
|
8
|
-
delete: (value:
|
|
9
|
-
deleteAll: (values:
|
|
8
|
+
delete: (value: Options) => any;
|
|
9
|
+
deleteAll: (values: Options[]) => any;
|
|
10
10
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
-
onDelete?: ((value:
|
|
11
|
+
onDelete?: ((value: Options) => any) | undefined;
|
|
12
12
|
"onUpdate:modelValue"?: ((value: Options[]) => any) | undefined;
|
|
13
|
-
onDeleteAll?: ((values:
|
|
13
|
+
onDeleteAll?: ((values: Options[]) => any) | undefined;
|
|
14
14
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
15
15
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeptMember } from '
|
|
1
|
+
import { DeptMember } from '../../../pro-selector/src/types';
|
|
2
2
|
export declare enum ApiUrl {
|
|
3
3
|
GET_USER = "/security/dept/user/tree",
|
|
4
4
|
GET_DEPT = "/security/dept/company/tree",
|
|
@@ -104,4 +104,9 @@ export declare function useApi(http: any, prefix?: string): {
|
|
|
104
104
|
authority: string;
|
|
105
105
|
}[]>;
|
|
106
106
|
userLoading: import('vue').Ref<boolean, boolean>;
|
|
107
|
+
deptLoading: import('vue').Ref<boolean, boolean>;
|
|
108
|
+
roleLoading: import('vue').Ref<boolean, boolean>;
|
|
109
|
+
deptError: import('vue').Ref<string, string>;
|
|
110
|
+
userError: import('vue').Ref<string, string>;
|
|
111
|
+
roleError: import('vue').Ref<string, string>;
|
|
107
112
|
};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { DeptUserType } from '../hooks/useApi';
|
|
2
|
+
import { Options } from '../types';
|
|
2
3
|
export declare function formatDeptTree(deptTree: DeptUserType[]): DeptUserType[];
|
|
4
|
+
/**
|
|
5
|
+
* 选择器组的每个 Tab 只维护自己类型的数据。这里把外部值规范为可安全编辑的草稿,
|
|
6
|
+
* 避免子 Tab 的异步回显把其它 Tab 的已选项覆盖掉。
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeSelectorOptions(value: unknown): Options[];
|
|
9
|
+
export declare function replaceSelectorOptionsForType(current: Options[], type: Options['type'], next: Options[]): Options[];
|
|
10
|
+
export declare function removeSelectorOption(current: Options[], value: string, type?: Options['type']): Options[];
|