2023年10月30日 新增日志

This commit is contained in:
bai 2023-10-30 01:40:08 +08:00
parent c8b2beafbb
commit 1864d4fbd7
11 changed files with 1412 additions and 1 deletions

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/jiaoshi/kcZhihuijiaoshiMonitorLog/list',
save='/jiaoshi/kcZhihuijiaoshiMonitorLog/add',
edit='/jiaoshi/kcZhihuijiaoshiMonitorLog/edit',
deleteOne = '/jiaoshi/kcZhihuijiaoshiMonitorLog/delete',
deleteBatch = '/jiaoshi/kcZhihuijiaoshiMonitorLog/deleteBatch',
importExcel = '/jiaoshi/kcZhihuijiaoshiMonitorLog/importExcel',
exportXls = '/jiaoshi/kcZhihuijiaoshiMonitorLog/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 });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
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
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,109 @@
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: 'createBy_dictText',
customRender: ({ text }) => {
return text?? '系统';
},
},
{
title: '时间',
align:"center",
dataIndex: 'createTime'
},
{
title: '日志类型',
align: "center",
dataIndex: 'logType',
customRender: ({ text }) => {
let map = ['','状态正常', '开启成功', '开启失败']
return map[text]
},
},
{
title: '教学楼名称',
align: "center",
dataIndex: 'jxlName'
},
{
title: '教室名称',
align: "center",
dataIndex: 'jsmc'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "日志类型",
field: 'logType',
component: 'Select',
colProps: {span: 6},
componentProps: {
options: [
{
label: '状态正常',
value: 1,
key: 1,
},
{
label: '开启成功',
value: 2,
key: 2,
},
{
label: '开启失败',
value: 2,
key: 2,
},
],
},
},
{
label: "教学楼名称",
field: 'jxlName',
component: 'Input',
colProps: {span: 6},
},
{
label: "教室名称",
field: 'jsmc',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '日志类型',
field: 'logType',
component: 'JDictSelectTag',
componentProps:{
dictCode: ""
},
},
{
label: '教学楼名称',
field: 'jxlName',
component: 'Input',
},
{
label: '教室名称',
field: 'jsmc',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,251 @@
<template>
<div>
<!--查询区域-->
<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="日志类型">
<!-- <a-input placeholder="请选择日志类型" v-model:value="queryParam.logType"></a-input> -->
<a-select placeholder="请选择日志类型" v-model:value="queryParam.logType">
<a-select-option :value="undefined">全部</a-select-option>
<a-select-option :value="1">状态正常</a-select-option>
<a-select-option :value="2">开启成功</a-select-option>
<a-select-option :value="3">开启失败</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="教学楼名称">
<a-input placeholder="请输入教学楼名称" v-model:value="queryParam.jxlName"></a-input>
</a-form-item>
</a-col>
<!--<template v-if="toggleSearchStatus">-->
<a-col :lg="8">
<a-form-item label="教室名称">
<a-input placeholder="请输入教室名称" v-model:value="queryParam.jsmc"></a-input>
</a-form-item>
</a-col>
<!--</template>-->
<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 @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>
<!--引用表格-->
<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>
<!-- 表单区域 -->
<KcZhihuijiaoshiMonitorLogModal ref="registerModal" @success="handleSuccess"></KcZhihuijiaoshiMonitorLogModal>
</div>
</template>
<script lang="ts" name="jiaoshi-kcZhihuijiaoshiMonitorLog" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './KcZhihuijiaoshiMonitorLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcZhihuijiaoshiMonitorLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import KcZhihuijiaoshiMonitorLogModal from './components/KcZhihuijiaoshiMonitorLogModal.vue'
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'kc_zhihuijiaoshi_monitor_log',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
params.column = '',params.order = '';//
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "kc_zhihuijiaoshi_monitor_log",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
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),
// },
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
// {
// label: '',
// popConfirm: {
// title: '',
// confirm: handleDelete.bind(null, record),
// }
// }
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.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
}
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/jiaoshi/kcZhihuijiaoshiStateLog/list',
save='/jiaoshi/kcZhihuijiaoshiStateLog/add',
edit='/jiaoshi/kcZhihuijiaoshiStateLog/edit',
deleteOne = '/jiaoshi/kcZhihuijiaoshiStateLog/delete',
deleteBatch = '/jiaoshi/kcZhihuijiaoshiStateLog/deleteBatch',
importExcel = '/jiaoshi/kcZhihuijiaoshiStateLog/importExcel',
exportXls = '/jiaoshi/kcZhihuijiaoshiStateLog/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 });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
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
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,169 @@
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: 'createBy_dictText',
customRender: ({ text }) => {
return text?? '系统';
},
},
{
title: '时间',
align:"center",
dataIndex: 'createTime'
},
{
title: '教学楼名称',
align: "center",
dataIndex: 'jxlName'
},
{
title: '教室名称',
align: "center",
dataIndex: 'jsmc'
},
{
title: '教师近景',
align: "center",
dataIndex: 'lbzj'
},
{
title: '教师全景',
align: "center",
dataIndex: 'jsqj'
},
{
title: '学生全景',
align: "center",
dataIndex: 'xsqj'
},
{
title: 'PPT',
align: "center",
dataIndex: 'ppt'
},
{
title: '绿色的数量',
align: "center",
dataIndex: 'greenNum'
},
{
title: '状态指示',
align: "center",
dataIndex: 'type',
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "教学楼名称",
field: 'jxlName',
component: 'Input',
colProps: {span: 6},
},
{
label: "教室名称",
field: 'jsmc',
component: 'Input',
colProps: {span: 6},
},
{
label: "教师近景",
field: 'lbzj',
component: 'Input',
colProps: {span: 6},
},
{
label: "教师全景",
field: 'jsqj',
component: 'Input',
colProps: {span: 6},
},
{
label: "学生全景",
field: 'xsqj',
component: 'Input',
colProps: {span: 6},
},
{
label: "PPT",
field: 'ppt',
component: 'Input',
colProps: {span: 6},
},
{
label: "绿色的数量",
field: 'greenNum',
component: 'Input',
colProps: {span: 6},
},
{
label: "状态指示灯",
field: 'type',
component: 'JDictSelectTag',
componentProps:{
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '教学楼名称',
field: 'jxlName',
component: 'Input',
},
{
label: '教室名称',
field: 'jsmc',
component: 'Input',
},
{
label: '教师近景',
field: 'lbzj',
component: 'Input',
},
{
label: '教师全景',
field: 'jsqj',
component: 'Input',
},
{
label: '学生全景',
field: 'xsqj',
component: 'Input',
},
{
label: 'PPT',
field: 'ppt',
component: 'Input',
},
{
label: '绿色的数量',
field: 'greenNum',
component: 'InputNumber',
},
{
label: '状态指示灯',
field: 'type',
component: 'JDictSelectTag',
componentProps:{
dictCode: ""
},
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,270 @@
<template>
<div>
<!--查询区域-->
<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="教学楼名称">
<a-input placeholder="请输入教学楼名称" v-model:value="queryParam.jxlName"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="教室名称">
<a-input placeholder="请输入教室名称" v-model:value="queryParam.jsmc"></a-input>
</a-form-item>
</a-col>
<!--<template v-if="toggleSearchStatus">-->
<!-- <a-col :lg="8">
<a-form-item label="教师近景">
<a-input placeholder="请输入教师近景" v-model:value="queryParam.lbzj"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="教师全景">
<a-input placeholder="请输入教师全景" v-model:value="queryParam.jsqj"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="学生全景">
<a-input placeholder="请输入学生全景" v-model:value="queryParam.xsqj"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="PPT">
<a-input placeholder="请输入PPT" v-model:value="queryParam.ppt"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="绿色的数量">
<a-input placeholder="请输入绿色的数量" v-model:value="queryParam.greenNum"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="状态指示灯green: 直播正常, yellow: 部分异常,red: 设备异常)">
<a-input placeholder="请输入状态指示灯green: 直播正常, yellow: 部分异常,red: 设备异常)" v-model:value="queryParam.type"></a-input>
</a-form-item>
</a-col> -->
<!--</template>-->
<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 @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>
<!--引用表格-->
<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>
<!-- 表单区域 -->
<KcZhihuijiaoshiStateLogModal ref="registerModal" @success="handleSuccess"></KcZhihuijiaoshiStateLogModal>
</div>
</template>
<script lang="ts" name="jiaoshi-kcZhihuijiaoshiStateLog" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './KcZhihuijiaoshiStateLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcZhihuijiaoshiStateLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import KcZhihuijiaoshiStateLogModal from './components/KcZhihuijiaoshiStateLogModal.vue'
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'kc_zhihuijiaoshi_state_log',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
params.column = '',params.order = '';//
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "kc_zhihuijiaoshi_state_log",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
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),
// },
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
// {
// label: '',
// popConfirm: {
// title: '',
// confirm: handleDelete.bind(null, record),
// }
// }
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.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
}
}
</style>

