materialSelectorForEditor.vue 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920
  1. <template>
  2. <div class="table-select">
  3. <span class="title">{{title}}</span>
  4. <div class="close-btn"><i class="iconfont icon-pop-ups_shut-down" @click="$emit('cancle')"></i></div>
  5. <div class="material-tab">
  6. <a v-if="selectableType.includes('image')" class="material-tab-item" @click.prevent="currentMaterialType = 'image'">
  7. <span class="text">图片</span>
  8. <div v-if="currentMaterialType === 'image'" class="bottom-line"></div>
  9. </a>
  10. <a v-if="selectableType.includes('pano')" class="material-tab-item" @click.prevent="currentMaterialType = 'pano'">
  11. <span class="text">全景图</span>
  12. <div v-if="currentMaterialType === 'pano'" class="bottom-line"></div>
  13. </a>
  14. <a v-if="selectableType.includes('audio')" class="material-tab-item" @click.prevent="currentMaterialType = 'audio'">
  15. <span class="text">音频</span>
  16. <div v-if="currentMaterialType === 'audio'" class="bottom-line"></div>
  17. </a>
  18. <a v-if="selectableType.includes('video')" class="material-tab-item" @click.prevent="currentMaterialType = 'video'">
  19. <span class="text">视频</span>
  20. <div v-if="currentMaterialType === 'video'" class="bottom-line"></div>
  21. </a>
  22. <a v-if="selectableType.includes('3D')" class="material-tab-item" @click.prevent="currentMaterialType = '3D'">
  23. <span class="text">三维场景</span>
  24. <div v-if="currentMaterialType === '3D'" class="bottom-line"></div>
  25. </a>
  26. </div>
  27. <div class="filter">
  28. <input type="text" placeholder="输入关键词" v-model="searchKey"/>
  29. <i v-if="!searchKey" class="iconfont icon-editor_search search-icon"/>
  30. <i v-if="searchKey" @click="searchKey=''" class="iconfont icontoast_red clear-icon"></i>
  31. </div>
  32. <div class="table table-image" v-show="currentMaterialType === 'image'">
  33. <div class="table-head-row">
  34. <span class="table-head nothing" v-if="!isMultiSelection">1</span>
  35. <span class="table-head select-all-checkbox-wrapper" v-if="isMultiSelection">
  36. <div v-show="!isAllSelected" class="unchecked" @click="onSelectAll"></div>
  37. <img v-show="isAllSelected" class="checked" @click="onUnselectAll" src="@/assets/images/icons/checkbox.png" />
  38. </span>
  39. <span class="table-head" v-for="(item,i) in tableHeadersForImage" :key="i">{{item.name}}</span>
  40. </div>
  41. <div
  42. v-if="imageListRealLength !== 0 || hasMoreImageData"
  43. class="table-body"
  44. v-infinite-scroll="requestMoreImageData"
  45. :infinite-scroll-disabled="!hasMoreImageData || isRequestingMoreImageData"
  46. >
  47. <!-- vuex中的上传中数据 -->
  48. <div class="table-body-row" v-for="(item, i) in uploadStatusListImage" :key="item.uid">
  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] + `?x-oss-process=image/resize,p_10&${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">
  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] + `?x-oss-process=image/resize,p_10&${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="panoListRealLength !== 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">
  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] + `?x-oss-process=image/resize,p_10&${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">
  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] + `?x-oss-process=image/resize,p_10&${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-if="panoList.length === 0 && !hasMorePanoData" 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="audioListRealLength !== 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">
  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="icon"
  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">
  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-if="audioList.length === 0 && !hasMoreAudioData" 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="videoListRealLength !== 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">
  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">
  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-if="videoList.length === 0 && !hasMoreVideoData" 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="requestMorePanoData"
  483. :infinite-scroll-disabled="!hasMore3DData || isRequestingMore3DData"
  484. >
  485. <div class="table-body-row" v-for="(item,i) in scene3DList" :key="i">
  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] + `?x-oss-process=image/resize,p_10&${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-if="scene3DList.length === 0 && !hasMore3DData" 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="$refs['file-input'].click()">
  519. <span>上传素材</span>
  520. <i class="iconfont icon-material_prompt tool-tip-for-editor"
  521. v-tooltip="
  522. currentMaterialType === 'image' ? '请上传10MB以内、jpg/png格式的图片' :
  523. currentMaterialType === 'pano' ? '请上传2:1、120MB以内、jpg格式的图片' :
  524. currentMaterialType === 'audio' ? '请上传20MB以内、mp3格式的音频' :
  525. currentMaterialType === 'video' ? '请上传200MB以内、mp4格式的视频' : ''
  526. ">
  527. </i>
  528. <FileInput
  529. ref="file-input"
  530. :failString="fileInputFailString"
  531. :limitFailStr="fileInputLimitFailStr"
  532. :acceptType="fileInputAcceptType"
  533. :mediaType="fileInputMediaType"
  534. :limit="fileInputLimit"
  535. @file-change="onFileInputChange"
  536. ></FileInput>
  537. </button>
  538. <div v-else class="button-placeholder"></div>
  539. <div>
  540. <button class="ui-button deepcancel" @click="$emit('cancle')">取消</button>
  541. <button class="ui-button submit" :class="{disable: !select.length}" @click="$emit('submit', select)">
  542. 确定
  543. </button>
  544. </div>
  545. </div>
  546. </div>
  547. </template>
  548. <script>
  549. import {
  550. getMaterialList,
  551. getSceneList,
  552. uploadMaterial,
  553. checkMStatus,
  554. } from "@/api";
  555. import { getImgWH, changeByteUnit } from "@/utils/file";
  556. import config from "@/config";
  557. import { debounce } from "@/utils/other.js"
  558. import FileInput from "@/components/shared/uploads/UploadMultiple.vue";
  559. import { mapState } from "vuex";
  560. import AudioIconCanPlay from "@/components/audio/indexForEditor.vue";
  561. import RadioOrCheckbox from "@/components/shared/RadioOrCheckbox.vue";
  562. export default {
  563. props:{
  564. title:{
  565. default:'',
  566. type:String
  567. },
  568. primaryKey: {
  569. default:'id'
  570. },
  571. selectableType: {
  572. type: Array,
  573. default: function() {
  574. return [
  575. 'image',
  576. 'pano',
  577. 'audio',
  578. 'video',
  579. '3D',
  580. ]
  581. },
  582. },
  583. initialMaterialType: {
  584. type: String,
  585. default: 'image',
  586. },
  587. isMultiSelection: {
  588. type: Boolean,
  589. default: false,
  590. }
  591. },
  592. components:{
  593. FileInput,
  594. AudioIconCanPlay,
  595. RadioOrCheckbox
  596. },
  597. watch:{
  598. searchKey: {
  599. handler: function () {
  600. this.refreshMaterialList(this.currentMaterialType)
  601. },
  602. immediate: false,
  603. },
  604. currentMaterialType: {
  605. handler: function (newVal) {
  606. if (newVal === 'image' && this.imageList.length === 0) {
  607. this.refreshMaterialList('image')
  608. } else if (newVal === 'pano' && this.panoList.length === 0) {
  609. this.refreshMaterialList('pano')
  610. } else if (newVal === 'audio' && this.audioList.length === 0) {
  611. this.refreshMaterialList('audio')
  612. } else if (newVal === 'video' && this.videoList.length === 0) {
  613. this.refreshMaterialList('video')
  614. } else if (newVal === '3D' && this.scene3DList.length === 0) {
  615. this.refreshMaterialList('3D')
  616. }
  617. },
  618. immediate: false,
  619. },
  620. needLongPolling: {
  621. handler: function (newVal) {
  622. if (!newVal) {
  623. clearInterval(this.longPollingIntervalId)
  624. this.longPollingIntervalId = null
  625. } else {
  626. console.log('need long polling!');
  627. clearInterval(this.longPollingIntervalId)
  628. this.longPollingIntervalId = null
  629. this.longPollingIntervalId = setInterval(() => {
  630. this._checkMStatus();
  631. }, 3000);
  632. }
  633. },
  634. },
  635. },
  636. computed:{
  637. ...mapState({
  638. uploadStatusListAudio: 'uploadStatusListAudio',
  639. uploadStatusListImage: 'uploadStatusListImage',
  640. uploadStatusListPano: 'uploadStatusListPano',
  641. uploadStatusListVideo: 'uploadStatusListVideo',
  642. }),
  643. tableHeadersForImage() {
  644. return this.$MAPTABLEHEADER['image'].filter(item => {
  645. return ['icon', 'name', 'fileSize', 'dpi'].includes(item.key)
  646. })
  647. },
  648. tableHeadersForPano() {
  649. return this.$MAPTABLEHEADER['pano'].filter(item => {
  650. return ['icon', 'name', 'fileSize'].includes(item.key)
  651. })
  652. },
  653. tableHeadersForAudio() {
  654. return this.$MAPTABLEHEADER['audio'].filter(item => {
  655. return ['ossPath', 'name', 'fileSize'].includes(item.key)
  656. })
  657. },
  658. tableHeadersForVideo() {
  659. return this.$MAPTABLEHEADER['video'].filter(item => {
  660. return ['icon', 'name', 'fileSize'].includes(item.key)
  661. })
  662. },
  663. tableHeadersFor3D() {
  664. return this.$MAPTABLEHEADER['scene'].filter(item => {
  665. return ['thumb', 'sceneName', 'createTime'].includes(item.key)
  666. })
  667. },
  668. fileInputFailString() {
  669. let ret = ''
  670. switch (this.currentMaterialType) {
  671. case 'pano':
  672. ret = '格式错误,请上传2:1、120MB以内、jpg格式的全景图片'
  673. break;
  674. case 'image':
  675. ret = '格式错误,请上传10MB以内、jpg/png格式的图片'
  676. break;
  677. case 'audio':
  678. ret = '格式错误,请上传20MB以内、mp3格式的音频'
  679. break;
  680. case 'video':
  681. ret = '格式错误,请上传200MB以内、mp4格式的视频'
  682. break;
  683. default:
  684. break;
  685. }
  686. return ret
  687. },
  688. fileInputLimitFailStr() {
  689. let ret = ''
  690. switch (this.currentMaterialType) {
  691. case 'pano':
  692. ret = '过大,请上传2:1、120MB以内、jpg格式的全景图片'
  693. break;
  694. case 'image':
  695. ret = '过大,请上传10MB以内、jpg/png格式的图片'
  696. break;
  697. case 'audio':
  698. ret = '过大,请上传20MB以内、mp3格式的音频'
  699. break;
  700. case 'video':
  701. ret = '过大,请上传200MB以内、mp4格式的视频'
  702. break;
  703. default:
  704. break;
  705. }
  706. return ret
  707. },
  708. fileInputAcceptType() {
  709. let ret = ''
  710. switch (this.currentMaterialType) {
  711. case 'pano':
  712. ret = 'image/jpeg'
  713. break;
  714. case 'image':
  715. ret = 'image/png,image/jpeg'
  716. break;
  717. case 'audio':
  718. ret = 'audio/mp3'
  719. break;
  720. case 'video':
  721. ret = 'video/mp4'
  722. break;
  723. default:
  724. break;
  725. }
  726. return ret
  727. },
  728. fileInputMediaType() {
  729. let ret = ''
  730. switch (this.currentMaterialType) {
  731. case 'pano':
  732. ret = 'image'
  733. break;
  734. case 'image':
  735. ret = 'image'
  736. break;
  737. case 'audio':
  738. ret = 'audio'
  739. break;
  740. case 'video':
  741. ret = 'video'
  742. break;
  743. default:
  744. break;
  745. }
  746. return ret
  747. },
  748. fileInputLimit() {
  749. let ret
  750. switch (this.currentMaterialType) {
  751. case 'pano':
  752. ret = 120
  753. break;
  754. case 'image':
  755. ret = 10
  756. break;
  757. case 'audio':
  758. ret = 20
  759. break;
  760. case 'video':
  761. ret = 200
  762. break;
  763. default:
  764. break;
  765. }
  766. return ret
  767. },
  768. imageListRealLength() {
  769. return this.imageList.length + this.uploadStatusListImage.filter((item) => {
  770. return item.status === 'SUCCESS'
  771. }).length
  772. },
  773. panoListRealLength() {
  774. return this.imageList.length + this.uploadStatusListPano.filter((item) => {
  775. return item.status === 'SUCCESS'
  776. }).length
  777. },
  778. audioListRealLength() {
  779. return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
  780. return item.status === 'SUCCESS'
  781. }).length
  782. },
  783. videoListRealLength() {
  784. return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
  785. return item.status === 'SUCCESS'
  786. }).length
  787. },
  788. needLongPolling() {
  789. return this.uploadStatusListPano.some((item) => {
  790. return item.status === 'LOADING' && item.ifKnowProgress === false
  791. })
  792. },
  793. isAllSelected() {
  794. let ret = false
  795. switch (this.currentMaterialType) {
  796. case 'image':
  797. ret = this.select.length === this.imageListRealLength && this.select.length !== 0
  798. break;
  799. case 'pano':
  800. ret = this.select.length === this.panoListRealLength && this.select.length !== 0
  801. break;
  802. case 'audio':
  803. ret = this.select.length === this.audioListRealLength && this.select.length !== 0
  804. break;
  805. case 'video':
  806. ret = this.select.length === this.videoListRealLength && this.select.length !== 0
  807. break;
  808. case '3D':
  809. ret = this.select.length === this.scene3DList.length && this.select.length !== 0
  810. break;
  811. default:
  812. break;
  813. }
  814. return ret
  815. }
  816. },
  817. data () {
  818. return {
  819. imageList: [],
  820. panoList: [],
  821. audioList: [],
  822. videoList: [],
  823. scene3DList: [],
  824. select: [],
  825. searchKey:'', // 搜索关键词
  826. latestUsedSearchKey: '',
  827. currentMaterialType: this.initialMaterialType,
  828. isRequestingMoreImageData: false,
  829. isRequestingMorePanoData: false,
  830. isRequestingMoreAudioData: false,
  831. isRequestingMoreVideoData: false,
  832. isRequestingMore3DData: false,
  833. hasMoreImageData: true,
  834. hasMorePanoData: true,
  835. hasMoreAudioData: true,
  836. hasMoreVideoData: true,
  837. hasMore3DData: true,
  838. longPollingIntervalId: null,
  839. }
  840. },
  841. methods: {
  842. selectItem(item, v) {
  843. item.materialType = this.currentMaterialType // 三维场景数据没有type字段来表明自己是三维场景。所以统一加一个字段。
  844. if (false) {
  845. // 对于图片,大于600kb的,压缩?
  846. } else {
  847. if (this.isMultiSelection) {
  848. if (v) {
  849. this.select.push(item)
  850. } else {
  851. const toDeleteIdx = this.select.findIndex((eachSelect) => {
  852. return eachSelect.id === item.id
  853. })
  854. if (toDeleteIdx >= 0) {
  855. this.select.splice(toDeleteIdx, 1)
  856. }
  857. }
  858. } else {
  859. if (v) {
  860. this.select = [item]
  861. } else {
  862. this.select = []
  863. }
  864. }
  865. }
  866. },
  867. requestMoreImageData() {
  868. this.isRequestingMoreImageData = true
  869. const latestUsedSearchKey = this.searchKey
  870. getMaterialList(
  871. {
  872. pageNum: Math.floor(this.imageListRealLength / config.PAGE_SIZE) + 1,
  873. pageSize: config.PAGE_SIZE,
  874. searchKey: this.searchKey,
  875. type: 'image',
  876. },
  877. (data) => {
  878. const newData = data.data.list.map((i) => {
  879. i.fileSize = changeByteUnit(Number(i.fileSize));
  880. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  881. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  882. return i;
  883. });
  884. this.imageList = this.imageList.concat(newData)
  885. if (this.imageListRealLength === data.data.total) {
  886. this.hasMoreImageData = false
  887. }
  888. this.isRequestingMoreImageData = false
  889. this.latestUsedSearchKey = latestUsedSearchKey
  890. },
  891. () => {
  892. this.isRequestingMoreImageData = false
  893. this.latestUsedSearchKey = latestUsedSearchKey
  894. }
  895. );
  896. },
  897. requestMorePanoData() {
  898. this.isRequestingMorePanoData = true
  899. const latestUsedSearchKey = this.searchKey
  900. getMaterialList(
  901. {
  902. pageNum: Math.floor(this.panoListRealLength / config.PAGE_SIZE) + 1,
  903. pageSize: config.PAGE_SIZE,
  904. searchKey: this.searchKey,
  905. type: 'pano',
  906. },
  907. (data) => {
  908. const newData = data.data.list.map((i) => {
  909. i.fileSize = changeByteUnit(Number(i.fileSize));
  910. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  911. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  912. return i;
  913. });
  914. this.panoList = this.panoList.concat(newData)
  915. if (this.panoListRealLength === data.data.total) {
  916. this.hasMorePanoData = false
  917. }
  918. this.isRequestingMorePanoData = false
  919. this.latestUsedSearchKey = latestUsedSearchKey
  920. },
  921. () => {
  922. this.isRequestingMorePanoData = false
  923. this.latestUsedSearchKey = latestUsedSearchKey
  924. }
  925. );
  926. },
  927. requestMoreAudioData() {
  928. this.isRequestingMoreAudioData = true
  929. const latestUsedSearchKey = this.searchKey
  930. getMaterialList(
  931. {
  932. pageNum: Math.floor(this.audioListRealLength / config.PAGE_SIZE) + 1,
  933. pageSize: config.PAGE_SIZE,
  934. searchKey: this.searchKey,
  935. type: 'audio',
  936. },
  937. (data) => {
  938. const newData = data.data.list.map((i) => {
  939. i.fileSize = changeByteUnit(Number(i.fileSize));
  940. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  941. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  942. return i;
  943. });
  944. this.audioList = this.audioList.concat(newData)
  945. if (this.audioListRealLength === data.data.total) {
  946. this.hasMoreAudioData = false
  947. }
  948. this.isRequestingMoreAudioData = false
  949. this.latestUsedSearchKey = latestUsedSearchKey
  950. },
  951. () => {
  952. this.isRequestingMoreAudioData = false
  953. this.latestUsedSearchKey = latestUsedSearchKey
  954. }
  955. );
  956. },
  957. requestMoreVideoData() {
  958. this.isRequestingMoreVideoData = true
  959. const latestUsedSearchKey = this.searchKey
  960. getMaterialList(
  961. {
  962. pageNum: Math.floor(this.videoListReallength / config.PAGE_SIZE) + 1,
  963. pageSize: config.PAGE_SIZE,
  964. searchKey: this.searchKey,
  965. type: 'video',
  966. },
  967. (data) => {
  968. const newData = data.data.list.map((i) => {
  969. i.fileSize = changeByteUnit(Number(i.fileSize));
  970. i.icon = i.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  971. i.createTime = i.createTime.substring(0, i.createTime.length - 3)
  972. i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
  973. return i;
  974. });
  975. this.videoList = this.videoList.concat(newData)
  976. if (this.videoListReallength === data.data.total) {
  977. this.hasMoreVideoData = false
  978. }
  979. this.isRequestingMoreVideoData = false
  980. this.latestUsedSearchKey = latestUsedSearchKey
  981. },
  982. () => {
  983. this.isRequestingMoreVideoData = false
  984. this.latestUsedSearchKey = latestUsedSearchKey
  985. }
  986. );
  987. },
  988. requestMore3DData() {
  989. this.isRequestingMore3DData = true
  990. const latestUsedSearchKey = this.searchKey
  991. getSceneList(
  992. {
  993. pageNum: Math.floor(this.scene3DList.length / config.PAGE_SIZE) + 1,
  994. pageSize: config.PAGE_SIZE,
  995. searchKey: this.searchKey,
  996. },
  997. (data) => {
  998. const newData = data.data.data.list.map((i) => {
  999. return i;
  1000. });
  1001. this.scene3DList = this.scene3DList.concat(newData)
  1002. if (this.scene3DList.length === data.data.data.total) {
  1003. this.hasMore3DData = false
  1004. }
  1005. this.isRequestingMore3DData = false
  1006. this.latestUsedSearchKey = latestUsedSearchKey
  1007. },
  1008. () => {
  1009. this.isRequestingMore3DData = false
  1010. this.latestUsedSearchKey = latestUsedSearchKey
  1011. }
  1012. )
  1013. },
  1014. refreshMaterialList: debounce(function(type) {
  1015. if (type === 'image') {
  1016. this.isRequestingMoreImageData = false
  1017. this.hasMoreImageData = true
  1018. this.imageList = []
  1019. let filterResult = this.uploadStatusListImage.filter((item) => {
  1020. return item.status === 'LOADING'
  1021. })
  1022. this.$store.commit('setUploadStatusListImage', filterResult)
  1023. this.requestMoreImageData()
  1024. } else if (type === 'pano') {
  1025. this.isRequestingMorePanoData = false
  1026. this.hasMorePanoData = true
  1027. this.panoList = []
  1028. let filterResult = this.uploadStatusListPano.filter((item) => {
  1029. return item.status === 'LOADING'
  1030. })
  1031. this.$store.commit('setUploadStatusListPano', filterResult)
  1032. this.requestMorePanoData()
  1033. } else if (type === 'audio') {
  1034. this.isRequestingMoreAudioData = false
  1035. this.hasMoreAudioData = true
  1036. this.audioList = []
  1037. let filterResult = this.uploadStatusListAudio.filter((item) => {
  1038. return item.status === 'LOADING'
  1039. })
  1040. this.$store.commit('setUploadStatusListAudio', filterResult)
  1041. this.requestMoreAudioData()
  1042. } else if (type === 'video') {
  1043. this.isRequestingMoreVideoData = false
  1044. this.hasMoreVideoData = true
  1045. this.videoList = []
  1046. let filterResult = this.uploadStatusListVideo.filter((item) => {
  1047. return item.status === 'LOADING'
  1048. })
  1049. this.$store.commit('setUploadStatusListVideo', filterResult)
  1050. this.requestMoreVideoData()
  1051. } else if (type === '3D') {
  1052. this.isRequestingMore3DData = false
  1053. this.hasMore3DData = true
  1054. this.scene3DList = []
  1055. this.requestMore3DData()
  1056. }
  1057. }, 700, false),
  1058. onFileInputChange(e) {
  1059. switch (this.currentMaterialType) {
  1060. case 'pano':
  1061. this.onPanoFileInputChange(e)
  1062. break;
  1063. case 'image':
  1064. this.onImageFileInputChange(e)
  1065. break;
  1066. case 'audio':
  1067. this.onAudioFileInputChange(e)
  1068. break;
  1069. case 'video':
  1070. this.onVideoFileInputChange(e)
  1071. break;
  1072. default:
  1073. break;
  1074. }
  1075. },
  1076. onPanoFileInputChange(e) {
  1077. e.files.forEach(async (eachFile, i) => {
  1078. if (
  1079. eachFile.type.indexOf("jpeg") <= -1
  1080. ) {
  1081. console.log('格式不对!');
  1082. setTimeout(() => {
  1083. this.$msg({
  1084. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1085. type: "warning",
  1086. });
  1087. }, i * 100);
  1088. return;
  1089. }
  1090. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1091. setTimeout(() => {
  1092. this.$msg({
  1093. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的全景图片`,
  1094. type: "warning",
  1095. });
  1096. }, i * 100);
  1097. return;
  1098. }
  1099. let WHRate = null
  1100. try {
  1101. const {width, height} = await getImgWH(eachFile)
  1102. WHRate = width / height
  1103. } catch(e) {
  1104. console.error('获取图像宽高失败:', e)
  1105. setTimeout(() => {
  1106. this.$msg({
  1107. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1108. type: "warning",
  1109. });
  1110. }, i * 100);
  1111. return
  1112. }
  1113. if (WHRate !== 2) {
  1114. setTimeout(() => {
  1115. this.$msg({
  1116. message: `“${eachFile.name}”格式错误,请上传2:1、120MB以内、jpg格式的全景图片`,
  1117. type: "warning",
  1118. });
  1119. }, i * 100);
  1120. return
  1121. }
  1122. let itemInUploadList = {
  1123. title: eachFile.name,
  1124. ifKnowProgress: true,
  1125. progress: 0,
  1126. status: 'LOADING',
  1127. statusText: "正在上传素材",
  1128. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1129. abortHandler: null,
  1130. backendId: '',
  1131. };
  1132. itemInUploadList.abortHandler = uploadMaterial(
  1133. {
  1134. file: eachFile
  1135. },
  1136. {
  1137. type: 'pano',
  1138. uid: itemInUploadList.uid,
  1139. },
  1140. (response) => { // 上传成功
  1141. itemInUploadList.statusText = '正在切图处理'
  1142. itemInUploadList.ifKnowProgress = false
  1143. itemInUploadList.backendId = response.data.id
  1144. },
  1145. (err) => {
  1146. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1147. console.log('用户取消了任务!');
  1148. const index = this.uploadStatusListPano.findIndex((eachItem) => {
  1149. return eachItem.uid === itemInUploadList.uid
  1150. })
  1151. this.uploadStatusListPano.splice(index, 1)
  1152. } else {
  1153. console.log('失败!');
  1154. itemInUploadList.status = 'FAIL'
  1155. itemInUploadList.statusText = '素材上传失败'
  1156. }
  1157. },
  1158. (progress) => {
  1159. console.log('进度:', progress);
  1160. itemInUploadList.progress = progress
  1161. }
  1162. )
  1163. this.uploadStatusListPano.unshift(itemInUploadList);
  1164. })
  1165. },
  1166. onImageFileInputChange(e) {
  1167. console.log('tableHeadersForImage: ', this.tableHeadersForImage);
  1168. e.files.forEach((eachFile, i) => {
  1169. if (
  1170. eachFile.type.indexOf("jpeg") <= -1 &&
  1171. eachFile.type.indexOf("png") <= -1
  1172. ) {
  1173. setTimeout(() => {
  1174. this.$msg({
  1175. message: `“${eachFile.name}”格式错误,请上传10MB以内、jpg/png格式的图片`,
  1176. type: "warning",
  1177. });
  1178. }, i * 100);
  1179. return;
  1180. }
  1181. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1182. setTimeout(() => {
  1183. this.$msg({
  1184. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的图片`,
  1185. type: "warning",
  1186. });
  1187. }, i * 100);
  1188. return;
  1189. }
  1190. let itemInUploadList = {
  1191. title: eachFile.name,
  1192. ifKnowProgress: true,
  1193. progress: 0,
  1194. status: 'LOADING',
  1195. statusText: "正在上传素材",
  1196. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1197. abortHandler: null,
  1198. successInfo: null,
  1199. };
  1200. itemInUploadList.abortHandler = uploadMaterial(
  1201. {
  1202. file: eachFile
  1203. },
  1204. {
  1205. type: 'image',
  1206. uid: itemInUploadList.uid,
  1207. },
  1208. (result) => { // 上传成功
  1209. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  1210. return eachItem.uid === itemInUploadList.uid
  1211. })
  1212. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1213. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1214. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1215. this.uploadStatusListImage[index].status = 'SUCCESS'
  1216. this.uploadStatusListImage[index].successInfo = result.data
  1217. return i;
  1218. },
  1219. (err) => {
  1220. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1221. console.log('用户取消了任务!');
  1222. const index = this.uploadStatusListImage.findIndex((eachItem) => {
  1223. return eachItem.uid === itemInUploadList.uid
  1224. })
  1225. this.uploadStatusListImage.splice(index, 1)
  1226. } else {
  1227. console.log('失败!');
  1228. itemInUploadList.status = 'FAIL'
  1229. itemInUploadList.statusText = '素材上传失败'
  1230. }
  1231. },
  1232. (progress) => {
  1233. console.log('进度:', progress);
  1234. itemInUploadList.progress = progress
  1235. }
  1236. );
  1237. this.uploadStatusListImage.unshift(itemInUploadList);
  1238. });
  1239. },
  1240. onAudioFileInputChange(e) {
  1241. e.files.forEach((eachFile, i) => {
  1242. if (eachFile.name.toLowerCase().indexOf("mp3") <= -1) {
  1243. setTimeout(() => {
  1244. this.$msg({
  1245. message: `“${eachFile.name}”格式错误,请上传20MB以内、mp3格式的音频`,
  1246. type: "warning",
  1247. });
  1248. }, i * 100);
  1249. return;
  1250. }
  1251. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1252. setTimeout(() => {
  1253. this.$msg({
  1254. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的音频`,
  1255. type: "warning",
  1256. });
  1257. }, i * 100);
  1258. return;
  1259. }
  1260. let itemInUploadList = {
  1261. title: eachFile.name,
  1262. ifKnowProgress: true,
  1263. progress: 0,
  1264. status: 'LOADING',
  1265. statusText: "正在上传素材",
  1266. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1267. abortHandler: null,
  1268. };
  1269. itemInUploadList.abortHandler = uploadMaterial(
  1270. {
  1271. file: eachFile
  1272. },
  1273. {
  1274. type: 'audio',
  1275. uid: itemInUploadList.uid,
  1276. },
  1277. (result) => { // 上传成功
  1278. console.log('success');
  1279. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  1280. return eachItem.uid === itemInUploadList.uid
  1281. })
  1282. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1283. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1284. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1285. this.uploadStatusListAudio[index].status = 'SUCCESS'
  1286. this.uploadStatusListAudio[index].successInfo = result.data
  1287. },
  1288. (err) => {
  1289. console.log('error');
  1290. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1291. console.log('用户取消了');
  1292. const index = this.uploadStatusListAudio.findIndex((eachItem) => {
  1293. return eachItem.uid === itemInUploadList.uid
  1294. })
  1295. this.uploadStatusListAudio.splice(index, 1)
  1296. } else {
  1297. console.log('上传失败');
  1298. itemInUploadList.status = 'FAIL'
  1299. itemInUploadList.statusText = '素材上传失败'
  1300. }
  1301. },
  1302. (progress) => {
  1303. console.log('progress');
  1304. itemInUploadList.progress = progress
  1305. }
  1306. );
  1307. this.uploadStatusListAudio.unshift(itemInUploadList);
  1308. });
  1309. },
  1310. onVideoFileInputChange(e) {
  1311. e.files.forEach((eachFile, i) => {
  1312. if (eachFile.name.toLowerCase().indexOf("mp4") <= -1) {
  1313. setTimeout(() => {
  1314. this.$msg({
  1315. message: `“${eachFile.name}”格式错误,请上传200MB以内、mp4格式的视频`,
  1316. type: "warning",
  1317. });
  1318. }, i * 100);
  1319. return;
  1320. }
  1321. if (eachFile.name.substring(0, eachFile.name.lastIndexOf(".")).length > 50) {
  1322. setTimeout(() => {
  1323. this.$msg({
  1324. message: `“${eachFile.name}”名称过长,请上传标题在50字以内的视频`,
  1325. type: "warning",
  1326. });
  1327. }, i * 100);
  1328. return;
  1329. }
  1330. let itemInUploadList = {
  1331. title: eachFile.name,
  1332. ifKnowProgress: true,
  1333. progress: 0,
  1334. status: 'LOADING',
  1335. statusText: "正在上传素材",
  1336. uid: `u_${this.$randomWord(true, 8, 8)}`,
  1337. abortHandler: null,
  1338. };
  1339. itemInUploadList.abortHandler = uploadMaterial(
  1340. {
  1341. file: eachFile
  1342. },
  1343. {
  1344. type: 'video',
  1345. uid: itemInUploadList.uid,
  1346. },
  1347. (result) => { // 上传成功
  1348. console.log('成功!');
  1349. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1350. return eachItem.uid === itemInUploadList.uid
  1351. })
  1352. result.data.fileSize = changeByteUnit(Number(result.data.fileSize));
  1353. result.data.createTime = result.data.createTime.substring(0, result.data.createTime.length - 3)
  1354. result.data.updateTime = result.data.updateTime.substring(0, result.data.updateTime.length - 3)
  1355. result.data.icon = result.data.ossPath + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto';
  1356. this.uploadStatusListVideo[index].status = 'SUCCESS'
  1357. this.uploadStatusListVideo[index].successInfo = result.data
  1358. },
  1359. (err) => {
  1360. if (err.statusText === 'abort') { // 用户取消了上传任务。
  1361. const index = this.uploadStatusListVideo.findIndex((eachItem) => {
  1362. return eachItem.uid === itemInUploadList.uid
  1363. })
  1364. this.uploadStatusListVideo.splice(index, 1)
  1365. } else {
  1366. itemInUploadList.status = 'FAIL'
  1367. itemInUploadList.statusText = '素材上传失败'
  1368. }
  1369. },
  1370. (progress) => {
  1371. console.log('进度:', progress);
  1372. itemInUploadList.progress = progress
  1373. }
  1374. );
  1375. this.uploadStatusListVideo.unshift(itemInUploadList);
  1376. });
  1377. },
  1378. _checkMStatus() {
  1379. let needPollingTaskList = this.uploadStatusListPano.filter((item) => item.status === 'LOADING' && item.ifKnowProgress === false);
  1380. if (needPollingTaskList.length > 0) {
  1381. checkMStatus(
  1382. {
  1383. ids: needPollingTaskList.map((item) => item.backendId),
  1384. islongpolling: true,
  1385. },
  1386. (res) => {
  1387. // 1切图中,2失败,3成功
  1388. res.data.forEach(eachRes => {
  1389. if (eachRes.status === 2) {
  1390. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1391. if (index >= 0) {
  1392. const targetItem = this.uploadStatusListPano[index]
  1393. targetItem.status = 'FAIL'
  1394. targetItem.statusText = '素材切图失败'
  1395. targetItem.ifKnowProgress = true
  1396. }
  1397. } else if (eachRes.status === 3) {
  1398. const index = this.uploadStatusListPano.findIndex(eachTask => eachTask.backendId === eachRes.id)
  1399. if (index >= 0) {
  1400. const targetItem = this.uploadStatusListPano[index]
  1401. targetItem.status = 'SUCCESS'
  1402. eachRes.fileSize = changeByteUnit(Number(eachRes.fileSize));
  1403. targetItem.successInfo = eachRes
  1404. }
  1405. }
  1406. });
  1407. }
  1408. );
  1409. }
  1410. },
  1411. onUnselectAll() {
  1412. this.select = []
  1413. },
  1414. onSelectAll() {
  1415. this.select = []
  1416. switch (this.currentMaterialType) {
  1417. case 'image':
  1418. for (const iterator of this.uploadStatusListImage) {
  1419. if (iterator.status === 'SUCCESS') {
  1420. this.select.push(iterator.successInfo)
  1421. }
  1422. }
  1423. for (const iterator of this.imageList) {
  1424. this.select.push(iterator)
  1425. }
  1426. break;
  1427. case 'pano':
  1428. for (const iterator of this.uploadStatusListPano) {
  1429. if (iterator.status === 'SUCCESS') {
  1430. this.select.push(iterator.successInfo)
  1431. }
  1432. }
  1433. for (const iterator of this.panoList) {
  1434. this.select.push(iterator)
  1435. }
  1436. break;
  1437. case 'audio':
  1438. for (const iterator of this.uploadStatusListAudio) {
  1439. if (iterator.status === 'SUCCESS') {
  1440. this.select.push(iterator.successInfo)
  1441. }
  1442. }
  1443. for (const iterator of this.audioList) {
  1444. this.select.push(iterator)
  1445. }
  1446. break;
  1447. case 'video':
  1448. for (const iterator of this.uploadStatusListVideo) {
  1449. if (iterator.status === 'SUCCESS') {
  1450. this.select.push(iterator.successInfo)
  1451. }
  1452. }
  1453. for (const iterator of this.videoList) {
  1454. this.select.push(iterator)
  1455. }
  1456. break;
  1457. case '3D':
  1458. for (const iterator of this.scene3DList) {
  1459. this.select.push(iterator)
  1460. }
  1461. break;
  1462. default:
  1463. break;
  1464. }
  1465. }
  1466. },
  1467. mounted() {
  1468. console.log('tableHeadersForAudio: ', this.tableHeadersForAudio);
  1469. console.log('tableHeadersForVideo: ', this.tableHeadersForVideo);
  1470. },
  1471. unmounted() {
  1472. this.$store.commit('setUploadStatusListImage', this.uploadStatusListImage.filter((item) => {
  1473. return item.status === 'LOADING'
  1474. }))
  1475. this.$store.commit('setUploadStatusListPano', this.uploadStatusListPano.filter((item) => {
  1476. return item.status === 'LOADING'
  1477. }))
  1478. this.$store.commit('setUploadStatusListAudio', this.uploadStatusListAudio.filter((item) => {
  1479. return item.status === 'LOADING'
  1480. }))
  1481. this.$store.commit('setUploadStatusListVideo', this.uploadStatusListVideo.filter((item) => {
  1482. return item.status === 'LOADING'
  1483. }))
  1484. }
  1485. }
  1486. </script>
  1487. <style lang="less" scoped>
  1488. .ellipsis{
  1489. text-overflow: ellipsis;
  1490. overflow: hidden;
  1491. white-space: nowrap;
  1492. width: 100%;
  1493. display: inline-block;
  1494. }
  1495. .table-select {
  1496. position: absolute;
  1497. z-index: 3;
  1498. left: 50%;
  1499. top: 50%;
  1500. transform: translateX(-50%) translateY(-50%);
  1501. width: 600px;
  1502. height: 730px;
  1503. background: #1A1B1D;
  1504. border-radius: 4px;
  1505. border: 1px solid #404040;
  1506. padding: 26px;
  1507. }
  1508. .title {
  1509. font-size: 18px;
  1510. color: rgba(255, 255, 255, 0.6);
  1511. }
  1512. .close-btn {
  1513. display: inline-block;
  1514. position: absolute;
  1515. top: 26px;
  1516. right: 20px;
  1517. font-size: 12px;
  1518. color: #969799;
  1519. cursor: pointer;
  1520. padding: 6px;
  1521. }
  1522. .material-tab {
  1523. margin-top: 35px;
  1524. > .material-tab-item {
  1525. display: inline-block;
  1526. margin-right: 20px;
  1527. position: relative;
  1528. cursor: pointer;
  1529. > .text {
  1530. font-size: 14px;
  1531. font-family: MicrosoftYaHei;
  1532. color: rgba(255, 255, 255, 0.6);
  1533. }
  1534. > .bottom-line {
  1535. position: absolute;
  1536. left: 50%;
  1537. transform: translateX(-50%);
  1538. bottom: -4px;
  1539. width: 16px;
  1540. height: 2px;
  1541. background: #0076F6;
  1542. border-radius: 1px;
  1543. }
  1544. }
  1545. }
  1546. .filter {
  1547. margin-top: 28px;
  1548. width: 100%;
  1549. height: 36px;
  1550. background: #252526;
  1551. border-radius: 2px;
  1552. border: 1px solid #404040;
  1553. position: relative;
  1554. > input {
  1555. box-sizing: border-box;
  1556. width: calc(100% - 42px);
  1557. height: 100%;
  1558. border: none;
  1559. padding-left: 16px;
  1560. background: transparent;
  1561. color: #fff;
  1562. outline: none;
  1563. }
  1564. > .search-icon {
  1565. position: absolute;
  1566. top: 50%;
  1567. transform: translateY(-50%);
  1568. right: 18px;
  1569. color: #404040;
  1570. font-size: 20px;
  1571. }
  1572. > .clear-icon {
  1573. position: absolute;
  1574. top: 50%;
  1575. transform: translateY(-50%);
  1576. right: 18px;
  1577. color: #404040;
  1578. font-size: 20px;
  1579. cursor: pointer;
  1580. }
  1581. }
  1582. @table-height: 440px;
  1583. @table-head-row-height: 40px;
  1584. @table-border-size: 1px;
  1585. .table {
  1586. margin-top: 20px;
  1587. border: @table-border-size solid #404040;
  1588. background: #1A1B1D;
  1589. width: 100%;
  1590. height: @table-height;
  1591. > .table-head-row {
  1592. width: 100%;
  1593. height: @table-head-row-height;
  1594. background: #252526;
  1595. color: rgba(255, 255, 255, 0.6);
  1596. .table-head {
  1597. font-size: 16px;
  1598. line-height: @table-head-row-height;
  1599. height: 100%;
  1600. display: inline-block;
  1601. }
  1602. }
  1603. > .table-body {
  1604. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1605. overflow: auto;
  1606. display: inline-block;
  1607. width: 100%;
  1608. > .table-body-row {
  1609. height: 50px;
  1610. border-bottom: 1px solid #404040;
  1611. display: flex;
  1612. align-items: center;
  1613. > .table-data {
  1614. font-size:14px;
  1615. line-height:50px;
  1616. height: 100%;
  1617. color: #fff;
  1618. > .list-img {
  1619. position: relative;
  1620. height: 100%;
  1621. display: inline-block;
  1622. width: 100%;
  1623. > img, .audio-player {
  1624. position: absolute;
  1625. top: 50%;
  1626. transform: translateY(-50%);
  1627. width: 40px;
  1628. height: 40px;
  1629. object-fit: cover;
  1630. }
  1631. }
  1632. }
  1633. }
  1634. }
  1635. > .no-data {
  1636. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1637. width: 100%;
  1638. position: relative;
  1639. > div {
  1640. position: absolute;
  1641. top: 50%;
  1642. left: 50%;
  1643. transform: translate(-50%, -50%);
  1644. text-align: center;
  1645. > img {
  1646. width: 116px;
  1647. }
  1648. > span {
  1649. margin-top: 20px;
  1650. display: block;
  1651. font-size: 14px;
  1652. color: rgba(255, 255, 255, 0.6);
  1653. }
  1654. > a {
  1655. > button {
  1656. margin-top: 20px;
  1657. }
  1658. }
  1659. }
  1660. }
  1661. }
  1662. .table-image .table-head,
  1663. .table-image .table-data {
  1664. &:nth-of-type(1) {
  1665. width: 50px;
  1666. &.nothing {
  1667. color: transparent;
  1668. }
  1669. &.select-all-checkbox-wrapper {
  1670. display: inline-flex;
  1671. justify-content: center;
  1672. align-items: center;
  1673. .unchecked {
  1674. width: 16px;
  1675. height: 16px;
  1676. cursor: pointer;
  1677. border-radius: 2px;
  1678. border: 1px solid #404040;
  1679. }
  1680. .checked {
  1681. width: 16px;
  1682. height: 16px;
  1683. cursor: pointer;
  1684. }
  1685. }
  1686. }
  1687. &:nth-of-type(2) {
  1688. width: calc(116px - 50px);
  1689. }
  1690. &:nth-of-type(3) {
  1691. width: calc(316px - 116px);
  1692. padding-right: 30px;
  1693. }
  1694. &:nth-of-type(4) {
  1695. width: calc(416px - 316px);
  1696. }
  1697. &:nth-of-type(5) {
  1698. width: calc(100% - 416px);
  1699. }
  1700. }
  1701. .table-pano .table-head,
  1702. .table-pano .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(416px - 116px);
  1731. padding-right: 30px;
  1732. }
  1733. &:nth-of-type(4) {
  1734. width: calc(100% - 416px);
  1735. }
  1736. }
  1737. .table-audio .table-head,
  1738. .table-audio .table-data {
  1739. &:nth-of-type(1) {
  1740. width: 50px;
  1741. &.nothing {
  1742. color: transparent;
  1743. }
  1744. &.select-all-checkbox-wrapper {
  1745. display: inline-flex;
  1746. justify-content: center;
  1747. align-items: center;
  1748. .unchecked {
  1749. width: 16px;
  1750. height: 16px;
  1751. cursor: pointer;
  1752. border-radius: 2px;
  1753. border: 1px solid #404040;
  1754. }
  1755. .checked {
  1756. width: 16px;
  1757. height: 16px;
  1758. cursor: pointer;
  1759. }
  1760. }
  1761. }
  1762. &:nth-of-type(2) {
  1763. width: calc(116px - 50px);
  1764. }
  1765. &:nth-of-type(3) {
  1766. width: calc(416px - 116px);
  1767. padding-right: 30px;
  1768. }
  1769. &:nth-of-type(4) {
  1770. width: calc(100% - 416px);
  1771. }
  1772. }
  1773. .table-video .table-head,
  1774. .table-video .table-data {
  1775. &:nth-of-type(1) {
  1776. width: 50px;
  1777. &.nothing {
  1778. color: transparent;
  1779. }
  1780. &.select-all-checkbox-wrapper {
  1781. display: inline-flex;
  1782. justify-content: center;
  1783. align-items: center;
  1784. .unchecked {
  1785. width: 16px;
  1786. height: 16px;
  1787. cursor: pointer;
  1788. border-radius: 2px;
  1789. border: 1px solid #404040;
  1790. }
  1791. .checked {
  1792. width: 16px;
  1793. height: 16px;
  1794. cursor: pointer;
  1795. }
  1796. }
  1797. }
  1798. &:nth-of-type(2) {
  1799. width: calc(116px - 50px);
  1800. }
  1801. &:nth-of-type(3) {
  1802. width: calc(416px - 116px);
  1803. padding-right: 30px;
  1804. }
  1805. &:nth-of-type(4) {
  1806. width: calc(100% - 416px);
  1807. }
  1808. }
  1809. .table-3D .table-head,
  1810. .table-3D .table-data {
  1811. &:nth-of-type(1) {
  1812. width: 50px;
  1813. &.nothing {
  1814. color: transparent;
  1815. }
  1816. &.select-all-checkbox-wrapper {
  1817. display: inline-flex;
  1818. justify-content: center;
  1819. align-items: center;
  1820. .unchecked {
  1821. width: 16px;
  1822. height: 16px;
  1823. cursor: pointer;
  1824. border-radius: 2px;
  1825. border: 1px solid #404040;
  1826. }
  1827. .checked {
  1828. width: 16px;
  1829. height: 16px;
  1830. cursor: pointer;
  1831. }
  1832. }
  1833. }
  1834. &:nth-of-type(2) {
  1835. width: calc(116px - 50px);
  1836. }
  1837. &:nth-of-type(3) {
  1838. width: calc(416px - 116px);
  1839. padding-right: 30px;
  1840. }
  1841. &:nth-of-type(4) {
  1842. width: calc(100% - 416px);
  1843. }
  1844. }
  1845. .checkbox {
  1846. width: 100%;
  1847. height: 100%;
  1848. }
  1849. .btns {
  1850. display: flex;
  1851. justify-content: space-between;
  1852. margin-top: 40px;
  1853. .upload-btn {
  1854. display: flex;
  1855. align-items: center;
  1856. > span {
  1857. display: inline-block;
  1858. margin-right: 4px;
  1859. }
  1860. i.tool-tip-for-editor {
  1861. font-size: 12px;
  1862. transform: scale(0.923) translateY(1px);
  1863. cursor: default;
  1864. }
  1865. }
  1866. > div {
  1867. .deepcancel {
  1868. margin-right: 16px;
  1869. }
  1870. }
  1871. }
  1872. </style>