Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
4eab6c50
提交
4eab6c50
authored
12月 12, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2022年12月12日 姚新国说的 没配这个东西都搞成 true qq 聊天记录
上级
0b44f6e5
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
83 行增加
和
34 行删除
+83
-34
index.js
one_stop_public/libs/formList/index.js
+83
-34
没有找到文件。
one_stop_public/libs/formList/index.js
浏览文件 @
4eab6c50
...
...
@@ -71,7 +71,8 @@ const CreateForm = Form.create()((props) => {
//处理日期何时入库问题
try
{
fieldsValue
[
d
]
=
fieldsValue
[
d
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
}
catch
(
e
)
{}
}
catch
(
e
)
{
}
break
;
}
}
...
...
@@ -118,7 +119,11 @@ const CreateForm = Form.create()((props) => {
);
});
@
connect
(({
formList
,
DataColumn
,
DataObj
})
=>
({
@
connect
(({
formList
,
DataColumn
,
DataObj
})
=>
({
formList
,
DataColumn
,
DataObj
,
...
...
@@ -288,7 +293,11 @@ class FormList extends React.Component {
window
.
addEventListener
(
'resize'
,
this
.
resize
);
if
(
this
.
props
.
objCode
)
{
const
{
dispatch
,
objCode
,
sql
}
=
this
.
props
;
const
{
dispatch
,
objCode
,
sql
}
=
this
.
props
;
if
(
Number
(
objCode
)
===
1
)
{
this
.
initColumn
();
...
...
@@ -414,8 +423,15 @@ class FormList extends React.Component {
}
initColumn
=
()
=>
{
const
{
dispatch
,
value
,
objCode
}
=
this
.
props
;
const
{
rights
,
columnRights
}
=
this
.
state
;
const
{
dispatch
,
value
,
objCode
}
=
this
.
props
;
const
{
rights
,
columnRights
}
=
this
.
state
;
if
(
value
&&
value
.
columns
)
{
this
.
columns
=
value
.
columns
;
let
cacheList
=
[];
...
...
@@ -440,7 +456,9 @@ class FormList extends React.Component {
if
(
Number
(
objCode
)
===
1
)
{
this
.
getPage
();
}
else
{
if
(
this
.
props
.
json
?.
isDiy
){
// 2022年11月8日 姚鑫国说的 开起了这个 自定义模式 就不调接口查表头了. 也不调接口查枚举项那些
if
(
this
.
props
.
json
?.
isDiy
!==
'false'
&&
this
.
props
.
json
?.
isDiy
!==
false
)
{
// 2022年11月8日 姚鑫国说的 开起了这个 自定义模式 就不调接口查表头了. 也不调接口查枚举项那些
// 2022年12月12日 姚新国说的 没配这个东西都搞成 true qq 聊天记录
this
.
getPage
();
return
undefined
;
}
...
...
@@ -492,7 +510,9 @@ class FormList extends React.Component {
if
(
Number
(
objCode
)
===
1
)
{
}
else
{
if
(
this
.
props
.
json
?.
isDiy
){
// 2022年11月8日 姚鑫国说的 开起了这个 自定义模式 就不调接口查表头了.
if
(
this
.
props
.
json
?.
isDiy
!==
'false'
&&
this
.
props
.
json
?.
isDiy
!==
false
)
{
// 2022年11月8日 姚鑫国说的 开起了这个 自定义模式 就不调接口查表头了.
// 2022年12月12日 姚新国说的 没配这个东西都搞成 true qq 聊天记录
this
.
getPage
();
return
undefined
;
}
...
...
@@ -542,9 +562,11 @@ class FormList extends React.Component {
return
val
;
}
if
(
datas
[
t
].
dataFormatStrWeb
!=
null
)
{
return
moment
(
val
).
format
(
datas
[
t
].
dataFormatStrWeb
);
return
moment
(
val
)
.
format
(
datas
[
t
].
dataFormatStrWeb
);
}
else
{
return
moment
(
val
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
return
moment
(
val
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
);
}
};
}
else
if
(
datas
[
t
].
name
.
indexOf
(
'process_status'
)
>
-
1
)
{
...
...
@@ -560,7 +582,7 @@ class FormList extends React.Component {
{
files
.
map
((
f
,
index2
)
=>
{
return
(
<
li
key
=
{
index2
}
>
<
FilePreview
path
=
{
queryFileUrl
(
f
.
path
)}
pathName
=
{
f
.
name
}
/
>
<
FilePreview
path
=
{
queryFileUrl
(
f
.
path
)}
pathName
=
{
f
.
name
}
/
>
<
/li
>
);
})}
...
...
@@ -713,7 +735,8 @@ class FormList extends React.Component {
};
handleStandardTableChange
=
(
pagination
,
filtersArg
,
sorter
)
=>
{
const
filters
=
Object
.
keys
(
filtersArg
).
reduce
((
obj
,
key
)
=>
{
const
filters
=
Object
.
keys
(
filtersArg
)
.
reduce
((
obj
,
key
)
=>
{
const
newObj
=
{
...
obj
};
newObj
[
key
]
=
getValue
(
filtersArg
[
key
]);
return
newObj
;
...
...
@@ -800,7 +823,8 @@ class FormList extends React.Component {
for
(
let
i
in
columns
)
{
if
(
columns
[
i
].
isPrimaryKey
)
{
//key
Keys
[
columns
[
i
].
name
]
=
selectedRows
.
map
((
row
)
=>
row
[
columns
[
i
].
name
]).
join
(
','
);
Keys
[
columns
[
i
].
name
]
=
selectedRows
.
map
((
row
)
=>
row
[
columns
[
i
].
name
])
.
join
(
','
);
}
}
this
.
props
.
dispatch
({
...
...
@@ -825,7 +849,10 @@ class FormList extends React.Component {
handleSearch
=
(
e
)
=>
{
e
.
preventDefault
();
const
{
dispatch
,
form
}
=
this
.
props
;
const
{
dispatch
,
form
}
=
this
.
props
;
const
{
formValues
}
=
this
.
state
;
...
...
@@ -876,7 +903,10 @@ class FormList extends React.Component {
this
.
getPage
(
params
);
};
handleFormReset
=
()
=>
{
const
{
form
,
dispatch
}
=
this
.
props
;
const
{
form
,
dispatch
}
=
this
.
props
;
form
.
resetFields
();
this
.
setState
(
{
...
...
@@ -888,14 +918,17 @@ class FormList extends React.Component {
);
};
getItem
=
(
isQuery
,
form
,
item
,
isAdd
,
formData
,
labelCol
,
wrapperCol
)
=>
{
const
{
groups
,
isView
}
=
this
.
state
;
const
{
groups
,
isView
}
=
this
.
state
;
//如果隐藏的话 就用隐藏域放置
if
(
item
.
isHidden
)
{
return
(
<
FormItem
className
=
{
styles
.
hidden
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
})(
<
Input
type
=
"hidden"
placeholder
=
"请输入"
/>
)}
})(
<
Input
type
=
"hidden"
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
...
...
@@ -909,7 +942,7 @@ class FormList extends React.Component {
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
Input
style
=
{{
width
:
'70%'
}}
readOnly
=
{
!
isAdd
}
placeholder
=
"请输入"
/>
)}
})(
<
Input
style
=
{{
width
:
'70%'
}}
readOnly
=
{
!
isAdd
}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
...
...
@@ -929,7 +962,8 @@ class FormList extends React.Component {
showSearch
filterOption
=
{(
input
,
option
)
=>
option
?
option
.
props
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
?
option
.
props
.
children
.
toLowerCase
()
.
indexOf
(
input
.
toLowerCase
())
>=
0
:
false
}
placeholder
=
"请选择"
...
...
@@ -974,7 +1008,7 @@ class FormList extends React.Component {
?
JSON
.
parse
(
formData
[
item
.
name
])
:
null
,
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
UploadCom
disabled
=
{
isView
}
/>
)
}
})(
<
UploadCom
disabled
=
{
isView
}
/>
)
}
<
/FormItem
>
);
}
else
if
(
isQuery
&&
item
.
isGroupQuery
!=
null
&&
item
.
isGroupQuery
)
{
...
...
@@ -995,7 +1029,8 @@ class FormList extends React.Component {
showSearch
filterOption
=
{(
input
,
option
)
=>
option
?
option
.
props
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
?
option
.
props
.
children
.
toLowerCase
()
.
indexOf
(
input
.
toLowerCase
())
>=
0
:
false
}
allowClear
>
...
...
@@ -1014,7 +1049,7 @@ class FormList extends React.Component {
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
Input
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请输入"
/>
)}
})(
<
Input
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
else
if
(
number
.
indexOf
(
item
.
type
)
>
-
1
)
{
...
...
@@ -1033,7 +1068,7 @@ class FormList extends React.Component {
callback
(
errors
);
},
],
})(
<
Input
disabled
=
{
isView
}
placeholder
=
"请输入"
/>
)}
})(
<
Input
disabled
=
{
isView
}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
else
if
(
isQuery
&&
date
.
indexOf
(
item
.
type
)
>
-
1
)
{
...
...
@@ -1078,14 +1113,18 @@ class FormList extends React.Component {
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
Input
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请输入"
/>
)}
})(
<
Input
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
};
renderForm
()
{
const
{
form
,
get
,
json
}
=
this
.
props
;
const
{
form
,
get
,
json
}
=
this
.
props
;
const
{
querys
}
=
this
.
state
;
if
(
querys
.
length
===
0
||
json
?.
isHiddenSearch
===
true
)
{
...
...
@@ -1158,7 +1197,13 @@ class FormList extends React.Component {
};
render
()
{
const
{
modalVisible
,
selectedRows
,
rights
,
data
,
isReady
}
=
this
.
state
;
const
{
modalVisible
,
selectedRows
,
rights
,
data
,
isReady
}
=
this
.
state
;
if
(
!
isReady
)
{
return
(
<
div
...
...
@@ -1166,7 +1211,7 @@ class FormList extends React.Component {
width
:
20
,
margin
:
'auto'
,
}}
>
<
Spin
/>
<
Spin
/>
<
/div
>
);
}
...
...
@@ -1183,7 +1228,11 @@ class FormList extends React.Component {
uuid
,
obj
,
}
=
this
.
props
;
const
{
showMobileDiv
,
isView
,
loading
}
=
this
.
state
;
const
{
showMobileDiv
,
isView
,
loading
}
=
this
.
state
;
let
scrollWidth
=
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
;
//可使宽度
let
isMobile
=
scrollWidth
<
1000
;
...
...
@@ -1274,7 +1323,7 @@ class FormList extends React.Component {
Dom
.
map
((
x
,
index
)
=>
(
<
Fragment
key
=
{
Math
.
random
()}
>
{
x
}
{
index
>
0
&&
index
!==
Dom
.
length
-
1
&&
<
Divider
type
=
"vertical"
/>
}
{
index
>
0
&&
index
!==
Dom
.
length
-
1
&&
<
Divider
type
=
"vertical"
/>
}
<
/Fragment
>
))}
<
/div
>
...
...
@@ -1365,13 +1414,13 @@ class FormList extends React.Component {
{
rights
&&
!
rights
.
includes
(
'searchData'
)
?
(
''
)
:
(
<
SearchInfo
hanldeHighSearch
=
{
this
.
hanldeHighSearch
}
objId
=
{
this
.
state
.
objId
}
/
>
<
SearchInfo
hanldeHighSearch
=
{
this
.
hanldeHighSearch
}
objId
=
{
this
.
state
.
objId
}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'importData'
)
?
(
''
)
:
(
<
ImportUtil
objId
=
{
this
.
state
.
objId
}
callback
=
{()
=>
this
.
getPage
()}
/
>
<
ImportUtil
objId
=
{
this
.
state
.
objId
}
callback
=
{()
=>
this
.
getPage
()}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'exportCurrent'
)
?
(
...
...
@@ -1388,12 +1437,12 @@ class FormList extends React.Component {
{
rights
&&
!
rights
.
includes
(
'exportData'
)
?
(
''
)
:
(
<
ExportInfo
objId
=
{
this
.
state
.
objId
}
/
>
<
ExportInfo
objId
=
{
this
.
state
.
objId
}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'statistics'
)
?
(
''
)
:
(
<
StatisticsInfo
objId
=
{
this
.
state
.
objId
}
/
>
<
StatisticsInfo
objId
=
{
this
.
state
.
objId
}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'delete'
)
?
''
...
...
@@ -1435,7 +1484,7 @@ class FormList extends React.Component {
<
/Popover
>
)}
{
btns
&&
btns
.
after
&&
btns
.
after
.
length
>
0
?
btns
.
after
.
map
((
r
)
=>
<
Button
{...
r
}
loading
=
{
loading
}
/>
)
?
btns
.
after
.
map
((
r
)
=>
<
Button
{...
r
}
loading
=
{
loading
}
/>
)
:
''
}
{
!!
this
.
props
.
otherProps
&&
...
...
@@ -1507,7 +1556,7 @@ class FormList extends React.Component {
)}
<
/div
>
<
/Card
>
<
CreateForm
{...
parentMethods
}
modalVisible
=
{
modalVisible
}
/
>
<
CreateForm
{...
parentMethods
}
modalVisible
=
{
modalVisible
}
/
>
<
/
>
);
if
(
isFormCom
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论