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 },
);
},
+46
View File
@@ -16,6 +16,52 @@ import { initMessageAdapter } from './adapter/message';
import { setupElementPlus } from './plugins/element-plus';
import { router } from './router';
import 'element-plus/theme-chalk/base.css';
import 'element-plus/theme-chalk/dark/css-vars.css';
import 'element-plus/theme-chalk/el-overlay.css';
import 'element-plus/theme-chalk/el-popper.css';
import 'element-plus/theme-chalk/el-icon.css';
import 'element-plus/theme-chalk/el-button.css';
import 'element-plus/theme-chalk/el-button-group.css';
import 'element-plus/theme-chalk/el-checkbox.css';
import 'element-plus/theme-chalk/el-checkbox-button.css';
import 'element-plus/theme-chalk/el-checkbox-group.css';
import 'element-plus/theme-chalk/el-radio.css';
import 'element-plus/theme-chalk/el-radio-button.css';
import 'element-plus/theme-chalk/el-radio-group.css';
import 'element-plus/theme-chalk/el-input.css';
import 'element-plus/theme-chalk/el-input-number.css';
import 'element-plus/theme-chalk/el-select.css';
import 'element-plus/theme-chalk/el-select-v2.css';
import 'element-plus/theme-chalk/el-select-dropdown.css';
import 'element-plus/theme-chalk/el-select-dropdown-v2.css';
import 'element-plus/theme-chalk/el-option.css';
import 'element-plus/theme-chalk/el-option-group.css';
import 'element-plus/theme-chalk/el-tree.css';
import 'element-plus/theme-chalk/el-tree-select.css';
import 'element-plus/theme-chalk/el-form.css';
import 'element-plus/theme-chalk/el-form-item.css';
import 'element-plus/theme-chalk/el-table.css';
import 'element-plus/theme-chalk/el-table-column.css';
import 'element-plus/theme-chalk/el-card.css';
import 'element-plus/theme-chalk/el-dialog.css';
import 'element-plus/theme-chalk/el-message.css';
import 'element-plus/theme-chalk/el-message-box.css';
import 'element-plus/theme-chalk/el-notification.css';
import 'element-plus/theme-chalk/el-popover.css';
import 'element-plus/theme-chalk/el-tooltip.css';
import 'element-plus/theme-chalk/el-scrollbar.css';
import 'element-plus/theme-chalk/el-empty.css';
import 'element-plus/theme-chalk/el-tag.css';
import 'element-plus/theme-chalk/el-pagination.css';
import 'element-plus/theme-chalk/el-loading.css';
import 'element-plus/theme-chalk/el-divider.css';
import 'element-plus/theme-chalk/el-skeleton.css';
import 'element-plus/theme-chalk/el-skeleton-item.css';
import 'element-plus/theme-chalk/el-cascader.css';
import 'element-plus/theme-chalk/el-cascader-panel.css';
import 'element-plus/theme-chalk/el-date-picker.css';
async function bootstrap(namespace: string) {
// // 设置弹窗的默认配置
// setDefaultModalProps({
+64
View File
@@ -2,6 +2,70 @@
--el-card-border-radius: var(--radius) !important;
}
html.dark {
color-scheme: dark;
}
html.dark .el-card,
html.dark .el-dialog,
html.dark .el-message-box,
html.dark .el-popover,
html.dark .el-table,
html.dark .el-table__expanded-cell {
color: hsl(var(--foreground));
background-color: hsl(var(--card));
}
html.dark .el-table {
--el-table-bg-color: hsl(var(--card));
--el-table-tr-bg-color: hsl(var(--card));
--el-table-header-bg-color: hsl(var(--background-deep));
--el-table-row-hover-bg-color: hsl(var(--accent));
--el-table-current-row-bg-color: hsl(var(--accent));
--el-table-border-color: hsl(var(--border));
--el-table-text-color: hsl(var(--foreground));
--el-table-header-text-color: hsl(var(--muted-foreground));
}
html.dark .el-table__body tr,
html.dark .el-table__body td.el-table__cell,
html.dark .el-table__fixed-right,
html.dark .el-table__fixed-left {
color: hsl(var(--foreground));
background-color: hsl(var(--card));
}
html.dark .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
background-color: hsl(var(--accent) / 0.45);
}
html.dark .el-table__body tr.hover-row > td.el-table__cell,
html.dark .el-table__body tr:hover > td.el-table__cell {
background-color: hsl(var(--accent));
}
html.dark .el-input__wrapper,
html.dark .el-select__wrapper,
html.dark .el-textarea__inner,
html.dark .el-input-number .el-input__wrapper {
color: hsl(var(--foreground));
background-color: hsl(var(--background));
box-shadow: 0 0 0 1px hsl(var(--border)) inset;
}
html.dark .el-input__inner,
html.dark .el-select__placeholder,
html.dark .el-textarea__inner {
color: hsl(var(--foreground));
}
.el-table .hidden-columns {
position: absolute !important;
z-index: -1 !important;
display: none !important;
visibility: hidden !important;
}
.el-dialog {
--el-dialog-border-radius: var(--radius) !important;
}