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 = {
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
/*
* @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 { Input, Dropdown, Menu, Select } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
......@@ -8,6 +16,7 @@ const options = [
{ label: '小数', value: '${小数}' },
{ label: '货币', value: '${货币}' },
{ label: '百分比', value: '${百分比}' },
{ label: '科学计数法', value: '${科学计数法}' }
]
const Formatting = (props) => {
......
......@@ -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
/*
* @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 { InputNumber } from 'antd'
import styles from './index.less'
......@@ -48,7 +56,11 @@ const NumberInput = (props) => {
return `${parseInt(value)}`
} else if (formatter === '${小数}') {
return Number(value).toFixed(Number(decimalDigits))
} else if (formatter) {
}
else if(formatter === '${科学计数法}'){
return Number(value).toExponential()
}
else if (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