materialSelectorForManageCenter.vue 64 KB

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