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
21461c06
Commit
21461c06
authored
Apr 20, 2022
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增导航选择是否展示导航
parent
41d868a3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
navigator.ts
app/service/navigator.ts
+37
-3
addOrEditNavigator.vue
...e/editor/view/navigator/components/addOrEditNavigator.vue
+6
-1
No files found.
app/service/navigator.ts
View file @
21461c06
...
@@ -17,6 +17,35 @@ function addOrEditUrlParams (url, paramName, replaceWith) {
...
@@ -17,6 +17,35 @@ function addOrEditUrlParams (url, paramName, replaceWith) {
}
}
return
url
;
return
url
;
};
};
function
deleteUrlParams
(
url
,
ref
)
{
let
str
=
""
;
if
(
url
.
indexOf
(
'
?
'
)
!=
-
1
)
{
str
=
url
.
substr
(
url
.
indexOf
(
'
?
'
)
+
1
);
}
else
{
return
url
;
}
let
arr
=
[];
let
returnurl
=
""
;
let
setparam
=
""
;
if
(
str
.
indexOf
(
'
&
'
)
!=
-
1
)
{
arr
=
str
.
split
(
'
&
'
);
for
(
let
i
in
arr
)
{
if
(
arr
[
i
].
split
(
'
=
'
)[
0
]
!=
ref
)
{
returnurl
=
returnurl
+
arr
[
i
].
split
(
'
=
'
)[
0
]
+
"
=
"
+
arr
[
i
].
split
(
'
=
'
)[
1
]
+
"
&
"
;
}
}
return
url
.
substr
(
0
,
url
.
indexOf
(
'
?
'
))
+
"
?
"
+
returnurl
.
substr
(
0
,
returnurl
.
length
-
1
);
}
else
{
arr
=
str
.
split
(
'
=
'
);
if
(
arr
[
0
]
==
ref
)
{
return
url
.
substr
(
0
,
url
.
indexOf
(
'
?
'
));
}
else
{
return
url
;
}
}
}
export
default
class
ArticeService
extends
Service
{
export
default
class
ArticeService
extends
Service
{
private
context
:
Context
;
private
context
:
Context
;
constructor
(
ctx
:
Context
)
{
constructor
(
ctx
:
Context
)
{
...
@@ -99,8 +128,13 @@ export default class ArticeService extends Service {
...
@@ -99,8 +128,13 @@ export default class ArticeService extends Service {
for
(
let
i
=
0
;
i
<
navigatorData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
navigatorData
.
length
;
i
++
)
{
if
(
navigatorData
[
i
].
pageType
==
2
)
{
if
(
navigatorData
[
i
].
pageType
==
2
)
{
let
url
=
navigatorData
[
i
].
pageUrl
;
let
url
=
navigatorData
[
i
].
pageUrl
;
if
(
navigatorData
[
i
].
carryNav
)
{
url
=
deleteUrlParams
(
url
,
'
navId
'
);
url
=
deleteUrlParams
(
url
,
'
index
'
);
}
else
{
url
=
addOrEditUrlParams
(
url
,
'
navId
'
,
id
);
url
=
addOrEditUrlParams
(
url
,
'
navId
'
,
id
);
url
=
addOrEditUrlParams
(
url
,
'
index
'
,
i
);
url
=
addOrEditUrlParams
(
url
,
'
index
'
,
i
);
}
navigatorData
[
i
].
pageUrl
=
url
;
navigatorData
[
i
].
pageUrl
=
url
;
}
}
}
}
...
@@ -118,7 +152,7 @@ export default class ArticeService extends Service {
...
@@ -118,7 +152,7 @@ export default class ArticeService extends Service {
const
navigatorData
=
JSON
.
parse
(
res
.
dataValues
.
navigatorData
);
const
navigatorData
=
JSON
.
parse
(
res
.
dataValues
.
navigatorData
);
// 更新保存数据的链接,pageType为2的要进行更新
// 更新保存数据的链接,pageType为2的要进行更新
for
(
let
i
=
0
;
i
<
navigatorData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
navigatorData
.
length
;
i
++
)
{
if
(
navigatorData
[
i
].
pageType
==
2
)
{
if
(
navigatorData
[
i
].
pageType
==
2
&&
navigatorData
[
i
].
carryNav
)
{
navigatorData
[
i
].
pageUrl
+=
`&navId=
${
id
}
&index=
${
i
}
`
;
navigatorData
[
i
].
pageUrl
+=
`&navId=
${
id
}
&index=
${
i
}
`
;
}
}
}
}
...
...
app/web/page/editor/view/navigator/components/addOrEditNavigator.vue
View file @
21461c06
...
@@ -81,6 +81,10 @@
...
@@ -81,6 +81,10 @@
<span><i>
*
</i>
选择页面
</span>
<span><i>
*
</i>
选择页面
</span>
<Button
@
click=
"clickSelectPageButton(index)"
>
选择
</Button>
<Button
@
click=
"clickSelectPageButton(index)"
>
选择
</Button>
</div>
</div>
<div
class=
"navigator-list-item_content"
v-if=
"item.pageType == 2"
>
<span>
是否展示导航
</span>
<Checkbox
v-model=
"item.carryNav"
/>
</div>
<div
class=
"navigator-list-item_content"
>
<div
class=
"navigator-list-item_content"
>
<span></span>
<span></span>
<span
class=
"select"
v-if=
"item.pageName && item.pageUrl"
>
<span
class=
"select"
v-if=
"item.pageName && item.pageUrl"
>
...
@@ -197,7 +201,8 @@ export default {
...
@@ -197,7 +201,8 @@ export default {
selectIcon
:
''
,
selectIcon
:
''
,
pageType
:
''
,
pageType
:
''
,
pageUrl
:
''
,
pageUrl
:
''
,
pageName
:
''
pageName
:
''
,
carryNav
:
true
,
// 是否携带导航
},
},
selectPageIndex
:
-
1
,
// 选择页面 config索引
selectPageIndex
:
-
1
,
// 选择页面 config索引
showSelectPageModal
:
false
,
showSelectPageModal
:
false
,
...
...
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