Commit ae5505b3 authored by 田翔's avatar 田翔

Merge branch 'master' of https://g.civnet.cn:8443/tianxiang/xform

parents f87fa266 e1dbab74
...@@ -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,
}, },
}, }, */
}, },
} }
......
This diff is collapsed.
...@@ -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
/*
* @Author: 634665781 634665781@qq.com
* @Date: 2023-12-06 09:16:37
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-12-11 16:46:25
* @FilePath: \xform\src\core\widgets\settings\groupStyle\Formatting\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import React from 'react' import React from 'react'
import { Input, Dropdown, Menu, Select } from 'antd' import { Input, Dropdown, Menu, Select } from 'antd'
import { PlusOutlined } from '@ant-design/icons' import { PlusOutlined } from '@ant-design/icons'
...@@ -8,6 +16,7 @@ const options = [ ...@@ -8,6 +16,7 @@ const options = [
{ label: '小数', value: '${小数}' }, { label: '小数', value: '${小数}' },
{ label: '货币', value: '${货币}' }, { label: '货币', value: '${货币}' },
{ label: '百分比', value: '${百分比}' }, { label: '百分比', value: '${百分比}' },
{ label: '科学计数法', value: '${科学计数法}' }
] ]
const Formatting = (props) => { const Formatting = (props) => {
......
...@@ -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
/*
* @Author: 634665781 634665781@qq.com
* @Date: 2023-12-06 09:16:37
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-12-11 17:07:06
* @FilePath: \xform\src\core\widgets\text\NumberInput\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import React, { useEffect, useMemo, useState } from 'react' import React, { useEffect, useMemo, useState } from 'react'
import { InputNumber } from 'antd' import { InputNumber } from 'antd'
import styles from './index.less' import styles from './index.less'
...@@ -48,7 +56,11 @@ const NumberInput = (props) => { ...@@ -48,7 +56,11 @@ const NumberInput = (props) => {
return `${parseInt(value)}` return `${parseInt(value)}`
} else if (formatter === '${小数}') { } else if (formatter === '${小数}') {
return Number(value).toFixed(Number(decimalDigits)) return Number(value).toFixed(Number(decimalDigits))
} else if (formatter) { }
else if(formatter === '${科学计数法}'){
return Number(value).toExponential()
}
else if (formatter) {
return `${value}${formatter}` return `${value}${formatter}`
} }
} }
......
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