Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
752f3075
提交
752f3075
编写于
7月 04, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chitanda 发布系统代码
上级
3d57cefb
变更
8
展开全部
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
575 行增加
和
556 行删除
+575
-556
app-keep-alive.vue
app_CRM/src/components/app-keep-alive/app-keep-alive.vue
+1
-1
tab-page-exp.vue
app_CRM/src/components/tab-page-exp/tab-page-exp.vue
+22
-21
campaign-service-base.ts
app_CRM/src/service/campaign/campaign-service-base.ts
+50
-50
contact-service-base.ts
app_CRM/src/service/contact/contact-service-base.ts
+147
-147
opportunity-service-base.ts
app_CRM/src/service/opportunity/opportunity-service-base.ts
+194
-194
product-service-base.ts
app_CRM/src/service/product/product-service-base.ts
+50
-50
sales-literature-service-base.ts
...service/sales-literature/sales-literature-service-base.ts
+50
-50
AppNavHistoryBase.ts
.../studio-core/service/app-nav-history/AppNavHistoryBase.ts
+61
-43
未找到文件。
app_CRM/src/components/app-keep-alive/app-keep-alive.vue
浏览文件 @
752f3075
...
...
@@ -116,7 +116,7 @@ export default {
},
matches
(
pattern
,
name
)
{
if
(
Array
.
isArray
(
pattern
))
{
return
pattern
.
findIndex
(
item
=>
item
.
fullPath
===
name
)
!==
-
1
;
return
pattern
.
findIndex
(
item
=>
item
.
to
.
fullPath
===
name
)
!==
-
1
;
}
else
if
(
typeof
pattern
===
'string'
)
{
return
pattern
.
split
(
','
).
indexOf
(
name
)
>
-
1
;
}
else
if
(
this
.
isRegExp
(
pattern
))
{
...
...
app_CRM/src/components/tab-page-exp/tab-page-exp.vue
浏览文件 @
752f3075
<
template
>
<div
class=
"ibiz-page-tag"
v-if=
"appService.navHistory.
meta
List.length > 0"
>
<div
class=
"ibiz-page-tag"
v-if=
"appService.navHistory.
history
List.length > 0"
>
<div
class=
"move-btn move-left"
@
click=
"leftMove"
>
<icon
type=
"ios-arrow-back"
/>
</div>
<div
ref=
"scrollBody"
class=
"tags-body"
>
<div
ref=
"scrollChild"
class=
"tags-container"
:style=
"
{left: styleLeft + 'px'}">
<transition-group
name=
"tags-transition"
>
<template
v-for=
"(
meta, index) of appService.navHistory.meta
List"
>
<Tag
ref=
"tagElement"
:key=
"index"
:class=
"isActive(
appService.navHistory.historyList[index]) ? 'tag-is-active' : ''"
:name=
"index"
closable
@
click
.
native=
"changePage(appService.navHistory.historyList[index])"
@
on-close=
"onClose(appService.navHistory.historyList[index]
)"
>
<template
v-for=
"(
item, index) of appService.navHistory.history
List"
>
<Tag
ref=
"tagElement"
:key=
"index"
:class=
"isActive(
item) ? 'tag-is-active' : ''"
:name=
"index"
closable
@
click
.
native=
"changePage(item)"
@
on-close=
"onClose(item
)"
>
<div
class=
"tag-text"
>
<div
:title=
"getCaption(
meta.caption,
meta.info)"
style=
"max-width: 300px;"
>
<i
v-if=
"
meta.iconCls && !Object.is(meta.iconCls, '')"
:class=
"
meta.iconCls"
></i>
<img
v-else
:src=
"meta.imgPath"
class=
"text-icon"
/>
{{
getCaption
(
meta
.
caption
,
meta
.
info
)
}}
<div
:title=
"getCaption(
item.meta.caption, item.
meta.info)"
style=
"max-width: 300px;"
>
<i
v-if=
"
item.meta.iconCls && !Object.is(item.meta.iconCls, '')"
:class=
"item.
meta.iconCls"
></i>
<img
v-else
:src=
"
item.
meta.imgPath"
class=
"text-icon"
/>
{{
getCaption
(
item
.
meta
.
caption
,
item
.
meta
.
info
)
}}
</div>
</div>
</Tag>
...
...
@@ -40,6 +40,7 @@
import
{
Vue
,
Component
,
Provide
,
Prop
,
Watch
}
from
'vue-property-decorator'
;
import
{
Environment
}
from
'../../environments/environment'
;
import
{
AppService
}
from
'../../studio-core/service/app-service/AppService'
;
import
{
HistoryItem
}
from
'../../studio-core/service/app-nav-history/AppNavHistoryBase'
;
@
Component
({})
export
default
class
TabPageExp
extends
Vue
{
...
...
@@ -101,12 +102,12 @@ export default class TabPageExp extends Vue {
/**
* 是否选中
*
* @param {
*} page
* @param {
HistoryItem} item
* @returns {boolean}
* @memberof TabPageExp
*/
public
isActive
(
page
:
any
):
boolean
{
if
(
Object
.
is
(
page
.
fullPath
,
this
.
$route
.
fullPath
))
{
public
isActive
(
item
:
HistoryItem
):
boolean
{
if
(
Object
.
is
(
item
.
to
.
fullPath
,
this
.
$route
.
fullPath
))
{
return
true
;
}
return
false
;
...
...
@@ -115,11 +116,11 @@ export default class TabPageExp extends Vue {
/**
* 关闭
*
* @param {
*} page
* @param {
HistoryItem} item
* @memberof TabPageExp
*/
public
onClose
(
page
:
any
)
{
const
appview
=
this
.
$store
.
getters
[
'viewaction/getAppView'
](
this
.
appService
.
navHistory
.
viewTagMap
.
get
(
page
.
fullPath
)
);
public
onClose
(
item
:
HistoryItem
)
{
const
appview
=
this
.
$store
.
getters
[
'viewaction/getAppView'
](
item
.
tag
);
if
(
appview
&&
appview
.
viewdatachange
)
{
const
title
:
any
=
this
.
$t
(
'app.tabpage.sureclosetip.title'
);
const
content
:
any
=
this
.
$t
(
'app.tabpage.sureclosetip.content'
);
...
...
@@ -127,15 +128,15 @@ export default class TabPageExp extends Vue {
title
:
title
,
content
:
content
,
onOk
:
()
=>
{
this
.
appService
.
navHistory
.
remove
(
page
);
this
.
gotoPage
(
page
);
this
.
appService
.
navHistory
.
remove
(
item
);
this
.
gotoPage
(
item
.
to
);
},
onCancel
:
()
=>
{
}
});
}
else
{
this
.
appService
.
navHistory
.
remove
(
page
);
this
.
gotoPage
(
page
);
this
.
appService
.
navHistory
.
remove
(
item
);
this
.
gotoPage
(
item
.
to
);
}
}
...
...
@@ -155,11 +156,11 @@ export default class TabPageExp extends Vue {
/**
* 切换分页
*
* @param {*}
page
* @param {*}
item
* @memberof TabPageExp
*/
public
changePage
(
page
:
any
)
{
this
.
gotoPage
(
page
);
public
changePage
(
item
:
HistoryItem
)
{
this
.
gotoPage
(
item
.
to
);
}
/**
...
...
@@ -254,7 +255,7 @@ export default class TabPageExp extends Vue {
this
.
appService
.
navHistory
.
reset
();
this
.
gotoPage
();
}
else
if
(
Object
.
is
(
name
,
'closeOther'
))
{
this
.
appService
.
navHistory
.
removeOther
(
this
.
$route
);
this
.
appService
.
navHistory
.
removeOther
(
{
to
:
this
.
$route
}
);
this
.
moveToView
(
this
.
$route
);
}
}
...
...
app_CRM/src/service/campaign/campaign-service-base.ts
浏览文件 @
752f3075
...
...
@@ -62,21 +62,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
let
campaigncampaignsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
...
...
@@ -107,6 +92,21 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
campaignlists
=
campaignlistsData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -133,21 +133,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
let
campaigncampaignsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
...
...
@@ -178,11 +163,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
campaignlists
=
campaignlistsData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/getdraft`
,
isloading
);
res
.
data
.
campaign
=
data
.
campaign
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -258,21 +258,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
let
campaigncampaignsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
...
...
@@ -303,11 +288,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
campaignlists
=
campaignlistsData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
app_CRM/src/service/contact/contact-service-base.ts
浏览文件 @
752f3075
此差异已折叠。
点击以展开。
app_CRM/src/service/opportunity/opportunity-service-base.ts
浏览文件 @
752f3075
此差异已折叠。
点击以展开。
app_CRM/src/service/product/product-service-base.ts
浏览文件 @
752f3075
此差异已折叠。
点击以展开。
app_CRM/src/service/sales-literature/sales-literature-service-base.ts
浏览文件 @
752f3075
此差异已折叠。
点击以展开。
app_CRM/src/studio-core/service/app-nav-history/AppNavHistoryBase.ts
浏览文件 @
752f3075
...
...
@@ -2,6 +2,43 @@ import { Util } from '@/utils';
import
{
AppContextStore
}
from
'../app-context-store/AppContextStore'
;
import
{
UIStateService
}
from
'../UIStateService'
;
/**
* 历史记录项
*
* @export
* @interface HistoryItem
*/
export
interface
HistoryItem
{
/**
* 路由信息
*
* @type {*}
* @memberof HistoryItem
*/
to
?:
any
;
/**
* 参数信息
*
* @type {*}
* @memberof HistoryItem
*/
meta
?:
any
;
/**
* 视图标识
*
* @type {string}
* @memberof HistoryItem
*/
tag
?:
string
;
/**
* 上下文
*
* @type {*}
* @memberof HistoryItem
*/
context
?:
any
;
}
/**
* 应用导航记录基类
*
...
...
@@ -29,26 +66,10 @@ export class AppNavHistoryBase {
/**
* 路由记录缓存
*
* @type {
any
[]}
* @type {
HistoryItem
[]}
* @memberof AppNavHistoryBase
*/
public
readonly
historyList
:
any
[]
=
[];
/**
* 参数列表
*
* @type {string[]}
* @memberof AppNavHistoryBase
*/
public
readonly
metaList
:
string
[]
=
[];
/**
* 视图标识
*
* @type {Map<string, string>}
* @memberof AppNavHistoryBase
*/
public
readonly
viewTagMap
:
Map
<
string
,
string
>
=
new
Map
();
public
readonly
historyList
:
HistoryItem
[]
=
[];
/**
* 导航缓存,忽略判断的导航参数正则
...
...
@@ -72,10 +93,11 @@ export class AppNavHistoryBase {
return
-
1
;
}
return
list
.
findIndex
((
item
:
any
)
=>
{
const
to
=
item
.
to
;
// 基本路径是否一致
if
(
Object
.
is
(
item
.
path
,
page
.
path
))
{
if
(
Object
.
is
(
to
.
path
,
page
.
path
))
{
// 历史路径是否存在参数
if
(
this
.
uiStateService
.
layoutState
.
styleMode
===
'STYLE2'
&&
item
.
query
)
{
if
(
this
.
uiStateService
.
layoutState
.
styleMode
===
'STYLE2'
&&
to
.
query
)
{
let
judge
:
boolean
=
true
;
// 新路径是否存在参数
if
(
page
.
query
)
{
...
...
@@ -84,7 +106,7 @@ export class AppNavHistoryBase {
if
(
this
.
navIgnoreParameters
.
test
(
`|
${
key
}
|`
))
{
continue
;
}
if
(
item
.
query
[
key
]
===
undefined
||
item
.
query
[
key
]
===
null
)
{
if
(
to
.
query
[
key
]
===
undefined
||
to
.
query
[
key
]
===
null
)
{
judge
=
false
;
}
}
...
...
@@ -102,30 +124,31 @@ export class AppNavHistoryBase {
/**
* 添加视图缓存
*
* @param {*}
page
当前路由信息
* @param {*}
to
当前路由信息
* @memberof AppNavHistoryBase
*/
public
add
(
page
:
any
):
void
{
if
(
this
.
findHistoryIndex
(
page
)
===
-
1
)
{
if
(
this
.
uiStateService
.
layoutState
.
styleMode
===
'DEFAULT'
&&
page
?.
matched
?.
length
===
1
)
{
public
add
(
to
:
any
):
void
{
if
(
this
.
findHistoryIndex
(
to
)
===
-
1
)
{
if
(
this
.
uiStateService
.
layoutState
.
styleMode
===
'DEFAULT'
&&
to
?.
matched
?.
length
===
1
)
{
return
;
}
this
.
historyList
.
push
(
page
);
this
.
metaList
.
push
(
Util
.
deepCopy
(
page
.
meta
));
this
.
historyList
.
push
({
to
,
meta
:
Util
.
deepCopy
(
to
.
meta
)
});
}
}
/**
* 删除视图缓存
*
* @param {
*} page
* @param {
HistoryItem} item
* @memberof AppNavHistoryBase
*/
public
remove
(
page
:
any
):
void
{
const
i
=
this
.
findHistoryIndex
(
page
);
public
remove
(
item
:
HistoryItem
):
void
{
const
i
=
this
.
findHistoryIndex
(
item
.
to
);
if
(
i
!==
-
1
)
{
this
.
historyList
.
splice
(
i
,
1
);
this
.
metaList
.
splice
(
i
,
1
);
}
}
...
...
@@ -137,7 +160,6 @@ export class AppNavHistoryBase {
*/
public
reset
(
num
:
number
=
0
):
void
{
this
.
historyList
.
splice
(
num
,
this
.
historyList
.
length
);
this
.
metaList
.
splice
(
num
,
this
.
metaList
.
length
);
}
/**
...
...
@@ -152,8 +174,8 @@ export class AppNavHistoryBase {
if
(
i
===
-
1
)
{
return
false
;
}
const
meta
=
this
.
meta
List
[
i
];
Object
.
assign
(
meta
,
{
caption
,
info
});
const
item
=
this
.
history
List
[
i
];
Object
.
assign
(
item
.
meta
,
{
caption
,
info
});
return
true
;
}
...
...
@@ -170,26 +192,23 @@ export class AppNavHistoryBase {
if
(
i
===
-
1
)
{
return
false
;
}
const
page
=
this
.
historyList
[
i
];
this
.
viewTagMap
.
set
(
page
.
fullPath
,
tag
)
;
const
item
=
this
.
historyList
[
i
];
item
.
tag
=
tag
;
return
true
;
}
/**
* 删除其他缓存
*
* @param {
*} page
* @param {
HistoryItem} item
* @memberof AppNavHistoryBase
*/
public
removeOther
(
page
:
any
):
void
{
const
i
=
this
.
findHistoryIndex
(
page
);
public
removeOther
(
item
:
HistoryItem
):
void
{
const
i
=
this
.
findHistoryIndex
(
item
.
to
);
if
(
i
!==
-
1
)
{
const
page
=
this
.
historyList
[
i
];
const
meta
=
this
.
metaList
[
i
];
this
.
historyList
.
splice
(
0
,
this
.
historyList
.
length
);
this
.
metaList
.
splice
(
0
,
this
.
metaList
.
length
);
this
.
historyList
.
push
(
page
);
this
.
metaList
.
push
(
meta
);
}
}
...
...
@@ -200,7 +219,6 @@ export class AppNavHistoryBase {
*/
public
pop
():
void
{
this
.
historyList
.
pop
();
this
.
metaList
.
pop
();
}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录