Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
田翔
xform
Commits
21415009
Commit
21415009
authored
Dec 11, 2023
by
程恺文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
元素宽度配置修改
parent
e3be7fcf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
5 deletions
+82
-5
otherSettings.js
src/core/FormDesigner/config/otherSettings.js
+2
-2
settings.js
src/core/FormDesigner/config/settings.js
+0
-0
index.js
src/core/widgets/settings/RadioGroup/index.js
+6
-2
index.js
src/core/widgets/settings/RadioGroupW/index.js
+70
-0
index.js
src/core/widgets/settings/index.js
+4
-1
No files found.
src/core/FormDesigner/config/otherSettings.js
View file @
21415009
...
...
@@ -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,
},
},
},
*/
},
}
...
...
src/core/FormDesigner/config/settings.js
View file @
21415009
This diff is collapsed.
Click to expand it.
src/core/widgets/settings/RadioGroup/index.js
View file @
21415009
...
...
@@ -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
>
})
...
...
src/core/widgets/settings/RadioGroupW/index.js
0 → 100644
View file @
21415009
/*
* @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
src/core/widgets/settings/index.js
View file @
21415009
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment