|
@@ -49,7 +49,7 @@ 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 { studentList, getSchoolOrganizationList } from '@/api/school'
|
|
|
// import { useRouter } from 'vue-router'; const router = useRouter()
|
|
|
import { previewFile } from '@/utils'
|
|
|
|
|
@@ -66,8 +66,7 @@ const studentNameItem = ref({
|
|
|
width: 300,
|
|
|
label: '请输入学生姓名搜索',
|
|
|
clearable: true,
|
|
|
- hideDetails: true,
|
|
|
- // appendInnerIcon: 'mdi-magnify'
|
|
|
+ hideDetails: true
|
|
|
})
|
|
|
|
|
|
const headers = [
|
|
@@ -106,22 +105,20 @@ const handleSearch = (refresh = false) => {
|
|
|
}
|
|
|
|
|
|
const schoolInfo = ref(localStorage.getItem('schoolInfo') ? JSON.parse(localStorage.getItem('schoolInfo')) : {})
|
|
|
-const schoolDepartmentItem = ref({ width: 300, items: [], clearable: false, hideDetails: true, label: '请选择院系' })
|
|
|
+const schoolDepartmentItem = ref({ width: 300, items: [], clearable: false, hideDetails: true, label: '请选择院系', itemText: 'name', itemValue: 'id' })
|
|
|
|
|
|
// 列表
|
|
|
const getYuanXiItem = async () => {
|
|
|
const schoolId = schoolInfo.value?.schoolId || null
|
|
|
if (!schoolId) return Snackbar.warning('获取学校信息失败!')
|
|
|
|
|
|
- const { data } = await schoolOrganization({ schoolId })
|
|
|
- schoolDepartmentItem.value.items = data?.length && data.map(item=> {
|
|
|
- return item?.title ? { label: item.title, value: item.title } : null
|
|
|
- }).filter(Boolean)
|
|
|
+ const data = await getSchoolOrganizationList({ schoolId, type: 0 })
|
|
|
+ schoolDepartmentItem.value.items = data || []
|
|
|
|
|
|
- if (schoolDepartmentItem.value.items?.length) {
|
|
|
- query.value.schoolDepartmentName = schoolDepartmentItem.value.items[0].value
|
|
|
- getData()
|
|
|
- }
|
|
|
+ // if (schoolDepartmentItem.value.items?.length) {
|
|
|
+ // query.value.schoolDepartmentName = schoolDepartmentItem.value.items[0].value
|
|
|
+ // getData()
|
|
|
+ // }
|
|
|
}
|
|
|
getYuanXiItem()
|
|
|
|