Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
d55855f6
提交
d55855f6
authored
5月 12, 2020
作者:
chscls@163.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
树型组件
上级
e97216ea
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
127 行增加
和
12 行删除
+127
-12
TableList.js
one_stop_public/libs/TableList.js
+2
-2
TreeList.js
one_stop_public/libs/formList/TreeList.js
+104
-5
TreeListNew.js
one_stop_public/libs/formList/TreeListNew.js
+0
-0
index.js
one_stop_public/libs/formList/index.js
+13
-5
FormList.js
one_stop_public/models/FormList.js
+8
-0
没有找到文件。
one_stop_public/libs/TableList.js
浏览文件 @
d55855f6
...
...
@@ -41,10 +41,10 @@ export default class TableList extends React.Component {
}
render
()
{
const
{
isTree
}
=
this
.
props
const
{
isTree
,
json
}
=
this
.
props
return
isTree
?
<
TreeList
json
=
{
json
}
onSelectRow
=
{
this
.
props
.
value
.
onSelectRow
}
istableCom
=
{
true
}
showHeader
=
{
this
.
props
.
showHeader
}
...
...
one_stop_public/libs/formList/TreeList.js
浏览文件 @
d55855f6
...
...
@@ -13,6 +13,7 @@ import {
message
,
Modal
,
Select
,
Tree
,
Popconfirm
,
Tooltip
,
Spin
...
...
@@ -30,17 +31,15 @@ import StatisticsInfo from '../../App/StatisticsInfo';
import
ImportUtil
from
'../../App/ImportUtil'
;
import
SearchInfo
from
'../../App/SearchInfo'
;
import
{
Base16Encode
}
from
"../../Base16/index"
;
import
baseX
from
'base-x'
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
bs16
=
baseX
(
BASE16
)
const
FormItem
=
Form
.
Item
;
let
AllWidth
=
0
;
// 表格总长度
const
{
RangePicker
}
=
DatePicker
;
const
TreeNode
=
Tree
.
TreeNode
;
const
text
=
[
'BINARY'
,
'BIT'
,
...
...
@@ -145,6 +144,10 @@ class TreeList extends React.Component {
list
:
[],
pagination
:
{},
},
treeData
:
[{
title
:
'根目录'
,
key
:
'0-0'
}],
isReady
:
false
,
parentName
:
"根节点"
,
parentId
:
null
,
selects
:[],
modalVisible
:
false
,
formData
:
null
,
...
...
@@ -189,6 +192,19 @@ class TreeList extends React.Component {
});
}
}
getList
=
(
values
,
callback
)
=>
{
const
{
dispatch
,
json
:{
treeParentIdName
}}
=
this
.
props
;
if
(
!
values
)
{
values
=
this
.
state
.
formValues
}
dispatch
({
type
:
'formList/tree'
,
payload
:
{...
values
,
parentIdName
:
treeParentIdName
,
dataObjId
:
this
.
state
.
objId
},
callback
:
callback
});
}
modify
=
record
=>
{
// if (this.state.formItem.length < 10) {
this
.
getOptions
()
...
...
@@ -937,6 +953,71 @@ class TreeList extends React.Component {
<
/Form
>
);
}
onSelect
=
(
selectedKeys
,
info
)
=>
{
if
(
info
.
selectedNodes
.
length
>
0
)
{
const
parentId
=
selectedKeys
[
0
]
!=
"0-0"
?
selectedKeys
[
0
]
:
null
this
.
setState
({
parentName
:
info
.
selectedNodes
[
0
].
props
.
title
,
parentId
})
this
.
getPage
({
parentId
:
parentId
})
}
}
onLoadData
=
(
treeNode
)
=>
{
return
new
Promise
((
resolve
)
=>
{
if
(
treeNode
.
props
.
childs
)
{
resolve
();
return
;
}
const
parentId
=
treeNode
.
props
.
eventKey
!=
"0-0"
?
treeNode
.
props
.
eventKey
:
null
this
.
getList
({
parentId
:
parentId
},
(
list
)
=>
{
treeNode
.
props
.
dataRef
.
childs
=
list
;
this
.
setState
({
treeData
:
[...
this
.
state
.
treeData
]
});
resolve
();
})
});
}
renderTreeNodes
=
(
list
)
=>
{
const
{
json
:{
treeTitleName
,
treeKeyName
}}
=
this
.
props
return
list
.
map
((
item
)
=>
{
item
.
title
=
item
[
treeTitleName
]
item
.
key
=
item
[
treeKeyName
]
if
(
item
.
childs
)
{
return
(
<
TreeNode
title
=
{
item
[
treeTitleName
]}
key
=
{
item
.
key
}
dataRef
=
{
item
}
>
{
this
.
renderTreeNodes
(
item
.
childs
)}
<
/TreeNode
>
);
}
return
<
TreeNode
{...
item
}
dataRef
=
{
item
}
/>
;
})
}
refesh
=
(
parentId
,
list
,
data
)
=>
{
if
(
parentId
==
null
)
{
data
[
0
].
childs
=
list
return
data
}
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
data
[
i
].
key
==
parentId
)
{
data
[
i
].
childs
=
list
break
;
}
else
{
if
(
data
[
i
].
childs
)
{
this
.
refesh
(
parentId
,
list
,
data
[
i
].
childs
)
}
}
}
return
data
}
render
()
{
const
{
modalVisible
,
...
...
@@ -958,6 +1039,7 @@ class TreeList extends React.Component {
valueName
,
notShowBack
,
istableCom
,
// 是否有模板设计器调用
json
:{
treeSpan
}
}
=
this
.
props
;
const
{
showMobileDiv
,
...
...
@@ -1066,7 +1148,24 @@ class TreeList extends React.Component {
AllWidth
+=
100
}
}
const
xxxx
=
<><
Card
bordered
=
{
false
}
bodyStyle
=
{{
padding
:
0
}}
>
const
xxxx
=
<>
<
Row
gutter
=
{
16
}
>
<
Col
span
=
{
treeSpan
}
>
<
Card
bordered
=
{
false
}
style
=
{{
minHeight
:
500
}}
>
<
Tree
showLine
defaultExpandedKeys
=
{[
"0-0"
]}
onSelect
=
{
this
.
onSelect
}
loadData
=
{
this
.
onLoadData
}
>
{
this
.
renderTreeNodes
(
this
.
state
.
treeData
)}
<
/Tree>
<
/Card
>
<
/Col
>
<
Col
span
=
{
24
-
treeSpan
}
>
<
Card
bordered
=
{
false
}
bodyStyle
=
{{
padding
:
0
}}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListForm
}
>
{
this
.
renderForm
()}
<
/div
>
<
div
className
=
{
styles
.
tableListOperator
}
>
...
...
@@ -1155,7 +1254,7 @@ class TreeList extends React.Component {
<
/div
>
<
/Card
>
<
/Card>
</
Col
><
/Row
>
<
CreateForm
{...
parentMethods
}
modalVisible
=
{
modalVisible
}
/></
>
if
(
isFormCom
)
{
return
xxxx
...
...
one_stop_public/libs/formList/TreeListNew.js
deleted
100644 → 0
浏览文件 @
e97216ea
差异被折叠。
点击展开。
one_stop_public/libs/formList/index.js
浏览文件 @
d55855f6
...
...
@@ -843,11 +843,19 @@ class FormList extends React.Component {
}
else
if
(
number
.
indexOf
(
item
.
type
)
>
-
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
}],
})(
<
InputNumber
placeholder
=
"请输入"
min
=
{
0
}
/>
)
}
<
/FormItem
>
{
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
(
!
reg
.
test
(
value
)){
errors
.
push
(
new
Error
(
"请输入数字"
),
rule
.
field
);
}
callback
(
errors
)
}],
})(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
);
}
else
if
(
isQuery
&&
data
.
indexOf
(
item
.
type
)
>
-
1
)
{
...
...
one_stop_public/models/FormList.js
浏览文件 @
d55855f6
...
...
@@ -27,6 +27,14 @@ export default {
}
if
(
callback
)
callback
(
response
);
},
*
tree
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/getFormDataList'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
if
(
callback
)
callback
(
response
);
},
*
getAppId
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
'/UnifiedAppFormApi/getDetailByCode'
,
payload
);
if
(
!
response
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论