Skip to content

Commit efa7a0b

Browse files
author
yuchenyao
committed
修复列表展示tag的缺陷,描述过长加省略,单击该行跳转到工作空间
1 parent b3479c0 commit efa7a0b

File tree

3 files changed

+35
-31
lines changed

3 files changed

+35
-31
lines changed

web/src/js/view/newhome/module/caseAndIntroduction/index.vue

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,7 @@
1818
</div>
1919
</div>
2020
</div>
21-
<!-- <div class="admin-box-right">
22-
<p class="title">{{$t('message.GLY.KSRM')}}</p>
23-
<div class="admin-box-video">
24-
<div v-for="(item, index) in videos" :key="index" class="video-item" @click="play(item)">
25-
<video width="100%" height="100" controls>
26-
<source :src="item.url" type="video/mp4" />
27-
</video>
28-
<h3 class="video-title">{{item.title}}</h3>
29-
</div>
30-
</div>
31-
</div> -->
3221
</div>
33-
<Modal
34-
v-model="showVideo"
35-
:title="video.title"
36-
:footer-hide="true"
37-
width="800"
38-
>
39-
<video v-if="showVideo" width="100%" controls autoplay>
40-
<source :src="video.url" type="video/mp4" />
41-
</video>
42-
</Modal>
4322
</div>
4423
</template>
4524
<script>
@@ -62,14 +41,12 @@ export default {
6241
{title: 'Scriptis',url: '/home',icon: 'fi-scriptis'},
6342
{title: 'Workflow',url: '/project',icon: 'fi-workflow1'},
6443
],
65-
showVideo: false,
6644
video: {},
6745
demos: [],
6846
videos: []
6947
}
7048
},
7149
created() {
72-
// this.getVideos();
7350
this.getDemos();
7451
},
7552
methods: {
@@ -103,10 +80,6 @@ export default {
10380
getsrc(item) {
10481
return this.src[item.name];
10582
},
106-
play(item) {
107-
this.showVideo = true;
108-
this.video = item
109-
}
11083
}
11184
};
11285
</script>

web/src/js/view/newhome/module/workspace/index.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
<li v-if="tag && tagIndex <= 2" class="item" :key="tagIndex">{{tag}}</li>
6161
</template>
6262
</ul>
63-
<!-- <Button size="small" class="editor" @click.stop="editor(item)">{{ $t('message.workspace.editWorkspace') }}</Button> -->
6463
</i-col>
6564
</Row>
6665
<div v-show="visual === 'table'" class="workspace-table">
@@ -103,6 +102,16 @@
103102
:add-project-show="workspaceShow"
104103
@show="workspaceShowAction"
105104
@confirm="workspaceConfirm"></WorkspaceForm>
105+
<Modal
106+
v-model="showVideo"
107+
:title="video.title"
108+
:footer-hide="true"
109+
width="800"
110+
>
111+
<video v-if="showVideo" width="100%" controls autoplay>
112+
<source :src="video.url" type="video/mp4" />
113+
</video>
114+
</Modal>
106115
<Spin
107116
v-if="loading"
108117
size="large"
@@ -125,6 +134,7 @@ export default {
125134
data() {
126135
return {
127136
loading: false,
137+
showVideo: false,
128138
actionType: '',
129139
currentWorkspaceData: {
130140
name: '',
@@ -137,6 +147,7 @@ export default {
137147
cacheData: [],
138148
filteredData: [],
139149
visual: 'card',
150+
video: {},
140151
videos: [],
141152
videoCache: [],
142153
visualCates: [
@@ -253,6 +264,10 @@ export default {
253264
} else {
254265
this.videos = this.videoCache.slice(0, this.pageSize);
255266
}
267+
},
268+
play(item) {
269+
this.showVideo = true;
270+
this.video = item
256271
}
257272
}
258273
}

web/src/js/view/newhome/module/workspace/module/workspaceTable.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="workspace-table">
3-
<Table :columns="columns" :data="tableData" style="margin-bottom: 10px;">
3+
<Table :columns="columns" :data="tableData" style="margin-bottom: 10px;" @on-row-click="gotoWorkspace">
44
<template slot-scope="{ row }" slot="name">
55
<span>{{ row.name }}</span>
66
</template>
@@ -10,11 +10,13 @@
1010
</template>
1111

1212
<template slot-scope="{ row }" slot="label" >
13-
<Tag color="blue" v-for="(label, index) in row.label.split(',')" :key="index">{{label}}</Tag>
13+
<template v-if="row.label">
14+
<Tag color="blue" v-for="(label, index) in row.label.split(',')" :key="index">{{label}}</Tag>
15+
</template>
1416
</template>
1517

1618
<template slot-scope="{ row }" slot="description">
17-
<span>{{ row.description }}</span>
19+
<span class="desc">{{ row.description }}</span>
1820
</template>
1921
</Table>
2022
</div>
@@ -65,6 +67,20 @@ export default {
6567
dateFormat(date) {
6668
return moment(date).format('YYYY-MM-DD HH:mm:ss');
6769
},
70+
gotoWorkspace(workspace) {
71+
this.$router.push({ path: '/workspace', query: { workspaceId: workspace.id }});
72+
},
6873
}
6974
}
7075
</script>
76+
77+
<style lang="scss" scoped>
78+
.workspace-table {
79+
.desc {
80+
width: 100%;
81+
display: block;
82+
overflow: hidden;
83+
text-overflow: ellipsis;
84+
}
85+
}
86+
</style>

0 commit comments

Comments
 (0)