feat: 教师选择学生进行切换查看学生配置数据信息

This commit is contained in:
TsMask
2024-07-15 17:59:30 +08:00
parent 66eb27813f
commit 4af02693a4
3 changed files with 97 additions and 36 deletions

View File

@@ -2,6 +2,7 @@ import { getPtClassStudents } from '@/api/pt/neClass';
import { ptSaveAsDefault, ptResetAsDefault } from '@/api/pt/neConfig';
import { stuPtNeConfigApply } from '@/api/pt/neConfigApply';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { hasRoles } from '@/plugins/auth-user';
import { message } from 'ant-design-vue/lib';
import { onMounted, reactive } from 'vue';
@@ -10,7 +11,7 @@ import { onMounted, reactive } from 'vue';
* @param param 父级传入 {t}
* @returns
*/
export default function usePtOptions({t}:any) {
export default function usePtOptions({ t }: any) {
/**保存网元下所有配置为示例配置 */
function ptConfigSave(neType: string) {
ptSaveAsDefault(neType, '001').then(res => {
@@ -124,21 +125,18 @@ export default function usePtOptions({t}:any) {
timeout = setTimeout(fake, 500);
}
/**学生选择改变 */
function studentChange(e: any) {
console.log(e);
// 仅教师加载
if (hasRoles(['teacher'])) {
onMounted(() => {
initStudentList();
});
}
onMounted(() => {
initStudentList();
});
return {
ptConfigSave,
ptConfigReset,
ptConfigApply,
classState,
studentChange,
studentSearch,
};
}