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
82b30992
Commit
82b30992
authored
Sep 30, 2021
by
wty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化子类样式等
parent
f98e5a10
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
44 additions
and
45 deletions
+44
-45
App.js
src/App.js
+1
-1
AdminIndex.jsx
src/component/AdminIndex/AdminIndex.jsx
+2
-4
Content.jsx
src/component/Content/Content.jsx
+2
-2
Content.jsx
src/component/ContentAdmin/Content.jsx
+6
-2
ContentItemAdmin.jsx
src/component/ContentAdmin/ContentItemAdmin.jsx
+0
-1
Pop_addToolBox.jsx
src/component/Pop_addToolBox/Pop_addToolBox.jsx
+1
-1
ToolType.jsx
src/component/ToolType/ToolType.jsx
+5
-8
Root.jsx
src/dataCenter/Root.jsx
+2
-1
index.js
src/index.js
+2
-2
PageModal.jsx
src/modal/PageModal.jsx
+3
-3
PublishModal.jsx
src/modal/PublishModal.jsx
+5
-5
RemoveType.jsx
src/modal/RemoveType.jsx
+4
-5
ToolModal.jsx
src/modal/ToolModal.jsx
+5
-4
TypeModal.jsx
src/modal/TypeModal.jsx
+5
-5
index.jsx
src/page/index/index.jsx
+1
-1
No files found.
src/App.js
View file @
82b30992
...
...
@@ -3,7 +3,7 @@ import DataCenter from "./dataCenter/Root";
import
IndexAdmin
from
"./page/indexAdmin"
;
import
Index
from
"./page/index"
;
import
Login
from
"./page/login/login"
;
import
{
Route
,
BrowserRouter
as
Router
,
Switch
}
from
"react-router-dom"
;
import
{
BrowserRouter
as
Router
,
Route
,
Switch
}
from
"react-router-dom"
;
function
App
()
{
return
(
...
...
src/component/AdminIndex/AdminIndex.jsx
View file @
82b30992
import
React
from
'react'
import
React
,
{
useState
}
from
'react'
import
'./AdminIndex.scss'
import
{
Layout
,
Menu
,
Breadcrumb
,
Button
}
from
'antd'
;
import
{
Button
}
from
'antd'
;
import
ToolModal
from
'../../modal/ToolModal'
import
PublishModal
from
'../../modal/PublishModal'
import
TypeModal
from
'../../modal/TypeModal'
import
PageModal
from
'../../modal/PageModal'
import
RemoveType
from
'../../modal/RemoveType'
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
function
AdminIndex
()
{
const
[
visible
,
setVisible
]
=
useState
(
false
)
...
...
src/component/Content/Content.jsx
View file @
82b30992
import
'./Content.scss'
import
ContentItem
from
"./ContentItem"
;
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
{
useContext
}
from
"react"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
function
Content
(
props
)
{
...
...
@@ -8,7 +8,7 @@ function Content(props) {
return
(
<
div
className=
"content"
>
{
dataCenter
.
childType
?.
length
?
dataCenter
?.
toolBox
?.
filter
(
v
=>
{
dataCenter
.
toolBox
?.
length
?
dataCenter
?.
toolBox
?.
filter
(
v
=>
{
if
(
dataCenter
.
childTypeId
===
'all'
)
return
true
else
return
v
.
childTypeId
===
dataCenter
.
childTypeId
}).
map
(
v
=>
{
...
...
src/component/ContentAdmin/Content.jsx
View file @
82b30992
import
'./Content.scss'
import
ContentItemAdmin
from
"./ContentItemAdmin"
;
import
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
{
useContext
}
from
"react"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
import
ContentItem
from
"../Content/ContentItem"
;
function
Content
(
props
)
{
const
{
dataCenter
}
=
useContext
(
Root
)
...
...
@@ -9,7 +10,10 @@ function Content(props) {
return
(
<
div
className=
"content"
>
{
dataCenter
?.
toolBox
?.
length
?
dataCenter
.
toolBox
.
map
(
v
=>
{
dataCenter
.
toolBox
?.
length
?
dataCenter
?.
toolBox
?.
filter
(
v
=>
{
if
(
dataCenter
.
childTypeId
===
'all'
)
return
true
else
return
v
.
childTypeId
===
dataCenter
.
childTypeId
}).
map
(
v
=>
{
return
(
<
ContentItemAdmin
key=
{
v
[
'toolBoxId'
]
}
value=
{
v
}
/>
)
...
...
src/component/ContentAdmin/ContentItemAdmin.jsx
View file @
82b30992
import
'./ContentItem.scss'
import
defaultIcon
from
'../../static/defaultIcon.png'
import
notFollow
from
'../../static/notFollow.png'
import
followed
from
'../../static/followed.png'
import
setting
from
'../../static/setting.svg'
...
...
src/component/Pop_addToolBox/Pop_addToolBox.jsx
View file @
82b30992
import
'./Pop_addToolBox.scss'
import
{
useContext
,
useEffect
,
useRef
}
from
"react"
;
import
{
useContext
}
from
"react"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
import
{
useFormState
}
from
"../../utils/hook"
;
import
PopContainer
from
"../PopContainer/PopContainer"
;
...
...
src/component/ToolType/ToolType.jsx
View file @
82b30992
...
...
@@ -25,14 +25,11 @@ function ToolType(props) {
return
(
<>
<
div
className=
"tab-tool-type"
>
{
/*<div className={dataCenter.typeId === 'all' ? 'item-tool-type item-tool-type-selected' : 'item-tool-type'}*/
}
{
/* onClick={() => setTypeId('all')}>工具*/
}
{
/*</div>*/
}
{
/*<div className={dataCenter.typeId === 'follow' ? 'item-tool-type item-tool-type-selected' : 'item-tool-type'}*/
}
{
/* onClick={() => setTypeId('follow')}>我的收藏*/
}
{
/*</div>*/
}
<
div
className=
{
dataCenter
.
typeId
===
'follow'
?
'item-tool-type item-tool-type-selected'
:
'item-tool-type'
}
onClick=
{
()
=>
dispatch
(
CHANGE_TYPE
(
'follow'
))
}
>
我的收藏
</
div
>
{
dataCenter
?.
type
?.
length
&&
dataCenter
.
type
.
map
(
v
=>
{
dataCenter
?.
type
?.
length
>
0
&&
dataCenter
.
type
.
map
(
v
=>
{
const
classNameArr
=
[
'item-tool-type '
]
if
(
v
[
"typeId"
]
===
dataCenter
.
typeId
)
classNameArr
.
push
(
'item-tool-type-selected'
)
return
(
...
...
@@ -45,7 +42,7 @@ function ToolType(props) {
<
div
className=
"child-type"
>
<
ChildTypeItem
key=
{
'all'
}
childTypeId=
{
'all'
}
childTypeName=
{
'全部'
}
/>
{
dataCenter
?.
childType
?.
length
&&
dataCenter
?.
childType
.
map
(
v
=>
{
dataCenter
?.
childType
?.
length
>
0
&&
dataCenter
?.
childType
.
map
(
v
=>
{
return
(
<
ChildTypeItem
key=
{
v
.
childTypeId
}
childTypeId=
{
v
.
childTypeId
}
childTypeName=
{
v
.
childTypeName
}
/>
...
...
src/dataCenter/Root.jsx
View file @
82b30992
import
React
,
{
createContext
,
useReducer
}
from
"react"
;
import
{
dataReducer
,
initDataCenter
}
from
"./reducer"
;
import
apiConfig
from
"../config/apiConfig"
;
import
{
NEED_UPDATE_INDEX
,
UPDATE_DATA
}
from
"./action"
;
import
{
UPDATE_DATA
}
from
"./action"
;
const
Root
=
createContext
({})
const
PopContext
=
createContext
({})
...
...
src/index.js
View file @
82b30992
import
React
from
'react'
;
import
ReactDOM
from
'react-dom'
;
import
{
ConfigProvider
,
DatePicker
,
message
}
from
'antd'
;
import
{
ConfigProvider
}
from
'antd'
;
// 由于 antd 组件的默认文案是英文,所以需要修改为中文
import
zhCN
from
'antd/lib/locale/zh_CN'
;
import
moment
from
'moment'
;
import
'moment/locale/zh-cn'
;
import
'antd/dist/antd.css'
;
import
'./index.css'
;
import
'./index.css'
;
import
App
from
'./App'
;
import
reportWebVitals
from
'./reportWebVitals'
;
moment
.
locale
(
'zh-cn'
);
ReactDOM
.
render
(
<
React
.
StrictMode
>
...
...
src/modal/PageModal.jsx
View file @
82b30992
import
React
,
{
useState
,
useEffect
,
useContext
}
from
'react'
;
import
{
Root
}
from
"../dataCenter/Root"
;
import
{
Button
,
Modal
,
Form
,
Input
,
Radio
,
Select
,
Table
,
Space
}
from
'antd'
;
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
{
Root
}
from
"../dataCenter/Root"
;
import
{
Modal
,
Space
,
Table
}
from
'antd'
;
import
PublishModal
from
"./PublishModal"
function
PageModal
({
visible
,
onCancel
,
onPublish
})
{
...
...
src/modal/PublishModal.jsx
View file @
82b30992
import
'./PublishModal.scss'
import
React
,
{
useState
,
useEffect
,
useContext
}
from
'react'
;
import
{
Root
}
from
"../dataCenter/Root"
;
import
{
UnControlled
as
CodeMirror
}
from
'react-codemirror2'
import
{
Button
,
Modal
,
Form
,
Input
,
Radio
,
Select
,
message
}
from
'antd'
;
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
{
Root
}
from
"../dataCenter/Root"
;
import
{
UnControlled
as
CodeMirror
}
from
'react-codemirror2'
import
{
Form
,
Input
,
message
,
Modal
,
Select
}
from
'antd'
;
import
apiConfig
from
"../config/apiConfig"
;
import
'codemirror/addon/display/autorefresh'
;
...
...
@@ -145,4 +145,4 @@ const PublishModal = ({ visible, onCancel, data }) => {
</
Modal
>
);
};
export
default
PublishModal
\ No newline at end of file
export
default
PublishModal
src/modal/RemoveType.jsx
View file @
82b30992
import
{
Table
,
Badge
,
Menu
,
Dropdown
,
Popconfirm
,
Space
,
Modal
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
,
useContext
}
from
'react'
;
import
{
DownOutlined
}
from
'@ant-design/icons'
;
import
{
Menu
,
Modal
,
Popconfirm
,
Space
,
Table
}
from
'antd'
;
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
TypeModal
from
'../modal/TypeModal'
import
{
Root
}
from
"../dataCenter/Root"
;
import
{
Root
}
from
"../dataCenter/Root"
;
const
menu
=
(
<
Menu
>
...
...
@@ -121,4 +120,4 @@ function RemoveType({ visible, onCancel }) {
);
}
export
default
RemoveType
\ No newline at end of file
export
default
RemoveType
src/modal/ToolModal.jsx
View file @
82b30992
import
React
,
{
useState
,
useEffect
,
useContext
}
from
'react'
;
import
{
Root
}
from
"../dataCenter/Root"
;
import
{
Button
,
Modal
,
Form
,
Input
,
Radio
,
Select
,
message
}
from
'antd'
;
import
React
,
{
useContext
,
useEffect
}
from
'react'
;
import
{
Root
}
from
"../dataCenter/Root"
;
import
{
Form
,
Input
,
message
,
Modal
,
Select
}
from
'antd'
;
const
{
Option
}
=
Select
;
const
ToolModal
=
({
visible
,
onCancel
,
data
})
=>
{
const
[
form
]
=
Form
.
useForm
();
...
...
@@ -195,4 +196,4 @@ const ToolModal = ({ visible, onCancel, data }) => {
</
Modal
>
);
};
export
default
ToolModal
\ No newline at end of file
export
default
ToolModal
src/modal/TypeModal.jsx
View file @
82b30992
import
React
,
{
useState
}
from
'react'
;
import
{
Button
,
Modal
,
Form
,
Input
,
Radio
,
Select
,
message
,
Tabs
}
from
'antd'
;
import
{
useContext
}
from
"reac
t"
;
import
{
Root
}
from
"../dataCenter/Root"
;
import
React
,
{
useContext
}
from
'react'
;
import
{
Form
,
Input
,
message
,
Modal
,
Radio
,
Select
,
Tabs
}
from
'antd'
;
import
{
Root
}
from
"../dataCenter/Roo
t"
;
const
{
Option
}
=
Select
;
const
{
TabPane
}
=
Tabs
;
const
TypeModal
=
({
visible
,
onCancel
,
data
})
=>
{
...
...
@@ -122,4 +122,4 @@ const TypeModal = ({ visible, onCancel, data }) => {
</
Modal
>
);
};
export
default
TypeModal
\ No newline at end of file
export
default
TypeModal
src/page/index/index.jsx
View file @
82b30992
...
...
@@ -27,7 +27,7 @@ function Index() {
useEffect
(()
=>
{
if
(
dataCenter
.
needUpdateIndex
)
{
const
_typeId
=
dataCenter
.
typeId
===
'
all'
?
{}
:
dataCenter
.
typeId
===
'
follow'
?
{
const
_typeId
=
dataCenter
.
typeId
===
'follow'
?
{
isFollow
:
true
,
typeId
:
JSON
.
stringify
(
dataCenter
.
userInfo
.
follow
)
}
:
{
typeId
:
dataCenter
.
typeId
}
...
...
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