From 7d647f5580a001a6fc459e7be009a6efa0abe21d Mon Sep 17 00:00:00 2001 From: qkiroc Date: Wed, 19 Oct 2022 11:59:36 +0800 Subject: [PATCH] =?UTF-8?q?amis-saas-7517=20=E6=9B=B4=E6=96=B0=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7917ba1db94159614ea8c4bde31b415a27f42eda --- .../amis-editor/src/component/BaseControl.ts | 8 +++--- packages/amis-editor/src/plugin/Avatar.tsx | 8 +++--- .../amis-editor/src/plugin/Breadcrumb.tsx | 8 +++--- .../amis-editor/src/plugin/CollapseGroup.tsx | 8 +++--- packages/amis-editor/src/plugin/Nav.tsx | 8 +++--- packages/amis-editor/src/tpl/common.tsx | 25 +++---------------- 6 files changed, 18 insertions(+), 47 deletions(-) diff --git a/packages/amis-editor/src/component/BaseControl.ts b/packages/amis-editor/src/component/BaseControl.ts index f7dba779f..5a0606524 100644 --- a/packages/amis-editor/src/component/BaseControl.ts +++ b/packages/amis-editor/src/component/BaseControl.ts @@ -463,12 +463,10 @@ export function remarkTpl(config: { } ] }, - { + getSchemaTpl('icon', { name: 'icon', - label: '图标', - type: 'icon-picker', - className: 'fix-icon-picker-overflow' - }, + label: '图标' + }), { name: 'className', label: 'CSS 类名', diff --git a/packages/amis-editor/src/plugin/Avatar.tsx b/packages/amis-editor/src/plugin/Avatar.tsx index 548ebed68..85a4b3b08 100644 --- a/packages/amis-editor/src/plugin/Avatar.tsx +++ b/packages/amis-editor/src/plugin/Avatar.tsx @@ -96,13 +96,11 @@ export class AvatarPlugin extends BasePlugin { className: 'ae-ExtendMore mb-3', body: [ // 图标 - { - label: '图标', + getSchemaTpl('icon', { name: 'icon', - type: 'icon-picker', - className: 'fix-icon-picker-overflow', + label: '图标', visibleOn: 'data.showtype === "icon"' - }, + }), // 图片 getSchemaTpl('valueFormula', { rendererSchema: { diff --git a/packages/amis-editor/src/plugin/Breadcrumb.tsx b/packages/amis-editor/src/plugin/Breadcrumb.tsx index 48d2fe2e7..bc50ccb4c 100644 --- a/packages/amis-editor/src/plugin/Breadcrumb.tsx +++ b/packages/amis-editor/src/plugin/Breadcrumb.tsx @@ -73,12 +73,10 @@ export class BreadcrumbPlugin extends BasePlugin { name: 'href', placeholder: '链接' }, - { + getSchemaTpl('icon', { name: 'icon', - label: '图标', - type: 'icon-picker', - className: 'fix-icon-picker-overflow' - } + label: '图标' + }) ] } ] diff --git a/packages/amis-editor/src/plugin/CollapseGroup.tsx b/packages/amis-editor/src/plugin/CollapseGroup.tsx index f8214e00f..017465348 100644 --- a/packages/amis-editor/src/plugin/CollapseGroup.tsx +++ b/packages/amis-editor/src/plugin/CollapseGroup.tsx @@ -96,18 +96,16 @@ export class CollapseGroupPlugin extends BasePlugin { autoFocus: false, form: { body: [ - { - label: '图标', + getSchemaTpl('icon', { name: 'expandIcon', - type: 'icon-picker', - className: 'fix-icon-picker-overflow', + label: '图标', pipeIn: (value: any) => value?.icon, pipeOut: (value: any) => ({ type: 'icon', vendor: '', icon: value }) - } + }) ] }, pipeIn: (value: string) => { diff --git a/packages/amis-editor/src/plugin/Nav.tsx b/packages/amis-editor/src/plugin/Nav.tsx index 57bcb7fb4..28a6ffe25 100644 --- a/packages/amis-editor/src/plugin/Nav.tsx +++ b/packages/amis-editor/src/plugin/Nav.tsx @@ -66,12 +66,10 @@ export class NavPlugin extends BasePlugin { required: true }, - { - type: 'icon-picker', + getSchemaTpl('icon', { name: 'icon', - label: '图标', - className: 'fix-icon-picker-overflow' - }, + label: '图标' + }), { type: 'group', diff --git a/packages/amis-editor/src/tpl/common.tsx b/packages/amis-editor/src/tpl/common.tsx index e2e101d2c..93264f99c 100644 --- a/packages/amis-editor/src/tpl/common.tsx +++ b/packages/amis-editor/src/tpl/common.tsx @@ -509,9 +509,8 @@ setSchemaTpl('expression', { setSchemaTpl('icon', { label: '图标', - type: 'icon-picker', + type: 'icon-select', name: 'icon', - className: 'fix-icon-picker-overflow', placeholder: '点击选择图标', clearable: true, description: '' @@ -1072,31 +1071,13 @@ setSchemaTpl( 'iconLink', (schema: {name: 'icon' | 'rightIcon'; visibleOn: boolean}) => { const {name, visibleOn} = schema; - return { + return getSchemaTpl('icon', { name: name, visibleOn, label: '图标', - type: 'icon-picker', - className: 'fix-icon-picker-overflow', 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: '' - }; + }); } );