From 563736b2c74eaa9a58e7440fc3df770f6d582d1c Mon Sep 17 00:00:00 2001 From: jiatianqi Date: Fri, 30 Sep 2022 10:29:51 +0800 Subject: [PATCH] =?UTF-8?q?amis-saas-7372=20=E3=80=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=B8=83=E5=B1=80=E5=88=87=E6=8D=A2select?= =?UTF-8?q?=E3=80=8D=E8=B0=83=E6=95=B4=E5=88=87=E6=8D=A2button-group-selec?= =?UTF-8?q?t=E5=88=87=E6=8D=A2=E4=B8=BA=20select?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iea605bb802c800b1bff0e2a736a2d8320704f7df --- packages/amis-editor/src/tpl/common.tsx | 64 +++++++++++---------- packages/amis-editor/src/tpl/horizontal.tsx | 2 +- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/packages/amis-editor/src/tpl/common.tsx b/packages/amis-editor/src/tpl/common.tsx index d1f2aa4fd..cfd3803c7 100644 --- a/packages/amis-editor/src/tpl/common.tsx +++ b/packages/amis-editor/src/tpl/common.tsx @@ -81,13 +81,7 @@ setSchemaTpl( }) => ({ label: '布局', name: 'mode', - type: 'button-group-select', - option: '继承', - horizontal: { - left: 2, - justify: true - }, - // className: 'w-full', + type: 'select', pipeIn: defaultValue(''), options: [ { @@ -215,7 +209,7 @@ setSchemaTpl( type: 'tabs', tabsMode: 'line', // tiled className: 'editor-prop-config-tabs', - linksClassName: 'editor-prop-config-tabs-links', + linksClassName: 'editor-prop-config-tabs-links aa', contentClassName: 'no-border editor-prop-config-tabs-cont hoverShowScrollBar', tabs: config @@ -592,12 +586,17 @@ setSchemaTpl('className', (schema: any) => { */ setSchemaTpl('combo-container', (config: SchemaObject) => { if (isObject(config)) { - const itemsWrapperClassName = - ['input-kv', 'combo'].includes((config as any).type) && - 'ae-Combo-items ' + ((config as any).itemsWrapperClassName ?? ''); + let itemsWrapperClassName; + let itemClassName; + if (['input-kv', 'combo'].includes((config as any).type)) { + itemsWrapperClassName = + 'ae-Combo-items ' + ((config as any).itemsWrapperClassName ?? ''); + itemClassName = 'ae-Combo-item ' + ((config as any).itemClassName ?? ''); + } return { ...(config as any), - ...(itemsWrapperClassName ? {itemsWrapperClassName} : {}) + ...(itemsWrapperClassName ? {itemsWrapperClassName} : {}), + ...(itemClassName ? {itemClassName} : {}) }; } return config; @@ -686,15 +685,15 @@ setSchemaTpl('visible', { expressionName: 'visibleOn' }); - // 新版配置面板兼容 [可见] 状态 setSchemaTpl('newVisible', { - type: 'ae-StatusControl', - label: '可见', - mode: 'normal', - name: 'visible', - expressionName: 'visibleOn', - visibleOn:"data.visible || data.visible === false || data.visibleOn !== undefined" + type: 'ae-StatusControl', + label: '可见', + mode: 'normal', + name: 'visible', + expressionName: 'visibleOn', + visibleOn: + 'data.visible || data.visible === false || data.visibleOn !== undefined' }); setSchemaTpl('hidden', { @@ -1040,7 +1039,7 @@ setSchemaTpl('app-page-args', { type: 'ae-DataMappingControl', name: 'params', label: '页面参数', - schema: {"type": "object", "properties":{}}, + schema: {type: 'object', properties: {}}, mode: 'horizontal' }); @@ -1061,15 +1060,18 @@ setSchemaTpl( } ); -setSchemaTpl('iconLink', (schema: {name: 'icon' | 'rightIcon', visibleOn: boolean}) => { - const {name, visibleOn} = schema; - return { - name: name, - visibleOn, - label: '图标', - type: 'icon-picker', - placeholder: '点击选择图标', - clearable: true, - description: '' +setSchemaTpl( + 'iconLink', + (schema: {name: 'icon' | 'rightIcon'; visibleOn: boolean}) => { + const {name, visibleOn} = schema; + return { + name: name, + visibleOn, + label: '图标', + type: 'icon-picker', + placeholder: '点击选择图标', + clearable: true, + description: '' + }; } -}); +); diff --git a/packages/amis-editor/src/tpl/horizontal.tsx b/packages/amis-editor/src/tpl/horizontal.tsx index 1583be9cc..a9d5913c6 100644 --- a/packages/amis-editor/src/tpl/horizontal.tsx +++ b/packages/amis-editor/src/tpl/horizontal.tsx @@ -63,7 +63,7 @@ setSchemaTpl( (config: {visibleOn: string; [propName: string]: any}) => { return [ { - type: 'button-group-select', + type: 'select', label: '标题宽度', name: 'horizontal', options: [