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
50195548
Commit
50195548
authored
Dec 15, 2023
by
田翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 代码优化
parent
a9ba22cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
8 deletions
+49
-8
index.js
...g/menuconfig/WorkDesign/components/Designer/Left/index.js
+24
-5
index.less
...menuconfig/WorkDesign/components/Designer/Left/index.less
+25
-3
No files found.
src/pages/productCenter/mobileConfig/menuconfig/WorkDesign/components/Designer/Left/index.js
View file @
50195548
...
...
@@ -5,11 +5,12 @@ import { CaretRightOutlined } from '@ant-design/icons'
import
styles
from
'./index.less'
import
{
GlobalStore
}
from
'../index'
import
{
getCardVersion
,
upgradeCardVersion
}
from
'@/services/mobileConfig/api'
import
moment
from
'moment'
const
cardTypes
=
[
'管理'
,
'执行'
,
'运营'
]
const
tabs
=
[
'产品组件'
,
'项目组件'
]
const
cards
=
[
[
{
title
:
'运营总览'
,
count
:
1
,
...
...
@@ -56,6 +57,10 @@ const cards = [
count
:
1
,
children
:
[{
name
:
'大表监控'
,
widget
:
'LARGE_MONITORING'
,
type
:
'运营'
}],
},
],
[
]
]
const
getNanoid
=
(
len
=
10
)
=>
{
...
...
@@ -163,17 +168,18 @@ const Left = () => {
const
{
shema
,
setShema
}
=
useContext
(
GlobalStore
)
const
[
cardType
,
setCardType
]
=
useState
(
cardTypes
)
const
[
version
,
setVersion
]
=
useState
({
Version
:
''
,
lastVersion
:
''
})
const
[
activeIndex
,
setActiveIndex
]
=
useState
(
0
)
const
cardsFilter
=
useMemo
(()
=>
{
let
array
=
[]
cards
.
forEach
(
v
=>
{
cards
[
activeIndex
]
.
forEach
(
v
=>
{
let
children
=
v
.
children
.
filter
(
s
=>
cardType
.
includes
(
s
.
type
))
if
(
children
.
length
)
{
array
.
push
({
...
v
,
children
})
}
})
return
array
},
[
cards
,
cardType
])
},
[
cards
,
cardType
,
activeIndex
])
const
cardTypeChange
=
(
value
)
=>
{
setCardType
(
value
)
...
...
@@ -223,8 +229,21 @@ const Left = () => {
<
Group
><
/Group
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
tabs
}
>
{
tabs
.
map
((
v
,
i
)
=>
{
return
(
<
div
className
=
{
styles
.
tab
}
active
=
{
`
${
activeIndex
===
i
}
`
}
onClick
=
{()
=>
setActiveIndex
(
i
)}
>
{
v
}
<
/div
>
)
})}
<
/div
>
<
div
className
=
{
styles
.
item
}
>
<
div
className
=
{
styles
[
'g-title'
]}
style
=
{{
paddingBottom
:
'0'
}}
>
卡片组件
<
/div
>
{
/* <div className={styles['g-title']} style={{ paddingBottom: '0' }}>卡片组件</div> */
}
<
div
className
=
{
styles
[
'g-checks'
]}
>
<
Checkbox
.
Group
style
=
{{
width
:
'100%'
}}
...
...
@@ -235,7 +254,7 @@ const Left = () => {
{
cardTypes
.
map
(
v
=>
{
return
(
<
Col
key
=
{
v
}
s
pan
=
{
8
}
style
=
{{
display
:
'flex'
,
justifyContent
:
'center
'
}}
>
<
Col
key
=
{
v
}
s
tyle
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
marginLeft
:
'10px
'
}}
>
<
Checkbox
value
=
{
v
}
>
{
v
}
<
/Checkbox
>
<
/Col
>
)
...
...
src/pages/productCenter/mobileConfig/menuconfig/WorkDesign/components/Designer/Left/index.less
View file @
50195548
...
...
@@ -17,6 +17,28 @@
}
.r-right {}
}
.tabs {
display: flex;
margin-top: 10px;
background: #F5F5F5;
color: #A5A5A5;
font-size: 14px;
font-weight: 500;
height: 35px;
line-height: 35px;
&:hover {
cursor: pointer;
}
.tab {
flex: 1;
text-align: center;
&[active='true'] {
border-top: 2px solid #0082F0;
color: #0082F0;
background: linear-gradient(to bottom, #EEF7FF, #FFFFFF);
}
}
}
.l-content {
height: calc(100% - 40px);
overflow: auto;
...
...
@@ -28,8 +50,8 @@
font-weight: 700;
}
.g-checks {
padding: 9px 0;
background: linear-gradient(to top, #F3F3F3, #FFFFFF);
//
padding: 9px 0;
//
background: linear-gradient(to top, #F3F3F3, #FFFFFF);
}
.g-content {
padding: 0 10px;
...
...
@@ -165,11 +187,11 @@
}
.cardGroup {
padding-left: 10px;
font-size: 14px;
margin-top: 3px;
.g-top {
display: inline;
font-size: 15px;
&:hover {
cursor: pointer;
color: #1890ff;
...
...
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