TenderPool.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="pool-page">
  3. <div class="page-tabs">
  4. <span
  5. v-for="tab in tabs"
  6. :key="tab.value"
  7. :class="['page-tab', { active: activeTab === tab.value }]"
  8. @click="handleTabClick(tab.value)"
  9. >
  10. {{ tab.label }}
  11. </span>
  12. </div>
  13. <div class="pool-content">
  14. <Monitor v-if="activeTab === 'monitor'" :historyProjectData="(historyProjects as any)"></Monitor>
  15. <!-- <Notice v-if="activeTab === 'notice'"></Notice> -->
  16. <Intention v-if="activeTab === 'intention'" :historyProjectData="(historyProjects as any)"></Intention>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup lang="ts">
  21. import { ref,onMounted } from 'vue'
  22. import Monitor from '@/components/tenderpool/Monitor.vue'
  23. // import Notice from '@/components/tenderpool/Notice.vue'
  24. import Intention from '@/components/tenderpool/Intention.vue'
  25. import api from '@/api/common'
  26. const historyProjects = ref<any[]>([])
  27. const activeTab = ref('monitor')
  28. const tabs = ref([
  29. { label: '招标监测', value: 'monitor' },
  30. // { label: '招标公告', value: 'notice' },
  31. { label: '招标意向', value: 'intention' },
  32. ])
  33. onMounted(() => {
  34. initData()
  35. })
  36. const initData = () => {
  37. getHistoryProjects()
  38. }
  39. const getHistoryProjects = () => {
  40. api.getHistoryPartner().then(res => {
  41. historyProjects.value = (res as any).content || []
  42. })
  43. }
  44. const handleTabClick = (tab: string) => {
  45. activeTab.value = tab
  46. }
  47. </script>
  48. <style scoped>
  49. .pool-page {
  50. width: 100%;
  51. }
  52. .pool-content {
  53. width: 100%;
  54. height: 100%;
  55. }
  56. .page-tabs {
  57. display: flex;
  58. gap: 0;
  59. margin-bottom: 16px;
  60. border-bottom: 1px solid #e8ecef;
  61. /* justify-content: space-between; */
  62. align-items: center;
  63. }
  64. .btn-right {
  65. margin-left: auto;
  66. }
  67. .page-tab {
  68. padding: 10px 18px;
  69. border: none;
  70. background: none;
  71. font-family: inherit;
  72. font-size: 13px;
  73. color: #5c6f82;
  74. cursor: pointer;
  75. border-bottom: 2px solid transparent;
  76. margin-bottom: -1px;
  77. }
  78. .page-tab.active {
  79. color: #0d9488;
  80. border-bottom-color: #0d9488;
  81. font-weight: 600;
  82. }
  83. @media (max-width: 1100px) {
  84. .pool-stats {
  85. grid-template-columns: repeat(2, 1fr);
  86. }
  87. }
  88. </style>