fix: stabilize admin ui and agent chat model fallback

This commit is contained in:
2026-06-14 10:32:47 +08:00
parent 58ce877e64
commit c293cb5e3b
4 changed files with 166 additions and 9 deletions
@@ -194,21 +194,24 @@ function initComponentAdapter() {
),
Checkbox: ElCheckbox,
CheckboxGroup: (props, { attrs, slots }) => {
const mergedProps = { ...props, ...attrs } as Recordable<any>;
let defaultSlot;
if (Reflect.has(slots, 'default')) {
defaultSlot = slots.default;
} else {
const { options, isButton } = attrs;
const { options, isButton } = mergedProps;
if (Array.isArray(options)) {
defaultSlot = () =>
options.map((option) =>
h(isButton ? ElCheckboxButton : ElCheckbox, option),
h(isButton ? ElCheckboxButton : ElCheckbox, option, () =>
option.label ?? option.value,
),
);
}
}
return h(
ElCheckboxGroup,
{ ...props, ...attrs },
mergedProps,
{ ...slots, default: defaultSlot },
);
},
@@ -232,21 +235,24 @@ function initComponentAdapter() {
}),
InputNumber: withDefaultPlaceholder(ElInputNumber, 'input'),
RadioGroup: (props, { attrs, slots }) => {
const mergedProps = { ...props, ...attrs } as Recordable<any>;
let defaultSlot;
if (Reflect.has(slots, 'default')) {
defaultSlot = slots.default;
} else {
const { options } = attrs;
const { options, isButton } = mergedProps;
if (Array.isArray(options)) {
defaultSlot = () =>
options.map((option) =>
h(attrs.isButton ? ElRadioButton : ElRadio, option),
h(isButton ? ElRadioButton : ElRadio, option, () =>
option.label ?? option.value,
),
);
}
}
return h(
ElRadioGroup,
{ ...props, ...attrs },
mergedProps,
{ ...slots, default: defaultSlot },
);
},