cnhis-design-vue 3.4.0-beta.33 → 3.4.0-beta.34
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/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/scale-view/src/hooks/use-event.js +56 -22
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -553,9 +553,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
553
553
|
hide: boolean;
|
554
554
|
}>;
|
555
555
|
draggable: boolean;
|
556
|
-
isHighlightRow: boolean;
|
557
556
|
idx: number;
|
558
557
|
isHighlight: boolean;
|
558
|
+
isHighlightRow: boolean;
|
559
559
|
isFieldSet: boolean;
|
560
560
|
fieldDescribeMode: "column" | "tooltip";
|
561
561
|
hideExpressionOption: AnyObject[];
|
@@ -594,9 +594,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
594
594
|
hide: boolean;
|
595
595
|
}>;
|
596
596
|
draggable: boolean;
|
597
|
-
isHighlightRow: boolean;
|
598
597
|
idx: number;
|
599
598
|
isHighlight: boolean;
|
599
|
+
isHighlightRow: boolean;
|
600
600
|
isFieldSet: boolean;
|
601
601
|
fieldDescribeMode: "column" | "tooltip";
|
602
602
|
hideExpressionOption: AnyObject[];
|
@@ -773,9 +773,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
773
773
|
hide: boolean;
|
774
774
|
}>;
|
775
775
|
draggable: boolean;
|
776
|
-
isHighlightRow: boolean;
|
777
776
|
idx: number;
|
778
777
|
isHighlight: boolean;
|
778
|
+
isHighlightRow: boolean;
|
779
779
|
isFieldSet: boolean;
|
780
780
|
fieldDescribeMode: "column" | "tooltip";
|
781
781
|
hideExpressionOption: AnyObject[];
|
@@ -384,9 +384,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
384
384
|
hide: boolean;
|
385
385
|
}>;
|
386
386
|
draggable: boolean;
|
387
|
-
isHighlightRow: boolean;
|
388
387
|
idx: number;
|
389
388
|
isHighlight: boolean;
|
389
|
+
isHighlightRow: boolean;
|
390
390
|
isFieldSet: boolean;
|
391
391
|
fieldDescribeMode: "column" | "tooltip";
|
392
392
|
hideExpressionOption: AnyObject[];
|
@@ -13,16 +13,17 @@ const useEvent = (props, state) => {
|
|
13
13
|
};
|
14
14
|
const handleLogicList = (formItem, formArray) => {
|
15
15
|
const { seq } = formItem;
|
16
|
-
|
16
|
+
const list = formArray.map((item2) => {
|
17
17
|
if (item2.seq > seq && item2.isShow && item2.__isLogic__)
|
18
18
|
return item2;
|
19
19
|
return false;
|
20
20
|
});
|
21
21
|
let nextItemMax = 0;
|
22
|
-
|
22
|
+
const len = list.length;
|
23
|
+
let i = 0, item;
|
23
24
|
for (; i < len; i++) {
|
24
25
|
item = list[i];
|
25
|
-
|
26
|
+
const curVal = state.form[formKey(item)];
|
26
27
|
if (!curVal)
|
27
28
|
continue;
|
28
29
|
if (Array.isArray(curVal)) {
|
@@ -83,7 +84,7 @@ const useEvent = (props, state) => {
|
|
83
84
|
});
|
84
85
|
}
|
85
86
|
} else if (nextLogic.next_logic == "uncondition") {
|
86
|
-
|
87
|
+
const res = vexutilsExpand.isEmpty(choiceValue);
|
87
88
|
formItem.__isLogic__ = !res;
|
88
89
|
formItem.__lastSeq__ = seq + 1;
|
89
90
|
formArray.forEach((item) => {
|
@@ -99,27 +100,60 @@ const useEvent = (props, state) => {
|
|
99
100
|
});
|
100
101
|
}
|
101
102
|
};
|
103
|
+
const processFieldValue = (value, isNumberType) => {
|
104
|
+
const defaultValue = isNumberType ? null : "/";
|
105
|
+
if (value == null || value === "") {
|
106
|
+
return defaultValue;
|
107
|
+
}
|
108
|
+
if (isNumberType) {
|
109
|
+
if (typeof value !== "number" && isNaN(+value)) {
|
110
|
+
return null;
|
111
|
+
}
|
112
|
+
return +value;
|
113
|
+
}
|
114
|
+
return value;
|
115
|
+
};
|
116
|
+
const createFormElementMap = (formArray) => {
|
117
|
+
const elementMap = /* @__PURE__ */ new Map();
|
118
|
+
formArray.forEach((element) => {
|
119
|
+
if (element.seq != null) {
|
120
|
+
elementMap.set(element.seq, element);
|
121
|
+
}
|
122
|
+
});
|
123
|
+
return elementMap;
|
124
|
+
};
|
125
|
+
const processRelationFieldList = (dataList, relationField, isNumberType) => {
|
126
|
+
return dataList.map((dataItem) => processFieldValue(dataItem[relationField], isNumberType)).filter(Boolean) || [];
|
127
|
+
};
|
102
128
|
const handleDynamicDataRelation = (list, formItem, formArray) => {
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
if (!targetSource.target_id)
|
107
|
-
return;
|
108
|
-
let { relationParam = [] } = targetSource;
|
109
|
-
if (!relationParam.length)
|
129
|
+
var _a;
|
130
|
+
const { targetSource } = formItem;
|
131
|
+
if (!targetSource || !Object.keys(targetSource).length || !targetSource.target_id || !((_a = targetSource.relationParam) == null ? void 0 : _a.length)) {
|
110
132
|
return;
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
133
|
+
}
|
134
|
+
const { relationParam } = targetSource;
|
135
|
+
const formElementMap = createFormElementMap(formArray);
|
136
|
+
const len = relationParam.length;
|
137
|
+
let i = 0, item;
|
138
|
+
for (; i < len; i++) {
|
139
|
+
item = relationParam[i];
|
140
|
+
const { relationElement, relationField } = item;
|
141
|
+
if (relationElement == null || !relationField)
|
142
|
+
continue;
|
143
|
+
const targetElement = formElementMap.get(item.relationElement);
|
144
|
+
if (!targetElement)
|
145
|
+
continue;
|
146
|
+
const { val_key: formKey2, valueType } = targetElement;
|
147
|
+
const isNumberType = valueType === "number";
|
148
|
+
if (!formKey2)
|
149
|
+
continue;
|
150
|
+
if (!list.length) {
|
151
|
+
state.form[formKey2] = null;
|
152
|
+
continue;
|
121
153
|
}
|
122
|
-
|
154
|
+
const relationFieldList = processRelationFieldList(list, item.relationField, isNumberType);
|
155
|
+
state.form[formKey2] = relationFieldList.length > 0 ? relationFieldList.join(",") : null;
|
156
|
+
}
|
123
157
|
};
|
124
158
|
return {
|
125
159
|
nextLogicEvent,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cnhis-design-vue",
|
3
|
-
"version": "3.4.0-beta.
|
3
|
+
"version": "3.4.0-beta.34",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -73,5 +73,5 @@
|
|
73
73
|
"iOS 7",
|
74
74
|
"last 3 iOS versions"
|
75
75
|
],
|
76
|
-
"gitHead": "
|
76
|
+
"gitHead": "d428050c11e691f5de5f8d8992e774e735b8514b"
|
77
77
|
}
|