materialSelectorForManageCenter.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448
  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
  8. :class="{active: currentMaterialType === 'image'}"
  9. class="text"
  10. >
  11. 图片
  12. </span>
  13. <div v-if="currentMaterialType === 'image'" class="bottom-line"></div>
  14. </a>
  15. <a v-if="selectableType.includes('pano')" class="material-tab-item" @click.prevent="currentMaterialType = 'pano'">
  16. <span
  17. :class="{active: currentMaterialType === 'pano'}"
  18. class="text"
  19. >
  20. 全景图
  21. </span>
  22. <div v-if="currentMaterialType === 'pano'" class="bottom-line"></div>
  23. </a>
  24. <a v-if="selectableType.includes('audio')" class="material-tab-item" @click.prevent="currentMaterialType = 'audio'">
  25. <span
  26. :class="{active: currentMaterialType === 'audio'}"
  27. class="text"
  28. >
  29. 音频
  30. </span>
  31. <div v-if="currentMaterialType === 'audio'" class="bottom-line"></div>
  32. </a>
  33. <a v-if="selectableType.includes('video')" class="material-tab-item" @click.prevent="currentMaterialType = 'video'">
  34. <span
  35. :class="{active: currentMaterialType === 'video'}"
  36. class="text"
  37. >
  38. 视频
  39. </span>
  40. <div v-if="currentMaterialType === 'video'" class="bottom-line"></div>
  41. </a>
  42. <a v-if="selectableType.includes('3D')" class="material-tab-item" @click.prevent="currentMaterialType = '3D'">
  43. <span
  44. :class="{active: currentMaterialType === '3D'}"
  45. class="text"
  46. >
  47. 三维场景
  48. </span>
  49. <div v-if="currentMaterialType === '3D'" class="bottom-line"></div>
  50. </a>
  51. </div>
  52. <div class="filter">
  53. <input type="text" placeholder="输入关键词" v-model="searchKey"/>
  54. <i v-if="!searchKey" class="iconfont icon-editor_search search-icon"/>
  55. <i v-if="searchKey" @click="searchKey=''" class="iconfont icontoast_red clear-icon"></i>
  56. </div>
  57. <div class="table table-pano" v-show="currentMaterialType === 'pano'">
  58. <div class="table-head-row">
  59. <span class="table-head">1</span>
  60. <span class="table-head" v-for="(item,i) in tableHeadersForPano" :key="i">{{item.name}}</span>
  61. </div>
  62. <div
  63. v-if="panoListRealLength !== 0 || hasMorePanoData"
  64. class="table-body"
  65. v-infinite-scroll="requestMorePanoData"
  66. :infinite-scroll-disabled="!hasMorePanoData || isRequestingMorePanoData"
  67. >
  68. <!-- vuex中的上传中数据 -->
  69. <div class="table-body-row" v-for="(item, i) in uploadStatusListPano" :key="item.uid" @click="onClickRow">
  70. <!-- 如果已经上传成功 -->
  71. <template v-if="item.status === 'SUCCESS'">
  72. <span class="table-data">
  73. <RadioOrCheckbox
  74. class="checkbox"
  75. :isLightTheme="true"
  76. :isMultiSelection="isMultiSelection"
  77. :isCheckedInitial="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  78. @change="v => selectItem(item.successInfo, v)"
  79. @click.native.stop
  80. />
  81. </span>
  82. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  83. <div v-if="tableItemStructure.type=='image'" class="list-img">
  84. <img :src="item.successInfo[tableItemStructure.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  85. </div>
  86. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  87. </span>
  88. </template>
  89. <!-- 如果还在上传或切图处理中 -->
  90. <template v-else-if="item.status = 'LOADING'">
  91. <span class="table-data">
  92. <div class="checkbox">
  93. <span class="for-outer-circle"></span>
  94. <span class="for-inner-circle disabled"></span>
  95. </div>
  96. </span>
  97. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  98. <div v-if="tableItemStructure.type=='image'" class="list-img">
  99. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  100. </div>
  101. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  102. <span v-if="tableItemStructure.key === 'fileSize' && item.ifKnowProgress">上传素材 {{Math.round(item.progress * 100)}}%</span>
  103. <span v-if="tableItemStructure.key === 'fileSize' && !item.ifKnowProgress">{{item.statusText}}</span>
  104. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  105. </span>
  106. </template>
  107. <!-- 如果上传失败了 -->
  108. <template v-else-if="item.status = 'FAIL'">
  109. <span class="table-data">
  110. <div class="checkbox">
  111. <span class="for-outer-circle"></span>
  112. <span class="for-inner-circle disabled"></span>
  113. </div>
  114. </span>
  115. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  116. <div v-if="tableItemStructure.type=='image'" class="list-img">
  117. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  118. </div>
  119. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  120. <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
  121. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  122. </span>
  123. </template>
  124. </div>
  125. <!-- 本组件内的列表数据 -->
  126. <div class="table-body-row" v-for="(item,i) in panoList" :key="i" @click="onClickRow">
  127. <span class="table-data">
  128. <RadioOrCheckbox
  129. class="checkbox"
  130. :isLightTheme="true"
  131. :isMultiSelection="isMultiSelection"
  132. :isCheckedInitial="select.some(i => i[primaryKey] === item[primaryKey])"
  133. @change="v => selectItem(item, v)"
  134. @click.native.stop
  135. />
  136. </span>
  137. <span class="table-data" v-for="(sub,idx) in tableHeadersForPano" :key="idx">
  138. <div v-if="sub.type=='image'" class="list-img">
  139. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  140. </div>
  141. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  142. </span>
  143. </div>
  144. </div>
  145. <!-- 无数据时的提示 -->
  146. <div v-if="panoList.length === 0 && !hasMorePanoData" class="no-data">
  147. <div v-if="latestUsedSearchKey">
  148. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  149. <span>{{'未搜索到结果~'}}</span>
  150. </div>
  151. <div v-if="!latestUsedSearchKey">
  152. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  153. <span>{{'暂无素材~'}}</span>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="table table-3D" v-show="currentMaterialType === '3D'">
  158. <div class="table-head-row">
  159. <span class="table-head">1</span>
  160. <span class="table-head" v-for="(item,i) in tableHeadersFor3D" :key="i">{{item.name}}</span>
  161. </div>
  162. <div
  163. v-if="scene3DList.length !== 0 || hasMore3DData"
  164. class="table-body"
  165. v-infinite-scroll="requestMorePanoData"
  166. :infinite-scroll-disabled="!hasMore3DData || isRequestingMore3DData"
  167. >
  168. <div class="table-body-row" v-for="(item,i) in scene3DList" :key="i">
  169. <span class="table-data">
  170. <RadioOrCheckbox
  171. class="checkbox"
  172. :isLightTheme="true"
  173. :isMultiSelection="isMultiSelection"
  174. :isCheckedInitial="select.some(i => i[primaryKey] === item[primaryKey])"
  175. @change="v => selectItem(item, v)"
  176. @click.native.stop
  177. />
  178. </span>
  179. <span class="table-data" v-for="(sub,idx) in tableHeadersFor3D" :key="idx">
  180. <div v-if="sub.type=='image'" class="list-img">
  181. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_20&${Math.random()}`" alt="">
  182. </div>
  183. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  184. </span>
  185. </div>
  186. </div>
  187. <!-- 无数据时的提示 -->
  188. <div v-if="scene3DList.length === 0 && !hasMore3DData" class="no-data">
  189. <div v-if="latestUsedSearchKey">
  190. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  191. <span>{{'未搜索到结果~'}}</span>
  192. </div>
  193. <div v-if="!latestUsedSearchKey">
  194. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  195. <span>{{'暂无素材~'}}</span>
  196. <a href="/#/">
  197. <button class="ui-button">如何拍摄三维场景</button>
  198. </a>
  199. </div>
  200. </div>
  201. </div>
  202. <div class="btns">
  203. <button v-if="currentMaterialType !== '3D'" class="ui-button upload-btn" @click="$refs['file-input'].click()">
  204. <span>上传素材</span>
  205. <i class="iconfont icon-material_prompt tool-tip-for-editor"
  206. v-tooltip="
  207. currentMaterialType === 'image' ? '请上传10MB以内、jpg/png格式的图片' :
  208. currentMaterialType === 'pano' ? '请上传2:1、120MB以内、jpg格式的图片' :
  209. currentMaterialType === 'audio' ? '请上传20MB以内、mp3格式的音频' :
  210. currentMaterialType === 'video' ? '请上传200MB以内、mp4格式的视频' : ''
  211. ">
  212. </i>
  213. <FileInput
  214. ref="file-input"
  215. :failString="fileInputFailString"
  216. :limitFailStr="fileInputLimitFailStr"
  217. :acceptType="fileInputAcceptType"
  218. :mediaType="fileInputMediaType"
  219. :limit="fileInputLimit"
  220. @file-change="onFileInputChange"
  221. ></FileInput>
  222. </button>
  223. <div v-else class="button-placeholder"></div>
  224. <div>
  225. <button class="ui-button cancel" @click="$emit('cancle')">取消</button>
  226. <button class="ui-button submit" :class="{disable: !select.length}" @click="$emit('submit', select)">
  227. 确定
  228. </button>
  229. </div>
  230. </div>
  231. </div>
  232. </template>
  233. <script>
  234. import { mapMutations } from "vuex";
  235. import {
  236. getMaterialList,
  237. getSceneList,
  238. uploadMaterial,
  239. checkMStatus,
  240. } from "@/api";
  241. import { getImgWH, changeByteUnit } from "@/utils/file";
  242. import config from "@/config";
  243. import { debounce } from "@/utils/other.js"
  244. import FileInput from "@/components/shared/uploads/UploadMultiple.vue";
  245. import { mapState } from "vuex";
  246. // import AudioIconCanPlay from "@/components/audio/indexForEditor.vue";
  247. import RadioOrCheckbox from "@/components/shared/RadioOrCheckbox.vue";
  248. export default {
  249. props:{
  250. title:{
  251. default:'',
  252. type:String
  253. },
  254. primaryKey: {
  255. default:'id'
  256. },
  257. selectableType: {
  258. type: Array,
  259. default: function() {
  260. return [
  261. 'image',
  262. 'pano',
  263. 'audio',
  264. 'video',
  265. '3D',
  266. ]
  267. },
  268. },
  269. initialMaterialType: {
  270. type: String,
  271. default: 'image',
  272. },
  273. isMultiSelection: {
  274. type: Boolean,
  275. default: false,
  276. },
  277. workId: {
  278. type: String,
  279. default: '',
  280. },
  281. },
  282. components:{
  283. FileInput,
  284. // AudioIconCanPlay,
  285. RadioOrCheckbox,
  286. },
  287. watch:{
  288. searchKey: {
  289. handler: function () {
  290. this.refreshMaterialList(this.currentMaterialType)
  291. },
  292. immediate: false,
  293. },
  294. currentMaterialType: {
  295. handler: function (newVal) {
  296. if (newVal === 'image' && this.imageList.length === 0) {
  297. this.refreshMaterialList('image')
  298. } else if (newVal === 'pano' && this.panoList.length === 0) {
  299. this.refreshMaterialList('pano')
  300. } else if (newVal === 'audio' && this.audioList.length === 0) {
  301. this.refreshMaterialList('audio')
  302. } else if (newVal === 'video' && this.videoList.length === 0) {
  303. this.refreshMaterialList('video')
  304. } else if (newVal === '3D' && this.scene3DList.length === 0) {
  305. this.refreshMaterialList('3D')
  306. }
  307. },
  308. immediate: false,
  309. },
  310. needLongPolling: {
  311. handler: function (newVal) {
  312. if (!newVal) {
  313. clearInterval(this.longPollingIntervalId)
  314. this.longPollingIntervalId = null
  315. } else {
  316. console.log('need long polling!');
  317. clearInterval(this.longPollingIntervalId)
  318. this.longPollingIntervalId = null
  319. this.longPollingIntervalId = setInterval(() => {
  320. this._checkMStatus();
  321. }, 3000);
  322. }
  323. },
  324. },
  325. },
  326. computed:{
  327. ...mapState({
  328. uploadStatusListAudio: 'uploadStatusListAudio',
  329. uploadStatusListImage: 'uploadStatusListImage',
  330. uploadStatusListPano: 'uploadStatusListPano',
  331. uploadStatusListVideo: 'uploadStatusListVideo',
  332. }),
  333. tableHeadersForImage() {
  334. return this.$MAPTABLEHEADER['image'].filter(item => {
  335. return ['icon', 'name', 'fileSize', 'dpi'].includes(item.key)
  336. })
  337. },
  338. tableHeadersForPano() {
  339. return this.$MAPTABLEHEADER['pano'].filter(item => {
  340. return ['icon', 'name', 'fileSize'].includes(item.key)
  341. })
  342. },
  343. tableHeadersForAudio() {
  344. return this.$MAPTABLEHEADER['audio'].filter(item => {
  345. return ['ossPath', 'name', 'fileSize'].includes(item.key)
  346. })
  347. },
  348. tableHeadersForVideo() {
  349. return this.$MAPTABLEHEADER['video'].filter(item => {
  350. return ['icon', 'name', 'fileSize'].includes(item.key)
  351. })
  352. },
  353. tableHeadersFor3D() {
  354. return this.$MAPTABLEHEADER['scene'].filter(item => {
  355. return ['thumb', 'sceneName', 'createTime'].includes(item.key)
  356. })
  357. },
  358. fileInputFailString() {
  359. let ret = ''
  360. switch (this.currentMaterialType) {
  361. case 'pano':
  362. ret = '格式错误,请上传2:1、120MB以内、jpg格式的全景图片'
  363. break;
  364. case 'image':
  365. ret = '格式错误,请上传10MB以内、jpg/png格式的图片'
  366. break;
  367. case 'audio':
  368. ret = '格式错误,请上传20MB以内、mp3格式的音频'
  369. break;
  370. case 'video':
  371. ret = '格式错误,请上传200MB以内、mp4格式的视频'
  372. break;
  373. default:
  374. break;
  375. }
  376. return ret
  377. },
  378. fileInputLimitFailStr() {
  379. let ret = ''
  380. switch (this.currentMaterialType) {
  381. case 'pano':
  382. ret = '过大,请上传2:1、120MB以内、jpg格式的全景图片'
  383. break;
  384. case 'image':
  385. ret = '过大,请上传10MB以内、jpg/png格式的图片'
  386. break;
  387. case 'audio':
  388. ret = '过大,请上传20MB以内、mp3格式的音频'
  389. break;
  390. case 'video':
  391. ret = '过大,请上传200MB以内、mp4格式的视频'
  392. break;
  393. default:
  394. break;
  395. }
  396. return ret
  397. },
  398. fileInputAcceptType() {
  399. let ret = ''
  400. switch (this.currentMaterialType) {
  401. case 'pano':
  402. ret = 'image/jpeg'
  403. break;
  404. case 'image':
  405. ret = 'image/png,image/jpeg'
  406. break;
  407. case 'audio':
  408. ret = 'audio/mp3'
  409. break;
  410. case 'video':
  411. ret = 'video/mp4'
  412. break;
  413. default:
  414. break;
  415. }
  416. return ret
  417. },
  418. fileInputMediaType() {
  419. let ret = ''
  420. switch (this.currentMaterialType) {
  421. case 'pano':
  422. ret = 'image'
  423. break;
  424. case 'image':
  425. ret = 'image'
  426. break;
  427. case 'audio':
  428. ret = 'audio'
  429. break;
  430. case 'video':
  431. ret = 'video'
  432. break;
  433. default:
  434. break;
  435. }
  436. return ret
  437. },
  438. fileInputLimit() {
  439. let ret
  440. switch (this.currentMaterialType) {
  441. case 'pano':
  442. ret = 120
  443. break;
  444. case 'image':
  445. ret = 10
  446. break;
  447. case 'audio':
  448. ret = 20
  449. break;
  450. case 'video':
  451. ret = 200
  452. break;
  453. default:
  454. break;
  455. }
  456. return ret
  457. },
  458. imageListRealLength() {
  459. return this.imageList.length + this.uploadStatusListImage.filter((item) => {
  460. return item.status === 'SUCCESS'
  461. }).length
  462. },
  463. panoListRealLength() {
  464. return this.panoList.length + this.uploadStatusListPano.filter((item) => {
  465. return item.status === 'SUCCESS'
  466. }).length
  467. },
  468. audioListRealLength() {
  469. return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
  470. return item.status === 'SUCCESS'
  471. }).length
  472. },
  473. videoListRealLength() {
  474. return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
  475. return item.status === 'SUCCESS'
  476. }).length
  477. },
  478. needLongPolling() {
  479. return this.uploadStatusListPano.some((item) => {
  480. return item.status === 'LOADING' && item.ifKnowProgress === false
  481. })
  482. },
  483. },
  484. data () {
  485. return {
  486. imageList: [],
  487. panoList: [],
  488. audioList: [],
  489. videoList: [],
  490. scene3DList: [],
  491. select: [],
  492. searchKey:'', // 搜索关键词
  493. latestUsedSearchKey: '',
  494. currentMaterialType: this.initialMaterialType,
  495. isRequestingMoreImageData: false,
  496. isRequestingMorePanoData: false,
  497. isRequestingMoreAudioData: false,
  498. isRequestingMoreVideoData: false,
  499. isRequestingMore3DData: false,
  500. hasMoreImageData: true,
  501. hasMorePanoData: true,
  502. hasMoreAudioData: true,
  503. hasMoreVideoData: true,
  504. hasMore3DData: true,
  505. longPollingIntervalId: null,
  506. }
  507. },
  508. methods: {
  509. ...mapMutations([
  510. 'clearUploadStatusLists',
  511. ]),
  512. selectItem(item, v) {
  513. item.materialType = this.currentMaterialType // 三维场景数据没有type字段来表明自己是三维场景。所以统一加一个字段。
  514. if (false) {
  515. // 对于图片,大于600kb的,压缩?
  516. } else {
  517. if (this.isMultiSelection) {
  518. if (v) {
  519. this.select.push(item)
  520. } else {
  521. const toDeleteIdx = this.select.findIndex((eachSelect) => {
  522. return eachSelect.id === item.id
  523. })
  524. if (toDeleteIdx >= 0) {
  525. this.select.splice(toDeleteIdx, 1)
  526. }
  527. }
  528. } else {
  529. if (v) {
  530. this.select = [item]
  531. } else {
  532. this.select = []
  533. }
  534. }
  535. }
  536. },
  537. requestMoreImageData() {
  538. this.isRequestingMoreImageData = true
  539. const latestUsedSearchKey = this.searchKey
  540. getMaterialList(
  541. {
  542. pageNum: Math.floor(this.imageListRealLength / config.PAGE_SIZE) + 1,
  543. pageSize: config.PAGE_SIZE,
  544. searchKey: this.searchKey,
  545. type: 'image',
  546. },
  547. (data) => {
  548. const newData = data.data.list.map((i) => {
  549. i.fileSize = changeByteUnit(Number(i.fileSize));
  550. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  551. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  552. return i;
  553. });
  554. this.imageList = this.imageList.concat(newData)
  555. if (this.imageListRealLength === data.data.total) {
  556. this.hasMoreImageData = false
  557. }
  558. this.isRequestingMoreImageData = false
  559. this.latestUsedSearchKey = latestUsedSearchKey
  560. },
  561. () => {
  562. this.isRequestingMoreImageData = false
  563. this.latestUsedSearchKey = latestUsedSearchKey
  564. }
  565. );
  566. },
  567. requestMorePanoData() {
  568. this.isRequestingMorePanoData = true
  569. const latestUsedSearchKey = this.searchKey
  570. getMaterialList(
  571. {
  572. pageNum: Math.floor(this.panoListRealLength / config.PAGE_SIZE) + 1,
  573. pageSize: config.PAGE_SIZE,
  574. searchKey: this.searchKey,
  575. type: 'pano',
  576. },
  577. (data) => {
  578. const newData = data.data.list.map((i) => {
  579. i.fileSize = changeByteUnit(Number(i.fileSize));
  580. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  581. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  582. return i;
  583. });
  584. this.panoList = this.panoList.concat(newData)
  585. if (this.panoListRealLength === data.data.total) {
  586. this.hasMorePanoData = false
  587. }
  588. this.isRequestingMorePanoData = false
  589. this.latestUsedSearchKey = latestUsedSearchKey
  590. },
  591. () => {
  592. this.isRequestingMorePanoData = false
  593. this.latestUsedSearchKey = latestUsedSearchKey
  594. }
  595. );
  596. },
  597. requestMoreAudioData() {
  598. this.isRequestingMoreAudioData = true
  599. const latestUsedSearchKey = this.searchKey
  600. getMaterialList(
  601. {
  602. pageNum: Math.floor(this.audioListRealLength / config.PAGE_SIZE) + 1,
  603. pageSize: config.PAGE_SIZE,
  604. searchKey: this.searchKey,
  605. type: 'audio',
  606. },
  607. (data) => {
  608. const newData = data.data.list.map((i) => {
  609. i.fileSize = changeByteUnit(Number(i.fileSize));
  610. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  611. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  612. return i;
  613. });
  614. this.audioList = this.audioList.concat(newData)
  615. if (this.audioListRealLength === data.data.total) {
  616. this.hasMoreAudioData = false
  617. }
  618. this.isRequestingMoreAudioData = false
  619. this.latestUsedSearchKey = latestUsedSearchKey
  620. },
  621. () => {
  622. this.isRequestingMoreAudioData = false
  623. this.latestUsedSearchKey = latestUsedSearchKey
  624. }
  625. );
  626. },
  627. requestMoreVideoData() {
  628. this.isRequestingMoreVideoData = true
  629. const latestUsedSearchKey = this.searchKey
  630. getMaterialList(
  631. {
  632. pageNum: Math.floor(this.videoListReallength / config.PAGE_SIZE) + 1,
  633. pageSize: config.PAGE_SIZE,
  634. searchKey: this.searchKey,
  635. type: 'video',
  636. },
  637. (data) => {
  638. const newData = data.data.list.map((i) => {
  639. i.fileSize = changeByteUnit(Number(i.fileSize));
  640. i.icon = i.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  641. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  642. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  643. return i;
  644. });
  645. this.videoList = this.videoList.concat(newData)
  646. if (this.videoListReallength === data.data.total) {
  647. this.hasMoreVideoData = false
  648. }
  649. this.isRequestingMoreVideoData = false
  650. this.latestUsedSearchKey = latestUsedSearchKey
  651. },
  652. () => {
  653. this.isRequestingMoreVideoData = false
  654. this.latestUsedSearchKey = latestUsedSearchKey
  655. }
  656. );
  657. },
  658. requestMore3DData() {
  659. this.isRequestingMore3DData = true
  660. const latestUsedSearchKey = this.searchKey
  661. getSceneList(
  662. {
  663. pageNum: Math.floor(this.scene3DList.length / config.PAGE_SIZE) + 1,
  664. pageSize: config.PAGE_SIZE,
  665. searchKey: this.searchKey,
  666. workId: this.workId,
  667. },
  668. (data) => {
  669. const newData = data.data.data.list.map((i) => {
  670. return i;
  671. });
  672. this.scene3DList = this.scene3DList.concat(newData)
  673. if (this.scene3DList.length === data.data.data.total) {
  674. this.hasMore3DData = false
  675. }
  676. this.isRequestingMore3DData = false
  677. this.latestUsedSearchKey = latestUsedSearchKey
  678. },
  679. () => {
  680. this.isRequestingMore3DData = false
  681. this.latestUsedSearchKey = latestUsedSearchKey
  682. }
  683. )
  684. },
  685. refreshMaterialList: debounce(function(type) {
  686. if (type === 'image') {
  687. this.isRequestingMoreImageData = false
  688. this.hasMoreImageData = true
  689. this.imageList = []
  690. let filterResult = this.uploadStatusListImage.filter((item) => {
  691. return item.status === 'LOADING'
  692. })
  693. this.$store.commit('setUploadStatusListImage', filterResult)
  694. this.requestMoreImageData()
  695. } else if (type === 'pano') {
  696. this.isRequestingMorePanoData = false
  697. this.hasMorePanoData = true
  698. this.panoList = []
  699. let filterResult = this.uploadStatusListPano.filter((item) => {
  700. return item.status === 'LOADING'
  701. })
  702. this.$store.commit('setUploadStatusListPano', filterResult)
  703. this.requestMorePanoData()
  704. } else if (type === 'audio') {
  705. this.isRequestingMoreAudioData = false
  706. this.hasMoreAudioData = true
  707. this.audioList = []
  708. let filterResult = this.uploadStatusListAudio.filter((item) => {
  709. return item.status === 'LOADING'
  710. })
  711. this.$store.commit('setUploadStatusListAudio', filterResult)
  712. this.requestMoreAudioData()
  713. } else if (type === 'video') {
  714. this.isRequestingMoreVideoData = false
  715. this.hasMoreVideoData = true
  716. this.videoList = []
  717. let filterResult = this.uploadStatusListVideo.filter((item) => {
  718. return item.status === 'LOADING'
  719. })
  720. this.$store.commit('setUploadStatusListVideo', filterResult)
  721. this.requestMoreVideoData()
  722. } else if (type === '3D') {
  723. this.isRequestingMore3DData = false
  724. this.hasMore3DData = true
  725. this.scene3DList = []
  726. this.requestMore3DData()
  727. }
  728. }, 700, false),
  729. onFileInputChange(e) {
  730. switch (this.currentMaterialType) {
  731. case 'pano':
  732. this.onPanoFileInputChange(e)
  733. break;
  734. case 'image':
  735. this.onImageFileInputChange(e)
  736. break;
  737. case 'audio':
  738. this.onAudioFileInputChange(e)
  739. break;
  740. case 'video':
  741. this.onVideoFileInputChange(e)
  742. break;
  743. default:
  744. break;
  745. }
  746. },
  747. onPanoFileInputChange(e) {
  748. e.files.forEach(async (eachFile, i) => {
  749. if (
  750. eachFile.type.indexOf("jpeg") <= -1
  751. ) {
  752. console.log('格式不对!');
  753. setTimeout(() => {
  754. this.$msg({
  755. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  756. type: "warning",
  757. });
  758. }, i * 100);
  759. return;
  760. }
  761. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  762. setTimeout(() => {
  763. this.$msg({
  764. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的全景图片`,
  765. type: "warning",
  766. });
  767. }, i * 100);
  768. return;
  769. }
  770. let WHRate = null
  771. try {
  772. const {width, height} = await getImgWH(eachFile)
  773. WHRate = width / height
  774. } catch(e) {
  775. console.error('获取图像宽高失败:', e)
  776. setTimeout(() => {
  777. this.$msg({
  778. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  779. type: "warning",
  780. });
  781. }, i * 100);
  782. return
  783. }
  784. if (WHRate !== 2) {
  785. setTimeout(() => {
  786. this.$msg({
  787. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  788. type: "warning",
  789. });
  790. }, i * 100);
  791. return
  792. }
  793. let itemInUploadList = {
  794. title: eachFile.name,
  795. ifKnowProgress: true,
  796. progress: 0,
  797. status: 'LOADING',
  798. statusText: "正在上传素材",
  799. uid: `u_${this.$randomWord(true, 8, 8)}`,
  800. abortHandler: null,
  801. backendId: '',
  802. };
  803. itemInUploadList.abortHandler = uploadMaterial(
  804. {
  805. file: eachFile
  806. },
  807. {
  808. type: 'pano',
  809. uid: itemInUploadList.uid,
  810. },
  811. (response) => { // 上传成功
  812. itemInUploadList.statusText = '正在切图处理'
  813. itemInUploadList.ifKnowProgress = false
  814. itemInUploadList.backendId = response.data.id
  815. },
  816. (err) => {
  817. if (err.statusText === 'abort') { // 用户取消了上传任务。
  818. console.log('用户取消了任务!');
  819. const index = this.uploadStatusListPano.findIndex((eachItem) => {
  820. return eachItem.uid === itemInUploadList.uid
  821. })
  822. this.uploadStatusListPano.splice(index, 1)
  823. } else {
  824. console.log('失败!');
  825. itemInUploadList.status = 'FAIL'
  826. itemInUploadList.statusText = '素材上传失败'
  827. }
  828. },
  829. (progress) => {
  830. console.log('进度:', progress);
  831. itemInUploadList.progress = progress
  832. }
  833. )
  834. this.uploadStatusListPano.unshift(itemInUploadList);
  835. })
  836. },
  837. onImageFileInputChange(e) {
  838. console.log('tableHeadersForImage: ', this.tableHeadersForImage);
  839. e.files.forEach((eachFile, i) => {
  840. if (
  841. eachFile.type.indexOf("jpeg") <= -1 &&
  842. eachFile.type.indexOf("png") <= -1
  843. ) {
  844. setTimeout(() => {
  845. this.$msg({
  846. message: `“${eachFile.name}”格式错误,请上传10MB以内、jpg/png格式的图片`,
  847. type: "warning",
  848. });
  849. }, i * 100);
  850. return;
  851. }
  852. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  853. setTimeout(() => {
  854. this.$msg({
  855. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的图片`,
  856. type: "warning",
  857. });
  858. }, i * 100);
  859. return;
  860. }
  861. let itemInUploadList = {
  862. title: eachFile.name,
  863. ifKnowProgress: true,
  864. progress: 0,
  865. status: 'LOADING',
  866. statusText: "正在上传素材",
  867. uid: `u_${this.$randomWord(true, 8, 8)}`,
  868. abortHandler: null,
  869. successInfo: null,
  870. };
  871. itemInUploadList.abortHandler = uploadMaterial(
  872. {
  873. file: eachFile
  874. },
  875. {
  876. type: 'image',
  877. uid: itemInUploadList.uid,
  878. },
  879. (result) => { // 上传成功
  880. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  881. return eachItem.uid === itemInUploadList.uid
  882. })
  883. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  884. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  885. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  886. this.uploadStatusListImage[index].status = 'SUCCESS'
  887. this.uploadStatusListImage[index].successInfo = result.data
  888. return i;
  889. },
  890. (err) => {
  891. if (err.statusText === 'abort') { // 用户取消了上传任务。
  892. console.log('用户取消了任务!');
  893. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  894. return eachItem.uid === itemInUploadList.uid
  895. })
  896. this.uploadStatusListImage.splice(index, 1)
  897. } else {
  898. console.log('失败!');
  899. itemInUploadList.status = 'FAIL'
  900. itemInUploadList.statusText = '素材上传失败'
  901. }
  902. },
  903. (progress) => {
  904. console.log('进度:', progress);
  905. itemInUploadList.progress = progress
  906. }
  907. );
  908. this.uploadStatusListImage.unshift(itemInUploadList);
  909. });
  910. },
  911. onAudioFileInputChange(e) {
  912. e.files.forEach((eachFile, i) => {
  913. if (eachFile.name.toLowerCase().indexOf("mp3") <= -1) {
  914. setTimeout(() => {
  915. this.$msg({
  916. message: `“${eachFile.name}”格式错误,请上传20MB以内、mp3格式的音频`,
  917. type: "warning",
  918. });
  919. }, i * 100);
  920. return;
  921. }
  922. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  923. setTimeout(() => {
  924. this.$msg({
  925. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的音频`,
  926. type: "warning",
  927. });
  928. }, i * 100);
  929. return;
  930. }
  931. let itemInUploadList = {
  932. title: eachFile.name,
  933. ifKnowProgress: true,
  934. progress: 0,
  935. status: 'LOADING',
  936. statusText: "正在上传素材",
  937. uid: `u_${this.$randomWord(true, 8, 8)}`,
  938. abortHandler: null,
  939. };
  940. itemInUploadList.abortHandler = uploadMaterial(
  941. {
  942. file: eachFile
  943. },
  944. {
  945. type: 'audio',
  946. uid: itemInUploadList.uid,
  947. },
  948. (result) => { // 上传成功
  949. console.log('success');
  950. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  951. return eachItem.uid === itemInUploadList.uid
  952. })
  953. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  954. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  955. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  956. this.uploadStatusListAudio[index].status = 'SUCCESS'
  957. this.uploadStatusListAudio[index].successInfo = result.data
  958. },
  959. (err) => {
  960. console.log('error');
  961. if (err.statusText === 'abort') { // 用户取消了上传任务。
  962. console.log('用户取消了');
  963. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  964. return eachItem.uid === itemInUploadList.uid
  965. })
  966. this.uploadStatusListAudio.splice(index, 1)
  967. } else {
  968. console.log('上传失败');
  969. itemInUploadList.status = 'FAIL'
  970. itemInUploadList.statusText = '素材上传失败'
  971. }
  972. },
  973. (progress) => {
  974. console.log('progress');
  975. itemInUploadList.progress = progress
  976. }
  977. );
  978. this.uploadStatusListAudio.unshift(itemInUploadList);
  979. });
  980. },
  981. onVideoFileInputChange(e) {
  982. e.files.forEach((eachFile, i) => {
  983. if (eachFile.name.toLowerCase().indexOf("mp4") <= -1) {
  984. setTimeout(() => {
  985. this.$msg({
  986. message: `“${eachFile.name}”格式错误,请上传200MB以内、mp4格式的视频`,
  987. type: "warning",
  988. });
  989. }, i * 100);
  990. return;
  991. }
  992. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  993. setTimeout(() => {
  994. this.$msg({
  995. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的视频`,
  996. type: "warning",
  997. });
  998. }, i * 100);
  999. return;
  1000. }
  1001. let itemInUploadList = {
  1002. title: eachFile.name,
  1003. ifKnowProgress: true,
  1004. progress: 0,
  1005. status: 'LOADING',
  1006. statusText: "正在上传素材",
  1007. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1008. abortHandler: null,
  1009. };
  1010. itemInUploadList.abortHandler = uploadMaterial(
  1011. {
  1012. file: eachFile
  1013. },
  1014. {
  1015. type: 'video',
  1016. uid: itemInUploadList.uid,
  1017. },
  1018. (result) => { // 上传成功
  1019. console.log('成功!');
  1020. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1021. return eachItem.uid === itemInUploadList.uid
  1022. })
  1023. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1024. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1025. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1026. result.data.icon = result.data.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  1027. this.uploadStatusListVideo[index].status = 'SUCCESS'
  1028. this.uploadStatusListVideo[index].successInfo = result.data
  1029. },
  1030. (err) => {
  1031. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1032. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1033. return eachItem.uid === itemInUploadList.uid
  1034. })
  1035. this.uploadStatusListVideo.splice(index, 1)
  1036. } else {
  1037. itemInUploadList.status = 'FAIL'
  1038. itemInUploadList.statusText = '素材上传失败'
  1039. }
  1040. },
  1041. (progress) => {
  1042. console.log('进度:', progress);
  1043. itemInUploadList.progress = progress
  1044. }
  1045. );
  1046. this.uploadStatusListVideo.unshift(itemInUploadList);
  1047. });
  1048. },
  1049. _checkMStatus() {
  1050. let needPollingTaskList = this.uploadStatusListPano.filter((item) => item.status === 'LOADING' && item.ifKnowProgress === false);
  1051. if (needPollingTaskList.length > 0) {
  1052. checkMStatus(
  1053. {
  1054. ids: needPollingTaskList.map((item) => item.backendId),
  1055. islongpolling: true,
  1056. },
  1057. (res) => {
  1058. // 1切图中,2失败,3成功
  1059. res.data.forEach(eachRes => {
  1060. if (eachRes.status === 2) {
  1061. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1062. if (index >= 0) {
  1063. const targetItem = this.uploadStatusListPano[index]
  1064. targetItem.status = 'FAIL'
  1065. targetItem.statusText = '素材切图失败'
  1066. targetItem.ifKnowProgress = true
  1067. }
  1068. } else if (eachRes.status === 3) {
  1069. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1070. if (index >= 0) {
  1071. const targetItem = this.uploadStatusListPano[index]
  1072. targetItem.status = 'SUCCESS'
  1073. eachRes.fileSize = changeByteUnit(Number(eachRes.fileSize));
  1074. targetItem.successInfo = eachRes
  1075. }
  1076. }
  1077. });
  1078. }
  1079. );
  1080. }
  1081. },
  1082. onClickRow(e) {
  1083. const checkboxNodeList = e.currentTarget.getElementsByClassName('selection-click-target')
  1084. if (checkboxNodeList && checkboxNodeList[0]) {
  1085. checkboxNodeList[0].click()
  1086. }
  1087. },
  1088. },
  1089. mounted() {
  1090. console.log('tableHeadersForAudio: ', this.tableHeadersForAudio);
  1091. console.log('tableHeadersForVideo: ', this.tableHeadersForVideo);
  1092. this.clearUploadStatusLists()
  1093. },
  1094. unmounted() {
  1095. this.$store.commit('setUploadStatusListImage', this.uploadStatusListImage.filter((item) => {
  1096. return item.status === 'LOADING'
  1097. }))
  1098. this.$store.commit('setUploadStatusListPano', this.uploadStatusListPano.filter((item) => {
  1099. return item.status === 'LOADING'
  1100. }))
  1101. this.$store.commit('setUploadStatusListAudio', this.uploadStatusListAudio.filter((item) => {
  1102. return item.status === 'LOADING'
  1103. }))
  1104. this.$store.commit('setUploadStatusListVideo', this.uploadStatusListVideo.filter((item) => {
  1105. return item.status === 'LOADING'
  1106. }))
  1107. }
  1108. }
  1109. </script>
  1110. <style lang="less" scoped>
  1111. .ellipsis{
  1112. text-overflow: ellipsis;
  1113. overflow: hidden;
  1114. white-space: nowrap;
  1115. width: 100%;
  1116. display: inline-block;
  1117. }
  1118. .table-select {
  1119. position: absolute;
  1120. z-index: 3;
  1121. left: 50%;
  1122. top: 50%;
  1123. transform: translateX(-50%) translateY(-50%);
  1124. width: 600px;
  1125. height: 730px;
  1126. border-radius: 4px;
  1127. border: 1px solid #EBEDF0;
  1128. padding: 26px;
  1129. background: #fff;
  1130. }
  1131. .title {
  1132. font-size: 18px;
  1133. color: #323233;
  1134. }
  1135. .close-btn {
  1136. display: inline-block;
  1137. position: absolute;
  1138. top: 26px;
  1139. right: 20px;
  1140. font-size: 12px;
  1141. color: #969799;
  1142. cursor: pointer;
  1143. padding: 6px;
  1144. }
  1145. .material-tab {
  1146. margin-top: 35px;
  1147. > .material-tab-item {
  1148. display: inline-block;
  1149. margin-right: 20px;
  1150. position: relative;
  1151. cursor: pointer;
  1152. > .text {
  1153. font-size: 14px;
  1154. font-family: MicrosoftYaHei;
  1155. color: #969799;
  1156. &.active {
  1157. color: #323233;
  1158. }
  1159. }
  1160. > .bottom-line {
  1161. position: absolute;
  1162. left: 50%;
  1163. transform: translateX(-50%);
  1164. bottom: -4px;
  1165. width: 16px;
  1166. height: 2px;
  1167. background: #0076F6;
  1168. border-radius: 1px;
  1169. }
  1170. }
  1171. }
  1172. .filter {
  1173. margin-top: 28px;
  1174. width: 100%;
  1175. height: 36px;
  1176. background: #F7F8FA;
  1177. border-radius: 2px;
  1178. border: 1px solid #EBEDF0;
  1179. position: relative;
  1180. > input {
  1181. box-sizing: border-box;
  1182. width: calc(100% - 42px);
  1183. height: 100%;
  1184. border: none;
  1185. padding-left: 16px;
  1186. background: transparent;
  1187. color: #323233;
  1188. outline: none;
  1189. }
  1190. > .search-icon {
  1191. position: absolute;
  1192. top: 50%;
  1193. transform: translateY(-50%);
  1194. right: 18px;
  1195. color: #C8C9CC;
  1196. font-size: 20px;
  1197. }
  1198. > .clear-icon {
  1199. position: absolute;
  1200. top: 50%;
  1201. transform: translateY(-50%);
  1202. right: 18px;
  1203. color: #C8C9CC;
  1204. font-size: 20px;
  1205. cursor: pointer;
  1206. }
  1207. }
  1208. @table-height: 440px;
  1209. @table-head-row-height: 40px;
  1210. @table-border-size: 1px;
  1211. .table {
  1212. margin-top: 20px;
  1213. border: @table-border-size solid #EBEDF0;
  1214. background: #ffffff;
  1215. width: 100%;
  1216. height: @table-height;
  1217. > .table-head-row {
  1218. width: 100%;
  1219. height: @table-head-row-height;
  1220. background: #F5F7FA;
  1221. color: #646566;
  1222. .table-head {
  1223. font-size: 16px;
  1224. line-height: @table-head-row-height;
  1225. height: 100%;
  1226. display: inline-block;
  1227. }
  1228. }
  1229. > .table-body {
  1230. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1231. overflow: auto;
  1232. display: inline-block;
  1233. width: 100%;
  1234. > .table-body-row {
  1235. height: 50px;
  1236. border-bottom: 1px solid #EBEDF0;
  1237. display: flex;
  1238. align-items: center;
  1239. cursor: pointer;
  1240. > .table-data {
  1241. font-size:14px;
  1242. line-height:50px;
  1243. height: 100%;
  1244. color: #323233;
  1245. > .list-img {
  1246. position: relative;
  1247. height: 100%;
  1248. display: inline-block;
  1249. width: 100%;
  1250. > img, .audio-player {
  1251. position: absolute;
  1252. top: 50%;
  1253. transform: translateY(-50%);
  1254. width: 40px;
  1255. height: 40px;
  1256. object-fit: cover;
  1257. }
  1258. }
  1259. }
  1260. }
  1261. }
  1262. > .no-data {
  1263. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1264. width: 100%;
  1265. position: relative;
  1266. > div {
  1267. position: absolute;
  1268. top: 50%;
  1269. left: 50%;
  1270. transform: translate(-50%, -50%);
  1271. text-align: center;
  1272. > img {
  1273. width: 116px;
  1274. }
  1275. > span {
  1276. margin-top: 20px;
  1277. display: block;
  1278. font-size: 14px;
  1279. color: rgba(255, 255, 255, 0.6);
  1280. }
  1281. > a {
  1282. > button {
  1283. margin-top: 20px;
  1284. }
  1285. }
  1286. }
  1287. }
  1288. }
  1289. .table-image .table-head,
  1290. .table-image .table-data {
  1291. &:nth-of-type(1) {
  1292. width: 50px;
  1293. color: transparent;
  1294. }
  1295. &:nth-of-type(2) {
  1296. width: calc(116px - 50px);
  1297. }
  1298. &:nth-of-type(3) {
  1299. width: calc(316px - 116px);
  1300. padding-right: 30px;
  1301. }
  1302. &:nth-of-type(4) {
  1303. width: calc(416px - 316px);
  1304. }
  1305. &:nth-of-type(5) {
  1306. width: calc(100% - 416px);
  1307. }
  1308. }
  1309. .table-pano .table-head,
  1310. .table-pano .table-data {
  1311. &:nth-of-type(1) {
  1312. width: 50px;
  1313. color: transparent;
  1314. }
  1315. &:nth-of-type(2) {
  1316. width: calc(116px - 50px);
  1317. }
  1318. &:nth-of-type(3) {
  1319. width: calc(416px - 116px);
  1320. padding-right: 30px;
  1321. }
  1322. &:nth-of-type(4) {
  1323. width: calc(100% - 416px);
  1324. }
  1325. }
  1326. .table-audio .table-head,
  1327. .table-audio .table-data {
  1328. &:nth-of-type(1) {
  1329. width: 50px;
  1330. color: transparent;
  1331. }
  1332. &:nth-of-type(2) {
  1333. width: calc(116px - 50px);
  1334. }
  1335. &:nth-of-type(3) {
  1336. width: calc(416px - 116px);
  1337. padding-right: 30px;
  1338. }
  1339. &:nth-of-type(4) {
  1340. width: calc(100% - 416px);
  1341. }
  1342. }
  1343. .table-video .table-head,
  1344. .table-video .table-data {
  1345. &:nth-of-type(1) {
  1346. width: 50px;
  1347. color: transparent;
  1348. }
  1349. &:nth-of-type(2) {
  1350. width: calc(116px - 50px);
  1351. }
  1352. &:nth-of-type(3) {
  1353. width: calc(416px - 116px);
  1354. padding-right: 30px;
  1355. }
  1356. &:nth-of-type(4) {
  1357. width: calc(100% - 416px);
  1358. }
  1359. }
  1360. .table-3D .table-head,
  1361. .table-3D .table-data {
  1362. &:nth-of-type(1) {
  1363. width: 50px;
  1364. color: transparent;
  1365. }
  1366. &:nth-of-type(2) {
  1367. width: calc(116px - 50px);
  1368. }
  1369. &:nth-of-type(3) {
  1370. width: calc(416px - 116px);
  1371. padding-right: 30px;
  1372. }
  1373. &:nth-of-type(4) {
  1374. width: calc(100% - 416px);
  1375. }
  1376. }
  1377. .checkbox {
  1378. width: 100%;
  1379. height: 100%;
  1380. }
  1381. .btns {
  1382. display: flex;
  1383. justify-content: space-between;
  1384. margin-top: 40px;
  1385. .upload-btn {
  1386. display: flex;
  1387. align-items: center;
  1388. > span {
  1389. display: inline-block;
  1390. margin-right: 4px;
  1391. }
  1392. i.tool-tip-for-editor {
  1393. font-size: 12px;
  1394. transform: scale(0.923) translateY(1px);
  1395. cursor: default;
  1396. }
  1397. }
  1398. > div {
  1399. .cancel {
  1400. margin-right: 16px;
  1401. }
  1402. }
  1403. }
  1404. </style>