2023年10月18日 修改智慧教室展示样式

This commit is contained in:
bai 2023-10-18 08:15:48 +08:00
parent b117cb7138
commit 322749627a
19 changed files with 1978 additions and 48 deletions

View File

@ -43,7 +43,7 @@ async function bootstrap() {
initAppConfigStore();
// 注册外部模块路由(注册online模块lib)
// registerPackages(app);
registerPackages(app);
// 注册全局组件
registerGlobComp(app);

View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/jiaoshi/kcJiaoxuelouInfo/list',
save='/jiaoshi/kcJiaoxuelouInfo/add',
edit='/jiaoshi/kcJiaoxuelouInfo/edit',
deleteOne = '/jiaoshi/kcJiaoxuelouInfo/delete',
deleteBatch = '/jiaoshi/kcJiaoxuelouInfo/deleteBatch',
importExcel = '/jiaoshi/kcJiaoxuelouInfo/importExcel',
exportXls = '/jiaoshi/kcJiaoxuelouInfo/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

View File

@ -0,0 +1,51 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '删除状态',
align:"center",
dataIndex: 'delFlag'
},
{
title: '教学楼名称',
align:"center",
dataIndex: 'jxlhName'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '删除状态',
field: 'delFlag',
component: 'InputNumber',
},
{
label: '教学楼名称',
field: 'jxlhName',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}

View File

@ -0,0 +1,173 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<KcJiaoxuelouInfoModal @register="registerModal" @success="handleSuccess"></KcJiaoxuelouInfoModal>
</div>
</template>
<script lang="ts" name="jiaoshi-kcJiaoxuelouInfo" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import KcJiaoxuelouInfoModal from './components/KcJiaoxuelouInfoModal.vue'
import {columns, searchFormSchema} from './KcJiaoxuelouInfo.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './KcJiaoxuelouInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '教学楼信息',
api: list,
columns,
canResize:false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
},
exportConfig: {
name:"教学楼信息",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/jiaoshi/kcZhihuijiaoshiAccessLog/list',
save='/jiaoshi/kcZhihuijiaoshiAccessLog/add',
edit='/jiaoshi/kcZhihuijiaoshiAccessLog/edit',
deleteOne = '/jiaoshi/kcZhihuijiaoshiAccessLog/delete',
deleteBatch = '/jiaoshi/kcZhihuijiaoshiAccessLog/deleteBatch',
importExcel = '/jiaoshi/kcZhihuijiaoshiAccessLog/importExcel',
exportXls = '/jiaoshi/kcZhihuijiaoshiAccessLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

View File

@ -0,0 +1,143 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '日志类型1播放成功2播放失败',
align:"center",
dataIndex: 'logType'
},
{
title: '教学楼编号',
align:"center",
dataIndex: 'jxlId'
},
{
title: '教学楼名称',
align:"center",
dataIndex: 'jxlName'
},
{
title: '教室编号',
align:"center",
dataIndex: 'jsbh'
},
{
title: '教室名称',
align:"center",
dataIndex: 'jsmc'
},
{
title: '课堂ID',
align:"center",
dataIndex: 'ketangbiaoId'
},
{
title: '课堂名称',
align:"center",
dataIndex: 'ketangbiaoName'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "日志类型1播放成功2播放失败",
field: 'logType',
component: 'Input',
colProps: {span: 6},
},
{
label: "教学楼编号",
field: 'jxlId',
component: 'Input',
colProps: {span: 6},
},
{
label: "教学楼名称",
field: 'jxlName',
component: 'Input',
colProps: {span: 6},
},
{
label: "教室编号",
field: 'jsbh',
component: 'Input',
colProps: {span: 6},
},
{
label: "教室名称",
field: 'jsmc',
component: 'Input',
colProps: {span: 6},
},
{
label: "课堂ID",
field: 'ketangbiaoId',
component: 'Input',
colProps: {span: 6},
},
{
label: "课堂名称",
field: 'ketangbiaoName',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '日志类型1播放成功2播放失败',
field: 'logType',
component: 'InputNumber',
},
{
label: '教学楼编号',
field: 'jxlId',
component: 'Input',
},
{
label: '教学楼名称',
field: 'jxlName',
component: 'Input',
},
{
label: '教室编号',
field: 'jsbh',
component: 'Input',
},
{
label: '教室名称',
field: 'jsmc',
component: 'Input',
},
{
label: '课堂ID',
field: 'ketangbiaoId',
component: 'Input',
},
{
label: '课堂名称',
field: 'ketangbiaoName',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}

