ReportMessage.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div class="report-message">
  3. <div class="flex reportmessage-head-tabs" v-if="!hideReportMessageTabs">
  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. import { computed } from 'vue';
  23. import { useGlobSetting } from '@/hooks/setting';
  24. const formStore = useFormList();
  25. const { type } = storeToRefs(formStore);
  26. const switchTable = (value) => {
  27. type.value = value;
  28. };
  29. const { hideReportMessageTabs } = useGlobSetting();
  30. </script>
  31. <style scoped lang="scss">
  32. .report-message {
  33. height: calc(100vh - 64px - 18px);
  34. background-color: rgba(255, 255, 255, 1);
  35. padding: 21px;
  36. }
  37. .reportmessage-head {
  38. height: 56px;
  39. &-tabs {
  40. margin: 18px 0;
  41. .tab-item {
  42. width: 188px;
  43. height: 38px;
  44. background: #fafafa;
  45. border: 1px solid #d9d9d9;
  46. cursor: pointer;
  47. &-active {
  48. color: rgba(22, 119, 255, 1);
  49. background: #e2eefe;
  50. border: 1px solid #1890ff;
  51. }
  52. }
  53. :first-child {
  54. border-radius: 8px 0px 0px 8px;
  55. }
  56. :last-child {
  57. border-radius: 0px 8px 8px 0px;
  58. }
  59. }
  60. }
  61. </style>