expertDatabase.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <div class="container">
  3. <van-search
  4. v-model="keywords"
  5. placeholder="请输入搜索关键词"
  6. :left-icon="searchImg"
  7. :right-icon="closeImg"
  8. @search="onSearch"
  9. class="common-search"
  10. />
  11. <van-dropdown-menu>
  12. <van-dropdown-item v-model="areaType" :options="columns" />
  13. <van-dropdown-item v-model="value2" :options="option2" />
  14. </van-dropdown-menu>
  15. <van-list
  16. v-model:loading="loading"
  17. :finished="finished"
  18. finished-text="没有更多了"
  19. @load="onLoad"
  20. >
  21. <div v-for="(item,index) in list" :key="item.id">
  22. <div class="person-box" @click="personInform(item)">
  23. <div class="circle">
  24. <img :src="onlineUser" alt="" />
  25. </div>
  26. <div style="display: flex">
  27. <div class="information-card">
  28. <div style="display: flex; margin-top: 10px;">
  29. <div style="font-weight: bold">{{ item.name }}</div>
  30. <div class="notOnline" style="color: #638dce">
  31. {{ item.title }}
  32. </div>
  33. </div>
  34. <div style="font-size: 13px; margin-top: 5px; color: #979797">
  35. {{ item.unit }}
  36. </div>
  37. <div class="text-ellipsis" style="color: #979797; font-size: 13px">
  38. {{ item.position }}
  39. </div>
  40. </div>
  41. <img
  42. src="@/assets/images/expertDatabase/rightArrow.png"
  43. style="height: 30px; margin-right: 10px; margin-top: 40px"
  44. />
  45. </div>
  46. </div>
  47. <div class="link-top" />
  48. </div>
  49. </van-list>
  50. </div>
  51. <!-- <expertinformation-->
  52. <!-- v-if="isShowInform"-->
  53. <!-- class="modal-overlay"-->
  54. <!-- />-->
  55. </template>
  56. <script setup lang="ts">
  57. import searchImg from "@/assets/images/search.png";
  58. import closeImg from "@/assets/images/close.png";
  59. import onlineUser from "@/assets/images/threePreventionResponsiblePerson/onlineUsers.png";
  60. import offlineUser from "@/assets/images/threePreventionResponsiblePerson/offlineUsers.png";
  61. import expertinformation from "@/views/disasterRiskMonitor/expertinformation.vue";
  62. const router = useRouter();
  63. const keywords = ref();
  64. const areaType = ref("440900000");
  65. const value2 = ref("a");
  66. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  67. const { district_type } = toRefs<any>(
  68. proxy?.useDict("district_type")
  69. );
  70. const columns = computed(() => {
  71. let data = [{ text: "茂名市", value: "440900000" }];
  72. if (district_type.value && district_type.value.length > 0) {
  73. district_type.value.forEach(item => {
  74. data.push({ text: item.label, value: item.value });
  75. });
  76. }
  77. return data;
  78. });
  79. const option2 = [
  80. { text: "所有", value: "a" },
  81. { text: "自然灾害", value: "b" },
  82. { text: "事故灾难", value: "c" },
  83. { text: "公共卫生", value: "d" },
  84. { text: "社会安全", value: "e" },
  85. { text: "其他", value: "f" }
  86. ];
  87. const list = ref([
  88. {
  89. id: "1",
  90. name: "谢和平",
  91. unit: "国务院学位委员会、深圳大学深地科学与绿色能源研究院",
  92. position: "委员、院长",
  93. title: "教授",
  94. expertType: "其它突发事件"
  95. },
  96. {
  97. id: "2",
  98. name: "谢和平",
  99. unit: "国务院学位委员会、深圳大学深地科学与绿色能源研究院",
  100. position: "委员、院长",
  101. title: "教授",
  102. expertType: "其它突发事件"
  103. },
  104. {
  105. id: "3",
  106. name: "谢和平",
  107. unit: "国务院学位委员会、深圳大学深地科学与绿色能源研究院",
  108. position: "委员、院长",
  109. title: "教授",
  110. expertType: "其它突发事件"
  111. },
  112. {
  113. id: "4",
  114. name: "谢和平",
  115. unit: "国务院学位委员会、深圳大学深地科学与绿色能源研究院",
  116. position: "委员、院长",
  117. title: "教授",
  118. expertType: "其它突发事件"
  119. },
  120. {
  121. id: "5",
  122. name: "谢和平",
  123. unit: "国务院学位委员会、深圳大学深地科学与绿色能源研究院",
  124. position: "委员、院长",
  125. title: "教授",
  126. expertType: "其它突发事件"
  127. }
  128. ]);
  129. const loading = ref(false);
  130. const finished = ref(false);
  131. // const onLoad = () => {};
  132. const personInform = item => {
  133. router.push({ name: "Expertinformation", query: { id: item.id } });
  134. };
  135. </script>
  136. <style scoped lang="scss">
  137. .container {
  138. height: calc(100vh - 55px);
  139. .van-dropdown-menu {
  140. :deep(.van-dropdown-menu__bar) {
  141. background: transparent;
  142. box-shadow: none;
  143. }
  144. }
  145. }
  146. .common-search {
  147. :deep(.van-field__left-icon) {
  148. .van-icon__image {
  149. width: 12px;
  150. height: 12px;
  151. }
  152. }
  153. :deep(.van-field__right-icon) {
  154. width: 30px;
  155. height: 30px;
  156. padding: 0;
  157. .van-icon__image {
  158. width: 30px;
  159. height: 30px;
  160. }
  161. }
  162. }
  163. .person-box {
  164. display: flex;
  165. flex-direction: row;
  166. padding-left: 8px;
  167. background-color: #ffffff;
  168. }
  169. .circle {
  170. width: 80px;
  171. height: 80px;
  172. border-radius: 50%;
  173. background-color: #eaeaea;
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. color: black;
  178. font-size: 15px;
  179. margin: 15px 5px 15px;
  180. }
  181. .information-card {
  182. display: flex;
  183. flex-direction: column;
  184. margin-left: 10px;
  185. width: 230px;
  186. margin-top: 2px;
  187. }
  188. .one {
  189. -webkit-line-clamp: 2; /* 限制显示的行数为2 */
  190. overflow: hidden; /* 隐藏超出部分 */
  191. text-overflow: ellipsis; /* 使用省略号表示被截断的部分 */
  192. }
  193. .notOnline {
  194. font-size: 12px;
  195. background-color: #f1f3fb;
  196. padding-left: 5px;
  197. height: 15px;
  198. width: 35px;
  199. padding-bottom: 18px;
  200. border-radius: 2px;
  201. color: #ffffff;
  202. margin-top: 5px;
  203. margin-left: 10px;
  204. }
  205. .text-ellipsis {
  206. margin-top: 3px;
  207. width: 250px;
  208. white-space: nowrap;
  209. overflow: hidden;
  210. text-overflow: ellipsis;
  211. font-size: 14px;
  212. }
  213. .type-name {
  214. background-color: #eff2fc;
  215. padding: 3px 15px;
  216. font-size: 13px;
  217. color: #8d9bc8;
  218. margin-right: 3px;
  219. border-radius: 2px;
  220. &:nth-last-child {
  221. margin-right: 0;
  222. }
  223. margin-bottom: 3px;
  224. }
  225. .force-newline {
  226. margin-right: 100%; /* 足够大的值来触发换行 */
  227. }
  228. .link-top {
  229. height: 0.5px;
  230. border-top: solid #f2f2f2 1px;
  231. }
  232. .isOnline {
  233. background-color: limegreen;
  234. }
  235. .modal-overlay {
  236. position: fixed;
  237. top: 0;
  238. left: 0;
  239. width: 100%;
  240. background-color: #f4f8fa;
  241. display: flex;
  242. justify-content: center;
  243. align-items: center;
  244. z-index: 1000;
  245. height: calc(100vh - 55px);
  246. }
  247. </style>