Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Dui123
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
王天宇
Dui123
Commits
31ee1c6f
Commit
31ee1c6f
authored
Sep 30, 2021
by
wty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化子类样式等
parent
f04f2a92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
74 deletions
+55
-74
Content.jsx
src/component/Content/Content.jsx
+11
-16
Content.jsx
src/component/ContentAdmin/Content.jsx
+6
-12
index.jsx
src/page/indexAdmin/index.jsx
+38
-46
No files found.
src/component/Content/Content.jsx
View file @
31ee1c6f
...
@@ -4,25 +4,20 @@ import {useContext, useEffect, useState} from "react";
...
@@ -4,25 +4,20 @@ import {useContext, useEffect, useState} from "react";
import
{
Root
}
from
"../../dataCenter/Root"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
function
Content
(
props
)
{
function
Content
(
props
)
{
const
{
dataCenter
,
fetchData
}
=
useContext
(
Root
)
const
{
dataCenter
}
=
useContext
(
Root
)
const
[
toolBoxData
,
setToolBoxData
]
=
useState
([])
useEffect
(()
=>
{
setToolBoxData
(
dataCenter
?.
toolBox
?.
filter
(
v
=>
{
if
(
dataCenter
.
childTypeId
===
'all'
)
return
true
else
return
v
.
childTypeId
===
dataCenter
.
childTypeId
})
||
[])
},[
dataCenter
.
childTypeId
])
return
(
return
(
<
div
className=
"content"
>
<
div
className=
"content"
>
{
{
toolBoxData
.
length
?
toolBoxData
.
map
(
v
=>
{
dataCenter
.
childType
?.
length
?
dataCenter
?.
toolBox
?.
filter
(
v
=>
{
return
(
if
(
dataCenter
.
childTypeId
===
'all'
)
return
true
<
ContentItem
key=
{
v
[
'toolBoxId'
]
}
value=
{
v
}
/>
else
return
v
.
childTypeId
===
dataCenter
.
childTypeId
)
}).
map
(
v
=>
{
})
return
(
:
<
ContentItem
key=
{
v
[
'toolBoxId'
]
}
value=
{
v
}
/>
'没有数据了!'
)
})
:
'没有数据了!'
}
}
</
div
>
</
div
>
)
)
...
...
src/component/ContentAdmin/Content.jsx
View file @
31ee1c6f
...
@@ -4,21 +4,15 @@ import {useContext, useEffect, useState} from "react";
...
@@ -4,21 +4,15 @@ import {useContext, useEffect, useState} from "react";
import
{
Root
}
from
"../../dataCenter/Root"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
function
Content
(
props
)
{
function
Content
(
props
)
{
const
{
dataCenter
,
fetchData
}
=
useContext
(
Root
)
const
{
dataCenter
}
=
useContext
(
Root
)
const
[
gridPosition
,
setGridPosition
]
=
useState
([])
const
updatePosition
=
()
=>
{
fetchData
(
'/update/updateToolBoxSort'
,{
sortArr
:
JSON
.
stringify
([{
toolBoxId
:
10
,
sortId
:
1
}])})
}
useEffect
(()
=>
{
setGridPosition
(
dataCenter
.
toolBox
&&
dataCenter
.
toolBox
.
map
(
v
=>
v
.
toolBoxId
))
},
[
dataCenter
.
toolBox
])
return
(
return
(
<
div
className=
"content"
>
<
div
className=
"content"
>
{
{
dataCenter
?.
toolBox
?.
length
?
dataCenter
.
toolBox
.
map
(
v
=>
{
dataCenter
.
childType
?.
length
?
dataCenter
?.
toolBox
?.
filter
(
v
=>
{
if
(
dataCenter
.
childTypeId
===
'all'
)
return
true
else
return
v
.
childTypeId
===
dataCenter
.
childTypeId
}).
map
(
v
=>
{
return
(
return
(
<
ContentItem
key=
{
v
[
'toolBoxId'
]
}
value=
{
v
}
/>
<
ContentItem
key=
{
v
[
'toolBoxId'
]
}
value=
{
v
}
/>
)
)
...
...
src/page/indexAdmin/index.jsx
View file @
31ee1c6f
import
logo
from
"../../static/logo.png"
;
import
'./index.scss'
import
'./index.scss'
import
ToolType
from
"../../component/ToolType/ToolType"
;
import
ToolType
from
"../../component/ToolType/ToolType"
;
import
Content
from
"../../component/ContentAdmin/Content"
;
import
Content
from
"../../component/Content/Content"
;
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
{
PopContext
,
Root
}
from
"../../dataCenter/Root"
;
import
PopAddToolBox
from
"../../component/Pop_addToolBox/Pop_addToolBox"
;
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
{
PopContext
,
Root
}
from
"../../dataCenter/Root"
;
import
{
NEED_UPDATE_INDEX
}
from
"../../dataCenter/action"
;
import
PopAddType
from
"../../component/Pop_addType/Pop_addType"
;
import
AdminIndex
from
"../../component/AdminIndex/AdminIndex"
;
import
logo
from
'../../static/logo.png'
import
AdminIndex
from
'../../component/AdminIndex/AdminIndex'
function
Index
()
{
function
IndexAdmin
()
{
const
{
updateIndex
}
=
useContext
(
Root
)
const
{
fetchData
,
dataCenter
}
=
useContext
(
Root
)
const
[
pop
,
setPop
]
=
useState
()
const
[
pop
,
setPop
]
=
useState
()
const
{
fetchData
,
dataCenter
,
dispatch
}
=
useContext
(
Root
)
const
showPop
=
popComponent
=>
{
const
showPop
=
popComponent
=>
{
setPop
(
popComponent
)
setPop
(
popComponent
)
}
}
const
getUser
=
()
=>
{
const
getUser
=
()
=>
{
fetchData
(
'/users/getUser'
,
{
userId
:
'100001'
},
'userInfo'
)
fetchData
(
'/users/getUser'
,
{
userId
:
'100001'
},
'userInfo'
)
.
catch
(
res
=>
.
catch
(
res
=>
res
.
code
===
70001
&&
(
window
.
location
.
href
=
'/login'
)
res
.
code
===
70001
&&
(
window
.
location
.
href
=
'/login'
)
)
)
}
}
useEffect
(()
=>
{
getUser
()
},[])
useEffect
(()
=>
{
useEffect
(()
=>
{
updateIndex
()
fetchData
(
'/query/queryType'
,
{},
'type'
)
// dataCenter()
.
then
(()
=>
fetchData
(
'/query/queryChildType'
,{
typeId
:
dataCenter
.
typeId
},
'childType'
))
.
then
(()
=>
dispatch
(
NEED_UPDATE_INDEX
()))
},
[
dataCenter
.
typeId
])
useEffect
(()
=>
{
if
(
dataCenter
.
needUpdateIndex
)
{
const
_typeId
=
dataCenter
.
typeId
===
'all'
?
{}
:
dataCenter
.
typeId
===
'follow'
?
{
isFollow
:
true
,
typeId
:
JSON
.
stringify
(
dataCenter
.
userInfo
.
follow
)
}
:
{
typeId
:
dataCenter
.
typeId
}
fetchData
(
'/query/queryToolBox'
,
_typeId
,
'toolBox'
).
then
(()
=>
dispatch
(
NEED_UPDATE_INDEX
()))
}
},
[
dataCenter
.
needUpdateIndex
])
useEffect
(()
=>
{
getUser
()
},
[])
},
[])
return
(
return
(
...
@@ -44,9 +51,12 @@ function IndexAdmin() {
...
@@ -44,9 +51,12 @@ function IndexAdmin() {
</
div
>
</
div
>
<
div
className=
"nav"
>
<
div
className=
"nav"
>
<
div
className=
"nav-title"
>
<
div
className=
"nav-title"
>
<
img
src=
{
logo
}
alt=
""
/>
<
img
src=
{
logo
}
alt=
""
/>
</
div
>
<
div
className=
"nav-weather"
>
<
iframe
width=
"360"
height=
"40"
frameBorder=
"0"
scrolling=
"no"
hspace=
"0"
src=
"https://i.tianqi.com/?c=code&a=getcode&id=40&icon=1"
/>
</
div
>
</
div
>
<
div
className=
"nav-weather"
><
iframe
width=
"360"
height=
"40"
frameBorder=
"0"
scrolling=
"no"
hspace=
"0"
src=
"https://i.tianqi.com/?c=code&a=getcode&id=40&icon=1"
/></
div
>
</
div
>
</
div
>
<
div
className=
"tool-nav"
>
<
div
className=
"tool-nav"
>
<
ToolType
/>
<
ToolType
/>
...
@@ -57,34 +67,16 @@ function IndexAdmin() {
...
@@ -57,34 +67,16 @@ function IndexAdmin() {
{
{
pop
pop
}
}
<
div
className
></
div
>
<
div
className=
"index-footer"
>
<
div
className=
"index-footer"
>
兑吧研发中心·杭州兑吧网络科技游戏公司版权所有
兑吧研发中心·杭州兑吧网络科技游戏公司版权所有
<
br
/>
<
br
/>
浙ICP备14017299号-1
浙ICP备14017299号-1
</
div
>
<
AdminIndex
/>
{
/* <div className="adminTool">
<button className='btn-admin' onClick={() => setPop((<PopAddToolBox/>))}>新建工具盒</button>
<button className='btn-admin' onClick={() => setPop((<PopAddType/>))}>新建类型</button>
</
div
>
</
div
>
<div className="tool-nav">
<
AdminIndex
/>
<ToolType/>
</div>
<div className="container">
<Content/>
</div>
{
pop
} */
}
</
div
>
</
div
>
</
PopContext
.
Provider
>
</
PopContext
.
Provider
>
)
)
}
}
export
default
IndexAdmin
export
default
Index
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