修改bug

This commit is contained in:
yangjun 2024-03-09 13:04:44 +08:00
parent e7ac9cabbb
commit b4a042b04f
5 changed files with 210 additions and 116 deletions

View File

@ -368,8 +368,8 @@
<div style="float: right;">
<a-button type="primary" :loading="btnLoading" @click="batchLiveOpen" style="margin-left: 8px">批量打开直播</a-button>
<a-button type="primary" :loading="btnLoading" @click="batchLiveClose" style="margin-left: 8px">批量关闭直播</a-button>
<a-button type="primary" :loading="btnLoading" @click="batchTingkeOpen" style="margin-left: 8px">批量打开听课</a-button>
<a-button type="primary" :loading="btnLoading" @click="batchTingkeClose" style="margin-left: 8px">批量关闭听课</a-button>
<a-button type="primary" :loading="btnLoading" @click="batchTingkeOpen" style="margin-left: 8px">批量打开前台展示</a-button>
<a-button type="primary" :loading="btnLoading" @click="batchTingkeClose" style="margin-left: 8px">批量关闭前台展示</a-button>
</div>
</a-col>
</a-row>
@ -393,125 +393,111 @@
{{ index+1 }}
</template>
</a-table-column>
<a-table-column title="教学楼" data-index="jxlName"/>
<a-table-column title="教室" data-index="jsmc">
<template #default="{ text, record }">
<a :href="'http://'+record.ip" target="_blank">{{ text }}</a>
</template>
</a-table-column>
<a-table-column-group>
<template #title><span>教室信息</span></template>
<a-table-column title="教学楼" data-index="jxlName"/>
<a-table-column title="教室" data-index="jsmc">
<template #default="{ text, record }">
<a :href="'http://'+record.ip" target="_blank">{{ text }}</a>
</template>
</a-table-column>
<a-table-column title="是否具备直播功能" align="center" data-index="zbgn">
<template #default="{ text }">
{{ text == 0?'是':'尚未接入' }}
</template>
</a-table-column>
<a-table-column title="是否允许开放听课" align="center" data-index="sfyx">
<template #default="{ text, record }">
<template v-if="record.tjKftkzt == 1"></template>
<template v-else></template>
</template>
</a-table-column>
</a-table-column-group>
<a-table-column title="直播功能" align="center" data-index="zbgn">
<template #default="{ text }">
{{ text == 0?'是':'尚未接入' }}
</template>
</a-table-column>
<a-table-column title="前台展示" align="center" data-index="sfyx">
<template #default="{ text, record }">
<template v-if="record.zbgn == 0">{{ text == 0?'':'' }}</template>
<template v-else>-</template>
</template>
</a-table-column>
<!-- 5.开放听课?? -->
<a-table-column title="直播状态" align="center" data-index="child_教师近景">
<template #default="{ record }">
<template v-if="record.zbgn == 0">
<span :class="getIsOnLineClass(record)" :title="onLineTitle[getIsOnLineClass(record)]">
<i class="fas fa-circle" />
</span>
<a-table-column-group>
<template #title><span>课堂信息</span></template>
<a-table-column title="(即将/当前)有课" align="center" data-index="nowIsClass">
<template #default="{ record }">
{{ record?.nowIsClass?'是':'否' }}
</template>
<template v-else>
-
</a-table-column>
<a-table-column title="下节有课" align="center" data-index="nextIsClass">
<template #default="{ record }">
{{ record?.nextIsClass?'是':'否' }}
</template>
</template>
</a-table-column>
<a-table-column title="(即将/当前)有课" align="center" data-index="nowIsClass">
<template #default="{ record }">
{{ record?.nowIsClass?'是':'否' }}
</template>
</a-table-column>
<a-table-column title="下节有课" align="center" data-index="nextIsClass">
<template #default="{ record }">
{{ record?.nextIsClass?'是':'否' }}
</template>
</a-table-column>
<a-table-column title="开放听课" align="center" data-index="sfyx">
<template #default="{ text, record }">
<template v-if="record.tjKftkzt == 1"></template>
<template v-else></template>
</template>
</a-table-column>
<a-table-column title="备注" data-index="bfStatusInfo"/>
</a-table-column>
</a-table-column-group>
<!-- <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"/>
</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"/>
</span>
</template>
</a-table-column>
<a-table-column title="PPT" align="center" data-index="child_PPT">
<template #default="{ record }">
<span :class="record?.child['PPT']?.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"/>
</span>
</template>
</a-table-column> -->
<!-- <a-table-column title="数量" data-index="allIsOnLine"/> -->
<a-table-column width="310px" title="操作" data-index="action">
<a-table-column-group>
<template #title><span>直播信息</span></template>
<!-- 5.开放听课?? -->
<a-table-column title="当前直播状态" align="center" data-index="child_教师近景">
<template #default="{ record }">
<template v-if="record.zbgn == 0">
<a-button type="link" style="padding: 0" :disabled="record.allIsOnLine == 0" @click="ylLiveNew(record)">预览 |</a-button>
<!-- <a v-if="record.allIsOnLine == 0" :disabled="true" @click="ylLiveNew(record)" >预览 |</a>
<a v-else @click="ylLiveNew(record)" >预览 |</a> -->
<a v-if="!record?.child['教师全景']?.isOnLine" @click="changeLive(record,true)">开启直播 |</a>
<span :class="getIsOnLineClass(record)" :title="onLineTitle[getIsOnLineClass(record)]">
<i class="fas fa-circle" />
</span>
</template>
<template v-else>
-
</template>
</template>
</a-table-column>
<a-table-column title="状态描述" data-index="bfStatusInfo"/>
<a-table-column title="操作" data-index="action">
<template #default="{ record }">
<template v-if="record.zbgn == 0">
<a v-if="!record?.child['教师全景']?.isOnLine" @click="changeLive(record,true)">开启直播</a>
<a v-else @click="changeLive(record,false)">关闭直播</a>
</template>
</template>
</a-table-column>
<a-table-column title="前台是否展示" align="center" data-index="sfyx">
<template #default="{ text, record }">
<template v-if="record.zbgn == 0">{{ text == 0?'':'' }}</template>
<template v-else>-</template>
</template>
</a-table-column>
<a-table-column title="操作" data-index="action">
<template #default="{ record }">
<template v-if="record.zbgn == 0">
<a v-if="record.sfyx == 1" @click="changeKt(record,true)">开启前台展示</a>
<a v-else-if="record.sfyx == 0" @click="changeKt(record,false)">关闭前台展示</a>
</template>
</template>
</a-table-column>
</a-table-column-group>
<a-table-column title="操作" data-index="action">
<template #default="{ record }">
<template v-if="record.zbgn == 0">
<a-button type="link" style="padding: 0" :disabled="record.allIsOnLine == 0" @click="ylLiveNew(record)">预览 </a-button>
<!-- <a v-if="!record?.child['教师全景']?.isOnLine" @click="changeLive(record,true)">开启直播 |</a>
<a v-else @click="changeLive(record,false)">关闭直播 |</a>
<a v-if="record.sfyx == 1" @click="changeKt(record,true)">开放前台展示</a>
<a v-else-if="record.sfyx == 0" @click="changeKt(record,false)">关闭前台展示</a>
<a v-if="record.tjKftkzt == 0" @click="changeKftk(record,'1')"> | 开放听课</a>
<a v-else-if="record.tjKftkzt == 1" @click="changeKftk(record,'0')"> | 关闭听课</a>
<!-- <a @click="changeSdjc(record)"> | 手动检测</a> -->
<a-button type="link" style="padding: 0" @click="jcZhiHuiJiaoShi(record)">检测教室 |</a-button>
<a-button type="link" style="padding: 0" v-if="!record.forceState || record.forceState == 'red'" @click="changeFlag(record, 'green')">标记为有效 </a-button>
<a-button type="link" style="padding: 0" v-if="record.forceState == 'green'" @click="changeFlag(record, 'red')">标记为无效 </a-button>
<a-button type="link" style="padding: 0" v-if="record.forceState == 'green'" @click="changeFlag(record, 'red')">标记为无效 </a-button> -->
<!-- {{ record.id }} -->
</template>
<template v-else>
<a-button type="link" style="padding: 0" disabled @click="ylLiveNew(record)">预览 |</a-button>
<a-button type="link" style="padding: 0" disabled v-if="!record?.child['教师全景']?.isOnLine" @click="changeLive(record,true)">开启直播 |</a-button>
<a-button type="link" style="padding: 0" disabled @click="ylLiveNew(record)">预览 </a-button>
<!-- <a-button type="link" style="padding: 0" disabled v-if="!record?.child['教师全景']?.isOnLine" @click="changeLive(record,true)">开启直播 |</a-button>
<a-button type="link" style="padding: 0" disabled v-else @click="changeLive(record,false)">关闭直播 |</a-button>
<a-button type="link" style="padding: 0" disabled v-if="record.sfyx == 1" @click="changeKt(record,true)">开放前台展示</a-button>
<a-button type="link" style="padding: 0" disabled v-else-if="record.sfyx == 0" @click="changeKt(record,false)">关闭前台展示</a-button>
<a-button v-if="record.tjKftkzt == 0" @click="changeKftk(record,'1')"> | 开放听课</a-button>
<a-button v-else-if="record.tjKftkzt == 1" @click="changeKftk(record,'0')"> | 关闭听课</a-button>
<!-- <a-button @click="changeSdjc(record)"> | 手动检测</a-button> -->
<a-button type="link" style="padding: 0" disabled @click="jcZhiHuiJiaoShi(record)">检测教室 |</a-button>
<a-button type="link" style="padding: 0" disabled v-if="!record.forceState || record.forceState == 'red'" @click="changeFlag(record, 'green')">标记为有效 |</a-button>
<a-button type="link" style="padding: 0" disabled v-if="record.forceState == 'green'" @click="changeFlag(record, 'red')">标记为无效 |</a-button>
<a-button type="link" style="padding: 0" disabled v-if="record.forceState == 'green'" @click="changeFlag(record, 'red')">标记为无效 |</a-button> -->
</template>
</template>
</a-table-column>

