From 7020ab4a1fcc50a9ad90c7688545c5292c505918 Mon Sep 17 00:00:00 2001 From: parisma Date: Thu, 8 Sep 2022 17:31:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor)):=20=E7=BB=84=E4=BB=B6=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=BB=A3=E7=A0=81=E5=9D=97form=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/utils/props.ts | 36 +++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/packages/editor/src/utils/props.ts b/packages/editor/src/utils/props.ts index 20282964..1036272a 100644 --- a/packages/editor/src/utils/props.ts +++ b/packages/editor/src/utils/props.ts @@ -16,8 +16,11 @@ * limitations under the License. */ +import { map } from 'lodash-es'; + import { FormConfig, FormState } from '@tmagic/form'; +import codeBlockService from '../services/codeBlock'; import editorService from '../services/editor'; import eventsService from '../services/events'; @@ -221,13 +224,36 @@ export const fillConfig = (config: FormConfig = []) => [ }, { title: '高级', - labelWidth: '80px', + lazy: true, items: [ { - type: 'code-link', - name: 'created', - text: 'created', - formTitle: 'created', + type: 'tab', + active: '0', + items: [ + { + title: 'created', + lazy: true, + items: [ + { + labelWidth: '100px', + name: 'created', + text: '关联代码块', + type: 'select', + multiple: true, + options: () => { + const codeDsl = codeBlockService.getCodeDsl(); + if (codeDsl) { + return map(codeDsl, (value, key) => ({ + text: value.name, + value: key, + })); + } + return []; + }, + }, + ], + }, + ], }, ], },