feat(editor)): 组件绑定代码块form表单配置

This commit is contained in:
parisma 2022-09-08 17:31:34 +08:00 committed by jia000
parent 7640c06ccb
commit 7020ab4a1f

View File

@ -16,8 +16,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { map } from 'lodash-es';
import { FormConfig, FormState } from '@tmagic/form'; import { FormConfig, FormState } from '@tmagic/form';
import codeBlockService from '../services/codeBlock';
import editorService from '../services/editor'; import editorService from '../services/editor';
import eventsService from '../services/events'; import eventsService from '../services/events';
@ -221,13 +224,36 @@ export const fillConfig = (config: FormConfig = []) => [
}, },
{ {
title: '高级', title: '高级',
labelWidth: '80px', lazy: true,
items: [ items: [
{ {
type: 'code-link', type: 'tab',
active: '0',
items: [
{
title: 'created',
lazy: true,
items: [
{
labelWidth: '100px',
name: 'created', name: 'created',
text: 'created', text: '关联代码块',
formTitle: 'created', type: 'select',
multiple: true,
options: () => {
const codeDsl = codeBlockService.getCodeDsl();
if (codeDsl) {
return map(codeDsl, (value, key) => ({
text: value.name,
value: key,
}));
}
return [];
},
},
],
},
],
}, },
], ],
}, },