mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-26 10:59:58 +08:00
feat(editor)): 组件绑定代码块form表单配置
This commit is contained in:
parent
7640c06ccb
commit
7020ab4a1f
@ -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',
|
||||||
name: 'created',
|
active: '0',
|
||||||
text: 'created',
|
items: [
|
||||||
formTitle: 'created',
|
{
|
||||||
|
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 [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user