1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693 |
- <template>
- <div class="table-select">
- <span class="title">{{title}}</span>
- <div class="close-btn"><i class="iconfont icon-pop-ups_shut-down" @click="$emit('cancle')"></i></div>
- <div class="material-tab">
- <a v-if="selectableType.includes('image')" class="material-tab-item" @click.prevent="currentMaterialType = 'image'">
- <span class="text">图片</span>
- <div v-if="currentMaterialType === 'image'" class="bottom-line"></div>
- </a>
- <a v-if="selectableType.includes('pano')" class="material-tab-item" @click.prevent="currentMaterialType = 'pano'">
- <span class="text">全景图</span>
- <div v-if="currentMaterialType === 'pano'" class="bottom-line"></div>
- </a>
- <a v-if="selectableType.includes('audio')" class="material-tab-item" @click.prevent="currentMaterialType = 'audio'">
- <span class="text">音频</span>
- <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>
- <div v-if="currentMaterialType === '3D'" class="bottom-line"></div>
- </a>
- </div>
-
- <div class="filter">
- <input type="text" placeholder="输入关键词" v-model="searchKey"/>
- <i v-if="!searchKey" class="iconfont icon-editor_search search-icon"/>
- <i v-if="searchKey" @click="searchKey=''" class="iconfont icontoast_red clear-icon"></i>
- </div>
- <div class="table table-image" v-show="currentMaterialType === 'image'">
- <div class="table-head-row">
- <span class="table-head">1</span>
- <span class="table-head" v-for="(item,i) in tableHeadersForImage" :key="i">{{item.name}}</span>
- </div>
- <div
- v-if="imageListRealLength !== 0 || hasMoreImageData"
- class="table-body"
- v-infinite-scroll="requestMoreImageData"
- :infinite-scroll-disabled="!hasMoreImageData || isRequestingMoreImageData"
- >
- <!-- vuex中的上传中数据 -->
- <div class="table-body-row" v-for="(item, i) in uploadStatusListImage" :key="item.uid">
- <!-- 如果已经上传成功 -->
- <template v-if="item.status === 'SUCCESS'">
- <span class="table-data">
- <div class="checkbox">
- <!-- 负责功能 -->
- <input
- type="checkbox"
- @change="e => selectItem(item.successInfo, e)"
- :checked="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
- >
- <!-- 负责外观 -->
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
- <div v-if="tableItemStructure.type=='image'" class="list-img">
- <img :src="item.successInfo[tableItemStructure.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" alt="">
- </div>
- <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
- </span>
- </template>
- <!-- 如果还在上传中 -->
- <template v-else-if="item.status = 'LOADING'">
- <span class="table-data">
- <div class="checkbox">
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle disabled"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
- <div v-if="tableItemStructure.type=='image'" class="list-img">
- <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
- </div>
- <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'dpi'"></span>
- <span v-if="tableItemStructure.key === 'dpi'">上传素材 {{item.progress * 100}}%</span>
- <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
- </span>
- </template>
- <!-- 如果上传失败了 -->
- <template v-else-if="item.status = 'FAIL'">
- <span class="table-data">
- <div class="checkbox">
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle disabled"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
- <div v-if="tableItemStructure.type=='image'" class="list-img">
- <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
- </div>
- <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'dpi'"></span>
- <span v-if="tableItemStructure.key === 'dpi'">上传失败</span>
- <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
- </span>
- </template>
- </div>
- <!-- 本组件内的列表数据 -->
- <div class="table-body-row" v-for="(item,i) in imageList" :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 tableHeadersForImage" :key="idx">
- <div v-if="sub.type=='image'" class="list-img">
- <img :src="item[sub.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" alt="">
- </div>
- <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{ item[sub.key] }}</span>
- </span>
- </div>
- </div>
- <!-- 无数据时的提示 -->
- <div v-else 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-pano" v-show="currentMaterialType === 'pano'">
- <div class="table-head-row">
- <span class="table-head">1</span>
- <span class="table-head" v-for="(item,i) in tableHeadersForPano" :key="i">{{item.name}}</span>
- </div>
- <div
- v-if="panoList.length !== 0 || hasMorePanoData"
- class="table-body"
- v-infinite-scroll="requestMorePanoData"
- :infinite-scroll-disabled="!hasMorePanoData || isRequestingMorePanoData"
- >
- <div class="table-body-row" v-for="(item,i) in panoList" :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 tableHeadersForPano" :key="idx">
- <div v-if="sub.type=='image'" class="list-img">
- <img :src="item[sub.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" 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="panoList.length === 0 && !hasMorePanoData" 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-audio" v-show="currentMaterialType === 'audio'">
- <div class="table-head-row">
- <span class="table-head">1</span>
- <span class="table-head" v-for="(item,i) in tableHeadersForAudio" :key="i">{{item.name}}</span>
- </div>
- <div
- v-if="audioListRealLength !== 0 || hasMoreAudioData"
- class="table-body"
- v-infinite-scroll="requestMoreAudioData"
- :infinite-scroll-disabled="!hasMoreAudioData || isRequestingMoreAudioData"
- >
- <!-- vuex中的上传中数据 -->
- <div class="table-body-row" v-for="(item, i) in uploadStatusListAudio" :key="item.uid">
- <!-- 如果已经上传成功 -->
- <template v-if="item.status === 'SUCCESS'">
- <span class="table-data">
- <div class="checkbox">
- <!-- 负责功能 -->
- <input
- type="checkbox"
- @change="e => selectItem(item.successInfo, e)"
- :checked="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
- >
- <!-- 负责外观 -->
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForAudio" :key="idx">
- <div v-if="tableItemStructure.type=='audio'" class="list-img">
- <!-- <img
- :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
- style="object-fit: contain;"
- alt=""
- > -->
- <AudioIconCanPlay
- class="icon"
- :vKey="item.successInfo.id"
- :idleft="`_${$randomWord(true, 8, 8)}`"
- :idright="`_${$randomWord(true, 8, 8)}`"
- :myAudioUrl="item.successInfo.ossPath"
- ></AudioIconCanPlay>
- </div>
- <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
- </span>
- </template>
- <!-- 如果还在上传中 -->
- <template v-else-if="item.status = 'LOADING'">
- <span class="table-data">
- <div class="checkbox">
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle disabled"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForAudio" :key="idx">
- <div v-if="tableItemStructure.type=='audio'" class="list-img">
- <img
- :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
- style="object-fit: contain;"
- alt=""
- >
- </div>
- <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
- <span v-if="tableItemStructure.key === 'fileSize'">上传素材 {{item.progress * 100}}%</span>
- <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
- </span>
- </template>
- <!-- 如果上传失败了 -->
- <template v-else-if="item.status = 'FAIL'">
- <span class="table-data">
- <div class="checkbox">
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle disabled"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
- <div v-if="tableItemStructure.type=='audio'" class="list-img">
- <img
- :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
- style="object-fit: contain;"
- alt=""
- >
- </div>
- <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
- <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
- <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
- </span>
- </template>
- </div>
- <!-- 本组件内的列表数据 -->
- <div class="table-body-row" v-for="(item,i) in audioList" :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 tableHeadersForAudio" :key="idx">
- <div v-if="sub.type=='audio'" class="list-img">
- <!-- <img
- :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
- style="object-fit: contain;"
- alt=""
- > -->
- <AudioIconCanPlay
- class="audio-player"
- :vKey="item.id"
- :idleft="`_${$randomWord(true, 8, 8)}`"
- :idright="`_${$randomWord(true, 8, 8)}`"
- :myAudioUrl="item.ossPath"
- ></AudioIconCanPlay>
- </div>
- <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
- </span>
- </div>
- </div>
- <!-- 无数据时的提示 -->
- <div v-if="audioList.length === 0 && !hasMoreAudioData" 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-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="videoListRealLength !== 0 || hasMoreVideoData"
- class="table-body"
- v-infinite-scroll="requestMoreVideoData"
- :infinite-scroll-disabled="!hasMoreVideoData || isRequestingMoreVideoData"
- >
- <!-- vuex中的上传中数据 -->
- <div class="table-body-row" v-for="(item, i) in uploadStatusListVideo" :key="item.uid">
- <!-- 如果已经上传成功 -->
- <template v-if="item.status === 'SUCCESS'">
- <span class="table-data">
- <div class="checkbox">
- <!-- 负责功能 -->
- <input
- type="checkbox"
- @change="e => selectItem(item.successInfo, e)"
- :checked="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
- >
- <!-- 负责外观 -->
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForVideo" :key="idx">
- <div v-if="tableItemStructure.type=='image'" class="list-img">
- <img
- :src="item.successInfo[tableItemStructure.key]"
- alt=""
- >
- </div>
- <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
- </span>
- </template>
- <!-- 如果还在上传中 -->
- <template v-else-if="item.status = 'LOADING'">
- <span class="table-data">
- <div class="checkbox">
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle disabled"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForVideo" :key="idx">
- <div v-if="tableItemStructure.type=='image'" class="list-img">
- <img
- :src="require('@/assets/images/icons/upload-file-type-icon-video@2x.png')"
- style="object-fit: contain;"
- alt=""
- >
- </div>
- <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
- <span v-if="tableItemStructure.key === 'fileSize'">上传素材 {{item.progress * 100}}%</span>
- <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
- </span>
- </template>
- <!-- 如果上传失败了 -->
- <template v-else-if="item.status = 'FAIL'">
- <span class="table-data">
- <div class="checkbox">
- <span class="for-outer-circle"></span>
- <span class="for-inner-circle disabled"></span>
- </div>
- </span>
- <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
- <div v-if="tableItemStructure.type=='image'" class="list-img">
- <img
- :src="require('@/assets/images/icons/upload-file-type-icon-video@2x.png')"
- style="object-fit: contain;"
- alt=""
- >
- </div>
- <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
- <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
- <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
- </span>
- </template>
- </div>
- <!-- 本组件内的列表数据 -->
- <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>
- <span class="table-head" v-for="(item,i) in tableHeadersFor3D" :key="i">{{item.name}}</span>
- </div>
- <div
- v-if="scene3DList.length !== 0 || hasMore3DData"
- class="table-body"
- v-infinite-scroll="requestMorePanoData"
- :infinite-scroll-disabled="!hasMore3DData || isRequestingMore3DData"
- >
- <div class="table-body-row" v-for="(item,i) in scene3DList" :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 tableHeadersFor3D" :key="idx">
- <div v-if="sub.type=='image'" class="list-img">
- <img :src="item[sub.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" 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="scene3DList.length === 0 && !hasMore3DData" 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>
- <a href="/#/">
- <button class="ui-button">如何拍摄三维场景</button>
- </a>
- </div>
- </div>
- </div>
- <div class="btns">
- <button v-if="currentMaterialType !== '3D'" class="ui-button upload-btn" @click="$refs['file-input'].click()">
- <span>上传素材</span>
- <i class="iconfont icon-material_prompt tool-tip-for-editor"
- v-tooltip="
- currentMaterialType === 'image' ? '请上传10MB以内、jpg/png格式的图片' :
- currentMaterialType === 'pano' ? '请上传2:1、120MB以内、jpg格式的图片' : ''
- ">
- </i>
- <FileInput
- ref="file-input"
- :failString="fileInputFailString"
- :limitFailStr="fileInputLimitFailStr"
- :acceptType="fileInputAcceptType"
- :mediaType="currentMaterialType"
- :limit="fileInputLimit"
- @file-change="onFileInputChange"
- ></FileInput>
- </button>
- <div v-else class="button-placeholder"></div>
- <div>
- <button class="ui-button deepcancel" @click="$emit('cancle')">取消</button>
- <button class="ui-button submit" :class="{disable: !select.length}" @click="$emit('submit', select)">
- 确定
- </button>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- getMaterialList,
- getSceneList,
- uploadMaterial,
- editMaterial,
- delMaterial,
- } from "@/api";
- import { changeByteUnit } from '@/utils/file'
- import config from "@/config";
- import { debounce } from "@/utils/other.js"
- import FileInput from "@/components/shared/uploads/UploadMultiple.vue";
- import { mapState } from "vuex";
- import AudioIconCanPlay from "@/components/audio/indexForEditor.vue";
- export default {
- props:{
- title:{
- default:'',
- type:String
- },
- primaryKey: {
- default:'id'
- },
- selectableType: {
- type: Array,
- default: function() {
- return [
- 'image',
- 'pano',
- 'audio',
- 'video',
- '3D',
- ]
- },
- },
- initialMaterialType: {
- type: String,
- default: 'image',
- },
- isMultiSelection: {
- type: Boolean,
- default: false,
- }
- },
- components:{
- FileInput,
- AudioIconCanPlay,
- },
- watch:{
- searchKey: {
- handler: function () {
- this.refreshMaterialList(this.currentMaterialType)
- },
- immediate: false,
- },
- currentMaterialType: {
- handler: function (newVal) {
- if (newVal === 'image' && this.imageList.length === 0) {
- this.refreshMaterialList('image')
- } else if (newVal === 'pano' && this.panoList.length === 0) {
- 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')
- }
- },
- immediate: false,
- }
- },
- computed:{
- ...mapState({
- uploadStatusListAudio: 'uploadStatusListAudio',
- uploadStatusListImage: 'uploadStatusListImage',
- uploadStatusListPano: 'uploadStatusListPano',
- uploadStatusListVideo: 'uploadStatusListVideo',
- }),
- tableHeadersForImage() {
- return this.$MAPTABLEHEADER['image'].filter(item => {
- return ['icon', 'name', 'fileSize', 'dpi'].includes(item.key)
- })
- },
- tableHeadersForPano() {
- return this.$MAPTABLEHEADER['pano'].filter(item => {
- return ['icon', 'name', 'fileSize'].includes(item.key)
- })
- },
- tableHeadersForAudio() {
- return this.$MAPTABLEHEADER['audio'].filter(item => {
- 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)
- })
- },
- fileInputFailString() {
- let ret = ''
- switch (this.currentMaterialType) {
- case 'pano':
- ret = '格式错误,请上传2:1、120MB以内、jpg格式的全景图片'
- break;
- case 'image':
- ret = '格式错误,请上传10MB以内、jpg/png格式的图片'
- break;
- case 'audio':
- ret = '格式错误,请上传20MB以内、mp3格式的音频'
- break;
- case 'video':
- ret = '格式错误,请上传200MB以内、mp4格式的视频'
- break;
- default:
- break;
- }
- return ret
- },
- fileInputLimitFailStr() {
- let ret = ''
- switch (this.currentMaterialType) {
- case 'pano':
- ret = '过大,请上传2:1、120MB以内、jpg格式的全景图片'
- break;
- case 'image':
- ret = '过大,请上传10MB以内、jpg/png格式的图片'
- break;
- case 'audio':
- ret = '过大,请上传20MB以内、mp3格式的音频'
- break;
- case 'video':
- ret = '过大,请上传200MB以内、mp4格式的视频'
- break;
- default:
- break;
- }
- return ret
- },
- fileInputAcceptType() {
- let ret = ''
- switch (this.currentMaterialType) {
- case 'pano':
- ret = 'image/jpeg'
- break;
- case 'image':
- ret = 'image/png,image/jpeg'
- break;
- case 'audio':
- ret = 'audio/mp3'
- break;
- case 'video':
- ret = 'video/mp4'
- break;
- default:
- break;
- }
- return ret
- },
- fileInputmediaType() {
- let ret = ''
- switch (this.currentMaterialType) {
- case 'pano':
- ret = 'image'
- break;
- case 'image':
- ret = 'image'
- break;
- case 'audio':
- ret = 'audio'
- break;
- case 'video':
- ret = 'video'
- break;
- default:
- break;
- }
- return ret
- },
- fileInputLimit() {
- let ret
- switch (this.currentMaterialType) {
- case 'pano':
- ret = 120
- break;
- case 'image':
- ret = 10
- break;
- case 'audio':
- ret = 20
- break;
- case 'video':
- ret = 200
- break;
- default:
- break;
- }
- return ret
- },
- imageListRealLength() {
- return this.imageList.length + this.uploadStatusListImage.filter((item) => {
- return item.status === 'SUCCESS'
- }).length
- },
- audioListRealLength() {
- return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
- return item.status === 'SUCCESS'
- }).length
- },
- videoListRealLength() {
- return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
- return item.status === 'SUCCESS'
- }).length
- },
- },
- data () {
- return {
- imageList: [],
- panoList: [],
- audioList: [],
- videoList: [],
- scene3DList: [],
-
- select: [],
- searchKey:'', // 搜索关键词
- latestUsedSearchKey: '',
- currentMaterialType: this.initialMaterialType,
-
- isRequestingMoreImageData: false,
- isRequestingMorePanoData: false,
- isRequestingMoreAudioData: false,
- isRequestingMoreVideoData: false,
- isRequestingMore3DData: false,
- hasMoreImageData: true,
- hasMorePanoData: true,
- hasMoreAudioData: true,
- hasMoreVideoData: true,
- hasMore3DData: true,
- }
- },
- methods: {
- selectItem(item, e) {
- item.materialType = this.currentMaterialType // 三维场景数据没有type字段来表明自己是三维场景。所以统一加一个字段。
- if (false) {
- // 对于图片,大于600kb的,压缩?
- } else {
- if (this.isMultiSelection) {
- if (e.target.checked) {
- this.select.push(item)
- } else {
- const toDeleteIdx = this.select.findIndex((eachSelect) => {
- return eachSelect.id === item.id
- })
- if (toDeleteIdx >= 0) {
- this.select.splice(toDeleteIdx, 1)
- }
- }
- } else {
- if (e.target.checked) {
- this.select = [item]
- } else {
- this.select = []
- }
- }
- }
- },
- requestMoreImageData() {
- this.isRequestingMoreImageData = true
- const latestUsedSearchKey = this.searchKey
- getMaterialList(
- {
- pageNum: Math.floor(this.imageListRealLength / config.PAGE_SIZE) + 1,
- pageSize: config.PAGE_SIZE,
- searchKey: this.searchKey,
- type: 'image',
- },
- (data) => {
- const newData = data.data.list.map((i) => {
- i.fileSize = changeByteUnit(Number(i.fileSize));
- i.createTime = i.createTime.substring(0, i.createTime.length - 3)
- i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
- return i;
- });
- this.imageList = this.imageList.concat(newData)
- if (this.imageListRealLength === data.data.total) {
- this.hasMoreImageData = false
- }
- this.isRequestingMoreImageData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- },
- () => {
- this.isRequestingMoreImageData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- }
- );
- },
- requestMorePanoData() {
- this.isRequestingMorePanoData = true
- const latestUsedSearchKey = this.searchKey
- getMaterialList(
- {
- pageNum: Math.floor(this.panoList.length / config.PAGE_SIZE) + 1,
- pageSize: config.PAGE_SIZE,
- searchKey: this.searchKey,
- type: 'pano',
- },
- (data) => {
- const newData = data.data.list.map((i) => {
- i.fileSize = changeByteUnit(Number(i.fileSize));
- i.createTime = i.createTime.substring(0, i.createTime.length - 3)
- i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
- return i;
- });
- this.panoList = this.panoList.concat(newData)
- if (this.panoList.length === data.data.total) {
- this.hasMorePanoData = false
- }
- this.isRequestingMorePanoData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- },
- () => {
- this.isRequestingMorePanoData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- }
- );
- },
- requestMoreAudioData() {
- this.isRequestingMoreAudioData = true
- const latestUsedSearchKey = this.searchKey
- getMaterialList(
- {
- pageNum: Math.floor(this.audioListRealLength / config.PAGE_SIZE) + 1,
- pageSize: config.PAGE_SIZE,
- searchKey: this.searchKey,
- type: 'audio',
- },
- (data) => {
- const newData = data.data.list.map((i) => {
- i.fileSize = changeByteUnit(Number(i.fileSize));
- i.createTime = i.createTime.substring(0, i.createTime.length - 3)
- i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
- return i;
- });
- this.audioList = this.audioList.concat(newData)
- if (this.audioListRealLength === data.data.total) {
- this.hasMoreAudioData = false
- }
- this.isRequestingMoreAudioData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- },
- () => {
- this.isRequestingMoreAudioData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- }
- );
- },
- requestMoreVideoData() {
- this.isRequestingMoreVideoData = true
- const latestUsedSearchKey = this.searchKey
- getMaterialList(
- {
- pageNum: Math.floor(this.videoListReallength / 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.videoListReallength === 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
- getSceneList(
- {
- pageNum: Math.floor(this.scene3DList.length / config.PAGE_SIZE) + 1,
- pageSize: config.PAGE_SIZE,
- searchKey: this.searchKey,
- },
- (data) => {
- const newData = data.data.data.list.map((i) => {
- return i;
- });
- this.scene3DList = this.scene3DList.concat(newData)
- if (this.scene3DList.length === data.data.data.total) {
- this.hasMore3DData = false
- }
- this.isRequestingMore3DData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- },
- () => {
- this.isRequestingMore3DData = false
- this.latestUsedSearchKey = latestUsedSearchKey
- }
- )
- },
- refreshMaterialList: debounce(function(type) {
- if (type === 'image') {
- this.isRequestingMoreImageData = false
- this.hasMoreImageData = true
- this.imageList = []
- let filterResult = this.uploadStatusListImage.filter((item) => {
- return item.status === 'LOADING'
- })
- this.$store.commit('setUploadStatusListImage', filterResult)
- this.requestMoreImageData()
- } else if (type === 'pano') {
- this.isRequestingMorePanoData = false
- this.hasMorePanoData = true
- this.panoList = []
- this.requestMorePanoData()
- } else if (type === 'audio') {
- this.isRequestingMoreAudioData = false
- this.hasMoreAudioData = true
- this.audioList = []
- let filterResult = this.uploadStatusListAudio.filter((item) => {
- return item.status === 'LOADING'
- })
- this.$store.commit('setUploadStatusListAudio', filterResult)
- this.requestMoreAudioData()
- } else if (type === 'video') {
- this.isRequestingMoreVideoData = false
- this.hasMoreVideoData = true
- this.videoList = []
- let filterResult = this.uploadStatusListVideo.filter((item) => {
- return item.status === 'LOADING'
- })
- this.$store.commit('setUploadStatusListVideo', filterResult)
- this.requestMoreVideoData()
- } else if (type === '3D') {
- this.isRequestingMore3DData = false
- this.hasMore3DData = true
- this.scene3DList = []
- this.requestMore3DData()
- }
- }, 700, false),
- onFileInputChange(e) {
- switch (this.currentMaterialType) {
- case 'pano':
- this.onPanoFileInputChange(e)
- break;
- case 'image':
- this.onImageFileInputChange(e)
- break;
- case 'audio':
- this.onAudioFileInputChange(e)
- break;
- case 'video':
- this.onVideoFileInputChange(e)
- break;
- default:
- break;
- }
- },
- onPanoFileInputChange(e) {
- e.files.forEach(async (eachFile, i) => {
- if (
- eachFile.type.indexOf("jpeg") <= -1
- ) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”名称过长,请上传标题在50字以内的全景图片`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- let WHRate = null
- try {
- const {width, height} = await getImgWH(eachFile)
- WHRate = width / height
- } catch(e) {
- console.error('获取图像宽高失败:', e)
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
- type: "warning",
- });
- }, i * 100);
- return
- }
- if (WHRate !== 2) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
- type: "warning",
- });
- }, i * 100);
- return
- }
- let itemInUploadList = {
- title: eachFile.name,
- ifKnowProgress: true,
- progress: 0,
- status: 'LOADING',
- statusText: "正在上传素材",
- uid: `u_${this.$randomWord(true, 8, 8)}`,
- abortHandler: null,
- backendId: '',
- };
- itemInUploadList.abortHandler = uploadMaterial(
- {
- file: eachFile
- },
- {
- type: TYPE,
- uid: itemInUploadList.uid,
- },
- (response) => { // 上传成功
- itemInUploadList.statusText = '正在切图处理'
- itemInUploadList.ifKnowProgress = false
- itemInUploadList.backendId = response.data.id
- },
- (err) => {
- if (err.statusText === 'abort') { // 用户取消了上传任务。
- const index = this.uploadListForUI.findIndex((eachItem) => {
- return eachItem.uid === itemInUploadList.uid
- })
- this.uploadListForUI.splice(index, 1)
- } else {
- itemInUploadList.status = 'FAIL'
- itemInUploadList.statusText = '素材上传失败'
- }
- },
- (progress) => {
- itemInUploadList.progress = progress
- }
- )
- this.uploadListForUI.push(itemInUploadList);
- })
- },
- onImageFileInputChange(e) {
- console.log('tableHeadersForImage: ', this.tableHeadersForImage);
-
- e.files.forEach((eachFile, i) => {
- if (
- eachFile.type.indexOf("jpeg") <= -1 &&
- eachFile.type.indexOf("png") <= -1
- ) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”格式错误,请上传10MB以内、jpg/png格式的图片`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”名称过长,请上传标题在50字以内的图片`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- let itemInUploadList = {
- title: eachFile.name,
- ifKnowProgress: true,
- progress: 0,
- status: 'LOADING',
- statusText: "正在上传素材",
- uid: `u_${this.$randomWord(true, 8, 8)}`,
- abortHandler: null,
- successInfo: null,
- };
-
- itemInUploadList.abortHandler = uploadMaterial(
- {
- file: eachFile
- },
- {
- type: 'image',
- uid: itemInUploadList.uid,
- },
- (result) => { // 上传成功
- const index = this.uploadStatusListImage.findIndex((eachItem) => {
- return eachItem.uid === itemInUploadList.uid
- })
- result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
- result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
- result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
- this.uploadStatusListImage[index].status = 'SUCCESS'
- this.uploadStatusListImage[index].successInfo = result.data
- return i;
- },
- (err) => {
- if (err.statusText === 'abort') { // 用户取消了上传任务。
- console.log('用户取消了任务!');
- const index = this.uploadStatusListImage.findIndex((eachItem) => {
- return eachItem.uid === itemInUploadList.uid
- })
- this.uploadStatusListImage.splice(index, 1)
- } else {
- console.log('失败!');
- itemInUploadList.status = 'FAIL'
- itemInUploadList.statusText = '素材上传失败'
- }
- },
- (progress) => {
- console.log('进度:', progress);
- itemInUploadList.progress = progress
- }
- );
- this.uploadStatusListImage.unshift(itemInUploadList);
- });
- },
- onAudioFileInputChange(e) {
- e.files.forEach((eachFile, i) => {
- if (eachFile.name.toLowerCase().indexOf("mp3") <= -1) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”格式错误,请上传20MB以内、mp3格式的音频`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”名称过长,请上传标题在50字以内的音频`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- let itemInUploadList = {
- title: eachFile.name,
- ifKnowProgress: true,
- progress: 0,
- status: 'LOADING',
- statusText: "正在上传素材",
- uid: `u_${this.$randomWord(true, 8, 8)}`,
- abortHandler: null,
- };
-
- itemInUploadList.abortHandler = uploadMaterial(
- {
- file: eachFile
- },
- {
- type: 'audio',
- uid: itemInUploadList.uid,
- },
- (result) => { // 上传成功
- console.log('success');
- const index = this.uploadStatusListAudio.findIndex((eachItem) => {
- return eachItem.uid === itemInUploadList.uid
- })
- result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
- result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
- result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
- this.uploadStatusListAudio[index].status = 'SUCCESS'
- this.uploadStatusListAudio[index].successInfo = result.data
- },
- (err) => {
- console.log('error');
- if (err.statusText === 'abort') { // 用户取消了上传任务。
- console.log('用户取消了');
- const index = this.uploadStatusListAudio.findIndex((eachItem) => {
- return eachItem.uid === itemInUploadList.uid
- })
- this.uploadStatusListAudio.splice(index, 1)
- } else {
- console.log('上传失败');
- itemInUploadList.status = 'FAIL'
- itemInUploadList.statusText = '素材上传失败'
- }
- },
- (progress) => {
- console.log('progress');
- itemInUploadList.progress = progress
- }
- );
- this.uploadStatusListAudio.unshift(itemInUploadList);
- });
- },
- onVideoFileInputChange(e) {
- e.files.forEach((eachFile, i) => {
- if (eachFile.name.toLowerCase().indexOf("mp4") <= -1) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”格式错误,请上传200MB以内、mp4格式的视频`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
- setTimeout(() => {
- this.$msg({
- message: `“${eachFile.name}”名称过长,请上传标题在50字以内的视频`,
- type: "warning",
- });
- }, i * 100);
- return;
- }
- let itemInUploadList = {
- title: eachFile.name,
- ifKnowProgress: true,
- progress: 0,
- status: 'LOADING',
- statusText: "正在上传素材",
- uid: `u_${this.$randomWord(true, 8, 8)}`,
- abortHandler: null,
- };
-
- itemInUploadList.abortHandler = uploadMaterial(
- {
- file: eachFile
- },
- {
- type: 'video',
- uid: itemInUploadList.uid,
- },
- (result) => { // 上传成功
- console.log('成功!');
- const index = this.uploadStatusListVideo.findIndex((eachItem) => {
- return eachItem.uid === itemInUploadList.uid
- })
- result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
- result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
- result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
- result.data.icon = result.data.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
- this.uploadStatusListVideo[index].status = 'SUCCESS'
- this.uploadStatusListVideo[index].successInfo = result.data
- },
- (err) => {
- if (err.statusText === 'abort') { // 用户取消了上传任务。
- const index = this.uploadStatusListVideo.findIndex((eachItem) => {
- return eachItem.uid === itemInUploadList.uid
- })
- this.uploadStatusListVideo.splice(index, 1)
- } else {
- itemInUploadList.status = 'FAIL'
- itemInUploadList.statusText = '素材上传失败'
- }
- },
- (progress) => {
- console.log('进度:', progress);
- itemInUploadList.progress = progress
- }
- );
- this.uploadStatusListVideo.unshift(itemInUploadList);
- });
- },
- },
- mounted() {
- console.log('tableHeadersForAudio: ', this.tableHeadersForAudio);
- console.log('tableHeadersForVideo: ', this.tableHeadersForVideo);
- },
- unmounted() {
- this.$store.commit('setUploadStatusListImage', this.uploadStatusListImage.filter((item) => {
- return item.status === 'LOADING'
- }))
- this.$store.commit('setUploadStatusListAudio', this.uploadStatusListAudio.filter((item) => {
- return item.status === 'LOADING'
- }))
- this.$store.commit('setUploadStatusListVideo', this.uploadStatusListVideo.filter((item) => {
- return item.status === 'LOADING'
- }))
- }
- }
- </script>
- <style lang="less" scoped>
- .ellipsis{
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- width: 100%;
- display: inline-block;
- }
- .table-select {
- position: absolute;
- z-index: 3;
- left: 50%;
- top: 50%;
- transform: translateX(-50%) translateY(-50%);
- width: 600px;
- height: 730px;
- background: #1A1B1D;
- border-radius: 4px;
- border: 1px solid #404040;
- padding: 26px;
- }
- .title {
- font-size: 18px;
- color: rgba(255, 255, 255, 0.6);
- }
- .close-btn {
- display: inline-block;
- position: absolute;
- top: 26px;
- right: 20px;
- font-size: 12px;
- color: #969799;
- cursor: pointer;
- padding: 6px;
- }
- .material-tab {
- margin-top: 35px;
- > .material-tab-item {
- display: inline-block;
- margin-right: 20px;
- position: relative;
- cursor: pointer;
- > .text {
- font-size: 14px;
- font-family: MicrosoftYaHei;
- color: rgba(255, 255, 255, 0.6);
- }
- > .bottom-line {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- bottom: -4px;
- width: 16px;
- height: 2px;
- background: #0076F6;
- border-radius: 1px;
- }
- }
- }
- .filter {
- margin-top: 28px;
- width: 100%;
- height: 36px;
- background: #252526;
- border-radius: 2px;
- border: 1px solid #404040;
- position: relative;
- > input {
- box-sizing: border-box;
- width: calc(100% - 42px);
- height: 100%;
- border: none;
- padding-left: 16px;
- background: transparent;
- color: #fff;
- outline: none;
- }
- > .search-icon {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- right: 18px;
- color: #404040;
- font-size: 20px;
- }
- > .clear-icon {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- right: 18px;
- color: #404040;
- font-size: 20px;
- cursor: pointer;
- }
- }
- @table-height: 440px;
- @table-head-row-height: 40px;
- @table-border-size: 1px;
- .table {
- margin-top: 20px;
- border: @table-border-size solid #404040;
- background: #1A1B1D;
- width: 100%;
- height: @table-height;
- > .table-head-row {
- width: 100%;
- height: @table-head-row-height;
- background: #252526;
- color: rgba(255, 255, 255, 0.6);
- .table-head {
- font-size: 16px;
- line-height: @table-head-row-height;
- height: 100%;
- display: inline-block;
- }
- }
- > .table-body {
- height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
- overflow: auto;
- display: inline-block;
- width: 100%;
- > .table-body-row {
- height: 50px;
- border-bottom: 1px solid #404040;
- display: flex;
- align-items: center;
- > .table-data {
- font-size:14px;
- line-height:50px;
- height: 100%;
- color: #fff;
- > .list-img {
- position: relative;
- height: 100%;
- display: inline-block;
- width: 100%;
- > img, .audio-player {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 40px;
- height: 40px;
- object-fit: cover;
- }
- }
- }
- }
- }
- > .no-data {
- height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
- width: 100%;
- position: relative;
- > div {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- text-align: center;
- > img {
- width: 116px;
- }
- > span {
- margin-top: 20px;
- display: block;
- font-size: 14px;
- color: rgba(255, 255, 255, 0.6);
- }
- > a {
- > button {
- margin-top: 20px;
- }
- }
- }
- }
- }
- .table-image .table-head,
- .table-image .table-data {
- &:nth-of-type(1) {
- width: 50px;
- color: transparent;
- }
- &:nth-of-type(2) {
- width: calc(116px - 50px);
- }
- &:nth-of-type(3) {
- width: calc(316px - 116px);
- padding-right: 30px;
- }
- &:nth-of-type(4) {
- width: calc(416px - 316px);
- }
- &:nth-of-type(5) {
- width: calc(100% - 416px);
- }
- }
- .table-pano .table-head,
- .table-pano .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-audio .table-head,
- .table-audio .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-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) {
- 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);
- }
- }
- .checkbox {
- position: relative;
- width: 100%;
- height: 100%;
- input {
- width: 20px;
- height: 20px;
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- cursor: pointer;
- opacity: 0;
- }
- .for-outer-circle {
- width: 16px;
- height: 16px;
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- border-radius: 50%;
- border: 1px solid #404040;
- pointer-events: none;
- }
- .for-inner-circle {
- width: 8px;
- height: 8px;
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- border-radius: 50%;
- background: #0076F6;
- pointer-events: none;
- opacity: 0;
- &.disabled {
- width: 14px;
- height: 14px;
- background: rgba(255, 255, 255, 0.0800);
- opacity: 1;
- }
- }
- }
- .checkbox > input:checked ~ .for-outer-circle {
- border: 1px solid #0076F6;
- }
- .checkbox > input:checked ~ .for-inner-circle {
- opacity: 1;
- }
- .checkbox > input:disabled {
- cursor: not-allowed;
- }
- // .checkbox > input:disabled + span {
- // }
- .btns {
- display: flex;
- justify-content: space-between;
- margin-top: 40px;
- .upload-btn {
- display: flex;
- align-items: center;
- > span {
- display: inline-block;
- margin-right: 4px;
- }
- i.tool-tip-for-editor {
- font-size: 12px;
- transform: scale(0.923) translateY(1px);
- cursor: default;
- }
- }
- > div {
- .deepcancel {
- margin-right: 16px;
- }
- }
- }
- </style>
|