Commit 9b7e49cd authored by mhw's avatar mhw

视频预览

parent 28b16207
<!-- --> <!-- -->
<template> <template>
<div class="cardBox">
<el-card class="box-card" v-for="item in dataList" :key="item.knowledgeId"> <el-card class="box-card" >
<div class="titleBox"> <div class="titleBox">
<div class="title omit">{{item.knowledgeName}}</div> <div class="title omit">{{item.knowledgeName}}</div>
<!-- <div> <!-- <div>
...@@ -41,8 +41,7 @@ ...@@ -41,8 +41,7 @@
</div> </div>
</div> </div>
</el-card> </el-card>
<div class="box-card-2" v-for="item in 3" :key="item"></div>
</div>
</template> </template>
<script> <script>
...@@ -53,7 +52,7 @@ export default { ...@@ -53,7 +52,7 @@ export default {
return { return {
}; };
}, },
props: ['dataList', 'isPreset', 'refresh'], props: ['item', 'isPreset', 'refresh'],
components: {}, components: {},
computed: { computed: {
...@@ -90,11 +89,11 @@ export default { ...@@ -90,11 +89,11 @@ export default {
} }
}, },
edit (item) { edit (item) {
this.$dialog.show('修改模版', editOrAdd, { this.$dialog.show('修改知识库', editOrAdd, {
area: ['100%', '100%'] area: ['100%', '100%']
}, { isEdit: true, item: item }).then(res => { }, { isEdit: true, item: item }).then(res => {
this.refresh(); this.refresh();
}).catch(e => { }); }).catch(e => { this.refresh(); });
}, },
del (item) { del (item) {
this.$confirm('是否确认删除', '提示', { this.$confirm('是否确认删除', '提示', {
...@@ -140,12 +139,7 @@ export default { ...@@ -140,12 +139,7 @@ export default {
min-width: 300px; min-width: 300px;
background: linear-gradient(to bottom, #e7efff 10%, #fff 50%); background: linear-gradient(to bottom, #e7efff 10%, #fff 50%);
} }
.box-card-2 {
width: calc(100% / 4 - 20px);
min-width: 300px;
flex-shrink: 0;
height: 0;
}
div /deep/.el-divider--horizontal { div /deep/.el-divider--horizontal {
margin: 14px 0 0 0; margin: 14px 0 0 0;
} }
...@@ -179,14 +173,7 @@ div /deep/.el-divider--horizontal { ...@@ -179,14 +173,7 @@ div /deep/.el-divider--horizontal {
justify-content: space-between; justify-content: space-between;
margin-bottom: 16px; margin-bottom: 16px;
} }
.cardBox {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-content: flex-start;
justify-content: space-between;
}
.tagBox { .tagBox {
margin-bottom: 10px; margin-bottom: 10px;
} }
......
...@@ -17,7 +17,10 @@ ...@@ -17,7 +17,10 @@
</el-form-item> </el-form-item>
</filter-box> </filter-box>
</el-form> </el-form>
<card :dataList='myDataSetPage.tableData.impl.dataList' :refresh="refresh"></card> <div class="cardBox">
<card v-for="item in myDataSetPage.tableData.impl.dataList" :item="item" :key="item.knowledgeId" :refresh="refresh"></card>
<div class="box-card-2" v-for="item in 3" :key="item"></div>
</div>
<el-row slot="pagination" type="flex" justify="end" style="margin-top: 16px;"> <el-row slot="pagination" type="flex" justify="end" style="margin-top: 16px;">
<el-pagination :total="myDataSetPage.tableData.impl.totalCount" :current-page="myDataSetPage.tableData.impl.currentPage" :page-size="myDataSetPage.tableData.impl.pageSize" :page-sizes="[10, 20, 50, 100]" layout="total, prev, pager, next, sizes" @current-change="myDataSetPage.tableData.impl.onCurrentPageChange" @size-change="myDataSetPage.tableData.impl.onPageSizeChange"> <el-pagination :total="myDataSetPage.tableData.impl.totalCount" :current-page="myDataSetPage.tableData.impl.currentPage" :page-size="myDataSetPage.tableData.impl.pageSize" :page-sizes="[10, 20, 50, 100]" layout="total, prev, pager, next, sizes" @current-change="myDataSetPage.tableData.impl.onCurrentPageChange" @size-change="myDataSetPage.tableData.impl.onPageSizeChange">
</el-pagination> </el-pagination>
...@@ -83,14 +86,14 @@ export default { ...@@ -83,14 +86,14 @@ export default {
area: ['100%', '100%'] area: ['100%', '100%']
}, { isEdit: false }).then(res => { }, { isEdit: false }).then(res => {
this.refresh(); this.refresh();
}).catch(e => { }); }).catch(e => { this.refresh(); });
}, },
edit (item) { edit (item) {
this.$dialog.show('修改知识库', editOrAdd, { this.$dialog.show('修改知识库', editOrAdd, {
area: ['100%', '100%'] area: ['100%', '100%']
}, { isEdit: true, item: item }).then(res => { }, { isEdit: true, item: item }).then(res => {
this.refresh(); this.refresh();
}).catch(e => { }); }).catch(e => { this.refresh(); });
}, },
del (item) { del (item) {
this.$confirm('是否确认删除', '提示', { this.$confirm('是否确认删除', '提示', {
...@@ -182,4 +185,18 @@ export default { ...@@ -182,4 +185,18 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
} }
.cardBox {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-content: flex-start;
justify-content: space-between;
}
.box-card-2 {
width: calc(100% / 4 - 20px);
min-width: 300px;
flex-shrink: 0;
height: 0;
}
</style> </style>
<!-- 文件预览 --> <!-- 文件预览 -->
<template> <template>
<div style="height: calc(100vh - 100px);position: relative;" v-loading.fullscreen.lock="fullscreenLoading" > <div style="height: calc(100vh - 100px);position: relative;" v-loading.fullscreen.lock="fullscreenLoading">
<div class="down"><a :href="url" >下载文件</a></div> <div class="down"><a :href="url">下载文件</a></div>
<div class="image" v-if="['jpg','gif','jpeg','png'].indexOf(fileType)>-1&&url"> <div class="image" v-if="['jpg','gif','jpeg','png'].indexOf(fileType)>-1&&url">
<el-image :src="url"> </el-image> <el-image :src="url"> </el-image>
</div> </div>
<vue-office-docx v-if="['docx','doc'].indexOf(fileType)>-1&&url" :src="url" style="height: 100%;" @rendered="rendered" @error="fullscreenLoading=false"/> <vue-office-docx v-if="['docx','doc'].indexOf(fileType)>-1&&url" :src="url" style="height: 100%;" @rendered="rendered" @error="fullscreenLoading=false" />
<vue-office-excel v-else-if="['xlsx','xls'].indexOf(fileType)>-1&&url" :src="url" style="height: 100%;" @rendered="rendered" @error="fullscreenLoading=false" /> <vue-office-excel v-else-if="['xlsx','xls'].indexOf(fileType)>-1&&url" :src="url" style="height: 100%;" @rendered="rendered" @error="fullscreenLoading=false" />
<template v-else-if="['pdf'].indexOf(fileType)>-1&&url" > <template v-else-if="['pdf'].indexOf(fileType)>-1&&url">
<div class="pagination" > <div class="pagination">
{{pageCount}} {{pageCount}}&nbsp; &nbsp; 当前第 &nbsp; &nbsp;<el-input-number v-model="currentPage" size="mini" :min="1"></el-input-number>&nbsp; &nbsp;
<!-- <el-button size="mini" type="primary" @click="changePdfPage(0)" class="turn" :disabled=" currentPage==1" >上一页</el-button>
<el-button size="mini" type="primary" @click="changePdfPage(1)" class="turn" :disabled="currentPage==pageCount" >下一页</el-button> -->
当前第 &nbsp; &nbsp;<el-input-number v-model="currentPage" size="mini" :min="1" ></el-input-number >&nbsp; &nbsp;
</div> </div>
<pdf :page="currentPage" :src="url" class="pdf"></pdf> <pdf :page="currentPage" :src="url" class="pdf"></pdf>
</template> </template>
<div class="txt" v-else-if="['txt'].indexOf(fileType)>-1" v-html="txtContent"> <div class="txt" v-else-if="['txt'].indexOf(fileType)>-1" v-html="txtContent">
</div> </div>
<div class="video" v-if="['mp4', 'webm', 'ogg', 'ogv'].indexOf(fileType)>-1&&url">
<video controls style="width: 100%">
<source :src="item" type="video/mp4" />
<source :src="item" type="video/ogg" />
<source :src="item" type="video/webm" />
您的浏览器不支持 video 标签。
</video>
</div>
</div> </div>
</template> </template>
...@@ -130,42 +133,42 @@ export default { ...@@ -130,42 +133,42 @@ export default {
</script> </script>
<style scoped> <style scoped>
.txt{ .txt {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
} }
.pagination{ .pagination {
font-size: 14px; font-size: 14px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
position: absolute; position: fixed;
top: 0px; top: 50px;
right: 10px; right: 20px;
z-index: 10; z-index: 10;
} }
.down{ .down {
width: 100%; width: 100%;
} }
.down a{ .down a {
background-color: #0092FF; text-decoration: none;
color: #FFFFFF; background-color: #0092ff;
color: #ffffff;
display: inline-block; display: inline-block;
line-height: 1; line-height: 1;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
background: #FFFFFF; border: 1px solid #0092ff;
border: 1px solid #0092FF; border-color: #0092ff;
border-color: #0092FF;
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
outline: none; outline: none;
margin: 0; margin: 0;
transition: .1s; transition: 0.1s;
font-weight: 500; font-weight: 500;
padding: 12px 20px; padding: 8px 10px;
font-size: 14px; font-size: 12px;
border-radius: 4px; border-radius: 4px;
z-index: 100; z-index: 100;
} }
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
let tagUrl = aTag.getAttribute('href') let tagUrl = aTag.getAttribute('href')
let url; let url;
// alert(aTag.getAttribute('href')) // alert(aTag.getAttribute('href'))
if (['jpg', 'gif', 'jpeg', 'png', 'docx', 'doc', 'xlsx', 'xls'].indexOf(tagUrl.split('.').pop().toLowerCase()) !== -1) { if (['pdf', 'jpg', 'gif', 'jpeg', 'png', 'docx', 'doc', 'xlsx', 'xls', 'mp4', 'webm', 'ogg', 'ogv'].indexOf(tagUrl.split('.').pop().toLowerCase()) !== -1) {
// 阻止默认点击事件 // 阻止默认点击事件
event.preventDefault(); event.preventDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment