`¥ ${value}`} parser={text => parseFloat(text.replace('¥', ''))} onChange={(value) => {
if (value !== null) {
const v2 = Math.round(value * 100);
onValueChange(v2);
}
else {
onValueChange(value);
}
}}/>);
}
case 'datetime':
case 'date': {
const precision = type === 'date' ? 'day' : 'second';
const format = type === 'date' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss';
return (
setDt(false)} precision={precision} value={new Date(value)} defaultValue={new Date()} min={min ? new Date(min) : undefined} max={max ? new Date(max) : undefined}>
{value => dayjs(value).format(format)}
);
}
case 'time': {
return (待实现
);
}
case 'boolean': {
return (} uncheckedText={} checked={value} onChange={(checked) => {
onValueChange(checked);
}}/>);
}
case 'enum': {
return ( onValueChange(value)}>
{enumeration.map(({ label, value }) => ({t(label)}))}
);
}
case 'ref': {
return ( { onValueChange(value[0]); }}/>);
}
case 'coordinate': {
const { coordinate } = value || {};
const { extra } = attrRender;
const poiNameAttr = extra?.poiName || 'poiName';
const areaIdAttr = extra?.areaId || 'areaId';
return (<>
setSl(false)} bodyStyle={{
height: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'stretch',
}}>
setPoi(poi)}/>
setSl(true)}>
>);
}
default: {
throw new Error(`【Abstract Update】无法支持的数据类别${type}的渲染`);
}
}
}
export default function render(props) {
const { renderData = [], helps, layout = 'horizontal', mode = 'default', entity, Map } = props.data;
const { update, t } = props.methods;
return (
<>
{makeAttrInput(ele, (value, extra) => {
const { attr } = ele;
update({
[attr]: value,
...extra,
});
}, t, label2, Map)}
>
);
})}
);
}