@ibiz-template/vue3-components 0.6.0-alpha.4 → 0.6.0
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/index-UyccsQgR.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-HHmyYumg.js → xlsx-util-G9ywpMYa.js} +1 -1
- package/es/common/data-import2/data-import2.css +1 -1
- package/es/control/tree/index.d.ts +1 -0
- package/es/control/tree/tree.d.ts +1 -0
- package/es/control/tree/tree.mjs +7 -2
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.d.ts +6 -8
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +139 -48
- package/es/editor/data-picker/picker-editor.controller.mjs +9 -2
- package/es/view-engine/pickup-tree-view.engine.d.ts +15 -0
- package/es/view-engine/pickup-tree-view.engine.mjs +60 -3
- package/lib/common/data-import2/data-import2.css +1 -1
- package/lib/control/tree/tree.cjs +6 -1
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +138 -47
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/lib/editor/data-picker/picker-editor.controller.cjs +8 -1
- package/lib/view-engine/pickup-tree-view.engine.cjs +59 -2
- package/package.json +6 -6
- package/dist/index-wFXNmg_E.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;
|
|
1
|
+
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;background:var(--ibiz-color-bg-1)}.ibiz-data-import2.ibiz-view{height:568px}.ibiz-data-import2__data-import2-toolbar{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__data-import2-toolbar-container{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__select-option-item-button{height:100%}
|
|
@@ -935,6 +935,7 @@ export declare const IBizTreeControl: import("@ibiz-template/vue3-util").TypeWit
|
|
|
935
935
|
treeRefreshKey: import("vue").Ref<string>;
|
|
936
936
|
editingNodeKey: import("vue").Ref<string | null>;
|
|
937
937
|
editingNodeText: import("vue").Ref<string | null>;
|
|
938
|
+
cascadeSelect: import("vue").Ref<boolean>;
|
|
938
939
|
findNodeData: typeof import("./el-tree-util").findNodeData;
|
|
939
940
|
onCheck: (nodeData: import("@ibiz-template/runtime").ITreeNodeData, opts: {
|
|
940
941
|
checkedNodes: import("@ibiz-template/runtime").ITreeNodeData[];
|
|
@@ -956,6 +956,7 @@ export declare const TreeControl: import("vue").DefineComponent<{
|
|
|
956
956
|
treeRefreshKey: import("vue").Ref<string>;
|
|
957
957
|
editingNodeKey: import("vue").Ref<string | null>;
|
|
958
958
|
editingNodeText: import("vue").Ref<string | null>;
|
|
959
|
+
cascadeSelect: import("vue").Ref<boolean>;
|
|
959
960
|
findNodeData: typeof findNodeData;
|
|
960
961
|
onCheck: (nodeData: ITreeNodeData, opts: {
|
|
961
962
|
checkedNodes: ITreeNodeData[];
|
package/es/control/tree/tree.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode,
|
|
1
|
+
import { isVNode, ref, reactive, watch, computed, nextTick, resolveComponent, createVNode, onMounted, onUnmounted, resolveDirective, withDirectives, defineComponent } from 'vue';
|
|
2
2
|
import { useControlController, useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { createUUID } from 'qx-util';
|
|
4
4
|
import { debounce } from 'lodash-es';
|
|
@@ -67,6 +67,7 @@ const TreeControl = /* @__PURE__ */ defineComponent({
|
|
|
67
67
|
},
|
|
68
68
|
setup() {
|
|
69
69
|
const c = useControlController((...args) => new TreeController(...args));
|
|
70
|
+
const cascadeSelect = ref(false);
|
|
70
71
|
const counterData = reactive({});
|
|
71
72
|
c.evt.on("onCreated", () => {
|
|
72
73
|
if (c.counter) {
|
|
@@ -74,6 +75,9 @@ const TreeControl = /* @__PURE__ */ defineComponent({
|
|
|
74
75
|
Object.assign(counterData, counter);
|
|
75
76
|
}, true);
|
|
76
77
|
}
|
|
78
|
+
if (c.controlParams.cascadeselect) {
|
|
79
|
+
cascadeSelect.value = true;
|
|
80
|
+
}
|
|
77
81
|
});
|
|
78
82
|
const ns = useNamespace("control-".concat(c.model.controlType.toLowerCase()));
|
|
79
83
|
const treeRef = ref(null);
|
|
@@ -405,6 +409,7 @@ const TreeControl = /* @__PURE__ */ defineComponent({
|
|
|
405
409
|
treeRefreshKey,
|
|
406
410
|
editingNodeKey,
|
|
407
411
|
editingNodeText,
|
|
412
|
+
cascadeSelect,
|
|
408
413
|
findNodeData,
|
|
409
414
|
onCheck,
|
|
410
415
|
onNodeClick,
|
|
@@ -453,7 +458,7 @@ const TreeControl = /* @__PURE__ */ defineComponent({
|
|
|
453
458
|
"expand-on-click-node": false,
|
|
454
459
|
"auto-expand-parent": false,
|
|
455
460
|
"show-checkbox": !this.c.state.singleSelect,
|
|
456
|
-
"check-strictly":
|
|
461
|
+
"check-strictly": !this.cascadeSelect,
|
|
457
462
|
"default-expanded-keys": this.c.state.expandedKeys,
|
|
458
463
|
"props": {
|
|
459
464
|
label: "_text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-picker-select-view{width:100%}.ibiz-picker-select-view .el-dropdown{width:100%}.ibiz-picker-select-view .el-select{width:100%}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper{width:100%;max-height:500px;overflow:auto}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list .el-dropdown-menu{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-select{display:block}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content{display:flex;align-items:center;width:100%;height:var(--ibiz-editor-default-line-height);padding:var(--ibiz-form-item-hover-edit-padding);font-family:Arial,sans-serif;font-size:var(--ibiz-form-item-font-size);line-height:var(--ibiz-editor-default-line-height);color:var(--ibiz-form-item-text-color)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content .ibiz-picker-select-view-content-item{height:22px;padding:0 9px;margin:2px 6px 2px 0;font-size:var(--ibiz-font-size-small);line-height:22px;color:var(--ibiz-editor-default-text-color);background-color:var(--ibiz-color-fill-0);border:1px solid transparent;border-radius:var(--ibiz-border-radius-small)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-select{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-select{display:block}
|
|
1
|
+
.ibiz-picker-select-view{width:100%}.ibiz-picker-select-view .el-dropdown{width:100%}.ibiz-picker-select-view .el-select{width:100%}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper{width:100%;min-height:100px;max-height:500px;overflow:auto}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list .el-dropdown-menu{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-select{display:block}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content{display:flex;align-items:center;width:100%;height:var(--ibiz-editor-default-line-height);padding:var(--ibiz-form-item-hover-edit-padding);font-family:Arial,sans-serif;font-size:var(--ibiz-form-item-font-size);line-height:var(--ibiz-editor-default-line-height);color:var(--ibiz-form-item-text-color)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content .ibiz-picker-select-view-content-item{height:22px;padding:0 9px;margin:2px 6px 2px 0;font-size:var(--ibiz-font-size-small);line-height:22px;color:var(--ibiz-editor-default-text-color);background-color:var(--ibiz-color-fill-0);border:1px solid transparent;border-radius:var(--ibiz-border-radius-small)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-select{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-select{display:block}.ibiz-picker-select-view-select-popover{display:none}
|
|
@@ -33,15 +33,10 @@ export declare const IBizPickerSelectView: import("vue").DefineComponent<{
|
|
|
33
33
|
queryValue: Ref<string>;
|
|
34
34
|
visible: Ref<boolean>;
|
|
35
35
|
pickViewWidth: Ref<string>;
|
|
36
|
-
context: Ref<
|
|
37
|
-
|
|
38
|
-
[x: symbol]: any;
|
|
39
|
-
srfsessionid: string;
|
|
40
|
-
srfappid: string;
|
|
41
|
-
}>;
|
|
42
|
-
params: Ref<IParams>;
|
|
36
|
+
context: Ref<IContext>;
|
|
37
|
+
params: Ref<IData>;
|
|
43
38
|
editorRef: Ref<any>;
|
|
44
|
-
onInputChange: () => void;
|
|
39
|
+
onInputChange: (e: IData) => void;
|
|
45
40
|
triggerMenu: (show?: boolean) => void;
|
|
46
41
|
onViewDataChange: (event: IData[]) => void;
|
|
47
42
|
onClear: () => void;
|
|
@@ -57,6 +52,9 @@ export declare const IBizPickerSelectView: import("vue").DefineComponent<{
|
|
|
57
52
|
isEditable: Ref<boolean>;
|
|
58
53
|
setEditable: (flag: boolean) => void;
|
|
59
54
|
showFormDefaultContent: import("vue").ComputedRef<boolean>;
|
|
55
|
+
onVisibleChange: (e: boolean) => void;
|
|
56
|
+
showView: Ref<boolean>;
|
|
57
|
+
selectedData: Ref<IData[]>;
|
|
60
58
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
59
|
change: (_value: unknown, _name?: string | undefined) => boolean;
|
|
62
60
|
blur: (_event?: IData | undefined) => boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isVNode, ref,
|
|
1
|
+
import { isVNode, ref, watch, computed, onMounted, resolveComponent, createVNode, h, defineComponent } from 'vue';
|
|
2
2
|
import { getDataPickerProps, getEditorEmits, useNamespace, useFocusAndBlur } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './ibiz-picker-select-view.css';
|
|
4
|
-
import { clone } from 'ramda';
|
|
5
4
|
import { ViewMode, Modal } from '@ibiz-template/runtime';
|
|
5
|
+
import { clone } from 'ramda';
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
8
8
|
function _isSlot(s) {
|
|
@@ -30,9 +30,24 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
const queryValue = ref("");
|
|
31
31
|
const visible = ref(false);
|
|
32
32
|
const pickViewWidth = ref("auto");
|
|
33
|
-
const context = ref(
|
|
34
|
-
const params = ref(
|
|
33
|
+
const context = ref(c.context);
|
|
34
|
+
const params = ref(c.params);
|
|
35
|
+
watch(() => props.data, (newVal) => {
|
|
36
|
+
const {
|
|
37
|
+
context: tempContext,
|
|
38
|
+
params: tempParams
|
|
39
|
+
} = c.handlePublicParams(newVal, c.context, c.params);
|
|
40
|
+
Object.assign(context.value, tempContext);
|
|
41
|
+
Object.assign(params.value, tempParams);
|
|
42
|
+
}, {
|
|
43
|
+
immediate: true,
|
|
44
|
+
deep: true
|
|
45
|
+
});
|
|
35
46
|
const isEditable = ref(false);
|
|
47
|
+
const multipleTempValue = ref(null);
|
|
48
|
+
const multipleTempText = ref(null);
|
|
49
|
+
const multipleObjs = ref(null);
|
|
50
|
+
const showView = ref(false);
|
|
36
51
|
const showFormDefaultContent = computed(() => {
|
|
37
52
|
if (props.controlParams && props.controlParams.editmode === "hover") {
|
|
38
53
|
return true;
|
|
@@ -48,12 +63,6 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
48
63
|
}, 100);
|
|
49
64
|
}
|
|
50
65
|
};
|
|
51
|
-
const onInputChange = () => {
|
|
52
|
-
context.value = {
|
|
53
|
-
query: queryValue.value,
|
|
54
|
-
...context.value
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
66
|
const triggerMenu = (show) => {
|
|
58
67
|
if (props.disabled) {
|
|
59
68
|
return;
|
|
@@ -84,10 +93,30 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
84
93
|
params.value.selectedData = selectedData.value;
|
|
85
94
|
}
|
|
86
95
|
} else {
|
|
87
|
-
keySet.value = [];
|
|
88
96
|
const selectItems = [];
|
|
97
|
+
keySet.value = [];
|
|
98
|
+
items.value = [];
|
|
89
99
|
if (newVal) {
|
|
90
|
-
if (
|
|
100
|
+
if (c.model.valueType === "OBJECTS") {
|
|
101
|
+
newVal.forEach((item) => {
|
|
102
|
+
const _item = clone(item);
|
|
103
|
+
Object.assign(_item, {
|
|
104
|
+
[c.keyName]: item[c.objectIdField],
|
|
105
|
+
[c.textName]: item[c.objectNameField]
|
|
106
|
+
});
|
|
107
|
+
if (c.objectValueField) {
|
|
108
|
+
Object.assign(_item, {
|
|
109
|
+
...item[c.objectValueField]
|
|
110
|
+
});
|
|
111
|
+
delete _item[c.objectValueField];
|
|
112
|
+
}
|
|
113
|
+
if (_item[c.keyName]) {
|
|
114
|
+
items.value.push(_item);
|
|
115
|
+
keySet.value.push(_item[c.keyName]);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
selectItems.push(...newVal);
|
|
119
|
+
} else if (!props.data || !c.valueItem || !props.data[c.valueItem]) {
|
|
91
120
|
ibiz.log.error("\u503C\u9879\u5F02\u5E38");
|
|
92
121
|
} else {
|
|
93
122
|
const tempValue = props.data[c.valueItem].split(",");
|
|
@@ -98,7 +127,6 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
98
127
|
srfkey
|
|
99
128
|
});
|
|
100
129
|
});
|
|
101
|
-
items.value = [];
|
|
102
130
|
selectItems.forEach((item) => {
|
|
103
131
|
keySet.value.push(item.srfkey);
|
|
104
132
|
const index = items.value.findIndex((i) => Object.is(i.srfkey, item.srfkey));
|
|
@@ -112,10 +140,10 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
112
140
|
}
|
|
113
141
|
}
|
|
114
142
|
selectedData.value = selectItems;
|
|
115
|
-
|
|
143
|
+
multipleObjs.value = selectItems;
|
|
116
144
|
}
|
|
117
145
|
}, {
|
|
118
|
-
immediate:
|
|
146
|
+
immediate: true,
|
|
119
147
|
deep: true
|
|
120
148
|
});
|
|
121
149
|
onMounted(() => {
|
|
@@ -135,9 +163,26 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
135
163
|
}
|
|
136
164
|
emit("change", null);
|
|
137
165
|
};
|
|
166
|
+
const onInputChange = (e) => {
|
|
167
|
+
if (!e) {
|
|
168
|
+
onClear();
|
|
169
|
+
}
|
|
170
|
+
};
|
|
138
171
|
const onViewDataChange = (event) => {
|
|
139
172
|
if (event.length === 0) {
|
|
140
|
-
|
|
173
|
+
if (singleSelect.value) {
|
|
174
|
+
onClear();
|
|
175
|
+
} else {
|
|
176
|
+
items.value = [];
|
|
177
|
+
if (c.model.valueType === "OBJECTS") {
|
|
178
|
+
multipleObjs.value = null;
|
|
179
|
+
} else {
|
|
180
|
+
if (c.valueItem) {
|
|
181
|
+
multipleTempValue.value = null;
|
|
182
|
+
}
|
|
183
|
+
multipleTempText.value = null;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
141
186
|
return;
|
|
142
187
|
}
|
|
143
188
|
if (singleSelect.value) {
|
|
@@ -152,6 +197,15 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
152
197
|
} else {
|
|
153
198
|
emit("change", tempText);
|
|
154
199
|
}
|
|
200
|
+
} else if (c.model.valueType === "OBJECTS") {
|
|
201
|
+
if (event && Array.isArray(event)) {
|
|
202
|
+
const objs = [];
|
|
203
|
+
event.forEach((item) => {
|
|
204
|
+
const obj = c.handleObjectParams(item);
|
|
205
|
+
objs.push(obj);
|
|
206
|
+
});
|
|
207
|
+
multipleObjs.value = objs;
|
|
208
|
+
}
|
|
155
209
|
} else {
|
|
156
210
|
let tempValue = "";
|
|
157
211
|
let tempText = "";
|
|
@@ -174,9 +228,9 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
174
228
|
tempValue = tempValue.substring(0, tempValue.length - 1);
|
|
175
229
|
tempText = tempText.substring(0, tempText.length - 1);
|
|
176
230
|
if (c.valueItem) {
|
|
177
|
-
|
|
231
|
+
multipleTempValue.value = tempValue;
|
|
178
232
|
}
|
|
179
|
-
|
|
233
|
+
multipleTempText.value = tempText;
|
|
180
234
|
}
|
|
181
235
|
};
|
|
182
236
|
const openLinkView = async (e) => {
|
|
@@ -196,20 +250,31 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
196
250
|
}
|
|
197
251
|
});
|
|
198
252
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
253
|
+
if (c.model.valueType === "OBJECTS") {
|
|
254
|
+
const objs = [];
|
|
255
|
+
val.forEach((item) => {
|
|
256
|
+
const obj = c.handleObjectParams(item);
|
|
257
|
+
objs.push(obj);
|
|
258
|
+
});
|
|
259
|
+
emit("change", objs);
|
|
260
|
+
} else {
|
|
261
|
+
let tempValue = "";
|
|
262
|
+
let tempText = "";
|
|
263
|
+
val.forEach((select) => {
|
|
264
|
+
const srfkey = select[c.keyName] ? select[c.keyName] : select.srfkey;
|
|
265
|
+
tempValue += "".concat(srfkey, ",");
|
|
266
|
+
const srfmajortext = select[c.textName] ? select[c.textName] : select.srfmajortext;
|
|
267
|
+
tempText += "".concat(srfmajortext, ",");
|
|
268
|
+
});
|
|
269
|
+
tempValue = tempValue.substring(0, tempValue.length - 1);
|
|
270
|
+
tempText = tempText.substring(0, tempText.length - 1);
|
|
271
|
+
if (c.valueItem) {
|
|
272
|
+
multipleTempValue.value = tempValue;
|
|
273
|
+
emit("change", tempValue, c.valueItem);
|
|
274
|
+
}
|
|
275
|
+
multipleTempText.value = tempText;
|
|
276
|
+
emit("change", tempText);
|
|
211
277
|
}
|
|
212
|
-
emit("change", tempText);
|
|
213
278
|
};
|
|
214
279
|
const remoteMethod = (e) => {
|
|
215
280
|
queryValue.value = e;
|
|
@@ -217,6 +282,9 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
217
282
|
const onSelectionChange = (event) => {
|
|
218
283
|
if (event.data) {
|
|
219
284
|
onViewDataChange(event.data);
|
|
285
|
+
if (singleSelect.value && editorRef.value) {
|
|
286
|
+
editorRef.value.handleClose();
|
|
287
|
+
}
|
|
220
288
|
}
|
|
221
289
|
};
|
|
222
290
|
const modal = new Modal({
|
|
@@ -243,8 +311,21 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
243
311
|
if (singleSelect.value) {
|
|
244
312
|
return queryValue.value;
|
|
245
313
|
}
|
|
246
|
-
return selectedData.value.map((item) => item.
|
|
314
|
+
return selectedData.value.map((item) => item[c.textName]).join(",");
|
|
247
315
|
});
|
|
316
|
+
const onVisibleChange = (e) => {
|
|
317
|
+
showView.value = e;
|
|
318
|
+
if (!e && !singleSelect.value) {
|
|
319
|
+
if (c.model.valueType === "OBJECTS") {
|
|
320
|
+
emit("change", multipleObjs.value);
|
|
321
|
+
} else {
|
|
322
|
+
if (c.valueItem) {
|
|
323
|
+
emit("change", multipleTempValue.value, c.valueItem);
|
|
324
|
+
}
|
|
325
|
+
emit("change", multipleTempText.value);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
};
|
|
248
329
|
return {
|
|
249
330
|
ns,
|
|
250
331
|
c,
|
|
@@ -272,7 +353,10 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
272
353
|
valueText,
|
|
273
354
|
isEditable,
|
|
274
355
|
setEditable,
|
|
275
|
-
showFormDefaultContent
|
|
356
|
+
showFormDefaultContent,
|
|
357
|
+
onVisibleChange,
|
|
358
|
+
showView,
|
|
359
|
+
selectedData
|
|
276
360
|
};
|
|
277
361
|
},
|
|
278
362
|
render() {
|
|
@@ -281,7 +365,8 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
281
365
|
"trigger": "click",
|
|
282
366
|
"teleported": false,
|
|
283
367
|
"class": this.ns.b("select"),
|
|
284
|
-
"popper-class": this.ns.b("popper")
|
|
368
|
+
"popper-class": this.ns.b("popper"),
|
|
369
|
+
"onVisibleChange": this.onVisibleChange
|
|
285
370
|
}, {
|
|
286
371
|
default: () => {
|
|
287
372
|
let _slot;
|
|
@@ -292,6 +377,7 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
292
377
|
"disabled": this.disabled,
|
|
293
378
|
"readonly": this.readonly,
|
|
294
379
|
"onChange": this.onInputChange,
|
|
380
|
+
"clearable": true,
|
|
295
381
|
"onFocus": (e) => {
|
|
296
382
|
this.onFocus(e);
|
|
297
383
|
},
|
|
@@ -302,13 +388,13 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
302
388
|
return [this.queryValue && !this.disabled && !this.readonly && createVNode("ion-icon", {
|
|
303
389
|
"onClick": this.onClear,
|
|
304
390
|
"name": "clear"
|
|
305
|
-
}, null), this.c.model.linkAppViewId &&
|
|
391
|
+
}, null), this.c.model.linkAppViewId && createVNode("ion-icon", {
|
|
306
392
|
"onClick": this.openLinkView,
|
|
307
393
|
"name": "link-arrow"
|
|
308
394
|
}, null)];
|
|
309
395
|
}
|
|
310
396
|
}) : createVNode(resolveComponent("el-select"), {
|
|
311
|
-
"popper-class": "select",
|
|
397
|
+
"popper-class": this.ns.b("select-popover"),
|
|
312
398
|
"model-value": this.keySet,
|
|
313
399
|
"placeholder": this.c.placeHolder ? this.c.placeHolder : " ",
|
|
314
400
|
"multiple": true,
|
|
@@ -333,19 +419,24 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
|
|
|
333
419
|
});
|
|
334
420
|
},
|
|
335
421
|
dropdown: () => {
|
|
422
|
+
if (!this.showView) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
336
425
|
const viewShell = resolveComponent("IBizViewShell");
|
|
337
|
-
return
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
426
|
+
return this.c.pickupView && h(viewShell, {
|
|
427
|
+
context: this.context,
|
|
428
|
+
params: this.params,
|
|
429
|
+
viewId: this.c.pickupView.id,
|
|
430
|
+
style: {
|
|
431
|
+
height: "100%",
|
|
432
|
+
width: this.pickViewWidth
|
|
433
|
+
},
|
|
434
|
+
state: {
|
|
435
|
+
singleSelect: this.singleSelect,
|
|
436
|
+
selectedData: this.selectedData
|
|
437
|
+
},
|
|
438
|
+
onSelectionChange: this.onSelectionChange,
|
|
439
|
+
modal: this.modal
|
|
349
440
|
});
|
|
350
441
|
}
|
|
351
442
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
2
|
import { EditorController, getDeACMode, OpenAppViewCommand } from '@ibiz-template/runtime';
|
|
3
|
-
import { mergeDeepLeft
|
|
3
|
+
import { mergeDeepLeft } from 'ramda';
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
@@ -293,7 +293,14 @@ class PickerEditorController extends EditorController {
|
|
|
293
293
|
}
|
|
294
294
|
if (this.objectValueField) {
|
|
295
295
|
Object.assign(object, {
|
|
296
|
-
[this.objectValueField]:
|
|
296
|
+
[this.objectValueField]: {
|
|
297
|
+
...select
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
if (select.srfnodeid) {
|
|
302
|
+
Object.assign(object, {
|
|
303
|
+
srfnodeid: select.srfnodeid
|
|
297
304
|
});
|
|
298
305
|
}
|
|
299
306
|
return object;
|
|
@@ -3,6 +3,13 @@ import { IAppDETreeView } from '@ibiz/model-core';
|
|
|
3
3
|
import { TreeViewEngine } from './tree-view.engine';
|
|
4
4
|
export declare class PickupTreeViewEngine extends TreeViewEngine {
|
|
5
5
|
protected view: ViewController<IAppDETreeView, IPickupTreeViewState, IPickupTreeViewEvent>;
|
|
6
|
+
/**
|
|
7
|
+
* 选中数据
|
|
8
|
+
*
|
|
9
|
+
* @type {IData[]}
|
|
10
|
+
* @memberof PickupViewEngine
|
|
11
|
+
*/
|
|
12
|
+
selectData: IData[];
|
|
6
13
|
/**
|
|
7
14
|
* 创建完成
|
|
8
15
|
*
|
|
@@ -11,6 +18,14 @@ export declare class PickupTreeViewEngine extends TreeViewEngine {
|
|
|
11
18
|
* @memberof PickupGridViewEngine
|
|
12
19
|
*/
|
|
13
20
|
onCreated(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* 根据key计算需要展开的节点标识
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2023-11-07 02:42:45
|
|
25
|
+
* @param {string} key
|
|
26
|
+
* @return {*} {string[]}
|
|
27
|
+
*/
|
|
28
|
+
calcExpandKeys(key: string): string[];
|
|
14
29
|
/**
|
|
15
30
|
* 挂载完成
|
|
16
31
|
*
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViewCallTag } from '@ibiz-template/runtime';
|
|
2
2
|
import { TreeViewEngine } from './tree-view.engine.mjs';
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __publicField = (obj, key, value) => {
|
|
8
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
|
+
return value;
|
|
10
|
+
};
|
|
5
11
|
class PickupTreeViewEngine extends TreeViewEngine {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/**
|
|
15
|
+
* 选中数据
|
|
16
|
+
*
|
|
17
|
+
* @type {IData[]}
|
|
18
|
+
* @memberof PickupViewEngine
|
|
19
|
+
*/
|
|
20
|
+
__publicField(this, "selectData", []);
|
|
21
|
+
}
|
|
6
22
|
/**
|
|
7
23
|
* 创建完成
|
|
8
24
|
*
|
|
@@ -16,6 +32,41 @@ class PickupTreeViewEngine extends TreeViewEngine {
|
|
|
16
32
|
this.view.slotProps.tree = {};
|
|
17
33
|
}
|
|
18
34
|
this.view.slotProps.tree.singleSelect = this.view.state.singleSelect;
|
|
35
|
+
if (this.view.state.selectedData) {
|
|
36
|
+
this.selectData = this.view.state.selectedData.map((item) => {
|
|
37
|
+
return {
|
|
38
|
+
...item,
|
|
39
|
+
_id: item.srfnodeid
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const set = /* @__PURE__ */ new Set();
|
|
43
|
+
this.selectData.forEach((item) => {
|
|
44
|
+
if (item.srfnodeid) {
|
|
45
|
+
const keys = this.calcExpandKeys(item.srfnodeid);
|
|
46
|
+
keys.forEach((key) => set.add(key));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
this.view.slotProps.tree.defaultExpandedKeys = Array.from(set);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 根据key计算需要展开的节点标识
|
|
54
|
+
* @author lxm
|
|
55
|
+
* @date 2023-11-07 02:42:45
|
|
56
|
+
* @param {string} key
|
|
57
|
+
* @return {*} {string[]}
|
|
58
|
+
*/
|
|
59
|
+
calcExpandKeys(key) {
|
|
60
|
+
const expandedKeys = [];
|
|
61
|
+
key.split(":").forEach((item, index) => {
|
|
62
|
+
if (index === 0) {
|
|
63
|
+
expandedKeys.push(item);
|
|
64
|
+
} else {
|
|
65
|
+
expandedKeys.push("".concat(expandedKeys[index - 1], ":").concat(item));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
expandedKeys.pop();
|
|
69
|
+
return expandedKeys;
|
|
19
70
|
}
|
|
20
71
|
/**
|
|
21
72
|
* 挂载完成
|
|
@@ -26,15 +77,21 @@ class PickupTreeViewEngine extends TreeViewEngine {
|
|
|
26
77
|
*/
|
|
27
78
|
async onMounted() {
|
|
28
79
|
const { model } = this.view;
|
|
80
|
+
let forbiddenSelectionChange = false;
|
|
29
81
|
this.xdataControl.evt.on("onSelectionChange", async (event) => {
|
|
30
|
-
if (
|
|
31
|
-
|
|
82
|
+
if (forbiddenSelectionChange) {
|
|
83
|
+
return;
|
|
32
84
|
}
|
|
33
85
|
this.view.evt.emit("onSelectionChange", { ...event });
|
|
34
86
|
});
|
|
35
87
|
this.xdataControl.evt.on("onActive", async (event) => {
|
|
36
88
|
this.view.evt.emit("onDataActive", { ...event });
|
|
37
89
|
});
|
|
90
|
+
this.xdataControl.evt.on("onLoadSuccess", () => {
|
|
91
|
+
forbiddenSelectionChange = true;
|
|
92
|
+
this.xdataControl.setSelection(this.selectData);
|
|
93
|
+
forbiddenSelectionChange = false;
|
|
94
|
+
});
|
|
38
95
|
if (!this.view.state.noLoadDefault && model.loadDefault) {
|
|
39
96
|
this.load();
|
|
40
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;
|
|
1
|
+
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;background:var(--ibiz-color-bg-1)}.ibiz-data-import2.ibiz-view{height:568px}.ibiz-data-import2__data-import2-toolbar{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__data-import2-toolbar-container{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__select-option-item-button{height:100%}
|
|
@@ -69,6 +69,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
69
69
|
},
|
|
70
70
|
setup() {
|
|
71
71
|
const c = vue3Util.useControlController((...args) => new runtime.TreeController(...args));
|
|
72
|
+
const cascadeSelect = vue.ref(false);
|
|
72
73
|
const counterData = vue.reactive({});
|
|
73
74
|
c.evt.on("onCreated", () => {
|
|
74
75
|
if (c.counter) {
|
|
@@ -76,6 +77,9 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
76
77
|
Object.assign(counterData, counter);
|
|
77
78
|
}, true);
|
|
78
79
|
}
|
|
80
|
+
if (c.controlParams.cascadeselect) {
|
|
81
|
+
cascadeSelect.value = true;
|
|
82
|
+
}
|
|
79
83
|
});
|
|
80
84
|
const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
|
|
81
85
|
const treeRef = vue.ref(null);
|
|
@@ -407,6 +411,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
407
411
|
treeRefreshKey,
|
|
408
412
|
editingNodeKey,
|
|
409
413
|
editingNodeText,
|
|
414
|
+
cascadeSelect,
|
|
410
415
|
findNodeData: elTreeUtil.findNodeData,
|
|
411
416
|
onCheck,
|
|
412
417
|
onNodeClick,
|
|
@@ -455,7 +460,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
455
460
|
"expand-on-click-node": false,
|
|
456
461
|
"auto-expand-parent": false,
|
|
457
462
|
"show-checkbox": !this.c.state.singleSelect,
|
|
458
|
-
"check-strictly":
|
|
463
|
+
"check-strictly": !this.cascadeSelect,
|
|
459
464
|
"default-expanded-keys": this.c.state.expandedKeys,
|
|
460
465
|
"props": {
|
|
461
466
|
label: "_text",
|