From 64b8026d6916b38882195c1b2cd5aba85067a042 Mon Sep 17 00:00:00 2001 From: jiatianqi Date: Mon, 14 Nov 2022 14:17:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?amis-saas-7980=20=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=A4=96=E8=A7=82=E6=A8=A1=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3ff6e0a6bb9e6dfc1a8fa99d7df74a83d26ddceb --- packages/amis-editor/src/plugin/Form/InputDate.tsx | 2 +- packages/amis-editor/src/plugin/Form/InputDateRange.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/amis-editor/src/plugin/Form/InputDate.tsx b/packages/amis-editor/src/plugin/Form/InputDate.tsx index 725bebf0c..b1bb00263 100644 --- a/packages/amis-editor/src/plugin/Form/InputDate.tsx +++ b/packages/amis-editor/src/plugin/Form/InputDate.tsx @@ -399,7 +399,7 @@ export class DateControlPlugin extends BasePlugin { size: 'md', label: '模式', mode: 'row', - value: false, + pipeIn: defaultValue(false), options: [ { label: '浮层', diff --git a/packages/amis-editor/src/plugin/Form/InputDateRange.tsx b/packages/amis-editor/src/plugin/Form/InputDateRange.tsx index 736c29eca..3301e0491 100644 --- a/packages/amis-editor/src/plugin/Form/InputDateRange.tsx +++ b/packages/amis-editor/src/plugin/Form/InputDateRange.tsx @@ -407,7 +407,7 @@ export class DateRangeControlPlugin extends BasePlugin { size: 'md', label: '模式', mode: 'row', - value: false, + pipeIn: defaultValue(false), options: [ { label: '浮层', From b7b87798289b514169a566e91664b601a3710d7d Mon Sep 17 00:00:00 2001 From: jiatianqi Date: Mon, 14 Nov 2022 14:20:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?amis-saas-7983=20[=E7=A0=94=E5=8F=91?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1]=20=E5=85=AC=E5=BC=8F=E7=BB=84=E4=BB=B6=20?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E7=BB=84=E4=BB=B6=E5=88=97=E8=A1=A8=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E4=B8=8B=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id6c2b11b15561814cc2502def06d8fe488d5a65e --- packages/amis-editor/src/plugin/Form/Formula.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/amis-editor/src/plugin/Form/Formula.tsx b/packages/amis-editor/src/plugin/Form/Formula.tsx index 210504080..d9fee4095 100644 --- a/packages/amis-editor/src/plugin/Form/Formula.tsx +++ b/packages/amis-editor/src/plugin/Form/Formula.tsx @@ -10,6 +10,7 @@ export class FormulaControlPlugin extends BasePlugin { // 组件名称 name = '公式'; isBaseComponent = true; + disabledRendererPlugin = true; icon = 'fa fa-calculator'; pluginIcon = 'formula-plugin'; description = '通过公式计算指定的变量值,并将其结果作用到指定的变量中'; From 1aafb7b1a68945d92accc7458d351e4a73024f94 Mon Sep 17 00:00:00 2001 From: jiatianqi Date: Mon, 14 Nov 2022 15:50:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?amis-saas-7980=20[=E7=A0=94=E5=8F=91?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1]=20=E6=A0=91=E9=80=89=E6=8B=A9=E3=80=81?= =?UTF-8?q?=E6=A0=91=E4=B8=8B=E6=8B=89=E8=A6=81=E5=90=88=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I89c304d57e8df94b60b1a105f2be16ad3457e047 --- .../amis-editor/src/plugin/Form/InputTree.tsx | 60 +++++++++-- .../src/plugin/Form/TreeSelect.tsx | 101 ++++++++++++------ 2 files changed, 123 insertions(+), 38 deletions(-) diff --git a/packages/amis-editor/src/plugin/Form/InputTree.tsx b/packages/amis-editor/src/plugin/Form/InputTree.tsx index 48c92f001..224b5d65c 100644 --- a/packages/amis-editor/src/plugin/Form/InputTree.tsx +++ b/packages/amis-editor/src/plugin/Form/InputTree.tsx @@ -20,8 +20,8 @@ export class TreeControlPlugin extends BasePlugin { isBaseComponent = true; icon = 'fa fa-list-alt'; pluginIcon = 'input-tree-plugin'; - description = - '树型结构来选择,可通过 options 来配置选项,也可通过 source 拉取选项'; + description = '树型结构选择,支持 [内嵌模式] 与 [浮层模式] 的外观切换'; + searchKeywords = 'tree、树下拉、树下拉框、tree-select'; docLink = '/amis/zh-CN/components/form/input-tree'; tags = ['表单项']; scaffold = { @@ -55,9 +55,13 @@ export class TreeControlPlugin extends BasePlugin { className: 'text-left', mode: 'horizontal', wrapWithPanel: false, - body: { - ...this.scaffold - } + body: [ + { + ...this.scaffold, + label: '树选择框 - 内嵌模式', + mode: 'normal' + } + ] }; notRenderFormZone = true; @@ -268,6 +272,34 @@ export class TreeControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), + { + type: 'button-group-select', + name: 'type', + label: '模式', + pipeIn: defaultValue('input-tree'), + options: [ + { + label: '内嵌', + value: 'input-tree' + }, + { + label: '浮层', + value: 'tree-select' + } + ] + }, + getSchemaTpl('clearable', { + mode: 'horizontal', + horizontal: { + justify: true, + left: 8 + }, + inputClassName: 'is-inline ', + visibleOn: 'data.type === "tree-select"' + }), + getSchemaTpl('searchable', { + visibleOn: 'data.type === "tree-select"' + }), getSchemaTpl('multiple', { body: [ { @@ -385,7 +417,8 @@ export class TreeControlPlugin extends BasePlugin { getSchemaTpl('valueFormula', { name: 'highlightTxt', label: '高亮节点字符', - type: 'input-text' + type: 'input-text', + visibleOn: 'data.type === "input-tree"' }), { type: 'ae-Switch-More', @@ -426,8 +459,17 @@ export class TreeControlPlugin extends BasePlugin { name: 'rootLabel' } ] - } + }, + visibleOn: 'data.type === "input-tree"' }, + getSchemaTpl('switch', { + label: tipedLabel( + '选项文本仅显示选中节点', + '隐藏选择框中已选中节点的祖先节点的文本信息' + ), + name: 'hideNodePathLabel', + visibleOn: 'data.type==="tree-select"' + }), getSchemaTpl('switch', { label: '显示节点图标', name: 'showIcon', @@ -441,6 +483,10 @@ export class TreeControlPlugin extends BasePlugin { name: 'showRadio', hiddenOn: 'data.multiple' }), + getSchemaTpl('switch', { + label: tipedLabel('显示层级展开线', '显示树层级展开线'), + name: 'showOutline' + }), getSchemaTpl('switch', { name: 'withChildren', label: '数值是否携带子节点', diff --git a/packages/amis-editor/src/plugin/Form/TreeSelect.tsx b/packages/amis-editor/src/plugin/Form/TreeSelect.tsx index 811dd08c3..688b7a0e9 100644 --- a/packages/amis-editor/src/plugin/Form/TreeSelect.tsx +++ b/packages/amis-editor/src/plugin/Form/TreeSelect.tsx @@ -12,17 +12,18 @@ export class TreeSelectControlPlugin extends BasePlugin { $schema = '/schemas/TreeSelectControlSchema.json'; // 组件名称 - name = '树下拉框'; + name = '树选择框'; isBaseComponent = true; - icon = 'fa fa-chevron-down'; + disabledRendererPlugin = true; + icon = 'fa fa-list-alt'; pluginIcon = 'tree-select-plugin'; - description = '点击输入框,弹出树型选择框进行选择'; + description = '树型结构选择,支持 [内嵌模式] 与 [浮层模式] 的外观切换'; docLink = '/amis/zh-CN/components/form/treeselect'; tags = ['表单项']; scaffold = { type: 'tree-select', label: '树下拉框', - name: 'tree-select', + name: 'tree', clearable: false, options: [ { @@ -58,7 +59,7 @@ export class TreeSelectControlPlugin extends BasePlugin { notRenderFormZone = true; - panelTitle = '树下拉'; + panelTitle = '树选择'; // 事件定义 events: RendererPluginEvent[] = [ @@ -265,16 +266,34 @@ export class TreeSelectControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - + { + type: 'button-group-select', + name: 'type', + label: '模式', + pipeIn: defaultValue('tree-select'), + options: [ + { + label: '内嵌', + value: 'input-tree' + }, + { + label: '浮层', + value: 'tree-select' + } + ] + }, getSchemaTpl('clearable', { mode: 'horizontal', horizontal: { justify: true, left: 8 }, - inputClassName: 'is-inline ' + inputClassName: 'is-inline ', + visibleOn: 'data.type === "tree-select"' + }), + getSchemaTpl('searchable', { + visibleOn: 'data.type === "tree-select"' }), - getSchemaTpl('searchable'), getSchemaTpl('multiple', { body: [ { @@ -390,6 +409,12 @@ export class TreeSelectControlPlugin extends BasePlugin { { title: '高级', body: [ + getSchemaTpl('valueFormula', { + name: 'highlightTxt', + label: '高亮节点字符', + type: 'input-text', + visibleOn: 'data.type === "input-tree"' + }), { type: 'ae-Switch-More', mode: 'normal', @@ -411,34 +436,35 @@ export class TreeSelectControlPlugin extends BasePlugin { ] } }, + { + type: 'ae-Switch-More', + mode: 'normal', + name: 'hideRoot', + label: '显示顶级节点', + value: true, + trueValue: false, + falseValue: true, + formType: 'extend', + form: { + body: [ + { + type: 'input-text', + label: '节点文案', + value: '顶级', + name: 'rootLabel' + } + ] + }, + visibleOn: 'data.type === "input-tree"' + }, getSchemaTpl('switch', { label: tipedLabel( '选项文本仅显示选中节点', '隐藏选择框中已选中节点的祖先节点的文本信息' ), - name: 'hideNodePathLabel' + name: 'hideNodePathLabel', + visibleOn: 'data.type==="tree-select"' }), - // tree-select 该组件目前无此配置 - // { - // type: 'ae-Switch-More', - // mode: 'normal', - // name: 'hideRoot', - // label: '显示顶级节点', - // value: true, - // trueValue: false, - // falseValue: true, - // formType: 'extend', - // form: { - // body: [ - // { - // type: 'input-text', - // label: '节点文案', - // value: '顶级', - // name: 'rootLabel' - // } - // ] - // } - // }, getSchemaTpl('switch', { label: '显示节点图标', name: 'showIcon', @@ -456,6 +482,19 @@ export class TreeSelectControlPlugin extends BasePlugin { label: tipedLabel('显示层级展开线', '显示树层级展开线'), name: 'showOutline' }), + getSchemaTpl('switch', { + name: 'withChildren', + label: '数值是否携带子节点', + visibleOn: 'data.cascade !== true && data.multiple', + disabledOn: 'data.onlyChildren' + }), + + getSchemaTpl('switch', { + name: 'onlyChildren', + label: '数值是否只包含子节点', + visibleOn: 'data.cascade !== true && data.multiple', + disabledOn: 'data.withChildren' + }), { type: 'ae-Switch-More', mode: 'normal', @@ -496,7 +535,7 @@ export class TreeSelectControlPlugin extends BasePlugin { getSchemaTpl('style:classNames', { schema: [ getSchemaTpl('className', { - label: 'tree容器', + label: '外层容器', name: 'treeContainerClassName' }) ]