2023年10月22日 修复灯和搜索不正常的问题

This commit is contained in:
bai 2023-10-22 20:26:14 +08:00
parent 7f64f66a61
commit 99f5cf3a5e
1 changed files with 50 additions and 27 deletions

View File

@ -150,8 +150,8 @@
<a-form-item label="当前有课">
<a-select placeholder="请选择当前有课" v-model:value="queryParam.nowIsClass">
<a-select-option :value="undefined">请选择</a-select-option>
<a-select-option value="1"></a-select-option>
<a-select-option value="0"></a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
@ -159,8 +159,8 @@
<a-form-item label="下节有课">
<a-select placeholder="请选择下节有课" v-model:value="queryParam.nextIsClass">
<a-select-option :value="undefined">请选择</a-select-option>
<a-select-option value="1"></a-select-option>
<a-select-option value="0"></a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
@ -183,7 +183,7 @@
</a-form>
</div>
<a-table v-show="true" :loading="loading" :data-source="filterDataSource()" :pagination="false" bordered size="middle" class="ant-table-striped" :scroll="{ y: 650 }">
<a-table v-show="true" :loading="loading" :data-source="filterComputedDataSource" :pagination="false" bordered size="middle" class="ant-table-striped" :scroll="{ y: 650 }">
<a-table-column title="序号" align="center" data-index="index">
<template #default="{ index }">
{{ index+1 }}
@ -233,8 +233,14 @@
c)开放听课/关闭听课
10.备注显示黄灯原因ppt没有信号 -->
<!-- <a-table-column title="教师全景" align="center" data-index="child_教师全景">
<!-- <a-table-column title="教师近景" align="center" data-index="child_教师近景">
<template #default="{ record }">
<span :class="record?.child['教师近景']?.isOnLine?'green':'red'">
<i class="fas fa-circle"/>
</span>
</template>
</a-table-column>
<a-table-column title="教师全景" align="center" data-index="child_教师全景">
<template #default="{ record }">
<span :class="record?.child['教师全景']?.isOnLine?'green':'red'">
<i class="fas fa-circle"/>
@ -262,6 +268,8 @@
</span>
</template>
</a-table-column> -->
<a-table-column title="数量" data-index="allIsOnLine"/>
<a-table-column width="200px" title="操作" data-index="action">
<template #default="{ record }">
<a :disabled="record.allIsOnLine != 0 " @click="ylLiveNew(record)" >预览 |</a>
@ -281,7 +289,7 @@
</template>
<script lang="ts" setup name="zhihuijiaoshiIndexPage">
import { defHttp } from '/@/utils/http/axios';
import { ref, onMounted, Ref, watch, reactive } from 'vue';
import { ref, onMounted, Ref, watch, reactive, computed } from 'vue';
import { nextTick } from 'vue';
import videojs from "video.js";
import { useMessage } from '/@/hooks/web/useMessage';
@ -315,6 +323,9 @@ onMounted(() => {
loadData();
});
const filterComputedDataSource = computed(() => {
return filterDataSource();
});
enum Api {
list = '/jiaoshi/kcZhihuijiaoshi/list',
@ -359,12 +370,16 @@ const ipagination = ref(
function loadData(){
loading.value = true;
let getListAction:any = [];
cardList.value = [];
let liveIsExist = (x) => {
return new Promise((resolve,reject) => {
videojs.xhr.get(x.pullUrl,(err, resp, body) => {
if(err){
reject(false);
x.isOnLine = false
// reject(true);
// x.isOnLine = true
}else{
resolve(true);
x.isOnLine = true
@ -403,21 +418,23 @@ function loadData(){
});
leftList.value = Object.values(map);
leftList.value.forEach(x => {
let item = jxlMap[x.jxlId];
if(item){
item.child.push(x);
}else{
let child = [x];
jxlMap[x.jxlId] = {
...x,
child
};
item = jxlMap[x.jxlId];
}
});
let changeAllList = () => {
leftList.value.forEach(x => {
let item = jxlMap[x.jxlId];
if(item){
item.child.push(x);
}else{
let child = [x];
jxlMap[x.jxlId] = {
...x,
child
};
item = jxlMap[x.jxlId];
}
});
cardList.value = Object.values(jxlMap);
}
cardList.value = Object.values(jxlMap);
loading.value = false;
nextTick(() => {
@ -432,13 +449,17 @@ function loadData(){
Promise.all(getListAction).then(resList => {
console.log(`🚀 ~ file: index.vue:104 ~ Promise.all ~ ress:`, resList);
// loading.value = false;
//queryParam.value._ = resList;
changeAllList();
}).catch((e) => {
console.error(e);
changeAllList();
// loading.value = false;
});
});
//
// let mainDiv:any = _document?.querySelector('.ant-layout .jeecg-default-layout-main > div');
// topWidth.value =mainDiv?.style?.height?? '0';
@ -458,7 +479,8 @@ function getJsjbxxList(){
//class
function getIsOnLineClass(record){
let resClas = 'red';
let allIsOnLine = record?.child['教师近景']?.isOnLine?1:0 + record?.child['教师全景']?.isOnLine?1:0 + record?.child['学生全景']?.isOnLine?1:0 + record?.child['PPT']?.isOnLine?1:0;
// let allIsOnLine = sfYxMap.value[record?.child['']?.id]?1:0 + sfYxMap.value[record?.child['']?.id]?1:0 + sfYxMap.value[record?.child['']?.id]?1:0 + sfYxMap.value[record?.child['PPT']?.id]?1:0;
let allIsOnLine = (record?.child['教师近景']?.isOnLine?1:0) + (record?.child['教师全景']?.isOnLine?1:0) + (record?.child['学生全景']?.isOnLine?1:0) + (record?.child['PPT']?.isOnLine?1:0);
record.allIsOnLine = allIsOnLine;
let bfStatusInfo = '';
@ -471,14 +493,15 @@ function getIsOnLineClass(record){
}else if(!record?.child['PPT']?.isOnLine){
bfStatusInfo = 'PPT没有信号';
}
record.bfStatusInfo = bfStatusInfo;
if(allIsOnLine == 4){
resClas = 'green';
}else if(allIsOnLine == 0){
resClas = 'red';
}else{
resClas = 'yellow';
record.bfStatusInfo = bfStatusInfo;
}
record.onLineClassType = resClas;
return resClas;
}
@ -580,12 +603,12 @@ function filterDataSource() {
if(qw.jsmc){
isReturn = x.jsmc?.includes(qw.jsmc);
}
if(qw.sfyx2){
isReturn = x.jsmc?.includes(qw.sfyx2);
}
if(qw.sfyx){
isReturn = x.sfyx == qw.sfyx;
}
if(qw.sfyx2){
isReturn = x.sfyx == qw.sfyx2;
}
if(qw.onLineClassType){
isReturn = x.onLineClassType == qw.onLineClassType;
}