Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
quantum-blocks
Commits
f31c3783
Commit
f31c3783
authored
Apr 27, 2022
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加导航上移/下移功能
parent
e824211d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
addOrEditNavigator.vue
...e/editor/view/navigator/components/addOrEditNavigator.vue
+34
-2
No files found.
app/web/page/editor/view/navigator/components/addOrEditNavigator.vue
View file @
f31c3783
...
...
@@ -27,8 +27,12 @@
>
<div
class=
"navigator-list-item_title"
>
<span>
一级导航
</span>
<div
class=
"operation"
>
<Button
type=
"primary"
size=
"small"
:disabled=
"index == 0"
@
click=
"sort(index, 1)"
>
上移
</Button>
<Button
type=
"primary"
size=
"small"
:disabled=
"index == navigatorData.length - 1"
@
click=
"sort(index, 2)"
>
下移
</Button>
<Icon
type=
"close-round"
@
click=
"deleteNavigatorConfigItem(index)"
></Icon>
</div>
</div>
<div
class=
"navigator-list-item_content"
>
<span><i>
*
</i>
导航名称
</span>
<Input
v-model=
"item.name"
placeholder=
"请输入导航名称"
/>
...
...
@@ -238,6 +242,9 @@ export default {
},
addNavigatorConfig
()
{
// 添加导航配置
if
(
this
.
navigatorData
.
length
===
5
)
{
return
this
.
$toast
(
'
最多支持配置5个导航
'
);
}
this
.
navigatorData
.
push
(
Object
.
assign
({},
this
.
standardEditDataModel
));
},
deleteNavigatorConfigItem
(
index
)
{
...
...
@@ -255,6 +262,10 @@ export default {
this
.
$toast
(
'
请配置导航
'
);
return
false
;
}
if
(
this
.
navigatorData
.
length
<
2
||
this
.
navigatorData
.
length
>
5
)
{
this
.
$toast
(
'
导航配置数量范围2-5个
'
);
return
false
;
}
if
(
this
.
bgColor
&&
!
reg
.
test
(
this
.
bgColor
))
{
this
.
$toast
(
'
导航背景色格式错误,请重新填写
'
);
return
false
;
...
...
@@ -323,6 +334,17 @@ export default {
},
changeColor
(
evnet
,
data
)
{
data
=
/^
(?:
#
[
A-Fa-f0-9
]{3}
|#
[
A-Fa-f0-9
]{6})
$/
.
test
(
evnet
.
target
.
value
)
?
evnet
.
target
.
value
:
""
},
sort
(
index
,
type
)
{
/**
* feat: 上移下移
* index: 当前点击的元素索引
* type: 移动类型,1上移,2下移
*/
const
arr
=
this
.
navigatorData
.
concat
([]);
const
targetIndex
=
type
===
1
?
index
-
1
:
index
+
1
;
arr
[
index
]
=
arr
.
splice
(
targetIndex
,
1
,
arr
[
index
])[
0
];
this
.
navigatorData
=
arr
;
}
},
}
...
...
@@ -376,6 +398,16 @@ export default {
display: flex;
align-items: center;
justify-content: space-between;
.operation{
display: flex;
align-items: center;
button{
margin-right: 12px;
&:first-child{
margin-right: 6px;
}
}
}
/deep/ .ivu-icon{
cursor: pointer;
}
...
...
@@ -386,7 +418,7 @@ export default {
align-items: center;
span{
display: inline-block;
width:
6
0px;
width:
8
0px;
flex-shrink: 0;
margin-right: 10px;
i{
...
...
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