materialSelectorForManageCenter.vue 64 KB

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