修复预览适配

master
许宏杰 1 year ago
parent 8071a4a86c
commit 75ad4c9709

@ -5,8 +5,8 @@ VUE_APP_TITLE = 扫码连网
ENV = 'development' ENV = 'development'
# 扫码连网/开发环境 # 扫码连网/开发环境
VUE_APP_BASE_API = 'https://192.168.0.105:9038' # VUE_APP_BASE_API = 'https://192.168.0.105:9038'
# VUE_APP_BASE_API = 'https://www.jichuanglanhai.com:9038' VUE_APP_BASE_API = 'https://www.jichuanglanhai.com:9038'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -0,0 +1,31 @@
<template>
<el-dialog
title="预览广告"
:visible.sync="show"
width="500px"
append-to-body
destroy-on-close
>
<video :src="videoPath" class="avatar" controls="controls"></video>
</el-dialog>
</template>
<script>
export default {
data() {
return {
baseUrl: process.env.VUE_APP_BASE_API,
show: false,
videoPath: "",
};
},
methods: {
openDialog(url) {
this.videoPath = this.baseUrl + url;
this.show = true;
},
},
};
</script>
<style></style>

@ -46,6 +46,8 @@ import VueMeta from "vue-meta";
import DictData from "@/components/DictData"; import DictData from "@/components/DictData";
//上传视频 //上传视频
import VideoUpload from "@/components/VideoUpload"; import VideoUpload from "@/components/VideoUpload";
//阅览广告
import VideoView from "@/components/VideoView";
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts; Vue.prototype.getDicts = getDicts;
@ -67,6 +69,7 @@ Vue.component("FileUpload", FileUpload);
Vue.component("ImageUpload", ImageUpload); Vue.component("ImageUpload", ImageUpload);
Vue.component("ImagePreview", ImagePreview); Vue.component("ImagePreview", ImagePreview);
Vue.component("VideoUpload", VideoUpload); Vue.component("VideoUpload", VideoUpload);
Vue.component("VideoView", VideoView);
Vue.use(directive); Vue.use(directive);
Vue.use(plugins); Vue.use(plugins);

@ -105,7 +105,7 @@
<el-table-column label="商户名称" align="center" prop="posName" /> <el-table-column label="商户名称" align="center" prop="posName" />
<el-table-column label="广告名称" align="center" prop="posterName"> <el-table-column label="广告名称" align="center" prop="posterName">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :href="baseUrl + scope.row.videoPath">{{ <el-link type="primary" @click="openVideoView(scope.row.videoPath)">{{
scope.row.posterName scope.row.posterName
}}</el-link> }}</el-link>
</template> </template>
@ -197,6 +197,7 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<VideoView ref="VideoView" />
</div> </div>
</template> </template>
@ -214,7 +215,6 @@ export default {
name: "PosterHistory", name: "PosterHistory",
data() { data() {
return { return {
baseUrl: process.env.VUE_APP_BASE_API,
// //
loading: true, loading: true,
// //
@ -270,6 +270,11 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
openVideoView(url) {
if (url) {
this.$refs.VideoView.openDialog(url);
}
},
/** 查询广告历史列表 */ /** 查询广告历史列表 */
getList() { getList() {
this.loading = true; this.loading = true;

@ -40,9 +40,11 @@
<el-table v-loading="loading" :data="posterList" :height="tableHeigth"> <el-table v-loading="loading" :data="posterList" :height="tableHeigth">
<el-table-column label="广告名称" align="center" prop="posterName"> <el-table-column label="广告名称" align="center" prop="posterName">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :href="baseUrl + scope.row.videoPath">{{ <el-link
scope.row.posterName type="primary"
}}</el-link> @click="openVideoView(scope.row.videoPath)"
>{{ scope.row.posterName }}</el-link
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="有效起始时间" align="center" prop="startTime"> <el-table-column label="有效起始时间" align="center" prop="startTime">
@ -81,6 +83,7 @@
/> />
</div> </div>
</div> </div>
<VideoView ref="VideoView" />
</el-dialog> </el-dialog>
</template> </template>
@ -89,7 +92,6 @@ import { listPoster, batchAllocation } from "@/api/netEwm/poster";
export default { export default {
data() { data() {
return { return {
baseUrl: process.env.VUE_APP_BASE_API,
loading: false, loading: false,
posterList: [], posterList: [],
total: 0, total: 0,
@ -108,6 +110,11 @@ export default {
}; };
}, },
methods: { methods: {
openVideoView(url) {
if (url) {
this.$refs.VideoView.openDialog(url);
}
},
openDialog(data, posterId) { openDialog(data, posterId) {
this.shanghuPosterId = posterId; this.shanghuPosterId = posterId;
this.fpData = data; this.fpData = data;

Loading…
Cancel
Save