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

元素宽度配置修改

parent e3be7fcf
...@@ -125,7 +125,7 @@ const globalSettings = { ...@@ -125,7 +125,7 @@ const globalSettings = {
enumNames: ['左右', '上下'], enumNames: ['左右', '上下'],
widget: 'select', widget: 'select',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
type: 'number', type: 'number',
widget: 'slider', widget: 'slider',
...@@ -134,7 +134,7 @@ const globalSettings = { ...@@ -134,7 +134,7 @@ const globalSettings = {
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
} }
......
...@@ -14,9 +14,9 @@ const groupStyle = { ...@@ -14,9 +14,9 @@ const groupStyle = {
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -26,7 +26,7 @@ const groupStyle = { ...@@ -26,7 +26,7 @@ const groupStyle = {
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} }
const layoutWidgets = [ const layoutWidgets = [
...@@ -257,11 +257,11 @@ const textWidgets = [ ...@@ -257,11 +257,11 @@ const textWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
disabled: disabled, disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'], dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -273,7 +273,7 @@ const textWidgets = [ ...@@ -273,7 +273,7 @@ const textWidgets = [
}, },
disabled: disabled, disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'], dependencies: ['tableTypeParent', 'IsSystemField'],
}, }, */
}, },
}, },
{ {
...@@ -379,10 +379,10 @@ const textWidgets = [ ...@@ -379,10 +379,10 @@ const textWidgets = [
title: '元素宽度', title: '元素宽度',
description: '默认值100%', description: '默认值100%',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
default: '100%', default: '100%',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -392,7 +392,7 @@ const textWidgets = [ ...@@ -392,7 +392,7 @@ const textWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -538,9 +538,9 @@ const textWidgets = [ ...@@ -538,9 +538,9 @@ const textWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -550,7 +550,7 @@ const textWidgets = [ ...@@ -550,7 +550,7 @@ const textWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -619,9 +619,9 @@ const textWidgets = [ ...@@ -619,9 +619,9 @@ const textWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -631,7 +631,7 @@ const textWidgets = [ ...@@ -631,7 +631,7 @@ const textWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -725,11 +725,11 @@ const textWidgets = [ ...@@ -725,11 +725,11 @@ const textWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
disabled: disabled, disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'], dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -741,7 +741,7 @@ const textWidgets = [ ...@@ -741,7 +741,7 @@ const textWidgets = [
}, },
disabled: disabled, disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'], dependencies: ['tableTypeParent', 'IsSystemField'],
}, }, */
}, },
}, },
{ {
...@@ -815,9 +815,9 @@ const textWidgets = [ ...@@ -815,9 +815,9 @@ const textWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -827,7 +827,7 @@ const textWidgets = [ ...@@ -827,7 +827,7 @@ const textWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
] ]
...@@ -988,9 +988,9 @@ const selectWidgets = [ ...@@ -988,9 +988,9 @@ const selectWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1000,7 +1000,7 @@ const selectWidgets = [ ...@@ -1000,7 +1000,7 @@ const selectWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} }
}, },
{ {
...@@ -1114,9 +1114,9 @@ const selectWidgets = [ ...@@ -1114,9 +1114,9 @@ const selectWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1126,7 +1126,7 @@ const selectWidgets = [ ...@@ -1126,7 +1126,7 @@ const selectWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} }
}, },
{ {
...@@ -1240,9 +1240,9 @@ const selectWidgets = [ ...@@ -1240,9 +1240,9 @@ const selectWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1252,7 +1252,7 @@ const selectWidgets = [ ...@@ -1252,7 +1252,7 @@ const selectWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} }
}, },
{ {
...@@ -1327,9 +1327,9 @@ const selectWidgets = [ ...@@ -1327,9 +1327,9 @@ const selectWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1339,7 +1339,7 @@ const selectWidgets = [ ...@@ -1339,7 +1339,7 @@ const selectWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -1514,9 +1514,9 @@ const selectWidgets = [ ...@@ -1514,9 +1514,9 @@ const selectWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1526,9 +1526,8 @@ const selectWidgets = [ ...@@ -1526,9 +1526,8 @@ const selectWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} },}
},
] ]
const businessWidgets = [ const businessWidgets = [
...@@ -1638,9 +1637,9 @@ const businessWidgets = [ ...@@ -1638,9 +1637,9 @@ const businessWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1650,7 +1649,7 @@ const businessWidgets = [ ...@@ -1650,7 +1649,7 @@ const businessWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} }
}, },
{ {
...@@ -1734,9 +1733,9 @@ const businessWidgets = [ ...@@ -1734,9 +1733,9 @@ const businessWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1746,7 +1745,7 @@ const businessWidgets = [ ...@@ -1746,7 +1745,7 @@ const businessWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} }
}, },
{ {
...@@ -1952,9 +1951,9 @@ const dateWidgets = [ ...@@ -1952,9 +1951,9 @@ const dateWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -1964,7 +1963,7 @@ const dateWidgets = [ ...@@ -1964,7 +1963,7 @@ const dateWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -2048,9 +2047,9 @@ const dateWidgets = [ ...@@ -2048,9 +2047,9 @@ const dateWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -2060,7 +2059,7 @@ const dateWidgets = [ ...@@ -2060,7 +2059,7 @@ const dateWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
} }
}, },
] ]
...@@ -2181,9 +2180,9 @@ const fileWidgets = [ ...@@ -2181,9 +2180,9 @@ const fileWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -2193,7 +2192,7 @@ const fileWidgets = [ ...@@ -2193,7 +2192,7 @@ const fileWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
] ]
...@@ -2283,9 +2282,9 @@ const mapWidgets = [ ...@@ -2283,9 +2282,9 @@ const mapWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -2295,7 +2294,7 @@ const mapWidgets = [ ...@@ -2295,7 +2294,7 @@ const mapWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -2377,9 +2376,9 @@ const mapWidgets = [ ...@@ -2377,9 +2376,9 @@ const mapWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -2389,7 +2388,7 @@ const mapWidgets = [ ...@@ -2389,7 +2388,7 @@ const mapWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -2464,9 +2463,9 @@ const mapWidgets = [ ...@@ -2464,9 +2463,9 @@ const mapWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -2476,7 +2475,7 @@ const mapWidgets = [ ...@@ -2476,7 +2475,7 @@ const mapWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -2551,9 +2550,9 @@ const mapWidgets = [ ...@@ -2551,9 +2550,9 @@ const mapWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值110', description: '默认值110',
default: 110, default: 110,
...@@ -2563,7 +2562,7 @@ const mapWidgets = [ ...@@ -2563,7 +2562,7 @@ const mapWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
] ]
...@@ -2671,9 +2670,9 @@ const advancedWidgets = [ ...@@ -2671,9 +2670,9 @@ const advancedWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
description: '默认值10', description: '默认值10',
default: 10, default: 10,
...@@ -2683,7 +2682,7 @@ const advancedWidgets = [ ...@@ -2683,7 +2682,7 @@ const advancedWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
{ {
...@@ -2748,9 +2747,9 @@ const advancedWidgets = [ ...@@ -2748,9 +2747,9 @@ const advancedWidgets = [
width: { width: {
title: '元素宽度', title: '元素宽度',
type: 'string', type: 'string',
widget: 'percentSlider', widget: 'RadioGroupW',
}, },
labelWidth: { /* labelWidth: {
title: '标签宽度', title: '标签宽度',
default: 110, default: 110,
type: 'number', type: 'number',
...@@ -2759,7 +2758,7 @@ const advancedWidgets = [ ...@@ -2759,7 +2758,7 @@ const advancedWidgets = [
props: { props: {
hideNumber: true, hideNumber: true,
}, },
}, }, */
}, },
}, },
] ]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com * @Author: 634665781 634665781@qq.com
* @Date: 2023-12-06 17:55:24 * @Date: 2023-12-06 17:55:24
* @LastEditors: 634665781 634665781@qq.com * @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 * @FilePath: \xform\src\core\widgets\settings\RadioGroup\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -20,12 +20,16 @@ const TableNames = (props) => { ...@@ -20,12 +20,16 @@ const TableNames = (props) => {
const onSelect = (value) => { const onSelect = (value) => {
setvalues(value) setvalues(value)
onChange(value) onChange(value)
sessionStorage.setItem('RadioButtonValue', value.target.value
)
} }
return ( return (
<Radio.Group onChange={onSelect} defaultValue={value} buttonStyle="solid"> <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] return <Radio.Button value={v}>{schema.enumNames[i]
}</Radio.Button> }</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' ...@@ -6,6 +6,7 @@ import groupStyle from './groupStyle'
import BooleanSwitch from './BooleanSwitch' import BooleanSwitch from './BooleanSwitch'
import InputAddon from './InputAddon' import InputAddon from './InputAddon'
import RadioGroup from './RadioGroup' import RadioGroup from './RadioGroup'
import RadioGroupW from './RadioGroupW'
const settings = { const settings = {
...form, ...form,
...groupBase, ...groupBase,
...@@ -14,7 +15,8 @@ const settings = { ...@@ -14,7 +15,8 @@ const settings = {
...groupStyle, ...groupStyle,
BooleanSwitch, BooleanSwitch,
InputAddon, InputAddon,
RadioGroup RadioGroup,
RadioGroupW
} }
export default settings 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