_fileId.vue 8.2 KB

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