index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <script setup>
  2. import { userInfo } from '~/store/user'
  3. const { uo_type, uo_name, user_id } = userInfo
  4. const router = useRouter();
  5. const isBureau = ref(false)// 当前用户是否局端
  6. isBureau.value = uo_type === '1'
  7. const list = ref([])
  8. const loading = ref(false)
  9. const finished = ref(false)
  10. let page = 1
  11. const param = $ref({
  12. hysyd_hyzt: '',
  13. hysyd_hymc: '',
  14. hysyd_chry_id: user_id
  15. })
  16. function onLoad() {
  17. loading.value = true
  18. request({
  19. url: '/jdbg/hy_hysyd/index',
  20. data: {
  21. page,
  22. limit: 20,
  23. ...param,
  24. },
  25. }).then((res) => {
  26. const data = res.data
  27. list.value = [...list.value, ...data.page_data]
  28. finished.value = data.total_page === page
  29. page++
  30. loading.value = false
  31. })
  32. }
  33. const searchValue = $ref('')
  34. function onClickSearch() {
  35. reGetList()
  36. }
  37. const yearOption = $ref([{ text: '状态', value: '' }, { text: '未开始', value: '0' }, { text: '进行中', value: '1' }, { text: '已结束', value: '2' }])
  38. const itemRef = ref(null)
  39. function onConfirm() {
  40. itemRef.value.toggle()
  41. reGetList()
  42. }
  43. function dropItemChange() {
  44. reGetList()
  45. }
  46. function reGetList() {
  47. page = 1
  48. list.value = []
  49. finished.value = false
  50. onLoad()
  51. }
  52. function handleLinkTo(item) {
  53. router.push({ path: '/reserveMeetingRooms/detail', query: { hysyd_id: item.hysyd_id } })
  54. }
  55. </script>
  56. <template>
  57. <div class="index">
  58. <van-search v-model="param.hysyd_hymc" :clearable="false" show-action placeholder="请输入搜索关键词"
  59. @search="onClickSearch">
  60. <template #action>
  61. <div @click="onClickSearch">
  62. 搜索
  63. </div>
  64. </template>
  65. </van-search>
  66. <van-dropdown-menu>
  67. <van-dropdown-item v-model="param.hysyd_hyzt" :options="yearOption" @change="dropItemChange" />
  68. </van-dropdown-menu>
  69. <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
  70. <van-cell v-for="item in list" :key="item" @click="handleLinkTo(item)">
  71. <template #title>
  72. <span>{{ `${item.hysyd_hymc}\u00A0\u00A0\u00A0 ${item.hysyd_hys_mc}` }}</span>
  73. </template>
  74. <template #value>
  75. <span style="color:black">状态:{{ item.hysyd_hyzt }}</span>
  76. </template>
  77. <template #label>
  78. <span class="van-ellipsis">会议时间:{{ item.hysyd_hysj_ks }}-{{ item.hysyd_hysj_js }}</span>
  79. </template>
  80. </van-cell>
  81. </van-list>
  82. </div>
  83. </template>
  84. <style lang="scss" scoped>
  85. :deep(.van-cell__title) {
  86. width: 70% !important;
  87. flex: auto
  88. }
  89. :deep(.van-cell__value) {
  90. width: 30% !important;
  91. flex: auto
  92. }
  93. </style>