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
4e3b12f6
Commit
4e3b12f6
authored
Nov 08, 2021
by
wty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
f72de40c
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1 addition
and
265 deletions
+1
-265
ContentItemAdmin.jsx
src/component/ContentAdmin/ContentItemAdmin.jsx
+1
-3
PopConfirm.jsx
src/component/PopConfirm/PopConfirm.jsx
+0
-23
PopConfirm.scss
src/component/PopConfirm/PopConfirm.scss
+0
-4
PopContainer.jsx
src/component/PopContainer/PopContainer.jsx
+0
-48
Pop_toolBoxConfig.jsx
src/component/Pop_ToolBoxConfig/Pop_toolBoxConfig.jsx
+0
-62
Pop_toolBoxConfig.scss
src/component/Pop_ToolBoxConfig/Pop_toolBoxConfig.scss
+0
-4
Pop_addToolBox.jsx
src/component/Pop_addToolBox/Pop_addToolBox.jsx
+0
-65
Pop_addToolBox.scss
src/component/Pop_addToolBox/Pop_addToolBox.scss
+0
-6
Pop_addType.jsx
src/component/Pop_addType/Pop_addType.jsx
+0
-37
Pop_addType.scss
src/component/Pop_addType/Pop_addType.scss
+0
-13
No files found.
src/component/ContentAdmin/ContentItemAdmin.jsx
View file @
4e3b12f6
import
'./ContentItem.scss'
import
notFollow
from
'../../static/notFollow.png'
import
followed
from
'../../static/followed.png'
import
setting
from
'../../static/setting.svg'
import
trash
from
'../../static/trash.svg'
import
dragIcon
from
'../../static/dragIcon.svg'
...
...
@@ -24,7 +22,7 @@ function ContentItemAdmin(props) {
}
const
deleteItem
=
toolbox_id
=>
{
fetchData
(
'/delete/deleteToolBoxById'
,
{
toolbox_id
})
.
then
(
dispatch
(
NEED_UPDATE_INDEX
()))
.
then
(
()
=>
dispatch
(
NEED_UPDATE_INDEX
()))
}
return
(
...
...
src/component/PopConfirm/PopConfirm.jsx
deleted
100644 → 0
View file @
f72de40c
import
{
useContext
}
from
"react"
;
import
{
PopContext
}
from
"../../dataCenter/Root"
;
function
PopConfirm
(
props
){
const
{
hidePop
}
=
useContext
(
PopContext
)
const
{
submit
,
title
}
=
props
return
(
<
div
className=
"Pop-container"
>
<
div
className=
"Pop-tool"
>
<
button
className=
"close"
onClick=
{
()
=>
hidePop
()
}
>
X
</
button
>
</
div
>
<
h2
className=
'Pop-title'
>
{
title
}
</
h2
>
<
div
className=
"Pop-bottom"
>
<
button
className=
'btn-submit-addToolBox'
onClick=
{
()
=>
submit
()
}
>
确定
</
button
>
<
button
className=
'btn-submit-addToolBox'
onClick=
{
()
=>
submit
()
}
>
取消
</
button
>
</
div
>
</
div
>
)
}
export
default
PopConfirm
src/component/PopConfirm/PopConfirm.scss
deleted
100644 → 0
View file @
f72de40c
@import
"../../common/popStyle"
;
.Pop-container
{
position
:
absolute
;
}
src/component/PopContainer/PopContainer.jsx
deleted
100644 → 0
View file @
f72de40c
import
{
useContext
,
useRef
,
useState
}
from
"react"
;
import
{
PopContext
}
from
"../../dataCenter/Root"
;
import
closeIcon
from
'../../static/closeIcon.svg'
function
PopContainer
(
props
)
{
const
dragRef
=
useRef
()
const
{
hidePop
}
=
useContext
(
PopContext
)
const
[
offset
,
setOffset
]
=
useState
({
x
:
0
,
y
:
0
})
const
[
draggable
,
setDraggable
]
=
useState
(
false
)
const
handleMouseDown
=
e
=>
{
e
.
stopPropagation
()
setDraggable
(
true
)
setOffset
({
x
:
e
.
clientX
-
dragRef
.
current
[
'getBoundingClientRect'
]().
x
,
y
:
e
.
clientY
-
dragRef
.
current
[
'getBoundingClientRect'
]().
y
})
}
const
handleMouseUp
=
()
=>
setDraggable
(
false
)
const
handleMouseMove
=
e
=>
{
if
(
draggable
)
{
let
x
=
e
.
clientX
-
offset
.
x
let
y
=
e
.
clientY
-
offset
.
y
// console.log(x, y)
if
(
x
<
0
)
x
=
0
if
(
y
<
0
)
y
=
0
if
(
x
+
dragRef
.
current
[
'offsetWidth'
]
>
document
.
body
.
offsetWidth
)
x
=
document
.
body
.
offsetWidth
-
dragRef
.
current
[
'offsetWidth'
]
if
(
y
+
dragRef
.
current
[
'offsetHeight'
]
>
document
.
body
.
offsetHeight
)
y
=
document
.
body
.
offsetHeight
-
dragRef
.
current
[
'offsetHeight'
]
dragRef
.
current
.
style
.
transform
=
`translate(
${
x
}
px,
${
y
}
px)`
}
}
return
(
<
div
className=
"drag-Container"
onMouseUp=
{
()
=>
handleMouseUp
()
}
onMouseMove=
{
(
e
)
=>
handleMouseMove
(
e
)
}
>
<
div
className=
"Pop-container"
ref=
{
dragRef
}
>
<
div
className=
"Pop-tool"
onMouseDown=
{
e
=>
handleMouseDown
(
e
)
}
>
<
button
className=
"close"
onClick=
{
()
=>
hidePop
()
}
><
img
src=
{
closeIcon
}
alt=
''
/></
button
>
</
div
>
{
props
.
children
}
</
div
>
</
div
>
)
}
export
default
PopContainer
src/component/Pop_ToolBoxConfig/Pop_toolBoxConfig.jsx
deleted
100644 → 0
View file @
f72de40c
import
{
useContext
}
from
"react"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
import
{
useFormState
}
from
"../../utils/hook"
;
import
PopContainer
from
"../PopContainer/PopContainer"
;
import
{
NEED_UPDATE_INDEX
}
from
"../../dataCenter/action"
;
function
Pop_toolBoxConfig
(
props
)
{
const
{
toolbox_name
,
toolbox_icon
,
toolbox_desc
,
toolbox_url
,
toolbox_id
}
=
props
.
value
const
{
fetchData
,
dispatch
}
=
useContext
(
Root
)
const
[
input
,
setInput
]
=
useFormState
({
toolbox_name
,
toolbox_icon
,
toolbox_desc
,
toolbox_url
})
const
updateToolBox
=
()
=>
{
fetchData
(
'/update/updateToolBox'
,
Object
.
assign
({},
input
,
{
toolbox_id
}))
.
then
(()
=>
dispatch
(
NEED_UPDATE_INDEX
()))
}
return
(
<
PopContainer
>
<
h2
className=
'Pop-title'
>
{
toolbox_name
}
</
h2
>
<
div
className=
"formArea"
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_name'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_name'
]
}
min=
{
1
}
required
/>
<
span
>
名称
</
span
>
</
div
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_icon'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_icon'
]
}
min=
{
1
}
required
/>
<
span
>
图标
</
span
>
</
div
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_desc'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_desc'
]
}
min=
{
1
}
required
/>
<
span
>
描述
</
span
>
</
div
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_url'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_url'
]
}
min=
{
1
}
required
/>
<
span
>
链接
</
span
>
</
div
>
</
div
>
<
div
className=
"Pop-bottom"
>
<
button
className=
'btn-submit-addToolBox'
onClick=
{
()
=>
updateToolBox
()
}
>
提交
</
button
>
</
div
>
</
PopContainer
>
)
}
export
default
Pop_toolBoxConfig
src/component/Pop_ToolBoxConfig/Pop_toolBoxConfig.scss
deleted
100644 → 0
View file @
f72de40c
@import
"../../common/popStyle"
;
.Pop-container
{
position
:
absolute
;
}
src/component/Pop_addToolBox/Pop_addToolBox.jsx
deleted
100644 → 0
View file @
f72de40c
import
'./Pop_addToolBox.scss'
import
{
useContext
}
from
"react"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
import
{
useFormState
}
from
"../../utils/hook"
;
import
PopContainer
from
"../PopContainer/PopContainer"
;
function
Pop_addToolBox
()
{
const
{
fetchData
,
updateIndex
,
dataCenter
}
=
useContext
(
Root
)
const
[
input
,
setInput
]
=
useFormState
()
const
addToolBox
=
()
=>
{
fetchData
(
'/add/addToolBox'
,
input
)
.
then
(()
=>
updateIndex
())
}
return
(
<
PopContainer
>
<
h2
className=
'Pop-title'
>
新建工具盒
</
h2
>
<
div
className=
"formArea"
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_name'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_name'
]
}
min=
{
1
}
required
/>
<
span
>
名称
</
span
>
</
div
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_icon'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_icon'
]
}
min=
{
1
}
required
/>
<
span
>
图标
</
span
>
</
div
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_desc'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_desc'
]
}
min=
{
1
}
required
/>
<
span
>
描述
</
span
>
</
div
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'toolbox_url'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.[
'toolbox_url'
]
}
min=
{
1
}
required
/>
<
span
>
链接
</
span
>
</
div
>
<
div
className=
"input-group "
>
<
select
onChange=
{
(
e
)
=>
setInput
(
'type_id'
,
e
.
target
.
value
)
}
>
{
dataCenter
?.
type
?.
length
&&
dataCenter
?.
type
.
map
(
v
=>
{
return
(
<
option
key=
{
v
.
type_id
}
value=
{
v
.
type_id
}
>
{
v
.
type_name
}
</
option
>
)
})
}
</
select
>
<
span
>
类型
</
span
>
</
div
>
</
div
>
<
div
className=
"Pop-bottom"
>
<
button
className=
'btn-submit-addToolBox'
onClick=
{
()
=>
addToolBox
()
}
>
提交
</
button
>
</
div
>
</
PopContainer
>
)
}
export
default
Pop_addToolBox
src/component/Pop_addToolBox/Pop_addToolBox.scss
deleted
100644 → 0
View file @
f72de40c
@import
"../../common/popStyle"
;
.Pop-container
{
position
:
absolute
;
top
:
100px
;
left
:
200px
;
}
src/component/Pop_addType/Pop_addType.jsx
deleted
100644 → 0
View file @
f72de40c
import
{
useContext
}
from
"react"
;
import
{
Root
}
from
"../../dataCenter/Root"
;
import
{
useFormState
}
from
"../../utils/hook"
;
import
PopContainer
from
"../PopContainer/PopContainer"
;
import
'./Pop_addType.scss'
import
{
NEED_UPDATE_INDEX
}
from
"../../dataCenter/action"
;
function
Pop_addType
(
props
)
{
const
{
fetchData
,
dispatch
}
=
useContext
(
Root
)
const
[
input
,
setInput
]
=
useFormState
()
const
addType
=
()
=>
{
fetchData
(
'/add/addType'
,
input
)
.
then
(()
=>
dispatch
(
NEED_UPDATE_INDEX
()))
}
return
(
<
PopContainer
>
<
h2
className=
'Pop-title'
>
新建类型
</
h2
>
<
div
className=
"formArea"
>
<
div
className=
"input-group "
>
<
input
type=
"text"
onChange=
{
e
=>
setInput
(
'type_name'
,
e
.
target
.
value
)
}
defaultValue=
{
input
?.
type_name
}
min=
{
1
}
required
/>
<
span
>
类型名称
</
span
>
</
div
>
</
div
>
<
div
className=
"Pop-bottom"
>
<
button
className=
'btn-submit-addToolBox'
onClick=
{
()
=>
addType
()
}
>
提交
</
button
>
</
div
>
</
PopContainer
>
)
}
export
default
Pop_addType
src/component/Pop_addType/Pop_addType.scss
deleted
100644 → 0
View file @
f72de40c
@import
"../../common/popStyle"
;
.drag-Container
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
.Pop-container
{
position
:
absolute
;
top
:
0
;
left
:
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