View File

@ -0,0 +1,173 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<KcZhihuijiaoshiAccessLogModal @register="registerModal" @success="handleSuccess"></KcZhihuijiaoshiAccessLogModal>
</div>
</template>
<script lang="ts" name="jiaoshi-kcZhihuijiaoshiAccessLog" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import KcZhihuijiaoshiAccessLogModal from './components/KcZhihuijiaoshiAccessLogModal.vue'
import {columns, searchFormSchema} from './KcZhihuijiaoshiAccessLog.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './KcZhihuijiaoshiAccessLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '智慧教室播放日志',
api: list,
columns,
canResize:false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
},
exportConfig: {
name:"智慧教室播放日志",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/jiaoshi/kcZhihuijiaoshiOperateLog/list',
save='/jiaoshi/kcZhihuijiaoshiOperateLog/add',
edit='/jiaoshi/kcZhihuijiaoshiOperateLog/edit',
deleteOne = '/jiaoshi/kcZhihuijiaoshiOperateLog/delete',
deleteBatch = '/jiaoshi/kcZhihuijiaoshiOperateLog/deleteBatch',
importExcel = '/jiaoshi/kcZhihuijiaoshiOperateLog/importExcel',
exportXls = '/jiaoshi/kcZhihuijiaoshiOperateLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

View File

@ -0,0 +1,159 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '日志类型1自动执行日志2手动操作操作日志',
align:"center",
dataIndex: 'logType'
},
{
title: '教学楼编号',
align:"center",
dataIndex: 'jxlId'
},
{
title: '教学楼名称',
align:"center",
dataIndex: 'jxlName'
},
{
title: '教室编号',
align:"center",
dataIndex: 'jsbh'
},
{
title: '教室名称',
align:"center",
dataIndex: 'jsmc'
},
{
title: '操作类型(1开启0关闭)',
align:"center",
dataIndex: 'operateType'
},
{
title: '操作结果',
align:"center",
dataIndex: 'operateUrl'
},
{
title: '操作结果',
align:"center",
dataIndex: 'operateResult'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "日志类型1自动执行日志2手动操作操作日志",
field: 'logType',
component: 'Input',
colProps: {span: 6},
},
{
label: "教学楼编号",
field: 'jxlId',
component: 'Input',
colProps: {span: 6},
},
{
label: "教学楼名称",
field: 'jxlName',
component: 'Input',
colProps: {span: 6},
},
{
label: "教室编号",
field: 'jsbh',
component: 'Input',
colProps: {span: 6},
},
{
label: "教室名称",
field: 'jsmc',
component: 'Input',
colProps: {span: 6},
},
{
label: "操作类型(1开启0关闭)",
field: 'operateType',
component: 'Input',
colProps: {span: 6},
},
{
label: "操作结果",
field: 'operateUrl',
component: 'Input',
colProps: {span: 6},
},
{
label: "操作结果",
field: 'operateResult',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '日志类型1自动执行日志2手动操作操作日志',
field: 'logType',
component: 'InputNumber',
},
{
label: '教学楼编号',
field: 'jxlId',
component: 'Input',
},
{
label: '教学楼名称',
field: 'jxlName',
component: 'Input',
},
{
label: '教室编号',
field: 'jsbh',
component: 'Input',
},
{
label: '教室名称',
field: 'jsmc',
component: 'Input',
},
{
label: '操作类型(1开启0关闭)',
field: 'operateType',
component: 'Input',
},
{
label: '操作结果',
field: 'operateUrl',
component: 'InputTextArea',
},
{
label: '操作结果',
field: 'operateResult',
component: 'InputTextArea',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}

View File

