_fileId.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <div class="page">
  3. <div class="page-top flex flex-col justify-center items-center">
  4. <!-- <span class="name mt-2" v-text="supplierInfo.shopName + '云资料库'"></span> -->
  5. <span class="name mt-2">云资料库</span>
  6. </div>
  7. <div class="page-content">
  8. <!-- 面包屑 -->
  9. <el-breadcrumb separator-class="el-icon-arrow-right">
  10. <el-breadcrumb-item :to="{ path: `${routePrefix}/docs/0` }"
  11. >全部文件</el-breadcrumb-item
  12. >
  13. <template v-for="(item, index) in crumbList">
  14. <template v-if="index === crumbList.length - 1">
  15. <el-breadcrumb-item :key="item.id">
  16. <span class="cell">{{ item.fileName }}</span>
  17. </el-breadcrumb-item>
  18. </template>
  19. <template v-else>
  20. <el-breadcrumb-item
  21. :key="item.id"
  22. :to="{ path: `${routePrefix}/docs/${item.id}` }"
  23. >
  24. <span>{{ item.fileName | crumbFormat }}</span>
  25. </el-breadcrumb-item>
  26. </template>
  27. </template>
  28. </el-breadcrumb>
  29. <!-- 列表 -->
  30. <div class="list-header">
  31. <div class="row">
  32. <div class="col">文件名</div>
  33. <div class="col">时间</div>
  34. <div class="col">大小</div>
  35. <div class="col">操作</div>
  36. </div>
  37. </div>
  38. <div class="list-body">
  39. <div class="row" v-for="item in list" :key="item.id">
  40. <div class="section pc">
  41. <div class="col">
  42. <doc-icon :type="item.fileType" :src="item.screenshot" />
  43. <span
  44. class="file-name"
  45. v-if="item.fileType === 'article'"
  46. @click="onRowClick(item)"
  47. >
  48. {{ item.fileName | fileNameFormat }}
  49. </span>
  50. <span class="file-name" v-else @click="onRowClick(item)">{{
  51. item.fileName
  52. }}</span>
  53. </div>
  54. <div class="col">{{ item.saveTime | dateFormat }}</div>
  55. <div class="col">
  56. <span v-if="item.packageType > 0">{{
  57. item.fileSize | fileSize
  58. }}</span>
  59. <span v-else>-</span>
  60. </div>
  61. <div class="col control">
  62. <div class="download" @click="onDownload(item, $event)"></div>
  63. </div>
  64. </div>
  65. <div class="section mobile">
  66. <div class="col file-cover">
  67. <doc-icon :type="item.fileType" :src="item.screenshot" />
  68. </div>
  69. <div class="col file-content" @click="onRowClick(item)">
  70. <div class="file-name" v-if="item.fileType === 'article'">
  71. {{ item.fileName | fileNameFormat }}
  72. </div>
  73. <div class="file-name" v-else>{{ item.fileName }}</div>
  74. <div class="file-info">
  75. <span class="date">{{ item.saveTime | dateFormat }}</span>
  76. <span class="size">
  77. <span v-if="item.packageType > 0">{{
  78. item.fileSize | fileSize
  79. }}</span>
  80. <span v-else>-</span>
  81. </span>
  82. </div>
  83. </div>
  84. <div class="col control">
  85. <div class="download" @click="onDownload(item, $event)"></div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import fileListMixin from '@/mixins/fileList'
  95. export default {
  96. layout: 'app-ross',
  97. mixins: [fileListMixin],
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. /* scss中可以用mixin来扩展 */
  102. @mixin ellipsis($line: 1) {
  103. overflow: hidden;
  104. text-overflow: ellipsis;
  105. display: -webkit-box;
  106. -webkit-line-clamp: $line;
  107. -webkit-box-orient: vertical;
  108. }
  109. // pc 端
  110. @media screen and (min-width: 768px) {
  111. ::v-deep {
  112. .el-breadcrumb {
  113. white-space: nowrap;
  114. overflow-y: scroll;
  115. padding-bottom: 16px;
  116. .el-breadcrumb__item {
  117. float: unset !important;
  118. }
  119. }
  120. }
  121. .page {
  122. margin-bottom: 16px;
  123. }
  124. .page-top {
  125. height: 360px;
  126. @include themify($themes) {
  127. background: themed('pc-banner-doc');
  128. background-size: auto 360px;
  129. }
  130. .logo {
  131. display: block;
  132. width: 120px;
  133. height: 120px;
  134. border-radius: 50%;
  135. background: #fff;
  136. }
  137. .name {
  138. font-size: 30px;
  139. color: #fff;
  140. }
  141. }
  142. .page-content {
  143. width: 1200px;
  144. margin: 0 auto;
  145. background-color: #fff;
  146. margin-top: 16px;
  147. box-sizing: border-box;
  148. overflow: hidden;
  149. padding: 32px 0;
  150. .el-breadcrumb {
  151. margin: 0 24px 32px;
  152. }
  153. .list-header,
  154. .list-body {
  155. font-size: 14px;
  156. color: #282828;
  157. .col {
  158. &:nth-child(1) {
  159. flex: 1;
  160. }
  161. &:nth-child(2),
  162. &:nth-child(3),
  163. &:nth-child(4) {
  164. width: 120px;
  165. text-align: center;
  166. }
  167. }
  168. }
  169. .list-header {
  170. .row {
  171. display: flex;
  172. justify-content: space-between;
  173. padding: 0 24px 16px;
  174. }
  175. }
  176. .list-body {
  177. .row {
  178. line-height: 70px;
  179. color: #666666;
  180. padding: 0 24px;
  181. transition: all 0.4s;
  182. &:hover {
  183. background: #fffaf3;
  184. }
  185. .section {
  186. display: flex;
  187. justify-content: space-between;
  188. border-top: 1px solid #f7f7f7;
  189. &.mobile {
  190. display: none;
  191. }
  192. }
  193. img {
  194. display: inline-block;
  195. width: 32px;
  196. height: 32px;
  197. background: #eee;
  198. margin-right: 24px;
  199. }
  200. .file-name {
  201. cursor: pointer;
  202. transition: all 0.4s;
  203. margin-left: 24px;
  204. &:hover {
  205. color: #f3920d;
  206. }
  207. }
  208. .control {
  209. display: flex;
  210. justify-content: center;
  211. align-items: center;
  212. .download {
  213. display: block;
  214. width: 24px;
  215. height: 24px;
  216. background: url(~assets/theme-images/common/pc-icon-download.png)
  217. no-repeat center;
  218. background-size: 24px;
  219. margin: 0 auto;
  220. cursor: pointer;
  221. &:hover {
  222. background-image: url(~assets/theme-images/common/pc-icon-download-hover.png);
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. // 移动 端
  231. @media screen and (max-width: 768px) {
  232. ::v-deep {
  233. .el-breadcrumb {
  234. white-space: nowrap;
  235. overflow-y: scroll;
  236. padding-bottom: 2.4vw;
  237. .el-breadcrumb__item {
  238. float: unset !important;
  239. }
  240. }
  241. }
  242. .page-top {
  243. height: 46vw;
  244. @include themify($themes) {
  245. background: themed('h5-banner-doc');
  246. background-size: auto 46vw;
  247. }
  248. .logo {
  249. display: block;
  250. width: 14.8vw;
  251. height: 14.8vw;
  252. border-radius: 50%;
  253. background: #fff;
  254. }
  255. .name {
  256. font-size: 4vw;
  257. color: #fff;
  258. text-align: center;
  259. margin: 0 3.2vw;
  260. }
  261. }
  262. .page-content {
  263. position: relative;
  264. padding: 8vw 0;
  265. .el-breadcrumb {
  266. margin: 0 4vw 4vw;
  267. }
  268. .list-header {
  269. display: none;
  270. }
  271. .list-body {
  272. font-size: 3.6vw;
  273. color: #282828;
  274. .row {
  275. color: #666666;
  276. padding: 0 4vw;
  277. .section {
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. border-bottom: 0.1vw solid #f7f7f7;
  282. height: 17.6vw;
  283. &.pc {
  284. display: none;
  285. }
  286. .file-cover {
  287. img {
  288. width: 8.8vw;
  289. height: 8.8vw;
  290. background: #eee;
  291. }
  292. }
  293. .file-content {
  294. flex: 1;
  295. margin: 0 4.8vw;
  296. .file-name {
  297. font-size: 3.6vw;
  298. @include ellipsis(1);
  299. }
  300. .file-info {
  301. font-size: 3vw;
  302. color: #999999;
  303. margin-top: 1.6vw;
  304. .size {
  305. margin-left: 4vw;
  306. }
  307. }
  308. }
  309. .control {
  310. width: 6.4vw;
  311. height: 6.4vw;
  312. .download {
  313. display: block;
  314. width: 6.4vw;
  315. height: 6.4vw;
  316. background: url(~assets/theme-images/common/h5-icon-download.png)
  317. no-repeat center;
  318. background-size: 6.4vw;
  319. margin: 0 auto;
  320. }
  321. }
  322. }
  323. }
  324. }
  325. }
  326. }
  327. </style>