materialSelectorForEditor.vue 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955
  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="imageListLocalLength !== 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="panoListLocalLength !== 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-else 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="audioListLocalLength !== 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-else 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="videoListLocalLength !== 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-else 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-else 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. imageListLocalLength() {
  786. return this.imageList.length + this.uploadStatusListImage.length
  787. },
  788. panoListRealLength() {
  789. return this.panoList.length + this.uploadStatusListPano.filter((item) => {
  790. return item.status === 'SUCCESS'
  791. }).length
  792. },
  793. panoListLocalLength() {
  794. return this.panoList.length + this.uploadStatusListPano.length
  795. },
  796. audioListRealLength() {
  797. return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
  798. return item.status === 'SUCCESS'
  799. }).length
  800. },
  801. audioListLocalLength() {
  802. return this.audioList.length + this.uploadStatusListAudio.length
  803. },
  804. videoListRealLength() {
  805. return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
  806. return item.status === 'SUCCESS'
  807. }).length
  808. },
  809. videoListLocalLength() {
  810. return this.videoList.length + this.uploadStatusListVideo.length
  811. },
  812. needLongPolling() {
  813. return this.uploadStatusListPano.some((item) => {
  814. return item.status === 'LOADING' && item.ifKnowProgress === false
  815. })
  816. },
  817. isAllSelected() {
  818. let ret = false
  819. switch (this.currentMaterialType) {
  820. case 'image':
  821. ret = this.select.length === this.imageListRealLength && this.select.length !== 0
  822. break;
  823. case 'pano':
  824. ret = this.select.length === this.panoListRealLength && this.select.length !== 0
  825. break;
  826. case 'audio':
  827. ret = this.select.length === this.audioListRealLength && this.select.length !== 0
  828. break;
  829. case 'video':
  830. ret = this.select.length === this.videoListRealLength && this.select.length !== 0
  831. break;
  832. case '3D':
  833. ret = this.select.length === this.scene3DList.length && this.select.length !== 0
  834. break;
  835. default:
  836. break;
  837. }
  838. return ret
  839. }
  840. },
  841. data () {
  842. return {
  843. imageList: [],
  844. panoList: [],
  845. audioList: [],
  846. videoList: [],
  847. scene3DList: [],
  848. select: [],
  849. searchKey:'', // 搜索关键词
  850. latestUsedSearchKey: '',
  851. currentMaterialType: this.initialMaterialType,
  852. isRequestingMoreImageData: false,
  853. isRequestingMorePanoData: false,
  854. isRequestingMoreAudioData: false,
  855. isRequestingMoreVideoData: false,
  856. isRequestingMore3DData: false,
  857. hasMoreImageData: true,
  858. hasMorePanoData: true,
  859. hasMoreAudioData: true,
  860. hasMoreVideoData: true,
  861. hasMore3DData: true,
  862. longPollingIntervalId: null,
  863. }
  864. },
  865. methods: {
  866. ...mapMutations([
  867. 'clearUploadStatusLists',
  868. ]),
  869. selectItem(item, v) {
  870. item.materialType = this.currentMaterialType // 三维场景数据没有type字段来表明自己是三维场景。所以统一加一个字段。
  871. if (false) {
  872. // 对于图片,大于600kb的,压缩?
  873. } else {
  874. if (this.isMultiSelection) {
  875. if (v) {
  876. this.select.push(item)
  877. } else {
  878. const toDeleteIdx = this.select.findIndex((eachSelect) => {
  879. return eachSelect.id === item.id
  880. })
  881. if (toDeleteIdx >= 0) {
  882. this.select.splice(toDeleteIdx, 1)
  883. }
  884. }
  885. } else {
  886. if (v) {
  887. this.select = [item]
  888. } else {
  889. this.select = []
  890. }
  891. }
  892. }
  893. },
  894. requestMoreImageData() {
  895. this.isRequestingMoreImageData = true
  896. const latestUsedSearchKey = this.searchKey
  897. getMaterialList(
  898. {
  899. pageNum: Math.floor(this.imageListRealLength / config.PAGE_SIZE) + 1,
  900. pageSize: config.PAGE_SIZE,
  901. searchKey: this.searchKey,
  902. type: 'image',
  903. },
  904. (data) => {
  905. const newData = data.data.list.map((i) => {
  906. i.fileSize = changeByteUnit(Number(i.fileSize));
  907. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  908. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  909. return i;
  910. });
  911. this.imageList = this.imageList.concat(newData)
  912. if (this.imageListRealLength === data.data.total) {
  913. this.hasMoreImageData = false
  914. }
  915. this.isRequestingMoreImageData = false
  916. this.latestUsedSearchKey = latestUsedSearchKey
  917. },
  918. () => {
  919. this.isRequestingMoreImageData = false
  920. this.latestUsedSearchKey = latestUsedSearchKey
  921. }
  922. );
  923. },
  924. requestMorePanoData() {
  925. this.isRequestingMorePanoData = true
  926. const latestUsedSearchKey = this.searchKey
  927. getMaterialList(
  928. {
  929. pageNum: Math.floor(this.panoListRealLength / config.PAGE_SIZE) + 1,
  930. pageSize: config.PAGE_SIZE,
  931. searchKey: this.searchKey,
  932. type: 'pano',
  933. },
  934. (data) => {
  935. const newData = data.data.list.map((i) => {
  936. i.fileSize = changeByteUnit(Number(i.fileSize));
  937. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  938. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  939. return i;
  940. });
  941. this.panoList = this.panoList.concat(newData)
  942. if (this.panoListRealLength === data.data.total) {
  943. this.hasMorePanoData = false
  944. }
  945. this.isRequestingMorePanoData = false
  946. this.latestUsedSearchKey = latestUsedSearchKey
  947. },
  948. () => {
  949. this.isRequestingMorePanoData = false
  950. this.latestUsedSearchKey = latestUsedSearchKey
  951. }
  952. );
  953. },
  954. requestMoreAudioData() {
  955. this.isRequestingMoreAudioData = true
  956. const latestUsedSearchKey = this.searchKey
  957. getMaterialList(
  958. {
  959. pageNum: Math.floor(this.audioListRealLength / config.PAGE_SIZE) + 1,
  960. pageSize: config.PAGE_SIZE,
  961. searchKey: this.searchKey,
  962. type: 'audio',
  963. },
  964. (data) => {
  965. const newData = data.data.list.map((i) => {
  966. i.fileSize = changeByteUnit(Number(i.fileSize));
  967. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  968. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  969. return i;
  970. });
  971. this.audioList = this.audioList.concat(newData)
  972. if (this.audioListRealLength === data.data.total) {
  973. this.hasMoreAudioData = false
  974. }
  975. this.isRequestingMoreAudioData = false
  976. this.latestUsedSearchKey = latestUsedSearchKey
  977. },
  978. () => {
  979. this.isRequestingMoreAudioData = false
  980. this.latestUsedSearchKey = latestUsedSearchKey
  981. }
  982. );
  983. },
  984. requestMoreVideoData() {
  985. this.isRequestingMoreVideoData = true
  986. const latestUsedSearchKey = this.searchKey
  987. getMaterialList(
  988. {
  989. pageNum: Math.floor(this.videoListReallength / config.PAGE_SIZE) + 1,
  990. pageSize: config.PAGE_SIZE,
  991. searchKey: this.searchKey,
  992. type: 'video',
  993. },
  994. (data) => {
  995. const newData = data.data.list.map((i) => {
  996. i.fileSize = changeByteUnit(Number(i.fileSize));
  997. i.icon = i.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  998. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  999. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  1000. return i;
  1001. });
  1002. this.videoList = this.videoList.concat(newData)
  1003. if (this.videoListReallength === data.data.total) {
  1004. this.hasMoreVideoData = false
  1005. }
  1006. this.isRequestingMoreVideoData = false
  1007. this.latestUsedSearchKey = latestUsedSearchKey
  1008. },
  1009. () => {
  1010. this.isRequestingMoreVideoData = false
  1011. this.latestUsedSearchKey = latestUsedSearchKey
  1012. }
  1013. );
  1014. },
  1015. requestMore3DData() {
  1016. this.isRequestingMore3DData = true
  1017. const latestUsedSearchKey = this.searchKey
  1018. getSceneList(
  1019. {
  1020. pageNum: Math.floor(this.scene3DList.length / config.PAGE_SIZE) + 1,
  1021. pageSize: config.PAGE_SIZE,
  1022. searchKey: this.searchKey,
  1023. },
  1024. (data) => {
  1025. const newData = data.data.data.list.map((i) => {
  1026. return i;
  1027. });
  1028. this.scene3DList = this.scene3DList.concat(newData)
  1029. if (this.scene3DList.length === data.data.data.total) {
  1030. this.hasMore3DData = false
  1031. }
  1032. this.isRequestingMore3DData = false
  1033. this.latestUsedSearchKey = latestUsedSearchKey
  1034. },
  1035. () => {
  1036. this.isRequestingMore3DData = false
  1037. this.latestUsedSearchKey = latestUsedSearchKey
  1038. }
  1039. )
  1040. },
  1041. refreshMaterialList: debounce(function(type) {
  1042. if (type === 'image') {
  1043. this.isRequestingMoreImageData = false
  1044. this.hasMoreImageData = true
  1045. this.imageList = []
  1046. let filterResult = this.uploadStatusListImage.filter((item) => {
  1047. return item.status === 'LOADING'
  1048. })
  1049. this.$store.commit('setUploadStatusListImage', filterResult)
  1050. this.requestMoreImageData()
  1051. } else if (type === 'pano') {
  1052. this.isRequestingMorePanoData = false
  1053. this.hasMorePanoData = true
  1054. this.panoList = []
  1055. let filterResult = this.uploadStatusListPano.filter((item) => {
  1056. return item.status === 'LOADING'
  1057. })
  1058. this.$store.commit('setUploadStatusListPano', filterResult)
  1059. this.requestMorePanoData()
  1060. } else if (type === 'audio') {
  1061. this.isRequestingMoreAudioData = false
  1062. this.hasMoreAudioData = true
  1063. this.audioList = []
  1064. let filterResult = this.uploadStatusListAudio.filter((item) => {
  1065. return item.status === 'LOADING'
  1066. })
  1067. this.$store.commit('setUploadStatusListAudio', filterResult)
  1068. this.requestMoreAudioData()
  1069. } else if (type === 'video') {
  1070. this.isRequestingMoreVideoData = false
  1071. this.hasMoreVideoData = true
  1072. this.videoList = []
  1073. let filterResult = this.uploadStatusListVideo.filter((item) => {
  1074. return item.status === 'LOADING'
  1075. })
  1076. this.$store.commit('setUploadStatusListVideo', filterResult)
  1077. this.requestMoreVideoData()
  1078. } else if (type === '3D') {
  1079. this.isRequestingMore3DData = false
  1080. this.hasMore3DData = true
  1081. this.scene3DList = []
  1082. this.requestMore3DData()
  1083. }
  1084. }, 700, false),
  1085. onFileInputChange(e) {
  1086. switch (this.currentMaterialType) {
  1087. case 'pano':
  1088. this.onPanoFileInputChange(e)
  1089. break;
  1090. case 'image':
  1091. this.onImageFileInputChange(e)
  1092. break;
  1093. case 'audio':
  1094. this.onAudioFileInputChange(e)
  1095. break;
  1096. case 'video':
  1097. this.onVideoFileInputChange(e)
  1098. break;
  1099. default:
  1100. break;
  1101. }
  1102. },
  1103. onPanoFileInputChange(e) {
  1104. e.files.forEach(async (eachFile, i) => {
  1105. if (
  1106. eachFile.type.indexOf("jpeg") <= -1
  1107. ) {
  1108. console.log('格式不对!');
  1109. setTimeout(() => {
  1110. this.$msg({
  1111. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1112. type: "warning",
  1113. });
  1114. }, i * 100);
  1115. return;
  1116. }
  1117. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1118. setTimeout(() => {
  1119. this.$msg({
  1120. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的全景图片`,
  1121. type: "warning",
  1122. });
  1123. }, i * 100);
  1124. return;
  1125. }
  1126. let WHRate = null
  1127. try {
  1128. const {width, height} = await getImgWH(eachFile)
  1129. WHRate = width / height
  1130. } catch(e) {
  1131. console.error('获取图像宽高失败:', e)
  1132. setTimeout(() => {
  1133. this.$msg({
  1134. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1135. type: "warning",
  1136. });
  1137. }, i * 100);
  1138. return
  1139. }
  1140. if (WHRate !== 2) {
  1141. setTimeout(() => {
  1142. this.$msg({
  1143. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1144. type: "warning",
  1145. });
  1146. }, i * 100);
  1147. return
  1148. }
  1149. let itemInUploadList = {
  1150. title: eachFile.name,
  1151. ifKnowProgress: true,
  1152. progress: 0,
  1153. status: 'LOADING',
  1154. statusText: "正在上传素材",
  1155. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1156. abortHandler: null,
  1157. backendId: '',
  1158. };
  1159. itemInUploadList.abortHandler = uploadMaterial(
  1160. {
  1161. file: eachFile
  1162. },
  1163. {
  1164. type: 'pano',
  1165. uid: itemInUploadList.uid,
  1166. },
  1167. (response) => { // 上传成功
  1168. itemInUploadList.statusText = '正在切图处理'
  1169. itemInUploadList.ifKnowProgress = false
  1170. itemInUploadList.backendId = response.data.id
  1171. },
  1172. (err) => {
  1173. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1174. console.log('用户取消了任务!');
  1175. const index = this.uploadStatusListPano.findIndex((eachItem) => {
  1176. return eachItem.uid === itemInUploadList.uid
  1177. })
  1178. this.uploadStatusListPano.splice(index, 1)
  1179. } else {
  1180. console.log('失败!');
  1181. itemInUploadList.status = 'FAIL'
  1182. itemInUploadList.statusText = '素材上传失败'
  1183. }
  1184. },
  1185. (progress) => {
  1186. console.log('进度:', progress);
  1187. itemInUploadList.progress = progress
  1188. }
  1189. )
  1190. this.uploadStatusListPano.unshift(itemInUploadList);
  1191. })
  1192. },
  1193. onImageFileInputChange(e) {
  1194. console.log('tableHeadersForImage: ', this.tableHeadersForImage);
  1195. e.files.forEach((eachFile, i) => {
  1196. if (
  1197. eachFile.type.indexOf("jpeg") <= -1 &&
  1198. eachFile.type.indexOf("png") <= -1
  1199. ) {
  1200. setTimeout(() => {
  1201. this.$msg({
  1202. message: `“${eachFile.name}”格式错误,请上传10MB以内、jpg/png格式的图片`,
  1203. type: "warning",
  1204. });
  1205. }, i * 100);
  1206. return;
  1207. }
  1208. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1209. setTimeout(() => {
  1210. this.$msg({
  1211. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的图片`,
  1212. type: "warning",
  1213. });
  1214. }, i * 100);
  1215. return;
  1216. }
  1217. let itemInUploadList = {
  1218. title: eachFile.name,
  1219. ifKnowProgress: true,
  1220. progress: 0,
  1221. status: 'LOADING',
  1222. statusText: "正在上传素材",
  1223. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1224. abortHandler: null,
  1225. successInfo: null,
  1226. };
  1227. itemInUploadList.abortHandler = uploadMaterial(
  1228. {
  1229. file: eachFile
  1230. },
  1231. {
  1232. type: 'image',
  1233. uid: itemInUploadList.uid,
  1234. },
  1235. (result) => { // 上传成功
  1236. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  1237. return eachItem.uid === itemInUploadList.uid
  1238. })
  1239. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1240. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1241. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1242. this.uploadStatusListImage[index].status = 'SUCCESS'
  1243. this.uploadStatusListImage[index].successInfo = result.data
  1244. return i;
  1245. },
  1246. (err) => {
  1247. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1248. console.log('用户取消了任务!');
  1249. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  1250. return eachItem.uid === itemInUploadList.uid
  1251. })
  1252. this.uploadStatusListImage.splice(index, 1)
  1253. } else {
  1254. console.log('失败!');
  1255. itemInUploadList.status = 'FAIL'
  1256. itemInUploadList.statusText = '素材上传失败'
  1257. }
  1258. },
  1259. (progress) => {
  1260. console.log('进度:', progress);
  1261. itemInUploadList.progress = progress
  1262. }
  1263. );
  1264. this.uploadStatusListImage.unshift(itemInUploadList);
  1265. });
  1266. },
  1267. onAudioFileInputChange(e) {
  1268. e.files.forEach((eachFile, i) => {
  1269. if (eachFile.name.toLowerCase().indexOf("mp3") <= -1) {
  1270. setTimeout(() => {
  1271. this.$msg({
  1272. message: `“${eachFile.name}”格式错误,请上传20MB以内、mp3格式的音频`,
  1273. type: "warning",
  1274. });
  1275. }, i * 100);
  1276. return;
  1277. }
  1278. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1279. setTimeout(() => {
  1280. this.$msg({
  1281. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的音频`,
  1282. type: "warning",
  1283. });
  1284. }, i * 100);
  1285. return;
  1286. }
  1287. let itemInUploadList = {
  1288. title: eachFile.name,
  1289. ifKnowProgress: true,
  1290. progress: 0,
  1291. status: 'LOADING',
  1292. statusText: "正在上传素材",
  1293. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1294. abortHandler: null,
  1295. };
  1296. itemInUploadList.abortHandler = uploadMaterial(
  1297. {
  1298. file: eachFile
  1299. },
  1300. {
  1301. type: 'audio',
  1302. uid: itemInUploadList.uid,
  1303. },
  1304. (result) => { // 上传成功
  1305. console.log('success');
  1306. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  1307. return eachItem.uid === itemInUploadList.uid
  1308. })
  1309. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1310. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1311. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1312. this.uploadStatusListAudio[index].status = 'SUCCESS'
  1313. this.uploadStatusListAudio[index].successInfo = result.data
  1314. },
  1315. (err) => {
  1316. console.log('error');
  1317. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1318. console.log('用户取消了');
  1319. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  1320. return eachItem.uid === itemInUploadList.uid
  1321. })
  1322. this.uploadStatusListAudio.splice(index, 1)
  1323. } else {
  1324. console.log('上传失败');
  1325. itemInUploadList.status = 'FAIL'
  1326. itemInUploadList.statusText = '素材上传失败'
  1327. }
  1328. },
  1329. (progress) => {
  1330. console.log('progress');
  1331. itemInUploadList.progress = progress
  1332. }
  1333. );
  1334. this.uploadStatusListAudio.unshift(itemInUploadList);
  1335. });
  1336. },
  1337. onVideoFileInputChange(e) {
  1338. e.files.forEach((eachFile, i) => {
  1339. if (eachFile.name.toLowerCase().indexOf("mp4") <= -1) {
  1340. setTimeout(() => {
  1341. this.$msg({
  1342. message: `“${eachFile.name}”格式错误,请上传200MB以内、mp4格式的视频`,
  1343. type: "warning",
  1344. });
  1345. }, i * 100);
  1346. return;
  1347. }
  1348. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1349. setTimeout(() => {
  1350. this.$msg({
  1351. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的视频`,
  1352. type: "warning",
  1353. });
  1354. }, i * 100);
  1355. return;
  1356. }
  1357. let itemInUploadList = {
  1358. title: eachFile.name,
  1359. ifKnowProgress: true,
  1360. progress: 0,
  1361. status: 'LOADING',
  1362. statusText: "正在上传素材",
  1363. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1364. abortHandler: null,
  1365. };
  1366. itemInUploadList.abortHandler = uploadMaterial(
  1367. {
  1368. file: eachFile
  1369. },
  1370. {
  1371. type: 'video',
  1372. uid: itemInUploadList.uid,
  1373. },
  1374. (result) => { // 上传成功
  1375. console.log('成功!');
  1376. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1377. return eachItem.uid === itemInUploadList.uid
  1378. })
  1379. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1380. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1381. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1382. result.data.icon = result.data.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  1383. this.uploadStatusListVideo[index].status = 'SUCCESS'
  1384. this.uploadStatusListVideo[index].successInfo = result.data
  1385. },
  1386. (err) => {
  1387. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1388. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1389. return eachItem.uid === itemInUploadList.uid
  1390. })
  1391. this.uploadStatusListVideo.splice(index, 1)
  1392. } else {
  1393. itemInUploadList.status = 'FAIL'
  1394. itemInUploadList.statusText = '素材上传失败'
  1395. }
  1396. },
  1397. (progress) => {
  1398. console.log('进度:', progress);
  1399. itemInUploadList.progress = progress
  1400. }
  1401. );
  1402. this.uploadStatusListVideo.unshift(itemInUploadList);
  1403. });
  1404. },
  1405. _checkMStatus() {
  1406. let needPollingTaskList = this.uploadStatusListPano.filter((item) => item.status === 'LOADING' && item.ifKnowProgress === false);
  1407. if (needPollingTaskList.length > 0) {
  1408. checkMStatus(
  1409. {
  1410. ids: needPollingTaskList.map((item) => item.backendId),
  1411. islongpolling: true,
  1412. },
  1413. (res) => {
  1414. // 1切图中,2失败,3成功
  1415. res.data.forEach(eachRes => {
  1416. if (eachRes.status === 2) {
  1417. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1418. if (index >= 0) {
  1419. const targetItem = this.uploadStatusListPano[index]
  1420. targetItem.status = 'FAIL'
  1421. targetItem.statusText = '素材切图失败'
  1422. targetItem.ifKnowProgress = true
  1423. }
  1424. } else if (eachRes.status === 3) {
  1425. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1426. if (index >= 0) {
  1427. const targetItem = this.uploadStatusListPano[index]
  1428. targetItem.status = 'SUCCESS'
  1429. eachRes.fileSize = changeByteUnit(Number(eachRes.fileSize));
  1430. targetItem.successInfo = eachRes
  1431. }
  1432. }
  1433. });
  1434. }
  1435. );
  1436. }
  1437. },
  1438. onUnselectAll() {
  1439. this.select = []
  1440. },
  1441. onSelectAll() {
  1442. this.select = []
  1443. switch (this.currentMaterialType) {
  1444. case 'image':
  1445. for (const iterator of this.uploadStatusListImage) {
  1446. if (iterator.status === 'SUCCESS') {
  1447. this.select.push(iterator.successInfo)
  1448. }
  1449. }
  1450. for (const iterator of this.imageList) {
  1451. this.select.push(iterator)
  1452. }
  1453. break;
  1454. case 'pano':
  1455. for (const iterator of this.uploadStatusListPano) {
  1456. if (iterator.status === 'SUCCESS') {
  1457. this.select.push(iterator.successInfo)
  1458. }
  1459. }
  1460. for (const iterator of this.panoList) {
  1461. this.select.push(iterator)
  1462. }
  1463. break;
  1464. case 'audio':
  1465. for (const iterator of this.uploadStatusListAudio) {
  1466. if (iterator.status === 'SUCCESS') {
  1467. this.select.push(iterator.successInfo)
  1468. }
  1469. }
  1470. for (const iterator of this.audioList) {
  1471. this.select.push(iterator)
  1472. }
  1473. break;
  1474. case 'video':
  1475. for (const iterator of this.uploadStatusListVideo) {
  1476. if (iterator.status === 'SUCCESS') {
  1477. this.select.push(iterator.successInfo)
  1478. }
  1479. }
  1480. for (const iterator of this.videoList) {
  1481. this.select.push(iterator)
  1482. }
  1483. break;
  1484. case '3D':
  1485. for (const iterator of this.scene3DList) {
  1486. this.select.push(iterator)
  1487. }
  1488. break;
  1489. default:
  1490. break;
  1491. }
  1492. },
  1493. onClickRow(e) {
  1494. const checkboxNodeList = e.currentTarget.getElementsByClassName('selection-click-target')
  1495. if (checkboxNodeList && checkboxNodeList[0]) {
  1496. checkboxNodeList[0].click()
  1497. }
  1498. },
  1499. },
  1500. mounted() {
  1501. console.log('tableHeadersForAudio: ', this.tableHeadersForAudio);
  1502. console.log('tableHeadersForVideo: ', this.tableHeadersForVideo);
  1503. this.clearUploadStatusLists()
  1504. },
  1505. unmounted() {
  1506. this.$store.commit('setUploadStatusListImage', this.uploadStatusListImage.filter((item) => {
  1507. return item.status === 'LOADING'
  1508. }))
  1509. this.$store.commit('setUploadStatusListPano', this.uploadStatusListPano.filter((item) => {
  1510. return item.status === 'LOADING'
  1511. }))
  1512. this.$store.commit('setUploadStatusListAudio', this.uploadStatusListAudio.filter((item) => {
  1513. return item.status === 'LOADING'
  1514. }))
  1515. this.$store.commit('setUploadStatusListVideo', this.uploadStatusListVideo.filter((item) => {
  1516. return item.status === 'LOADING'
  1517. }))
  1518. }
  1519. }
  1520. </script>
  1521. <style lang="less" scoped>
  1522. .ellipsis{
  1523. text-overflow: ellipsis;
  1524. overflow: hidden;
  1525. white-space: nowrap;
  1526. width: 100%;
  1527. display: inline-block;
  1528. }
  1529. .table-select {
  1530. position: absolute;
  1531. z-index: 3;
  1532. left: 50%;
  1533. top: 50%;
  1534. transform: translateX(-50%) translateY(-50%);
  1535. width: 600px;
  1536. height: 730px;
  1537. background: #1A1B1D;
  1538. border-radius: 4px;
  1539. border: 1px solid #404040;
  1540. padding: 26px;
  1541. }
  1542. .title {
  1543. font-size: 18px;
  1544. color: rgba(255, 255, 255, 0.6);
  1545. }
  1546. .close-btn {
  1547. display: inline-block;
  1548. position: absolute;
  1549. top: 26px;
  1550. right: 20px;
  1551. font-size: 12px;
  1552. color: #969799;
  1553. cursor: pointer;
  1554. padding: 6px;
  1555. }
  1556. .material-tab {
  1557. margin-top: 35px;
  1558. > .material-tab-item {
  1559. display: inline-block;
  1560. margin-right: 20px;
  1561. position: relative;
  1562. cursor: pointer;
  1563. > .text {
  1564. font-size: 14px;
  1565. font-family: MicrosoftYaHei;
  1566. color: rgba(255, 255, 255, 0.6);
  1567. }
  1568. > .bottom-line {
  1569. position: absolute;
  1570. left: 50%;
  1571. transform: translateX(-50%);
  1572. bottom: -4px;
  1573. width: 16px;
  1574. height: 2px;
  1575. background: #0076F6;
  1576. border-radius: 1px;
  1577. }
  1578. }
  1579. }
  1580. .filter {
  1581. margin-top: 28px;
  1582. width: 100%;
  1583. height: 36px;
  1584. background: #252526;
  1585. border-radius: 2px;
  1586. border: 1px solid #404040;
  1587. position: relative;
  1588. > input {
  1589. box-sizing: border-box;
  1590. width: calc(100% - 42px);
  1591. height: 100%;
  1592. border: none;
  1593. padding-left: 16px;
  1594. background: transparent;
  1595. color: #fff;
  1596. outline: none;
  1597. }
  1598. > .search-icon {
  1599. position: absolute;
  1600. top: 50%;
  1601. transform: translateY(-50%);
  1602. right: 18px;
  1603. color: #404040;
  1604. font-size: 20px;
  1605. }
  1606. > .clear-icon {
  1607. position: absolute;
  1608. top: 50%;
  1609. transform: translateY(-50%);
  1610. right: 18px;
  1611. color: #404040;
  1612. font-size: 20px;
  1613. cursor: pointer;
  1614. }
  1615. }
  1616. @table-height: 440px;
  1617. @table-head-row-height: 40px;
  1618. @table-border-size: 1px;
  1619. .table {
  1620. margin-top: 20px;
  1621. border: @table-border-size solid #404040;
  1622. background: #1A1B1D;
  1623. width: 100%;
  1624. height: @table-height;
  1625. > .table-head-row {
  1626. width: 100%;
  1627. height: @table-head-row-height;
  1628. background: #252526;
  1629. color: rgba(255, 255, 255, 0.6);
  1630. .table-head {
  1631. font-size: 16px;
  1632. line-height: @table-head-row-height;
  1633. height: 100%;
  1634. display: inline-block;
  1635. }
  1636. }
  1637. > .table-body {
  1638. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1639. overflow: auto;
  1640. display: inline-block;
  1641. width: 100%;
  1642. > .table-body-row {
  1643. height: 50px;
  1644. border-bottom: 1px solid #404040;
  1645. display: flex;
  1646. align-items: center;
  1647. cursor: pointer;
  1648. > .table-data {
  1649. font-size:14px;
  1650. line-height:50px;
  1651. height: 100%;
  1652. color: #fff;
  1653. > .list-img {
  1654. position: relative;
  1655. height: 100%;
  1656. display: inline-block;
  1657. width: 100%;
  1658. > img, .audio-player {
  1659. position: absolute;
  1660. top: 50%;
  1661. transform: translateY(-50%);
  1662. width: 40px;
  1663. height: 40px;
  1664. object-fit: cover;
  1665. }
  1666. }
  1667. }
  1668. }
  1669. }
  1670. > .no-data {
  1671. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1672. width: 100%;
  1673. position: relative;
  1674. > div {
  1675. position: absolute;
  1676. top: 50%;
  1677. left: 50%;
  1678. transform: translate(-50%, -50%);
  1679. text-align: center;
  1680. > img {
  1681. width: 116px;
  1682. }
  1683. > span {
  1684. margin-top: 20px;
  1685. display: block;
  1686. font-size: 14px;
  1687. color: rgba(255, 255, 255, 0.6);
  1688. }
  1689. > a {
  1690. > button {
  1691. margin-top: 20px;
  1692. }
  1693. }
  1694. }
  1695. }
  1696. }
  1697. .table-image .table-head,
  1698. .table-image .table-data {
  1699. &:nth-of-type(1) {
  1700. width: 50px;
  1701. &.nothing {
  1702. color: transparent;
  1703. }
  1704. &.select-all-checkbox-wrapper {
  1705. display: inline-flex;
  1706. justify-content: center;
  1707. align-items: center;
  1708. .unchecked {
  1709. width: 16px;
  1710. height: 16px;
  1711. cursor: pointer;
  1712. border-radius: 2px;
  1713. border: 1px solid #404040;
  1714. }
  1715. .checked {
  1716. width: 16px;
  1717. height: 16px;
  1718. cursor: pointer;
  1719. }
  1720. }
  1721. }
  1722. &:nth-of-type(2) {
  1723. width: calc(116px - 50px);
  1724. }
  1725. &:nth-of-type(3) {
  1726. width: calc(316px - 116px);
  1727. padding-right: 30px;
  1728. }
  1729. &:nth-of-type(4) {
  1730. width: calc(416px - 316px);
  1731. }
  1732. &:nth-of-type(5) {
  1733. width: calc(100% - 416px);
  1734. }
  1735. }
  1736. .table-pano .table-head,
  1737. .table-pano .table-data {
  1738. &:nth-of-type(1) {
  1739. width: 50px;
  1740. &.nothing {
  1741. color: transparent;
  1742. }
  1743. &.select-all-checkbox-wrapper {
  1744. display: inline-flex;
  1745. justify-content: center;
  1746. align-items: center;
  1747. .unchecked {
  1748. width: 16px;
  1749. height: 16px;
  1750. cursor: pointer;
  1751. border-radius: 2px;
  1752. border: 1px solid #404040;
  1753. }
  1754. .checked {
  1755. width: 16px;
  1756. height: 16px;
  1757. cursor: pointer;
  1758. }
  1759. }
  1760. }
  1761. &:nth-of-type(2) {
  1762. width: calc(116px - 50px);
  1763. }
  1764. &:nth-of-type(3) {
  1765. width: calc(416px - 116px);
  1766. padding-right: 30px;
  1767. }
  1768. &:nth-of-type(4) {
  1769. width: calc(100% - 416px);
  1770. }
  1771. }
  1772. .table-audio .table-head,
  1773. .table-audio .table-data {
  1774. &:nth-of-type(1) {
  1775. width: 50px;
  1776. &.nothing {
  1777. color: transparent;
  1778. }
  1779. &.select-all-checkbox-wrapper {
  1780. display: inline-flex;
  1781. justify-content: center;
  1782. align-items: center;
  1783. .unchecked {
  1784. width: 16px;
  1785. height: 16px;
  1786. cursor: pointer;
  1787. border-radius: 2px;
  1788. border: 1px solid #404040;
  1789. }
  1790. .checked {
  1791. width: 16px;
  1792. height: 16px;
  1793. cursor: pointer;
  1794. }
  1795. }
  1796. }
  1797. &:nth-of-type(2) {
  1798. width: calc(116px - 50px);
  1799. }
  1800. &:nth-of-type(3) {
  1801. width: calc(416px - 116px);
  1802. padding-right: 30px;
  1803. }
  1804. &:nth-of-type(4) {
  1805. width: calc(100% - 416px);
  1806. }
  1807. }
  1808. .table-video .table-head,
  1809. .table-video .table-data {
  1810. &:nth-of-type(1) {
  1811. width: 50px;
  1812. &.nothing {
  1813. color: transparent;
  1814. }
  1815. &.select-all-checkbox-wrapper {
  1816. display: inline-flex;
  1817. justify-content: center;
  1818. align-items: center;
  1819. .unchecked {
  1820. width: 16px;
  1821. height: 16px;
  1822. cursor: pointer;
  1823. border-radius: 2px;
  1824. border: 1px solid #404040;
  1825. }
  1826. .checked {
  1827. width: 16px;
  1828. height: 16px;
  1829. cursor: pointer;
  1830. }
  1831. }
  1832. }
  1833. &:nth-of-type(2) {
  1834. width: calc(116px - 50px);
  1835. }
  1836. &:nth-of-type(3) {
  1837. width: calc(416px - 116px);
  1838. padding-right: 30px;
  1839. }
  1840. &:nth-of-type(4) {
  1841. width: calc(100% - 416px);
  1842. }
  1843. }
  1844. .table-3D .table-head,
  1845. .table-3D .table-data {
  1846. &:nth-of-type(1) {
  1847. width: 50px;
  1848. &.nothing {
  1849. color: transparent;
  1850. }
  1851. &.select-all-checkbox-wrapper {
  1852. display: inline-flex;
  1853. justify-content: center;
  1854. align-items: center;
  1855. .unchecked {
  1856. width: 16px;
  1857. height: 16px;
  1858. cursor: pointer;
  1859. border-radius: 2px;
  1860. border: 1px solid #404040;
  1861. }
  1862. .checked {
  1863. width: 16px;
  1864. height: 16px;
  1865. cursor: pointer;
  1866. }
  1867. }
  1868. }
  1869. &:nth-of-type(2) {
  1870. width: calc(116px - 50px);
  1871. }
  1872. &:nth-of-type(3) {
  1873. width: calc(416px - 116px);
  1874. padding-right: 30px;
  1875. }
  1876. &:nth-of-type(4) {
  1877. width: calc(100% - 416px);
  1878. }
  1879. }
  1880. .checkbox {
  1881. width: 100%;
  1882. height: 100%;
  1883. }
  1884. .btns {
  1885. display: flex;
  1886. justify-content: space-between;
  1887. margin-top: 40px;
  1888. .upload-btn {
  1889. display: flex;
  1890. align-items: center;
  1891. > span {
  1892. display: inline-block;
  1893. margin-right: 4px;
  1894. }
  1895. i.tool-tip-for-editor {
  1896. font-size: 12px;
  1897. transform: scale(0.923) translateY(1px);
  1898. cursor: default;
  1899. }
  1900. }
  1901. > div {
  1902. .deepcancel {
  1903. margin-right: 16px;
  1904. }
  1905. }
  1906. }
  1907. </style>