@ -0,0 +1,173 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<KcZhihuijiaoshiOperateLogModal @register="registerModal" @success="handleSuccess"></KcZhihuijiaoshiOperateLogModal>
</div>
</template>
<script lang="ts" name="jiaoshi-kcZhihuijiaoshiOperateLog" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import KcZhihuijiaoshiOperateLogModal from './components/KcZhihuijiaoshiOperateLogModal.vue'
import {columns, searchFormSchema} from './KcZhihuijiaoshiOperateLog.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './KcZhihuijiaoshiOperateLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '智慧教室操作日志',
api: list,
columns,
canResize:false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
},
exportConfig: {
name:"智慧教室操作日志",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../KcJiaoxuelouInfo.data';
import {saveOrUpdate} from '../KcJiaoxuelouInfo.api';
export default defineComponent({
name: "KcJiaoxuelouInfoForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 12}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/jiaoshi/kcJiaoxuelouInfo/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

View File

@ -0,0 +1,66 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="896" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../KcJiaoxuelouInfo.data';
import {saveOrUpdate} from '../KcJiaoxuelouInfo.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 12}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
}
:deep(.ant-calendar-picker){
width: 100%
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../KcZhihuijiaoshiAccessLog.data';
import {saveOrUpdate} from '../KcZhihuijiaoshiAccessLog.api';
export default defineComponent({
name: "KcZhihuijiaoshiAccessLogForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/jiaoshi/kcZhihuijiaoshiAccessLog/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

View File

@ -0,0 +1,66 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../KcZhihuijiaoshiAccessLog.data';
import {saveOrUpdate} from '../KcZhihuijiaoshiAccessLog.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
}
:deep(.ant-calendar-picker){
width: 100%
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../KcZhihuijiaoshiOperateLog.data';
import {saveOrUpdate} from '../KcZhihuijiaoshiOperateLog.api';
export default defineComponent({
name: "KcZhihuijiaoshiOperateLogForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/jiaoshi/kcZhihuijiaoshiOperateLog/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

View File

@ -0,0 +1,66 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../KcZhihuijiaoshiOperateLog.data';
import {saveOrUpdate} from '../KcZhihuijiaoshiOperateLog.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
}
:deep(.ant-calendar-picker){
width: 100%
}
</style>

View File

@ -28,7 +28,24 @@
</a-form>
</div>
<a-table :loading="loading" :data-source="leftList" :pagination="false" bordered size="middle" class="ant-table-striped" :scroll="{ y: 650 }">
<div class="" style="padding: 1rem;">
<a-row :gutter="[16,16]">
<a-col :span="6" v-for="(item,index) of cardList" :key="index">
<a-card bordered hoverable @click="() => currentCardIndex = index" :class="currentCardIndex == index?'active':''">
<div>名称{{ item.jxlName }}</div>
<div>总数{{ item.child.length }}</div>
<!-- {{ item.child }} -->
<div>正在上课的教室{{ item.child.filter(x => x?.nowIsClass).length || 0}}</div>
<div>正常直播的教室{{ item.child.filter(x => x?.child['教师近景']?.isOnLine).length || 0}}</div>
<div>没开启直播的教室{{ item.child.filter(x => !x?.child['教师近景']?.isOnLine).length || 0 }}</div>
</a-card>
</a-col>
</a-row>
</div>
<a-table v-show="true" :loading="loading" :data-source="cardList[currentCardIndex]?.child??[]" :pagination="false" bordered size="middle" class="ant-table-striped" :scroll="{ y: 650 }">
<a-table-column title="教室" data-index="jsmc"/>
<a-table-column title="教师近景" align="center" data-index="child_教师近景">
<template #default="{ record }">
@ -121,7 +138,9 @@ import { useRouter } from 'vue-router';
const showAllLiveRef = ref();
const leftList:Ref<any> = ref([]);
const cardList:Ref<any> = ref([]);
const currentItem:Ref<any> = ref({});
const currentCardIndex:Ref<any> = ref(0);
// const topWidth:any = ref('0');
// const isfirst:any = ref(false);
const showAllLiveKey:Ref<string> = ref('showAllLiveKey');
@ -204,6 +223,7 @@ function loadData(){
let list = (res?.records) ?? [];
//
let map = {};
let jxlMap = {};
list.forEach(x => {
let item = map[x.jsmc];
x.isOnLine = false;
@ -220,6 +240,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];
}
});
cardList.value = Object.values(jxlMap);
loading.value = false;
nextTick(() => {
leftList.value.forEach(item => {
@ -273,31 +310,11 @@ function changeLive(record, isEnable){
Object.values(record.child).forEach(x => {
let item:any = x;
//ID
if(item.xm == '教师近景'){
ids.push(item.id);
// changeLiveEnd.push(new Promise((resolve,reject) => {
// videojs.xhr.get(getAvyCtrlLiveOpenOrCloseUrl(item.ip,item.user,item.mima,isEnable),(err, resp, body) => {
// if(!err){
// resolve(true);
// }else{
// reject(false);
// }
// })
// }));
}
});
// console.log('changeLiveEnd ->',changeLiveEnd);
// Promise.all(changeLiveEnd).then(resList => {
// console.log(`🚀 ----------------------------------------------------------🚀`);
// console.log(`🚀 ~ file: index.vue:181 ~ Promise.all ~ resList:`, resList);
// console.log(`🚀 ----------------------------------------------------------🚀`);
// createMessage.info("");
// loadData();
// }).catch(e => {
// console.error(e);
// createMessage.error("");
// loading.value = false;
// });
changeAvyLiveApi({ ids:ids.join(','), type: isEnable?1:0 }).then(res => {
console.log(`🚀 -------------------------------------------------------🚀`);
@ -317,15 +334,6 @@ function changeLive(record, isEnable){
createInfoModal({title: '错误结果',content:e})
})
// if(!err){
// createMessage.info("");
// loadData();
// }else{
// createMessage.error("");
// }
}
function changeKt(record, isEnable){
@ -337,11 +345,7 @@ function changeKt(record, isEnable){
});
if(!ids) return;
updateAllLive({ ids: ids.join(','), sfyx: isEnable?0:1}).then(res => {
console.log(`🚀 ----------------------------------------------------🚀`);
console.log(`🚀 ~ file: index.vue:176 ~ updateAllLive ~ res:`, res);
console.log(`🚀 ----------------------------------------------------🚀`);
loadData();
// createMessage.
}).catch(e => {
console.error(e);
loading.value = false;
@ -393,15 +397,6 @@ async function closeQuartz(){
await pauseJob({ id: shangXianQuartz.value.id }, loadData);
}
// async function handlerPause(record) {
// await pauseJob({ id: record.id }, reload);
// }
// async function handlerResume(record) {
// await resumeJob({ id: record.id }, reload);
// }
</script>
<style lang="less" scoped>
.videoMax{
@ -454,4 +449,7 @@ video::-webkit-media-controls-timeline {
min-height: 0px !important;
padding: 0 0 8px 0 !important;
}
.active{
background-color: #36b395;
}
</style>

View File

@ -0,0 +1,460 @@
<template>
<div style="width:100%;height: 100%;">
<div class="jeecg-basic-table-form-container">
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="教室名称">
<!-- <j-dict-select-tag placeholder="请选择教室" v-model:value="queryParam.xqxn" dictCode="kc_xqxn_history,title,title"/> -->
<j-input placeholder="请输入教室名称" v-model:value="queryParam.jsmc"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:check-square-outlined" @click="closeQuartz" v-if="shangXianQuartz.status == 0" style="margin-left: 8px">停止自动调整教室</a-button>
<a-button type="primary" preIcon="ant-design:border-outlined" @click="openQuartz" v-if="shangXianQuartz.status == -1" style="margin-left: 8px">开启自动调整教室</a-button>
<!--<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>-->
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-table :loading="loading" :data-source="leftList" :pagination="false" bordered size="middle" class="ant-table-striped" :scroll="{ y: 650 }">
<a-table-column title="教室" data-index="jsmc"/>
<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="当前是否有课" align="center" data-index="nowIsClass">
<template #default="{ record }">
<span :class="record?.nowIsClass?'green':'red'">
<i class="fas fa-circle"/>
</span>
</template>
</a-table-column>
<a-table-column title="下一节是否有课" align="center" data-index="nextIsClass">
<template #default="{ record }">
<span :class="record?.nextIsClass?'green':'red'">
<i class="fas fa-circle"/>
</span>
</template>
</a-table-column>
<a-table-column title="课堂上线" align="center" data-index="sfyx">
<template #default="{ text }">
<span :class="text == 0?'green':'red'">
<i class="fas fa-circle"/>
</span>
</template>
</a-table-column>
<a-table-column width="200px" title="操作" data-index="action">
<template #default="{ record }">
<a @click="ylLiveNew(record)" >预览 |</a>
<a @click="ylLive(record)" hidden>预览 |</a>
<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>
<!-- {{ record.id }} -->
</template>
</a-table-column>
</a-table>
</div>
<a-modal :visible="isShowAllLive" width="80%" style="top: 20px" title="直播" :ok-button-props="{ style: { display: 'none' } }" cancelText="关闭" @cancel="() => (isShowAllLive = false,showAllLiveRef.close())">
<showAllLive ref="showAllLiveRef" :currentItem="currentItem" :isShowAllLive="isShowAllLive"/>
</a-modal>
</template>
<script lang="ts" setup name="zhihuijiaoshiIndexPage">
import { defHttp } from '/@/utils/http/axios';
import { ref, onMounted, Ref, watch, reactive } from 'vue';
import { nextTick } from 'vue';
import videojs from "video.js";
import { useMessage } from '/@/hooks/web/useMessage';
import showAllLive from './showAllLive.vue';
import { execAvyApi, getAvyCtrlLiveOpenOrCloseUrl } from "/@/views/site/utils/index";
import { JInput } from '/@/components/Form';
import { resumeJob, pauseJob } from '/@/views/monitor/quartz/quartz.api';
import { useRouter } from 'vue-router';
// const _document:any = window.document;
const showAllLiveRef = ref();
const leftList:Ref<any> = ref([]);
const currentItem:Ref<any> = ref({});
// const topWidth:any = ref('0');
// const isfirst:any = ref(false);
const showAllLiveKey:Ref<string> = ref('showAllLiveKey');
const isShowAllLive:Ref<boolean> = ref(false);
const loading:Ref<boolean> = ref(false);
const { createMessage, createInfoModal } = useMessage();
const route = useRouter();
const queryParam:Ref<any> = ref({});
onMounted(() => {
loadData();
});
enum Api {
list = '/jiaoshi/kcZhihuijiaoshi/list',
updateAllLive = '/jiaoshi/kcZhihuijiaoshi/updateAllLive',
changeAvyLiveApi = '/httpinterface/runAvyApiByIds',
}
/**
* 列表接口
* @param params
*/
const list = (params) => defHttp.get({ url: Api.list, params });
const updateAllLive = (params) => defHttp.get({ url: Api.updateAllLive, params });
const changeAvyLiveApi = (params) => defHttp.get({ url: Api.changeAvyLiveApi, params });
const shangXianQuartz = ref<any>({});
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
const ipagination = ref(
{
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条';
},
showQuickJumper: true,
showSizeChanger: true,
total: 0,
}
);
function loadData(){
loading.value = true;
let getListAction:any = [];
let liveIsExist = (x) => {
return new Promise((resolve,reject) => {
videojs.xhr.get(x.pullUrl,(err, resp, body) => {
if(err){
reject(false);
x.isOnLine = false
}else{
resolve(true);
x.isOnLine = true
}
})
//
// defHttp.get({ url: x.pullUrl }, { isExternal: true, withToken: true }).then(res => {
// resolve(true);
// x.isOnLine = true;
// }).catch(eres => {
// reject(false);
// x.isOnLine = false;
// })
})
}
list({ pageSize: -1, changshang: '奥威亚',...queryParam.value }).then(res => {
let list = (res?.records) ?? [];
//
let map = {};
list.forEach(x => {
let item = map[x.jsmc];
x.isOnLine = false;
if(item){
item.child[x.xm] = x;
}else{
let child = {};
child[x.xm] = x;
map[x.jsmc] = {
...x,
child
};
item = map[x.jsmc];
}
});
leftList.value = Object.values(map);
loading.value = false;
nextTick(() => {
leftList.value.forEach(item => {
let child = item.child;
Object.values(child).forEach(item => {
let x:any = item;
// if(x.pullUrl == 'https://kczx.nenu.edu.cn:9553/live_hls/yfjxl101s_lbzj.m3u8')
getListAction.push(liveIsExist(x));
});
});
Promise.all(getListAction).then(resList => {
console.log(`🚀 ~ file: index.vue:104 ~ Promise.all ~ ress:`, resList);
// loading.value = false;
}).catch((e) => {
console.error(e);
// loading.value = false;
});
});
//
// let mainDiv:any = _document?.querySelector('.ant-layout .jeecg-default-layout-main > div');
// topWidth.value =mainDiv?.style?.height?? '0';
});
getAutoShangXianQuartz();
}
function ylLive(record){
console.log(`🚀 ---------------------------------------------------🚀`);
console.log(`🚀 ~ file: index.vue:192 ~ ylLive ~ ----record:`, record);
console.log(`🚀 ---------------------------------------------------🚀`);
isShowAllLive.value = true
nextTick(() => {
currentItem.value = record
})
}
function ylLiveNew(record) {
let routeData = route.resolve({ path:'/site/liveRoom2',query:{ id: record.jsbh } });
window.open(routeData.href, '_blank');
}
function changeLive(record, isEnable){
console.log('createInfoModal ->',createInfoModal);
loading.value = true;
let ids:any = [];
let changeLiveEnd:any = [];
Object.values(record.child).forEach(x => {
let item:any = x;
//ID
if(item.xm == '教师近景'){
ids.push(item.id);
}
// changeLiveEnd.push(new Promise((resolve,reject) => {
// videojs.xhr.get(getAvyCtrlLiveOpenOrCloseUrl(item.ip,item.user,item.mima,isEnable),(err, resp, body) => {
// if(!err){
// resolve(true);
// }else{
// reject(false);
// }
// })
// }));
});
// console.log('changeLiveEnd ->',changeLiveEnd);
// Promise.all(changeLiveEnd).then(resList => {
// console.log(`🚀 ----------------------------------------------------------🚀`);
// console.log(`🚀 ~ file: index.vue:181 ~ Promise.all ~ resList:`, resList);
// console.log(`🚀 ----------------------------------------------------------🚀`);
// createMessage.info("");
// loadData();
// }).catch(e => {
// console.error(e);
// createMessage.error("");
// loading.value = false;
// });
changeAvyLiveApi({ ids:ids.join(','), type: isEnable?1:0 }).then(res => {
console.log(`🚀 -------------------------------------------------------🚀`);
console.log(`🚀 ~ file: index.vue:295 ~ changeAvyLiveApi ~ res:`, res);
console.log(`🚀 -------------------------------------------------------🚀`);
loadData();
let content = '';
res.forEach(x => {
content += x.jsmc + "-" + x.xm
content += " " + x.resText + "<br/>"
});
createInfoModal({ width:'50%', title: '结果',content })
}).catch(e => {
console.error(e);
loading.value = false;
createInfoModal({title: '错误结果',content:e})
})
// if(!err){
// createMessage.info("");
// loadData();
// }else{
// createMessage.error("");
// }
}
function changeKt(record, isEnable){
loading.value = true;
let ids:any = [];
Object.values(record.child).forEach(x => {
let item:any = x;
ids.push(item.id);
});
if(!ids) return;
updateAllLive({ ids: ids.join(','), sfyx: isEnable?0:1}).then(res => {
console.log(`🚀 ----------------------------------------------------🚀`);
console.log(`🚀 ~ file: index.vue:176 ~ updateAllLive ~ res:`, res);
console.log(`🚀 ----------------------------------------------------🚀`);
loadData();
// createMessage.
}).catch(e => {
console.error(e);
loading.value = false;
})
}
function tableChange(pagination) {
ipagination.value.current = pagination.current;
ipagination.value.pageSize = pagination.pageSize;
loadData();
}
/**
* 查询
*/
function searchQuery() {
loadData();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
//
loadData();
}
function getAutoShangXianQuartz(){
defHttp.get({ url: '/jiaoshi/kcZhihuijiaoshi/getAutoShangXianQuartz', params: {} }).then(res => {
shangXianQuartz.value = res;
})
}
/**
* 启动
*/
async function openQuartz(){
await resumeJob({ id: shangXianQuartz.value.id }, loadData);
}
/**
* 暂停
*/
async function closeQuartz(){
await pauseJob({ id: shangXianQuartz.value.id }, loadData);
}
// async function handlerPause(record) {
// await pauseJob({ id: record.id }, reload);
// }
// async function handlerResume(record) {
// await resumeJob({ id: record.id }, reload);
// }
</script>
<style lang="less" scoped>
.videoMax{
width: 25%;
}
.videoCardMain {
:deep(.ant-card-body) {
padding: 0;
}
}
/* 隐藏video 进度条 */
video::-webkit-media-controls-timeline {
display: none;
}
.green {
color: green;
}
.red {
color: red;
}
.jeecg-basic-table-form-container {
.ant-form {
padding: 12px 10px 6px 10px;
margin-bottom: 8px;
background-color: #fff;
border-radius: 2px;
}
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
}
.jeecg-basic-table-form-containera{
line-height: 24px;
background: #fff;
padding: 20px 0 0 10px;
margin-bottom: -20px;
}
.jeecg-basic-table .ant-table-wrapper .ant-table-title {
min-height: 0px !important;
padding: 0 0 8px 0 !important;
}
</style>

View File

@ -65,7 +65,7 @@
</div>
<span class="topTitle" >
<div hidden @click="testKuayu">点击开始跨域报错</div>
<div hidden1 @click="testKuayu">点击开始跨域报错</div>
<RouterLink :to="{path:'/site/index'}" style="color:white;">{{ projectName }}
<span style="font-size: 16px;" v-if="getSysConfig().flag1">{{getSysConfig().flag1}}({{getSysConfig().bxqkssj}}{{getSysConfig().bxqjssj}})</span>
<span style="font-size: 16px;margin-left: 20px;" >本学期听课要求{{tkyqcs}}<span v-if="tkyqcs!='未配置'"></span>已完成{{tkyqywc}}</span>