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
003a7fef
Commit
003a7fef
authored
Sep 25, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板列表页样式 及文件夹名称显示
parent
1f331b34
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
17 deletions
+11
-17
index.ts
src/router/index.ts
+1
-1
Index-sy.vue
src/views/index/Index-sy.vue
+7
-16
List.vue
src/views/template/List.vue
+3
-0
No files found.
src/router/index.ts
View file @
003a7fef
...
@@ -101,7 +101,7 @@ const routes: RouteConfig[] = [
...
@@ -101,7 +101,7 @@ const routes: RouteConfig[] = [
// this generates a separate chunk (about.[hash].js) for this route
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
// which is lazy-loaded when the route is visited.
component
:
()
=>
import
(
/* webpackChunkName: "templ-list" */
'@/views/template/List.vue'
),
component
:
()
=>
import
(
/* webpackChunkName: "templ-list" */
'@/views/template/List.vue'
),
props
:
(
route
)
=>
({
templList
:
route
.
query
.
templList
}),
props
:
(
{
query
:
{
templList
,
folderName
}})
=>
({
templList
,
folderName
}),
meta
:
{
requiresAuth
:
true
},
meta
:
{
requiresAuth
:
true
},
},
},
{
{
...
...
src/views/index/Index-sy.vue
View file @
003a7fef
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<li
<li
v-for=
"
{ id, folder_simg_url, folder_name, detail} of systemList"
v-for=
"
{ id, folder_simg_url, folder_name, detail} of systemList"
:key="id"
:key="id"
@click="goTemplList(detail)"
@click="goTemplList(detail
, folder_name
)"
>
>
<van-image
:src=
"folder_simg_url"
width=
"44px"
height=
"64px"
fit=
"contain"
></van-image>
<van-image
:src=
"folder_simg_url"
width=
"44px"
height=
"64px"
fit=
"contain"
></van-image>
<div
style=
"font-size:14px;color:#353535;"
>
{{
folder_name
}}
</div>
<div
style=
"font-size:14px;color:#353535;"
>
{{
folder_name
}}
</div>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
</div>
</div>
<empty
v-if=
"!list.length && !loading"
name=
"moban"
tip=
"您还未添加模板"
></empty>
<empty
v-if=
"!list.length && !loading"
name=
"moban"
tip=
"您还未添加模板"
></empty>
<div>
<div>
<div
class=
"folder-item"
v-for=
"
{id, folder_simg_url, folder_name, detail} of list" :key="id" @click="goTemplList(detail)">
<div
class=
"folder-item"
v-for=
"
{id, folder_simg_url, folder_name, detail} of list" :key="id" @click="goTemplList(detail
, folder_name
)">
<van-image
<van-image
class=
"thumb"
class=
"thumb"
:src=
"folder_simg_url"
:src=
"folder_simg_url"
...
@@ -81,18 +81,9 @@ export default class IndexSy extends Mixins(IndexMixin) {
...
@@ -81,18 +81,9 @@ export default class IndexSy extends Mixins(IndexMixin) {
private
async
onIsLoginChange
(
newVal
:
boolean
,
oldVal
:
boolean
)
{
private
async
onIsLoginChange
(
newVal
:
boolean
,
oldVal
:
boolean
)
{
if
(
!
newVal
)
{
if
(
!
newVal
)
{
this
.
loading
=
false
;
this
.
loading
=
false
;
}
}
else
{
if
(
newVal
)
{
const
promises
=
[
this
.
getProofCount
(),
this
.
getUserFolders
()];
const
promises
=
Promise
.
all
([
await
Promise
.
all
(
promises
);
this
.
getProofCount
(),
this
.
$api
.
template
.
folderList
({
template_type
:
1
,
})]);
const
[
,
folderListResult
]
=
await
promises
;
const
{
results
=
[]
}
=
folderListResult
;
const
ids
=
results
.
map
((
folder
:
any
)
=>
folder
.
id
);
const
res
=
await
this
.
$api
.
template
.
list
({
id
:
ids
});
this
.
list
=
res
.
results
||
[];
this
.
loading
=
false
;
this
.
loading
=
false
;
}
}
}
}
...
@@ -110,8 +101,8 @@ export default class IndexSy extends Mixins(IndexMixin) {
...
@@ -110,8 +101,8 @@ export default class IndexSy extends Mixins(IndexMixin) {
private
toLogin
()
{
private
toLogin
()
{
this
.
$router
.
push
({
name
:
'Login'
});
this
.
$router
.
push
({
name
:
'Login'
});
}
}
private
goTemplList
(
templList
:
[]
=
[])
{
private
goTemplList
(
templList
:
[]
=
[]
,
folderName
=
''
)
{
this
.
$router
.
push
({
name
:
'TemplList'
,
query
:
{
templList
:
JSON
.
stringify
(
templList
)
}
});
this
.
$router
.
push
({
name
:
'TemplList'
,
query
:
{
templList
:
JSON
.
stringify
(
templList
)
,
folderName
}
});
}
}
}
}
</
script
>
</
script
>
...
...
src/views/template/List.vue
View file @
003a7fef
<
template
>
<
template
>
<div
class=
"template-list"
>
<div
class=
"template-list"
>
<div
style=
"display:flex;flex-direction:row;justify-content:space-between;align-items:center;"
><span>
{{
folderName
}}
</span><router-link
to=
"addTemplate"
tag=
"p"
style=
"color:#3F79FE;"
>
+添加模板
</router-link></div>
<empty
v-if=
"!list"
name=
"moban"
tip=
"您还未添加模板"
style=
"margin-top:30vh"
></empty>
<empty
v-if=
"!list"
name=
"moban"
tip=
"您还未添加模板"
style=
"margin-top:30vh"
></empty>
<template-item
<template-item
v-for=
"
{id, s_image_url, name, info} of list"
v-for=
"
{id, s_image_url, name, info} of list"
...
@@ -29,6 +30,8 @@ export default class Index extends Vue {
...
@@ -29,6 +30,8 @@ export default class Index extends Vue {
@
Prop
({
@
Prop
({
})
})
private
templList
!
:
string
;
private
templList
!
:
string
;
@
Prop
()
private
folderName
!
:
string
;
@
Watch
(
'templList'
,
{
immediate
:
true
,
deep
:
true
})
@
Watch
(
'templList'
,
{
immediate
:
true
,
deep
:
true
})
private
async
onRouteChange
(
newTemplList
:
string
,
oldTemplList
:
string
)
{
private
async
onRouteChange
(
newTemplList
:
string
,
oldTemplList
:
string
)
{
this
.
list
=
JSON
.
parse
(
newTemplList
);
this
.
list
=
JSON
.
parse
(
newTemplList
);
...
...
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