Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
0f756667
提交
0f756667
authored
5月 25, 2020
作者:
徐立
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化移动端横屏提示
上级
9e8c0faf
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
531 行增加
和
447 行删除
+531
-447
index.js
one_stop_public/libs/formList/index.js
+531
-447
没有找到文件。
one_stop_public/libs/formList/index.js
浏览文件 @
0f756667
...
...
@@ -15,7 +15,7 @@ import {
Select
,
Popconfirm
,
Tooltip
,
Spin
Spin
,
}
from
'antd'
;
import
{
connect
}
from
'dva'
;
import
PageHeaderWrapper
from
'./PageHeaderWrapper'
;
...
...
@@ -29,12 +29,12 @@ import ExportCurrentInfo from '../../App/ExportCurrentInfo';
import
StatisticsInfo
from
'../../App/StatisticsInfo'
;
import
ImportUtil
from
'../../App/ImportUtil'
;
import
SearchInfo
from
'../../App/SearchInfo'
;
import
{
Base16Encode
}
from
"../../Base16/index"
;
import
{
Base16Encode
}
from
'../../Base16/index'
;
import
{
isEmpty
}
from
'lodash'
import
FilePreview
from
"@/webPublic/one_stop_public/filePreview"
;
import
{
queryApiActionPath
}
from
"@/webPublic/one_stop_public/utils/queryConfig"
;
import
UploadCom
from
"@/webPublic/one_stop_public/libs/UploadCom"
;
import
{
isEmpty
}
from
'lodash'
;
import
FilePreview
from
'@/webPublic/one_stop_public/filePreview'
;
import
{
queryApiActionPath
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
UploadCom
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
const
FormItem
=
Form
.
Item
;
let
AllWidth
=
0
;
// 表格总长度
const
{
RangePicker
}
=
DatePicker
;
...
...
@@ -82,37 +82,33 @@ const CreateForm = Form.create()(props => {
handleModalVisible
,
formItem
,
getItem
,
isView
isView
,
}
=
props
;
//通过回调
const
okHandle
=
()
=>
{
form
.
validateFields
((
err
,
fieldsValue
)
=>
{
if
(
err
)
return
;
if
(
isView
)
{
if
(
isView
)
{
handleModalVisible
();
return
;
}
formItem
.
map
((
item
,
index
)
=>
{
if
(
item
.
type
.
indexOf
(
'DATE'
)
>
-
1
)
{
for
(
let
d
in
fieldsValue
)
{
if
(
item
.
name
===
d
&&
fieldsValue
[
d
])
{
if
(
item
.
name
===
d
&&
fieldsValue
[
d
])
{
fieldsValue
[
d
]
=
fieldsValue
[
d
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
break
break
;
}
}
}
else
if
(
number
.
includes
(
item
.
type
))
{
}
else
if
(
number
.
includes
(
item
.
type
))
{
for
(
let
d
in
fieldsValue
)
{
if
(
item
.
name
===
d
&&
fieldsValue
[
d
]
==
""
)
{
fieldsValue
[
d
]
=
null
break
if
(
item
.
name
===
d
&&
fieldsValue
[
d
]
==
''
)
{
fieldsValue
[
d
]
=
null
;
break
;
}
}
}
});
let
params
=
{
...
fieldsValue
};
handleAdd
(
params
,
isAdd
);
...
...
@@ -125,28 +121,33 @@ const CreateForm = Form.create()(props => {
width
=
"700px"
maskClosable
=
{
false
}
destroyOnClose
title
=
{
isView
?
"查看详情"
:(
isAdd
?
'新增'
:
'编辑'
)
}
title
=
{
isView
?
'查看详情'
:
isAdd
?
'新增'
:
'编辑'
}
visible
=
{
modalVisible
}
footer
=
{
isView
?
null
:[
footer
=
{
isView
?
null
:
[
<
Button
key
=
"back"
onClick
=
{()
=>
handleModalVisible
()}
>
取消
<
/Button>
,
<
Button
key
=
"submit"
type
=
"primary"
onClick
=
{
okHandle
}
>
确定
<
/Button
>
]}
<
/Button>
,
]
}
onOk
=
{
okHandle
}
onCancel
=
{()
=>
handleModalVisible
()}
>
{
formItem
.
map
((
item
,
index
)
=>
getItem
(
false
,
form
,
item
,
isAdd
,
formData
,
{
span
:
5
},
{
span
:
15
}))}
{
formItem
.
map
((
item
,
index
)
=>
getItem
(
false
,
form
,
item
,
isAdd
,
formData
,
{
span
:
5
},
{
span
:
15
}),
)}
<
/Modal
>
);
});
@
connect
(({
formList
,
loading
})
=>
({
formList
,
loading
:
loading
.
models
.
formList
,
formList
,
loading
:
loading
.
models
.
formList
,
}))
@
Form
.
create
()
class
FormList
extends
React
.
Component
{
...
...
@@ -155,58 +156,58 @@ class FormList extends React.Component {
list
:
[],
pagination
:
{},
},
selects
:[],
selects
:
[],
modalVisible
:
false
,
formData
:
null
,
formValues
:
{},
formItem
:
[],
objId
:
this
.
props
.
objId
||
(
this
.
props
.
location
?
this
.
props
.
location
.
state
.
id
:
null
),
objId
:
this
.
props
.
objId
||
(
this
.
props
.
location
?
this
.
props
.
location
.
state
.
id
:
null
),
isAdd
:
false
,
querys
:
[],
selectedRows
:
[],
primaryKey
:
null
,
options
:
{},
isTable
:
true
,
tableWidth
:
500
,
rights
:
this
.
props
.
rights
||
[],
columnRights
:[],
isReady
:
false
,
groups
:{},
showDiv
:
''
,
showMobileDiv
:
''
,
isView
:
false
tableWidth
:
500
,
rights
:
this
.
props
.
rights
||
[],
columnRights
:
[],
isReady
:
false
,
groups
:
{},
showDiv
:
''
,
showMobileDiv
:
''
,
isView
:
false
,
};
columns
=
[];
getOptions
=
()
=>
{
const
refIds
=
[]
const
refIds
=
[]
;
for
(
var
i
=
0
;
i
<
this
.
state
.
formItem
.
length
;
i
++
)
{
if
(
this
.
state
.
formItem
[
i
].
referenceObjId
!=
null
&&
this
.
state
.
options
[
this
.
state
.
formItem
[
i
].
id
+
''
]
==
null
)
{
refIds
.
push
(
datas
[
t
].
id
)
if
(
this
.
state
.
formItem
[
i
].
referenceObjId
!=
null
&&
this
.
state
.
options
[
this
.
state
.
formItem
[
i
].
id
+
''
]
==
null
)
{
refIds
.
push
(
datas
[
t
].
id
);
}
}
if
(
refIds
.
length
>
0
)
{
dispatch
({
type
:
'formList/getBatchOptions'
,
payload
:
{
ids
:
refIds
},
callback
:
(
options
)
=>
{
this
.
setState
({
options
:
{
...
this
.
state
.
options
,
...
options
}
})
}
callback
:
options
=>
{
this
.
setState
({
options
:
{
...
this
.
state
.
options
,
...
options
}
});
},
});
}
}
}
;
modify
=
record
=>
{
// if (this.state.formItem.length < 10) {
this
.
getOptions
()
this
.
getOptions
();
this
.
setState
({
formData
:
record
,
modalVisible
:
true
,
isAdd
:
false
,
isView
:
false
isView
:
false
,
});
// } else {
// router.push({
...
...
@@ -222,15 +223,14 @@ class FormList extends React.Component {
// }
};
view
=
record
=>
{
// if (this.state.formItem.length < 10) {
this
.
getOptions
()
this
.
getOptions
();
this
.
setState
({
formData
:
record
,
modalVisible
:
true
,
isAdd
:
false
,
isView
:
true
isView
:
true
,
});
// } else {
// router.push({
...
...
@@ -246,7 +246,7 @@ class FormList extends React.Component {
// }
};
isJSON
=
(
str
)
=>
{
isJSON
=
str
=>
{
if
(
typeof
str
==
'string'
)
{
try
{
var
obj
=
JSON
.
parse
(
str
);
...
...
@@ -255,14 +255,13 @@ class FormList extends React.Component {
}
else
{
return
false
;
}
}
catch
(
e
)
{
console
.
log
(
'error:'
+
str
+
'!!!'
+
e
);
return
false
;
}
}
console
.
log
(
'这不是个字符串'
)
}
console
.
log
(
'这不是个字符串'
)
;
}
;
delete
=
record
=>
{
//找出主键
...
...
@@ -272,7 +271,7 @@ class FormList extends React.Component {
type
:
'formList/delete'
,
payload
:
{
keys
:
JSON
.
stringify
(
Keys
),
objId
:
this
.
state
.
objId
objId
:
this
.
state
.
objId
,
},
callback
:
()
=>
{
this
.
getPage
();
...
...
@@ -281,14 +280,14 @@ class FormList extends React.Component {
};
viewProcess
=
record
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'formList/getAppId'
,
payload
:
{
code
:
record
.
process_biz_key
,
},
callback
:
(
data
)
=>
{
router
.
push
({
pathname
:
'/portal/serviceCentre/getdetail'
,
state
:
{
id
:
data
.
id
}})
callback
:
data
=>
{
router
.
push
({
pathname
:
'/portal/serviceCentre/getdetail'
,
state
:
{
id
:
data
.
id
}
});
},
});
};
...
...
@@ -296,73 +295,70 @@ class FormList extends React.Component {
/**
* 宽度自适应函数
*/
resize
=
(
e
)
=>
{
resize
=
e
=>
{
let
scrollWidth
=
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
;
//可使宽度
let
showMobileDiv
=
scrollWidth
-
77
if
(
document
.
querySelector
(
'#previewDiv'
)){
// 预览模式
let
showMobileDiv
=
scrollWidth
-
77
;
if
(
document
.
querySelector
(
'#previewDiv'
))
{
// 预览模式
this
.
setState
({
showMobileDiv
:
document
.
querySelector
(
'#previewDiv'
).
clientWidth
-
77
})
showMobileDiv
:
document
.
querySelector
(
'#previewDiv'
).
clientWidth
-
77
,
})
;
}
else
{
this
.
setState
({
showMobileDiv
,
})
}
console
.
log
(
showMobileDiv
)
});
}
console
.
log
(
showMobileDiv
);
};
//渲染值
componentDidMount
()
{
const
{
dispatch
,
isFormCom
,
isSelect
,
callback
,
valueName
}
=
this
.
props
;
window
.
addEventListener
(
'resize'
,
this
.
resize
);
if
(
this
.
props
.
objCode
)
{
const
{
dispatch
,
objCode
,
sql
}
=
this
.
props
;
if
(
this
.
props
.
objCode
)
{
const
{
dispatch
,
objCode
,
sql
}
=
this
.
props
;
if
(
objCode
==
1
||
objCode
==
"1"
)
{
if
(
objCode
==
1
||
objCode
==
'1'
)
{
this
.
initColumn
();
}
else
{
}
else
{
dispatch
({
type
:
'DataObj/findByCode'
,
payload
:
{
objCode
:
this
.
props
.
objCode
},
payload
:
{
objCode
:
this
.
props
.
objCode
},
callback
:
dataObj
=>
{
this
.
setState
({
objId
:
dataObj
.
id
,
isTable
:
data
.
isTable
},()
=>
{
this
.
setState
({
objId
:
dataObj
.
id
,
isTable
:
data
.
isTable
},
()
=>
{
dispatch
({
type
:
'DataRight/getUserRight'
,
payload
:
{
objId
:
this
.
state
.
objId
},
callback
:
data
=>
{
if
(
!
this
.
props
.
rights
)
{
if
(
!
this
.
props
.
rights
)
{
this
.
setState
({
rights
:
data
});
}
dispatch
({
type
:
'DataRight/getUserColumnRight'
,
payload
:
{
objId
:
this
.
state
.
objId
},
callback
:
data
=>
{
this
.
setState
({
columnRights
:
data
});
this
.
initColumn
();
}
}
,
});
}
}
,
});
});
},
});
}
}
else
{
}
else
{
dispatch
({
type
:
'formList/getObjDetail'
,
payload
:
{
id
:
this
.
state
.
objId
},
callback
:
data
=>
{
this
.
setState
({
isTable
:
data
.
isTable
});
}
}
,
});
dispatch
({
type
:
'DataRight/getUserRight'
,
payload
:
{
objId
:
this
.
state
.
objId
},
callback
:
data
=>
{
if
(
!
this
.
props
.
rights
)
{
if
(
!
this
.
props
.
rights
)
{
this
.
setState
({
rights
:
data
});
}
dispatch
({
...
...
@@ -371,188 +367,186 @@ class FormList extends React.Component {
callback
:
data
=>
{
this
.
setState
({
columnRights
:
data
});
this
.
initColumn
();
}
}
,
});
}
}
,
});
}
}
/**
* 移除监听器
*/
componentWillUnmount
(){
window
.
removeEventListener
(
'resize'
,
this
.
resize
);
componentWillUnmount
()
{
window
.
removeEventListener
(
'resize'
,
this
.
resize
);
}
custom
=
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
)):
null
componentWillReceiveProps
(
nextProps
){
custom
=
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
))
:
null
;
componentWillReceiveProps
(
nextProps
)
{
const
b
=
nextProps
.
value
||
{};
const
b
=
nextProps
.
value
||
{}
const
a
=
this
.
props
.
value
||
{};
const
jsonb
=
JSON
.
stringify
(
b
);
const
jsona
=
JSON
.
stringify
(
a
);
const
a
=
this
.
props
.
value
||
{}
const
jsonb
=
JSON
.
stringify
(
b
)
const
jsona
=
JSON
.
stringify
(
a
)
this
.
custom
=
Base16Encode
(
jsonb
)
if
(
jsona
!=
jsonb
){
let
params
=
{
pageNo
:
b
.
pageNo
?
b
.
pageNo
:
this
.
state
.
data
.
pagination
.
current
,
pageSize
:
b
.
pageSize
?
b
.
pageSize
:
this
.
state
.
data
.
pagination
.
pageSize
,
this
.
custom
=
Base16Encode
(
jsonb
);
if
(
jsona
!=
jsonb
)
{
let
params
=
{
pageNo
:
b
.
pageNo
?
b
.
pageNo
:
this
.
state
.
data
.
pagination
.
current
,
pageSize
:
b
.
pageSize
?
b
.
pageSize
:
this
.
state
.
data
.
pagination
.
pageSize
,
query
:
JSON
.
stringify
(
this
.
state
.
formValues
),
};
if
(
nextProps
.
value
.
columns
!=
null
&&
nextProps
.
value
.
columns
.
length
>
0
){
this
.
columns
=
nextProps
.
value
.
columns
if
(
nextProps
.
value
.
columns
!=
null
&&
nextProps
.
value
.
columns
.
length
>
0
)
{
this
.
columns
=
nextProps
.
value
.
columns
;
}
if
(
nextProps
.
value
.
getPage
){
this
.
getPage
(
params
,
null
,
nextProps
.
value
.
getPage
);
}
else
{
if
(
this
.
state
.
objId
)
this
.
getPage
(
params
)
if
(
nextProps
.
value
.
getPage
)
{
this
.
getPage
(
params
,
null
,
nextProps
.
value
.
getPage
);
}
else
{
if
(
this
.
state
.
objId
)
this
.
getPage
(
params
);
}
}
const
x
=
nextProps
.
selects
const
y
=
this
.
props
.
selects
if
(
JSON
.
stringify
(
x
)
!=
JSON
.
stringify
(
y
)){
this
.
setState
({
selects
:
x
})
const
x
=
nextProps
.
selects
;
const
y
=
this
.
props
.
selects
;
if
(
JSON
.
stringify
(
x
)
!=
JSON
.
stringify
(
y
))
{
this
.
setState
({
selects
:
x
});
}
}
initColumn
=
()
=>
{
initColumn
=
()
=>
{
const
{
dispatch
,
isFormCom
,
isSelect
,
callback
,
valueName
}
=
this
.
props
;
const
{
rights
,
columnRights
}
=
this
.
state
;
if
(
this
.
props
.
value
&&
this
.
props
.
value
.
columns
)
{
this
.
columns
=
this
.
props
.
value
.
columns
const
{
rights
,
columnRights
}
=
this
.
state
;
if
(
this
.
props
.
value
&&
this
.
props
.
value
.
columns
)
{
this
.
columns
=
this
.
props
.
value
.
columns
;
this
.
getPage
();
return
return
;
}
if
(
this
.
props
.
objCode
==
1
||
this
.
props
.
objCode
==
"1"
){
}
else
{
if
(
this
.
props
.
objCode
==
1
||
this
.
props
.
objCode
==
'1'
)
{
}
else
{
dispatch
({
type
:
'formList/getHead'
,
payload
:
{
dataObjId
:
this
.
state
.
objId
},
callback
:
datas
=>
{
const
querys
=
[]
const
refIds
=
[]
const
groups
=
{};
const
querys
=
[]
;
const
refIds
=
[]
;
const
groups
=
{};
if
(
datas
)
{
this
.
state
.
formItem
=
datas
;
let
i
=
0
;
for
(
let
t
in
datas
)
{
if
(
datas
[
t
].
isPrimaryKey
)
this
.
state
.
primaryKey
=
datas
[
t
].
name
;
if
(
datas
[
t
].
isHidden
)
{
continue
if
(
datas
[
t
].
isHidden
)
{
continue
;
}
let
column
=
{};
column
.
title
=
datas
[
t
].
title
;
column
.
dataIndex
=
datas
[
t
].
name
;
column
.
width
=
datas
[
t
].
width
;
if
(
i
==
0
)
column
.
fixed
=
'left'
;
if
(
i
==
0
)
column
.
fixed
=
'left'
;
if
(
columnRights
.
length
>
0
&&!
columnRights
.
includes
(
datas
[
t
].
id
))
{
if
(
columnRights
.
length
>
0
&&
!
columnRights
.
includes
(
datas
[
t
].
id
))
{
continue
;
}
if
(
data
.
includes
(
datas
[
t
].
type
))
{
column
.
render
=
(
val
)
=>
{
if
(
val
==
null
)
{
column
.
render
=
val
=>
{
if
(
val
==
null
)
{
return
val
;
}
if
(
datas
[
t
].
dataFormatStrWeb
!=
null
)
{
if
(
datas
[
t
].
dataFormatStrWeb
!=
null
)
{
return
moment
(
val
).
format
(
datas
[
t
].
dataFormatStrWeb
);
}
else
{
}
else
{
return
moment
(
val
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
}
}
}
else
if
(
datas
[
t
].
name
.
indexOf
(
"process_status"
)
>-
1
){
column
.
render
=
(
val
)
=>
val
?(
val
===
"0"
?
"审核通过"
:
"审核未通过"
):
null
}
else
if
(
datas
[
t
].
extendTypeId
&&
datas
[
t
].
extendTypeId
.
indexOf
(
"file"
)
>-
1
){
//特殊处理附件
column
.
render
=
(
val
)
=>
{
if
(
this
.
isJSON
(
val
)){
};
}
else
if
(
datas
[
t
].
name
.
indexOf
(
'process_status'
)
>
-
1
)
{
column
.
render
=
val
=>
(
val
?
(
val
===
'0'
?
'审核通过'
:
'审核未通过'
)
:
null
);
}
else
if
(
datas
[
t
].
extendTypeId
&&
datas
[
t
].
extendTypeId
.
indexOf
(
'file'
)
>
-
1
)
{
//特殊处理附件
column
.
render
=
val
=>
{
if
(
this
.
isJSON
(
val
))
{
val
=
JSON
.
parse
(
val
);
let
files
=
val
.
files
;
let
xx
=
(
<
ul
>
let
xx
=
(
<
ul
>
{
files
.
map
((
f
,
index2
)
=>
{
return
<
li
key
=
{
index2
}
><
FilePreview
path
=
{
queryApiActionPath
()
+
f
.
path
}
pathName
=
{
f
.
name
}
/>
</
li
>
}
)}
return
(
<
li
key
=
{
index2
}
>
<
FilePreview
path
=
{
queryApiActionPath
()
+
f
.
path
}
pathName
=
{
f
.
name
}
/
>
<
/li
>
);
}
)}
<
/ul
>
)
);
return
xx
;
}
else
{
}
else
{
return
val
;
}
}
}
else
{
column
.
render
=
(
val
)
=>
val
&&
val
.
length
>
100
?
<
Tooltip
title
=
{
val
}
overlayStyle
=
{{
width
:
1000
}}
>
<
span
style
=
{{
width
:
column
.
width
||
200
,
display
:
"block"
,
wordBreak
:
"keep-all"
,
whiteSpace
:
"nowrap"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
}}
>
{
val
}
<
/span
>
<
/Tooltip>:va
l
};
}
else
{
column
.
render
=
val
=>
val
&&
val
.
length
>
100
?
(
<
Tooltip
title
=
{
val
}
overlayStyle
=
{{
width
:
1000
}}
>
<
span
style
=
{{
width
:
column
.
width
||
200
,
display
:
'block'
,
wordBreak
:
'keep-all'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
}}
>
{
val
}
<
/span
>
<
/Tooltip
>
)
:
(
val
);
}
this
.
setState
({
tableWidth
:((
datas
.
length
-
1
)
*
200
)})
this
.
setState
({
tableWidth
:
(
datas
.
length
-
1
)
*
200
});
this
.
columns
.
push
(
column
);
if
(
datas
[
t
].
isShowQuery
)
{
querys
.
push
(
datas
[
t
])
querys
.
push
(
datas
[
t
])
;
if
(
datas
[
t
].
referenceObjId
!=
null
)
{
refIds
.
push
(
datas
[
t
].
id
)
refIds
.
push
(
datas
[
t
].
id
)
;
}
if
(
datas
[
t
].
isGroupQuery
!=
null
)
{
if
(
datas
[
t
].
isGroupQuery
!=
null
)
{
dispatch
({
type
:
'formList/getGroupList'
,
payload
:
{
columnId
:
datas
[
t
].
id
},
callback
:
(
gourp
)
=>
{
callback
:
gourp
=>
{
groups
[
datas
[
t
].
id
]
=
gourp
;
this
.
setState
({
groups
})
}
this
.
setState
({
groups
})
;
}
,
});
}
}
i
++
;
}
if
(
querys
.
length
>
0
)
{
this
.
setState
({
querys
})
this
.
setState
({
querys
})
;
if
(
refIds
.
length
>
0
)
{
dispatch
({
type
:
'formList/getBatchOptions'
,
payload
:
{
ids
:
refIds
},
callback
:
(
options
)
=>
{
this
.
setState
({
options
})
}
callback
:
options
=>
{
this
.
setState
({
options
})
;
}
,
});
}
}
this
.
getPage
();
}
},
});
}
}
sqlBs16
=
Base16Encode
(
this
.
props
.
sql
)
getPage
=
(
params
,
values
,
callPage
)
=>
{
if
(
this
.
columns
==
null
||
this
.
columns
.
length
==
0
){
};
sqlBs16
=
Base16Encode
(
this
.
props
.
sql
);
getPage
=
(
params
,
values
,
callPage
)
=>
{
if
(
this
.
columns
==
null
||
this
.
columns
.
length
==
0
)
{
return
;
}
const
{
dispatch
}
=
this
.
props
;
...
...
@@ -561,58 +555,52 @@ class FormList extends React.Component {
if
(
params
==
null
)
{
params
=
{
pageNo
:
pagination
.
current
?
pagination
.
current
:
1
,
pageSize
:
pagination
.
pageSize
?
pagination
.
pageSize
:
(
this
.
props
.
pageSize
||
10
)
,
query
:
JSON
.
stringify
(
values
!=
null
?
values
:
this
.
state
.
formValues
),
pageSize
:
pagination
.
pageSize
?
pagination
.
pageSize
:
this
.
props
.
pageSize
||
10
,
query
:
JSON
.
stringify
(
values
!=
null
?
values
:
this
.
state
.
formValues
),
};
}
if
(
this
.
props
.
objCode
&&
(
this
.
props
.
objCode
==
"1"
||
this
.
props
.
objCode
==
1
)){
if
(
callPage
){
callPage
(
params
,(
data
)
=>
{
if
(
!
this
.
state
.
isReady
){
this
.
setState
({
data
,
isReady
:
true
})
}
else
{
this
.
setState
({
data
})
}
})
}
else
if
(
this
.
props
.
value
&&
this
.
props
.
value
.
getPage
){
this
.
props
.
value
.
getPage
(
params
,(
data
)
=>
{
if
(
!
this
.
state
.
isReady
){
this
.
setState
({
data
,
isReady
:
true
})
}
else
{
this
.
setState
({
data
})
if
(
this
.
props
.
objCode
&&
(
this
.
props
.
objCode
==
'1'
||
this
.
props
.
objCode
==
1
))
{
if
(
callPage
)
{
callPage
(
params
,
data
=>
{
if
(
!
this
.
state
.
isReady
)
{
this
.
setState
({
data
,
isReady
:
true
});
}
else
{
this
.
setState
({
data
});
}
})
});
}
else
if
(
this
.
props
.
value
&&
this
.
props
.
value
.
getPage
)
{
this
.
props
.
value
.
getPage
(
params
,
data
=>
{
if
(
!
this
.
state
.
isReady
)
{
this
.
setState
({
data
,
isReady
:
true
});
}
else
{
this
.
setState
({
data
});
}
}
else
{
});
}
}
else
{
dispatch
({
type
:
'formList/fetch'
,
payload
:
{
custom
:
this
.
custom
,
custom
:
this
.
custom
,
...
params
,
sql
:
this
.
sqlBs16
,
sql
:
this
.
sqlBs16
,
dataObjId
:
this
.
state
.
objId
,
},
callback
:(
data
)
=>
{
if
(
!
this
.
state
.
isReady
){
this
.
setState
({
data
,
isReady
:
true
})
}
else
{
this
.
setState
({
data
})
}
callback
:
data
=>
{
if
(
!
this
.
state
.
isReady
)
{
this
.
setState
({
data
,
isReady
:
true
});
}
else
{
this
.
setState
({
data
});
}
},
});
}
};
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
;
...
...
@@ -641,7 +629,7 @@ class FormList extends React.Component {
objId
:
this
.
state
.
objId
,
isAdd
:
isAdd
,
isSelf
:
true
,
isView
:
false
isView
:
false
,
},
callback
:
()
=>
{
message
.
success
(
'操作成功'
);
...
...
@@ -662,12 +650,12 @@ class FormList extends React.Component {
add
=
()
=>
{
// if (this.state.formItem.length < 10) {
this
.
getOptions
()
this
.
getOptions
();
this
.
setState
({
modalVisible
:
true
,
formData
:
{},
isAdd
:
true
,
isView
:
false
isView
:
false
,
});
// } else {
// router.push({
...
...
@@ -678,8 +666,8 @@ class FormList extends React.Component {
};
handleSelectRows
=
rows
=>
{
if
(
this
.
props
.
onSelectRow
)
{
this
.
props
.
onSelectRow
(
rows
)
if
(
this
.
props
.
onSelectRow
)
{
this
.
props
.
onSelectRow
(
rows
)
;
}
this
.
setState
({
selectedRows
:
rows
,
...
...
@@ -698,8 +686,7 @@ 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
({
...
...
@@ -707,7 +694,7 @@ class FormList extends React.Component {
payload
:
{
keys
:
JSON
.
stringify
(
Keys
),
objId
:
this
.
state
.
objId
,
isSelf
:
true
isSelf
:
true
,
},
callback
:
()
=>
{
this
.
setState
({
...
...
@@ -721,26 +708,28 @@ class FormList extends React.Component {
goBack
=
()
=>
{
router
.
goBack
();
};
handleSearch
=
(
e
)
=>
{
handleSearch
=
e
=>
{
e
.
preventDefault
();
const
{
dispatch
,
form
}
=
this
.
props
;
const
{
formValues
}
=
this
.
state
;
const
{
formValues
}
=
this
.
state
;
form
.
validateFields
((
err
,
fieldsValue
)
=>
{
if
(
err
)
return
;
const
formItem
=
this
.
state
.
formItem
const
formItem
=
this
.
state
.
formItem
;
formItem
.
map
((
item
,
index
)
=>
{
if
(
item
.
type
.
indexOf
(
'DATE'
)
>
-
1
)
{
for
(
let
d
in
fieldsValue
)
{
if
(
item
.
name
===
d
&&
fieldsValue
[
d
])
{
if
(
fieldsValue
[
d
]
!=
null
&&
fieldsValue
[
d
].
length
>
0
){
fieldsValue
[
d
]
=
[
fieldsValue
[
d
][
0
].
format
(
'YYYY-MM-DD HH:mm:ss'
),
fieldsValue
[
d
][
1
].
format
(
'YYYY-MM-DD HH:mm:ss'
)];
}
else
{
fieldsValue
[
d
]
=
""
;
if
(
fieldsValue
[
d
]
!=
null
&&
fieldsValue
[
d
].
length
>
0
)
{
fieldsValue
[
d
]
=
[
fieldsValue
[
d
][
0
].
format
(
'YYYY-MM-DD HH:mm:ss'
),
fieldsValue
[
d
][
1
].
format
(
'YYYY-MM-DD HH:mm:ss'
),
];
}
else
{
fieldsValue
[
d
]
=
''
;
}
}
}
...
...
@@ -748,115 +737,137 @@ class FormList extends React.Component {
});
const
values
=
{
...
this
.
state
.
formValues
,
...
fieldsValue
...
fieldsValue
,
};
this
.
setState
({
formValues
:
fieldsValue
,
});
this
.
getPage
(
null
,
values
)
this
.
getPage
(
null
,
values
)
;
});
}
}
;
hanldeHighSearch
=
(
e
)
=>
{
hanldeHighSearch
=
e
=>
{
const
pagination
=
this
.
props
.
formList
.
data
.
pagination
;
let
params
=
{
pageNo
:
pagination
.
current
?
pagination
.
current
:
1
,
pageSize
:
pagination
.
pageSize
?
pagination
.
pageSize
:
(
this
.
props
.
pageSize
||
10
)
,
...
e
}
this
.
setState
({
formValues
:{...
e
,...
this
.
state
.
formValues
}})
this
.
getPage
(
params
)
}
pageSize
:
pagination
.
pageSize
?
pagination
.
pageSize
:
this
.
props
.
pageSize
||
10
,
...
e
,
}
;
this
.
setState
({
formValues
:
{
...
e
,
...
this
.
state
.
formValues
}
});
this
.
getPage
(
params
)
;
}
;
handleFormReset
=
()
=>
{
const
{
form
,
dispatch
}
=
this
.
props
;
form
.
resetFields
();
this
.
setState
({
this
.
setState
(
{
formValues
:
{},
},
()
=>
{
this
.
getPage
()
});
}
getItem
=
(
isQuery
,
form
,
item
,
isAdd
,
formData
,
labelCol
,
wrapperCol
)
=>
{
const
{
groups
,
isView
}
=
this
.
state
;
},
()
=>
{
this
.
getPage
();
},
);
};
getItem
=
(
isQuery
,
form
,
item
,
isAdd
,
formData
,
labelCol
,
wrapperCol
)
=>
{
const
{
groups
,
isView
}
=
this
.
state
;
//如果隐藏的话 就用隐藏域放置
if
(
item
.
isHidden
)
{
if
(
item
.
isHidden
)
{
return
(
<
FormItem
>
<
FormItem
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
})(
<
Input
type
=
'hidden'
placeholder
=
"请输入"
/>
)}
})(
<
Input
type
=
"hidden"
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
if
(
item
.
isPrimaryKey
)
{
if
(
isAdd
)
{
return
(
<><
/>
)
;
return
<><
/>
;
}
else
{
return
(
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
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
>
);
}
}
else
if
(
item
.
referenceObjId
!=
null
)
{
const
{
options
}
=
this
.
state
const
ops
=
options
[
item
.
id
+
''
]
||
[]
const
{
options
}
=
this
.
state
;
const
ops
=
options
[
item
.
id
+
''
]
||
[]
;
return
(
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
Select
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
{
ops
.
map
((
r
)
=>
<
Option
value
=
{
r
[
item
.
referenceCodeName
]}
key
=
{
r
[
item
.
referenceCodeName
]}
>
{
r
[
item
.
referenceNameName
]}
<
/Option>
)
}
<
/Select>
)
}
})(
<
Select
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
{
ops
.
map
(
r
=>
(
<
Option
value
=
{
r
[
item
.
referenceCodeName
]}
key
=
{
r
[
item
.
referenceCodeName
]}
>
{
r
[
item
.
referenceNameName
]}
<
/Option
>
))}
<
/Select>
,
)}
<
/FormItem
>
);
}
else
if
(
item
.
name
.
indexOf
(
"process_status"
)
>-
1
)
{
}
else
if
(
item
.
name
.
indexOf
(
'process_status'
)
>
-
1
)
{
return
(
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
Select
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
<
Option
value
=
{
'0'
}
key
=
{
'0'
}
>
审核通过
<
/Option
>
<
Option
value
=
{
'2'
}
key
=
{
'2'
}
>
审核未通过
<
/Option
>
<
/Select>
)
}
})(
<
Select
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
<
Option
value
=
{
'0'
}
key
=
{
'0'
}
>
审核通过
<
/Option
>
<
Option
value
=
{
'2'
}
key
=
{
'2'
}
>
审核未通过
<
/Option
>
<
/Select>
,
)}
<
/FormItem
>
);
}
else
if
(
item
.
extendTypeId
&&
item
.
extendTypeId
.
indexOf
(
"file"
)
>-
1
){
}
else
if
(
item
.
extendTypeId
&&
item
.
extendTypeId
.
indexOf
(
'file'
)
>
-
1
)
{
//特殊处理附件 如果是查询就 跳过
if
(
isQuery
)
return
;
if
(
isQuery
)
return
;
return
(
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
(
formData
[
item
.
name
]
&&
this
.
isJSON
(
formData
[
item
.
name
])?
JSON
.
parse
(
formData
[
item
.
name
]):
null
),
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
]
&&
this
.
isJSON
(
formData
[
item
.
name
])
?
JSON
.
parse
(
formData
[
item
.
name
])
:
null
,
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
UploadCom
disabled
=
{
isView
}
/>
)
}
<
/FormItem
>
);
}
else
if
(
isQuery
&&
item
.
isGroupQuery
!=
null
&&
item
.
isGroupQuery
){
//如果是查询 并且是组合查询
}
else
if
(
isQuery
&&
item
.
isGroupQuery
!=
null
&&
item
.
isGroupQuery
)
{
//如果是查询 并且是组合查询
const
ops
=
groups
[
item
.
id
+
''
]
||
[]
const
ops
=
groups
[
item
.
id
+
''
]
||
[]
;
return
(
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
Select
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
{
ops
.
map
((
r
)
=>
<
Option
value
=
{
r
.
value
}
key
=
{
r
.
value
}
>
{
r
.
value
}
<
/Option>
)
}
<
/Select>
)
}
})(
<
Select
disabled
=
{
isView
}
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
{
ops
.
map
(
r
=>
(
<
Option
value
=
{
r
.
value
}
key
=
{
r
.
value
}
>
{
r
.
value
}
<
/Option
>
))}
<
/Select>
,
)}
<
/FormItem
>
);
}
else
if
(
text
.
indexOf
(
item
.
type
)
>
-
1
)
{
...
...
@@ -865,7 +876,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
)
{
...
...
@@ -873,41 +884,49 @@ class FormList extends React.Component {
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
''
:
formData
[
item
.
name
],
rules
:
[{
required
:
!
item
.
isNull
},(
rule
,
value
,
callback
)
=>
{
var
errors
=
[];
var
reg
=
new
RegExp
(
/
(
^-
?[
0-9
][
0-9
]
*
(
.
[
0-9
]
+
)?)
$/
)
if
(
value
!=
null
&&
value
!=
""
&&!
reg
.
test
(
value
)){
errors
.
push
(
new
Error
(
"请输入数字"
),
rule
.
field
);
}
callback
(
errors
)
}],
})(
<
Input
disabled
=
{
isView
}
placeholder
=
"请输入"
/>
)}
rules
:
[
{
required
:
!
item
.
isNull
},
(
rule
,
value
,
callback
)
=>
{
var
errors
=
[];
var
reg
=
new
RegExp
(
/
(
^-
?[
0-9
][
0-9
]
*
(
.
[
0-9
]
+
)?)
$/
);
if
(
value
!=
null
&&
value
!=
''
&&
!
reg
.
test
(
value
))
{
errors
.
push
(
new
Error
(
'请输入数字'
),
rule
.
field
);
}
callback
(
errors
);
},
],
})(
<
Input
disabled
=
{
isView
}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
else
if
(
isQuery
&&
data
.
indexOf
(
item
.
type
)
>
-
1
)
{
}
else
if
(
isQuery
&&
data
.
indexOf
(
item
.
type
)
>
-
1
)
{
return
(
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
null
:
moment
(
formData
[
item
.
name
]),
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
RangePicker
disabled
=
{
isView
}
format
=
{
item
.
dataFormatStrWeb
==
null
?
"YYYY-MM-DD HH:mm:ss"
:
item
.
dataFormatStrWeb
}
style
=
{{
width
:
'95%'
}}
/>
)
}
<
RangePicker
disabled
=
{
isView
}
format
=
{
item
.
dataFormatStrWeb
==
null
?
'YYYY-MM-DD HH:mm:ss'
:
item
.
dataFormatStrWeb
}
style
=
{{
width
:
'95%'
}}
/>
,
)}
<
/FormItem
>
);
}
else
if
(
data
.
indexOf
(
item
.
type
)
>
-
1
)
{
}
else
if
(
data
.
indexOf
(
item
.
type
)
>
-
1
)
{
return
(
<
FormItem
labelCol
=
{
labelCol
}
wrapperCol
=
{
wrapperCol
}
label
=
{
item
.
title
}
key
=
{
item
.
id
}
>
{
form
.
getFieldDecorator
(
item
.
name
,
{
initialValue
:
formData
==
null
?
moment
()
:(
formData
[
item
.
name
]?
moment
(
formData
[
item
.
name
]):
null
),
initialValue
:
formData
==
null
?
moment
()
:
formData
[
item
.
name
]
?
moment
(
formData
[
item
.
name
])
:
null
,
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
DatePicker
format
=
{
item
.
dataFormatStrWeb
==
null
?
"YYYY-MM-DD HH:mm:ss"
:
item
.
dataFormatStrWeb
}
format
=
{
item
.
dataFormatStrWeb
==
null
?
'YYYY-MM-DD HH:mm:ss'
:
item
.
dataFormatStrWeb
}
style
=
{{
width
:
'100%'
}}
placeholder
=
"请输入"
disabled
=
{
isView
}
...
...
@@ -921,39 +940,42 @@ 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
,
}
=
this
.
props
;
const
{
form
,
get
}
=
this
.
props
;
const
{
querys
}
=
this
.
state
const
{
querys
}
=
this
.
state
;
if
(
querys
.
length
==
0
)
{
return
''
;
}
return
(
<
Form
layout
=
"inline"
>
<
Row
style
=
{{
padding
:
"15px"
}}
>
{
querys
.
map
((
item
)
=>
<
Col
style
=
{{
height
:
58
}}
span
=
{
get
===
'mobile'
?
24
:
8
}
key
=
{
item
.
id
}
>
{
this
.
getItem
(
true
,
form
,
{
<
Row
style
=
{{
padding
:
'15px'
}}
>
{
querys
.
map
(
item
=>
(
<
Col
style
=
{{
height
:
58
}}
span
=
{
get
===
'mobile'
?
24
:
8
}
key
=
{
item
.
id
}
>
{
this
.
getItem
(
true
,
form
,
{
...
item
,
isNull
:
true
},
true
)}
<
/Col
>
isNull
:
true
,
},
true
,
)}
<
/Col
>
))}
<
Col
span
=
{
get
===
'mobile'
?
24
:
8
}
<
Col
span
=
{
get
===
'mobile'
?
24
:
8
}
style
=
{{
textAlign
:
get
===
'mobile'
?
'right'
:
''
,
paddingRight
:
get
===
'mobile'
?
12
:
''
textAlign
:
get
===
'mobile'
?
'right'
:
''
,
paddingRight
:
get
===
'mobile'
?
12
:
''
,
}}
>
<
span
className
=
{
styles
.
submitButtons
}
>
...
...
@@ -973,17 +995,13 @@ class FormList extends React.Component {
);
}
render
()
{
const
{
modalVisible
,
selectedRows
,
querys
,
tableWidth
,
rights
,
data
,
isReady
,
}
=
this
.
state
;
if
(
!
isReady
){
return
<
div
style
=
{{
width
:
20
,
margin
:
"auto"
}}
><
Spin
/><
/div
>
const
{
modalVisible
,
selectedRows
,
querys
,
tableWidth
,
rights
,
data
,
isReady
}
=
this
.
state
;
if
(
!
isReady
)
{
return
(
<
div
style
=
{{
width
:
20
,
margin
:
'auto'
}}
>
<
Spin
/>
<
/div
>
);
}
const
{
isFormCom
,
...
...
@@ -994,18 +1012,16 @@ class FormList extends React.Component {
notShowBack
,
istableCom
,
// 是否有模板设计器调用
}
=
this
.
props
;
const
{
showMobileDiv
,
isView
}
=
this
.
state
const
{
showMobileDiv
,
isView
}
=
this
.
state
;
let
scrollWidth
=
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
;
//可使宽度
let
isMobile
=
scrollWidth
<
1200
if
(
document
.
querySelector
(
'#previewDiv'
))
{
isMobile
=
true
let
isMobile
=
scrollWidth
<
1200
;
if
(
document
.
querySelector
(
'#previewDiv'
))
{
isMobile
=
true
;
}
let
showDiv
=
document
.
querySelector
(
'#mobelDiv'
)
&&
document
.
querySelector
(
'#mobelDiv'
)?.
parentNode
.
clientWidth
let
showDiv
=
document
.
querySelector
(
'#mobelDiv'
)
&&
document
.
querySelector
(
'#mobelDiv'
)?.
parentNode
.
clientWidth
;
const
parentMethods
=
{
handleAdd
:
this
.
handleAdd
,
handleModalVisible
:
this
.
handleModalVisible
,
...
...
@@ -1013,117 +1029,190 @@ class FormList extends React.Component {
formItem
:
this
.
state
.
formItem
,
isAdd
:
this
.
state
.
isAdd
,
getItem
:
this
.
getItem
,
isView
:
isView
,
isView
:
isView
,
};
if
(
!
isSelect
&&!
rights
.
includes
(
'edit'
)
&&!
rights
.
includes
(
'delete'
)
&&!
rights
.
includes
(
"view"
)
&&!
rights
.
includes
(
"viewProcess"
)){
}
else
{
let
width
=
0
;
if
(
rights
&&
rights
.
includes
(
'viewProcess'
)){
width
=
width
+
75
;
if
(
!
isSelect
&&
!
rights
.
includes
(
'edit'
)
&&
!
rights
.
includes
(
'delete'
)
&&
!
rights
.
includes
(
'view'
)
&&
!
rights
.
includes
(
'viewProcess'
)
)
{
}
else
{
let
width
=
0
;
if
(
rights
&&
rights
.
includes
(
'viewProcess'
))
{
width
=
width
+
75
;
}
if
(
rights
&&
rights
.
includes
(
'view'
))
{
width
=
width
+
75
;
if
(
rights
&&
rights
.
includes
(
'view'
))
{
width
=
width
+
75
;
}
if
(
rights
&&
rights
.
includes
(
'edit'
))
{
width
=
width
+
40
;
if
(
rights
&&
rights
.
includes
(
'edit'
))
{
width
=
width
+
40
;
}
if
(
rights
&&
rights
.
includes
(
'delete'
))
{
width
=
width
+
40
;
if
(
rights
&&
rights
.
includes
(
'delete'
))
{
width
=
width
+
40
;
}
const
column
=
{
title
:
'操作'
,
fixed
:
'right'
,
width
:
width
,
render
:
(
text
,
record
)
=>
{
return
<
Fragment
>
<
div
style
=
{{
textAlign
:
'center'
}}
>
{
isSelect
?
this
.
state
.
selects
.
includes
(
record
[
valueName
])
?
<><
span
>
已选择
<
/span><Divide
r
type
=
"vertical"
/><
/> : <><
a
onClick
=
{
callback
.
bind
(
this
,
record
,
this
.
columns
)}
>
选择
<
/a><Divide
r
type
=
"vertical"
/><
/> : ''
}
{
rights
&&
!
rights
.
includes
(
'view'
)
?
''
:
<><
a
onClick
=
{
this
.
view
.
bind
(
this
,
record
)}
>
查看详情
<
/a><Divider type="vertical"/
><
/>
}
{
rights
&&
!
rights
.
includes
(
'edit'
)
?
''
:
<><
a
onClick
=
{
this
.
modify
.
bind
(
this
,
record
)}
>
编辑
<
/a><Divider type="vertical"/
><
/>
}
{
rights
&&
rights
.
includes
(
"viewProcess"
)
&&
record
.
process_biz_key
?
<><
a
onClick
=
{
this
.
viewProcess
.
bind
(
this
,
record
)}
>
查看流程详情
<
/a><Divider type="vertical"/
><
/>:''
}
{
rights
&&
!
rights
.
includes
(
'delete'
)
?
''
:
<>
<
Popconfirm
return
(
<
Fragment
>
<
div
style
=
{{
textAlign
:
'center'
}}
>
{
isSelect
?
(
this
.
state
.
selects
.
includes
(
record
[
valueName
])
?
(
<>
<
span
>
已选择
<
/span
>
<
Divider
type
=
"vertical"
/>
<
/
>
)
:
(
<>
<
a
onClick
=
{
callback
.
bind
(
this
,
record
,
this
.
columns
)}
>
选择
<
/a
>
<
Divider
type
=
"vertical"
/>
<
/
>
)
)
:
(
''
)}
{
rights
&&
!
rights
.
includes
(
'view'
)
?
(
''
)
:
(
<>
<
a
onClick
=
{
this
.
view
.
bind
(
this
,
record
)}
>
查看详情
<
/a
>
<
Divider
type
=
"vertical"
/>
<
/
>
)}
{
rights
&&
!
rights
.
includes
(
'edit'
)
?
(
''
)
:
(
<>
<
a
onClick
=
{
this
.
modify
.
bind
(
this
,
record
)}
>
编辑
<
/a
>
<
Divider
type
=
"vertical"
/>
<
/
>
)}
{
rights
&&
rights
.
includes
(
'viewProcess'
)
&&
record
.
process_biz_key
?
(
<>
<
a
onClick
=
{
this
.
viewProcess
.
bind
(
this
,
record
)}
>
查看流程详情
<
/a
>
<
Divider
type
=
"vertical"
/>
<
/
>
)
:
(
''
)}
{
rights
&&
!
rights
.
includes
(
'delete'
)
?
(
''
)
:
(
<>
{
' '
}
<
Popconfirm
title
=
"确定删除该数据?"
onConfirm
=
{
this
.
delete
.
bind
(
this
,
record
)}
okText
=
"确定"
cancelText
=
"取消"
>
<
a
>
删除
<
/a
>
<
/Popconfirm></
>
}
<
/Popconfirm
>
<
/
>
)}
<
/div
>
<
/Fragment
>
}
}
if
(
this
.
columns
.
length
>
0
&&
this
.
columns
[
this
.
columns
.
length
-
1
].
title
==
"操作"
){
this
.
columns
[
this
.
columns
.
length
-
1
]
=
column
;
}
else
{
);
},
};
if
(
this
.
columns
.
length
>
0
&&
this
.
columns
[
this
.
columns
.
length
-
1
].
title
==
'操作'
)
{
this
.
columns
[
this
.
columns
.
length
-
1
]
=
column
;
}
else
{
this
.
columns
.
push
(
column
);
}
}
if
(
this
.
columns
){
if
(
this
.
columns
)
{
/**
* 计算总长度
*/
AllWidth
=
0
this
.
columns
=
this
.
columns
.
map
((
item
,
index
)
=>
{
if
(
isEmpty
(
item
)){
return
item
}
if
(
index
===
this
.
columns
.
length
-
1
&&
this
.
columns
[
this
.
columns
.
length
-
1
].
title
!==
'操作'
){
AllWidth
+=
150
item
.
width
=
''
return
item
}
let
width
=
item
.
width
?
item
.
width
:
150
if
(
!
item
.
width
){
item
.
width
=
150
}
AllWidth
+=
width
return
item
})
if
(
!
isEmpty
(
this
.
columns
[
this
.
columns
.
length
-
1
])
&&
this
.
columns
[
this
.
columns
.
length
-
1
].
title
===
'操作'
){
this
.
columns
[
this
.
columns
.
length
-
2
].
width
=
''
AllWidth
+=
100
}
}
const
xxxx
=
<><
Card
bordered
=
{
false
}
bodyStyle
=
{{
padding
:
0
}}
>
AllWidth
=
0
;
this
.
columns
=
this
.
columns
.
map
((
item
,
index
)
=>
{
if
(
isEmpty
(
item
))
{
return
item
;
}
if
(
index
===
this
.
columns
.
length
-
1
&&
this
.
columns
[
this
.
columns
.
length
-
1
].
title
!==
'操作'
)
{
AllWidth
+=
150
;
item
.
width
=
''
;
return
item
;
}
let
width
=
item
.
width
?
item
.
width
:
150
;
if
(
!
item
.
width
)
{
item
.
width
=
150
;
}
AllWidth
+=
width
;
return
item
;
});
if
(
!
isEmpty
(
this
.
columns
[
this
.
columns
.
length
-
1
])
&&
this
.
columns
[
this
.
columns
.
length
-
1
].
title
===
'操作'
)
{
this
.
columns
[
this
.
columns
.
length
-
2
].
width
=
''
;
AllWidth
+=
100
;
}
}
const
xxxx
=
(
<>
<
Card
bordered
=
{
false
}
bodyStyle
=
{{
padding
:
0
}}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListForm
}
>
{
this
.
renderForm
()}
<
/div
>
<
div
className
=
{
styles
.
tableListOperator
}
>
{
notShowBack
?
notShowBack
:
<
Button
icon
=
"rollback"
type
=
"primary"
onClick
=
{
this
.
goBack
}
>
{
notShowBack
?
(
notShowBack
)
:
(
<
Button
icon
=
"rollback"
type
=
"primary"
onClick
=
{
this
.
goBack
}
>
返回
<
/Button>
}
{
rights
&&
!
rights
.
includes
(
'add'
)
?
''
:
<
/Button
>
)}
{
rights
&&
!
rights
.
includes
(
'add'
)
?
(
''
)
:
(
<
Button
icon
=
"plus"
type
=
"primary"
onClick
=
{
this
.
add
}
>
新建
<
/Button>
}
{
rights
&&
!
rights
.
includes
(
'searchData'
)
?
''
:
<
SearchInfo
hanldeHighSearch
=
{
this
.
hanldeHighSearch
}
objId
=
{
this
.
state
.
objId
}
/>
}
<
/Button
>
)}
{
rights
&&
!
rights
.
includes
(
'searchData'
)
?
(
''
)
:
(
<
SearchInfo
hanldeHighSearch
=
{
this
.
hanldeHighSearch
}
objId
=
{
this
.
state
.
objId
}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'importData'
)
?
''
:
<
ImportUtil
objId
=
{
this
.
state
.
objId
}
/>
}
{
rights
&&
!
rights
.
includes
(
'exportCurrent'
)
?
''
:
<
ExportCurrentInfo
objId
=
{
this
.
state
.
objId
}
{
rights
&&
!
rights
.
includes
(
'importData'
)
?
(
''
)
:
(
<
ImportUtil
objId
=
{
this
.
state
.
objId
}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'exportCurrent'
)
?
(
''
)
:
(
<
ExportCurrentInfo
objId
=
{
this
.
state
.
objId
}
query
=
{
JSON
.
stringify
(
this
.
state
.
formValues
)}
custom
=
{
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
)):
null
}
custom
=
{
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
))
:
null
}
sql
=
{
Base16Encode
(
this
.
props
.
sql
)}
/>
}
{
rights
&&
!
rights
.
includes
(
'exportData'
)
?
''
:
<
ExportInfo
objId
=
{
this
.
state
.
objId
}
/>
}
{
rights
&&
!
rights
.
includes
(
'statistics'
)
?
''
:
<
StatisticsInfo
objId
=
{
this
.
state
.
objId
}
/>
}
{
rights
&&
!
rights
.
includes
(
'delete'
)
?
''
:
selectedRows
.
length
>
0
&&
(
/
>
)}
{
rights
&&
!
rights
.
includes
(
'exportData'
)
?
(
''
)
:
(
<
ExportInfo
objId
=
{
this
.
state
.
objId
}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'statistics'
)
?
(
''
)
:
(
<
StatisticsInfo
objId
=
{
this
.
state
.
objId
}
/
>
)}
{
rights
&&
!
rights
.
includes
(
'delete'
)
?
''
:
selectedRows
.
length
>
0
&&
(
<
span
>
<
Popconfirm
title
=
"确定删除该数据?"
...
...
@@ -1131,75 +1220,70 @@ class FormList extends React.Component {
okText
=
"确定"
cancelText
=
"取消"
>
<
Button
>
批量删除
<
/Button></
Popconfirm
>
<
Button
>
批量删除
<
/Button
>
<
/Popconfirm
>
<
/span
>
)}
<
/div
>
{
(
!
istableCom
)
||
(
this
.
props
.
value
&&
this
.
props
.
value
.
columns
)?
{
!
istableCom
||
(
this
.
props
.
value
&&
this
.
props
.
value
.
columns
)
?
(
<
StandardTable
showHeader
=
{
this
.
props
.
showHeader
!=
null
?
this
.
props
.
showHeader
:
true
}
noSelectRow
=
{
this
.
props
.
onSelectRow
==
null
&&
(
rights
==
null
||
!
rights
.
includes
(
'delete'
))
}
showHeader
=
{
this
.
props
.
showHeader
!=
null
?
this
.
props
.
showHeader
:
true
}
noSelectRow
=
{
this
.
props
.
onSelectRow
==
null
&&
(
rights
==
null
||
!
rights
.
includes
(
'delete'
))
}
rowKey
=
"id"
data
=
{
data
}
isHiddenPage
=
{
this
.
props
.
isHiddenPage
!=
null
?
this
.
props
.
isHiddenPage
:
false
}
isHiddenPage
=
{
this
.
props
.
isHiddenPage
!=
null
?
this
.
props
.
isHiddenPage
:
false
}
columns
=
{
this
.
columns
}
scroll
=
{
this
.
props
.
value
&&
this
.
props
.
value
.
columns
?{}:
{
x
:
AllWidth
}}
scroll
=
{
this
.
props
.
value
&&
this
.
props
.
value
.
columns
?
{}
:
{
x
:
AllWidth
}}
selectedRows
=
{
selectedRows
}
onSelectRow
=
{
this
.
handleSelectRows
}
onChange
=
{
this
.
handleStandardTableChange
}
loading
=
{
this
.
props
.
loading
}
/
>
:
)
:
(
<
div
id
=
'mobelDiv'
id
=
"mobelDiv"
style
=
{{
overflow
:
'hidden'
,
width
:
isMobile
?
showMobileDiv
:
showDiv
,
height
:
'100%'
overflow
:
'hidden'
,
width
:
isMobile
?
showMobileDiv
:
showDiv
,
height
:
'100%'
,
}}
>
<
div
>
{
get
===
'mobile'
?
<
div
>
手机端
,
请将手机横屏查看
<
/div
>
:
null
<
div
>
{
get
===
'mobile'
?
<
div
>
手机端
,
请使用浏览器将手机横屏查看
<
/div> : null
}
{
showDiv
&&
(
<
StandardTable
showHeader
=
{
this
.
props
.
showHeader
!=
null
?
this
.
props
.
showHeader
:
true
}
noSelectRow
=
{
this
.
props
.
onSelectRow
==
null
&&
(
rights
==
null
||
!
rights
.
includes
(
'delete'
))
}
{
showDiv
&&<
StandardTable
showHeader
=
{
this
.
props
.
showHeader
!=
null
?
this
.
props
.
showHeader
:
true
}
noSelectRow
=
{
this
.
props
.
onSelectRow
==
null
&&
(
rights
==
null
||
!
rights
.
includes
(
'delete'
))
}
rowKey
=
"id"
data
=
{
data
}
columns
=
{
this
.
columns
}
scroll
=
{
this
.
props
.
value
&&
this
.
props
.
value
.
columns
?{}:
{
x
:
AllWidth
}}
scroll
=
{
this
.
props
.
value
&&
this
.
props
.
value
.
columns
?
{}
:
{
x
:
AllWidth
}}
selectedRows
=
{
selectedRows
}
isHiddenPage
=
{
this
.
props
.
isHiddenPage
!=
null
?
this
.
props
.
isHiddenPage
:
false
}
isHiddenPage
=
{
this
.
props
.
isHiddenPage
!=
null
?
this
.
props
.
isHiddenPage
:
false
}
onSelectRow
=
{
this
.
handleSelectRows
}
onChange
=
{
this
.
handleStandardTableChange
}
loading
=
{
this
.
props
.
loading
}
/
>
}
)}
<
/div
>
<
/div
>
}
)}
<
/div
>
<
/Card
>
<
CreateForm
{...
parentMethods
}
modalVisible
=
{
modalVisible
}
/></
>
<
CreateForm
{...
parentMethods
}
modalVisible
=
{
modalVisible
}
/
>
<
/
>
);
if
(
isFormCom
)
{
return
xxxx
return
xxxx
;
}
return
(
<
PageHeaderWrapper
title
=
""
>
{
xxxx
}
<
/PageHeaderWrapper
>
);
return
<
PageHeaderWrapper
title
=
""
>
{
xxxx
}
<
/PageHeaderWrapper>
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论