Browse Source

教师面包屑

lifanagju_citu 2 tháng trước cách đây
mục cha
commit
4db08c7038

+ 2 - 1
components.d.ts

@@ -33,6 +33,7 @@ declare module 'vue' {
     Echarts: typeof import('./src/components/Echarts/index.vue')['default']
     ElCascader: typeof import('element-plus/es')['ElCascader']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
+    ElTree: typeof import('element-plus/es')['ElTree']
     Empty: typeof import('./src/components/Empty/index.vue')['default']
     File: typeof import('./src/components/Upload/file.vue')['default']
     HeadSearch: typeof import('./src/components/headSearch/index.vue')['default']
@@ -46,7 +47,7 @@ declare module 'vue' {
     IndustryTypeCard: typeof import('./src/components/industryTypeCard/index.vue')['default']
     Info: typeof import('./src/components/Enterprise/info.vue')['default']
     InitPay: typeof import('./src/components/personalRecharge/initPay.vue')['default']
-    Item: typeof import('./src/components/PositionLongStrip/item.vue')['default']
+    Item: typeof import('./src/components/Position/item.vue')['default']
     JobTypeCard: typeof import('./src/components/jobTypeCard/index.vue')['default']
     ListGroup: typeof import('./src/components/FormUI/nestedListGroup/components/listGroup.vue')['default']
     Loading: typeof import('./src/components/Loading/index.vue')['default']

+ 17 - 1
src/api/school.js

@@ -29,4 +29,20 @@ export const getSchoolAuditById = async (data) => {
 		url: '/app-api/flames/user/auth/record/get',
 		data
 	})
-}
+}
+
+// 学校组织查询
+export const schoolOrganization = async (data) => {
+	return await request.post({
+		url: '/app-api/flames/school/organization',
+		data
+	})
+}
+
+// 学生列表
+export const studentList = async (data) => {
+	return await request.post({
+		url: '/app-api/flames/student/list',
+		data
+	})
+}

+ 2 - 2
src/layout/teacher.vue

@@ -6,7 +6,7 @@
       <div class="content-box d-flex flex-column" :style="`width: ${ !isInWhiteList(route.path) ? 'calc(100% - 230px)' : '100%'}`">
         <div v-if="!isInWhiteList(route.path)" class="breadcrumbs_sticky">
           <div class=" d-flex align-center justify-space-between">
-            <v-breadcrumbs :items="system.breadcrumbs" elevation="3">
+            <v-breadcrumbs :items="system.teacherBreadcrumbs" elevation="3">
               <template v-slot:item="{ item }">
                 <span class="text" :class="{active: !item.disabled}" @click="toPath(item)">{{ item.text }}</span>
               </template>
