index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <v-card class="card-box pa-3">
  3. <CtTable
  4. :items="tableData"
  5. :headers="headers"
  6. :loading="loading"
  7. :elevation="0"
  8. :is-tools="false"
  9. :showPage="true"
  10. :total="total"
  11. :page-info="query"
  12. itemKey="id"
  13. @pageHandleChange="handleChangePage"
  14. >
  15. <template #enterpriseName="{ item }">
  16. <div class="d-flex align-center">
  17. <v-avatar class="entLogoImg" tile size="40" :image="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></v-avatar>
  18. <span class="ml-3 color-primary cursor-pointer" @click="handleDetail(item.id)">{{ formatName(item.anotherName || item.name) }}</span>
  19. </div>
  20. </template>
  21. <template #studentCount="{ item }">
  22. <span class="color-primary cursor-pointer" @click="handleStudent(item.id)">{{ item.studentCount || 0 }}人</span>
  23. </template>
  24. </CtTable>
  25. </v-card>
  26. <CtDialog :visible="drill.show" :widthType="1" titleClass="text-h6" :footer="false" :title="title" @close="handleClose">
  27. <CtTable
  28. :items="drill.list"
  29. :headers="drill.headers"
  30. :loading="false"
  31. :elevation="0"
  32. :isTools="false"
  33. :showPage="true"
  34. :total="drill.total"
  35. :page-info="drill.query"
  36. itemKey="id"
  37. @pageHandleChange="handleChangeDrillPage"
  38. >
  39. </CtTable>
  40. </CtDialog>
  41. </template>
  42. <script setup>
  43. defineOptions({name: 'internship-company'})
  44. import { ref, onMounted } from 'vue'
  45. import { internshipCompanyList } from '@/api/school'
  46. import { formatName } from '@/utils/getText'
  47. const total = ref(0)
  48. const loading = ref(false)
  49. const query = ref({
  50. size: 10,
  51. current: 10,
  52. schoolId: JSON.parse(localStorage.getItem('schoolInfo'))?.schoolId
  53. })
  54. const tableData = ref([
  55. {
  56. "id": 1,
  57. "name": "门墩儿信息科技有限公司",
  58. "anotherName": "门墩儿",
  59. "industryId": "1829087620475494402",
  60. "industryName": '互联网',
  61. "scale": "0",
  62. "scaleName": '0-20人',
  63. "logoUrl": "https://minio.menduner.com/dev/1e6893918ef378ca280360078dfe74ade10b27101c89865261824b46de7d34a6.png",
  64. studentCount: 2
  65. }
  66. ])
  67. const headers = [
  68. { title: '企业名称', key: 'enterpriseName', sortable: false },
  69. { title: '在岗实习学生', key: 'studentCount', sortable: false },
  70. { title: '所在行业', key: 'industryName', sortable: false },
  71. { title: '企业规模', key: 'scaleName', sortable: false }
  72. ]
  73. const getList = async () => {
  74. try {
  75. const data = await internshipCompanyList(query.value)
  76. console.log(data, 'data')
  77. } catch {}
  78. }
  79. const handleChangePage = (page) => {
  80. query.value.current = page
  81. getList()
  82. }
  83. // 跳转企业详情
  84. const handleDetail = (id) => {
  85. if (!id) return
  86. window.open(`/recruit/personal/company/details/${id}?key=briefIntroduction`)
  87. }
  88. const drill = ref({
  89. total: 0,
  90. query: {
  91. size: 10,
  92. current: 1
  93. },
  94. show: false,
  95. list: [],
  96. headers: [
  97. { title: '学生姓名', key: 'studentName', sortable: false },
  98. ]
  99. })
  100. // 在岗实习学生列表
  101. const handleStudent = (id) => {
  102. drill.value.query.current = 1
  103. drill.value.show = true
  104. }
  105. const handleChangeDrillPage = (page) => {
  106. drill.value.query.current = page
  107. }
  108. const handleClose = () => {
  109. drill.value.show = false
  110. drill.value.list = []
  111. }
  112. onMounted(async () => {
  113. // await getList()
  114. })
  115. </script>
  116. <style lang="scss" scoped>
  117. </style>