Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
cb92eb5a
提交
cb92eb5a
authored
5月 09, 2020
作者:
chscls@163.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
f5570902
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
59 行增加
和
7 行删除
+59
-7
TreeList.js
one_stop_public/libs/formList/TreeList.js
+59
-7
没有找到文件。
one_stop_public/libs/formList/TreeList.js
浏览文件 @
cb92eb5a
...
@@ -32,11 +32,15 @@ import SearchInfo from '../../App/SearchInfo';
...
@@ -32,11 +32,15 @@ import SearchInfo from '../../App/SearchInfo';
import
{
Base16Encode
}
from
"../../Base16/index"
;
import
{
Base16Encode
}
from
"../../Base16/index"
;
import
baseX
from
'base-x'
import
baseX
from
'base-x'
import
{
isEmpty
}
from
'lodash'
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
BASE16
=
'0123456789abcdef'
const
BASE16
=
'0123456789abcdef'
const
bs16
=
baseX
(
BASE16
)
const
bs16
=
baseX
(
BASE16
)
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
let
AllWidth
=
0
;
// 表格总长度
let
AllWidth
=
0
;
// 表格总长度
const
{
RangePicker
}
=
DatePicker
;
const
{
RangePicker
}
=
DatePicker
;
const
text
=
[
const
text
=
[
'BINARY'
,
'BINARY'
,
'BIT'
,
'BIT'
,
...
@@ -104,7 +108,7 @@ const CreateForm = Form.create()(props => {
...
@@ -104,7 +108,7 @@ const CreateForm = Form.create()(props => {
handleAdd
(
params
,
isAdd
);
handleAdd
(
params
,
isAdd
);
});
});
};
};
console
.
log
(
"isView"
,
isView
)
//需要获取动态表单
//需要获取动态表单
return
(
return
(
<
Modal
<
Modal
...
@@ -232,6 +236,24 @@ class TreeList extends React.Component {
...
@@ -232,6 +236,24 @@ class TreeList extends React.Component {
// }
// }
};
};
isJSON
=
(
str
)
=>
{
if
(
typeof
str
==
'string'
)
{
try
{
var
obj
=
JSON
.
parse
(
str
);
if
(
typeof
obj
==
'object'
&&
obj
)
{
return
true
;
}
else
{
return
false
;
}
}
catch
(
e
)
{
console
.
log
(
'error:'
+
str
+
'!!!'
+
e
);
return
false
;
}
}
console
.
log
(
'这不是个字符串'
)
}
delete
=
record
=>
{
delete
=
record
=>
{
//找出主键
//找出主键
let
Keys
=
{};
let
Keys
=
{};
...
@@ -369,17 +391,16 @@ class TreeList extends React.Component {
...
@@ -369,17 +391,16 @@ class TreeList extends React.Component {
pageSize
:
this
.
props
.
pageSize
||
10
,
pageSize
:
this
.
props
.
pageSize
||
10
,
query
:
JSON
.
stringify
(
this
.
state
.
formValues
),
query
:
JSON
.
stringify
(
this
.
state
.
formValues
),
};
};
if
(
nextProps
.
value
.
columns
!=
null
&&
nextProps
.
value
.
columns
.
length
>
0
){
this
.
columns
=
nextProps
.
value
.
columns
this
.
columns
=
nextProps
.
value
.
columns
}
this
.
custom
=
Base16Encode
(
JSON
.
stringify
(
b
))
this
.
custom
=
Base16Encode
(
JSON
.
stringify
(
b
))
if
(
nextProps
.
value
.
getPage
){
if
(
nextProps
.
value
.
getPage
){
this
.
getPage
(
params
,
null
,
nextProps
.
value
.
getPage
);
this
.
getPage
(
params
,
null
,
nextProps
.
value
.
getPage
);
}
else
{
}
else
{
if
(
this
.
state
.
objId
)
this
.
getPage
(
params
)
if
(
this
.
state
.
objId
)
this
.
getPage
(
params
)
}
}
}
}
const
x
=
nextProps
.
selects
const
x
=
nextProps
.
selects
const
y
=
this
.
props
.
selects
const
y
=
this
.
props
.
selects
...
@@ -441,7 +462,27 @@ class TreeList extends React.Component {
...
@@ -441,7 +462,27 @@ class TreeList extends React.Component {
}
}
}
else
if
(
datas
[
t
].
name
.
indexOf
(
"process_status"
)
>-
1
){
}
else
if
(
datas
[
t
].
name
.
indexOf
(
"process_status"
)
>-
1
){
column
.
render
=
(
val
)
=>
val
?(
val
===
"0"
?
"审核通过"
:
"审核未通过"
):
null
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
>
{
files
.
map
((
f
,
index2
)
=>
{
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
}}
>
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
>
<
span
style
=
{{
width
:
column
.
width
||
200
,
display
:
"block"
,
wordBreak
:
"keep-all"
,
whiteSpace
:
"nowrap"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
}}
>
{
val
}
<
/span
>
<
/Tooltip>:va
l
<
/Tooltip>:va
l
...
@@ -767,6 +808,17 @@ class TreeList extends React.Component {
...
@@ -767,6 +808,17 @@ class TreeList extends React.Component {
<
/FormItem
>
<
/FormItem
>
);
);
}
else
if
(
item
.
extendTypeId
&&
item
.
extendTypeId
.
indexOf
(
"file"
)
>-
1
){
//特殊处理附件 如果是查询就 跳过
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
),
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
UploadCom
/>
)}
<
/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
+
''
]
||
[]
...
@@ -845,7 +897,7 @@ class TreeList extends React.Component {
...
@@ -845,7 +897,7 @@ class TreeList extends React.Component {
form
,
form
,
get
,
get
,
}
=
this
.
props
;
}
=
this
.
props
;
console
.
log
(
get
)
const
{
querys
}
=
this
.
state
const
{
querys
}
=
this
.
state
if
(
querys
.
length
==
0
)
{
if
(
querys
.
length
==
0
)
{
return
''
;
return
''
;
...
@@ -962,7 +1014,7 @@ class TreeList extends React.Component {
...
@@ -962,7 +1014,7 @@ class TreeList extends React.Component {
onClick
=
{
this
.
view
.
bind
(
this
,
record
)}
>
查看详情
<
/a><Divider type="vertical"/
><
/>
}
onClick
=
{
this
.
view
.
bind
(
this
,
record
)}
>
查看详情
<
/a><Divider type="vertical"/
><
/>
}
{
rights
&&
!
rights
.
includes
(
'edit'
)
?
''
:
<><
a
{
rights
&&
!
rights
.
includes
(
'edit'
)
?
''
:
<><
a
onClick
=
{
this
.
modify
.
bind
(
this
,
record
)}
>
编辑
<
/a><Divider type="vertical"/
><
/>
}
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
(
"viewProcess"
)
&&
record
.
process_biz_key
?
<><
a
onClick
=
{
this
.
viewProcess
.
bind
(
this
,
record
)}
>
查看流程详情
<
/a><Divider type="vertical"/
><
/>:''
}
{
rights
&&
!
rights
.
includes
(
'delete'
)
?
''
:
<>
<
Popconfirm
{
rights
&&
!
rights
.
includes
(
'delete'
)
?
''
:
<>
<
Popconfirm
title
=
"确定删除该数据?"
title
=
"确定删除该数据?"
onConfirm
=
{
this
.
delete
.
bind
(
this
,
record
)}
onConfirm
=
{
this
.
delete
.
bind
(
this
,
record
)}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论