@@ -60,7 +60,7 @@ watch(
   () => route.matched,
   async (val) => {
     // getTitle(val, route.fullPath)
-    system.setBreadcrumbs(val, route.fullPath)
+    system.setTeacherBreadcrumbs(val, route.fullPath)
   },
   { immediate: true },
   { deep: true }

+ 1 - 1
src/router/modules/components/recruit/teacher.js

@@ -23,7 +23,7 @@ const teacher = [
         component: () => import('@/views/recruit/teacher/studentList/index.vue')
       },
       {
-        path: '/recruit/teacher/studentDetails',
+        path: '/recruit/teacher/studentDetails/:id',
         show: true,
         meta: {
           title: '学生详情',

+ 32 - 0
src/store/system.js

@@ -59,10 +59,42 @@ export const useSystem = defineStore('system',
       }
       breadcrumbs.value =  arr
     }
+
+    // 教师
+    const teacherBreadcrumbs = ref([])
+    const setTeacherBreadcrumbs = (matched, fullPath) => {
+      const _fullPath = fullPath.split('/')
+      const arr = matched.map((item, index) => {
+        // 重组路径
+        if (item.path === matched[index - 1]?.path) return false
+        const text = item.meta.title
+        const _path = item.path.split('/')
+        const obj = {
+          text,
+          to: _path.map((e, i) => _fullPath[i]).join('/')
+        }
+        if (item.children && item.children.length) {
+          if (!item.children.find(e => e.path === 'index')) {
+            obj.to += `/${item.children[0].path}`
+            return obj
+          }
+          obj.to += '/index'
+          return obj
+        }
+        return obj
+      }).filter(e => e) || []
+      if (arr?.length) {
+        arr[arr.length - 1].disabled = true
+        arr[arr.length - 1].link = true
+      }
+      teacherBreadcrumbs.value =  arr
+    }
     return {
       systemInfo,
       setTimeDifference,
       getTimeDifference,
+      setTeacherBreadcrumbs,
+      teacherBreadcrumbs,
       setBreadcrumbs,
       breadcrumbs
     }

+ 28 - 13
src/views/recruit/teacher/studentList/index.vue

@@ -5,7 +5,7 @@
     <div class="d-flex justify-space-between mt-8 mb-10">
       <div class="d-flex align-center">
         <!-- <span class="mx-3 color-666 font-size-14">院系</span> -->
-        <Autocomplete class="mr-3" v-model="query.collegeId" :item="yuanXi"></Autocomplete>
+        <Autocomplete class="mr-3" v-model="query.schoolDepartmentName" :item="yuanXi"></Autocomplete>
         <v-btn color="primary" class="half-button ml-3" @click="handleSearch()">查 询</v-btn>
         <v-btn class="half-button ml-3" prepend-icon="mdi-refresh" variant="outlined" color="primary" @click="handleSearch(true)">刷 新</v-btn>
       </div>
@@ -27,7 +27,7 @@
         @pageHandleChange="handleChangePage"
       >
         <template #studentName="{ item }">
-          <div class="d-flex align-center" @click="studentDetails(item.id)">
+          <div class="d-flex align-center cursor-pointer" @click="studentDetails(item.id)">
             <v-avatar size="40" :image="getUserAvatar(item?.person?.avatar, item?.person?.sex)"></v-avatar>
             <span class="ml-3">{{ item?.person?.name }}</span>
           </div>
@@ -48,12 +48,14 @@ import { ref } from 'vue'
 import Snackbar from '@/plugins/snackbar'
 import { formatName } from '@/utils/getText'
 import { getUserAvatar } from '@/utils/avatar'
+import { schoolOrganization, studentList } from '@/api/school'
+import { useRouter } from 'vue-router'; const router = useRouter()
 
 const loading = ref(false)
 const query = ref({
   pageSize: 20,
   pageNo: 1,
-  collegeId: null,
+  schoolDepartmentName: null,
 })
 
 const headers = [
@@ -67,13 +69,19 @@ const headers = [
 ]
 
 const tableData = ref([])
+tableData.value = [{ test: 'ces', person: { name: '123' }, id: '1'}]
 const total = ref(0)
 // 列表
 const getData = async (isRefresh = false) => {
-  // const { list, total: number } = await getInterviewInvitePage(query.value)
-  // tableData.value = list
-  // total.value = number
-  tableData.value = [{ test: 'ces', person: { name: '123' }}]
+  query.value.schoolDepartmentName = '中文系'
+  const { data, total: number } = await studentList(query.value)
+
+  tableData.value = data?.records?.length && data.records.map(item=>{
+    const { enterpeiseName, enterpriseRecruitJobName, jobDept } = item
+    return { ...item.student, enterpeiseName, enterpriseRecruitJobName, jobDept }
+  })
+
+  total.value = number
   if (isRefresh) Snackbar.success('刷新成功')
 }
 
@@ -87,22 +95,29 @@ const handleSearch = (refresh = false) => {
   getData(refresh)
 }
 
+const schoolInfo = ref(localStorage.getItem('schoolInfo') ? JSON.parse(localStorage.getItem('schoolInfo')) : {})
+
 const yuanXi = ref({ width: 300, items: [], clearable: false, hideDetails: true, label: '请选择院系' })
+
 // 列表
 const getYuanXiItem = async () => {
-  // const { list } = await getInterviewInvitePage(query.value)
-  yuanXi.value.items = [
-    { label: '中文系', value: '中文系' },
-    { label: '人文学院', value: '人文学院' },
-  ]
+  const schoolId = schoolInfo.value?.school?.schoolId || null
+  if (!schoolId) return Snackbar.warning('获取学校信息失败!')
+  
+  const { data } = await schoolOrganization({ schoolId })
+  yuanXi.value.items = data?.length && data.map(item=> {
+    return item?.title ? { label: item.title, value: item.title } : null
+  }).filter(Boolean)
+
   if (yuanXi.value.items?.length) {
-    query.value.collegeId = yuanXi.value.items[0].value
+    query.value.schoolDepartmentName = yuanXi.value.items[0].value
     getData()
   }
 }
 getYuanXiItem()
 
 const studentDetails = (id) => {
+  if (id) router.push(`/recruit/teacher/studentDetails/${id}`)
 }
 
 const exportLoading = ref(false)