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
bcc1f503
Commit
bcc1f503
authored
Sep 12, 2023
by
田翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加移动端预览
parent
daf6d641
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
18 deletions
+35
-18
settings.js
src/core/FormDesigner/config/settings.js
+16
-11
index.js
src/core/FormDesigner/index.js
+19
-1
index.js
src/core/widgets/file/FileUpload/index.js
+0
-6
No files found.
src/core/FormDesigner/config/settings.js
View file @
bcc1f503
...
@@ -2558,13 +2558,6 @@ const advancedWidgets = [
...
@@ -2558,13 +2558,6 @@ const advancedWidgets = [
type
:
'string'
,
type
:
'string'
,
widget
:
'htmlInput'
,
widget
:
'htmlInput'
,
},
},
disabled
:
{
title
:
'只读'
,
type
:
'boolean'
,
widget
:
'checkbox'
,
default
:
false
,
width
:
'33%'
,
},
'台账名称'
:
{
'台账名称'
:
{
title
:
'台账名称'
,
title
:
'台账名称'
,
type
:
'string'
,
type
:
'string'
,
...
@@ -2577,6 +2570,11 @@ const advancedWidgets = [
...
@@ -2577,6 +2570,11 @@ const advancedWidgets = [
default
:
[],
default
:
[],
dependencies
:
[
'台账名称'
],
dependencies
:
[
'台账名称'
],
},
},
'控制规则'
:
{
title
:
'控制规则'
,
type
:
'string'
,
widget
:
'ControlRules'
,
},
'默认显示'
:
{
'默认显示'
:
{
title
:
'默认显示'
,
title
:
'默认显示'
,
type
:
'boolean'
,
type
:
'boolean'
,
...
@@ -2585,10 +2583,17 @@ const advancedWidgets = [
...
@@ -2585,10 +2583,17 @@ const advancedWidgets = [
displayType
:
'row'
,
displayType
:
'row'
,
labelWidth
:
80
,
labelWidth
:
80
,
},
},
'控制规则'
:
{
// otherAccount: {
title
:
'控制规则'
,
// title: '数据来源',
type
:
'string'
,
// type: 'string',
widget
:
'ControlRules'
,
// widget: 'OtherAccount',
// },
disabled
:
{
title
:
'只读'
,
type
:
'boolean'
,
widget
:
'checkbox'
,
default
:
false
,
width
:
'33%'
,
},
},
groupStyle
:
{
groupStyle
:
{
title
:
'控件样式'
,
title
:
'控件样式'
,
...
...
src/core/FormDesigner/index.js
View file @
bcc1f503
import
React
,
{
useRef
,
useState
,
forwardRef
,
useImperativeHandle
,
useMemo
,
useLayoutEffect
}
from
'react'
import
React
,
{
useRef
,
useState
,
forwardRef
,
useImperativeHandle
,
useMemo
,
useLayoutEffect
}
from
'react'
import
{
message
,
Modal
,
Button
}
from
'antd'
import
{
message
,
Modal
,
Button
,
Popover
}
from
'antd'
import
{
ExclamationCircleOutlined
}
from
'@ant-design/icons'
import
{
ExclamationCircleOutlined
}
from
'@ant-design/icons'
import
QRcode
from
'qrcode.react'
import
Generator
,
{
defaultSettings
,
defaultCommonSettings
,
defaultGlobalSettings
}
from
'fr-generator'
import
Generator
,
{
defaultSettings
,
defaultCommonSettings
,
defaultGlobalSettings
}
from
'fr-generator'
import
{
settings
,
baseSettings
,
globalSettings
}
from
'./config'
import
{
settings
,
baseSettings
,
globalSettings
}
from
'./config'
import
widgets
from
'../widgets'
import
widgets
from
'../widgets'
...
@@ -26,6 +27,7 @@ const FormDesigner = (props, ref) => {
...
@@ -26,6 +27,7 @@ const FormDesigner = (props, ref) => {
const
[
schema
,
setSchema
]
=
useState
({})
const
[
schema
,
setSchema
]
=
useState
({})
const
[
fieldName
,
setFieldName
]
=
useState
([])
const
[
fieldName
,
setFieldName
]
=
useState
([])
const
[
textShow
,
setTextShow
]
=
useState
(
false
)
const
[
textShow
,
setTextShow
]
=
useState
(
false
)
const
[
open
,
setOpen
]
=
useState
(
false
)
const
designerRef
=
useRef
(
null
)
const
designerRef
=
useRef
(
null
)
const
formRenderRef
=
useRef
(
null
)
const
formRenderRef
=
useRef
(
null
)
...
@@ -330,6 +332,10 @@ const FormDesigner = (props, ref) => {
...
@@ -330,6 +332,10 @@ const FormDesigner = (props, ref) => {
return
true
return
true
}
}
const
onOpenChange
=
(
value
)
=>
{
console
.
log
(
'value'
,
value
)
}
if
(
!
tableName
)
{
if
(
!
tableName
)
{
return
null
return
null
}
}
...
@@ -365,6 +371,18 @@ const FormDesigner = (props, ref) => {
...
@@ -365,6 +371,18 @@ const FormDesigner = (props, ref) => {
<
div
>
<
div
>
<
span
style
=
{{
color
:
'#18b918'
,
fontSize
:
'14px'
,
paddingRight
:
'10px'
,
display
:
textShow
?
'inline-block'
:
'none'
}}
>
该表单内容校验通过
,
可正常使用
!<
/span
>
<
span
style
=
{{
color
:
'#18b918'
,
fontSize
:
'14px'
,
paddingRight
:
'10px'
,
display
:
textShow
?
'inline-block'
:
'none'
}}
>
该表单内容校验通过
,
可正常使用
!<
/span
>
<
Button
onClick
=
{()
=>
setVisible
(
false
)}
>
取消
<
/Button
>
<
Button
onClick
=
{()
=>
setVisible
(
false
)}
>
取消
<
/Button
>
<
Popover
trigger
=
"click"
open
=
{
open
}
onOpenChange
=
{
onOpenChange
}
content
=
{
<
div
>
<
QRcode
value
=
{
`
${
window
.
origin
}
/civ_mobile/product/workflow/formTest?env=dev&tableName=
${
tableName
}
`
}
/
>
<
/div
>
}
>
<
Button
>
移动端预览
<
/Button
>
<
/Popover
>
<
Button
type
=
'primary'
onClick
=
{
testSubmit
}
>
测试提交
<
/Button
>
<
Button
type
=
'primary'
onClick
=
{
testSubmit
}
>
测试提交
<
/Button
>
<
/div
>
<
/div
>
}
}
...
...
src/core/widgets/file/FileUpload/index.js
View file @
bcc1f503
...
@@ -73,15 +73,9 @@ const FileUpload = (props) => {
...
@@ -73,15 +73,9 @@ const FileUpload = (props) => {
action
:
`
${
window
.
location
.
origin
}${
uploadFileUrl
}
`
,
action
:
`
${
window
.
location
.
origin
}${
uploadFileUrl
}
`
,
listType
:
showType
,
listType
:
showType
,
withCredentials
:
true
,
withCredentials
:
true
,
// showUploadList: download ?
// {
// showDownloadIcon: '下载',
// downloadIcon: <ArrowDownOutlined style={{ color: fileType === '图片' ? 'white' : '' }} />,
// } : {},
showUploadList
:
{
showUploadList
:
{
showRemoveIcon
:
!
disabled
,
showRemoveIcon
:
!
disabled
,
showDownloadIcon
:
download
,
showDownloadIcon
:
download
,
// downloadIcon: <ArrowDownOutlined style={{ color: fileType === '图片' ? 'white' : '' }} />,
},
},
beforeUpload
(
file
,
fileList
)
{
beforeUpload
(
file
,
fileList
)
{
/** @Tips: 解决提交文件中存在特殊字符的问题 */
/** @Tips: 解决提交文件中存在特殊字符的问题 */
...
...
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