import React from 'react'; import { ComponentsType, DataType, iProperty, TagType } from '../../base/type'; import IOTImg from './IOTImg'; import { IOTImgProps } from './interface'; import iGrapesJSConfig from '../../type'; import { iIOTImgJSON } from '.'; import { mergeParameters } from '../../base/utils'; const grapesJSConfig: iGrapesJSConfig = { type: [ComponentsType.Element], id: 'IOTImg', tag: TagType.IOTImg, access: 'r', render: (jsonData, ...args) => { const props = mergeParameters(jsonData, ...args); return ; }, buildData: (mock: boolean = false, property?: iProperty) => { const props: iIOTImgJSON = { width: '160', height: '160', imgSrc: 'https://smartoss.tsy.spic.com.cn/smart-lowcode/static/img/image_empty.svg', }; return props; }, traits: () => { return [ { type: 'upload', name: 'imgSrc', label: '图片设置', tip: '上传图片的文件≤512KB,格式仅支持PNG', count: 3, }, ]; }, }; export default grapesJSConfig;