View File

@ -0,0 +1,146 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="日志类型" v-bind="validateInfos.logType">
<!-- <j-dict-select-tag v-model:value="formData.logType" dictCode="" placeholder="请选择日志类型(1:播放正常 | 2:播放失败,拉起成功 | 3:播放失败,拉起失败)" :disabled="disabled"/> -->
<a-select placeholder="请选择日志类型" v-model:value="formData.logType">
<a-select-option :value="undefined">全部</a-select-option>
<a-select-option :value="1">状态正常</a-select-option>
<a-select-option :value="2">开启成功</a-select-option>
<a-select-option :value="3">开启失败</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="教学楼名称" v-bind="validateInfos.jxlName">
<a-input v-model:value="formData.jxlName" placeholder="请输入教学楼名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="教室名称" v-bind="validateInfos.jsmc">
<a-input v-model:value="formData.jsmc" placeholder="请输入教室名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../KcZhihuijiaoshiMonitorLog.api';
import { Form } from 'ant-design-vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
logType: undefined,
jxlName: '',
jsmc: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<KcZhihuijiaoshiMonitorLogForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcZhihuijiaoshiMonitorLogForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import KcZhihuijiaoshiMonitorLogForm from './KcZhihuijiaoshiMonitorLogForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -0,0 +1,170 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="教学楼名称" v-bind="validateInfos.jxlName">
<a-input v-model:value="formData.jxlName" placeholder="请输入教学楼名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="教室名称" v-bind="validateInfos.jsmc">
<a-input v-model:value="formData.jsmc" placeholder="请输入教室名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="教师近景" v-bind="validateInfos.lbzj">
<a-input v-model:value="formData.lbzj" placeholder="请输入教师近景" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="教师全景" v-bind="validateInfos.jsqj">
<a-input v-model:value="formData.jsqj" placeholder="请输入教师全景" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学生全景" v-bind="validateInfos.xsqj">
<a-input v-model:value="formData.xsqj" placeholder="请输入学生全景" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="PPT" v-bind="validateInfos.ppt">
<a-input v-model:value="formData.ppt" placeholder="请输入PPT" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="绿色的数量" v-bind="validateInfos.greenNum">
<a-input-number v-model:value="formData.greenNum" placeholder="请输入绿色的数量" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="状态指示灯" v-bind="validateInfos.type">
<j-dict-select-tag v-model:value="formData.type" dictCode="" placeholder="请选择状态指示灯" :disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../KcZhihuijiaoshiStateLog.api';
import { Form } from 'ant-design-vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
jxlName: '',
jsmc: '',
lbzj: '',
jsqj: '',
xsqj: '',
ppt: '',
greenNum: undefined,
type: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<KcZhihuijiaoshiStateLogForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcZhihuijiaoshiStateLogForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import KcZhihuijiaoshiStateLogForm from './KcZhihuijiaoshiStateLogForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -26,7 +26,7 @@
</div> </div>
</a-col> </a-col>
<a-col :xs="{ span: 8 }" :sm="{ span: 8 }" :lg="{ span: 8 }"> <a-col :xs="{ span: 8 }" :sm="{ span: 8 }" :lg="{ span: 8 }">
<div class="numberBlob handleCss" @click="openDetail({ onLineClassType: 'red' })"> <div class="numberBlob handleCss" @click="refreshLogs({})">
<div class="numSpan orange" style="font-size: 24px;height: 50px;line-height: 50px;">未检测</div> <div class="numSpan orange" style="font-size: 24px;height: 50px;line-height: 50px;">未检测</div>
<div class="numberName"> <div class="numberName">
<!-- <RiseOutlined class="orange"/> --> <!-- <RiseOutlined class="orange"/> -->
@ -369,6 +369,7 @@ enum Api {
updateAllLive = '/jiaoshi/kcZhihuijiaoshi/updateAllLive', updateAllLive = '/jiaoshi/kcZhihuijiaoshi/updateAllLive',
changeAvyLiveApi = '/httpinterface/runAvyApiByIds', changeAvyLiveApi = '/httpinterface/runAvyApiByIds',
xxhbjsjbxxList = '/xxhbjsjbxx/xxhbjsjbxx/list', xxhbjsjbxxList = '/xxhbjsjbxx/xxhbjsjbxx/list',
refreshLogs = '/jiaoshi/kcZhihuijiaoshi/refreshLogs',
} }
/** /**
* 列表接口 * 列表接口
@ -378,6 +379,7 @@ const list = (params) => defHttp.get({ url: Api.list, params });
const updateAllLive = (params) => defHttp.get({ url: Api.updateAllLive, params }); const updateAllLive = (params) => defHttp.get({ url: Api.updateAllLive, params });
const changeAvyLiveApi = (params) => defHttp.get({ url: Api.changeAvyLiveApi, params,timeout: 9000000 }); const changeAvyLiveApi = (params) => defHttp.get({ url: Api.changeAvyLiveApi, params,timeout: 9000000 });
const jsjbxxList = (params) => defHttp.get({ url: Api.xxhbjsjbxxList, params,timeout: 9000000 }); const jsjbxxList = (params) => defHttp.get({ url: Api.xxhbjsjbxxList, params,timeout: 9000000 });
const refreshLogs = (params) => defHttp.get({ url: Api.refreshLogs, params,timeout: 9000000 });
const shangXianQuartz = ref<any>({}); const shangXianQuartz = ref<any>({});