PageDrillSignList.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="safety-platform-container">
  3. <header class="safety-platform-container__header">
  4. <div class="breadcrumb-title"> 演练会签 </div>
  5. </header>
  6. <main class="safety-platform-container__main">
  7. <div class="search-table-container">
  8. <BasicSearch :search-data="searchData" :search-config="DRILL_SIGN_LIST_SEARCH_CONFIG">
  9. <template #drillScope>
  10. <el-select v-model="searchData.drillScope" placeholder="请选择演练规模" filterable>
  11. <el-option
  12. v-for="item in drillScopeDice"
  13. :key="item.itemCode"
  14. :label="item.itemValue"
  15. :value="item.itemCode"
  16. />
  17. </el-select>
  18. </template>
  19. <template #drillTime>
  20. <el-date-picker
  21. v-model="searchData.drillTime"
  22. type="daterange"
  23. range-separator="至"
  24. start-placeholder="开始时间"
  25. end-placeholder="结束时间"
  26. @change="handleDateChange"
  27. />
  28. </template>
  29. </BasicSearch>
  30. <!-- 表格 -->
  31. </div>
  32. </main>
  33. </div>
  34. </template>
  35. <script setup lang="ts">
  36. import { onMounted, reactive } from 'vue';
  37. import BasicSearch from '@/components/BasicSearch.vue';
  38. import { useEmergencyDrillHook } from './hook';
  39. import type { DrillSignSearch } from '@/types/emergency-drill';
  40. import { DRILL_SIGN_LIST_SEARCH_CONFIG } from './configs/sign';
  41. const { drillScopeDice, getDrillScopeDict } = useEmergencyDrillHook();
  42. const searchData = reactive<DrillSignSearch>({
  43. signType: null,
  44. drillScope: null,
  45. drillContent: null,
  46. drillTime: null,
  47. });
  48. const handleDateChange = (val: string[]) => {
  49. if (val && val.length === 2) {
  50. const [startDate, endDate] = val;
  51. searchData.drillTime = [`${startDate} 00:00:00`, `${endDate} 23:59:59`];
  52. return;
  53. }
  54. };
  55. onMounted(() => {
  56. getDrillScopeDict();
  57. });
  58. </script>
  59. <style scoped lang="scss">
  60. @use '@/styles/page-details-layout.scss' as *;
  61. @use '@/styles/page-main-layout.scss' as *;
  62. </style>