Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
CivManage
Commits
0e46664d
Commit
0e46664d
authored
Jan 17, 2024
by
田翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 代码优化
parent
86655bcc
Pipeline
#84311
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
index.js
...g/menuconfig/WorkDesign/components/Designer/Left/index.js
+14
-3
index.less
...menuconfig/WorkDesign/components/Designer/Left/index.less
+12
-7
No files found.
src/pages/productCenter/mobileConfig/menuconfig/WorkDesign/components/Designer/Left/index.js
View file @
0e46664d
import
React
,
{
useState
,
useRef
,
useContext
,
useMemo
,
useEffect
}
from
'react'
import
{
Checkbox
,
Row
,
Col
,
Button
,
message
}
from
'antd'
import
{
Checkbox
,
Row
,
Col
,
Button
,
message
,
Input
}
from
'antd'
import
{
useDrag
,
useDrop
,
DndProvider
}
from
'react-dnd'
import
{
CaretRightOutlined
}
from
'@ant-design/icons'
import
styles
from
'./index.less'
import
{
GlobalStore
}
from
'../index'
import
{
getCardVersion
,
upgradeCardVersion
}
from
'@/services/mobileConfig/api'
const
{
Search
}
=
Input
const
cardTypes
=
[
'管理'
,
'执行'
,
'运营'
]
const
tabs
=
[
'产品组件'
,
'项目组件'
]
...
...
@@ -180,17 +182,18 @@ const Left = () => {
const
[
cardType
,
setCardType
]
=
useState
(
cardTypes
)
const
[
version
,
setVersion
]
=
useState
({
Version
:
''
,
lastVersion
:
''
})
const
[
activeIndex
,
setActiveIndex
]
=
useState
(
0
)
const
[
inputValue
,
setInputValue
]
=
useState
(
''
)
const
cardsFilter
=
useMemo
(()
=>
{
let
array
=
[]
cards
[
activeIndex
].
forEach
(
v
=>
{
let
children
=
v
.
children
.
filter
(
s
=>
cardType
.
includes
(
s
.
type
))
let
children
=
v
.
children
.
filter
(
s
=>
cardType
.
includes
(
s
.
type
)
&&
(
!
inputValue
||
s
.
name
.
includes
(
inputValue
))
)
if
(
children
.
length
)
{
array
.
push
({
...
v
,
children
})
}
})
return
array
},
[
cards
,
cardType
,
activeIndex
])
},
[
cards
,
cardType
,
activeIndex
,
inputValue
])
const
cardTypeChange
=
(
value
)
=>
{
setCardType
(
value
)
...
...
@@ -254,6 +257,14 @@ const Left = () => {
})}
<
/div
>
<
div
className
=
{
styles
.
item
}
>
<
div
className
=
{
styles
.
search
}
>
<
Search
placeholder
=
"请输入关键字搜索"
value
=
{
inputValue
}
onChange
=
{(
e
)
=>
setInputValue
(
e
.
target
.
value
)}
style
=
{{
width
:
250
}}
/
>
<
/div
>
<
div
className
=
{
styles
[
'g-checks'
]}
>
<
Checkbox
.
Group
style
=
{{
width
:
'100%'
}}
...
...
src/pages/productCenter/mobileConfig/menuconfig/WorkDesign/components/Designer/Left/index.less
View file @
0e46664d
...
...
@@ -44,11 +44,17 @@
overflow: auto;
padding-bottom: 10px;
.item {
position: relative;
.g-title {
padding: 10px;
font-size: 14px;
font-weight: 700;
}
.search {
position: absolute;
right: 10px;
top: 0;
}
.g-checks {
margin: 10px 0 5px 0;
}
...
...
@@ -172,12 +178,11 @@
background-size: 100% 100%;
}
}
}
&:hover {
.swiper {
height: 25px;
}
}
} // &:hover {
// .swiper {
// height: 25px;
// }
// }
.cardType {
position: absolute;
right: 0;
...
...
@@ -206,7 +211,7 @@
left: 0;
width: 100%;
text-align: center;
height:
0
;
height:
25px
;
line-height: 25px;
border-radius: 0 0 4px 4px;
background: rgba(0, 0, 0, 0.3);
...
...
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