Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
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
yanyanhong
traceSourceMb
Commits
1e2f7f3d
Commit
1e2f7f3d
authored
Oct 15, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userTemplate vuex
parent
61ab6382
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
19 deletions
+17
-19
proof.ts
src/store/modules/proof.ts
+1
-4
template.ts
src/store/modules/template.ts
+11
-1
Index-sy.vue
src/views/index/Index-sy.vue
+2
-7
SelectTemplate.vue
src/views/template/components/SelectTemplate.vue
+3
-7
No files found.
src/store/modules/proof.ts
View file @
1e2f7f3d
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
const
$api
=
Vue
.
prototype
.
$api
;
const
state
=
{
const
state
=
{
};
};
const
getters
=
{
const
getters
=
{
...
@@ -9,9 +8,7 @@ const mutations = {
...
@@ -9,9 +8,7 @@ const mutations = {
};
};
const
actions
=
{
const
actions
=
{
getProofList
()
{
$api
.
list
();
},
};
};
const
namespaced
:
boolean
=
true
;
const
namespaced
:
boolean
=
true
;
export
const
proof
=
{
export
const
proof
=
{
...
...
src/store/modules/template.ts
View file @
1e2f7f3d
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
const
state
=
{
const
state
=
{
sysTemplateList
:
[]
=
[],
sysTemplateList
:
[]
=
[],
userFolderList
:
[]
=
[],
};
};
const
getters
=
{
const
getters
=
{
...
@@ -9,15 +10,24 @@ const mutations = {
...
@@ -9,15 +10,24 @@ const mutations = {
updateSysTemplateList
(
state
:
any
,
payload
:
any
)
{
updateSysTemplateList
(
state
:
any
,
payload
:
any
)
{
state
.
sysTemplateList
=
payload
||
[];
state
.
sysTemplateList
=
payload
||
[];
},
},
updateUserFolders
(
state
:
any
,
payload
:
any
)
{
state
.
userFolderList
=
payload
||
[];
},
};
};
const
actions
=
{
const
actions
=
{
getSysTemplateList
({
commit
,
state
}:
any
)
{
getSysTemplateList
({
commit
}:
any
)
{
if
(
state
.
sysTemplateList
.
length
<=
0
)
{
if
(
state
.
sysTemplateList
.
length
<=
0
)
{
Vue
.
prototype
.
$api
.
template
.
systemList
().
then
(({
results
=
[]})
=>
{
Vue
.
prototype
.
$api
.
template
.
systemList
().
then
(({
results
=
[]})
=>
{
commit
(
'updateSysTemplateList'
,
results
||
[]);
commit
(
'updateSysTemplateList'
,
results
||
[]);
});
});
}
}
},
},
async
getUserFolders
({
commit
}:
any
)
{
const
{
results
=
[]}
=
await
Vue
.
prototype
.
$api
.
template
.
folderList
({
template_type
:
1
});
const
ids
=
results
.
map
((
folder
:
any
)
=>
folder
.
id
);
const
res
=
await
Vue
.
prototype
.
$api
.
template
.
list
({
id
:
ids
});
commit
(
'updateUserFolders'
,
res
.
results
||
[]);
},
};
};
const
namespaced
:
boolean
=
true
;
const
namespaced
:
boolean
=
true
;
export
const
template
=
{
export
const
template
=
{
...
...
src/views/index/Index-sy.vue
View file @
1e2f7f3d
...
@@ -82,7 +82,8 @@ export default class IndexSy extends Mixins(IndexMixin) {
...
@@ -82,7 +82,8 @@ export default class IndexSy extends Mixins(IndexMixin) {
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
@
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
private
list
:
any
[]
=
[];
@
Action
(
'getUserFolders'
,
{
namespace
:
'template'
})
private
getUserFolders
!
:
()
=>
void
;
@
State
(
'userFolderList'
,
{
namespace
:
'template'
})
private
list
!
:
any
[];
private
currentFolder
:
object
=
{};
private
currentFolder
:
object
=
{};
private
show
:
boolean
=
false
;
private
show
:
boolean
=
false
;
private
isShowRename
:
boolean
=
false
;
private
isShowRename
:
boolean
=
false
;
...
@@ -105,12 +106,6 @@ export default class IndexSy extends Mixins(IndexMixin) {
...
@@ -105,12 +106,6 @@ export default class IndexSy extends Mixins(IndexMixin) {
};
};
this
.
show
=
true
;
this
.
show
=
true
;
}
}
private
async
getUserFolders
()
{
const
{
results
=
[]}
=
await
this
.
$api
.
template
.
folderList
({
template_type
:
1
});
const
ids
=
results
.
map
((
folder
:
any
)
=>
folder
.
id
);
const
res
=
await
this
.
$api
.
template
.
list
({
id
:
ids
});
this
.
list
=
res
.
results
||
[];
}
private
async
addFolder
(
{
folderName
}:
any
)
{
private
async
addFolder
(
{
folderName
}:
any
)
{
this
.
showAddFolder
=
false
;
this
.
showAddFolder
=
false
;
await
this
.
$api
.
template
.
addFolder
(
folderName
);
await
this
.
$api
.
template
.
addFolder
(
folderName
);
...
...
src/views/template/components/SelectTemplate.vue
View file @
1e2f7f3d
...
@@ -128,8 +128,10 @@ import PreviewTemplate from './PreviewTemplate.vue';
...
@@ -128,8 +128,10 @@ import PreviewTemplate from './PreviewTemplate.vue';
})
})
export
default
class
SelectTemplate
extends
Mixins
(
IndexMixin
)
{
export
default
class
SelectTemplate
extends
Mixins
(
IndexMixin
)
{
@
Inject
(
'isSy'
)
private
isSy
!
:
boolean
;
@
Inject
(
'isSy'
)
private
isSy
!
:
boolean
;
@
Action
(
'getUserFolders'
,
{
namespace
:
'template'
})
private
getUserFolders
!
:
()
=>
void
;
@
State
(
'userFolderList'
,
{
namespace
:
'template'
})
private
userFolderList
!
:
any
[];
private
active
:
number
=
0
;
private
active
:
number
=
0
;
private
userFolderList
:
any
[]
=
[];
private
currentFolder
:
any
=
{};
private
currentFolder
:
any
=
{};
private
currentTemplate
:
any
=
{};
private
currentTemplate
:
any
=
{};
private
show
:
boolean
=
true
;
private
show
:
boolean
=
true
;
...
@@ -142,12 +144,6 @@ export default class SelectTemplate extends Mixins(IndexMixin) {
...
@@ -142,12 +144,6 @@ export default class SelectTemplate extends Mixins(IndexMixin) {
protected
mounted
()
{
protected
mounted
()
{
this
.
getUserFolders
();
this
.
getUserFolders
();
}
}
private
async
getUserFolders
()
{
const
{
results
}
=
await
this
.
$api
.
template
.
folderList
({
template_type
:
1
});
const
ids
=
(
results
||
[]).
map
((
folder
:
any
)
=>
folder
.
id
);
const
res
=
await
this
.
$api
.
template
.
list
({
id
:
ids
});
this
.
userFolderList
=
res
.
results
||
[];
}
private
selectFolder
(
folder
:
any
)
{
private
selectFolder
(
folder
:
any
)
{
this
.
currentFolder
=
folder
;
this
.
currentFolder
=
folder
;
this
.
showDetailb
=
false
;
this
.
showDetailb
=
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