|
@@ -14,7 +14,11 @@
|
|
|
</a>
|
|
|
<a v-if="selectableType.includes('audio')" class="material-tab-item" @click.prevent="currentMaterialType = 'audio'">
|
|
|
<span class="text">音频</span>
|
|
|
- <div v-if="currentMaterialType === 'pano'" class="bottom-line"></div>
|
|
|
+ <div v-if="currentMaterialType === 'audio'" class="bottom-line"></div>
|
|
|
+ </a>
|
|
|
+ <a v-if="selectableType.includes('video')" class="material-tab-item" @click.prevent="currentMaterialType = 'video'">
|
|
|
+ <span class="text">视频</span>
|
|
|
+ <div v-if="currentMaterialType === 'video'" class="bottom-line"></div>
|
|
|
</a>
|
|
|
<a v-if="selectableType.includes('3D')" class="material-tab-item" @click.prevent="currentMaterialType = '3D'">
|
|
|
<span class="text">三维场景</span>
|
|
@@ -170,6 +174,53 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <div class="table table-video" v-show="currentMaterialType === 'video'">
|
|
|
+ <div class="table-head-row">
|
|
|
+ <span class="table-head">1</span>
|
|
|
+ <span class="table-head" v-for="(item,i) in tableHeadersForVideo" :key="i">{{item.name}}</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="videoList.length !== 0 || hasMoreVideoData"
|
|
|
+ class="table-body"
|
|
|
+ v-infinite-scroll="requestMoreVideoData"
|
|
|
+ :infinite-scroll-disabled="!hasMoreVideoData || isRequestingMoreVideoData"
|
|
|
+ >
|
|
|
+ <div class="table-body-row" v-for="(item,i) in videoList" :key="i">
|
|
|
+ <span class="table-data">
|
|
|
+ <div class="checkbox">
|
|
|
+ <!-- 负责功能 -->
|
|
|
+ <input
|
|
|
+ type="checkbox"
|
|
|
+ @change="e => selectItem(item, e)"
|
|
|
+ :checked="select.some(i => i[primaryKey] === item[primaryKey])"
|
|
|
+ >
|
|
|
+ <!-- 负责外观 -->
|
|
|
+ <span class="for-outer-circle"></span>
|
|
|
+ <span class="for-inner-circle"></span>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span class="table-data" v-for="(sub,idx) in tableHeadersForVideo" :key="idx">
|
|
|
+ <div v-if="sub.type=='image'" class="list-img">
|
|
|
+ <img :src="item[sub.key]" alt="">
|
|
|
+ </div>
|
|
|
+ <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 无数据时的提示 -->
|
|
|
+ <div v-if="videoList.length === 0 && !hasMoreVideoData" class="no-data">
|
|
|
+ <div v-if="latestUsedSearchKey">
|
|
|
+ <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
|
|
|
+ <span>{{'未搜索到结果~'}}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="!latestUsedSearchKey">
|
|
|
+ <img :src="require('@/assets/images/default/empty_04.png')" alt="">
|
|
|
+ <span>{{'暂无素材~'}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="table table-3D" v-show="currentMaterialType === '3D'">
|
|
|
<div class="table-head-row">
|
|
|
<span class="table-head">1</span>
|
|
@@ -258,6 +309,7 @@ export default {
|
|
|
'image',
|
|
|
'pano',
|
|
|
'audio',
|
|
|
+ 'video',
|
|
|
'3D',
|
|
|
]
|
|
|
},
|
|
@@ -288,6 +340,8 @@ export default {
|
|
|
this.refreshMaterialList('pano')
|
|
|
} else if (newVal === 'audio' && this.audioList.length === 0) {
|
|
|
this.refreshMaterialList('audio')
|
|
|
+ } else if (newVal === 'video' && this.videoList.length === 0) {
|
|
|
+ this.refreshMaterialList('video')
|
|
|
} else if (newVal === '3D' && this.scene3DList.length === 0) {
|
|
|
this.refreshMaterialList('3D')
|
|
|
}
|
|
@@ -311,6 +365,11 @@ export default {
|
|
|
return ['ossPath', 'name', 'fileSize'].includes(item.key)
|
|
|
})
|
|
|
},
|
|
|
+ tableHeadersForVideo() {
|
|
|
+ return this.$MAPTABLEHEADER['video'].filter(item => {
|
|
|
+ return ['icon', 'name', 'fileSize'].includes(item.key)
|
|
|
+ })
|
|
|
+ },
|
|
|
tableHeadersFor3D() {
|
|
|
return this.$MAPTABLEHEADER['scene'].filter(item => {
|
|
|
return ['thumb', 'sceneName', 'createTime'].includes(item.key)
|
|
@@ -322,6 +381,7 @@ export default {
|
|
|
imageList: [],
|
|
|
panoList: [],
|
|
|
audioList: [],
|
|
|
+ videoList: [],
|
|
|
scene3DList: [],
|
|
|
|
|
|
select: [],
|
|
@@ -333,10 +393,12 @@ export default {
|
|
|
isRequestingMoreImageData: false,
|
|
|
isRequestingMorePanoData: false,
|
|
|
isRequestingMoreAudioData: false,
|
|
|
+ isRequestingMoreVideoData: false,
|
|
|
isRequestingMore3DData: false,
|
|
|
hasMoreImageData: true,
|
|
|
hasMorePanoData: true,
|
|
|
hasMoreAudioData: true,
|
|
|
+ hasMoreVideoData: true,
|
|
|
hasMore3DData: true,
|
|
|
}
|
|
|
},
|
|
@@ -457,6 +519,37 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+ requestMoreVideoData() {
|
|
|
+ this.isRequestingMoreVideoData = true
|
|
|
+ const latestUsedSearchKey = this.searchKey
|
|
|
+ getMaterialList(
|
|
|
+ {
|
|
|
+ pageNum: Math.floor(this.videoList.length / config.PAGE_SIZE) + 1,
|
|
|
+ pageSize: config.PAGE_SIZE,
|
|
|
+ searchKey: this.searchKey,
|
|
|
+ type: 'video',
|
|
|
+ },
|
|
|
+ (data) => {
|
|
|
+ const newData = data.data.list.map((i) => {
|
|
|
+ i.fileSize = changeByteUnit(Number(i.fileSize));
|
|
|
+ i.icon = i.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
|
|
|
+ i.createTime = i.createTime.substring(0, i.createTime.length - 3)
|
|
|
+ i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
|
|
|
+ return i;
|
|
|
+ });
|
|
|
+ this.videoList = this.videoList.concat(newData)
|
|
|
+ if (this.videoList.length === data.data.total) {
|
|
|
+ this.hasMoreVideoData = false
|
|
|
+ }
|
|
|
+ this.isRequestingMoreVideoData = false
|
|
|
+ this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
+ },
|
|
|
+ () => {
|
|
|
+ this.isRequestingMoreVideoData = false
|
|
|
+ this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
requestMore3DData() {
|
|
|
this.isRequestingMore3DData = true
|
|
|
const latestUsedSearchKey = this.searchKey
|
|
@@ -748,6 +841,24 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.table-video .table-head,
|
|
|
+.table-video .table-data {
|
|
|
+ &:nth-of-type(1) {
|
|
|
+ width: 50px;
|
|
|
+ color: transparent;
|
|
|
+ }
|
|
|
+ &:nth-of-type(2) {
|
|
|
+ width: calc(116px - 50px);
|
|
|
+ }
|
|
|
+ &:nth-of-type(3) {
|
|
|
+ width: calc(416px - 116px);
|
|
|
+ padding-right: 30px;
|
|
|
+ }
|
|
|
+ &:nth-of-type(4) {
|
|
|
+ width: calc(100% - 416px);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.table-3D .table-head,
|
|
|
.table-3D .table-data {
|
|
|
&:nth-of-type(1) {
|