|
@@ -1,26 +1,30 @@
|
|
|
<template>
|
|
|
<v-card class="card-box d-flex pa-3">
|
|
|
<div style="width: 20%; border-right: 1px solid #ccc;">
|
|
|
- <v-treeview
|
|
|
- :items="treeData"
|
|
|
- activatable
|
|
|
- color="primary"
|
|
|
- item-value="id"
|
|
|
- open-all
|
|
|
- open-strategy="single"
|
|
|
- density="compact"
|
|
|
- @update:activated="handleClick"
|
|
|
- @update:opened="handleClick"
|
|
|
- >
|
|
|
- <template v-slot:title="{ item }">
|
|
|
- <div class="treeTitle font-size-15" v-ellipse-tooltip style="max-width: 100%;">{{ formatName(item.title) }}</div>
|
|
|
- </template>
|
|
|
- </v-treeview>
|
|
|
+ <div v-if="treeData.length > 0">
|
|
|
+ <v-treeview
|
|
|
+ :items="treeData"
|
|
|
+ activatable
|
|
|
+ class="mr-3"
|
|
|
+ color="primary"
|
|
|
+ item-value="id"
|
|
|
+ open-all
|
|
|
+ open-strategy="single"
|
|
|
+ density="compact"
|
|
|
+ @update:activated="handleClick"
|
|
|
+ @update:opened="handleClick"
|
|
|
+ >
|
|
|
+ <template v-slot:title="{ item }">
|
|
|
+ <div class="treeTitle font-size-15" v-ellipse-tooltip style="max-width: 100%;">{{ formatName(item.name) }}</div>
|
|
|
+ </template>
|
|
|
+ </v-treeview>
|
|
|
+ </div>
|
|
|
+ <div v-else class="font-size-15 color-999 text-center" style="line-height: 60vh;">暂无院系</div>
|
|
|
</div>
|
|
|
<div style="width: 80%" class="ml-3">
|
|
|
- <div class="d-flex justify-space-between px-3">
|
|
|
+ <div class="d-flex justify-space-between">
|
|
|
<TextInput v-model="query.name" :item="textItem" @change="getUserList"></TextInput>
|
|
|
- <v-btn class="mr-3" width="100" color="primary" prepend-icon="mdi-refresh" variant="outlined" @click="getTreeData">刷 新</v-btn>
|
|
|
+ <v-btn width="100" color="primary" prepend-icon="mdi-refresh" variant="outlined" @click="getTreeData">刷 新</v-btn>
|
|
|
</div>
|
|
|
<CtTable
|
|
|
:items="tableData"
|
|
@@ -74,7 +78,7 @@
|
|
|
defineOptions({ name: 'group-account'})
|
|
|
import { ref } from 'vue'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
-import { getEnterpriseTree } from '@/api/recruit/enterprise/system/group'
|
|
|
+import { getOrganizationTree } from '@/api/school'
|
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
|
import { formatName } from '@/utils/getText';
|
|
|
|
|
@@ -122,16 +126,7 @@ const tableData = ref([
|
|
|
"createTime": 1741681159370
|
|
|
}
|
|
|
])
|
|
|
-const treeData = ref([
|
|
|
- {
|
|
|
- title: '农学',
|
|
|
- children: [{ title: '农学1' }, { title: '农学2' }]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '文学',
|
|
|
- children: [{ title: '文学1' }, { title: '文学2' }]
|
|
|
- }
|
|
|
-])
|
|
|
+const treeData = ref([])
|
|
|
const headers = [
|
|
|
{ title: '学生姓名', key: 'studentName', sortable: false },
|
|
|
{ title: '实习企业', key: 'enterpriseName', sortable: false },
|
|
@@ -166,15 +161,11 @@ const getUserList = async () => {
|
|
|
const getTreeData = async () => {
|
|
|
treeData.value = []
|
|
|
try {
|
|
|
- const data = await getEnterpriseTree()
|
|
|
- if (!data) return
|
|
|
- treeData.value[0] = data
|
|
|
- query.value.enterpriseId = data.id
|
|
|
- // 获取用户列表
|
|
|
- getUserList()
|
|
|
+ const data = await getOrganizationTree({ schoolId: schoolInfo.value.schoolId })
|
|
|
+ treeData.value = data || []
|
|
|
} catch {}
|
|
|
}
|
|
|
-// getTreeData()
|
|
|
+getTreeData()
|
|
|
|
|
|
// 分页
|
|
|
const handleChangePage = (e) => {
|
|
@@ -185,8 +176,6 @@ const handleChangePage = (e) => {
|
|
|
// 树形click
|
|
|
const handleClick = (e) => {
|
|
|
if (!e.length) return
|
|
|
- query.value.enterpriseId = e[0]
|
|
|
- getUserList()
|
|
|
}
|
|
|
|
|
|
// 查看实习报告
|