_fileId.vue 8.9 KB

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