Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
cc838bc6
提交
cc838bc6
authored
5月 07, 2020
作者:
徐立
浏览文件
操作
浏览文件
下载
差异文件
合并
上级
841ebe1a
542ffc66
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
122 行增加
和
73 行删除
+122
-73
BatchAudit.js
FormInsertDiy/AffairPage/AuditPage/BatchAudit.js
+22
-0
index.js
FormInsertDiy/ListWithAddEditTemplate/index.js
+11
-8
ImgUploadCom.jsx
one_stop_public/libs/ImgUploadCom.jsx
+66
-0
MobileDate.jsx
one_stop_public/libs/MobileDate.jsx
+5
-3
index.jsx
one_stop_public/tableCompon/index.jsx
+18
-62
没有找到文件。
FormInsertDiy/AffairPage/AuditPage/BatchAudit.js
0 → 100644
浏览文件 @
cc838bc6
/***
* 批量审核
* 2020年5月7日 09:53:12
* 钟是志
*
* */
import
React
,
{
Component
}
from
'react'
;
import
AuditPage
from
'./index'
;
export
default
class
BatchAudit
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
return
(
<
AuditPage
{...
this
.
props
}
hasBatchAudit
=
{
true
}
/
>
)
}
}
FormInsertDiy/ListWithAddEditTemplate/index.js
浏览文件 @
cc838bc6
...
...
@@ -58,7 +58,7 @@ class ListWithAddEditTemplate extends React.Component {
isAdd
:
false
,
// 是新增还是编辑
selectedRows
:
[],
primaryKey
:
null
,
showEdit
:
false
,
// 是否显示编辑区域
//
showEdit: false, // 是否显示编辑区域
pageData
:
{
list
:
[],
pagination
:
{},
...
...
@@ -114,12 +114,12 @@ class ListWithAddEditTemplate extends React.Component {
// 新增按钮事件
add
=
()
=>
{
const
{
headerList
}
=
this
.
state
;
const
showEdit
=
headerList
.
length
>=
10
;
//
const showEdit = headerList.length >= 10;
this
.
setState
({
modalVisible
:
!
showEdit
,
modalVisible
:
true
,
formData
:
{},
isAdd
:
true
,
showEdit
,
//
showEdit,
});
};
...
...
@@ -127,18 +127,21 @@ class ListWithAddEditTemplate extends React.Component {
modify
=
record
=>
{
const
recordTemp
=
{
...
record
,
update_time
:
Date
.
now
()
};
const
{
headerList
}
=
this
.
state
;
const
showEdit
=
headerList
.
length
>=
10
;
//
const showEdit = headerList.length >= 10;
// 把record里明文key改成转换后的key,用于在模板表单中回显
const
headerMap
=
headerList
.
reduce
((
acc
,
header
)
=>
({
...
acc
,
[
header
.
name
]:
header
}),
{});
const
formData
=
Object
.
keys
(
recordTemp
).
reduce
(
(
acc
,
key
)
=>
({
...
acc
,
[
headerMap
[
key
].
base52
]:
recordTemp
[
key
]
}),
(
acc
,
key
)
=>
{
if
(
!
headerMap
[
key
])
return
acc
;
return
{
...
acc
,
[
headerMap
[
key
].
base52
]:
recordTemp
[
key
]
};
},
{}
);
this
.
setState
({
formData
,
modalVisible
:
!
showEdit
,
modalVisible
:
true
,
isAdd
:
false
,
showEdit
,
//
showEdit,
});
};
...
...
one_stop_public/libs/ImgUploadCom.jsx
0 → 100644
浏览文件 @
cc838bc6
import
React
from
'react'
import
{
Upload
,
message
}
from
'antd'
;
import
config
from
'@/config/config'
export
default
class
ImgUploadCom
extends
React
.
Component
{
constructor
(
props
){
super
(
props
)
const
value
=
props
.
value
this
.
state
=
{
url
:
value
}
}
triggerChange
=
(
changedValue
)
=>
{
// Should provide an event to pass value to Form.
const
onChange
=
this
.
props
.
onChange
;
if
(
onChange
)
{
onChange
(
changedValue
);
}
}
componentWillReceiveProps
(
nextProps
)
{
// Should be a controlled component.
if
(
'value'
in
nextProps
)
{
const
value
=
nextProps
.
value
;
this
.
setState
({
url
:
value
});
}
}
changeUrl
=
(
info
,
key
)
=>
{
if
(
info
.
file
.
status
===
'done'
)
{
message
.
success
(
`图片上传成功`
);
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
url
:
info
.
file
.
response
});
}
this
.
triggerChange
(
info
.
file
.
response
);
}
else
if
(
info
.
file
.
status
===
'error'
)
{
message
.
error
(
`图片上传失败`
);
}
}
changePos
=
(
obj
)
=>
{
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({...
obj
});
}
this
.
triggerChange
({...
obj
});
}
render
()
{
const
{
json
,
disabled
}
=
this
.
props
const
{
url
}
=
this
.
state
return
(
<
Upload
.
Dragger
disabled=
{
disabled
}
accept=
{
"image/*"
}
url=
{
url
}
showUploadList=
{
false
}
name=
"file"
action=
{
config
.
uploadUrl
}
onChange=
{
this
.
changeUrl
}
multiple=
{
false
}
style=
{
{
padding
:
0
}
}
>
{
url
?
<
img
src=
{
config
.
httpServer
+
(
url
)
}
style=
{
{
height
:
json
.
height
,
width
:
json
.
width
}
}
/>
:
<
div
style=
{
{
height
:
json
.
height
,
width
:
json
.
width
}
}
>
</
div
>
}
</
Upload
.
Dragger
>
);
}
}
\ No newline at end of file
one_stop_public/libs/MobileDate.jsx
浏览文件 @
cc838bc6
...
...
@@ -64,7 +64,7 @@ export default class MobileDate extends Component {
}
render
()
{
let
{
dates
}
=
this
.
state
const
{
format
}
=
this
.
props
const
startTime
=
dates
.
length
>
0
?
dates
[
0
].
valueOf
():
null
const
endTime
=
dates
.
length
>
1
?
dates
[
1
].
valueOf
():
null
...
...
@@ -72,18 +72,20 @@ export default class MobileDate extends Component {
<
div
>
<
DatePicker
// value={this.state.date}
extra=
{
<
span
style=
{
{
fontSize
:
14
}
}
>
{
!!
startTime
?
moment
(
startTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
):
'请选择时间'
}
</
span
>
}
extra=
{
<
span
style=
{
{
fontSize
:
14
}
}
>
{
!!
startTime
?
moment
(
startTime
).
format
(
format
?
format
:
'YYYY-MM-DD HH:mm:ss'
):
'请选择时间'
}
</
span
>
}
locale=
{
{
okText
:
"确定"
,
dismissText
:
'取消'
}
}
value=
{
!!
startTime
?
new
Date
(
startTime
):
null
}
format=
{
format
?
format
:
'YYYY-MM-DD HH:mm:ss'
}
onChange=
{
date
=>
this
.
handelStartChange
(
date
)
}
>
<
List
.
Item
arrow=
"horizontal"
>
开始时间
</
List
.
Item
>
</
DatePicker
>
<
DatePicker
// value={this.state.date}
extra=
{
<
span
style=
{
{
fontSize
:
14
}
}
>
{
!!
endTime
?
moment
(
endTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
):
'请选择时间'
}
</
span
>
}
extra=
{
<
span
style=
{
{
fontSize
:
14
}
}
>
{
!!
endTime
?
moment
(
endTime
).
format
(
format
?
format
:
'YYYY-MM-DD HH:mm:ss'
):
'请选择时间'
}
</
span
>
}
value=
{
!!
endTime
?
new
Date
(
endTime
):
null
}
locale=
{
{
okText
:
"确定"
,
dismissText
:
'取消'
}
}
format=
{
format
?
format
:
'YYYY-MM-DD HH:mm:ss'
}
onChange=
{
date
=>
this
.
handelEndChange
(
date
)
}
>
<
List
.
Item
arrow=
"horizontal"
>
结束时间
</
List
.
Item
>
...
...
one_stop_public/tableCompon/index.jsx
浏览文件 @
cc838bc6
...
...
@@ -49,6 +49,7 @@ import TableSelect from '../libs/TableSelect';
import
LocationCom
from
'../libs/LocationCom'
import
MobileDate
from
'../libs/MobileDate'
;
import
ChildForm
from
'../libs/ChildForm'
;
import
ImgUploadCom
from
'../libs/ImgUploadCom'
;
import
moment
from
'moment'
;
import
router
from
'umi/router'
;
import
TableList
from
'../libs/TableList'
;
...
...
@@ -116,14 +117,6 @@ const errorHandler = error => {
}
};
let
oldProps
=
{}
const
normFile
=
(
e
)
=>
{
console
.
log
(
e
)
if
(
Array
.
isArray
(
e
))
{
return
e
;
}
return
e
&&
e
.
fileList
[
0
];
}
@
connect
(({
DataColumn
,
SqlManageEntity
,
formList
,
loading
})
=>
({
DataColumn
,
SqlManageEntity
,
formList
,
loading
:
loading
.
models
.
DataColumn
||
loading
.
models
.
SqlManageEntity
||
loading
.
models
.
formList
...
...
@@ -774,11 +767,11 @@ export default class tableCom extends Component {
}
reqUtil
=
(
base52
,
json
,
orgCallback
,
url
,
method
,
params
,
callback
,
options
=
{})
=>
{
//查缓存
var
isChange
=
fals
e
;
var
isChange
=
tru
e
;
if
(
url
.
indexOf
(
"http"
)
===
-
1
)
{
url
=
config
.
httpServer
+
url
}
const
{
reqUrls
}
=
this
.
state
const
{
reqUrls
}
=
this
.
state
if
(
reqUrls
[
url
]
!=
null
)
{
const
ps
=
reqUrls
[
url
].
params
...
...
@@ -860,7 +853,7 @@ export default class tableCom extends Component {
}
return
"norefeshxxxxxxxxxxxxxxxxxxxx"
}
this
.
setState
({
reqUrls
},
()
=>
{
this
.
setState
({
},
()
=>
{
for
(
let
i
in
params
)
{
if
(
params
[
i
]
==
null
)
{
delete
params
[
i
]
...
...
@@ -884,10 +877,10 @@ export default class tableCom extends Component {
method
:
method
,
requestType
:
"form"
}).
then
(
data
=>
{
this
.
setState
({
res
:
data
},
()
=>
{
const
{
reqUrls
}
=
this
.
state
reqUrls
[
url
].
data
=
data
this
.
setState
({
reqUrls
})
const
{
reqUrls
}
=
this
.
state
reqUrls
[
url
].
data
=
data
this
.
setState
({
res
:
data
,
reqUrls
},
()
=>
{
if
(
callback
)
{
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
...
...
@@ -1471,16 +1464,7 @@ export default class tableCom extends Component {
return
dataColumn
;
};
changeUrl
=
(
info
,
key
)
=>
{
if
(
info
.
file
.
status
===
'done'
)
{
message
.
success
(
`图片上传成功`
);
this
.
setState
({
url
:
info
.
file
.
response
})
}
else
if
(
info
.
file
.
status
===
'error'
)
{
message
.
error
(
`图片上传失败`
);
}
}
render
()
{
/**
* json为申请表单
...
...
@@ -1933,19 +1917,14 @@ export default class tableCom extends Component {
if
(
end
!=
null
)
ivs
.
push
(
moment
(
parseInt
(
init
[
end
.
base52
])));
}
if
(
begin
!=
null
&&
end
!=
null
)
{
if
(
!
isEdit
)
{
r
:
cm
=
<
span
>
{
moment
(
parseInt
(
obj
[
begin
.
base52
])).
format
(
json
.
format
?
json
.
format
:
'YYYY-MM-DD HH:mm:ss'
)
}
至
{
' '
}
{
moment
(
parseInt
(
obj
[
end
.
base52
])).
format
(
json
.
format
?
json
.
format
:
'YYYY-MM-DD HH:mm:ss'
)
}
</
span
>
}
else
{
cm
=
getFieldDecorator
(
begin
.
base52
+
'_'
+
end
.
base52
,
{
initialValue
:
ivs
,
rules
:
[{
required
:
required
,
message
:
'请选择起止时间'
}],
})(<
RangePicker
showTime
/>);
}
}
else
{
cm
=
""
}
...
...
@@ -2545,7 +2524,7 @@ export default class tableCom extends Component {
cm
=
getFieldDecorator
(
begin
.
base52
+
'$'
+
end
.
base52
,
{
initialValue
:
ivs
,
rules
:
json
.
vlds
&&
json
.
vlds
.
length
>
0
?
json
.
vlds
:
[{
required
:
required
,
message
:
'请选择起止时间'
}],
})(<
MobileDate
disabled=
{
disabled
}
/>);
})(<
MobileDate
disabled=
{
disabled
}
formate=
{
json
.
format
}
/>);
if
(
json
.
isLabel
&&
title
)
{
cm
=
<
Form
.
Item
labelCol=
{
{
span
:
json
.
labelSpan
}
}
...
...
@@ -2560,7 +2539,7 @@ export default class tableCom extends Component {
cm
=
getFieldDecorator
(
begin
.
base52
+
'$'
+
end
.
base52
,
{
initialValue
:
ivs
,
rules
:
json
.
vlds
&&
json
.
vlds
.
length
>
0
?
json
.
vlds
:
[{
required
:
required
,
message
:
'请选择起止时间'
}],
})(<
RangePicker
showTime
disabled=
{
disabled
}
/>);
})(<
RangePicker
showTime
=
{
json
.
showTime
!=
null
?
json
.
showTime
:
true
}
format=
{
json
.
format
?
json
.
format
:
"YYYY-MM-DD HH:mm:ss"
}
disabled=
{
disabled
}
/>);
}
if (json.label == null) title = '起止时间';
break;
...
...
@@ -2612,7 +2591,7 @@ export default class tableCom extends Component {
rules
:
json
.
vlds
&&
json
.
vlds
.
length
>
0
?
json
.
vlds
:
[{
required
:
required
,
message
:
'请选择起止时间'
}],
}
)(
<
DatePicker
disabled=
{
disabled
}
showTime
showTime
=
{
json
.
showTime
!=
null
?
json
.
showTime
:
true
}
onOpenChange=
{
get
===
'mobile'
?
()
=>
{
// 取消唤起移动端小键盘
setTimeout
(()
=>
{
if
(
document
.
querySelector
(
'.ant-calendar-input '
))
{
...
...
@@ -2712,33 +2691,10 @@ export default class tableCom extends Component {
}
break
;
case
'ImgUploadCom'
:
cm
=
getFieldDecorator
(
"img$"
+
dataColumn
.
base52
,
{
valuePropName
:
'fileList[0]'
,
getValueFromEvent
:
normFile
,
})(
<
Upload
.
Dragger
disabled=
{
disabled
}
accept=
{
"image/*"
}
url=
{
this
.
state
.
url
||
initValue
}
showUploadList=
{
false
}
name=
"file"
action=
{
config
.
uploadUrl
}
onChange=
{
info
=>
this
.
changeUrl
(
info
,
dataColumn
.
base52
)
}
multiple=
{
false
}
style=
{
{
padding
:
0
}
}
>
{
this
.
state
.
url
||
initValue
?
<
img
src=
{
config
.
httpServer
+
(
this
.
state
.
url
||
initValue
)
}
style=
{
{
height
:
json
.
height
,
width
:
json
.
width
}
}
/>
:
<
div
style=
{
{
height
:
json
.
height
,
width
:
json
.
width
}
}
>
</
div
>
}
</
Upload
.
Dragger
>
);
cm
=
getFieldDecorator
(
dataColumn
.
base52
,
{
initialValue
:
initValue
,
})(<
ImgUploadCom
json=
{
json
}
disabled=
{
disabled
}
/>);
if
(
get
===
'mobile'
&&
json
.
isLabel
&&
title
)
{
cm
=
<
Form
.
Item
labelCol=
{
{
span
:
json
.
labelSpan
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论