index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <div>
  3. <el-collapse v-model="activeNames" @change="handleChange">
  4. <div v-if="isList">
  5. <el-collapse-item name="folder">
  6. <template #title>
  7. <span class="collapseItem_title">文件夹</span>
  8. </template>
  9. <!-- 表格 -->
  10. <el-table
  11. :data="tableData"
  12. style="width: 100%"
  13. height="250"
  14. :scrollbar-always-on="true"
  15. >
  16. <el-table-column fixed prop="date" label="名称" width="500">
  17. <template #default="scope">
  18. <div>
  19. <img
  20. class="table_icon"
  21. src="../../../assets/images/fileBox.png"
  22. alt=""
  23. style=""
  24. />
  25. {{ scope.row.date }}
  26. </div>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="name" label="时间" width="200" />
  30. <el-table-column prop="state" label="类型" width="180" />
  31. <el-table-column prop="city" label="大小" width="160" />
  32. </el-table>
  33. </el-collapse-item>
  34. <el-collapse-item name="file">
  35. <template #title>
  36. <span class="collapseItem_title">文件</span>
  37. </template>
  38. <!-- 表格 -->
  39. <el-table
  40. :data="tableData"
  41. style="width: 100%"
  42. height="250"
  43. :scrollbar-always-on="true"
  44. >
  45. <el-table-column fixed prop="date" label="名称" width="500">
  46. <template #default="scope">
  47. <div>
  48. <img
  49. class="table_icon"
  50. src="../../../assets/images/fileBox.png"
  51. alt=""
  52. style=""
  53. />
  54. {{ scope.row.date }}
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="name" label="时间" width="200" />
  59. <el-table-column prop="state" label="类型" width="180" />
  60. <el-table-column prop="city" label="大小" width="160" />
  61. </el-table>
  62. </el-collapse-item>
  63. </div>
  64. <div v-else>
  65. <el-collapse-item name="folder">
  66. <template #title>
  67. <span class="collapseItem_title">文件夹</span>
  68. </template>
  69. <!-- 平铺 -->
  70. <el-scrollbar height="360px">
  71. <div class="tile_box">
  72. <div class="file_box" v-for="item in 20" :key="item">
  73. <img
  74. class="big_file_img"
  75. src="../../../assets/images/fileBox.png"
  76. alt=""
  77. />
  78. <span>Inceptos</span>
  79. </div>
  80. </div>
  81. </el-scrollbar>
  82. </el-collapse-item>
  83. <el-collapse-item name="file">
  84. <template #title>
  85. <span class="collapseItem_title">文件</span>
  86. </template>
  87. <!-- 平铺 -->
  88. <el-scrollbar height="360px">
  89. <div class="tile_box">
  90. <div class="file_box" v-for="item in 20" :key="item">
  91. <img
  92. class="big_file_img"
  93. src="../../../assets/images/fileType//file/DOC.png"
  94. alt=""
  95. />
  96. <span>Inceptos</span>
  97. </div>
  98. </div>
  99. </el-scrollbar>
  100. </el-collapse-item>
  101. </div>
  102. </el-collapse>
  103. </div>
  104. </template>
  105. <script setup>
  106. import { onMounted, ref } from "vue";
  107. import { listRecent } from "../../../api/biz/recent";
  108. const activeNames = ref(["folder", "file"]);
  109. const isList = ref(false); //控制显示方式
  110. onMounted(() => {
  111. getList();
  112. });
  113. const getList = async () => {
  114. const res = await listRecent();
  115. console.log("res = ", res);
  116. };
  117. const handleChange = (val) => {
  118. // console.log(val);
  119. };
  120. const tableData = [
  121. {
  122. date: "2016-05-03",
  123. name: "Tom",
  124. state: "California",
  125. city: "Los Angeles",
  126. address: "No. 189, Grove St, Los Angeles",
  127. zip: "CA 90036",
  128. },
  129. {
  130. date: "2016-05-02",
  131. name: "Tom",
  132. state: "California",
  133. city: "Los Angeles",
  134. address: "No. 189, Grove St, Los Angeles",
  135. zip: "CA 90036",
  136. },
  137. {
  138. date: "2016-05-04",
  139. name: "Tom",
  140. state: "California",
  141. city: "Los Angeles",
  142. address: "No. 189, Grove St, Los Angeles",
  143. zip: "CA 90036",
  144. },
  145. {
  146. date: "2016-05-01",
  147. name: "Tom",
  148. state: "California",
  149. city: "Los Angeles",
  150. address: "No. 189, Grove St, Los Angeles",
  151. zip: "CA 90036",
  152. },
  153. {
  154. date: "2016-05-08",
  155. name: "Tom",
  156. state: "California",
  157. city: "Los Angeles",
  158. address: "No. 189, Grove St, Los Angeles",
  159. zip: "CA 90036",
  160. },
  161. {
  162. date: "2016-05-06",
  163. name: "Tom",
  164. state: "California",
  165. city: "Los Angeles",
  166. address: "No. 189, Grove St, Los Angeles",
  167. zip: "CA 90036",
  168. },
  169. {
  170. date: "2016-05-07",
  171. name: "Tom",
  172. state: "California",
  173. city: "Los Angeles",
  174. address: "No. 189, Grove St, Los Angeles",
  175. zip: "CA 90036",
  176. },
  177. ];
  178. </script>
  179. <style lang="scss" scoped>
  180. .table_icon {
  181. height: 27px;
  182. width: 27px;
  183. vertical-align: middle;
  184. }
  185. ::v-deep .el-collapse-item__content {
  186. padding-bottom: 0;
  187. }
  188. ::v-deep .el-collapse-item__header {
  189. background-color: #ebeff6 !important;
  190. width: 100% !important;
  191. height: 24px !important;
  192. }
  193. ::v-deep .el-collapse-item__arrow {
  194. position: relative;
  195. color: #2e6bc8;
  196. right: 97%;
  197. }
  198. ::v-deep .el-table td.el-table__cell {
  199. border: none;
  200. font-size: 14px !important;
  201. font-weight: 400 !important;
  202. color: #000 !important;
  203. }
  204. ::v-deep .el-table__row {
  205. height: 35px !important;
  206. }
  207. ::v-deep .el-table .el-table__header-wrapper th {
  208. border-bottom: none;
  209. border-right: 1px solid #c1cce3;
  210. background-color: #fff !important;
  211. color: #505870;
  212. font-size: 14px;
  213. }
  214. .collapseItem_title {
  215. position: relative;
  216. left: 40px;
  217. color: #2e6bc8;
  218. font-family: Inter-Medium;
  219. font-size: 12px;
  220. }
  221. // 表格右边3个靠右对齐
  222. ::v-deep .el-table__header thead tr th {
  223. font-family: Inter-Medium;
  224. font-size: 14px;
  225. color: #505870;
  226. text-align: right;
  227. &:nth-child(1) {
  228. text-align: left;
  229. }
  230. }
  231. // ::v-deep .el-table__body tbody [class*="column_2"] {
  232. // text-align: right;
  233. // }
  234. // ::v-deep .el-table__body tbody [class*="column_3"] {
  235. // text-align: right;
  236. // }
  237. // ::v-deep .el-table__body tbody [class*="column_4"] {
  238. // text-align: right;
  239. // }
  240. // ::v-deep .el-table__body tbody [class*="column_6"] {
  241. // text-align: right;
  242. // }
  243. // ::v-deep .el-table__body tbody [class*="column_7"] {
  244. // text-align: right;
  245. // }
  246. // ::v-deep .el-table__body tbody [class*="column_8"] {
  247. // text-align: right;
  248. // }
  249. ::v-deep .el-table__body tbody [class*="column_"] {
  250. text-align: right;
  251. &:nth-child(4n+1){
  252. text-align: left;
  253. }
  254. }
  255. //平铺
  256. .tile_box {
  257. width: 100%;
  258. height: 300px;
  259. display: flex;
  260. flex-wrap: wrap;
  261. .file_box {
  262. width: 116px;
  263. min-height: 138px;
  264. // border: 1px solid #000;
  265. display: flex;
  266. flex-direction: column;
  267. align-items: center;
  268. .big_file_img {
  269. width: 100px;
  270. height: 100px;
  271. }
  272. span {
  273. font-size: 14px;
  274. font-weight: 400;
  275. line-height: 22px;
  276. }
  277. }
  278. }
  279. </style>