archives.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="archives-page">
  3. <custom-header name="信息化档案"></custom-header>
  4. <div class="archives-content">
  5. <div class="archives-header">
  6. <el-select class="header-item" v-model="value" placeholder="Select" style="width: 240px">
  7. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  8. </el-select>
  9. <div class="sort header-item" @click="toggleSort">
  10. <span>时间排序</span>
  11. <div class="sort-icon">
  12. <el-icon :class="{ active: sortDirection === 'asc' }"><CaretTop /></el-icon>
  13. <el-icon class="caret-bottom" :class="{ active: sortDirection === 'desc' }"><CaretBottom /></el-icon>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="archives-list">
  18. <div class="archives-item" v-for="item in 3" :key="item" @click="handleItem(item)">
  19. <div class="item-content">
  20. <div class="img"></div>
  21. <div class="archives-info">
  22. <div class="info-title">
  23. <span class="title-text">无人机飞巡报告</span>
  24. <span>查看详情</span>
  25. </div>
  26. <div class="info-desc van-multi-ellipsis--l2">果园面积共XX亩,共有XX棵生树本次飞巡拍摄了XX张照片,包括果园面积共XX亩,共有XX棵</div>
  27. </div>
  28. </div>
  29. <div class="item-footer">
  30. <span>来自 从化荔博园</span>
  31. <span>2025.05.28</span>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script setup>
  39. import customHeader from "@/components/customHeader.vue";
  40. import { ref } from "vue";
  41. import { useRouter } from "vue-router";
  42. const router = useRouter();
  43. const value = ref("Option1");
  44. const options = [
  45. {
  46. value: "Option1",
  47. label: "农事类型",
  48. },
  49. {
  50. value: "Option2",
  51. label: "Option2",
  52. },
  53. ];
  54. // 排序方向状态:asc-升序,desc-降序,null-无排序
  55. const sortDirection = ref(null);
  56. // 切换排序方向
  57. const toggleSort = () => {
  58. if (sortDirection.value === null) {
  59. sortDirection.value = 'asc';
  60. } else if (sortDirection.value === 'asc') {
  61. sortDirection.value = 'desc';
  62. } else {
  63. sortDirection.value = 'asc';
  64. }
  65. // 这里可以添加实际的排序逻辑
  66. console.log('排序方向:', sortDirection.value);
  67. };
  68. const handleItem = (item) => {
  69. router.push("/report_detail");
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .archives-page {
  74. width: 100%;
  75. height: 100vh;
  76. background-color: #f7f7f7;
  77. .archives-content {
  78. width: 100%;
  79. height: 100%;
  80. padding: 12px;
  81. box-sizing: border-box;
  82. .archives-header{
  83. display: flex;
  84. align-items: center;
  85. gap: 10px;
  86. .header-item{
  87. flex: 1;
  88. ::v-deep{
  89. .el-select__wrapper{
  90. padding: 7px 0;
  91. justify-content: center;
  92. background: none;
  93. }
  94. .el-select__selection {
  95. flex: none;
  96. width: fit-content;
  97. }
  98. .el-select__placeholder {
  99. position: static;
  100. transform: none;
  101. width: fit-content;
  102. color: #6D6D6D;
  103. }
  104. .el-select__caret {
  105. color: #6D6D6D;
  106. }
  107. }
  108. }
  109. .sort{
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. color: #6D6D6D;
  114. padding: 7px 0;
  115. border-radius: 4px;
  116. border: 1px solid #DDDDDD;
  117. .sort-icon{
  118. display: flex;
  119. flex-direction: column;
  120. margin-left: 2px;
  121. .caret-bottom{
  122. margin-top: -8px;
  123. }
  124. .el-icon {
  125. color: #6D6D6D;
  126. &.active {
  127. color: #409EFF;
  128. }
  129. }
  130. }
  131. }
  132. }
  133. .archives-list{
  134. .archives-item{
  135. margin-top: 12px;
  136. border-radius: 8px;
  137. background: #fff;
  138. padding: 10px;
  139. .item-content{
  140. display: flex;
  141. margin-bottom: 12px;
  142. .img{
  143. width: 64px;
  144. height: 64px;
  145. border-radius: 8px;
  146. margin-right: 16px;
  147. background-color: red;
  148. }
  149. .archives-info{
  150. width: calc(100% - 64px - 16px);
  151. .info-title{
  152. display: flex;
  153. justify-content: space-between;
  154. align-items: center;
  155. color: #A8A8A8;
  156. font-size: 12px;
  157. .title-text{
  158. font-size: 16px;
  159. font-weight: 500;
  160. color: #000;
  161. }
  162. }
  163. .info-desc{
  164. margin-top: 5px;
  165. font-size: 12px;
  166. color: #575757;
  167. }
  168. }
  169. }
  170. .item-footer{
  171. border-top: 1px solid rgba(0, 0, 0, 0.1);
  172. padding-top: 12px;
  173. display: flex;
  174. justify-content: space-between;
  175. align-items: center;
  176. color: #999999;
  177. }
  178. }
  179. }
  180. }
  181. }
  182. </style>