Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
memberTag-web
Overview
Overview
Details
Activity
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
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
memberTag
memberTag-web
Commits
2ca012c8
Commit
2ca012c8
authored
Jul 25, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 客户标签
parent
399544bc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
16 deletions
+13
-16
index.js
src/router/index.js
+9
-2
del-cache.js
src/utils/del-cache.js
+3
-14
member-tag.vue
src/view/platformTag/member-tag.vue
+1
-0
No files found.
src/router/index.js
View file @
2ca012c8
import
Router
from
'vue-router'
;
import
_import
from
'./_import.js'
;
import
delCache
from
'../utils/del-cache.js'
;
// import delCache from '@/utils/router-utils.js';
const
errorPage
=
r
=>
{
import
(
'view/errorPage/index.vue'
).
then
(
module
=>
{
...
...
@@ -203,8 +204,14 @@ const router = new Router({
scrollBehavior
:
()
=>
({
y
:
0
})
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
const
{
fromPath
=
[]
}
=
from
.
meta
||
{};
from
.
meta
.
keepAlive
=
fromPath
.
includes
(
to
.
path
);
const
{
keepAlive
,
componentName
,
fromPath
}
=
to
.
meta
||
{};
if
(
keepAlive
&&
fromPath
.
every
(
el
=>
el
!=
'/'
))
{
fromPath
.
push
(
'/'
);
}
// 当前路径的keepAlive为true而且from.path不在fromPath中时,将清除to.path的缓存
if
(
keepAlive
&&
fromPath
.
every
(
el
=>
el
!=
from
.
path
))
{
delCache
(
router
.
apps
,
componentName
);
}
next
();
})
export
default
router
;
src/utils/
router-utils
.js
→
src/utils/
del-cache
.js
View file @
2ca012c8
/**
* 需求分析
* A是列表页,B是详情页,C是另一个列表页
* A=>B=>A A的状态不变
* A=>C=>A A为初始状态
* A=>B=>C=>A A为初始状态
* A=>B=>A=>C=>A A为初始状态
* A=>B=>A=>C=>A=>B=>A A的状态不变(保持A最新的状态)
* A=>B=>A=>C=>A=>B=>C=>A A为初始状态
*/
/**
* 查找指定的组件实例
* @param {array} components 组件树
* @param {string} componentName 指定的组件name
...
...
@@ -18,6 +7,7 @@
function
getComponent
(
components
,
componentName
)
{
let
result
=
{};
components
.
some
(
el
=>
{
// console.log(el.$options.name);
if
(
el
.
$options
.
name
==
componentName
)
{
result
=
el
;
}
else
if
(
Array
.
isArray
(
el
.
$children
))
{
...
...
@@ -33,13 +23,12 @@ function getComponent(components, componentName) {
* @param {object} vm 组件实例
*/
function
delCache
(
vm
)
{
let
{
componentOptions
,
parent
=
{},
key
}
=
vm
.
$vnode
||
{};
if
(
!
vm
.
$vnode
)
return
;
let
{
componentOptions
,
parent
,
key
}
=
vm
.
$vnode
||
{};
let
{
cache
,
keys
}
=
parent
.
componentInstance
||
{};
cache
=
cache
||
{};
keys
=
Array
.
isArray
(
keys
)
?
keys
:
[];
if
(
!
componentOptions
)
return
;
if
(
!
key
)
{
const
{
Ctor
,
tag
}
=
componentOptions
;
key
=
Ctor
.
cid
+
(
tag
?
`::
${
tag
}
`
:
''
);
...
...
src/view/platformTag/member-tag.vue
View file @
2ca012c8
...
...
@@ -43,6 +43,7 @@
style=
"width: 260px;float: left;margin-left: 0"
v-model=
"memberTag"
@
keyup
.
native
.
enter=
"searchMemberList"
@
blur=
"searchMemberList"
@
clear=
"allTagList"
clearable
></el-input>
...
...
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