ReportMessage.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="report-message">
  3. <div class="flex reportmessage-head-tabs">
  4. <div
  5. class="flex justify-center items-center tab-item"
  6. :class="{ 'tab-item-active': type === item.value }"
  7. @click="switchTable(item.value)"
  8. v-for="item in typeName"
  9. :key="item.value"
  10. >
  11. {{ item.label }}
  12. </div>
  13. </div>
  14. <Form />
  15. </div>
  16. </template>
  17. <script setup lang="ts">
  18. import Form from './components/Form.vue';
  19. import { typeName } from '@/views/message/constant';
  20. import { storeToRefs } from 'pinia';
  21. import useFormList from './store/useFormList';
  22. const formStore = useFormList();
  23. const { type } = storeToRefs(formStore);
  24. const switchTable = (value) => {
  25. type.value = value;
  26. };
  27. </script>
  28. <style scoped lang="scss">
  29. .report-message {
  30. height: calc(100vh - 64px - 18px);
  31. background-color: rgba(255, 255, 255, 1);
  32. padding: 21px;
  33. }
  34. .reportmessage-head {
  35. height: 56px;
  36. &-tabs {
  37. margin: 18px 0;
  38. .tab-item {
  39. width: 188px;
  40. height: 38px;
  41. background: #fafafa;
  42. border: 1px solid #d9d9d9;
  43. cursor: pointer;
  44. &-active {
  45. color: rgba(22, 119, 255, 1);
  46. background: #e2eefe;
  47. border: 1px solid #1890ff;
  48. }
  49. }
  50. :first-child {
  51. border-radius: 8px 0px 0px 8px;
  52. }
  53. :last-child {
  54. border-radius: 0px 8px 8px 0px;
  55. }
  56. }
  57. }
  58. </style>