|
@@ -12,11 +12,11 @@ defineOptions({
|
|
inheritAttrs: false,
|
|
inheritAttrs: false,
|
|
});
|
|
});
|
|
/**
|
|
/**
|
|
- * 班级数据
|
|
|
|
|
|
+ * 教师数据
|
|
*/
|
|
*/
|
|
const teacherData = ref<TeacherItem[]>();
|
|
const teacherData = ref<TeacherItem[]>();
|
|
-// 0加载中,1数据正常,2数据为空
|
|
|
|
-const dataStatus = ref(0);
|
|
|
|
|
|
+const dataMessage = ref("加载中...");
|
|
|
|
+const dataStatus = ref(false);
|
|
// 教师数量
|
|
// 教师数量
|
|
let teacherCount = ref(0);
|
|
let teacherCount = ref(0);
|
|
// 用于搜索的教师名称或手机号
|
|
// 用于搜索的教师名称或手机号
|
|
@@ -25,13 +25,21 @@ let searchKeyword = ref("");
|
|
async function getTeacherData(schoolId: number, keyword: string) {
|
|
async function getTeacherData(schoolId: number, keyword: string) {
|
|
getTeacherManage(schoolId, keyword)
|
|
getTeacherManage(schoolId, keyword)
|
|
.then(({data}) => {
|
|
.then(({data}) => {
|
|
- const temp: TeacherManage = data;
|
|
|
|
- teacherData.value = temp.lists;
|
|
|
|
- teacherCount.value = temp.count;
|
|
|
|
- dataStatus.value = 1;
|
|
|
|
|
|
+ const {count, lists} = data;
|
|
|
|
+ teacherData.value = lists;
|
|
|
|
+ teacherCount.value = count;
|
|
|
|
+ dataStatus.value = true;
|
|
|
|
+ if (!(count && count > 0)) {
|
|
|
|
+ dataStatus.value = false;
|
|
|
|
+ dataMessage.value = "没有符合搜索条件的记录!";
|
|
|
|
+ if (searchKeyword.value == "") {
|
|
|
|
+ dataMessage.value = "暂时还没有任何教师注册绑定学校!";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
- dataStatus.value = 2;
|
|
|
|
|
|
+ dataStatus.value = false;
|
|
|
|
+ dataMessage.value = error.message;
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -94,7 +102,7 @@ watch(
|
|
>人</span
|
|
>人</span
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <template v-if="dataStatus == 1">
|
|
|
|
|
|
+ <template v-if="dataStatus">
|
|
<!-- 折叠面板-->
|
|
<!-- 折叠面板-->
|
|
<div v-for="teacher in teacherData" :key="teacher.id" class="list-collapse">
|
|
<div v-for="teacher in teacherData" :key="teacher.id" class="list-collapse">
|
|
<el-collapse v-model="teacher.active" @change="collapseTeacher(teacher)">
|
|
<el-collapse v-model="teacher.active" @change="collapseTeacher(teacher)">
|
|
@@ -169,8 +177,7 @@ watch(
|
|
<template v-else>
|
|
<template v-else>
|
|
<div class="empty page-empty">
|
|
<div class="empty page-empty">
|
|
<img src="../../assets/empty.png" alt="数据为空" />
|
|
<img src="../../assets/empty.png" alt="数据为空" />
|
|
- <p v-if="dataStatus == 0">加载中...</p>
|
|
|
|
- <p v-if="dataStatus == 2">暂时还没有任何教师注册绑定学校!</p>
|
|
|
|
|
|
+ <p>{{ dataMessage }}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
@@ -261,6 +268,7 @@ watch(
|
|
}
|
|
}
|
|
|
|
|
|
:deep(.el-table .el-table__header .el-table__cell .cell) {
|
|
:deep(.el-table .el-table__header .el-table__cell .cell) {
|
|
|
|
+ overflow: visible;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -286,4 +294,8 @@ watch(
|
|
:deep(.grade .el-table th.el-table__cell) {
|
|
:deep(.grade .el-table th.el-table__cell) {
|
|
background: #ddd;
|
|
background: #ddd;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.empty {
|
|
|
|
+ padding: 200px 0;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|