_fileId.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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. // 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. @include useTheme() {
  112. margin-bottom: 16px;
  113. .page-top {
  114. height: 360px;
  115. background: fetch('pc-banner-doc');
  116. background-size: auto 360px;
  117. .logo {
  118. display: block;
  119. width: 120px;
  120. height: 120px;
  121. border-radius: 50%;
  122. background: #fff;
  123. }
  124. .name {
  125. font-size: 30px;
  126. color: #fff;
  127. }
  128. }
  129. .page-content {
  130. width: 1200px;
  131. margin: 0 auto;
  132. background-color: #fff;
  133. margin-top: 16px;
  134. box-sizing: border-box;
  135. overflow: hidden;
  136. padding: 32px 0;
  137. .el-breadcrumb {
  138. margin: 0 24px 32px;
  139. }
  140. .list-header,
  141. .list-body {
  142. font-size: 14px;
  143. color: #282828;
  144. .col {
  145. &:nth-child(1) {
  146. flex: 1;
  147. }
  148. &:nth-child(2),
  149. &:nth-child(3),
  150. &:nth-child(4) {
  151. width: 120px;
  152. text-align: center;
  153. }
  154. }
  155. }
  156. .list-header {
  157. .row {
  158. display: flex;
  159. justify-content: space-between;
  160. padding: 0 24px 16px;
  161. }
  162. }
  163. .list-body {
  164. .row {
  165. line-height: 70px;
  166. color: #666666;
  167. padding: 0 24px;
  168. transition: all 0.4s;
  169. &:hover {
  170. background: #fff1f2;
  171. }
  172. .section {
  173. display: flex;
  174. justify-content: space-between;
  175. border-top: 1px solid #f7f7f7;
  176. &.mobile {
  177. display: none;
  178. }
  179. }
  180. img {
  181. display: inline-block;
  182. width: 32px;
  183. height: 32px;
  184. background: #eee;
  185. margin-right: 24px;
  186. }
  187. .file-name {
  188. cursor: pointer;
  189. transition: all 0.4s;
  190. margin-left: 24px;
  191. &:hover {
  192. color: #bc1724;
  193. }
  194. }
  195. .control {
  196. display: flex;
  197. justify-content: center;
  198. align-items: center;
  199. .download {
  200. display: block;
  201. width: 24px;
  202. height: 24px;
  203. background: url(~assets/theme-images/common/pc-icon-download.png)
  204. no-repeat center;
  205. background-size: 24px;
  206. margin: 0 auto;
  207. cursor: pointer;
  208. &:hover {
  209. background-image: url(~assets/theme-images/common/pc-icon-download-hover.png);
  210. }
  211. }
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. // 移动 端
  220. @media screen and (max-width: 768px) {
  221. ::v-deep {
  222. .el-breadcrumb {
  223. white-space: nowrap;
  224. overflow-y: scroll;
  225. padding-bottom: 2.4vw;
  226. .el-breadcrumb__item {
  227. float: unset !important;
  228. }
  229. }
  230. }
  231. .page {
  232. .page-top {
  233. @include useTheme() {
  234. height: 46vw;
  235. background: fetch('h5-banner-doc');
  236. background-size: auto 46vw;
  237. .logo {
  238. display: block;
  239. width: 14.8vw;
  240. height: 14.8vw;
  241. border-radius: 50%;
  242. background: #fff;
  243. }
  244. .name {
  245. font-size: 4vw;
  246. color: #fff;
  247. text-align: center;
  248. margin: 0 3.2vw;
  249. }
  250. }
  251. .page-content {
  252. position: relative;
  253. padding: 8vw 0;
  254. .el-breadcrumb {
  255. margin: 0 4vw 4vw;
  256. }
  257. .list-header {
  258. display: none;
  259. }
  260. .list-body {
  261. font-size: 3.6vw;
  262. color: #282828;
  263. .row {
  264. color: #666666;
  265. padding: 0 4vw;
  266. .section {
  267. display: flex;
  268. justify-content: space-between;
  269. align-items: center;
  270. border-bottom: 0.1vw solid #f7f7f7;
  271. height: 17.6vw;
  272. &.pc {
  273. display: none;
  274. }
  275. .file-cover {
  276. img {
  277. width: 8.8vw;
  278. height: 8.8vw;
  279. background: #eee;
  280. }
  281. }
  282. .file-content {
  283. flex: 1;
  284. margin: 0 4.8vw;
  285. .file-name {
  286. font-size: 3.6vw;
  287. @include ellipsis(1);
  288. }
  289. .file-info {
  290. font-size: 3vw;
  291. color: #999999;
  292. margin-top: 1.6vw;
  293. .size {
  294. margin-left: 4vw;
  295. }
  296. }
  297. }
  298. .control {
  299. width: 6.4vw;
  300. height: 6.4vw;
  301. .download {
  302. display: block;
  303. width: 6.4vw;
  304. height: 6.4vw;
  305. background: url(~assets/theme-images/common/h5-icon-download.png)
  306. no-repeat center;
  307. background-size: 6.4vw;
  308. margin: 0 auto;
  309. }
  310. }
  311. }
  312. }
  313. }
  314. }
  315. }
  316. }
  317. }
  318. </style>