cnhis-design-vue 3.1.8-beta.9 → 3.1.9-beta.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.
- package/README.md +22 -22
- package/es/packages/big-table/index.d.ts +1 -1
- package/es/packages/big-table/src/BigTable.vue.d.ts +1 -1
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.mjs +3 -1
- package/es/packages/big-table/style/index.less +557 -557
- package/es/packages/bpmn-workflow/style/index.less +29 -29
- package/es/packages/button-print/style/index.less +30 -30
- package/es/packages/chunk-upload/src/chunk-upload-new.vue.d.ts +6 -4
- package/es/packages/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +3 -0
- package/es/packages/chunk-upload/style/index.less +394 -394
- package/es/packages/drag-layout/src/DragLayout.vue.d.ts +8 -5
- package/es/packages/drag-layout/style/index.less +208 -208
- package/es/packages/field-set/style/index.less +157 -157
- package/es/packages/form-render/index.d.ts +2 -1
- package/es/packages/form-render/index.mjs +2 -0
- package/es/packages/form-render/src/FormRender.vue.d.ts +2 -1
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.mjs +12 -7
- package/es/packages/form-render/src/components/select.d.ts +10 -2
- package/es/packages/form-render/src/components/select.mjs +19 -2
- package/es/packages/form-render/src/constants/index.d.ts +2 -0
- package/es/packages/form-render/src/constants/index.mjs +2 -1
- package/es/packages/form-render/src/hooks/index.d.ts +11 -9
- package/es/packages/form-render/src/hooks/index.mjs +2 -0
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +13 -33
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useBusinessBinding.mjs +1 -1
- package/es/packages/form-render/src/hooks/useChangeContext.d.ts +11 -0
- package/es/packages/form-render/src/hooks/useChangeContext.mjs +21 -0
- package/es/packages/form-render/src/hooks/useUrlDeps.d.ts +1 -0
- package/es/packages/form-render/src/hooks/useUrlDeps.mjs +4 -0
- package/es/packages/form-render/src/types/index.d.ts +16 -6
- package/es/packages/form-table/style/index.less +301 -301
- package/es/packages/grid/style/index.less +12 -12
- package/es/packages/index.less +2945 -2945
- package/es/packages/index.mjs +2 -0
- package/es/packages/info-header/style/index.less +153 -153
- package/es/packages/map/style/index.less +59 -59
- package/es/packages/scale-view/style/index.less +748 -748
- package/es/packages/select-label/src/LabelFormContent.vue.d.ts +3 -0
- package/es/packages/select-label/style/index.less +151 -151
- package/es/packages/select-person/src/SelectPerson.vue.d.ts +6 -8
- package/es/packages/select-person/src/SelectPerson.vue_vue_type_script_setup_true_lang.mjs +43 -18
- package/es/packages/select-person/src/utils/index.mjs +15 -2
- package/es/packages/select-person/style/index.less +229 -229
- package/es/packages/time-line/style/index.less +34 -34
- package/global.d.ts +8 -8
- package/package.json +1 -1
- package/yarn-error.log +103 -8659
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
.c-field-set {
|
|
2
|
-
ul {
|
|
3
|
-
margin: 0;
|
|
4
|
-
padding: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.fields-set-content {
|
|
8
|
-
height: 100%;
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
.fields-table {
|
|
13
|
-
flex: 1;
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
overflow: auto;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
height: 100%;
|
|
21
|
-
position: relative;
|
|
22
|
-
.n-spin-container {
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
}
|
|
26
|
-
.n-spin-content {
|
|
27
|
-
height: 100%;
|
|
28
|
-
}
|
|
29
|
-
.setting-title {
|
|
30
|
-
background: #f2f2f4;
|
|
31
|
-
border: 1px solid #f2f2f2;
|
|
32
|
-
height: 52px;
|
|
33
|
-
line-height: 52px;
|
|
34
|
-
span {
|
|
35
|
-
display: inline-block;
|
|
36
|
-
}
|
|
37
|
-
&.seting-title-api {
|
|
38
|
-
.width-large {
|
|
39
|
-
width: 15%;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
.set-show {
|
|
44
|
-
min-height: 100px;
|
|
45
|
-
overflow-y: auto;
|
|
46
|
-
&.set-show-api {
|
|
47
|
-
.width-large {
|
|
48
|
-
width: 15%;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.left-style.sortable-chosen {
|
|
53
|
-
background: #fafafa;
|
|
54
|
-
box-shadow: 0px 0px 10px 0px #d5d5d5;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
li {
|
|
58
|
-
padding: 5px 0;
|
|
59
|
-
display: flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
border-bottom: 1px solid #e8e8e8;
|
|
62
|
-
height: 52px;
|
|
63
|
-
line-height: 52px;
|
|
64
|
-
}
|
|
65
|
-
.alias-style {
|
|
66
|
-
outline: none;
|
|
67
|
-
border-radius: 4px 4px 4px 4px;
|
|
68
|
-
border: solid 1px #d5d5d5;
|
|
69
|
-
height: 32px;
|
|
70
|
-
text-indent: 16px;
|
|
71
|
-
color: #38454f;
|
|
72
|
-
width: 100%;
|
|
73
|
-
}
|
|
74
|
-
.is-sort-style {
|
|
75
|
-
outline: none;
|
|
76
|
-
border-radius: 4px 4px 4px 4px;
|
|
77
|
-
border: solid 1px #d5d5d5;
|
|
78
|
-
height: 32px;
|
|
79
|
-
text-indent: 6px;
|
|
80
|
-
color: #38454f;
|
|
81
|
-
width: 87px;
|
|
82
|
-
margin-right: 5px;
|
|
83
|
-
&:disabled {
|
|
84
|
-
cursor: not-allowed;
|
|
85
|
-
background: #f5f5f5;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
.col-width-style {
|
|
89
|
-
width: 70px;
|
|
90
|
-
}
|
|
91
|
-
.title-item {
|
|
92
|
-
display: inline-flex;
|
|
93
|
-
justify-content: flex-start;
|
|
94
|
-
align-items: center;
|
|
95
|
-
text-align: left;
|
|
96
|
-
> span {
|
|
97
|
-
display: inline-block;
|
|
98
|
-
max-width: calc(100% - 20px);
|
|
99
|
-
overflow: hidden;
|
|
100
|
-
white-space: nowrap;
|
|
101
|
-
text-overflow: ellipsis;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
.alias-style {
|
|
106
|
-
outline: none;
|
|
107
|
-
border-radius: 4px 4px 4px 4px;
|
|
108
|
-
border: solid 1px rgba(212, 222, 229, 1);
|
|
109
|
-
height: 32px;
|
|
110
|
-
text-indent: 16px;
|
|
111
|
-
color: #38454f;
|
|
112
|
-
}
|
|
113
|
-
.btn-operate {
|
|
114
|
-
border-top: 1px solid #d5d5d5;
|
|
115
|
-
padding: 12px 0 12px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.width-show {
|
|
119
|
-
display: inline-block;
|
|
120
|
-
width: 10%;
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
white-space: nowrap;
|
|
123
|
-
text-overflow: ellipsis;
|
|
124
|
-
}
|
|
125
|
-
.drag-icon-wrap {
|
|
126
|
-
width: 5% !important;
|
|
127
|
-
cursor: pointer;
|
|
128
|
-
text-align: center;
|
|
129
|
-
}
|
|
130
|
-
.width-showed {
|
|
131
|
-
display: inline-block;
|
|
132
|
-
width: 15%;
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
white-space: nowrap;
|
|
135
|
-
text-overflow: ellipsis;
|
|
136
|
-
select {
|
|
137
|
-
width: 90% !important;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
.width-word {
|
|
141
|
-
display: inline-block;
|
|
142
|
-
width: 20%;
|
|
143
|
-
line-height: 52px;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
white-space: nowrap;
|
|
146
|
-
input {
|
|
147
|
-
width: 90% !important;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
.width-large {
|
|
151
|
-
display: inline-block;
|
|
152
|
-
width: 20%;
|
|
153
|
-
overflow: hidden;
|
|
154
|
-
white-space: nowrap;
|
|
155
|
-
text-overflow: ellipsis;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
1
|
+
.c-field-set {
|
|
2
|
+
ul {
|
|
3
|
+
margin: 0;
|
|
4
|
+
padding: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.fields-set-content {
|
|
8
|
+
height: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
.fields-table {
|
|
13
|
+
flex: 1;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
height: 100%;
|
|
21
|
+
position: relative;
|
|
22
|
+
.n-spin-container {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
.n-spin-content {
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
.setting-title {
|
|
30
|
+
background: #f2f2f4;
|
|
31
|
+
border: 1px solid #f2f2f2;
|
|
32
|
+
height: 52px;
|
|
33
|
+
line-height: 52px;
|
|
34
|
+
span {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
}
|
|
37
|
+
&.seting-title-api {
|
|
38
|
+
.width-large {
|
|
39
|
+
width: 15%;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.set-show {
|
|
44
|
+
min-height: 100px;
|
|
45
|
+
overflow-y: auto;
|
|
46
|
+
&.set-show-api {
|
|
47
|
+
.width-large {
|
|
48
|
+
width: 15%;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.left-style.sortable-chosen {
|
|
53
|
+
background: #fafafa;
|
|
54
|
+
box-shadow: 0px 0px 10px 0px #d5d5d5;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
li {
|
|
58
|
+
padding: 5px 0;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
border-bottom: 1px solid #e8e8e8;
|
|
62
|
+
height: 52px;
|
|
63
|
+
line-height: 52px;
|
|
64
|
+
}
|
|
65
|
+
.alias-style {
|
|
66
|
+
outline: none;
|
|
67
|
+
border-radius: 4px 4px 4px 4px;
|
|
68
|
+
border: solid 1px #d5d5d5;
|
|
69
|
+
height: 32px;
|
|
70
|
+
text-indent: 16px;
|
|
71
|
+
color: #38454f;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
74
|
+
.is-sort-style {
|
|
75
|
+
outline: none;
|
|
76
|
+
border-radius: 4px 4px 4px 4px;
|
|
77
|
+
border: solid 1px #d5d5d5;
|
|
78
|
+
height: 32px;
|
|
79
|
+
text-indent: 6px;
|
|
80
|
+
color: #38454f;
|
|
81
|
+
width: 87px;
|
|
82
|
+
margin-right: 5px;
|
|
83
|
+
&:disabled {
|
|
84
|
+
cursor: not-allowed;
|
|
85
|
+
background: #f5f5f5;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
.col-width-style {
|
|
89
|
+
width: 70px;
|
|
90
|
+
}
|
|
91
|
+
.title-item {
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
justify-content: flex-start;
|
|
94
|
+
align-items: center;
|
|
95
|
+
text-align: left;
|
|
96
|
+
> span {
|
|
97
|
+
display: inline-block;
|
|
98
|
+
max-width: calc(100% - 20px);
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.alias-style {
|
|
106
|
+
outline: none;
|
|
107
|
+
border-radius: 4px 4px 4px 4px;
|
|
108
|
+
border: solid 1px rgba(212, 222, 229, 1);
|
|
109
|
+
height: 32px;
|
|
110
|
+
text-indent: 16px;
|
|
111
|
+
color: #38454f;
|
|
112
|
+
}
|
|
113
|
+
.btn-operate {
|
|
114
|
+
border-top: 1px solid #d5d5d5;
|
|
115
|
+
padding: 12px 0 12px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.width-show {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
width: 10%;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
text-overflow: ellipsis;
|
|
124
|
+
}
|
|
125
|
+
.drag-icon-wrap {
|
|
126
|
+
width: 5% !important;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
text-align: center;
|
|
129
|
+
}
|
|
130
|
+
.width-showed {
|
|
131
|
+
display: inline-block;
|
|
132
|
+
width: 15%;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
select {
|
|
137
|
+
width: 90% !important;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.width-word {
|
|
141
|
+
display: inline-block;
|
|
142
|
+
width: 20%;
|
|
143
|
+
line-height: 52px;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
input {
|
|
147
|
+
width: 90% !important;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
.width-large {
|
|
151
|
+
display: inline-block;
|
|
152
|
+
width: 20%;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
text-overflow: ellipsis;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -188,7 +188,8 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
188
188
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
189
189
|
create: () => import("./src/hooks").BusinessCollector;
|
|
190
190
|
trigger: (collector: import("./src/hooks").BusinessCollector, formModel: import("@formily/core").Form<any>, fieldName: string, value: unknown) => void;
|
|
191
|
-
|
|
191
|
+
businessCollector: import("./src/hooks").BusinessCollector;
|
|
192
|
+
changeContextCollector: import("./src/hooks").ContextCollector;
|
|
192
193
|
formModel: import("@formily/core").Form<{
|
|
193
194
|
[x: string]: any;
|
|
194
195
|
}>;
|
|
@@ -11,6 +11,8 @@ export { useFieldVisitor } from './src/hooks/useFieldVisitor.mjs';
|
|
|
11
11
|
export { useTypeNormalize } from './src/hooks/useTypeNormalize.mjs';
|
|
12
12
|
export { useFormValidator } from './src/hooks/useFormValidator.mjs';
|
|
13
13
|
export { BusinessCollector, useBusinessBinding } from './src/hooks/useBusinessBinding.mjs';
|
|
14
|
+
export { ContextCollector, useChangeContext } from './src/hooks/useChangeContext.mjs';
|
|
15
|
+
export { useUrlDeps } from './src/hooks/useUrlDeps.mjs';
|
|
14
16
|
|
|
15
17
|
const FormRender = script;
|
|
16
18
|
FormRender.install = function(app) {
|
|
@@ -188,7 +188,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
188
188
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
189
189
|
create: () => import("./hooks").BusinessCollector;
|
|
190
190
|
trigger: (collector: import("./hooks").BusinessCollector, formModel: import("@formily/core").Form<any>, fieldName: string, value: unknown) => void;
|
|
191
|
-
|
|
191
|
+
businessCollector: import("./hooks").BusinessCollector;
|
|
192
|
+
changeContextCollector: import("./hooks").ContextCollector;
|
|
192
193
|
formModel: import("@formily/core").Form<{
|
|
193
194
|
[x: string]: any;
|
|
194
195
|
}>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, renderSlot, createBlock, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
2
2
|
import { injectOrProvide } from './utils/index.mjs';
|
|
3
3
|
import { cloneDeep } from 'lodash-es';
|
|
4
|
-
import { InjectionBusinessCollector, InjectAsyncQueue, InjectionSchemaField } from './constants/index.mjs';
|
|
4
|
+
import { InjectionBusinessCollector, InjectAsyncQueue, InjectionChangeContextCollector, InjectionSchemaField } from './constants/index.mjs';
|
|
5
5
|
import * as index from './components/index.mjs';
|
|
6
6
|
import { createForm, onFieldValueChange } from '@formily/core';
|
|
7
7
|
import { FormProvider, FormConsumer, createSchemaField } from '@formily/vue';
|
|
8
8
|
import { useBusinessBinding } from './hooks/useBusinessBinding.mjs';
|
|
9
9
|
import { useAsyncQueue } from './hooks/useAsyncQueue.mjs';
|
|
10
|
+
import { useChangeContext } from './hooks/useChangeContext.mjs';
|
|
10
11
|
import { useFieldVisitor } from './hooks/useFieldVisitor.mjs';
|
|
11
12
|
import { useFieldList2Schema } from './hooks/useFieldList2Schema.mjs';
|
|
12
13
|
|
|
@@ -33,19 +34,22 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
33
34
|
setup(__props, { expose, emit }) {
|
|
34
35
|
const props = __props;
|
|
35
36
|
const { create, trigger } = useBusinessBinding();
|
|
36
|
-
const
|
|
37
|
+
const businessCollector = injectOrProvide(InjectionBusinessCollector, create);
|
|
37
38
|
injectOrProvide(InjectAsyncQueue, () => useAsyncQueue().create(props.parallelism));
|
|
39
|
+
const changeContextCollector = injectOrProvide(InjectionChangeContextCollector, useChangeContext().create);
|
|
38
40
|
const formModel = createForm({
|
|
39
41
|
initialValues: props.initialData,
|
|
40
42
|
effects() {
|
|
41
43
|
onFieldValueChange("*", (field) => {
|
|
44
|
+
const fieldKey = field.props.name.toString();
|
|
42
45
|
emit("formChange", {
|
|
43
46
|
fieldInstance: field,
|
|
44
|
-
fieldKey
|
|
47
|
+
fieldKey,
|
|
45
48
|
fieldName: field.title,
|
|
46
|
-
value: field.value
|
|
49
|
+
value: field.value,
|
|
50
|
+
context: changeContextCollector.getContext(fieldKey)
|
|
47
51
|
});
|
|
48
|
-
trigger(
|
|
52
|
+
trigger(businessCollector, formModel, fieldKey, field.value);
|
|
49
53
|
});
|
|
50
54
|
}
|
|
51
55
|
});
|
|
@@ -54,11 +58,12 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
54
58
|
scope: props.scope
|
|
55
59
|
}).SchemaField);
|
|
56
60
|
const { traverse } = useFieldVisitor();
|
|
57
|
-
const { transform } = useFieldList2Schema(
|
|
61
|
+
const { transform } = useFieldList2Schema(businessCollector);
|
|
58
62
|
const renderSchema = computed(() => {
|
|
59
63
|
if (props.schema) {
|
|
60
64
|
return props.schema;
|
|
61
|
-
}
|
|
65
|
+
}
|
|
66
|
+
if (props.fieldList) {
|
|
62
67
|
const _fieldList = traverse(cloneDeep(props.fieldList), props.fieldVisitor);
|
|
63
68
|
return { type: "object", properties: transform(_fieldList) };
|
|
64
69
|
}
|
|
@@ -8,6 +8,9 @@ declare type UrlConfig = {
|
|
|
8
8
|
valueKey: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const SELECT: import("vue").DefineComponent<{
|
|
11
|
+
value: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
};
|
|
11
14
|
options: {
|
|
12
15
|
type: PropType<AnyObject[]>;
|
|
13
16
|
default: () => never[];
|
|
@@ -18,7 +21,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
18
21
|
onChange: {
|
|
19
22
|
type: FunctionConstructor;
|
|
20
23
|
};
|
|
21
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
24
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
value: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
22
28
|
options: {
|
|
23
29
|
type: PropType<AnyObject[]>;
|
|
24
30
|
default: () => never[];
|
|
@@ -29,7 +35,9 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
29
35
|
onChange: {
|
|
30
36
|
type: FunctionConstructor;
|
|
31
37
|
};
|
|
32
|
-
}
|
|
38
|
+
}>> & {
|
|
39
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
}, {
|
|
33
41
|
options: AnyObject[];
|
|
34
42
|
}>;
|
|
35
43
|
export {};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { defineComponent, ref, inject, computed, watch, createVNode } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { cloneDeep } from 'lodash-es';
|
|
3
|
+
import { InjectAsyncQueue, InjectionChangeContextCollector } from '../constants/index.mjs';
|
|
3
4
|
import { assignUpdateValue, formRenderLog } from '../utils/index.mjs';
|
|
4
5
|
import { isObject } from '@vueuse/core';
|
|
5
|
-
import { connect, mapProps } from '@formily/vue';
|
|
6
|
+
import { useField, connect, mapProps } from '@formily/vue';
|
|
6
7
|
import { NSelect } from 'naive-ui';
|
|
7
8
|
import { useFormField } from '../hooks/useFormField.mjs';
|
|
8
9
|
|
|
9
10
|
const script = defineComponent({
|
|
10
11
|
name: "FormSelect",
|
|
11
12
|
props: {
|
|
13
|
+
value: {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
12
16
|
options: {
|
|
13
17
|
type: Array,
|
|
14
18
|
default: () => []
|
|
@@ -20,8 +24,10 @@ const script = defineComponent({
|
|
|
20
24
|
type: Function
|
|
21
25
|
}
|
|
22
26
|
},
|
|
27
|
+
emits: ["update:value"],
|
|
23
28
|
setup(props, {
|
|
24
29
|
slots,
|
|
30
|
+
emit,
|
|
25
31
|
attrs
|
|
26
32
|
}) {
|
|
27
33
|
const _options = ref(null);
|
|
@@ -79,9 +85,20 @@ const script = defineComponent({
|
|
|
79
85
|
}, {
|
|
80
86
|
immediate: true
|
|
81
87
|
});
|
|
88
|
+
const field = useField();
|
|
89
|
+
const fieldKey = computed(() => {
|
|
90
|
+
return field.value.props.name.toString();
|
|
91
|
+
});
|
|
92
|
+
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
93
|
+
function update(v, option) {
|
|
94
|
+
changeContextCollector == null ? void 0 : changeContextCollector.setContext(fieldKey.value, "currentOption", cloneDeep(option));
|
|
95
|
+
emit("update:value", v);
|
|
96
|
+
}
|
|
82
97
|
return () => {
|
|
83
98
|
var _a, _b, _c, _d;
|
|
84
99
|
return createVNode(NSelect, {
|
|
100
|
+
"value": props.value,
|
|
101
|
+
"onUpdate:value": update,
|
|
85
102
|
"remote": true,
|
|
86
103
|
"filterable": true,
|
|
87
104
|
"labelField": (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { ContextCollector } from 'cnhis-design-vue/es/packages/form-render/src/hooks/useChangeContext';
|
|
1
2
|
import { BusinessCollector } from '../hooks';
|
|
2
3
|
import { FormAsyncQueue } from '../types';
|
|
3
4
|
import { Component, InjectionKey } from 'vue';
|
|
4
5
|
export declare const InjectAsyncQueue: InjectionKey<FormAsyncQueue>;
|
|
5
6
|
export declare const InjectionSchemaField: InjectionKey<Component>;
|
|
6
7
|
export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>;
|
|
8
|
+
export declare const InjectionChangeContextCollector: InjectionKey<ContextCollector>;
|
|
7
9
|
export declare enum FIELD_BUSINESS_TYPE {
|
|
8
10
|
PASSWORD = "password",
|
|
9
11
|
ID_CARD = "id_card",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const InjectAsyncQueue = Symbol("InjectAsyncQueue");
|
|
2
2
|
const InjectionSchemaField = Symbol("InjectionSchemaField");
|
|
3
3
|
const InjectionBusinessCollector = Symbol("InjectionBusinessCollector");
|
|
4
|
+
const InjectionChangeContextCollector = Symbol("InjectionChangeContextCollector");
|
|
4
5
|
var FIELD_BUSINESS_TYPE = /* @__PURE__ */ ((FIELD_BUSINESS_TYPE2) => {
|
|
5
6
|
FIELD_BUSINESS_TYPE2["PASSWORD"] = "password";
|
|
6
7
|
FIELD_BUSINESS_TYPE2["ID_CARD"] = "id_card";
|
|
@@ -23,4 +24,4 @@ var FIELD_SEX_VALUE = /* @__PURE__ */ ((FIELD_SEX_VALUE2) => {
|
|
|
23
24
|
return FIELD_SEX_VALUE2;
|
|
24
25
|
})(FIELD_SEX_VALUE || {});
|
|
25
26
|
|
|
26
|
-
export { FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, InjectAsyncQueue, InjectionBusinessCollector, InjectionSchemaField };
|
|
27
|
+
export { FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, InjectAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionSchemaField };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from './useFieldList2Schema';
|
|
2
|
+
export * from './useFormRequest';
|
|
3
|
+
export * from './useCommonLog';
|
|
4
|
+
export * from './useFormField';
|
|
5
|
+
export * from './useAsyncQueue';
|
|
6
|
+
export * from './useFieldVisitor';
|
|
7
|
+
export * from './useTypeNormalize';
|
|
8
|
+
export * from './useFormValidator';
|
|
9
|
+
export * from './useBusinessBinding';
|
|
10
|
+
export * from './useChangeContext';
|
|
11
|
+
export * from './useUrlDeps';
|
|
@@ -7,3 +7,5 @@ export { useFieldVisitor } from './useFieldVisitor.mjs';
|
|
|
7
7
|
export { useTypeNormalize } from './useTypeNormalize.mjs';
|
|
8
8
|
export { useFormValidator } from './useFormValidator.mjs';
|
|
9
9
|
export { BusinessCollector, useBusinessBinding } from './useBusinessBinding.mjs';
|
|
10
|
+
export { ContextCollector, useChangeContext } from './useChangeContext.mjs';
|
|
11
|
+
export { useUrlDeps } from './useUrlDeps.mjs';
|
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
import { FormAsyncQueueItem } from
|
|
2
|
-
declare enum ENTRY_STATE {
|
|
3
|
-
PENDING = 0,
|
|
4
|
-
DONE = 1
|
|
5
|
-
}
|
|
1
|
+
import { FormAsyncQueueItem } from '../types';
|
|
6
2
|
interface EntryCallback {
|
|
7
3
|
(err?: any, result?: any): void;
|
|
8
4
|
}
|
|
9
|
-
declare class AsyncQueueEntry<K = any> {
|
|
10
|
-
key: K;
|
|
11
|
-
item: any;
|
|
12
|
-
state: ENTRY_STATE;
|
|
13
|
-
callback?: EntryCallback;
|
|
14
|
-
callbacks?: EntryCallback[];
|
|
15
|
-
result?: any;
|
|
16
|
-
error?: any;
|
|
17
|
-
constructor(item: any, key: K, callback: EntryCallback);
|
|
18
|
-
}
|
|
19
|
-
declare class ArrayQueue<K = any> {
|
|
20
|
-
_list: AsyncQueueEntry<K>[];
|
|
21
|
-
constructor(items?: AsyncQueueEntry<K>[]);
|
|
22
|
-
enqueue(item: AsyncQueueEntry<K>): void;
|
|
23
|
-
dequeue(): AsyncQueueEntry<K> | undefined;
|
|
24
|
-
}
|
|
25
5
|
interface Processor<T, R = any> {
|
|
26
6
|
(item: T, cb: (err?: any, result?: R) => void, removeCache: () => void): void;
|
|
27
7
|
}
|
|
@@ -35,21 +15,21 @@ interface AsyncQueueOptions<T = any, K = any> {
|
|
|
35
15
|
* @constructor 并发控制器
|
|
36
16
|
*/
|
|
37
17
|
export declare class AsyncQueue<T = any, K = any, R = any> {
|
|
38
|
-
name: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
parallelism
|
|
42
|
-
_queued
|
|
43
|
-
|
|
44
|
-
_activeTasks
|
|
45
|
-
_processingLock
|
|
46
|
-
_stopped
|
|
18
|
+
readonly name: string;
|
|
19
|
+
private readonly processor;
|
|
20
|
+
private readonly getKey;
|
|
21
|
+
private readonly parallelism;
|
|
22
|
+
private readonly _queued;
|
|
23
|
+
private readonly _entries;
|
|
24
|
+
private _activeTasks;
|
|
25
|
+
private _processingLock;
|
|
26
|
+
private _stopped;
|
|
47
27
|
constructor({ name, processor, getKey, parallelism }: AsyncQueueOptions<T>);
|
|
48
28
|
add(item: T, callback: EntryCallback): void;
|
|
49
29
|
addAsync(item: T): Promise<R>;
|
|
50
|
-
_ensureProcessing
|
|
51
|
-
_startProcess
|
|
52
|
-
_handlerResult
|
|
30
|
+
private _ensureProcessing;
|
|
31
|
+
private _startProcess;
|
|
32
|
+
private _handlerResult;
|
|
53
33
|
}
|
|
54
34
|
export declare function useAsyncQueue(): {
|
|
55
35
|
create: (parallelism?: number) => AsyncQueue<FormAsyncQueueItem, any, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Form } from '@formily/core';
|
|
2
2
|
import { FIELD_BUSINESS_TYPE } from '../constants';
|
|
3
3
|
export declare class BusinessCollector {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
private readonly typeCollector;
|
|
5
|
+
private readonly fieldNameCollector;
|
|
6
6
|
collect(type: FIELD_BUSINESS_TYPE, fieldName: string): void;
|
|
7
7
|
getField(type: FIELD_BUSINESS_TYPE): string[];
|
|
8
8
|
getType(fieldName: string): FIELD_BUSINESS_TYPE | undefined;
|
|
@@ -49,7 +49,7 @@ function useBusinessBinding() {
|
|
|
49
49
|
}
|
|
50
50
|
const handlerMap = /* @__PURE__ */ new Map([[FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType]]);
|
|
51
51
|
function trigger(collector, formModel, fieldName, value) {
|
|
52
|
-
const type = collector.
|
|
52
|
+
const type = collector.getType(fieldName);
|
|
53
53
|
if (!type || !handlerMap.has(type))
|
|
54
54
|
return;
|
|
55
55
|
handlerMap.get(type)(formModel, collector, value);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FormChangeContext } from 'cnhis-design-vue/es/packages/form-render';
|
|
2
|
+
export declare class ContextCollector {
|
|
3
|
+
private readonly contextMap;
|
|
4
|
+
setContext(key: string, prop: keyof FormChangeContext, value: any): void;
|
|
5
|
+
getContext(key: string): Partial<{
|
|
6
|
+
currentOption: import("../../../../src/types").AnyObject;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useChangeContext(): {
|
|
10
|
+
create: () => ContextCollector;
|
|
11
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class ContextCollector {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.contextMap = /* @__PURE__ */ new Map();
|
|
4
|
+
}
|
|
5
|
+
setContext(key, prop, value) {
|
|
6
|
+
const context = this.contextMap.get(key) || {};
|
|
7
|
+
Reflect.set(context, prop, value);
|
|
8
|
+
this.contextMap.set(key, context);
|
|
9
|
+
}
|
|
10
|
+
getContext(key) {
|
|
11
|
+
return this.contextMap.get(key) || {};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function useChangeContext() {
|
|
15
|
+
function create() {
|
|
16
|
+
return new ContextCollector();
|
|
17
|
+
}
|
|
18
|
+
return { create };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { ContextCollector, useChangeContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useUrlDeps(): void;
|