_fileId.vue 8.1 KB

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