jhbigscreen/src/pages/photography.vue

254 lines
9.0 KiB
Vue
Raw Normal View History

2023-10-18 22:44:09 +08:00
<template>
<div class="prj-photography-main">
<div class="screen-content">
<el-row>
<el-col :span="6">
2024-01-10 16:16:09 +08:00
<module-one-3-1 label="项目全景列表">
2023-10-18 22:44:09 +08:00
<div class="left-list scroll">
2024-06-22 00:53:10 +08:00
<template v-if="showPrjs && showPrjs.length>0">
2023-10-22 23:46:07 +08:00
<el-collapse v-model="activeNames" >
2024-06-22 00:53:10 +08:00
<el-collapse-item v-for="(it, idx) in showPrjs" :key="idx" :name="it">
2023-10-18 22:44:09 +08:00
<template slot="title">
<div style="position:relative;padding-left:20px;width: 100%;">
2024-06-22 00:53:10 +08:00
<span>{{ it }}</span>
2023-10-18 22:44:09 +08:00
</div>
</template>
<div class="img-items">
<div v-for="(item, index) in it.images" :key="index" class="img-item">
<el-image :src="item.url + '.min.jpg'" style="width: 90%;"
:preview-src-list="[item.url]" />
<div class="div-date">{{ item.date }}</div>
</div>
</div>
2024-06-22 00:53:10 +08:00
<div v-for="(item,index) in infoList[it]" :key="index" class="video-item" @click.stop="playVideo(item)">
<span class="div-date">{{ item.videoDate }}</span>
<i class="header-icon el-icon-camera-solid"
style="font-size: 24px;color: aqua;"></i>
</div>
2023-10-18 22:44:09 +08:00
</el-collapse-item>
</el-collapse>
2023-10-22 23:46:07 +08:00
</template>
<div v-else style="text-align: center;" class="div-no-data">
<img src="images/nodata.png" style="width: 120px;">
<div style="text-align: center;font-size: 12px;color:#888;">暂无数据</div>
</div>
2023-10-18 22:44:09 +08:00
</div>
</module-one-3-1>
</el-col>
<el-col :span="18" class="no-title">
<module-one-3-3 label="" :notitle="true">
2023-10-22 23:46:07 +08:00
<template v-if="info">
2023-10-18 22:44:09 +08:00
<div class="right-title">
<span class="sp-title">{{info.videoDate }}</span>
</div>
<video controls v-if="info">
<source :src="info.videoUrl" type="video/mp4" />
您的浏览器不支持Video标签
</video>
2023-10-22 23:46:07 +08:00
</template>
<div v-else style="text-align: center;" class="div-no-data">
<img src="images/nodata.png" style="width: 120px;">
<div style="text-align: center;font-size: 12px;color:#888;">暂无数据</div>
</div>
2023-10-18 22:44:09 +08:00
</module-one-3-3>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import '../components/module/module-one-3-1'
import '../components/module/module-one-3-3'
import debounce from 'lodash.debounce'
export default {
name: 'JhbigscreenPhotography',
data() {
return {
prj: {},
prjs: [],
dataList: [],
activeNames: [],
info: null,
2024-06-22 00:53:10 +08:00
dept:null,
showPrjs:[],
infoList:{},
2023-10-18 22:44:09 +08:00
};
},
mounted() {
2024-06-25 00:27:14 +08:00
this.$bus.$on("projectChange", debounce(res => {
2023-10-18 22:44:09 +08:00
this.prj = res;
2024-06-22 00:53:10 +08:00
this.prjs=this.$root.projects||this.prjs;
this.dept=this.$root.dept||this.dept;
this.loadData2();
2023-10-18 22:44:09 +08:00
}));
2024-06-25 00:27:14 +08:00
if (this.$root.hasInitHeader) {
2023-10-18 22:44:09 +08:00
this.initMe();
}
},
methods: {
playVideo(it){
2024-01-18 22:16:39 +08:00
this.info=null;
setTimeout(()=>{
this.info=it;
},400)
2023-10-18 22:44:09 +08:00
},
loadData2() {
2023-10-22 23:46:07 +08:00
this.info=null;
2024-06-25 00:27:14 +08:00
this.prj = this.$root.project;
this.prjs=this.$root.projects||this.prjs;
this.dept=this.$root.dept||this.dept;
2024-06-22 00:53:10 +08:00
this.$api.project.listPhotography(this.prj.id, this.dept.id || 0).then(d => {
let tmps = (d.data || []).map(it => {
2023-10-18 22:44:09 +08:00
it.images = this.$tryToJson(it.imageUrl);
return it;
})
2024-06-22 00:53:10 +08:00
if (tmps.length > 0) {
this.activeNames = [tmps[0].updateBy];
this.info = tmps[0];
2023-10-18 22:44:09 +08:00
}
2024-06-22 00:53:10 +08:00
let obj={};
this.showPrjs=[];
tmps.forEach(it=>{
if(!obj[it.updateBy]){
obj[it.updateBy]=[it]
this.showPrjs.push(it.updateBy);
}else{
obj[it.updateBy].push(it);
}
});
2024-08-06 22:15:04 +08:00
for(let k in obj){
let v=obj[k].sort((a,b)=>b.videoDate.localeCompare(a.videoDate));
obj[k]=v;
}
2024-06-22 00:53:10 +08:00
this.infoList=obj;
2023-10-18 22:44:09 +08:00
})
2024-06-22 00:53:10 +08:00
2023-10-18 22:44:09 +08:00
},
initMe() {
this.prj = this.$root.project || {};
this.prjs = this.$root.projects || [];
this.loadData2();
2023-10-18 22:44:09 +08:00
},
getProjectId(cb) {
let func = () => {
let prjId = this.prj?.id || 0;
if (prjId == 0) {
if (!this.prjs || this.prjs.length == 0) {
setTimeout(func, 100);
} else {
2024-04-06 17:21:58 +08:00
if(this.prjs.length>1){
cb && cb(this.prjs[1].id);
}else{
cb(0);
}
2023-10-18 22:44:09 +08:00
}
} else {
cb && cb(prjId);
}
}
func();
},
},
};
</script>
<style lang="less" scoped>
.prj-photography-main {
2023-10-22 23:46:07 +08:00
.div-no-data{
text-align: center;
height: 600px;
display: flex;
align-items: center;
justify-content: center;
}
2023-10-18 22:44:09 +08:00
.no-title {
/deep/ .screen-one-3-3 {
background-image: none;
border: solid 1px #409eff5c;
.module-title{
display: none;
}
.right-title{
height: 200px;
display: flex;
align-items: center;
justify-content: center
}
.sp-title{
display: inline-block;
line-height: 72px;
padding: 0px 40px;
font-size: 40px;
background-size: 100% 100%;
background-image: url('../assets/images/bgphoto.png');
}
video{
width: 100%;
height: calc(100% - 201px);
}
}
}
.left-list{
max-height: calc(100% - 40px);
overflow-y: auto;
&::-webkit-scrollbar {
width: 4px;
height: 4px;
}
}
/deep/ .screen-one-3-1 {
.el-collapse {
border: none;
margin-top: 4px;
.el-collapse-item {}
.el-collapse-item__header {
background-color: #097fca2e;
color: #089fff;
2024-06-22 00:53:10 +08:00
border-bottom: dotted 1px #089fff77;
2023-10-18 22:44:09 +08:00
}
.el-collapse-item__content {
padding-bottom: 12px;
}
.el-collapse-item__wrap {
background-color: transparent;
border: none;
.img-item {
margin-top: 8px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
color: #fff;
position: relative;
2024-06-22 00:53:10 +08:00
2023-10-18 22:44:09 +08:00
}
2024-06-22 00:53:10 +08:00
.video-item{
position: relative;
line-height: 30px;
display: flex;
align-items: center;
cursor: pointer;
border-bottom: solid 1px #089fff77;
.div-date {
width: calc(90% - 24px);
text-align: left;
bottom: 0px;
color:#089fff;
padding-left: 24px;
}
}
2023-10-18 22:44:09 +08:00
}
}
}
}</style>