_fileId.vue 7.9 KB

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