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,
},
},
}, */
},
}
......
......@@ -14,9 +14,9 @@ const groupStyle = {
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -26,7 +26,7 @@ const groupStyle = {
props: {
hideNumber: true,
},
},
}, */
}
const layoutWidgets = [
......@@ -257,11 +257,11 @@ const textWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -273,7 +273,7 @@ const textWidgets = [
},
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
}, */
},
},
{
......@@ -379,10 +379,10 @@ const textWidgets = [
title: '元素宽度',
description: '默认值100%',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
default: '100%',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -392,7 +392,7 @@ const textWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -538,9 +538,9 @@ const textWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -550,7 +550,7 @@ const textWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -619,9 +619,9 @@ const textWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -631,7 +631,7 @@ const textWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -725,11 +725,11 @@ const textWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -741,7 +741,7 @@ const textWidgets = [
},
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
}, */
},
},
{
......@@ -815,9 +815,9 @@ const textWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -827,7 +827,7 @@ const textWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
]
......@@ -988,9 +988,9 @@ const selectWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1000,7 +1000,7 @@ const selectWidgets = [
props: {
hideNumber: true,
},
},
}, */
}
},
{
......@@ -1114,9 +1114,9 @@ const selectWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1126,7 +1126,7 @@ const selectWidgets = [
props: {
hideNumber: true,
},
},
}, */
}
},
{
......@@ -1240,9 +1240,9 @@ const selectWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1252,7 +1252,7 @@ const selectWidgets = [
props: {
hideNumber: true,
},
},
}, */
}
},
{
......@@ -1327,9 +1327,9 @@ const selectWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1339,7 +1339,7 @@ const selectWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -1514,9 +1514,9 @@ const selectWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1526,9 +1526,8 @@ const selectWidgets = [
props: {
hideNumber: true,
},
},
}
},
}, */
},}
]
const businessWidgets = [
......@@ -1638,9 +1637,9 @@ const businessWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1650,7 +1649,7 @@ const businessWidgets = [
props: {
hideNumber: true,
},
},
}, */
}
},
{
......@@ -1734,9 +1733,9 @@ const businessWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1746,7 +1745,7 @@ const businessWidgets = [
props: {
hideNumber: true,
},
},
}, */
}
},
{
......@@ -1952,9 +1951,9 @@ const dateWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -1964,7 +1963,7 @@ const dateWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -2048,9 +2047,9 @@ const dateWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -2060,7 +2059,7 @@ const dateWidgets = [
props: {
hideNumber: true,
},
},
}, */
}
},
]
......@@ -2181,9 +2180,9 @@ const fileWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -2193,7 +2192,7 @@ const fileWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
]
......@@ -2283,9 +2282,9 @@ const mapWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -2295,7 +2294,7 @@ const mapWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -2377,9 +2376,9 @@ const mapWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -2389,7 +2388,7 @@ const mapWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -2464,9 +2463,9 @@ const mapWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -2476,7 +2475,7 @@ const mapWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -2551,9 +2550,9 @@ const mapWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
......@@ -2563,7 +2562,7 @@ const mapWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
]
......@@ -2671,9 +2670,9 @@ const advancedWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
description: '默认值10',
default: 10,
......@@ -2683,7 +2682,7 @@ const advancedWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
{
......@@ -2748,9 +2747,9 @@ const advancedWidgets = [
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
widget: 'RadioGroupW',
},
labelWidth: {
/* labelWidth: {
title: '标签宽度',
default: 110,
type: 'number',
......@@ -2759,7 +2758,7 @@ const advancedWidgets = [
props: {
hideNumber: true,
},
},
}, */
},
},
]
......
......@@ -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