View File

@ -4,7 +4,7 @@
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
</a-modal>
@ -17,12 +17,16 @@
import { useListPage } from '/@/hooks/system/useListPage'
import { columns, searchFormSchema } from './KcZhihuijiaoshiStateLog.data';
import { list } from './KcZhihuijiaoshiStateLog.api';
import { defHttp } from '/@/utils/http/axios';
import videojs from "video.js";
import { useMessage } from '/@/hooks/web/useMessage';
const queryParam:any = ref({});
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, { openModal }] = useModal();
const { createMessage, createInfoModal, createErrorModal,createConfirm } = useMessage();
//table
const { tableContext } = useListPage({
tableProps:{
@ -30,7 +34,7 @@
api: list,
columns,
canResize:false,
showActionColumn: false,
showActionColumn: true,
immediate: false,
formConfig: {
//labelWidth: 120,
@ -47,8 +51,11 @@
return Object.assign(params, queryParam.value);
},
actionColumn: {
width: 120,
fixed:'right'
width: 180,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: undefined,
},
},
})
@ -71,23 +78,111 @@
* 操作栏
*/
function getTableAction(record){
return [
if(record.forceState === 'green'){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
label: '检测教室',
onClick: jcZhiHuiJiaoShi.bind(null, record),
},
{
label: '标记为无效',
onClick: changeFlag.bind(null, record,"red"),
}
]
}else{
return [
{
label: '检测教室',
onClick: jcZhiHuiJiaoShi.bind(null, record),
},
{
label: '标记为有效',
onClick: changeFlag.bind(null, record,"green"),
}
]
}
}
function getDropDownAction(record){
return []
}
//
async function jcZhiHuiJiaoShi(record){
console.log(`🚀 ~ jcZhiHuiJiaoShi ~ record:`, record)
let jxlMap = {};
let getListAction:any = [];
let liveIsExist = (x) => {
return new Promise((resolve,reject) => {
videojs.xhr.get(x.pullUrl,(err, resp, body) => {
if(err){
reject(x);
x.isOnLine = false
}else{
resolve(x);
x.isOnLine = true
}
})
})
}
async function open(param){
let child = [];
await defHttp.get({url: '/jiaoshi/kcZhihuijiaoshi/list',params:{jsbh:record.jsbh}}).then((res:any) => {
console.log(`🚀 ~ awaitdefHttp.get ~ res:`, res)
console.log(`🚀 ~ awaitdefHttp.get ~ res:`, res.records)
child = res.records;
})
Object.values(child).forEach(item => {
let x:any = item;
if(x.pullUrl){
getListAction.push(liveIsExist(x));
}
});
console.log(`🚀 ~ Object.values ~ getListAction:`, getListAction)
Promise.all(getListAction).then(resList => {
}).catch((e) => {
console.error(`🚀 ~ file: index.vue:1170 ~ Promise.all Error ~ ress:`, e);
}).finally((...d) => {
console.log("正常执行!",...d);
//
let isSuccess = true;
let msgList:any = [];
Object.values(child).forEach(item => {
let _item = item as any;
console.log(`🚀 ~ Object.values ~ _item:`, _item)
if(_item.isOnLine){
msgList.push(_item.xm + ':连接成功!');
}else{
msgList.push(_item.xm + ':连接失败!');
isSuccess = false;
}
});
if(msgList.length){
if(isSuccess){
createInfoModal({ title: '成功!', content: msgList.join(',') });
}else{
createErrorModal({ title: '失败!', content: msgList.join(',') });
}
}
});
}
//
function changeFlag(record, flag){
record.forceState = flag;
defHttp.post({ url: '/jiaoshi/kcZhihuijiaoshiStateLog/updateByJsbh', params: {
jsbh: record.jsbh,
forceState: flag
}}).then(res => {
queryParam.value.jxlName = null;
loadData();
});
}
function open(param){
console.log(`🚀 ~ detaillogopen ~ param:`, param)
// changeQueryParam(param);
// reload();
await nextTick(() => {
nextTick(() => {
queryParam.value = Object.assign({ }, param);
reload();
isShowPage.value = true;

View File

@ -109,7 +109,11 @@
* 新增事件
*/
function add() {
console.log(11111);
selectedRowKeys.value = [];
rowSelection.value = [];
selectedRows.value = [];
queryParam.value = {xqxn:getSysConfig().flag1};
reload();
}
function submitForm() {

View File

@ -69,6 +69,7 @@
import { Form } from 'ant-design-vue';
import KcKetangbiaoCheckListModal from '/@/views/kc/ketang/KcKetangbiaoCheckListModal.vue';
import CheckUserToolModal from '/@/views/kc/kcTingkeBmd/checkuser/CheckUserToolModal.vue';
import _ from 'lodash-es';
const useForm = Form.useForm;
export default defineComponent({
@ -141,10 +142,14 @@
}
function ketangSuccess(par){
console.log(`🚀 ~ file: KcZzYbtkbForm.vue:232 ~ handleSuccess ~ par:`, par)
var list = par;
console.log(`🚀 ~ ketangSuccess ~ list:`, list)
kcTingkeBmdKcxxTable.dataSource = [...list]
console.log(`🚀 ~ ketangSuccess ~ par`, par);
var oldList2 = kcTingkeBmdKcxxTable.dataSource;
for(var i=0;i<list.length;i++){
oldList2.push(list[i]);
}
var list2 = _.unionBy(oldList2,(x) => x.kcmc+x.skjs+x.skdd+x.hh+x.xnxq+x.skrq);
kcTingkeBmdKcxxTable.dataSource = [...list2]
}
function userSuccess(par){

View File

@ -152,7 +152,11 @@
* 新增事件
*/
function add() {
console.log(11111);
selectedRowKeys.value = [];
rowSelection.value = [];
selectedRows.value = [];
queryParam.value = {searchByNowXqxn:true};
reload();
}
function submitForm() {