form组件外观调整

This commit is contained in:
qinhaoyan 2024-02-02 13:52:40 +08:00
parent 84121a20a8
commit a6d6a68ad1
6 changed files with 44 additions and 42 deletions

View File

@ -1086,7 +1086,7 @@ export class FormPlugin extends BasePlugin {
title: '外观', title: '外观',
body: getSchemaTpl('collapseGroup', [ body: getSchemaTpl('collapseGroup', [
{ {
title: '布局', title: '基本',
body: [ body: [
getSchemaTpl('formItemMode', { getSchemaTpl('formItemMode', {
isForm: true, isForm: true,
@ -1117,12 +1117,7 @@ export class FormPlugin extends BasePlugin {
return undefined; return undefined;
} }
} }
} },
]
},
{
title: '其他',
body: [
getSchemaTpl('switch', { getSchemaTpl('switch', {
name: 'wrapWithPanel', name: 'wrapWithPanel',
label: tipedLabel( label: tipedLabel(
@ -1141,33 +1136,40 @@ export class FormPlugin extends BasePlugin {
}) })
] ]
}, },
...getSchemaTpl('theme:common', { getSchemaTpl('theme:base', {
classname: 'formControlClassName', classname: 'panelControlClassName',
baseTitle: 'form样式', title: 'Panel样式',
exclude: ['layout'], visibleOn: isWrapped
extra: [
getSchemaTpl('theme:base', {
classname: 'panelControlClassName',
title: 'Panel样式',
visibleOn: isWrapped
}),
getSchemaTpl('theme:base', {
classname: 'headerControlClassName',
title: '标题区样式',
visibleOn: isWrapped
}),
getSchemaTpl('theme:base', {
classname: 'bodyControlClassName',
title: '内容区样式',
visibleOn: isWrapped
}),
getSchemaTpl('theme:base', {
classname: 'actionsControlClassName',
title: '操作区样式',
visibleOn: isWrapped
})
]
}), }),
getSchemaTpl('theme:base', {
classname: 'headerControlClassName',
title: '标题区样式',
visibleOn: isWrapped
}),
getSchemaTpl('theme:base', {
classname: 'bodyControlClassName',
title: '内容区样式',
visibleOn: isWrapped
}),
getSchemaTpl('theme:base', {
classname: 'actionsControlClassName',
title: '操作区样式',
visibleOn: isWrapped
}),
getSchemaTpl('theme:base', {
classname: 'formControlClassName',
title: '表单样式',
hiddenOn: isWrapped
}),
{
title: '自定义样式',
body: [
{
type: 'theme-cssCode',
label: false
}
]
},
/** */ /** */
getSchemaTpl('style:classNames', { getSchemaTpl('style:classNames', {
isFormItem: false, isFormItem: false,

View File

@ -118,7 +118,8 @@ setSchemaTpl(
body: [ body: [
getSchemaTpl('leftFixed'), getSchemaTpl('leftFixed'),
getSchemaTpl('leftRate'), getSchemaTpl('leftRate'),
getSchemaTpl('labelAlign') getSchemaTpl('labelAlign'),
{}
] ]
}) })
]; ];

View File

@ -591,6 +591,7 @@ setSchemaTpl(
classname?: string; classname?: string;
title?: string; title?: string;
hiddenOn?: string; hiddenOn?: string;
visibleOn?: string;
hidePaddingAndMargin?: boolean; hidePaddingAndMargin?: boolean;
}) => { }) => {
const { const {
@ -599,6 +600,7 @@ setSchemaTpl(
classname = 'baseControlClassName', classname = 'baseControlClassName',
title = '基本样式', title = '基本样式',
hiddenOn, hiddenOn,
visibleOn,
hidePaddingAndMargin hidePaddingAndMargin
} = option; } = option;
const curHidePaddingAndMargin = hidePaddingAndMargin ?? false; const curHidePaddingAndMargin = hidePaddingAndMargin ?? false;
@ -614,11 +616,6 @@ setSchemaTpl(
name: `themeCss.${classname}.radius:${state}`, name: `themeCss.${classname}.radius:${state}`,
state state
}), }),
getSchemaTpl('theme:paddingAndMargin', {
visibleOn: visibleOn,
name: `themeCss.${classname}.padding-and-margin:${state}`,
state
}),
!curHidePaddingAndMargin !curHidePaddingAndMargin
? getSchemaTpl('theme:paddingAndMargin', { ? getSchemaTpl('theme:paddingAndMargin', {
visibleOn: visibleOn, visibleOn: visibleOn,
@ -690,7 +687,8 @@ setSchemaTpl(
title, title,
collapsed, collapsed,
body: styles, body: styles,
hiddenOn hiddenOn,
visibleOn
}; };
} }
); );

View File

@ -282,7 +282,7 @@ export class ParseThemeData {
// 解析组件通用方法 // 解析组件通用方法
parseComponentCommon(component: any) { parseComponentCommon(component: any) {
if (component.token) { if (component.token && component.body) {
// 有token时结束递归 // 有token时结束递归
const token = component.token; const token = component.token;
for (let key in component.body) { for (let key in component.body) {

View File

@ -9,6 +9,7 @@ $ns: cxd-;
padding: 0 px2rem(8px); padding: 0 px2rem(8px);
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #fff;
.ThemeSelectContent-theme { .ThemeSelectContent-theme {
background-color: #f7f8fa; background-color: #f7f8fa;
border-radius: 2px; border-radius: 2px;

View File

@ -378,7 +378,7 @@
.#{$ns}NumberControl-single-unit { .#{$ns}NumberControl-single-unit {
cursor: default; cursor: default;
text-align: center; text-align: center;
min-width: unset; min-width: unset !important;
padding: 0 var(--inputNumber-base-default-unit-paddingLeft); padding: 0 var(--inputNumber-base-default-unit-paddingLeft);
} }
} }