You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
duoji-frontend/src/views/historyMonitoring/index.vue

153 lines
4.2 KiB
Vue

6 years ago
<template>
<div class="history bg-white">
<a-input-search
class="mb24"
style="width: 40%;"
placeholder="请输入工单号搜索"
v-model="search"
enter-button="搜索"
@search="handleSearch"
></a-input-search>'
6 years ago
<a-table :rowKey="record => record.id" :columns="columns" :dataSource="dataSource">
5 years ago
<div slot="mediaPath" slot-scope="text, record">
<a :href="record.mediaPath" target="_blank">
<img
v-if="imglist.some(item => record.mediaType.toLowerCase() === item)"
:src="record.mediaPath"
alt="内容图片"
style="width: 140px; cursor:pointer;"
/>
<span v-else style="color: #40a9ff; cursor:pointer;">{{ record.mediaPath }}</span>
</a>
6 years ago
</div>
</a-table>
<a-drawer placement="bottom" :visible="drawer" @close="onClose">
<img
v-if="showDrawer.type === 'image'"
:src="showDrawer.url"
alt="内容图片"
style="height: 500px"
/>
5 years ago
<!-- <video-player
v-else
class="flex"
style="height: 500px;"
ref="videoPlayer"
:options="playerOptions"
></video-player>-->
6 years ago
</a-drawer>
</div>
6 years ago
</template>
6 years ago
<script>
5 years ago
// require styles
// import "video.js/dist/video-js.css";
5 years ago
// import { videoPlayer } from "vue-video-player";
6 years ago
export default {
name: "historyMonitoring",
5 years ago
components: {
// videoPlayer
},
data() {
return {
5 years ago
playerOptions: {
autoplay: true,
muted: true,
language: "zh-CN",
height: 500,
sources: [
{
src: ""
}
]
},
search: "",
columns: [
{
6 years ago
title: "工单号",
5 years ago
dataIndex: "orderNum",
width: 90
},
{
6 years ago
title: "仓位号",
5 years ago
dataIndex: "positionNum",
width: 170
},
{
6 years ago
title: "创建时间",
5 years ago
dataIndex: "createTime",
width: 200
},
{
6 years ago
title: "内容",
5 years ago
dataIndex: "mediaPath",
6 years ago
scopedSlots: {
5 years ago
customRender: "mediaPath"
5 years ago
},
width: 300
}
],
6 years ago
dataSource: [],
imglist: ["png", "jpg", "jpeg", "bmp", "gif"],
videolist: [
"mp4",
"m2v",
"mkv",
"rmvb",
"wmv",
"avi",
"flv",
"mov",
"m4v"
],
drawer: false,
showDrawer: {}
};
},
methods: {
6 years ago
handleSearch() {
console.log(this.$api)
6 years ago
this.query();
},
query() {
this.$api.httpApi
6 years ago
.queryList({
data: {
orderNum: this.search
}
})
.then(res => {
5 years ago
// res.data[1].mediaPath =
// "http://gitlab.zhehekeji.com/security_check/security_front/raw/1.0.0/src/assets/video/video2.mp4";
6 years ago
this.dataSource = res.data;
}).catch(err => {
6 years ago
});
},
handlePopup(type, url) {
this.drawer = true;
this.showDrawer.type = type;
5 years ago
this.playerOptions.sources[0].src = url;
6 years ago
},
onClose() {
this.drawer = false;
}
},
mounted() {}
6 years ago
};
</script>
5 years ago
<style lang="scss">
.history {
padding: 24px;
}
6 years ago
.ant-drawer-content-wrapper {
height: auto !important;
}
.ant-drawer-body {
text-align: center;
}
5 years ago
</style>