Skip to content

Commit

Permalink
feat(editor)): 组件绑定代码块form表单配置
Browse files Browse the repository at this point in the history
  • Loading branch information
parisma authored and jia000 committed Sep 22, 2022
1 parent 7640c06 commit 7020ab4
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions packages/editor/src/utils/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 [];
},
},
],
},
],
},
],
},
Expand Down

0 comments on commit 7020ab4

Please sign in to comment.