|
@@ -5,6 +5,7 @@
|
|
|
<GroupList
|
|
|
:is-group="!isGroup"
|
|
|
:group-list="group_list"
|
|
|
+ :adjust-group-list="adjustGroupList"
|
|
|
@enterGroup="enterGroup"
|
|
|
@getGroupInfo="getGroupInfo"
|
|
|
/>
|
|
@@ -12,9 +13,14 @@
|
|
|
:is-group="isGroup"
|
|
|
:stream-list="streamList"
|
|
|
:no-stream-list="noStreamList"
|
|
|
+ :adjust-group-list="adjustGroupList"
|
|
|
+ :student-list="student_list"
|
|
|
:is-teacher-stream="isTeacherStream"
|
|
|
:teacher-name="roomInfo.teacher_name"
|
|
|
- @searchStudentName="searchStudentName"
|
|
|
+ :cur-group-id="group_id"
|
|
|
+ :search-student-name="searchStudentName"
|
|
|
+ @getMyGroupInfo="getMyGroupInfo_Teacher"
|
|
|
+ @getGroupInfo="getGroupInfo"
|
|
|
/>
|
|
|
<MemberList
|
|
|
:member-show="memberShow && isAudit"
|
|
@@ -48,7 +54,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, inject, watch, nextTick, onBeforeUnmount } from 'vue';
|
|
|
+import { ref, inject, computed, watch, nextTick, onBeforeUnmount } from 'vue';
|
|
|
import {
|
|
|
GetMyGroupInfo_Teacher,
|
|
|
JoinGroup_Teacher,
|
|
@@ -64,6 +70,8 @@ import {
|
|
|
useDownloadSDK,
|
|
|
room_id,
|
|
|
session_id,
|
|
|
+ noStreamList,
|
|
|
+ student_list,
|
|
|
live_room_sys_user_id
|
|
|
} from './group';
|
|
|
import { useLive, useMemberList } from '../common/common';
|
|
@@ -79,6 +87,7 @@ const { memberShow, toggle } = useMemberList();
|
|
|
|
|
|
const route = useRoute();
|
|
|
let task_id = route.query.task_id; // 任务id
|
|
|
+
|
|
|
const $t = inject('$t');
|
|
|
|
|
|
let isTeacherStream = ref(false);
|
|
@@ -101,22 +110,27 @@ let roomData = ref({
|
|
|
let speakData = ref({});
|
|
|
let roomContext = ref({});
|
|
|
let liveStat = ref(false); // 直播状态
|
|
|
+
|
|
|
let streamList = ref([]);
|
|
|
-watch(streamList, (newVal) => {
|
|
|
- const list = student_list.value.filter((item) => {
|
|
|
- let isNoStream = true;
|
|
|
- for (let i = 0; i < newVal.length; i++) {
|
|
|
- if (newVal[i].id().split('-')[0] === item.room_user_id) isNoStream = false;
|
|
|
- }
|
|
|
- return isNoStream;
|
|
|
- });
|
|
|
- noStreamList.value = list;
|
|
|
- if (newVal.length > 0) {
|
|
|
- nextTick(() => {
|
|
|
- newVal[newVal.length - 1].show(`group-${newVal.length - 1}`);
|
|
|
+watch(
|
|
|
+ streamList,
|
|
|
+ (newVal) => {
|
|
|
+ const list = student_list.value.filter((item) => {
|
|
|
+ let isNoStream = true;
|
|
|
+ for (let i = 0; i < newVal.length; i++) {
|
|
|
+ if (newVal[i].id().split('-')[0] === item.room_user_id) isNoStream = false;
|
|
|
+ }
|
|
|
+ return isNoStream;
|
|
|
});
|
|
|
- }
|
|
|
-});
|
|
|
+ noStreamList.value = list;
|
|
|
+ if (newVal.length > 0) {
|
|
|
+ nextTick(() => {
|
|
|
+ newVal[newVal.length - 1].show(`group-${newVal.length - 1}`);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
+);
|
|
|
|
|
|
const { downloadWebSDK, removeWebSDK } = useDownloadSDK(useInitListener, {
|
|
|
roomData,
|
|
@@ -128,6 +142,12 @@ const { downloadWebSDK, removeWebSDK } = useDownloadSDK(useInitListener, {
|
|
|
});
|
|
|
|
|
|
let group_list = ref([]); // 小组成员列表
|
|
|
+// 调整分组用列表
|
|
|
+let adjustGroupList = computed(() => {
|
|
|
+ return group_list.value.map(({ group_id }, i) => {
|
|
|
+ return { group_id, group_name: `分组${i + 1}` };
|
|
|
+ });
|
|
|
+});
|
|
|
/**
|
|
|
* 得到分组讨论信息(教师端)
|
|
|
*/
|
|
@@ -138,38 +158,29 @@ function getGroupInfo() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-const { audience_list, group_id, isAudit, isGroup, noStreamList, roomInfo, student_list, searchStudentName } =
|
|
|
- useGroupInit(downloadWebSDK, getGroupInfo);
|
|
|
+const { audience_list, group_id, isAudit, isGroup, roomInfo, searchStudentName } = useGroupInit(
|
|
|
+ downloadWebSDK,
|
|
|
+ getGroupInfo
|
|
|
+);
|
|
|
const { stopGroup } = useGroup();
|
|
|
|
|
|
+function getMyGroupInfo_Teacher() {
|
|
|
+ GetMyGroupInfo_Teacher({ task_id }).then(({ student_list: sList }) => {
|
|
|
+ noStreamList.value = sList ?? [];
|
|
|
+ student_list.value = sList ?? [];
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
// 加入分组讨论
|
|
|
function enterGroup(_group_id) {
|
|
|
- JoinGroup_Teacher({ task_id, group_id: _group_id })
|
|
|
- .then(({ room_id: rId, session_id: sId }) => {
|
|
|
- room_id.value = rId;
|
|
|
- session_id.value = sId;
|
|
|
- downloadWebSDK();
|
|
|
- isGroup.value = true;
|
|
|
- group_id.value = _group_id;
|
|
|
- return GetMyGroupInfo_Teacher({ task_id });
|
|
|
- })
|
|
|
- .then(({ student_list: sList }) => {
|
|
|
- noStreamList.value = sList;
|
|
|
- student_list.value = sList;
|
|
|
- // for (let i = 0; i < 30; i++) {
|
|
|
- // student_list.value.push({
|
|
|
- // is_mobile: 'false',
|
|
|
- // is_self: 'false',
|
|
|
- // is_teacher_role_in_room: 'true',
|
|
|
- // room_user_id: 'QjxZTgVShaYyUNjl',
|
|
|
- // session_id: '3953BA342CFC3AC1DE2BAAC5EF0BCAF76FC545644E10CF40EFF0373DBDFA5BD5',
|
|
|
- // student_id: '20210621-1055-0000002',
|
|
|
- // student_image_url:
|
|
|
- // 'https://file-kf.helxsoft.cn/CSFileServer/URL/001/584B22C60E22F90EBCCC9C95108528C420230208173530PTAYLGFPXSTTBHUZSJNYF5G48JVKVQB1VO9HGBFB_00101-20210722-20-M95FFDOU.png',
|
|
|
- // student_name: '陈秒(学生)'
|
|
|
- // });
|
|
|
- // }
|
|
|
- });
|
|
|
+ JoinGroup_Teacher({ task_id, group_id: _group_id }).then(({ room_id: rId, session_id: sId }) => {
|
|
|
+ room_id.value = rId;
|
|
|
+ session_id.value = sId;
|
|
|
+ downloadWebSDK();
|
|
|
+ isGroup.value = true;
|
|
|
+ group_id.value = _group_id;
|
|
|
+ getMyGroupInfo_Teacher();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 退出当前分组讨论
|