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
d1bfa69c
Commit
d1bfa69c
authored
Jan 09, 2024
by
罗剑
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 提交OCR身份认证
parent
d1f6b8d3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
263 additions
and
11 deletions
+263
-11
process.js
src/apis/process.js
+1
-0
settings.js
src/core/FormDesigner/config/settings.js
+140
-0
index.js
src/core/widgets/advanced/IDCard/index.js
+0
-0
index.less
src/core/widgets/advanced/IDCard/index.less
+57
-0
index.js
src/core/widgets/advanced/index.js
+3
-0
index.js
src/core/widgets/settings/groupStyle/CheckBoxGroup/index.js
+40
-0
index.less
...core/widgets/settings/groupStyle/CheckBoxGroup/index.less
+9
-0
index.js
src/core/widgets/settings/groupStyle/index.js
+13
-11
No files found.
src/apis/process.js
View file @
d1bfa69c
...
...
@@ -11,6 +11,7 @@ const url = (REACT_APP_ENV || 'dev') !== 'dev' ? `${YOURSELFER_SERVER}/${BASEURL
export
const
uploadFileUrl
=
`
${
BASEURL
}
/UploaderFiles`
;
// 上传文件链接
export
const
downloadFileUrl
=
`
${
BASEURL
}
/DownloadFiles`
;
// 下载/播放文件链接
export
const
uploadCardFileUrl
=
`
${
BASEURL
}
/CardOCRUpLoad`
;
// 上传文件链接
/** @End */
...
...
src/core/FormDesigner/config/settings.js
View file @
d1bfa69c
...
...
@@ -2516,6 +2516,146 @@ const advancedWidgets = [
},
},
},
{
text
:
'身份证识别'
,
name
:
'身份证识别'
,
icon
:
<
IconPack
.
FileUpload
/>
,
schema
:
{
title
:
'身份证'
,
type
:
'string'
,
widget
:
'IDCard'
,
width
:
'100%'
,
preview
:
true
,
},
setting
:
{
widget
:
{
title
:
'控件类型'
,
type
:
'string'
,
widget
:
'WidgetType'
,
displayType
:
'row'
,
labelWidth
:
80
,
},
$id
:
{
title
:
'数据源'
,
type
:
'string'
,
widget
:
'FieldNames'
,
required
:
true
,
},
title
:
{
title
:
'展示名称'
,
type
:
'string'
,
required
:
true
,
},
description
:
{
title
:
'字段说明'
,
type
:
'string'
,
},
showField
:{
title
:
'身份信息'
,
type
:
'array'
,
widget
:
'CheckBoxGroup'
,
default
:
[],
},
// hiddenCondition: {
// title: '隐藏条件',
// type: 'string',
// description: '所有形态默认显示',
// widget: 'HiddenCondition'
// },
// options: {
// title: '',
// name: '选项',
// type: 'array',
// default: [{ value: '选项一' }],
// widget: 'SimpleList',
// dependencies: ['sourceType', 'color', 'isMultiple']
// },
// fileType: {
// title: '文件类型',
// type: 'string',
// widget: 'FileTypeSelect',
// enum: ['图片'],
// enumNames: ['图片'],
// default: '全部',
// },
durationTime
:
{
title
:
"{{formData.fileType+'最大时长'}}"
,
type
:
'number'
,
description
:
'秒'
,
widget
:
'slider'
,
default
:
60
,
min
:
1
,
max
:
60
,
hidden
:
"{{!['音频', '视频'].includes(formData.fileType)}}"
,
dependencies
:
[
'fileType'
]
},
disabled
:
{
title
:
'只读'
,
type
:
'boolean'
,
widget
:
'checkbox'
,
default
:
false
,
width
:
'50%'
,
},
required
:
{
title
:
'必填'
,
type
:
'boolean'
,
widget
:
'checkbox'
,
default
:
false
,
width
:
'50%'
,
},
// preview: {
// title: '预览',
// type: 'boolean',
// widget: 'checkbox',
// default: true,
// width: '33%',
// },
// download: {
// title: '下载',
// type: 'boolean',
// widget: 'checkbox',
// default: true,
// width: '33%',
// },
photo
:
{
title
:
'允许从相册选取'
,
type
:
'boolean'
,
widget
:
'BooleanSwitch'
,
description
:
'仅支持移动端'
,
default
:
false
,
hidden
:
"{{!['图片', '视频'].includes(formData.fileType)}}"
},
watermark
:
{
title
:
'水印'
,
type
:
'boolean'
,
widget
:
'BooleanSwitch'
,
description
:
'图片是否添加水印(仅支持移动端)'
,
default
:
false
,
hidden
:
"{{!['图片'].includes(formData.fileType)}}"
},
groupStyle
:
{
title
:
'控件样式'
,
type
:
'object'
,
properties
:
{}
},
width
:
{
title
:
'元素宽度'
,
type
:
'string'
,
widget
:
'percentSlider'
,
},
labelWidth
:
{
title
:
'标签宽度'
,
description
:
'默认值110'
,
default
:
110
,
type
:
'number'
,
widget
:
'slider'
,
max
:
400
,
props
:
{
hideNumber
:
true
,
},
},
},
}
]
const
settings
=
[
...
...
src/core/widgets/advanced/IDCard/index.js
0 → 100644
View file @
d1bfa69c
This diff is collapsed.
Click to expand it.
src/core/widgets/advanced/IDCard/index.less
0 → 100644
View file @
d1bfa69c
@import '~antd/es/style/themes/default.less';
@imgSrc: '../../../../assets/images/file';
.uploadBox,
.uploadBoxImg {
.iconImg {
width: 45px;
height: 45px;
margin: 0 auto;
&[type='通用'] {
background: url('@{imgSrc}/通用.png');
background-size: 100% 100%;
}
&[type='jpg'] {
background: url('@{imgSrc}/JPG.png');
background-size: 100% 100%;
}
&[type='png'] {
background: url('@{imgSrc}/PNG.png');
background-size: 100% 100%;
}
&[type="mp3"] {
background: url('@{imgSrc}/音乐.png');
background-size: 100% 100%;
}
&[type="mp4"] {
background: url('@{imgSrc}/视频.png');
background-size: 100% 100%;
}
&[type='docx'] {
background: url('@{imgSrc}/Word.png');
background-size: 100% 100%;
}
&[type='xlsx'],
&[type='xls'] {
background: url('@{imgSrc}/Excel.png');
background-size: 100% 100%;
}
&[type='PDF'] {
background: url('@{imgSrc}/PDF.png');
background-size: 100% 100%;
}
}
.@{ant-prefix}-form-item-label {
width: 100px;
text-align: left;
}
.ant-form-item{
margin-bottom: 12px;
}
}
.uploadBoxImg {
.@{ant-prefix}-upload-list-item-name {
display: none !important;
}
}
\ No newline at end of file
src/core/widgets/advanced/index.js
View file @
d1bfa69c
import
RelationForm
from
'./RelationForm'
import
Signature
from
'./Signature'
import
IDCard
from
'./IDCard'
const
advanced
=
{
RelationForm
,
Signature
,
IDCard
,
}
export
default
advanced
\ No newline at end of file
src/core/widgets/settings/groupStyle/CheckBoxGroup/index.js
0 → 100644
View file @
d1bfa69c
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
'react'
;
import
{
Checkbox
,
Divider
}
from
'antd'
;
import
styles
from
'./index.less'
;
const
plainOptions
=
[
'身份号码'
,
'姓名'
,
'名族'
,
'住址'
,
'出生'
,
'性别'
,
'失效日期'
,
'签发机关'
,
'签发日期'
];
const
defaultCheckedList
=
[
'姓名'
,
'名族'
,
'住址'
,
'身份号码'
,
'出生'
,
'性别'
,
'失效日期'
,
'签发机关'
,
'签发日期'
];
const
CheckboxGroup
=
Checkbox
.
Group
;
const
TableNames
=
(
props
)
=>
{
const
{
value
,
schema
,
onChange
}
=
props
;
const
[
checkedList
,
setCheckedList
]
=
useState
((
value
&&
value
.
length
>
0
)
?
value
:
defaultCheckedList
);
const
checkAll
=
plainOptions
.
length
===
checkedList
.
length
;
const
indeterminate
=
checkedList
.
length
>
0
&&
checkedList
.
length
<
plainOptions
.
length
;
const
onChangeOne
=
(
list
)
=>
{
setCheckedList
(
list
);
onChange
(
list
);
};
const
onCheckAllChange
=
(
e
)
=>
{
setCheckedList
(
e
.
target
.
checked
?
plainOptions
:
[]);
onChange
(
e
.
target
.
checked
?
plainOptions
:
[]);
};
return
(
<
div
className
=
{
styles
.
CheckBoxGroup
}
>
<
Checkbox
indeterminate
=
{
indeterminate
}
onChange
=
{
onCheckAllChange
}
checked
=
{
checkAll
}
>
全选
<
/Checkbox
>
<
Divider
/>
<
CheckboxGroup
options
=
{
plainOptions
}
value
=
{
checkedList
}
onChange
=
{
onChangeOne
}
/
>
<
/div
>
);
};
export
default
TableNames
;
\ No newline at end of file
src/core/widgets/settings/groupStyle/CheckBoxGroup/index.less
0 → 100644
View file @
d1bfa69c
@import '~antd/es/style/themes/default.less';
.CheckBoxGroup {
width: 100%;
.ant-checkbox-group-item {
margin-right: 2px;
width: 90px;
}
}
\ No newline at end of file
src/core/widgets/settings/groupStyle/index.js
View file @
d1bfa69c
import
PercentSlider
from
'./PercentSlider'
import
ShowText
from
'./ShowText'
import
Formatting
from
'./Formatting'
import
DecimalDigits
from
'./DecimalDigits'
import
FileTypeSelect
from
'./FileTypeSelect'
import
ContentHTML
from
'./ContentHTML'
import
StyleHTML
from
'./StyleHTML'
import
RadioGroupW
from
'./RadioGroupW'
import
PercentSlider
from
'./PercentSlider'
;
import
ShowText
from
'./ShowText'
;
import
Formatting
from
'./Formatting'
;
import
DecimalDigits
from
'./DecimalDigits'
;
import
FileTypeSelect
from
'./FileTypeSelect'
;
import
ContentHTML
from
'./ContentHTML'
;
import
StyleHTML
from
'./StyleHTML'
;
import
RadioGroupW
from
'./RadioGroupW'
;
import
CheckBoxGroup
from
'./CheckBoxGroup'
;
const
groupStyle
=
{
PercentSlider
,
...
...
@@ -16,6 +17,7 @@ const groupStyle = {
ContentHTML
,
StyleHTML
,
RadioGroupW
,
}
CheckBoxGroup
,
};
export
default
groupStyle
\ No newline at end of file
export
default
groupStyle
;
\ 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