Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
fbf8b038
提交
fbf8b038
authored
4 年前
作者:
徐立
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增提交按钮
上级
239e7f0e
master
revert-0d777914
yaanzhiyuan_2021
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
148 行增加
和
0 行删除
+148
-0
AddModal.jsx
one_stop_public/AffairButton/SumbitButton/AddModal.jsx
+24
-0
index.jsx
one_stop_public/AffairButton/SumbitButton/index.jsx
+103
-0
按钮使用文档.md
one_stop_public/AffairButton/按钮使用文档.md
+20
-0
表单设计器相关.md
one_stop_public/表单设计器相关.md
+1
-0
没有找到文件。
one_stop_public/AffairButton/SumbitButton/AddModal.jsx
0 → 100644
浏览文件 @
fbf8b038
/**
* 徐立
* 2019年9月19日
* 事务发起提交多次弹框
*/
import
React
,
{
Component
}
from
'react'
import
{
Modal
,
Button
}
from
'antd'
;
export
default
class
AddModal
extends
Component
{
render
()
{
let
{
visible
,
handleCancel
,
handleOk
,
loading
}
=
this
.
props
return
(
<
Modal
title=
"提交申请"
visible=
{
visible
}
onOk=
{
handleOk
}
confirmLoading=
{
loading
}
onCancel=
{
handleCancel
}
width=
{
400
}
>
<
p
style=
{
{
width
:
'100%'
,
textAlign
:
'center'
,
fontSize
:
14
,
color
:
'#666666'
}
}
>
确定要提交申请吗?
</
p
>
</
Modal
>
)
}
}
This diff is collapsed.
Click to expand it.
one_stop_public/AffairButton/SumbitButton/index.jsx
0 → 100644
浏览文件 @
fbf8b038
/**
* 提交按钮封装
* 需要传入以下参数
* form控件
* appId 事务Id
* draftId 草稿Id 可不传
* callback 保存成功后执行函数
*/
import
React
,
{
Component
}
from
'react'
;
import
{
Button
}
from
'antd'
;
import
AddModel
from
'./AddModal'
;
import
{
preHandle
}
from
'../../utils/myutils'
;
import
{
connect
}
from
'dva'
;
import
{
openToast
}
from
'../../location/Notification'
;
@
connect
()
export
default
class
idnex
extends
Component
{
constructor
(
props
){
super
(
props
)
this
.
state
=
{
visible
:
false
,
isLoading
:
false
}
}
showModal
=
()
=>
{
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
this
.
setState
({
visible
:
true
,
});
}
});
}
handleOk
=
()
=>
{
let
{
dispatch
}
=
this
.
props
;
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
preHandle
(
values
);
// 引入 import preHandle from '@/webPublic/one_stop_public/utils/myutils.js'
console
.
log
(
values
)
this
.
setState
({
isLoading
:
true
,
},()
=>
{
dispatch
({
type
:
'affair/startProcess'
,
payload
:
{
content
:
JSON
.
stringify
(
values
),
// 表单数据
appId
:
this
.
props
.
appId
,
// 这里应该由上级路由跳转传入 事务Id
id
:
!!
this
.
props
.
draftId
?
this
.
props
.
draftId
:
null
// 确认是否存在草稿表单Id存在即传入
},
callback
:
val
=>
{
if
(
val
)
{
if
(
this
.
props
?.
callback
){
this
.
props
.
callback
()
}
}
else
{
openToast
(
'error'
,
'保存失败'
,
'请尝试'
);
}
},
}).
then
(()
=>
{
this
.
setState
({
isLoading
:
false
,
visible
:
false
,
})
})
})
}
else
{
openToast
(
'error'
,
'提交失败'
,
'请填写必填项'
);
}
});
}
handleCancel
=
()
=>
{
this
.
setState
({
visible
:
false
})
}
render
()
{
const
{
text
}
=
this
.
props
const
{
visible
,
isLoading
,
}
=
this
.
state
return
(
<>
<
Button
onClick=
{
this
.
showModal
}
isLoading=
{
isLoading
}
type=
'primary'
>
{
text
??
'提交'
}
</
Button
>
<
AddModel
visible=
{
visible
}
handleOk=
{
this
.
handleOk
}
isLoading=
{
isLoading
}
handleCancel=
{
this
.
handleCancel
}
/>
</>
)
}
}
This diff is collapsed.
Click to expand it.
one_stop_public/AffairButton/按钮使用文档.md
0 → 100644
浏览文件 @
fbf8b038
## 提交按钮使用文档
## 引入
```
js
import
SumbitButton
from
'@/webPublic/one_stop_public/AffairButton/SumbitButton'
```
## 使用
```
js
<
SumbitButton
form
=
{
this
.
props
.
form
}
// form 控件
appId
=
{
'事务ID'
}
// 事务ID
text
=
'提交'
// 按钮文本
draftId
=
{
'草稿Id'
}
// 可不传 不传为发起全新 传后修改草稿
/
>
```
This diff is collapsed.
Click to expand it.
one_stop_public/表单设计器相关.md
浏览文件 @
fbf8b038
...
...
@@ -19,6 +19,7 @@ xlsx-oc
react
-
native
-
uuid
path
-
to
-
regexp
prop
-
types
react
-
signature
-
canvas
```
##抽离注意
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论