Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
source-trace-manage-go
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tracing
source-trace-manage-go
Commits
a6ef76c9
Commit
a6ef76c9
authored
Dec 22, 2020
by
zL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缓存
parent
2b4e4082
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
10 deletions
+49
-10
TemplateManage.vue
src/components/category/TemplateManage.vue
+33
-7
getters.ts
src/store/getters.ts
+2
-0
mutations.ts
src/store/mutations.ts
+8
-1
state.ts
src/store/state.ts
+3
-1
types.ts
src/store/types.ts
+3
-1
No files found.
src/components/category/TemplateManage.vue
View file @
a6ef76c9
...
@@ -174,7 +174,6 @@ export default {
...
@@ -174,7 +174,6 @@ export default {
classificationList
:
[],
//系统模板>分类
classificationList
:
[],
//系统模板>分类
theTemplateList
:
[],
//系统模板>分类>模板
theTemplateList
:
[],
//系统模板>分类>模板
checkIndex
:
0
,
// 系统模板>分类>选中效果
checkIndex
:
0
,
// 系统模板>分类>选中效果
TemplateType
:
0
,
//个人模板or系统模板>选中效果
MyCategories
:
[],
// 个人模板>分类
MyCategories
:
[],
// 个人模板>分类
ClassificationPopups
:
false
,
//个人模板>分类>添加弹窗
ClassificationPopups
:
false
,
//个人模板>分类>添加弹窗
checkClassification
:
0
,
//个人模板>分类>选择效果
checkClassification
:
0
,
//个人模板>分类>选择效果
...
@@ -197,11 +196,30 @@ export default {
...
@@ -197,11 +196,30 @@ export default {
CopyTemplate
,
CopyTemplate
,
rename
,
rename
,
},
},
computed
:
{
//个人模板or系统模板>选中效果
TemplateType
()
{
return
this
.
$store
.
getters
.
get_templateType
;
},
TemplateDate
()
{
return
this
.
$store
.
getters
.
get_templateData
;
},
},
created
()
{
created
()
{
this
.
listOfSystem
();
if
(
this
.
TemplateType
===
0
)
{
if
(
this
.
$route
.
query
.
type
)
{
// 系统模板
this
.
TemplateType
=
1
;
this
.
listOfSystem
();
if
(
!
this
.
TemplateDate
.
index
)
return
;
this
.
switchClassification
(
this
.
TemplateDate
.
item
,
this
.
TemplateDate
.
index
);
}
else
{
this
.
getFolderList
();
this
.
getFolderList
();
this
.
switchPersonalClassification
(
this
.
TemplateDate
.
item
,
this
.
TemplateDate
.
index
);
}
}
},
},
methods
:
{
methods
:
{
...
@@ -329,6 +347,7 @@ export default {
...
@@ -329,6 +347,7 @@ export default {
},
},
// 个人模板>分类>切换
// 个人模板>分类>切换
switchPersonalClassification
(
item
,
index
)
{
switchPersonalClassification
(
item
,
index
)
{
this
.
$store
.
commit
(
"setTemplateData"
,
{
item
,
index
});
this
.
checkClassification
=
index
;
this
.
checkClassification
=
index
;
this
.
getpersonalList
(
item
.
id
);
this
.
getpersonalList
(
item
.
id
);
},
},
...
@@ -355,20 +374,23 @@ export default {
...
@@ -355,20 +374,23 @@ export default {
});
});
if
(
res
)
{
if
(
res
)
{
this
.
MyCategories
=
res
.
data
.
results
;
this
.
MyCategories
=
res
.
data
.
results
;
if
(
this
.
TemplateDate
.
index
)
return
;
this
.
getpersonalList
(
this
.
MyCategories
[
0
].
id
);
this
.
getpersonalList
(
this
.
MyCategories
[
0
].
id
);
this
.
checkClassification
=
0
;
this
.
checkClassification
=
0
;
}
}
},
},
//个人模板or系统模板切换
//个人模板or系统模板切换
SwitchTemplate
(
key
)
{
SwitchTemplate
(
key
)
{
console
.
log
(
key
);
switch
(
key
)
{
switch
(
key
)
{
case
0
:
case
0
:
this
.
TemplateType
=
1
;
this
.
$store
.
commit
(
"setTemplateType"
,
1
);
this
.
$store
.
commit
(
"setTemplateData"
,
{});
this
.
getFolderList
();
this
.
getFolderList
();
break
;
break
;
case
1
:
case
1
:
this
.
TemplateType
=
0
;
this
.
$store
.
commit
(
"setTemplateType"
,
0
);
this
.
$store
.
commit
(
"setTemplateData"
,
{});
this
.
listOfSystem
();
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -384,6 +406,9 @@ export default {
...
@@ -384,6 +406,9 @@ export default {
},
},
// 系统模板下的分类切换
// 系统模板下的分类切换
switchClassification
(
item
,
index
)
{
switchClassification
(
item
,
index
)
{
if
(
index
!==
this
.
TemplateDate
.
index
)
{
this
.
$store
.
commit
(
"setTemplateData"
,
{
item
,
index
});
}
this
.
checkIndex
=
index
;
this
.
checkIndex
=
index
;
if
(
item
.
detail
)
{
if
(
item
.
detail
)
{
this
.
theTemplateList
=
item
.
detail
;
this
.
theTemplateList
=
item
.
detail
;
...
@@ -401,6 +426,7 @@ export default {
...
@@ -401,6 +426,7 @@ export default {
});
});
if
(
res
)
{
if
(
res
)
{
this
.
classificationList
=
res
.
data
.
results
;
this
.
classificationList
=
res
.
data
.
results
;
if
(
this
.
TemplateDate
.
index
)
return
;
if
(
res
.
data
.
results
[
0
].
detail
)
{
if
(
res
.
data
.
results
[
0
].
detail
)
{
this
.
theTemplateList
=
res
.
data
.
results
[
0
].
detail
;
this
.
theTemplateList
=
res
.
data
.
results
[
0
].
detail
;
this
.
$store
.
commit
(
this
.
$store
.
commit
(
...
...
src/store/getters.ts
View file @
a6ef76c9
...
@@ -2,6 +2,8 @@ import { StateTypes } from "./types";
...
@@ -2,6 +2,8 @@ import { StateTypes } from "./types";
import
{
GetterTree
}
from
"vuex"
;
import
{
GetterTree
}
from
"vuex"
;
const
getters
:
GetterTree
<
StateTypes
,
any
>
=
{
const
getters
:
GetterTree
<
StateTypes
,
any
>
=
{
get_templateType
:
state
=>
state
.
templateType
,
get_templateData
:
state
=>
state
.
templateData
,
};
};
export
default
getters
;
export
default
getters
;
src/store/mutations.ts
View file @
a6ef76c9
...
@@ -50,7 +50,14 @@ const mutations: MutationTree<StateTypes> = {
...
@@ -50,7 +50,14 @@ const mutations: MutationTree<StateTypes> = {
},
},
setChainStatus
(
state
,
str
)
{
setChainStatus
(
state
,
str
)
{
state
.
chainStatus
=
str
state
.
chainStatus
=
str
}
},
setTemplateType
(
state
,
num
)
{
state
.
templateType
=
num
},
setTemplateData
(
state
,
data
)
{
state
.
templateData
=
data
},
// templateData
};
};
export
default
mutations
;
export
default
mutations
;
src/store/state.ts
View file @
a6ef76c9
...
@@ -14,7 +14,9 @@ const state: StateTypes = {
...
@@ -14,7 +14,9 @@ const state: StateTypes = {
userInfos
:
{},
userInfos
:
{},
templateNum
:
0
,
//模板数量
templateNum
:
0
,
//模板数量
theAnchor
:
-
1
,
theAnchor
:
-
1
,
chainStatus
:
''
chainStatus
:
''
,
templateType
:
0
,
templateData
:
{}
};
};
export
default
state
;
export
default
state
;
src/store/types.ts
View file @
a6ef76c9
...
@@ -13,6 +13,8 @@ export interface StateTypes {
...
@@ -13,6 +13,8 @@ export interface StateTypes {
userInfos
:
object
,
// 用户信息
userInfos
:
object
,
// 用户信息
templateNum
:
number
,
// 模板数量
templateNum
:
number
,
// 模板数量
theAnchor
:
number
,
//用于记录增量列表的展开
theAnchor
:
number
,
//用于记录增量列表的展开
chainStatus
:
string
chainStatus
:
string
,
templateType
:
number
,
templateData
:
any
}
}
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