Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
da122e60
Commit
da122e60
authored
May 24, 2021
by
涂茜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bug
parent
b27051f5
Pipeline
#28135
passed with stages
in 5 minutes 1 second
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
Basic.tsx
packages/extend-components/EC_DeviceTree/src/demos/Basic.tsx
+1
-1
index.js
packages/extend-components/EC_DeviceTree/src/index.js
+10
-5
index.less
packages/extend-components/EC_DeviceTree/src/index.less
+13
-3
No files found.
packages/extend-components/EC_DeviceTree/src/demos/Basic.tsx
View file @
da122e60
...
@@ -43,7 +43,7 @@ const Demo = () => {
...
@@ -43,7 +43,7 @@ const Demo = () => {
pageSize
:
20
,
pageSize
:
20
,
// deviceTypes: '二供泵房,二供机组',
// deviceTypes: '二供泵房,二供机组',
getChild
:
true
,
getChild
:
true
,
//
userID: 1,
userID
:
1
,
// queryInfo: '',
// queryInfo: '',
// sortFields: '',
// sortFields: '',
// direction: '',
// direction: '',
...
...
packages/extend-components/EC_DeviceTree/src/index.js
View file @
da122e60
...
@@ -22,7 +22,7 @@ const DeviceTree = (props) => {
...
@@ -22,7 +22,7 @@ const DeviceTree = (props) => {
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
params
,
setParams
]
=
useState
({});
const
[
params
,
setParams
]
=
useState
({});
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
total
Count
,
setTotalCount
]
=
useState
(
0
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -31,7 +31,7 @@ const DeviceTree = (props) => {
...
@@ -31,7 +31,7 @@ const DeviceTree = (props) => {
pageSize
:
serviceParams
.
pageSize
||
20
,
pageSize
:
serviceParams
.
pageSize
||
20
,
deviceTypes
:
serviceParams
.
deviceTypes
||
'二供泵房,二供机组'
,
deviceTypes
:
serviceParams
.
deviceTypes
||
'二供泵房,二供机组'
,
getChild
:
serviceParams
.
getChild
,
getChild
:
serviceParams
.
getChild
,
userID
:
serviceParams
.
userID
||
0
,
userID
:
serviceParams
.
userID
||
''
,
queryInfo
:
serviceParams
.
queryInfo
||
''
,
queryInfo
:
serviceParams
.
queryInfo
||
''
,
sortFields
:
serviceParams
.
sortFields
||
''
,
sortFields
:
serviceParams
.
sortFields
||
''
,
direction
:
serviceParams
.
direction
||
''
,
direction
:
serviceParams
.
direction
||
''
,
...
@@ -61,7 +61,7 @@ const DeviceTree = (props) => {
...
@@ -61,7 +61,7 @@ const DeviceTree = (props) => {
const
newData
=
handleData
(
data
);
const
newData
=
handleData
(
data
);
setLoading
(
false
);
setLoading
(
false
);
setTreeData
(
newData
);
setTreeData
(
newData
);
setTotal
(
response
.
data
.
totalPages
);
setTotal
Count
(
response
.
data
.
totalCount
);
onTreeCheck
([
newData
[
0
]]);
onTreeCheck
([
newData
[
0
]]);
onTreeSelect
([
newData
[
0
]]);
onTreeSelect
([
newData
[
0
]]);
}
else
{
}
else
{
...
@@ -118,7 +118,7 @@ const DeviceTree = (props) => {
...
@@ -118,7 +118,7 @@ const DeviceTree = (props) => {
onChange
=
{
onSearch
}
onChange
=
{
onSearch
}
onPressEnter
=
{
onSearch
}
onPressEnter
=
{
onSearch
}
/
>
/
>
<
Divider
/>
<
Divider
className
=
{
classNames
(
`
${
prefixCls
}
-divider`
)}
/
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-content`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-content`
)}
>
<
Spin
spinning
=
{
loading
}
>
<
Spin
spinning
=
{
loading
}
>
{
!!
treeData
.
length
&&
(
{
!!
treeData
.
length
&&
(
...
@@ -143,11 +143,16 @@ const DeviceTree = (props) => {
...
@@ -143,11 +143,16 @@ const DeviceTree = (props) => {
hideOnSinglePage
hideOnSinglePage
current
=
{
params
.
pageIndex
||
1
}
current
=
{
params
.
pageIndex
||
1
}
pageSize
=
{
params
.
pageSize
||
20
}
pageSize
=
{
params
.
pageSize
||
20
}
total
=
{
total
}
total
=
{
total
Count
}
onChange
=
{
onPaginationChange
}
onChange
=
{
onPaginationChange
}
/
>
/
>
<
/div
>
<
/div
>
)}
)}
{
!
pagination
&&
(
<
Divider
plain
className
=
{
classNames
(
`
${
prefixCls
}
-total`
)}
>
共
{
totalCount
}
条
记录
<
/Divider
>
)}
<
/div
>
<
/div
>
);
);
};
};
...
...
packages/extend-components/EC_DeviceTree/src/index.less
View file @
da122e60
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
height: 100%;
height: 100%;
padding: 5px;
padding: 5px;
.ant
-divider {
&
-divider {
margin: 6px 0 12px 0;
margin: 6px 0 12px 0;
}
}
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
width: 100%;
width: 100%;
}
}
.ant-tree-
indent
{
.ant-tree-
switcher-noop
{
width:
0
;
width:
14px
;
}
}
.ant-tree-node-content-wrapper {
.ant-tree-node-content-wrapper {
...
@@ -46,4 +46,14 @@
...
@@ -46,4 +46,14 @@
&-pagination {
&-pagination {
margin: 10px auto;
margin: 10px auto;
}
}
&-total.ant-divider-horizontal.ant-divider-with-text {
margin: 10px auto;
color: #a4b1c7;
}
.ant-divider-horizontal.ant-divider-with-text::before,
.ant-divider-horizontal.ant-divider-with-text::after {
top: 0;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment