Commit 21415009 authored by 程恺文's avatar 程恺文

元素宽度配置修改

parent e3be7fcf
......@@ -125,7 +125,7 @@ const globalSettings = {
enumNames: ['左右', '上下'],
widget: 'select',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
type: 'number',
widget: 'slider',
......@@ -134,7 +134,7 @@ const globalSettings = {
props: {
hideNumber: true,
},
},
}, */
},
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com
* @Date: 2023-12-06 17:55:24
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-12-06 18:12:16
* @LastEditTime: 2023-12-11 15:54:35
* @FilePath: \xform\src\core\widgets\settings\RadioGroup\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -20,12 +20,16 @@ const TableNames = (props) => {
const onSelect = (value) => {
setvalues(value)
onChange(value)
sessionStorage.setItem('RadioButtonValue', value.target.value
)
}
return (
<Radio.Group onChange={onSelect} defaultValue={value} buttonStyle="solid">
{schema.enum.map((v,i)=>{
{schema?.enum?.map((v,i)=>{
return <Radio.Button value={v}>{schema.enumNames[i]
}</Radio.Button>
})
......
/*
* @Author: 634665781 634665781@qq.com
* @Date: 2023-12-06 17:55:24
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-12-11 16:31:35
* @FilePath: \xform\src\core\widgets\settings\RadioGroup\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%堵
*/
import React, { useEffect, useState } from 'react'
import { Radio } from 'antd'
const TableNames = (props) => {
console.log(props,sessionStorage.getItem('RadioButtonValue'),'props布局内容宽度。。。。');
let num =sessionStorage.getItem('RadioButtonValue')||3
const { value, schema, onChange } = props
let val ='33.3%'
if(num==4) val ='25%'
if(num==5) val ='20%'
const [values, setvalues] = useState(value||val)
const onSelect = (value) => {
setvalues(value)
onChange(value)
}
const getHtml =() =>{
if(num==3){
let val =['33.3%','66.6%','100%']
// let width=['50px','100px','150px']
return ['1/3','2/3','1'].map((v,i)=>{
return <Radio.Button style={{textAlign:'center'}} value={val[i]}>{v
}</Radio.Button>
})
}
if(num==4){
let val =['25%','50%','75%','100%']
// let width=['50px','100px','150px','200px']
return ['1/4','1/2','3/4','1'].map((v,i)=>{
return <Radio.Button style={{textAlign:'center'}} value={val[i]}>{v
}</Radio.Button>
})
}
if(num==5){
let val =['20%','40%','60%','80%','100%']
//let width=['50px','100px','150px','200px','250px']
return ['1/5','2/5','3/5','4/5','1'].map((v,i)=>{
return <Radio.Button style={{textAlign:'center'}} value={val[i]}>{v
}</Radio.Button>
})
}}
return (
<Radio.Group onChange={onSelect} defaultValue={values} buttonStyle="solid">
{
getHtml()
}
</Radio.Group>
)
}
export default TableNames
\ No newline at end of file
......@@ -6,6 +6,7 @@ import groupStyle from './groupStyle'
import BooleanSwitch from './BooleanSwitch'
import InputAddon from './InputAddon'
import RadioGroup from './RadioGroup'
import RadioGroupW from './RadioGroupW'
const settings = {
...form,
...groupBase,
......@@ -14,7 +15,8 @@ const settings = {
...groupStyle,
BooleanSwitch,
InputAddon,
RadioGroup
RadioGroup,
RadioGroupW
}
export default settings
\ No newline at end of file
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