import React from 'react'; import { ComponentsType, DataType, iProperty, TagType } from '../../base/type'; import IOTDoubleButton from './IOTDoubleButton'; import { iIOTElementDoubleButtonProps } from './interface'; import iGrapesJSConfig from '../../type'; import { iIOTElementDoubleButtoJSON } from '.'; import { mergeParameters } from '../../base/utils'; const grapesJSConfig: iGrapesJSConfig = { type: [ComponentsType.Element], id: 'IOTDoubleButton', tag: TagType.IOTDoubleButton, access: 'r', render: (jsonData, ...args) => { const props = mergeParameters(jsonData, ...args); return ; }, buildData: (mock: boolean = false, property?: iProperty) => { if (property === undefined) return; const props: iIOTElementDoubleButtoJSON = { title: property['display-name'], icon: { value: 'insideicon-cu-1', show: true }, streamId: property.streamName, type: property?.valuedef?.type, disabled: false, btnTitle:'音量', leftBtn:'', //按钮图标 rightBtn:'', }; return props; }, traits: () => { return [ { type: 'upload', name: 'imgSrc', label: '图片设置' }, ]; }, }; export default grapesJSConfig;