materialSelectorForEditor.vue 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825
  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">1</span>
  35. <span class="table-head" v-for="(item,i) in tableHeadersForImage" :key="i">{{item.name}}</span>
  36. </div>
  37. <div
  38. v-if="imageListRealLength !== 0 || hasMoreImageData"
  39. class="table-body"
  40. v-infinite-scroll="requestMoreImageData"
  41. :infinite-scroll-disabled="!hasMoreImageData || isRequestingMoreImageData"
  42. >
  43. <!-- vuex中的上传中数据 -->
  44. <div class="table-body-row" v-for="(item, i) in uploadStatusListImage" :key="item.uid">
  45. <!-- 如果已经上传成功 -->
  46. <template v-if="item.status === 'SUCCESS'">
  47. <span class="table-data">
  48. <div class="checkbox">
  49. <!-- 负责功能 -->
  50. <input
  51. type="checkbox"
  52. @change="e => selectItem(item.successInfo, e)"
  53. :checked="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  54. >
  55. <!-- 负责外观 -->
  56. <span class="for-outer-circle"></span>
  57. <span class="for-inner-circle"></span>
  58. </div>
  59. </span>
  60. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  61. <div v-if="tableItemStructure.type=='image'" class="list-img">
  62. <img :src="item.successInfo[tableItemStructure.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" alt="">
  63. </div>
  64. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  65. </span>
  66. </template>
  67. <!-- 如果还在上传中 -->
  68. <template v-else-if="item.status = 'LOADING'">
  69. <span class="table-data">
  70. <div class="checkbox">
  71. <span class="for-outer-circle"></span>
  72. <span class="for-inner-circle disabled"></span>
  73. </div>
  74. </span>
  75. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  76. <div v-if="tableItemStructure.type=='image'" class="list-img">
  77. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  78. </div>
  79. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'dpi'"></span>
  80. <span v-if="tableItemStructure.key === 'dpi'">上传素材 {{Math.round(item.progress * 100)}}%</span>
  81. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  82. </span>
  83. </template>
  84. <!-- 如果上传失败了 -->
  85. <template v-else-if="item.status = 'FAIL'">
  86. <span class="table-data">
  87. <div class="checkbox">
  88. <span class="for-outer-circle"></span>
  89. <span class="for-inner-circle disabled"></span>
  90. </div>
  91. </span>
  92. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  93. <div v-if="tableItemStructure.type=='image'" class="list-img">
  94. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  95. </div>
  96. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'dpi'"></span>
  97. <span v-if="tableItemStructure.key === 'dpi'">上传失败</span>
  98. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  99. </span>
  100. </template>
  101. </div>
  102. <!-- 本组件内的列表数据 -->
  103. <div class="table-body-row" v-for="(item,i) in imageList" :key="i">
  104. <span class="table-data">
  105. <div class="checkbox">
  106. <!-- 负责功能 -->
  107. <input
  108. type="checkbox"
  109. @change="e => selectItem(item, e)"
  110. :checked="select.some(i => i[primaryKey] === item[primaryKey])"
  111. >
  112. <!-- 负责外观 -->
  113. <span class="for-outer-circle"></span>
  114. <span class="for-inner-circle"></span>
  115. </div>
  116. </span>
  117. <span class="table-data" v-for="(sub,idx) in tableHeadersForImage" :key="idx">
  118. <div v-if="sub.type=='image'" class="list-img">
  119. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" alt="">
  120. </div>
  121. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{ item[sub.key] }}</span>
  122. </span>
  123. </div>
  124. </div>
  125. <!-- 无数据时的提示 -->
  126. <div v-else class="no-data">
  127. <div v-if="latestUsedSearchKey">
  128. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  129. <span>{{'未搜索到结果~'}}</span>
  130. </div>
  131. <div v-if="!latestUsedSearchKey">
  132. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  133. <span>{{'暂无素材~'}}</span>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="table table-pano" v-show="currentMaterialType === 'pano'">
  138. <div class="table-head-row">
  139. <span class="table-head">1</span>
  140. <span class="table-head" v-for="(item,i) in tableHeadersForPano" :key="i">{{item.name}}</span>
  141. </div>
  142. <div
  143. v-if="panoListRealLength !== 0 || hasMorePanoData"
  144. class="table-body"
  145. v-infinite-scroll="requestMorePanoData"
  146. :infinite-scroll-disabled="!hasMorePanoData || isRequestingMorePanoData"
  147. >
  148. <!-- vuex中的上传中数据 -->
  149. <div class="table-body-row" v-for="(item, i) in uploadStatusListPano" :key="item.uid">
  150. <!-- 如果已经上传成功 -->
  151. <template v-if="item.status === 'SUCCESS'">
  152. <span class="table-data">
  153. <div class="checkbox">
  154. <!-- 负责功能 -->
  155. <input
  156. type="checkbox"
  157. @change="e => selectItem(item.successInfo, e)"
  158. :checked="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  159. >
  160. <!-- 负责外观 -->
  161. <span class="for-outer-circle"></span>
  162. <span class="for-inner-circle"></span>
  163. </div>
  164. </span>
  165. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  166. <div v-if="tableItemStructure.type=='image'" class="list-img">
  167. <img :src="item.successInfo[tableItemStructure.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" alt="">
  168. </div>
  169. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  170. </span>
  171. </template>
  172. <!-- 如果还在上传或切图处理中 -->
  173. <template v-else-if="item.status = 'LOADING'">
  174. <span class="table-data">
  175. <div class="checkbox">
  176. <span class="for-outer-circle"></span>
  177. <span class="for-inner-circle disabled"></span>
  178. </div>
  179. </span>
  180. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  181. <div v-if="tableItemStructure.type=='image'" class="list-img">
  182. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  183. </div>
  184. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  185. <span v-if="tableItemStructure.key === 'fileSize' && item.ifKnowProgress">上传素材 {{Math.round(item.progress * 100)}}%</span>
  186. <span v-if="tableItemStructure.key === 'fileSize' && !item.ifKnowProgress">{{item.statusText}}</span>
  187. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  188. </span>
  189. </template>
  190. <!-- 如果上传失败了 -->
  191. <template v-else-if="item.status = 'FAIL'">
  192. <span class="table-data">
  193. <div class="checkbox">
  194. <span class="for-outer-circle"></span>
  195. <span class="for-inner-circle disabled"></span>
  196. </div>
  197. </span>
  198. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForPano" :key="idx">
  199. <div v-if="tableItemStructure.type=='image'" class="list-img">
  200. <img src="@/assets/images/icons/upload-file-type-icon-image@2x.png" alt="">
  201. </div>
  202. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  203. <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
  204. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  205. </span>
  206. </template>
  207. </div>
  208. <!-- 本组件内的列表数据 -->
  209. <div class="table-body-row" v-for="(item,i) in panoList" :key="i">
  210. <span class="table-data">
  211. <div class="checkbox">
  212. <!-- 负责功能 -->
  213. <input
  214. type="checkbox"
  215. @change="e => selectItem(item, e)"
  216. :checked="select.some(i => i[primaryKey] === item[primaryKey])"
  217. >
  218. <!-- 负责外观 -->
  219. <span class="for-outer-circle"></span>
  220. <span class="for-inner-circle"></span>
  221. </div>
  222. </span>
  223. <span class="table-data" v-for="(sub,idx) in tableHeadersForPano" :key="idx">
  224. <div v-if="sub.type=='image'" class="list-img">
  225. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" alt="">
  226. </div>
  227. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  228. </span>
  229. </div>
  230. </div>
  231. <!-- 无数据时的提示 -->
  232. <div v-if="panoList.length === 0 && !hasMorePanoData" class="no-data">
  233. <div v-if="latestUsedSearchKey">
  234. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  235. <span>{{'未搜索到结果~'}}</span>
  236. </div>
  237. <div v-if="!latestUsedSearchKey">
  238. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  239. <span>{{'暂无素材~'}}</span>
  240. </div>
  241. </div>
  242. </div>
  243. <div class="table table-audio" v-show="currentMaterialType === 'audio'">
  244. <div class="table-head-row">
  245. <span class="table-head">1</span>
  246. <span class="table-head" v-for="(item,i) in tableHeadersForAudio" :key="i">{{item.name}}</span>
  247. </div>
  248. <div
  249. v-if="audioListRealLength !== 0 || hasMoreAudioData"
  250. class="table-body"
  251. v-infinite-scroll="requestMoreAudioData"
  252. :infinite-scroll-disabled="!hasMoreAudioData || isRequestingMoreAudioData"
  253. >
  254. <!-- vuex中的上传中数据 -->
  255. <div class="table-body-row" v-for="(item, i) in uploadStatusListAudio" :key="item.uid">
  256. <!-- 如果已经上传成功 -->
  257. <template v-if="item.status === 'SUCCESS'">
  258. <span class="table-data">
  259. <div class="checkbox">
  260. <!-- 负责功能 -->
  261. <input
  262. type="checkbox"
  263. @change="e => selectItem(item.successInfo, e)"
  264. :checked="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  265. >
  266. <!-- 负责外观 -->
  267. <span class="for-outer-circle"></span>
  268. <span class="for-inner-circle"></span>
  269. </div>
  270. </span>
  271. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForAudio" :key="idx">
  272. <div v-if="tableItemStructure.type=='audio'" class="list-img">
  273. <!-- <img
  274. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  275. style="object-fit: contain;"
  276. alt=""
  277. > -->
  278. <AudioIconCanPlay
  279. class="icon"
  280. :vKey="item.successInfo.id"
  281. :idleft="`_${$randomWord(true, 8, 8)}`"
  282. :idright="`_${$randomWord(true, 8, 8)}`"
  283. :myAudioUrl="item.successInfo.ossPath"
  284. ></AudioIconCanPlay>
  285. </div>
  286. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  287. </span>
  288. </template>
  289. <!-- 如果还在上传中 -->
  290. <template v-else-if="item.status = 'LOADING'">
  291. <span class="table-data">
  292. <div class="checkbox">
  293. <span class="for-outer-circle"></span>
  294. <span class="for-inner-circle disabled"></span>
  295. </div>
  296. </span>
  297. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForAudio" :key="idx">
  298. <div v-if="tableItemStructure.type=='audio'" class="list-img">
  299. <img
  300. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  301. style="object-fit: contain;"
  302. alt=""
  303. >
  304. </div>
  305. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  306. <span v-if="tableItemStructure.key === 'fileSize'">上传素材 {{Math.round(item.progress * 100)}}%</span>
  307. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  308. </span>
  309. </template>
  310. <!-- 如果上传失败了 -->
  311. <template v-else-if="item.status = 'FAIL'">
  312. <span class="table-data">
  313. <div class="checkbox">
  314. <span class="for-outer-circle"></span>
  315. <span class="for-inner-circle disabled"></span>
  316. </div>
  317. </span>
  318. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  319. <div v-if="tableItemStructure.type=='audio'" class="list-img">
  320. <img
  321. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  322. style="object-fit: contain;"
  323. alt=""
  324. >
  325. </div>
  326. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  327. <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
  328. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  329. </span>
  330. </template>
  331. </div>
  332. <!-- 本组件内的列表数据 -->
  333. <div class="table-body-row" v-for="(item,i) in audioList" :key="i">
  334. <span class="table-data">
  335. <div class="checkbox">
  336. <!-- 负责功能 -->
  337. <input
  338. type="checkbox"
  339. @change="e => selectItem(item, e)"
  340. :checked="select.some(i => i[primaryKey] === item[primaryKey])"
  341. >
  342. <!-- 负责外观 -->
  343. <span class="for-outer-circle"></span>
  344. <span class="for-inner-circle"></span>
  345. </div>
  346. </span>
  347. <span class="table-data" v-for="(sub,idx) in tableHeadersForAudio" :key="idx">
  348. <div v-if="sub.type=='audio'" class="list-img">
  349. <!-- <img
  350. :src="require('@/assets/images/icons/upload-file-type-icon-audio@2x.png')"
  351. style="object-fit: contain;"
  352. alt=""
  353. > -->
  354. <AudioIconCanPlay
  355. class="audio-player"
  356. :vKey="item.id"
  357. :idleft="`_${$randomWord(true, 8, 8)}`"
  358. :idright="`_${$randomWord(true, 8, 8)}`"
  359. :myAudioUrl="item.ossPath"
  360. ></AudioIconCanPlay>
  361. </div>
  362. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  363. </span>
  364. </div>
  365. </div>
  366. <!-- 无数据时的提示 -->
  367. <div v-if="audioList.length === 0 && !hasMoreAudioData" class="no-data">
  368. <div v-if="latestUsedSearchKey">
  369. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  370. <span>{{'未搜索到结果~'}}</span>
  371. </div>
  372. <div v-if="!latestUsedSearchKey">
  373. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  374. <span>{{'暂无素材~'}}</span>
  375. </div>
  376. </div>
  377. </div>
  378. <div class="table table-video" v-show="currentMaterialType === 'video'">
  379. <div class="table-head-row">
  380. <span class="table-head">1</span>
  381. <span class="table-head" v-for="(item,i) in tableHeadersForVideo" :key="i">{{item.name}}</span>
  382. </div>
  383. <div
  384. v-if="videoListRealLength !== 0 || hasMoreVideoData"
  385. class="table-body"
  386. v-infinite-scroll="requestMoreVideoData"
  387. :infinite-scroll-disabled="!hasMoreVideoData || isRequestingMoreVideoData"
  388. >
  389. <!-- vuex中的上传中数据 -->
  390. <div class="table-body-row" v-for="(item, i) in uploadStatusListVideo" :key="item.uid">
  391. <!-- 如果已经上传成功 -->
  392. <template v-if="item.status === 'SUCCESS'">
  393. <span class="table-data">
  394. <div class="checkbox">
  395. <!-- 负责功能 -->
  396. <input
  397. type="checkbox"
  398. @change="e => selectItem(item.successInfo, e)"
  399. :checked="select.some(i => i[primaryKey] === item.successInfo[primaryKey])"
  400. >
  401. <!-- 负责外观 -->
  402. <span class="for-outer-circle"></span>
  403. <span class="for-inner-circle"></span>
  404. </div>
  405. </span>
  406. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForVideo" :key="idx">
  407. <div v-if="tableItemStructure.type=='image'" class="list-img">
  408. <img
  409. :src="item.successInfo[tableItemStructure.key]"
  410. alt=""
  411. >
  412. </div>
  413. <span v-else class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.successInfo[tableItemStructure.key] : ''">{{ item.successInfo[tableItemStructure.key] }}</span>
  414. </span>
  415. </template>
  416. <!-- 如果还在上传中 -->
  417. <template v-else-if="item.status = 'LOADING'">
  418. <span class="table-data">
  419. <div class="checkbox">
  420. <span class="for-outer-circle"></span>
  421. <span class="for-inner-circle disabled"></span>
  422. </div>
  423. </span>
  424. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForVideo" :key="idx">
  425. <div v-if="tableItemStructure.type=='image'" class="list-img">
  426. <img
  427. :src="require('@/assets/images/icons/upload-file-type-icon-video@2x.png')"
  428. style="object-fit: contain;"
  429. alt=""
  430. >
  431. </div>
  432. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  433. <span v-if="tableItemStructure.key === 'fileSize'">上传素材 {{Math.round(item.progress * 100)}}%</span>
  434. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  435. </span>
  436. </template>
  437. <!-- 如果上传失败了 -->
  438. <template v-else-if="item.status = 'FAIL'">
  439. <span class="table-data">
  440. <div class="checkbox">
  441. <span class="for-outer-circle"></span>
  442. <span class="for-inner-circle disabled"></span>
  443. </div>
  444. </span>
  445. <span class="table-data" v-for="(tableItemStructure, idx) in tableHeadersForImage" :key="idx">
  446. <div v-if="tableItemStructure.type=='image'" class="list-img">
  447. <img
  448. :src="require('@/assets/images/icons/upload-file-type-icon-video@2x.png')"
  449. style="object-fit: contain;"
  450. alt=""
  451. >
  452. </div>
  453. <span v-if="tableItemStructure.key !== 'name' && tableItemStructure.key !== 'fileSize'"></span>
  454. <span v-if="tableItemStructure.key === 'fileSize'">上传失败</span>
  455. <span v-if="tableItemStructure.key === 'name'" class="ellipsis" v-title="tableItemStructure.key === 'name' ? item.title : ''">{{ item.title }}</span>
  456. </span>
  457. </template>
  458. </div>
  459. <!-- 本组件内的列表数据 -->
  460. <div class="table-body-row" v-for="(item,i) in videoList" :key="i">
  461. <span class="table-data">
  462. <div class="checkbox">
  463. <!-- 负责功能 -->
  464. <input
  465. type="checkbox"
  466. @change="e => selectItem(item, e)"
  467. :checked="select.some(i => i[primaryKey] === item[primaryKey])"
  468. >
  469. <!-- 负责外观 -->
  470. <span class="for-outer-circle"></span>
  471. <span class="for-inner-circle"></span>
  472. </div>
  473. </span>
  474. <span class="table-data" v-for="(sub,idx) in tableHeadersForVideo" :key="idx">
  475. <div v-if="sub.type=='image'" class="list-img">
  476. <img :src="item[sub.key]" alt="">
  477. </div>
  478. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  479. </span>
  480. </div>
  481. </div>
  482. <!-- 无数据时的提示 -->
  483. <div v-if="videoList.length === 0 && !hasMoreVideoData" class="no-data">
  484. <div v-if="latestUsedSearchKey">
  485. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  486. <span>{{'未搜索到结果~'}}</span>
  487. </div>
  488. <div v-if="!latestUsedSearchKey">
  489. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  490. <span>{{'暂无素材~'}}</span>
  491. </div>
  492. </div>
  493. </div>
  494. <div class="table table-3D" v-show="currentMaterialType === '3D'">
  495. <div class="table-head-row">
  496. <span class="table-head">1</span>
  497. <span class="table-head" v-for="(item,i) in tableHeadersFor3D" :key="i">{{item.name}}</span>
  498. </div>
  499. <div
  500. v-if="scene3DList.length !== 0 || hasMore3DData"
  501. class="table-body"
  502. v-infinite-scroll="requestMorePanoData"
  503. :infinite-scroll-disabled="!hasMore3DData || isRequestingMore3DData"
  504. >
  505. <div class="table-body-row" v-for="(item,i) in scene3DList" :key="i">
  506. <span class="table-data">
  507. <div class="checkbox">
  508. <!-- 负责功能 -->
  509. <input
  510. type="checkbox"
  511. @change="e => selectItem(item, e)"
  512. :checked="select.some(i => i[primaryKey] === item[primaryKey])"
  513. >
  514. <!-- 负责外观 -->
  515. <span class="for-outer-circle"></span>
  516. <span class="for-inner-circle"></span>
  517. </div>
  518. </span>
  519. <span class="table-data" v-for="(sub,idx) in tableHeadersFor3D" :key="idx">
  520. <div v-if="sub.type=='image'" class="list-img">
  521. <img :src="item[sub.key] + `?x-oss-process=image/resize,p_10&${Math.random()}`" alt="">
  522. </div>
  523. <span class="ellipsis" v-else v-title="sub.key === 'name' ? item[sub.key] : ''">{{item[sub.key]}}</span>
  524. </span>
  525. </div>
  526. </div>
  527. <!-- 无数据时的提示 -->
  528. <div v-if="scene3DList.length === 0 && !hasMore3DData" class="no-data">
  529. <div v-if="latestUsedSearchKey">
  530. <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
  531. <span>{{'未搜索到结果~'}}</span>
  532. </div>
  533. <div v-if="!latestUsedSearchKey">
  534. <img :src="require('@/assets/images/default/empty_04.png')" alt="">
  535. <span>{{'暂无素材~'}}</span>
  536. <a href="/#/">
  537. <button class="ui-button">如何拍摄三维场景</button>
  538. </a>
  539. </div>
  540. </div>
  541. </div>
  542. <div class="btns">
  543. <button v-if="currentMaterialType !== '3D'" class="ui-button upload-btn" @click="$refs['file-input'].click()">
  544. <span>上传素材</span>
  545. <i class="iconfont icon-material_prompt tool-tip-for-editor"
  546. v-tooltip="
  547. currentMaterialType === 'image' ? '请上传10MB以内、jpg/png格式的图片' :
  548. currentMaterialType === 'pano' ? '请上传2:1、120MB以内、jpg格式的图片' :
  549. currentMaterialType === 'audio' ? '请上传20MB以内、mp3格式的音频' :
  550. currentMaterialType === 'video' ? '请上传200MB以内、mp4格式的视频' : ''
  551. ">
  552. </i>
  553. <FileInput
  554. ref="file-input"
  555. :failString="fileInputFailString"
  556. :limitFailStr="fileInputLimitFailStr"
  557. :acceptType="fileInputAcceptType"
  558. :mediaType="fileInputMediaType"
  559. :limit="fileInputLimit"
  560. @file-change="onFileInputChange"
  561. ></FileInput>
  562. </button>
  563. <div v-else class="button-placeholder"></div>
  564. <div>
  565. <button class="ui-button deepcancel" @click="$emit('cancle')">取消</button>
  566. <button class="ui-button submit" :class="{disable: !select.length}" @click="$emit('submit', select)">
  567. 确定
  568. </button>
  569. </div>
  570. </div>
  571. </div>
  572. </template>
  573. <script>
  574. import {
  575. getMaterialList,
  576. getSceneList,
  577. uploadMaterial,
  578. checkMStatus,
  579. } from "@/api";
  580. import { getImgWH, changeByteUnit } from "@/utils/file";
  581. import config from "@/config";
  582. import { debounce } from "@/utils/other.js"
  583. import FileInput from "@/components/shared/uploads/UploadMultiple.vue";
  584. import { mapState } from "vuex";
  585. import AudioIconCanPlay from "@/components/audio/indexForEditor.vue";
  586. export default {
  587. props:{
  588. title:{
  589. default:'',
  590. type:String
  591. },
  592. primaryKey: {
  593. default:'id'
  594. },
  595. selectableType: {
  596. type: Array,
  597. default: function() {
  598. return [
  599. 'image',
  600. 'pano',
  601. 'audio',
  602. 'video',
  603. '3D',
  604. ]
  605. },
  606. },
  607. initialMaterialType: {
  608. type: String,
  609. default: 'image',
  610. },
  611. isMultiSelection: {
  612. type: Boolean,
  613. default: false,
  614. }
  615. },
  616. components:{
  617. FileInput,
  618. AudioIconCanPlay,
  619. },
  620. watch:{
  621. searchKey: {
  622. handler: function () {
  623. this.refreshMaterialList(this.currentMaterialType)
  624. },
  625. immediate: false,
  626. },
  627. currentMaterialType: {
  628. handler: function (newVal) {
  629. if (newVal === 'image' && this.imageList.length === 0) {
  630. this.refreshMaterialList('image')
  631. } else if (newVal === 'pano' && this.panoList.length === 0) {
  632. this.refreshMaterialList('pano')
  633. } else if (newVal === 'audio' && this.audioList.length === 0) {
  634. this.refreshMaterialList('audio')
  635. } else if (newVal === 'video' && this.videoList.length === 0) {
  636. this.refreshMaterialList('video')
  637. } else if (newVal === '3D' && this.scene3DList.length === 0) {
  638. this.refreshMaterialList('3D')
  639. }
  640. },
  641. immediate: false,
  642. },
  643. needLongPolling: {
  644. handler: function (newVal) {
  645. if (!newVal) {
  646. clearInterval(this.longPollingIntervalId)
  647. this.longPollingIntervalId = null
  648. } else {
  649. console.log('need long polling!');
  650. clearInterval(this.longPollingIntervalId)
  651. this.longPollingIntervalId = null
  652. this.longPollingIntervalId = setInterval(() => {
  653. this._checkMStatus();
  654. }, 3000);
  655. }
  656. },
  657. },
  658. },
  659. computed:{
  660. ...mapState({
  661. uploadStatusListAudio: 'uploadStatusListAudio',
  662. uploadStatusListImage: 'uploadStatusListImage',
  663. uploadStatusListPano: 'uploadStatusListPano',
  664. uploadStatusListVideo: 'uploadStatusListVideo',
  665. }),
  666. tableHeadersForImage() {
  667. return this.$MAPTABLEHEADER['image'].filter(item => {
  668. return ['icon', 'name', 'fileSize', 'dpi'].includes(item.key)
  669. })
  670. },
  671. tableHeadersForPano() {
  672. return this.$MAPTABLEHEADER['pano'].filter(item => {
  673. return ['icon', 'name', 'fileSize'].includes(item.key)
  674. })
  675. },
  676. tableHeadersForAudio() {
  677. return this.$MAPTABLEHEADER['audio'].filter(item => {
  678. return ['ossPath', 'name', 'fileSize'].includes(item.key)
  679. })
  680. },
  681. tableHeadersForVideo() {
  682. return this.$MAPTABLEHEADER['video'].filter(item => {
  683. return ['icon', 'name', 'fileSize'].includes(item.key)
  684. })
  685. },
  686. tableHeadersFor3D() {
  687. return this.$MAPTABLEHEADER['scene'].filter(item => {
  688. return ['thumb', 'sceneName', 'createTime'].includes(item.key)
  689. })
  690. },
  691. fileInputFailString() {
  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. fileInputLimitFailStr() {
  712. let ret = ''
  713. switch (this.currentMaterialType) {
  714. case 'pano':
  715. ret = '过大,请上传2:1、120MB以内、jpg格式的全景图片'
  716. break;
  717. case 'image':
  718. ret = '过大,请上传10MB以内、jpg/png格式的图片'
  719. break;
  720. case 'audio':
  721. ret = '过大,请上传20MB以内、mp3格式的音频'
  722. break;
  723. case 'video':
  724. ret = '过大,请上传200MB以内、mp4格式的视频'
  725. break;
  726. default:
  727. break;
  728. }
  729. return ret
  730. },
  731. fileInputAcceptType() {
  732. let ret = ''
  733. switch (this.currentMaterialType) {
  734. case 'pano':
  735. ret = 'image/jpeg'
  736. break;
  737. case 'image':
  738. ret = 'image/png,image/jpeg'
  739. break;
  740. case 'audio':
  741. ret = 'audio/mp3'
  742. break;
  743. case 'video':
  744. ret = 'video/mp4'
  745. break;
  746. default:
  747. break;
  748. }
  749. return ret
  750. },
  751. fileInputMediaType() {
  752. let ret = ''
  753. switch (this.currentMaterialType) {
  754. case 'pano':
  755. ret = 'image'
  756. break;
  757. case 'image':
  758. ret = 'image'
  759. break;
  760. case 'audio':
  761. ret = 'audio'
  762. break;
  763. case 'video':
  764. ret = 'video'
  765. break;
  766. default:
  767. break;
  768. }
  769. return ret
  770. },
  771. fileInputLimit() {
  772. let ret
  773. switch (this.currentMaterialType) {
  774. case 'pano':
  775. ret = 120
  776. break;
  777. case 'image':
  778. ret = 10
  779. break;
  780. case 'audio':
  781. ret = 20
  782. break;
  783. case 'video':
  784. ret = 200
  785. break;
  786. default:
  787. break;
  788. }
  789. return ret
  790. },
  791. imageListRealLength() {
  792. return this.imageList.length + this.uploadStatusListImage.filter((item) => {
  793. return item.status === 'SUCCESS'
  794. }).length
  795. },
  796. panoListRealLength() {
  797. return this.imageList.length + this.uploadStatusListPano.filter((item) => {
  798. return item.status === 'SUCCESS'
  799. }).length
  800. },
  801. audioListRealLength() {
  802. return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
  803. return item.status === 'SUCCESS'
  804. }).length
  805. },
  806. videoListRealLength() {
  807. return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
  808. return item.status === 'SUCCESS'
  809. }).length
  810. },
  811. needLongPolling() {
  812. return this.uploadStatusListPano.some((item) => {
  813. return item.status === 'LOADING' && item.ifKnowProgress === false
  814. })
  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, e) {
  843. item.materialType = this.currentMaterialType // 三维场景数据没有type字段来表明自己是三维场景。所以统一加一个字段。
  844. if (false) {
  845. // 对于图片,大于600kb的,压缩?
  846. } else {
  847. if (this.isMultiSelection) {
  848. if (e.target.checked) {
  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 (e.target.checked) {
  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. },
  1412. mounted() {
  1413. console.log('tableHeadersForAudio: ', this.tableHeadersForAudio);
  1414. console.log('tableHeadersForVideo: ', this.tableHeadersForVideo);
  1415. },
  1416. unmounted() {
  1417. this.$store.commit('setUploadStatusListImage', this.uploadStatusListImage.filter((item) => {
  1418. return item.status === 'LOADING'
  1419. }))
  1420. this.$store.commit('setUploadStatusListPano', this.uploadStatusListPano.filter((item) => {
  1421. return item.status === 'LOADING'
  1422. }))
  1423. this.$store.commit('setUploadStatusListAudio', this.uploadStatusListAudio.filter((item) => {
  1424. return item.status === 'LOADING'
  1425. }))
  1426. this.$store.commit('setUploadStatusListVideo', this.uploadStatusListVideo.filter((item) => {
  1427. return item.status === 'LOADING'
  1428. }))
  1429. }
  1430. }
  1431. </script>
  1432. <style lang="less" scoped>
  1433. .ellipsis{
  1434. text-overflow: ellipsis;
  1435. overflow: hidden;
  1436. white-space: nowrap;
  1437. width: 100%;
  1438. display: inline-block;
  1439. }
  1440. .table-select {
  1441. position: absolute;
  1442. z-index: 3;
  1443. left: 50%;
  1444. top: 50%;
  1445. transform: translateX(-50%) translateY(-50%);
  1446. width: 600px;
  1447. height: 730px;
  1448. background: #1A1B1D;
  1449. border-radius: 4px;
  1450. border: 1px solid #404040;
  1451. padding: 26px;
  1452. }
  1453. .title {
  1454. font-size: 18px;
  1455. color: rgba(255, 255, 255, 0.6);
  1456. }
  1457. .close-btn {
  1458. display: inline-block;
  1459. position: absolute;
  1460. top: 26px;
  1461. right: 20px;
  1462. font-size: 12px;
  1463. color: #969799;
  1464. cursor: pointer;
  1465. padding: 6px;
  1466. }
  1467. .material-tab {
  1468. margin-top: 35px;
  1469. > .material-tab-item {
  1470. display: inline-block;
  1471. margin-right: 20px;
  1472. position: relative;
  1473. cursor: pointer;
  1474. > .text {
  1475. font-size: 14px;
  1476. font-family: MicrosoftYaHei;
  1477. color: rgba(255, 255, 255, 0.6);
  1478. }
  1479. > .bottom-line {
  1480. position: absolute;
  1481. left: 50%;
  1482. transform: translateX(-50%);
  1483. bottom: -4px;
  1484. width: 16px;
  1485. height: 2px;
  1486. background: #0076F6;
  1487. border-radius: 1px;
  1488. }
  1489. }
  1490. }
  1491. .filter {
  1492. margin-top: 28px;
  1493. width: 100%;
  1494. height: 36px;
  1495. background: #252526;
  1496. border-radius: 2px;
  1497. border: 1px solid #404040;
  1498. position: relative;
  1499. > input {
  1500. box-sizing: border-box;
  1501. width: calc(100% - 42px);
  1502. height: 100%;
  1503. border: none;
  1504. padding-left: 16px;
  1505. background: transparent;
  1506. color: #fff;
  1507. outline: none;
  1508. }
  1509. > .search-icon {
  1510. position: absolute;
  1511. top: 50%;
  1512. transform: translateY(-50%);
  1513. right: 18px;
  1514. color: #404040;
  1515. font-size: 20px;
  1516. }
  1517. > .clear-icon {
  1518. position: absolute;
  1519. top: 50%;
  1520. transform: translateY(-50%);
  1521. right: 18px;
  1522. color: #404040;
  1523. font-size: 20px;
  1524. cursor: pointer;
  1525. }
  1526. }
  1527. @table-height: 440px;
  1528. @table-head-row-height: 40px;
  1529. @table-border-size: 1px;
  1530. .table {
  1531. margin-top: 20px;
  1532. border: @table-border-size solid #404040;
  1533. background: #1A1B1D;
  1534. width: 100%;
  1535. height: @table-height;
  1536. > .table-head-row {
  1537. width: 100%;
  1538. height: @table-head-row-height;
  1539. background: #252526;
  1540. color: rgba(255, 255, 255, 0.6);
  1541. .table-head {
  1542. font-size: 16px;
  1543. line-height: @table-head-row-height;
  1544. height: 100%;
  1545. display: inline-block;
  1546. }
  1547. }
  1548. > .table-body {
  1549. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1550. overflow: auto;
  1551. display: inline-block;
  1552. width: 100%;
  1553. > .table-body-row {
  1554. height: 50px;
  1555. border-bottom: 1px solid #404040;
  1556. display: flex;
  1557. align-items: center;
  1558. > .table-data {
  1559. font-size:14px;
  1560. line-height:50px;
  1561. height: 100%;
  1562. color: #fff;
  1563. > .list-img {
  1564. position: relative;
  1565. height: 100%;
  1566. display: inline-block;
  1567. width: 100%;
  1568. > img, .audio-player {
  1569. position: absolute;
  1570. top: 50%;
  1571. transform: translateY(-50%);
  1572. width: 40px;
  1573. height: 40px;
  1574. object-fit: cover;
  1575. }
  1576. }
  1577. }
  1578. }
  1579. }
  1580. > .no-data {
  1581. height: calc(@table-height - @table-head-row-height - @table-border-size - @table-border-size);
  1582. width: 100%;
  1583. position: relative;
  1584. > div {
  1585. position: absolute;
  1586. top: 50%;
  1587. left: 50%;
  1588. transform: translate(-50%, -50%);
  1589. text-align: center;
  1590. > img {
  1591. width: 116px;
  1592. }
  1593. > span {
  1594. margin-top: 20px;
  1595. display: block;
  1596. font-size: 14px;
  1597. color: rgba(255, 255, 255, 0.6);
  1598. }
  1599. > a {
  1600. > button {
  1601. margin-top: 20px;
  1602. }
  1603. }
  1604. }
  1605. }
  1606. }
  1607. .table-image .table-head,
  1608. .table-image .table-data {
  1609. &:nth-of-type(1) {
  1610. width: 50px;
  1611. color: transparent;
  1612. }
  1613. &:nth-of-type(2) {
  1614. width: calc(116px - 50px);
  1615. }
  1616. &:nth-of-type(3) {
  1617. width: calc(316px - 116px);
  1618. padding-right: 30px;
  1619. }
  1620. &:nth-of-type(4) {
  1621. width: calc(416px - 316px);
  1622. }
  1623. &:nth-of-type(5) {
  1624. width: calc(100% - 416px);
  1625. }
  1626. }
  1627. .table-pano .table-head,
  1628. .table-pano .table-data {
  1629. &:nth-of-type(1) {
  1630. width: 50px;
  1631. color: transparent;
  1632. }
  1633. &:nth-of-type(2) {
  1634. width: calc(116px - 50px);
  1635. }
  1636. &:nth-of-type(3) {
  1637. width: calc(416px - 116px);
  1638. padding-right: 30px;
  1639. }
  1640. &:nth-of-type(4) {
  1641. width: calc(100% - 416px);
  1642. }
  1643. }
  1644. .table-audio .table-head,
  1645. .table-audio .table-data {
  1646. &:nth-of-type(1) {
  1647. width: 50px;
  1648. color: transparent;
  1649. }
  1650. &:nth-of-type(2) {
  1651. width: calc(116px - 50px);
  1652. }
  1653. &:nth-of-type(3) {
  1654. width: calc(416px - 116px);
  1655. padding-right: 30px;
  1656. }
  1657. &:nth-of-type(4) {
  1658. width: calc(100% - 416px);
  1659. }
  1660. }
  1661. .table-video .table-head,
  1662. .table-video .table-data {
  1663. &:nth-of-type(1) {
  1664. width: 50px;
  1665. color: transparent;
  1666. }
  1667. &:nth-of-type(2) {
  1668. width: calc(116px - 50px);
  1669. }
  1670. &:nth-of-type(3) {
  1671. width: calc(416px - 116px);
  1672. padding-right: 30px;
  1673. }
  1674. &:nth-of-type(4) {
  1675. width: calc(100% - 416px);
  1676. }
  1677. }
  1678. .table-3D .table-head,
  1679. .table-3D .table-data {
  1680. &:nth-of-type(1) {
  1681. width: 50px;
  1682. color: transparent;
  1683. }
  1684. &:nth-of-type(2) {
  1685. width: calc(116px - 50px);
  1686. }
  1687. &:nth-of-type(3) {
  1688. width: calc(416px - 116px);
  1689. padding-right: 30px;
  1690. }
  1691. &:nth-of-type(4) {
  1692. width: calc(100% - 416px);
  1693. }
  1694. }
  1695. .checkbox {
  1696. position: relative;
  1697. width: 100%;
  1698. height: 100%;
  1699. input {
  1700. width: 20px;
  1701. height: 20px;
  1702. position: absolute;
  1703. left: 50%;
  1704. top: 50%;
  1705. transform: translate(-50%, -50%);
  1706. cursor: pointer;
  1707. opacity: 0;
  1708. }
  1709. .for-outer-circle {
  1710. width: 16px;
  1711. height: 16px;
  1712. position: absolute;
  1713. left: 50%;
  1714. top: 50%;
  1715. transform: translate(-50%, -50%);
  1716. border-radius: 50%;
  1717. border: 1px solid #404040;
  1718. pointer-events: none;
  1719. }
  1720. .for-inner-circle {
  1721. width: 8px;
  1722. height: 8px;
  1723. position: absolute;
  1724. left: 50%;
  1725. top: 50%;
  1726. transform: translate(-50%, -50%);
  1727. border-radius: 50%;
  1728. background: #0076F6;
  1729. pointer-events: none;
  1730. opacity: 0;
  1731. &.disabled {
  1732. width: 14px;
  1733. height: 14px;
  1734. background: rgba(255, 255, 255, 0.0800);
  1735. opacity: 1;
  1736. }
  1737. }
  1738. }
  1739. .checkbox > input:checked ~ .for-outer-circle {
  1740. border: 1px solid #0076F6;
  1741. }
  1742. .checkbox > input:checked ~ .for-inner-circle {
  1743. opacity: 1;
  1744. }
  1745. .checkbox > input:disabled {
  1746. cursor: not-allowed;
  1747. }
  1748. // .checkbox > input:disabled + span {
  1749. // }
  1750. .btns {
  1751. display: flex;
  1752. justify-content: space-between;
  1753. margin-top: 40px;
  1754. .upload-btn {
  1755. display: flex;
  1756. align-items: center;
  1757. > span {
  1758. display: inline-block;
  1759. margin-right: 4px;
  1760. }
  1761. i.tool-tip-for-editor {
  1762. font-size: 12px;
  1763. transform: scale(0.923) translateY(1px);
  1764. cursor: default;
  1765. }
  1766. }
  1767. > div {
  1768. .deepcancel {
  1769. margin-right: 16px;
  1770. }
  1771. }
  1772. }
  1773. </style>