Commit 39623860 authored by 田翔's avatar 田翔

fix: 配置整体布局优化

parent 8efd8214
{
"name": "panda-xform",
"version": "5.9.16",
"description": "5.9.16 图片支持webp格式",
"version": "5.9.17",
"description": "5.9.17 配置整体布局优化",
"keywords": [
"panda-xform"
],
......
......@@ -9,16 +9,37 @@
import React, { useEffect, useState } from 'react'
import { Radio } from 'antd'
import styles from './index.less'
import { isJson, isObject } from '../../../../../utils';
const getJson = (json, value) => {
json.column = value
let parent = json?.properties
if (isObject(parent)) {
Object.keys(parent).forEach(keys => {
let child = parent[keys]?.properties
if (isObject(child)) {
Object.keys(child).forEach(k => {
if (child[k]?.width !== '100%') {
delete child[k].width
}
})
}
})
}
return json
}
const RadioGroup = (props) => {
const { value, schema, onChange } = props
const [values, setvalues] = useState(value)
const onSelect = (value) => {
const onSelect = (e) => {
sessionStorage.setItem('RadioButtonValue', e.target.value)
setvalues(value)
onChange(value)
sessionStorage.setItem('RadioButtonValue', value.target.value)
let json = getJson(window.designerRef?.current?.getValue(), e.target.value)
window.designerRef?.current?.setValue(json)
}
return (
......
......@@ -54,7 +54,7 @@ const TableNames = (props) => {
options.map((v, i) => {
return (
<div style={{ flex: 1, marginLeft: i === 0 ? '0' : '-1px' }}>
<Radio.Button style={{ textAlign: 'center' }} value={v.value}>{v.label}</Radio.Button>
<Radio.Button style={{ textAlign: 'center' }} value={v.value} key={i}>{v.label}</Radio.Button>
</div>
)
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment