@ibiz-template/vue3-components 0.7.41-alpha.112 → 0.7.41-alpha.113
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-XI8ySm9i.js → index-CkG9L_La.js} +3 -3
- package/dist/{index.es-Dsu1bPbQ.js → index.es-BU8Fy5we.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-4OTQfjW9.js → wang-editor-9zdglekK.js} +1 -1
- package/dist/{xlsx-util--TUzshNx.js → xlsx-util-DrUAhpzt.js} +1 -1
- package/es/editor/check-box-list/checkbox-list-editor.controller.mjs +11 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +9 -4
- package/es/editor/date-range-select/date-range-select-picker/date-range-select.mjs +4 -4
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +1 -1
- package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.mjs +17 -1
- package/es/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.mjs +19 -4
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +24 -7
- package/es/editor/list-box/list-box-editor.controller.mjs +11 -0
- package/es/editor/list-box/list-box-picker-editor.controller.mjs +11 -0
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +7 -0
- package/es/editor/radio-button-list/radio-button-list.controller.mjs +11 -1
- package/lib/editor/check-box-list/checkbox-list-editor.controller.cjs +11 -1
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +9 -4
- package/lib/editor/date-range-select/date-range-select-picker/date-range-select.cjs +4 -4
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +1 -1
- package/lib/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.cjs +17 -1
- package/lib/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.cjs +19 -4
- package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +24 -7
- package/lib/editor/list-box/list-box-editor.controller.cjs +11 -0
- package/lib/editor/list-box/list-box-picker-editor.controller.cjs +11 -0
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +7 -0
- package/lib/editor/radio-button-list/radio-button-list.controller.cjs +11 -1
- package/package.json +4 -4
- package/src/editor/check-box-list/checkbox-list-editor.controller.ts +11 -0
- package/src/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.tsx +28 -6
- package/src/editor/date-range-select/date-range-select-picker/date-range-select.tsx +8 -5
- package/src/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.tsx +3 -1
- package/src/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.tsx +28 -1
- package/src/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.tsx +31 -4
- package/src/editor/list-box/ibiz-list-box/ibiz-list-box.tsx +45 -9
- package/src/editor/list-box/list-box-editor.controller.ts +11 -0
- package/src/editor/list-box/list-box-picker-editor.controller.ts +11 -0
- package/src/editor/radio-button-list/ibiz-radio/ibiz-radio.tsx +13 -0
- package/src/editor/radio-button-list/radio-button-list.controller.ts +11 -0
|
@@ -19,9 +19,14 @@ class RadioButtonListEditorController extends runtime.CodeListEditorController {
|
|
|
19
19
|
* @type {(number | undefined)}
|
|
20
20
|
*/
|
|
21
21
|
__publicField(this, "rowNumber");
|
|
22
|
+
/**
|
|
23
|
+
* @description 自动选中第一个
|
|
24
|
+
* @memberof RadioButtonListEditorController
|
|
25
|
+
*/
|
|
26
|
+
__publicField(this, "autoSelectFirstOption", false);
|
|
22
27
|
}
|
|
23
28
|
async onInit() {
|
|
24
|
-
var _a, _b;
|
|
29
|
+
var _a, _b, _c;
|
|
25
30
|
super.onInit();
|
|
26
31
|
if ((_a = this.editorParams) == null ? void 0 : _a.rowNumber) {
|
|
27
32
|
this.rowNumber = Number(this.editorParams.rowNumber);
|
|
@@ -29,6 +34,11 @@ class RadioButtonListEditorController extends runtime.CodeListEditorController {
|
|
|
29
34
|
if ((_b = this.editorParams) == null ? void 0 : _b.rownumber) {
|
|
30
35
|
this.rowNumber = Number(this.editorParams.rownumber);
|
|
31
36
|
}
|
|
37
|
+
if ((_c = this.editorParams) == null ? void 0 : _c.autoselectfirstoption) {
|
|
38
|
+
this.autoSelectFirstOption = this.toBoolean(
|
|
39
|
+
this.editorParams.autoselectfirstoption
|
|
40
|
+
);
|
|
41
|
+
}
|
|
32
42
|
}
|
|
33
43
|
}
|
|
34
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.113",
|
|
4
4
|
"description": "web端组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@ibiz-template-plugin/data-view": "0.0.7",
|
|
38
38
|
"@ibiz-template/core": "0.7.41-alpha.117",
|
|
39
39
|
"@ibiz-template/devtool": "0.0.16",
|
|
40
|
-
"@ibiz-template/model-helper": "0.7.41-alpha.
|
|
41
|
-
"@ibiz-template/runtime": "0.7.41-alpha.
|
|
40
|
+
"@ibiz-template/model-helper": "0.7.41-alpha.118",
|
|
41
|
+
"@ibiz-template/runtime": "0.7.41-alpha.118",
|
|
42
42
|
"@ibiz-template/theme": "0.7.39",
|
|
43
|
-
"@ibiz-template/vue3-util": "0.7.41-alpha.
|
|
43
|
+
"@ibiz-template/vue3-util": "0.7.41-alpha.118",
|
|
44
44
|
"@ibiz-template/web-theme": "3.16.0",
|
|
45
45
|
"@ibiz/model-core": "^0.1.89",
|
|
46
46
|
"@imengyu/vue3-context-menu": "^1.3.5",
|
|
@@ -24,6 +24,12 @@ export class CheckBoxListEditorController extends CodeListEditorController<IChec
|
|
|
24
24
|
*/
|
|
25
25
|
rowNumber: number | undefined = undefined;
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* @description 自动选中第一个
|
|
29
|
+
* @memberof CheckBoxListEditorController
|
|
30
|
+
*/
|
|
31
|
+
public autoSelectFirstOption = false;
|
|
32
|
+
|
|
27
33
|
protected async onInit(): Promise<void> {
|
|
28
34
|
super.onInit();
|
|
29
35
|
if (this.model.appCodeListId) {
|
|
@@ -36,5 +42,10 @@ export class CheckBoxListEditorController extends CodeListEditorController<IChec
|
|
|
36
42
|
if (this.editorParams?.rownumber) {
|
|
37
43
|
this.rowNumber = Number(this.editorParams.rownumber);
|
|
38
44
|
}
|
|
45
|
+
if (this.editorParams?.autoselectfirstoption) {
|
|
46
|
+
this.autoSelectFirstOption = this.toBoolean(
|
|
47
|
+
this.editorParams.autoselectfirstoption,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
39
50
|
}
|
|
40
51
|
}
|
|
@@ -29,6 +29,7 @@ import './ibiz-checkbox-list.scss';
|
|
|
29
29
|
* @editorparams {"name":"readonly","parameterType":"boolean","defaultvalue":false,"description":"设置编辑器是否为只读态"}
|
|
30
30
|
* @editorparams {name:rendermode,parameterType:'default' | 'button',defaultvalue:'default',description:默认绘制选项框列表,当值为 'button' 时绘制按钮列表}
|
|
31
31
|
* @editorparams {name:isbtnroundcorner,parameterType:boolean,defaultvalue:false,description:设置按钮是否显示圆角}
|
|
32
|
+
* @editorparams {name:autoselectfirstoption,parameterType:boolean,defaultvalue:false,description:编辑器无值时,自动选中第一个数据}
|
|
32
33
|
* @ignoreprops autoFocus | overflowMode
|
|
33
34
|
* @ignoreemits blur | focus | enter
|
|
34
35
|
*/
|
|
@@ -108,13 +109,40 @@ export const IBizCheckboxList = defineComponent({
|
|
|
108
109
|
return false;
|
|
109
110
|
});
|
|
110
111
|
|
|
112
|
+
// 值分隔符
|
|
113
|
+
const valueSeparator = codeList?.valueSeparator || ',';
|
|
114
|
+
|
|
111
115
|
// 代码表数据
|
|
112
116
|
const items = ref<readonly CodeListItem[]>([]);
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @description 自动选择第一条数据
|
|
120
|
+
* @returns {*} {void}
|
|
121
|
+
*/
|
|
122
|
+
const autoSelectFirstOption = (): void => {
|
|
123
|
+
const item = items.value[0];
|
|
124
|
+
if (!c.autoSelectFirstOption || props.value || !item) return;
|
|
125
|
+
const selections = c.allItems
|
|
126
|
+
? items.value
|
|
127
|
+
.filter(_item => _item.value !== c.allItemsValue)
|
|
128
|
+
.map(_item => _item.value)
|
|
129
|
+
: [item.value];
|
|
130
|
+
emit(
|
|
131
|
+
'change',
|
|
132
|
+
c.model.valueType === 'SIMPLES'
|
|
133
|
+
? selections
|
|
134
|
+
: selections.join(valueSeparator),
|
|
135
|
+
undefined,
|
|
136
|
+
true,
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
113
140
|
watch(
|
|
114
141
|
() => props.data,
|
|
115
142
|
newVal => {
|
|
116
143
|
c.loadCodeList(newVal).then(_codeList => {
|
|
117
144
|
items.value = c.handleCodeListAllItems(_codeList);
|
|
145
|
+
autoSelectFirstOption();
|
|
118
146
|
});
|
|
119
147
|
},
|
|
120
148
|
{
|
|
@@ -146,12 +174,6 @@ export const IBizCheckboxList = defineComponent({
|
|
|
146
174
|
|
|
147
175
|
useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
|
|
148
176
|
|
|
149
|
-
// 值分隔符
|
|
150
|
-
let valueSeparator = ',';
|
|
151
|
-
if (codeList && codeList.valueSeparator) {
|
|
152
|
-
valueSeparator = codeList.valueSeparator;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
177
|
const { useInFocusAndBlur, useInValueChange } = useAutoFocusBlur(
|
|
156
178
|
props,
|
|
157
179
|
emit,
|
|
@@ -207,8 +207,11 @@ export const IBizDateRangeSelect = defineComponent({
|
|
|
207
207
|
v-model={unitValue.value}
|
|
208
208
|
onChange={unitChange}
|
|
209
209
|
class={ns.em('date-unit', 'editor-select')}
|
|
210
|
-
popper-class={[
|
|
211
|
-
|
|
210
|
+
popper-class={[
|
|
211
|
+
ns.b('date-unit-popper'),
|
|
212
|
+
semanticClass('editor.dateUnit.popup'),
|
|
213
|
+
]}
|
|
214
|
+
popper-style={semanticStyle('editor.dateUnit.popup')}
|
|
212
215
|
>
|
|
213
216
|
{units.map((item: IData) => {
|
|
214
217
|
return (
|
|
@@ -409,11 +412,11 @@ export const IBizDateRangeSelect = defineComponent({
|
|
|
409
412
|
trigger='click'
|
|
410
413
|
width='240px'
|
|
411
414
|
popper-class={[
|
|
412
|
-
ns.b('popper'),
|
|
415
|
+
ns.b('date-type-popper'),
|
|
413
416
|
ns.b('date-range-select'),
|
|
414
|
-
semanticClass('editor.popup'),
|
|
417
|
+
semanticClass('editor.dateType.popup'),
|
|
415
418
|
]}
|
|
416
|
-
popper-style={semanticStyle('editor.popup')}
|
|
419
|
+
popper-style={semanticStyle('editor.dateType.popup')}
|
|
417
420
|
>
|
|
418
421
|
{{
|
|
419
422
|
reference: () => {
|
|
@@ -272,7 +272,9 @@ export const IBizDropdown = defineComponent({
|
|
|
272
272
|
if (c.multiple) {
|
|
273
273
|
const value =
|
|
274
274
|
c.allItems && !hasChildren.value
|
|
275
|
-
?
|
|
275
|
+
? items.value
|
|
276
|
+
.filter(_item => _item.value !== c.allItemsValue)
|
|
277
|
+
.map(_item => _item.value)
|
|
276
278
|
: [item.value];
|
|
277
279
|
emit(
|
|
278
280
|
'change',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ref, Ref, defineComponent, watch, onMounted } from 'vue';
|
|
2
|
+
import { recursiveIterate } from '@ibiz-template/core';
|
|
2
3
|
import {
|
|
3
4
|
useNamespace,
|
|
4
5
|
getEditorEmits,
|
|
@@ -18,6 +19,7 @@ import './ibiz-tree-picker.scss';
|
|
|
18
19
|
* @primary
|
|
19
20
|
* @editorparams {"name":"showtoolbar","parameterType":"boolean","defaultvalue":"false","description":"是否显示顶部工具栏。默认不显示,若此值为 true,则会在顶部呈现快捷工具栏,该工具栏可用于执行全选、取消全选、全展开以及全收起操作"}
|
|
20
21
|
* @editorparams {"name":"valuetype","parameterType":"string","description":"编辑器的值类型"}
|
|
22
|
+
* @editorparams {name:autoselectfirstoption,parameterType:boolean,defaultvalue:false,description:编辑器无值时,自动选中第一个数据}
|
|
21
23
|
* @ignoreprops autoFocus | overflowMode
|
|
22
24
|
* @ignoreemits blur | focus | enter | infoTextChange
|
|
23
25
|
*/
|
|
@@ -156,6 +158,30 @@ export const IBizTreePicker = defineComponent({
|
|
|
156
158
|
return list;
|
|
157
159
|
};
|
|
158
160
|
|
|
161
|
+
/**
|
|
162
|
+
* @description 自动选中第一项
|
|
163
|
+
*/
|
|
164
|
+
const autoSelectFirstOption = (): void => {
|
|
165
|
+
const item = items.value[0];
|
|
166
|
+
if (!c.autoSelectFirstOption || props.value || !item) return;
|
|
167
|
+
const selections: string[] = [];
|
|
168
|
+
recursiveIterate(
|
|
169
|
+
{ children: [item] },
|
|
170
|
+
_item => {
|
|
171
|
+
selections.push(_item.value);
|
|
172
|
+
},
|
|
173
|
+
{ childrenFields: ['children'] },
|
|
174
|
+
);
|
|
175
|
+
emit(
|
|
176
|
+
'change',
|
|
177
|
+
c.model.valueType === 'SIMPLES'
|
|
178
|
+
? selections
|
|
179
|
+
: selections.join(valueSeparator),
|
|
180
|
+
undefined,
|
|
181
|
+
true,
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
|
|
159
185
|
/**
|
|
160
186
|
* 加载代码表后续处理
|
|
161
187
|
*
|
|
@@ -179,6 +205,7 @@ export const IBizTreePicker = defineComponent({
|
|
|
179
205
|
break;
|
|
180
206
|
}
|
|
181
207
|
}
|
|
208
|
+
autoSelectFirstOption();
|
|
182
209
|
};
|
|
183
210
|
|
|
184
211
|
/** 加载代码表数据 */
|
|
@@ -214,7 +241,7 @@ export const IBizTreePicker = defineComponent({
|
|
|
214
241
|
}
|
|
215
242
|
defaultCheckedKeys.value = val.filter(_key =>
|
|
216
243
|
codeListItems.value.find(
|
|
217
|
-
(item: IData) => item.value === _key && item.
|
|
244
|
+
(item: IData) => item.value === _key && !item.children,
|
|
218
245
|
),
|
|
219
246
|
);
|
|
220
247
|
}
|
|
@@ -35,6 +35,7 @@ import './ibiz-virtualized-list.scss';
|
|
|
35
35
|
* @editorparams {name:itemstext,parameterType:string,defaultvalue:'全部',description:下拉列表框全部项文本}
|
|
36
36
|
* @editorparams {"name":"valuetype","parameterType":"string","description":"编辑器的值类型"}
|
|
37
37
|
* @editorparams {"name":"readonly","parameterType":"boolean","defaultvalue":false,"description":"设置编辑器是否为只读态"}
|
|
38
|
+
* @editorparams {name:autoselectfirstoption,parameterType:boolean,defaultvalue:false,description:编辑器无值时,自动选中第一个数据}
|
|
38
39
|
* @ignoreprops overflowMode
|
|
39
40
|
*/
|
|
40
41
|
export const IBizVirtualizedList = defineComponent({
|
|
@@ -185,6 +186,10 @@ export const IBizVirtualizedList = defineComponent({
|
|
|
185
186
|
// 代码项值是否为数值
|
|
186
187
|
const codeItemValueNumber = ref(false);
|
|
187
188
|
|
|
189
|
+
const { getSelection, getSelectionValue } = useCodeListSelection(
|
|
190
|
+
c.allItemsValue,
|
|
191
|
+
);
|
|
192
|
+
|
|
188
193
|
// 处理树数据
|
|
189
194
|
const handleTreeNodes = (nodes: readonly IData[]): IData[] => {
|
|
190
195
|
if (nodes.length === 0) {
|
|
@@ -221,6 +226,31 @@ export const IBizVirtualizedList = defineComponent({
|
|
|
221
226
|
return list;
|
|
222
227
|
};
|
|
223
228
|
|
|
229
|
+
/**
|
|
230
|
+
* @description 自动选中第一项
|
|
231
|
+
*/
|
|
232
|
+
const autoSelectFirstOption = (): void => {
|
|
233
|
+
const item = items.value[0];
|
|
234
|
+
if (!c.autoSelectFirstOption || props.value || !item) return;
|
|
235
|
+
if (c.multiple) {
|
|
236
|
+
const value =
|
|
237
|
+
c.allItems && !hasChildren.value
|
|
238
|
+
? getSelectionValue(item.value).map(v => `${v}`)
|
|
239
|
+
: [item.value];
|
|
240
|
+
emit(
|
|
241
|
+
'change',
|
|
242
|
+
c.model.valueType === 'SIMPLES' ? value : value.join(','),
|
|
243
|
+
undefined,
|
|
244
|
+
true,
|
|
245
|
+
);
|
|
246
|
+
} else if (editorItems && editorItems.length > 0) {
|
|
247
|
+
emit('change', item.value, editorItems[0].id!, true);
|
|
248
|
+
emit('change', item.text, undefined, true);
|
|
249
|
+
} else {
|
|
250
|
+
emit('change', item.value, undefined, true);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
224
254
|
/**
|
|
225
255
|
* 加载代码表后续处理
|
|
226
256
|
*
|
|
@@ -253,6 +283,7 @@ export const IBizVirtualizedList = defineComponent({
|
|
|
253
283
|
break;
|
|
254
284
|
}
|
|
255
285
|
}
|
|
286
|
+
autoSelectFirstOption();
|
|
256
287
|
};
|
|
257
288
|
|
|
258
289
|
// 加载代码表数据与后续操作
|
|
@@ -324,10 +355,6 @@ export const IBizVirtualizedList = defineComponent({
|
|
|
324
355
|
return list.find(item => item.value === value);
|
|
325
356
|
};
|
|
326
357
|
|
|
327
|
-
const { getSelection, getSelectionValue } = useCodeListSelection(
|
|
328
|
-
c.allItemsValue,
|
|
329
|
-
);
|
|
330
|
-
|
|
331
358
|
// 当前值
|
|
332
359
|
const curValue = computed({
|
|
333
360
|
get() {
|
|
@@ -36,6 +36,7 @@ import './ibiz-list-box.scss';
|
|
|
36
36
|
* @editorparams {name:allitems,parameterType:boolean,defaultvalue:false,description:列表框是否启用全部项}
|
|
37
37
|
* @editorparams {name:itemstext,parameterType:string,defaultvalue:'全部',description:列表框全部项文本}
|
|
38
38
|
* @editorparams {"name":"readonly","parameterType":"boolean","defaultvalue":false,"description":"设置编辑器是否为只读态"}
|
|
39
|
+
* @editorparams {name:autoselectfirstoption,parameterType:boolean,defaultvalue:false,description:编辑器无值时,自动选中第一个数据}
|
|
39
40
|
* @ignoreprops autoFocus | overflowMode
|
|
40
41
|
* @ignoreemits blur | focus | enter | infoTextChange
|
|
41
42
|
*/
|
|
@@ -124,9 +125,39 @@ export const IBizListBox = defineComponent({
|
|
|
124
125
|
|
|
125
126
|
const editorType = editorModel.editorType;
|
|
126
127
|
|
|
128
|
+
// 值分隔符
|
|
129
|
+
const valueSeparator = codeList?.valueSeparator || ',';
|
|
130
|
+
|
|
127
131
|
// 代码表数据(LISTBOX) or AC请求数据(LISTBOXPICKUP)
|
|
128
132
|
const items = ref<readonly IData[]>([]);
|
|
129
133
|
|
|
134
|
+
/**
|
|
135
|
+
* @description 自动选择第一条数据
|
|
136
|
+
* @returns {*} {void}
|
|
137
|
+
*/
|
|
138
|
+
const autoSelectFirstOption = (): void => {
|
|
139
|
+
const item = items.value[0];
|
|
140
|
+
if (!c.autoSelectFirstOption || props.value || !item) return;
|
|
141
|
+
let value: string | undefined | string[];
|
|
142
|
+
if (multiple) {
|
|
143
|
+
const selections = (c as ListBoxEditorController).allItems
|
|
144
|
+
? items.value
|
|
145
|
+
.filter(
|
|
146
|
+
_item =>
|
|
147
|
+
_item.value !== (c as ListBoxEditorController).allItemsValue,
|
|
148
|
+
)
|
|
149
|
+
.map(_item => _item.value)
|
|
150
|
+
: [item.value];
|
|
151
|
+
value =
|
|
152
|
+
c.model.valueType === 'SIMPLES'
|
|
153
|
+
? selections
|
|
154
|
+
: selections.join(valueSeparator);
|
|
155
|
+
} else {
|
|
156
|
+
value = item.value;
|
|
157
|
+
}
|
|
158
|
+
emit('change', value, undefined, true);
|
|
159
|
+
};
|
|
160
|
+
|
|
130
161
|
// 更新列表框选项
|
|
131
162
|
const loadListBoxItems = async () => {
|
|
132
163
|
if (Object.is('LISTBOX', editorType)) {
|
|
@@ -134,9 +165,10 @@ export const IBizListBox = defineComponent({
|
|
|
134
165
|
controller.loadCodeList(props.data).then(_codeList => {
|
|
135
166
|
if (multiple) {
|
|
136
167
|
items.value = controller.handleCodeListAllItems(_codeList);
|
|
137
|
-
|
|
168
|
+
} else {
|
|
169
|
+
items.value = _codeList;
|
|
138
170
|
}
|
|
139
|
-
|
|
171
|
+
autoSelectFirstOption();
|
|
140
172
|
});
|
|
141
173
|
} else if (Object.is('LISTBOXPICKUP', editorType)) {
|
|
142
174
|
const controller = c as ListBoxPickerEditorController;
|
|
@@ -147,12 +179,22 @@ export const IBizListBox = defineComponent({
|
|
|
147
179
|
value: item[controller.keyName],
|
|
148
180
|
text: item[controller.textName],
|
|
149
181
|
}));
|
|
182
|
+
autoSelectFirstOption();
|
|
150
183
|
}
|
|
151
184
|
}
|
|
152
185
|
}
|
|
153
186
|
};
|
|
154
187
|
|
|
155
|
-
|
|
188
|
+
watch(
|
|
189
|
+
() => props.data,
|
|
190
|
+
() => {
|
|
191
|
+
loadListBoxItems();
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
immediate: true,
|
|
195
|
+
deep: true,
|
|
196
|
+
},
|
|
197
|
+
);
|
|
156
198
|
|
|
157
199
|
const fn = (data: CodeListItem[] | undefined) => {
|
|
158
200
|
if (data) {
|
|
@@ -185,12 +227,6 @@ export const IBizListBox = defineComponent({
|
|
|
185
227
|
c.model.valueType,
|
|
186
228
|
);
|
|
187
229
|
|
|
188
|
-
// 值分隔符
|
|
189
|
-
let valueSeparator = ',';
|
|
190
|
-
if (codeList && codeList.valueSeparator) {
|
|
191
|
-
valueSeparator = codeList.valueSeparator;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
230
|
const { getSelection, getSelectionValue } = useCodeListSelection(
|
|
195
231
|
Object.is('LISTBOX', editorType)
|
|
196
232
|
? (c as ListBoxEditorController).allItemsValue
|
|
@@ -16,11 +16,22 @@ export class ListBoxEditorController extends CodeListEditorController<IListBox>
|
|
|
16
16
|
*/
|
|
17
17
|
codeList: IAppCodeList | undefined = undefined;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @description 自动选中第一个
|
|
21
|
+
* @memberof ListBoxEditorController
|
|
22
|
+
*/
|
|
23
|
+
public autoSelectFirstOption = false;
|
|
24
|
+
|
|
19
25
|
protected async onInit(): Promise<void> {
|
|
20
26
|
super.onInit();
|
|
21
27
|
if (this.model.appCodeListId) {
|
|
22
28
|
const app = await ibiz.hub.getApp(this.context.srfappid);
|
|
23
29
|
this.codeList = app.codeList.getCodeList(this.model.appCodeListId);
|
|
24
30
|
}
|
|
31
|
+
if (this.editorParams?.autoselectfirstoption) {
|
|
32
|
+
this.autoSelectFirstOption = this.toBoolean(
|
|
33
|
+
this.editorParams.autoselectfirstoption,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
25
36
|
}
|
|
26
37
|
}
|
|
@@ -48,8 +48,19 @@ export class ListBoxPickerEditorController extends EditorController<IListBoxPick
|
|
|
48
48
|
*/
|
|
49
49
|
acItemProvider?: IAcItemProvider;
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* @description 自动选中第一个
|
|
53
|
+
* @memberof ListBoxPickerEditorController
|
|
54
|
+
*/
|
|
55
|
+
public autoSelectFirstOption = false;
|
|
56
|
+
|
|
51
57
|
protected async onInit(): Promise<void> {
|
|
52
58
|
super.onInit();
|
|
59
|
+
if (this.editorParams?.autoselectfirstoption) {
|
|
60
|
+
this.autoSelectFirstOption = this.toBoolean(
|
|
61
|
+
this.editorParams.autoselectfirstoption,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
53
64
|
if (this.model.editorType === 'LISTBOXPICKUP') {
|
|
54
65
|
if (this.model.appDEDataSetId) {
|
|
55
66
|
this.interfaceName = this.model.appDEDataSetId;
|
|
@@ -25,6 +25,7 @@ import './ibiz-radio.scss';
|
|
|
25
25
|
* @editorparams {name:isbtnroundcorner,parameterType:boolean,defaultvalue:false,description:设置按钮是否显示圆角}
|
|
26
26
|
* @editorparams {name:itemwidth,parameterType:number,description:设置单选框列表的项宽度}
|
|
27
27
|
* @editorparams {"name":"readonly","parameterType":"boolean","defaultvalue":false,"description":"设置编辑器是否为只读态"}
|
|
28
|
+
* @editorparams {name:autoselectfirstoption,parameterType:boolean,defaultvalue:false,description:编辑器无值时,自动选中第一个数据}
|
|
28
29
|
* @ignoreprops autoFocus | overflowMode
|
|
29
30
|
* @ignoreemits blur | focus | enter
|
|
30
31
|
*/
|
|
@@ -117,11 +118,23 @@ export const IBizRadio = defineComponent({
|
|
|
117
118
|
|
|
118
119
|
// 代码表
|
|
119
120
|
const items = ref<readonly IData[]>([]);
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @description 自动选择第一条数据
|
|
124
|
+
* @returns {*} {void}
|
|
125
|
+
*/
|
|
126
|
+
const autoSelectFirstOption = (): void => {
|
|
127
|
+
const item = items.value[0];
|
|
128
|
+
if (!c.autoSelectFirstOption || props.value || !item) return;
|
|
129
|
+
emit('change', item.value, undefined, true);
|
|
130
|
+
};
|
|
131
|
+
|
|
120
132
|
watch(
|
|
121
133
|
() => props.data,
|
|
122
134
|
newVal => {
|
|
123
135
|
c.loadCodeList(newVal).then(_codeList => {
|
|
124
136
|
items.value = _codeList;
|
|
137
|
+
autoSelectFirstOption();
|
|
125
138
|
});
|
|
126
139
|
},
|
|
127
140
|
{
|
|
@@ -16,6 +16,12 @@ export class RadioButtonListEditorController extends CodeListEditorController<IR
|
|
|
16
16
|
*/
|
|
17
17
|
rowNumber: number | undefined = undefined;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @description 自动选中第一个
|
|
21
|
+
* @memberof RadioButtonListEditorController
|
|
22
|
+
*/
|
|
23
|
+
public autoSelectFirstOption = false;
|
|
24
|
+
|
|
19
25
|
protected async onInit(): Promise<void> {
|
|
20
26
|
super.onInit();
|
|
21
27
|
if (this.editorParams?.rowNumber) {
|
|
@@ -24,5 +30,10 @@ export class RadioButtonListEditorController extends CodeListEditorController<IR
|
|
|
24
30
|
if (this.editorParams?.rownumber) {
|
|
25
31
|
this.rowNumber = Number(this.editorParams.rownumber);
|
|
26
32
|
}
|
|
33
|
+
if (this.editorParams?.autoselectfirstoption) {
|
|
34
|
+
this.autoSelectFirstOption = this.toBoolean(
|
|
35
|
+
this.editorParams.autoselectfirstoption,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
27
38
|
}
|
|
28
39
|
}
|