materialSelectorForEditor.vue 68 KB

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