1
0

materialSelectorForEditor.vue 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943
  1. <template>
  2. <div class="table-select">
  3. <span class="title">{{title}}</span>
  4. <div class="close-btn"><i class="iconfont icon-pop-ups_shut-down" @click="$emit('cancle')"></i></div>
  5. <div class="material-tab">
  6. <a v-if="selectableType.includes('image')" class="material-tab-item" @click.prevent="currentMaterialType = 'image'">
  7. <span class="text">图片</span>
  8. <div v-if="currentMaterialType === 'image'" class="bottom-line"></div>
  9. </a>
  10. <a v-if="selectableType.includes('pano')" class="material-tab-item" @click.prevent="currentMaterialType = 'pano'">
  11. <span class="text">全景图</span>
  12. <div v-if="currentMaterialType === 'pano'" class="bottom-line"></div>
  13. </a>
  14. <a v-if="selectableType.includes('audio')" class="material-tab-item" @click.prevent="currentMaterialType = 'audio'">
  15. <span class="text">音频</span>
  16. <div v-if="currentMaterialType === 'audio'" class="bottom-line"></div>
  17. </a>
  18. <a v-if="selectableType.includes('video')" class="material-tab-item" @click.prevent="currentMaterialType = 'video'">
  19. <span class="text">视频</span>
  20. <div v-if="currentMaterialType === 'video'" class="bottom-line"></div>
  21. </a>
  22. <a v-if="selectableType.includes('3D')" class="material-tab-item" @click.prevent="currentMaterialType = '3D'">
  23. <span class="text">三维场景</span>
  24. <div v-if="currentMaterialType === '3D'" class="bottom-line"></div>
  25. </a>
  26. </div>
  27. <div class="filter">
  28. <input type="text" placeholder="输入关键词" v-model="searchKey"/>
  29. <i v-if="!searchKey" class="iconfont icon-editor_search search-icon"/>
  30. <i v-if="searchKey" @click="searchKey=''" class="iconfont icontoast_red clear-icon"></i>
  31. </div>
  32. <div class="table table-image" v-show="currentMaterialType === 'image'">
  33. <div class="table-head-row">
  34. <span class="table-head nothing" v-if="!isMultiSelection">1</span>
  35. <span class="table-head select-all-checkbox-wrapper" v-if="isMultiSelection">
  36. <div v-show="!isAllSelected" class="unchecked" @click="onSelectAll"></div>
  37. <img v-show="isAllSelected" class="checked" @click="onUnselectAll" src="@/assets/images/icons/checkbox.png" />
  38. </span>
  39. <span class="table-head" v-for="(item,i) in tableHeadersForImage" :key="i">{{item.name}}</span>
  40. </div>
  41. <div
  42. v-if="imageListRealLength !== 0 || hasMoreImageData"
  43. class="table-body"
  44. v-infinite-scroll="requestMoreImageData"
  45. :infinite-scroll-disabled="!hasMoreImageData || isRequestingMoreImageData"
  46. >
  47. <!-- vuex中的上传中数据 -->
  48. <div class="table-body-row" v-for="(item, i) in uploadStatusListImage" :key="item.uid" @click="onClickRow">
  49. <!-- 如果已经上传成功 -->
  50. <template v-if="item.status === 'SUCCESS'">
  51. <span class="table-data">
  52. <RadioOrCheckbox
  53. class="checkbox"
  54. :isMultiSelection="isMultiSelection"
  55. :isCheckedInitial="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  56. @change="v => selectItem(item.successInfo, v)"
  57. @click.native.stop
  58. />
  59. </span>
  60. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  61. <div v-if="tableItemStructure.type=='image'" class="list-img">
  62. <img :src="item.successInfo[tableItemStructure.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  63. </div>
  64. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  65. </span>
  66. </template>
  67. <!-- 如果还在上传中 -->
  68. <template v-else-if="item.status = 'LOADING'">
  69. <span class="table-data">
  70. <div class="checkbox">
  71. <span class="for-outer-circle"></span>
  72. <span class="for-inner-circle disabled"></span>
  73. </div>
  74. </span>
  75. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  76. <div v-if="tableItemStructure.type=='image'" class="list-img">
  77. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  78. </div>
  79. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'dpi'"></span>
  80. <span v-if="tableItemStructure.key === 'dpi'">上传素材 {{Math.round(item.progress * 100)}}%</span>
  81. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  82. </span>
  83. </template>
  84. <!-- 如果上传失败了 -->
  85. <template v-else-if="item.status = 'FAIL'">
  86. <span class="table-data">
  87. <div class="checkbox">
  88. <span class="for-outer-circle"></span>
  89. <span class="for-inner-circle disabled"></span>
  90. </div>
  91. </span>
  92. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  93. <div v-if="tableItemStructure.type=='image'" class="list-img">
  94. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  95. </div>
  96. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'dpi'"></span>
  97. <span v-if="tableItemStructure.key === 'dpi'">上传失败</span>
  98. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  99. </span>
  100. </template>
  101. </div>
  102. <!-- 本组件内的列表数据 -->
  103. <div class="table-body-row" v-for="(item,i) in imageList" :key="i" @click="onClickRow">
  104. <span class="table-data">
  105. <RadioOrCheckbox
  106. class="checkbox"
  107. :isMultiSelection="isMultiSelection"
  108. :isCheckedInitial="select.some(i => i[primaryKey] === item[primaryKey])"
  109. @change="v => selectItem(item, v)"
  110. @click.native.stop
  111. />
  112. </span>
  113. <span class="table-data" v-for="(sub,idx) in tableHeadersForImage" :key="idx">
  114. <div v-if="sub.type=='image'" class="list-img">
  115. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  116. </div>
  117. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{ item[sub.key] }}</span>
  118. </span>
  119. </div>
  120. </div>
  121. <!-- 无数据时的提示 -->
  122. <div v-else class="no-data">
  123. <div v-if="latestUsedSearchKey">
  124. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  125. <span>{{'未搜索到结果~'}}</span>
  126. </div>
  127. <div v-if="!latestUsedSearchKey">
  128. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  129. <span>{{'暂无素材~'}}</span>
  130. </div>
  131. </div>
  132. </div>
  133. <div class="table table-pano" v-show="currentMaterialType === 'pano'">
  134. <div class="table-head-row">
  135. <span class="table-head nothing" v-if="!isMultiSelection">1</span>
  136. <span class="table-head select-all-checkbox-wrapper" v-if="isMultiSelection">
  137. <div v-show="!isAllSelected" class="unchecked" @click="onSelectAll"></div>
  138. <div v-show="isAllSelected" class="checked" @click="onUnselectAll"></div>
  139. </span>
  140. <span class="table-head" v-for="(item,i) in tableHeadersForPano" :key="i">{{item.name}}</span>
  141. </div>
  142. <div
  143. v-if="panoListRealLength !== 0 || hasMorePanoData"
  144. class="table-body"
  145. v-infinite-scroll="requestMorePanoData"
  146. :infinite-scroll-disabled="!hasMorePanoData || isRequestingMorePanoData"
  147. >
  148. <!-- vuex中的上传中数据 -->
  149. <div class="table-body-row" v-for="(item, i) in uploadStatusListPano" :key="item.uid" @click="onClickRow">
  150. <!-- 如果已经上传成功 -->
  151. <template v-if="item.status === 'SUCCESS'">
  152. <span class="table-data">
  153. <RadioOrCheckbox
  154. class="checkbox"
  155. :isMultiSelection="isMultiSelection"
  156. :isCheckedInitial="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  157. @change="v => selectItem(item.successInfo, v)"
  158. @click.native.stop
  159. />
  160. </span>
  161. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  162. <div v-if="tableItemStructure.type=='image'" class="list-img">
  163. <img :src="item.successInfo[tableItemStructure.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  164. </div>
  165. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  166. </span>
  167. </template>
  168. <!-- 如果还在上传或切图处理中 -->
  169. <template v-else-if="item.status = 'LOADING'">
  170. <span class="table-data">
  171. <div class="checkbox">
  172. <span class="for-outer-circle"></span>
  173. <span class="for-inner-circle disabled"></span>
  174. </div>
  175. </span>
  176. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  177. <div v-if="tableItemStructure.type=='image'" class="list-img">
  178. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  179. </div>
  180. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  181. <span v-if="tableItemStructure.key === 'fileSize' && item.ifKnowProgress">上传素材 {{Math.round(item.progress * 100)}}%</span>
  182. <span v-if="tableItemStructure.key === 'fileSize' && !item.ifKnowProgress">{{item.statusText}}</span>
  183. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  184. </span>
  185. </template>
  186. <!-- 如果上传失败了 -->
  187. <template v-else-if="item.status = 'FAIL'">
  188. <span class="table-data">
  189. <div class="checkbox">
  190. <span class="for-outer-circle"></span>
  191. <span class="for-inner-circle disabled"></span>
  192. </div>
  193. </span>
  194. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  195. <div v-if="tableItemStructure.type=='image'" class="list-img">
  196. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  197. </div>
  198. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  199. <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
  200. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  201. </span>
  202. </template>
  203. </div>
  204. <!-- 本组件内的列表数据 -->
  205. <div class="table-body-row" v-for="(item,i) in panoList" :key="i" @click="onClickRow">
  206. <span class="table-data">
  207. <RadioOrCheckbox
  208. class="checkbox"
  209. :isMultiSelection="isMultiSelection"
  210. :isCheckedInitial="select.some(i => i[primaryKey] === item[primaryKey])"
  211. @change="v => selectItem(item, v)"
  212. @click.native.stop
  213. />
  214. </span>
  215. <span class="table-data" v-for="(sub,idx) in tableHeadersForPano" :key="idx">
  216. <div v-if="sub.type=='image'" class="list-img">
  217. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  218. </div>
  219. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  220. </span>
  221. </div>
  222. </div>
  223. <!-- 无数据时的提示 -->
  224. <div v-if="panoList.length === 0 && !hasMorePanoData" class="no-data">
  225. <div v-if="latestUsedSearchKey">
  226. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  227. <span>{{'未搜索到结果~'}}</span>
  228. </div>
  229. <div v-if="!latestUsedSearchKey">
  230. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  231. <span>{{'暂无素材~'}}</span>
  232. </div>
  233. </div>
  234. </div>
  235. <div class="table table-audio" v-show="currentMaterialType === 'audio'">
  236. <div class="table-head-row">
  237. <span class="table-head nothing" v-if="!isMultiSelection">1</span>
  238. <span class="table-head select-all-checkbox-wrapper" v-if="isMultiSelection">
  239. <div v-show="!isAllSelected" class="unchecked" @click="onSelectAll"></div>
  240. <div v-show="isAllSelected" class="checked" @click="onUnselectAll"></div>
  241. </span>
  242. <span class="table-head" v-for="(item,i) in tableHeadersForAudio" :key="i">{{item.name}}</span>
  243. </div>
  244. <div
  245. v-if="audioListRealLength !== 0 || hasMoreAudioData"
  246. class="table-body"
  247. v-infinite-scroll="requestMoreAudioData"
  248. :infinite-scroll-disabled="!hasMoreAudioData || isRequestingMoreAudioData"
  249. >
  250. <!-- vuex中的上传中数据 -->
  251. <div class="table-body-row" v-for="(item, i) in uploadStatusListAudio" :key="item.uid" @click="onClickRow">
  252. <!-- 如果已经上传成功 -->
  253. <template v-if="item.status === 'SUCCESS'">
  254. <span class="table-data">
  255. <RadioOrCheckbox
  256. class="checkbox"
  257. :isMultiSelection="isMultiSelection"
  258. :isCheckedInitial="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  259. @change="v => selectItem(item.successInfo, v)"
  260. @click.native.stop
  261. />
  262. </span>
  263. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForAudio" :key="idx">
  264. <div v-if="tableItemStructure.type=='audio'" class="list-img">
  265. <!-- <img
  266. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  267. style="object-fit: contain;"
  268. alt=""
  269. > -->
  270. <AudioIconCanPlay
  271. @click.native.stop
  272. class="audio-player"
  273. :vKey="item.successInfo.id"
  274. :idleft="`_${$randomWord(true, 8, 8)}`"
  275. :idright="`_${$randomWord(true, 8, 8)}`"
  276. :myAudioUrl="item.successInfo.ossPath"
  277. ></AudioIconCanPlay>
  278. </div>
  279. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  280. </span>
  281. </template>
  282. <!-- 如果还在上传中 -->
  283. <template v-else-if="item.status = 'LOADING'">
  284. <span class="table-data">
  285. <div class="checkbox">
  286. <span class="for-outer-circle"></span>
  287. <span class="for-inner-circle disabled"></span>
  288. </div>
  289. </span>
  290. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForAudio" :key="idx">
  291. <div v-if="tableItemStructure.type=='audio'" class="list-img">
  292. <img
  293. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  294. style="object-fit: contain;"
  295. alt=""
  296. >
  297. </div>
  298. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  299. <span v-if="tableItemStructure.key === 'fileSize'">上传素材 {{Math.round(item.progress * 100)}}%</span>
  300. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  301. </span>
  302. </template>
  303. <!-- 如果上传失败了 -->
  304. <template v-else-if="item.status = 'FAIL'">
  305. <span class="table-data">
  306. <div class="checkbox">
  307. <span class="for-outer-circle"></span>
  308. <span class="for-inner-circle disabled"></span>
  309. </div>
  310. </span>
  311. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  312. <div v-if="tableItemStructure.type=='audio'" class="list-img">
  313. <img
  314. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  315. style="object-fit: contain;"
  316. alt=""
  317. >
  318. </div>
  319. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  320. <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
  321. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  322. </span>
  323. </template>
  324. </div>
  325. <!-- 本组件内的列表数据 -->
  326. <div class="table-body-row" v-for="(item,i) in audioList" :key="i" @click="onClickRow">
  327. <span class="table-data">
  328. <RadioOrCheckbox
  329. class="checkbox"
  330. :isMultiSelection="isMultiSelection"
  331. :isCheckedInitial="select.some(i => i[primaryKey] === item[primaryKey])"
  332. @change="v => selectItem(item, v)"
  333. @click.native.stop
  334. />
  335. </span>
  336. <span class="table-data" v-for="(sub,idx) in tableHeadersForAudio" :key="idx">
  337. <div v-if="sub.type=='audio'" class="list-img">
  338. <!-- <img
  339. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  340. style="object-fit: contain;"
  341. alt=""
  342. > -->
  343. <AudioIconCanPlay
  344. @click.native.stop
  345. class="audio-player"
  346. :vKey="item.id"
  347. :idleft="`_${$randomWord(true, 8, 8)}`"
  348. :idright="`_${$randomWord(true, 8, 8)}`"
  349. :myAudioUrl="item.ossPath"
  350. ></AudioIconCanPlay>
  351. </div>
  352. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  353. </span>
  354. </div>
  355. </div>
  356. <!-- 无数据时的提示 -->
  357. <div v-if="audioList.length === 0 && !hasMoreAudioData" class="no-data">
  358. <div v-if="latestUsedSearchKey">
  359. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  360. <span>{{'未搜索到结果~'}}</span>
  361. </div>
  362. <div v-if="!latestUsedSearchKey">
  363. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  364. <span>{{'暂无素材~'}}</span>
  365. </div>
  366. </div>
  367. </div>
  368. <div class="table table-video" v-show="currentMaterialType === 'video'">
  369. <div class="table-head-row">
  370. <span class="table-head nothing" v-if="!isMultiSelection">1</span>
  371. <span class="table-head select-all-checkbox-wrapper" v-if="isMultiSelection">
  372. <div v-show="!isAllSelected" class="unchecked" @click="onSelectAll"></div>
  373. <div v-show="isAllSelected" class="checked" @click="onUnselectAll"></div>
  374. </span>
  375. <span class="table-head" v-for="(item,i) in tableHeadersForVideo" :key="i">{{item.name}}</span>
  376. </div>
  377. <div
  378. v-if="videoListRealLength !== 0 || hasMoreVideoData"
  379. class="table-body"
  380. v-infinite-scroll="requestMoreVideoData"
  381. :infinite-scroll-disabled="!hasMoreVideoData || isRequestingMoreVideoData"
  382. >
  383. <!-- vuex中的上传中数据 -->
  384. <div class="table-body-row" v-for="(item, i) in uploadStatusListVideo" :key="item.uid" @click="onClickRow">
  385. <!-- 如果已经上传成功 -->
  386. <template v-if="item.status === 'SUCCESS'">
  387. <span class="table-data">
  388. <RadioOrCheckbox
  389. class="checkbox"
  390. :isMultiSelection="isMultiSelection"
  391. :isCheckedInitial="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  392. @change="v => selectItem(item.successInfo, v)"
  393. @click.native.stop
  394. />
  395. </span>
  396. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForVideo" :key="idx">
  397. <div v-if="tableItemStructure.type=='image'" class="list-img">
  398. <img
  399. :src="item.successInfo[tableItemStructure.key]"
  400. alt=""
  401. >
  402. </div>
  403. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  404. </span>
  405. </template>
  406. <!-- 如果还在上传中 -->
  407. <template v-else-if="item.status = 'LOADING'">
  408. <span class="table-data">
  409. <div class="checkbox">
  410. <span class="for-outer-circle"></span>
  411. <span class="for-inner-circle disabled"></span>
  412. </div>
  413. </span>
  414. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForVideo" :key="idx">
  415. <div v-if="tableItemStructure.type=='image'" class="list-img">
  416. <img
  417. :src="require('@/assets/images/icons/upload-file-type-icon-video@2x.png')"
  418. style="object-fit: contain;"
  419. alt=""
  420. >
  421. </div>
  422. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  423. <span v-if="tableItemStructure.key === 'fileSize'">上传素材 {{Math.round(item.progress * 100)}}%</span>
  424. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  425. </span>
  426. </template>
  427. <!-- 如果上传失败了 -->
  428. <template v-else-if="item.status = 'FAIL'">
  429. <span class="table-data">
  430. <div class="checkbox">
  431. <span class="for-outer-circle"></span>
  432. <span class="for-inner-circle disabled"></span>
  433. </div>
  434. </span>
  435. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  436. <div v-if="tableItemStructure.type=='image'" class="list-img">
  437. <img
  438. :src="require('@/assets/images/icons/upload-file-type-icon-video@2x.png')"
  439. style="object-fit: contain;"
  440. alt=""
  441. >
  442. </div>
  443. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  444. <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
  445. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  446. </span>
  447. </template>
  448. </div>
  449. <!-- 本组件内的列表数据 -->
  450. <div class="table-body-row" v-for="(item,i) in videoList" :key="i" @click="onClickRow">
  451. <span class="table-data">
  452. <RadioOrCheckbox
  453. class="checkbox"
  454. :isMultiSelection="isMultiSelection"
  455. :isCheckedInitial="select.some(i => i[primaryKey] === item[primaryKey])"
  456. @change="v => selectItem(item, v)"
  457. @click.native.stop
  458. />
  459. </span>
  460. <span class="table-data" v-for="(sub,idx) in tableHeadersForVideo" :key="idx">
  461. <div v-if="sub.type=='image'" class="list-img">
  462. <img :src="item[sub.key]" alt="">
  463. </div>
  464. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  465. </span>
  466. </div>
  467. </div>
  468. <!-- 无数据时的提示 -->
  469. <div v-if="videoList.length === 0 && !hasMoreVideoData" class="no-data">
  470. <div v-if="latestUsedSearchKey">
  471. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  472. <span>{{'未搜索到结果~'}}</span>
  473. </div>
  474. <div v-if="!latestUsedSearchKey">
  475. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  476. <span>{{'暂无素材~'}}</span>
  477. </div>
  478. </div>
  479. </div>
  480. <div class="table table-3D" v-show="currentMaterialType === '3D'">
  481. <div class="table-head-row">
  482. <span class="table-head nothing" v-if="!isMultiSelection">1</span>
  483. <span class="table-head select-all-checkbox-wrapper" v-if="isMultiSelection">
  484. <div v-show="!isAllSelected" class="unchecked" @click="onSelectAll"></div>
  485. <div v-show="isAllSelected" class="checked" @click="onUnselectAll"></div>
  486. </span>
  487. <span class="table-head" v-for="(item,i) in tableHeadersFor3D" :key="i">{{item.name}}</span>
  488. </div>
  489. <div
  490. v-if="scene3DList.length !== 0 || hasMore3DData"
  491. class="table-body"
  492. v-infinite-scroll="requestMore3DData"
  493. :infinite-scroll-disabled="!hasMore3DData || isRequestingMore3DData"
  494. >
  495. <div class="table-body-row" v-for="(item,i) in scene3DList" :key="i" @click="onClickRow">
  496. <span class="table-data">
  497. <RadioOrCheckbox
  498. class="checkbox"
  499. :isMultiSelection="isMultiSelection"
  500. :isCheckedInitial="select.some(i => i[primaryKey] === item[primaryKey])"
  501. @change="v => selectItem(item, v)"
  502. @click.native.stop
  503. />
  504. </span>
  505. <span class="table-data" v-for="(sub,idx) in tableHeadersFor3D" :key="idx">
  506. <div v-if="sub.type=='image'" class="list-img">
  507. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  508. </div>
  509. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  510. </span>
  511. </div>
  512. </div>
  513. <!-- 无数据时的提示 -->
  514. <div v-if="scene3DList.length === 0 && !hasMore3DData" class="no-data">
  515. <div v-if="latestUsedSearchKey">
  516. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  517. <span>{{'未搜索到结果~'}}</span>
  518. </div>
  519. <div v-if="!latestUsedSearchKey">
  520. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  521. <span>{{'暂无素材~'}}</span>
  522. <a href="/#/">
  523. <button class="ui-button">如何拍摄三维场景</button>
  524. </a>
  525. </div>
  526. </div>
  527. </div>
  528. <div class="btns">
  529. <button v-if="currentMaterialType !== '3D'" class="ui-button upload-btn" @click="$refs['file-input'].click()">
  530. <span>上传素材</span>
  531. <i class="iconfont icon-material_prompt tool-tip-for-editor"
  532. v-tooltip="
  533. currentMaterialType === 'image' ? '请上传10MB以内、jpg/png格式的图片' :
  534. currentMaterialType === 'pano' ? '请上传2:1、120MB以内、jpg格式的图片' :
  535. currentMaterialType === 'audio' ? '请上传20MB以内、mp3格式的音频' :
  536. currentMaterialType === 'video' ? '请上传200MB以内、mp4格式的视频' : ''
  537. ">
  538. </i>
  539. <FileInput
  540. ref="file-input"
  541. :failString="fileInputFailString"
  542. :limitFailStr="fileInputLimitFailStr"
  543. :acceptType="fileInputAcceptType"
  544. :mediaType="fileInputMediaType"
  545. :limit="fileInputLimit"
  546. @file-change="onFileInputChange"
  547. ></FileInput>
  548. </button>
  549. <div v-else class="button-placeholder"></div>
  550. <div>
  551. <button class="ui-button deepcancel" @click="$emit('cancle')">取消</button>
  552. <button class="ui-button submit" :class="{disable: !select.length}" @click="$emit('submit', select)">
  553. 确定
  554. </button>
  555. </div>
  556. </div>
  557. </div>
  558. </template>
  559. <script>
  560. import { mapMutations } from "vuex";
  561. import {
  562. getMaterialList,
  563. getSceneList,
  564. uploadMaterial,
  565. checkMStatus,
  566. } from "@/api";
  567. import { getImgWH, changeByteUnit } from "@/utils/file";
  568. import config from "@/config";
  569. import { debounce } from "@/utils/other.js"
  570. import FileInput from "@/components/shared/uploads/UploadMultiple.vue";
  571. import { mapState } from "vuex";
  572. import AudioIconCanPlay from "@/components/audio/indexForEditor.vue";
  573. import RadioOrCheckbox from "@/components/shared/RadioOrCheckbox.vue";
  574. export default {
  575. props:{
  576. title:{
  577. default:'',
  578. type:String
  579. },
  580. primaryKey: {
  581. default:'id'
  582. },
  583. selectableType: {
  584. type: Array,
  585. default: function() {
  586. return [
  587. 'image',
  588. 'pano',
  589. 'audio',
  590. 'video',
  591. '3D',
  592. ]
  593. },
  594. },
  595. initialMaterialType: {
  596. type: String,
  597. default: 'image',
  598. },
  599. isMultiSelection: {
  600. type: Boolean,
  601. default: false,
  602. }
  603. },
  604. components:{
  605. FileInput,
  606. AudioIconCanPlay,
  607. RadioOrCheckbox
  608. },
  609. watch:{
  610. searchKey: {
  611. handler: function () {
  612. this.refreshMaterialList(this.currentMaterialType)
  613. },
  614. immediate: false,
  615. },
  616. currentMaterialType: {
  617. handler: function (newVal) {
  618. if (newVal === 'image' && this.imageList.length === 0) {
  619. this.refreshMaterialList('image')
  620. } else if (newVal === 'pano' && this.panoList.length === 0) {
  621. this.refreshMaterialList('pano')
  622. } else if (newVal === 'audio' && this.audioList.length === 0) {
  623. this.refreshMaterialList('audio')
  624. } else if (newVal === 'video' && this.videoList.length === 0) {
  625. this.refreshMaterialList('video')
  626. } else if (newVal === '3D' && this.scene3DList.length === 0) {
  627. this.refreshMaterialList('3D')
  628. }
  629. },
  630. immediate: false,
  631. },
  632. needLongPolling: {
  633. handler: function (newVal) {
  634. if (!newVal) {
  635. clearInterval(this.longPollingIntervalId)
  636. this.longPollingIntervalId = null
  637. } else {
  638. console.log('need long polling!');
  639. clearInterval(this.longPollingIntervalId)
  640. this.longPollingIntervalId = null
  641. this.longPollingIntervalId = setInterval(() => {
  642. this._checkMStatus();
  643. }, 3000);
  644. }
  645. },
  646. },
  647. },
  648. computed:{
  649. ...mapState({
  650. uploadStatusListAudio: 'uploadStatusListAudio',
  651. uploadStatusListImage: 'uploadStatusListImage',
  652. uploadStatusListPano: 'uploadStatusListPano',
  653. uploadStatusListVideo: 'uploadStatusListVideo',
  654. }),
  655. tableHeadersForImage() {
  656. return this.$MAPTABLEHEADER['image'].filter(item => {
  657. return ['icon', 'name', 'fileSize', 'dpi'].includes(item.key)
  658. })
  659. },
  660. tableHeadersForPano() {
  661. return this.$MAPTABLEHEADER['pano'].filter(item => {
  662. return ['icon', 'name', 'fileSize'].includes(item.key)
  663. })
  664. },
  665. tableHeadersForAudio() {
  666. return this.$MAPTABLEHEADER['audio'].filter(item => {
  667. return ['ossPath', 'name', 'fileSize'].includes(item.key)
  668. })
  669. },
  670. tableHeadersForVideo() {
  671. return this.$MAPTABLEHEADER['video'].filter(item => {
  672. return ['icon', 'name', 'fileSize'].includes(item.key)
  673. })
  674. },
  675. tableHeadersFor3D() {
  676. return this.$MAPTABLEHEADER['scene'].filter(item => {
  677. return ['thumb', 'sceneName', 'createTime'].includes(item.key)
  678. })
  679. },
  680. fileInputFailString() {
  681. let ret = ''
  682. switch (this.currentMaterialType) {
  683. case 'pano':
  684. ret = '格式错误,请上传2:1、120MB以内、jpg格式的全景图片'
  685. break;
  686. case 'image':
  687. ret = '格式错误,请上传10MB以内、jpg/png格式的图片'
  688. break;
  689. case 'audio':
  690. ret = '格式错误,请上传20MB以内、mp3格式的音频'
  691. break;
  692. case 'video':
  693. ret = '格式错误,请上传200MB以内、mp4格式的视频'
  694. break;
  695. default:
  696. break;
  697. }
  698. return ret
  699. },
  700. fileInputLimitFailStr() {
  701. let ret = ''
  702. switch (this.currentMaterialType) {
  703. case 'pano':
  704. ret = '过大,请上传2:1、120MB以内、jpg格式的全景图片'
  705. break;
  706. case 'image':
  707. ret = '过大,请上传10MB以内、jpg/png格式的图片'
  708. break;
  709. case 'audio':
  710. ret = '过大,请上传20MB以内、mp3格式的音频'
  711. break;
  712. case 'video':
  713. ret = '过大,请上传200MB以内、mp4格式的视频'
  714. break;
  715. default:
  716. break;
  717. }
  718. return ret
  719. },
  720. fileInputAcceptType() {
  721. let ret = ''
  722. switch (this.currentMaterialType) {
  723. case 'pano':
  724. ret = 'image/jpeg'
  725. break;
  726. case 'image':
  727. ret = 'image/png,image/jpeg'
  728. break;
  729. case 'audio':
  730. ret = 'audio/mp3'
  731. break;
  732. case 'video':
  733. ret = 'video/mp4'
  734. break;
  735. default:
  736. break;
  737. }
  738. return ret
  739. },
  740. fileInputMediaType() {
  741. let ret = ''
  742. switch (this.currentMaterialType) {
  743. case 'pano':
  744. ret = 'image'
  745. break;
  746. case 'image':
  747. ret = 'image'
  748. break;
  749. case 'audio':
  750. ret = 'audio'
  751. break;
  752. case 'video':
  753. ret = 'video'
  754. break;
  755. default:
  756. break;
  757. }
  758. return ret
  759. },
  760. fileInputLimit() {
  761. let ret
  762. switch (this.currentMaterialType) {
  763. case 'pano':
  764. ret = 120
  765. break;
  766. case 'image':
  767. ret = 10
  768. break;
  769. case 'audio':
  770. ret = 20
  771. break;
  772. case 'video':
  773. ret = 200
  774. break;
  775. default:
  776. break;
  777. }
  778. return ret
  779. },
  780. imageListRealLength() {
  781. return this.imageList.length + this.uploadStatusListImage.filter((item) => {
  782. return item.status === 'SUCCESS'
  783. }).length
  784. },
  785. panoListRealLength() {
  786. return this.imageList.length + this.uploadStatusListPano.filter((item) => {
  787. return item.status === 'SUCCESS'
  788. }).length
  789. },
  790. audioListRealLength() {
  791. return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
  792. return item.status === 'SUCCESS'
  793. }).length
  794. },
  795. videoListRealLength() {
  796. return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
  797. return item.status === 'SUCCESS'
  798. }).length
  799. },
  800. needLongPolling() {
  801. return this.uploadStatusListPano.some((item) => {
  802. return item.status === 'LOADING' && item.ifKnowProgress === false
  803. })
  804. },
  805. isAllSelected() {
  806. let ret = false
  807. switch (this.currentMaterialType) {
  808. case 'image':
  809. ret = this.select.length === this.imageListRealLength && this.select.length !== 0
  810. break;
  811. case 'pano':
  812. ret = this.select.length === this.panoListRealLength && this.select.length !== 0
  813. break;
  814. case 'audio':
  815. ret = this.select.length === this.audioListRealLength && this.select.length !== 0
  816. break;
  817. case 'video':
  818. ret = this.select.length === this.videoListRealLength && this.select.length !== 0
  819. break;
  820. case '3D':
  821. ret = this.select.length === this.scene3DList.length && this.select.length !== 0
  822. break;
  823. default:
  824. break;
  825. }
  826. return ret
  827. }
  828. },
  829. data () {
  830. return {
  831. imageList: [],
  832. panoList: [],
  833. audioList: [],
  834. videoList: [],
  835. scene3DList: [],
  836. select: [],
  837. searchKey:'', // 搜索关键词
  838. latestUsedSearchKey: '',
  839. currentMaterialType: this.initialMaterialType,
  840. isRequestingMoreImageData: false,
  841. isRequestingMorePanoData: false,
  842. isRequestingMoreAudioData: false,
  843. isRequestingMoreVideoData: false,
  844. isRequestingMore3DData: false,
  845. hasMoreImageData: true,
  846. hasMorePanoData: true,
  847. hasMoreAudioData: true,
  848. hasMoreVideoData: true,
  849. hasMore3DData: true,
  850. longPollingIntervalId: null,
  851. }
  852. },
  853. methods: {
  854. ...mapMutations([
  855. 'clearUploadStatusLists',
  856. ]),
  857. selectItem(item, v) {
  858. item.materialType = this.currentMaterialType // 三维场景数据没有type字段来表明自己是三维场景。所以统一加一个字段。
  859. if (false) {
  860. // 对于图片,大于600kb的,压缩?
  861. } else {
  862. if (this.isMultiSelection) {
  863. if (v) {
  864. this.select.push(item)
  865. } else {
  866. const toDeleteIdx = this.select.findIndex((eachSelect) => {
  867. return eachSelect.id === item.id
  868. })
  869. if (toDeleteIdx >= 0) {
  870. this.select.splice(toDeleteIdx, 1)
  871. }
  872. }
  873. } else {
  874. if (v) {
  875. this.select = [item]
  876. } else {
  877. this.select = []
  878. }
  879. }
  880. }
  881. },
  882. requestMoreImageData() {
  883. this.isRequestingMoreImageData = true
  884. const latestUsedSearchKey = this.searchKey
  885. getMaterialList(
  886. {
  887. pageNum: Math.floor(this.imageListRealLength / config.PAGE_SIZE) + 1,
  888. pageSize: config.PAGE_SIZE,
  889. searchKey: this.searchKey,
  890. type: 'image',
  891. },
  892. (data) => {
  893. const newData = data.data.list.map((i) => {
  894. i.fileSize = changeByteUnit(Number(i.fileSize));
  895. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  896. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  897. return i;
  898. });
  899. this.imageList = this.imageList.concat(newData)
  900. if (this.imageListRealLength === data.data.total) {
  901. this.hasMoreImageData = false
  902. }
  903. this.isRequestingMoreImageData = false
  904. this.latestUsedSearchKey = latestUsedSearchKey
  905. },
  906. () => {
  907. this.isRequestingMoreImageData = false
  908. this.latestUsedSearchKey = latestUsedSearchKey
  909. }
  910. );
  911. },
  912. requestMorePanoData() {
  913. this.isRequestingMorePanoData = true
  914. const latestUsedSearchKey = this.searchKey
  915. getMaterialList(
  916. {
  917. pageNum: Math.floor(this.panoListRealLength / config.PAGE_SIZE) + 1,
  918. pageSize: config.PAGE_SIZE,
  919. searchKey: this.searchKey,
  920. type: 'pano',
  921. },
  922. (data) => {
  923. const newData = data.data.list.map((i) => {
  924. i.fileSize = changeByteUnit(Number(i.fileSize));
  925. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  926. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  927. return i;
  928. });
  929. this.panoList = this.panoList.concat(newData)
  930. if (this.panoListRealLength === data.data.total) {
  931. this.hasMorePanoData = false
  932. }
  933. this.isRequestingMorePanoData = false
  934. this.latestUsedSearchKey = latestUsedSearchKey
  935. },
  936. () => {
  937. this.isRequestingMorePanoData = false
  938. this.latestUsedSearchKey = latestUsedSearchKey
  939. }
  940. );
  941. },
  942. requestMoreAudioData() {
  943. this.isRequestingMoreAudioData = true
  944. const latestUsedSearchKey = this.searchKey
  945. getMaterialList(
  946. {
  947. pageNum: Math.floor(this.audioListRealLength / config.PAGE_SIZE) + 1,
  948. pageSize: config.PAGE_SIZE,
  949. searchKey: this.searchKey,
  950. type: 'audio',
  951. },
  952. (data) => {
  953. const newData = data.data.list.map((i) => {
  954. i.fileSize = changeByteUnit(Number(i.fileSize));
  955. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  956. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  957. return i;
  958. });
  959. this.audioList = this.audioList.concat(newData)
  960. if (this.audioListRealLength === data.data.total) {
  961. this.hasMoreAudioData = false
  962. }
  963. this.isRequestingMoreAudioData = false
  964. this.latestUsedSearchKey = latestUsedSearchKey
  965. },
  966. () => {
  967. this.isRequestingMoreAudioData = false
  968. this.latestUsedSearchKey = latestUsedSearchKey
  969. }
  970. );
  971. },
  972. requestMoreVideoData() {
  973. this.isRequestingMoreVideoData = true
  974. const latestUsedSearchKey = this.searchKey
  975. getMaterialList(
  976. {
  977. pageNum: Math.floor(this.videoListReallength / config.PAGE_SIZE) + 1,
  978. pageSize: config.PAGE_SIZE,
  979. searchKey: this.searchKey,
  980. type: 'video',
  981. },
  982. (data) => {
  983. const newData = data.data.list.map((i) => {
  984. i.fileSize = changeByteUnit(Number(i.fileSize));
  985. i.icon = i.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  986. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  987. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  988. return i;
  989. });
  990. this.videoList = this.videoList.concat(newData)
  991. if (this.videoListReallength === data.data.total) {
  992. this.hasMoreVideoData = false
  993. }
  994. this.isRequestingMoreVideoData = false
  995. this.latestUsedSearchKey = latestUsedSearchKey
  996. },
  997. () => {
  998. this.isRequestingMoreVideoData = false
  999. this.latestUsedSearchKey = latestUsedSearchKey
  1000. }
  1001. );
  1002. },
  1003. requestMore3DData() {
  1004. this.isRequestingMore3DData = true
  1005. const latestUsedSearchKey = this.searchKey
  1006. getSceneList(
  1007. {
  1008. pageNum: Math.floor(this.scene3DList.length / config.PAGE_SIZE) + 1,
  1009. pageSize: config.PAGE_SIZE,
  1010. searchKey: this.searchKey,
  1011. },
  1012. (data) => {
  1013. const newData = data.data.data.list.map((i) => {
  1014. return i;
  1015. });
  1016. this.scene3DList = this.scene3DList.concat(newData)
  1017. if (this.scene3DList.length === data.data.data.total) {
  1018. this.hasMore3DData = false
  1019. }
  1020. this.isRequestingMore3DData = false
  1021. this.latestUsedSearchKey = latestUsedSearchKey
  1022. },
  1023. () => {
  1024. this.isRequestingMore3DData = false
  1025. this.latestUsedSearchKey = latestUsedSearchKey
  1026. }
  1027. )
  1028. },
  1029. refreshMaterialList: debounce(function(type) {
  1030. if (type === 'image') {
  1031. this.isRequestingMoreImageData = false
  1032. this.hasMoreImageData = true
  1033. this.imageList = []
  1034. let filterResult = this.uploadStatusListImage.filter((item) => {
  1035. return item.status === 'LOADING'
  1036. })
  1037. this.$store.commit('setUploadStatusListImage', filterResult)
  1038. this.requestMoreImageData()
  1039. } else if (type === 'pano') {
  1040. this.isRequestingMorePanoData = false
  1041. this.hasMorePanoData = true
  1042. this.panoList = []
  1043. let filterResult = this.uploadStatusListPano.filter((item) => {
  1044. return item.status === 'LOADING'
  1045. })
  1046. this.$store.commit('setUploadStatusListPano', filterResult)
  1047. this.requestMorePanoData()
  1048. } else if (type === 'audio') {
  1049. this.isRequestingMoreAudioData = false
  1050. this.hasMoreAudioData = true
  1051. this.audioList = []
  1052. let filterResult = this.uploadStatusListAudio.filter((item) => {
  1053. return item.status === 'LOADING'
  1054. })
  1055. this.$store.commit('setUploadStatusListAudio', filterResult)
  1056. this.requestMoreAudioData()
  1057. } else if (type === 'video') {
  1058. this.isRequestingMoreVideoData = false
  1059. this.hasMoreVideoData = true
  1060. this.videoList = []
  1061. let filterResult = this.uploadStatusListVideo.filter((item) => {
  1062. return item.status === 'LOADING'
  1063. })
  1064. this.$store.commit('setUploadStatusListVideo', filterResult)
  1065. this.requestMoreVideoData()
  1066. } else if (type === '3D') {
  1067. this.isRequestingMore3DData = false
  1068. this.hasMore3DData = true
  1069. this.scene3DList = []
  1070. this.requestMore3DData()
  1071. }
  1072. }, 700, false),
  1073. onFileInputChange(e) {
  1074. switch (this.currentMaterialType) {
  1075. case 'pano':
  1076. this.onPanoFileInputChange(e)
  1077. break;
  1078. case 'image':
  1079. this.onImageFileInputChange(e)
  1080. break;
  1081. case 'audio':
  1082. this.onAudioFileInputChange(e)
  1083. break;
  1084. case 'video':
  1085. this.onVideoFileInputChange(e)
  1086. break;
  1087. default:
  1088. break;
  1089. }
  1090. },
  1091. onPanoFileInputChange(e) {
  1092. e.files.forEach(async (eachFile, i) => {
  1093. if (
  1094. eachFile.type.indexOf("jpeg") <= -1
  1095. ) {
  1096. console.log('格式不对!');
  1097. setTimeout(() => {
  1098. this.$msg({
  1099. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1100. type: "warning",
  1101. });
  1102. }, i * 100);
  1103. return;
  1104. }
  1105. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1106. setTimeout(() => {
  1107. this.$msg({
  1108. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的全景图片`,
  1109. type: "warning",
  1110. });
  1111. }, i * 100);
  1112. return;
  1113. }
  1114. let WHRate = null
  1115. try {
  1116. const {width, height} = await getImgWH(eachFile)
  1117. WHRate = width / height
  1118. } catch(e) {
  1119. console.error('获取图像宽高失败:', e)
  1120. setTimeout(() => {
  1121. this.$msg({
  1122. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1123. type: "warning",
  1124. });
  1125. }, i * 100);
  1126. return
  1127. }
  1128. if (WHRate !== 2) {
  1129. setTimeout(() => {
  1130. this.$msg({
  1131. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1132. type: "warning",
  1133. });
  1134. }, i * 100);
  1135. return
  1136. }
  1137. let itemInUploadList = {
  1138. title: eachFile.name,
  1139. ifKnowProgress: true,
  1140. progress: 0,
  1141. status: 'LOADING',
  1142. statusText: "正在上传素材",
  1143. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1144. abortHandler: null,
  1145. backendId: '',
  1146. };
  1147. itemInUploadList.abortHandler = uploadMaterial(
  1148. {
  1149. file: eachFile
  1150. },
  1151. {
  1152. type: 'pano',
  1153. uid: itemInUploadList.uid,
  1154. },
  1155. (response) => { // 上传成功
  1156. itemInUploadList.statusText = '正在切图处理'
  1157. itemInUploadList.ifKnowProgress = false
  1158. itemInUploadList.backendId = response.data.id
  1159. },
  1160. (err) => {
  1161. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1162. console.log('用户取消了任务!');
  1163. const index = this.uploadStatusListPano.findIndex((eachItem) => {
  1164. return eachItem.uid === itemInUploadList.uid
  1165. })
  1166. this.uploadStatusListPano.splice(index, 1)
  1167. } else {
  1168. console.log('失败!');
  1169. itemInUploadList.status = 'FAIL'
  1170. itemInUploadList.statusText = '素材上传失败'
  1171. }
  1172. },
  1173. (progress) => {
  1174. console.log('进度:', progress);
  1175. itemInUploadList.progress = progress
  1176. }
  1177. )
  1178. this.uploadStatusListPano.unshift(itemInUploadList);
  1179. })
  1180. },
  1181. onImageFileInputChange(e) {
  1182. console.log('tableHeadersForImage: ', this.tableHeadersForImage);
  1183. e.files.forEach((eachFile, i) => {
  1184. if (
  1185. eachFile.type.indexOf("jpeg") <= -1 &&
  1186. eachFile.type.indexOf("png") <= -1
  1187. ) {
  1188. setTimeout(() => {
  1189. this.$msg({
  1190. message: `“${eachFile.name}”格式错误,请上传10MB以内、jpg/png格式的图片`,
  1191. type: "warning",
  1192. });
  1193. }, i * 100);
  1194. return;
  1195. }
  1196. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1197. setTimeout(() => {
  1198. this.$msg({
  1199. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的图片`,
  1200. type: "warning",
  1201. });
  1202. }, i * 100);
  1203. return;
  1204. }
  1205. let itemInUploadList = {
  1206. title: eachFile.name,
  1207. ifKnowProgress: true,
  1208. progress: 0,
  1209. status: 'LOADING',
  1210. statusText: "正在上传素材",
  1211. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1212. abortHandler: null,
  1213. successInfo: null,
  1214. };
  1215. itemInUploadList.abortHandler = uploadMaterial(
  1216. {
  1217. file: eachFile
  1218. },
  1219. {
  1220. type: 'image',
  1221. uid: itemInUploadList.uid,
  1222. },
  1223. (result) => { // 上传成功
  1224. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  1225. return eachItem.uid === itemInUploadList.uid
  1226. })
  1227. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1228. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1229. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1230. this.uploadStatusListImage[index].status = 'SUCCESS'
  1231. this.uploadStatusListImage[index].successInfo = result.data
  1232. return i;
  1233. },
  1234. (err) => {
  1235. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1236. console.log('用户取消了任务!');
  1237. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  1238. return eachItem.uid === itemInUploadList.uid
  1239. })
  1240. this.uploadStatusListImage.splice(index, 1)
  1241. } else {
  1242. console.log('失败!');
  1243. itemInUploadList.status = 'FAIL'
  1244. itemInUploadList.statusText = '素材上传失败'
  1245. }
  1246. },
  1247. (progress) => {
  1248. console.log('进度:', progress);
  1249. itemInUploadList.progress = progress
  1250. }
  1251. );
  1252. this.uploadStatusListImage.unshift(itemInUploadList);
  1253. });
  1254. },
  1255. onAudioFileInputChange(e) {
  1256. e.files.forEach((eachFile, i) => {
  1257. if (eachFile.name.toLowerCase().indexOf("mp3") <= -1) {
  1258. setTimeout(() => {
  1259. this.$msg({
  1260. message: `“${eachFile.name}”格式错误,请上传20MB以内、mp3格式的音频`,
  1261. type: "warning",
  1262. });
  1263. }, i * 100);
  1264. return;
  1265. }
  1266. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1267. setTimeout(() => {
  1268. this.$msg({
  1269. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的音频`,
  1270. type: "warning",
  1271. });
  1272. }, i * 100);
  1273. return;
  1274. }
  1275. let itemInUploadList = {
  1276. title: eachFile.name,
  1277. ifKnowProgress: true,
  1278. progress: 0,
  1279. status: 'LOADING',
  1280. statusText: "正在上传素材",
  1281. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1282. abortHandler: null,
  1283. };
  1284. itemInUploadList.abortHandler = uploadMaterial(
  1285. {
  1286. file: eachFile
  1287. },
  1288. {
  1289. type: 'audio',
  1290. uid: itemInUploadList.uid,
  1291. },
  1292. (result) => { // 上传成功
  1293. console.log('success');
  1294. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  1295. return eachItem.uid === itemInUploadList.uid
  1296. })
  1297. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1298. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1299. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1300. this.uploadStatusListAudio[index].status = 'SUCCESS'
  1301. this.uploadStatusListAudio[index].successInfo = result.data
  1302. },
  1303. (err) => {
  1304. console.log('error');
  1305. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1306. console.log('用户取消了');
  1307. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  1308. return eachItem.uid === itemInUploadList.uid
  1309. })
  1310. this.uploadStatusListAudio.splice(index, 1)
  1311. } else {
  1312. console.log('上传失败');
  1313. itemInUploadList.status = 'FAIL'
  1314. itemInUploadList.statusText = '素材上传失败'
  1315. }
  1316. },
  1317. (progress) => {
  1318. console.log('progress');
  1319. itemInUploadList.progress = progress
  1320. }
  1321. );
  1322. this.uploadStatusListAudio.unshift(itemInUploadList);
  1323. });
  1324. },
  1325. onVideoFileInputChange(e) {
  1326. e.files.forEach((eachFile, i) => {
  1327. if (eachFile.name.toLowerCase().indexOf("mp4") <= -1) {
  1328. setTimeout(() => {
  1329. this.$msg({
  1330. message: `“${eachFile.name}”格式错误,请上传200MB以内、mp4格式的视频`,
  1331. type: "warning",
  1332. });
  1333. }, i * 100);
  1334. return;
  1335. }
  1336. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1337. setTimeout(() => {
  1338. this.$msg({
  1339. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的视频`,
  1340. type: "warning",
  1341. });
  1342. }, i * 100);
  1343. return;
  1344. }
  1345. let itemInUploadList = {
  1346. title: eachFile.name,
  1347. ifKnowProgress: true,
  1348. progress: 0,
  1349. status: 'LOADING',
  1350. statusText: "正在上传素材",
  1351. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1352. abortHandler: null,
  1353. };
  1354. itemInUploadList.abortHandler = uploadMaterial(
  1355. {
  1356. file: eachFile
  1357. },
  1358. {
  1359. type: 'video',
  1360. uid: itemInUploadList.uid,
  1361. },
  1362. (result) => { // 上传成功
  1363. console.log('成功!');
  1364. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1365. return eachItem.uid === itemInUploadList.uid
  1366. })
  1367. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1368. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1369. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1370. result.data.icon = result.data.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  1371. this.uploadStatusListVideo[index].status = 'SUCCESS'
  1372. this.uploadStatusListVideo[index].successInfo = result.data
  1373. },
  1374. (err) => {
  1375. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1376. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1377. return eachItem.uid === itemInUploadList.uid
  1378. })
  1379. this.uploadStatusListVideo.splice(index, 1)
  1380. } else {
  1381. itemInUploadList.status = 'FAIL'
  1382. itemInUploadList.statusText = '素材上传失败'
  1383. }
  1384. },
  1385. (progress) => {
  1386. console.log('进度:', progress);
  1387. itemInUploadList.progress = progress
  1388. }
  1389. );
  1390. this.uploadStatusListVideo.unshift(itemInUploadList);
  1391. });
  1392. },
  1393. _checkMStatus() {
  1394. let needPollingTaskList = this.uploadStatusListPano.filter((item) => item.status === 'LOADING' && item.ifKnowProgress === false);
  1395. if (needPollingTaskList.length > 0) {
  1396. checkMStatus(
  1397. {
  1398. ids: needPollingTaskList.map((item) => item.backendId),
  1399. islongpolling: true,
  1400. },
  1401. (res) => {
  1402. // 1切图中,2失败,3成功
  1403. res.data.forEach(eachRes => {
  1404. if (eachRes.status === 2) {
  1405. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1406. if (index >= 0) {
  1407. const targetItem = this.uploadStatusListPano[index]
  1408. targetItem.status = 'FAIL'
  1409. targetItem.statusText = '素材切图失败'
  1410. targetItem.ifKnowProgress = true
  1411. }
  1412. } else if (eachRes.status === 3) {
  1413. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1414. if (index >= 0) {
  1415. const targetItem = this.uploadStatusListPano[index]
  1416. targetItem.status = 'SUCCESS'
  1417. eachRes.fileSize = changeByteUnit(Number(eachRes.fileSize));
  1418. targetItem.successInfo = eachRes
  1419. }
  1420. }
  1421. });
  1422. }
  1423. );
  1424. }
  1425. },
  1426. onUnselectAll() {
  1427. this.select = []
  1428. },
  1429. onSelectAll() {
  1430. this.select = []
  1431. switch (this.currentMaterialType) {
  1432. case 'image':
  1433. for (const iterator of this.uploadStatusListImage) {
  1434. if (iterator.status === 'SUCCESS') {
  1435. this.select.push(iterator.successInfo)
  1436. }
  1437. }
  1438. for (const iterator of this.imageList) {
  1439. this.select.push(iterator)
  1440. }
  1441. break;
  1442. case 'pano':
  1443. for (const iterator of this.uploadStatusListPano) {
  1444. if (iterator.status === 'SUCCESS') {
  1445. this.select.push(iterator.successInfo)
  1446. }
  1447. }
  1448. for (const iterator of this.panoList) {
  1449. this.select.push(iterator)
  1450. }
  1451. break;
  1452. case 'audio':
  1453. for (const iterator of this.uploadStatusListAudio) {
  1454. if (iterator.status === 'SUCCESS') {
  1455. this.select.push(iterator.successInfo)
  1456. }
  1457. }
  1458. for (const iterator of this.audioList) {
  1459. this.select.push(iterator)
  1460. }
  1461. break;
  1462. case 'video':
  1463. for (const iterator of this.uploadStatusListVideo) {
  1464. if (iterator.status === 'SUCCESS') {
  1465. this.select.push(iterator.successInfo)
  1466. }
  1467. }
  1468. for (const iterator of this.videoList) {
  1469. this.select.push(iterator)
  1470. }
  1471. break;
  1472. case '3D':
  1473. for (const iterator of this.scene3DList) {
  1474. this.select.push(iterator)
  1475. }
  1476. break;
  1477. default:
  1478. break;
  1479. }
  1480. },
  1481. onClickRow(e) {
  1482. const checkboxNodeList = e.currentTarget.getElementsByClassName('selection-click-target')
  1483. if (checkboxNodeList && checkboxNodeList[0]) {
  1484. checkboxNodeList[0].click()
  1485. }
  1486. },
  1487. },
  1488. mounted() {
  1489. console.log('tableHeadersForAudio: ', this.tableHeadersForAudio);
  1490. console.log('tableHeadersForVideo: ', this.tableHeadersForVideo);
  1491. this.clearUploadStatusLists()
  1492. },
  1493. unmounted() {
  1494. this.$store.commit('setUploadStatusListImage', this.uploadStatusListImage.filter((item) => {
  1495. return item.status === 'LOADING'
  1496. }))
  1497. this.$store.commit('setUploadStatusListPano', this.uploadStatusListPano.filter((item) => {
  1498. return item.status === 'LOADING'
  1499. }))
  1500. this.$store.commit('setUploadStatusListAudio', this.uploadStatusListAudio.filter((item) => {
  1501. return item.status === 'LOADING'
  1502. }))
  1503. this.$store.commit('setUploadStatusListVideo', this.uploadStatusListVideo.filter((item) => {
  1504. return item.status === 'LOADING'
  1505. }))
  1506. }
  1507. }
  1508. </script>
  1509. <style lang="less" scoped>
  1510. .ellipsis{
  1511. text-overflow: ellipsis;
  1512. overflow: hidden;
  1513. white-space: nowrap;
  1514. width: 100%;
  1515. display: inline-block;
  1516. }
  1517. .table-select {
  1518. position: absolute;
  1519. z-index: 3;
  1520. left: 50%;
  1521. top: 50%;
  1522. transform: translateX(-50%) translateY(-50%);
  1523. width: 600px;
  1524. height: 730px;
  1525. background: #1A1B1D;
  1526. border-radius: 4px;
  1527. border: 1px solid #404040;
  1528. padding: 26px;
  1529. }
  1530. .title {
  1531. font-size: 18px;
  1532. color: rgba(255, 255, 255, 0.6);
  1533. }
  1534. .close-btn {
  1535. display: inline-block;
  1536. position: absolute;
  1537. top: 26px;
  1538. right: 20px;
  1539. font-size: 12px;
  1540. color: #969799;
  1541. cursor: pointer;
  1542. padding: 6px;
  1543. }
  1544. .material-tab {
  1545. margin-top: 35px;
  1546. > .material-tab-item {
  1547. display: inline-block;
  1548. margin-right: 20px;
  1549. position: relative;
  1550. cursor: pointer;
  1551. > .text {
  1552. font-size: 14px;
  1553. font-family: MicrosoftYaHei;
  1554. color: rgba(255, 255, 255, 0.6);
  1555. }
  1556. > .bottom-line {
  1557. position: absolute;
  1558. left: 50%;
  1559. transform: translateX(-50%);
  1560. bottom: -4px;
  1561. width: 16px;
  1562. height: 2px;
  1563. background: #0076F6;
  1564. border-radius: 1px;
  1565. }
  1566. }
  1567. }
  1568. .filter {
  1569. margin-top: 28px;
  1570. width: 100%;
  1571. height: 36px;
  1572. background: #252526;
  1573. border-radius: 2px;
  1574. border: 1px solid #404040;
  1575. position: relative;
  1576. > input {
  1577. box-sizing: border-box;
  1578. width: calc(100% - 42px);
  1579. height: 100%;
  1580. border: none;
  1581. padding-left: 16px;
  1582. background: transparent;
  1583. color: #fff;
  1584. outline: none;
  1585. }
  1586. > .search-icon {
  1587. position: absolute;
  1588. top: 50%;
  1589. transform: translateY(-50%);
  1590. right: 18px;
  1591. color: #404040;
  1592. font-size: 20px;
  1593. }
  1594. > .clear-icon {
  1595. position: absolute;
  1596. top: 50%;
  1597. transform: translateY(-50%);
  1598. right: 18px;
  1599. color: #404040;
  1600. font-size: 20px;
  1601. cursor: pointer;
  1602. }
  1603. }
  1604. @table-height: 440px;
  1605. @table-head-row-height: 40px;
  1606. @table-border-size: 1px;
  1607. .table {
  1608. margin-top: 20px;
  1609. border: @table-border-size solid #404040;
  1610. background: #1A1B1D;
  1611. width: 100%;
  1612. height: @table-height;
  1613. > .table-head-row {
  1614. width: 100%;
  1615. height: @table-head-row-height;
  1616. background: #252526;
  1617. color: rgba(255, 255, 255, 0.6);
  1618. .table-head {
  1619. font-size: 16px;
  1620. line-height: @table-head-row-height;
  1621. height: 100%;
  1622. display: inline-block;
  1623. }
  1624. }
  1625. > .table-body {
  1626. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1627. overflow: auto;
  1628. display: inline-block;
  1629. width: 100%;
  1630. > .table-body-row {
  1631. height: 50px;
  1632. border-bottom: 1px solid #404040;
  1633. display: flex;
  1634. align-items: center;
  1635. cursor: pointer;
  1636. > .table-data {
  1637. font-size:14px;
  1638. line-height:50px;
  1639. height: 100%;
  1640. color: #fff;
  1641. > .list-img {
  1642. position: relative;
  1643. height: 100%;
  1644. display: inline-block;
  1645. width: 100%;
  1646. > img, .audio-player {
  1647. position: absolute;
  1648. top: 50%;
  1649. transform: translateY(-50%);
  1650. width: 40px;
  1651. height: 40px;
  1652. object-fit: cover;
  1653. }
  1654. }
  1655. }
  1656. }
  1657. }
  1658. > .no-data {
  1659. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1660. width: 100%;
  1661. position: relative;
  1662. > div {
  1663. position: absolute;
  1664. top: 50%;
  1665. left: 50%;
  1666. transform: translate(-50%, -50%);
  1667. text-align: center;
  1668. > img {
  1669. width: 116px;
  1670. }
  1671. > span {
  1672. margin-top: 20px;
  1673. display: block;
  1674. font-size: 14px;
  1675. color: rgba(255, 255, 255, 0.6);
  1676. }
  1677. > a {
  1678. > button {
  1679. margin-top: 20px;
  1680. }
  1681. }
  1682. }
  1683. }
  1684. }
  1685. .table-image .table-head,
  1686. .table-image .table-data {
  1687. &:nth-of-type(1) {
  1688. width: 50px;
  1689. &.nothing {
  1690. color: transparent;
  1691. }
  1692. &.select-all-checkbox-wrapper {
  1693. display: inline-flex;
  1694. justify-content: center;
  1695. align-items: center;
  1696. .unchecked {
  1697. width: 16px;
  1698. height: 16px;
  1699. cursor: pointer;
  1700. border-radius: 2px;
  1701. border: 1px solid #404040;
  1702. }
  1703. .checked {
  1704. width: 16px;
  1705. height: 16px;
  1706. cursor: pointer;
  1707. }
  1708. }
  1709. }
  1710. &:nth-of-type(2) {
  1711. width: calc(116px - 50px);
  1712. }
  1713. &:nth-of-type(3) {
  1714. width: calc(316px - 116px);
  1715. padding-right: 30px;
  1716. }
  1717. &:nth-of-type(4) {
  1718. width: calc(416px - 316px);
  1719. }
  1720. &:nth-of-type(5) {
  1721. width: calc(100% - 416px);
  1722. }
  1723. }
  1724. .table-pano .table-head,
  1725. .table-pano .table-data {
  1726. &:nth-of-type(1) {
  1727. width: 50px;
  1728. &.nothing {
  1729. color: transparent;
  1730. }
  1731. &.select-all-checkbox-wrapper {
  1732. display: inline-flex;
  1733. justify-content: center;
  1734. align-items: center;
  1735. .unchecked {
  1736. width: 16px;
  1737. height: 16px;
  1738. cursor: pointer;
  1739. border-radius: 2px;
  1740. border: 1px solid #404040;
  1741. }
  1742. .checked {
  1743. width: 16px;
  1744. height: 16px;
  1745. cursor: pointer;
  1746. }
  1747. }
  1748. }
  1749. &:nth-of-type(2) {
  1750. width: calc(116px - 50px);
  1751. }
  1752. &:nth-of-type(3) {
  1753. width: calc(416px - 116px);
  1754. padding-right: 30px;
  1755. }
  1756. &:nth-of-type(4) {
  1757. width: calc(100% - 416px);
  1758. }
  1759. }
  1760. .table-audio .table-head,
  1761. .table-audio .table-data {
  1762. &:nth-of-type(1) {
  1763. width: 50px;
  1764. &.nothing {
  1765. color: transparent;
  1766. }
  1767. &.select-all-checkbox-wrapper {
  1768. display: inline-flex;
  1769. justify-content: center;
  1770. align-items: center;
  1771. .unchecked {
  1772. width: 16px;
  1773. height: 16px;
  1774. cursor: pointer;
  1775. border-radius: 2px;
  1776. border: 1px solid #404040;
  1777. }
  1778. .checked {
  1779. width: 16px;
  1780. height: 16px;
  1781. cursor: pointer;
  1782. }
  1783. }
  1784. }
  1785. &:nth-of-type(2) {
  1786. width: calc(116px - 50px);
  1787. }
  1788. &:nth-of-type(3) {
  1789. width: calc(416px - 116px);
  1790. padding-right: 30px;
  1791. }
  1792. &:nth-of-type(4) {
  1793. width: calc(100% - 416px);
  1794. }
  1795. }
  1796. .table-video .table-head,
  1797. .table-video .table-data {
  1798. &:nth-of-type(1) {
  1799. width: 50px;
  1800. &.nothing {
  1801. color: transparent;
  1802. }
  1803. &.select-all-checkbox-wrapper {
  1804. display: inline-flex;
  1805. justify-content: center;
  1806. align-items: center;
  1807. .unchecked {
  1808. width: 16px;
  1809. height: 16px;
  1810. cursor: pointer;
  1811. border-radius: 2px;
  1812. border: 1px solid #404040;
  1813. }
  1814. .checked {
  1815. width: 16px;
  1816. height: 16px;
  1817. cursor: pointer;
  1818. }
  1819. }
  1820. }
  1821. &:nth-of-type(2) {
  1822. width: calc(116px - 50px);
  1823. }
  1824. &:nth-of-type(3) {
  1825. width: calc(416px - 116px);
  1826. padding-right: 30px;
  1827. }
  1828. &:nth-of-type(4) {
  1829. width: calc(100% - 416px);
  1830. }
  1831. }
  1832. .table-3D .table-head,
  1833. .table-3D .table-data {
  1834. &:nth-of-type(1) {
  1835. width: 50px;
  1836. &.nothing {
  1837. color: transparent;
  1838. }
  1839. &.select-all-checkbox-wrapper {
  1840. display: inline-flex;
  1841. justify-content: center;
  1842. align-items: center;
  1843. .unchecked {
  1844. width: 16px;
  1845. height: 16px;
  1846. cursor: pointer;
  1847. border-radius: 2px;
  1848. border: 1px solid #404040;
  1849. }
  1850. .checked {
  1851. width: 16px;
  1852. height: 16px;
  1853. cursor: pointer;
  1854. }
  1855. }
  1856. }
  1857. &:nth-of-type(2) {
  1858. width: calc(116px - 50px);
  1859. }
  1860. &:nth-of-type(3) {
  1861. width: calc(416px - 116px);
  1862. padding-right: 30px;
  1863. }
  1864. &:nth-of-type(4) {
  1865. width: calc(100% - 416px);
  1866. }
  1867. }
  1868. .checkbox {
  1869. width: 100%;
  1870. height: 100%;
  1871. }
  1872. .btns {
  1873. display: flex;
  1874. justify-content: space-between;
  1875. margin-top: 40px;
  1876. .upload-btn {
  1877. display: flex;
  1878. align-items: center;
  1879. > span {
  1880. display: inline-block;
  1881. margin-right: 4px;
  1882. }
  1883. i.tool-tip-for-editor {
  1884. font-size: 12px;
  1885. transform: scale(0.923) translateY(1px);
  1886. cursor: default;
  1887. }
  1888. }
  1889. > div {
  1890. .deepcancel {
  1891. margin-right: 16px;
  1892. }
  1893. }
  1894. }
  1895. </style>