This commit is contained in:
bai 2023-10-31 01:32:13 +08:00
commit 9ddb60a6d4
7 changed files with 513 additions and 5 deletions

View File

@ -24,12 +24,15 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="听课类型" v-bind="validateInfos.sf"> <a-form-item label="听课类型" v-bind="validateInfos.sf">
<a-input v-model:value="formData.sf" placeholder="请输听课类型" :disabled="disabled"></a-input> <!-- <a-input v-model:value="formData.sf" placeholder="请输听课类型" :disabled="disabled"></a-input> -->
<j-dict-select-tag v-model:value="formData.sf" dictCode="tklx" placeholder="请选择听课类型" :disabled="disabled"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="状态" v-bind="validateInfos.zt"> <a-form-item label="状态" v-bind="validateInfos.zt">
<a-input v-model:value="formData.zt" placeholder="请输状态" :disabled="disabled"></a-input> <!-- <a-input v-model:value="formData.zt" placeholder="请输状态" :disabled="disabled"></a-input> -->
<j-dict-select-tag v-model:value="formData.zt" :dictCode="`xxhbjzgdqzt,mc,mc`" placeholder="请选择状态" :disabled="disabled"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -89,11 +92,11 @@
// //
const validatorRules = { const validatorRules = {
gh: [{ required: true, message: '请输入教师!'}, { validator: ghDuplicatevalidate }], gh: [{ required: true, message: '请输入教师!'}, { validator: ghDuplicatevalidate }],
tklx: [{ required: true, message: '请输入听课类型!'},], tklx: [{ required: true, message: '请输入身份!'},],
dwmc: [{ required: true, message: '请输入单位名称!'},], dwmc: [{ required: true, message: '请输入单位名称!'},],
xm: [{ required: true, message: '请输入教师姓名!'},], xm: [{ required: true, message: '请输入教师姓名!'},],
zt: [{ required: true, message: '请输入状态!'},], zt: [{ required: true, message: '请输入状态!'},],
sf: [{ required: true, message: '请输入身份!'},], sf: [{ required: true, message: '请输入听课类型!'},],
ytkcs: [{ required: true, message: '请输入每学期应听课次数!'},], ytkcs: [{ required: true, message: '请输入每学期应听课次数!'},],
}; };
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });

View File

@ -32,6 +32,7 @@
<a-col :lg="6"> <a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button> <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:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:up-outlined" @click="handleBaobiao" style="margin-left: 8px">报表</a-button>
<!--<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px"> <!--<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }} {{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" /> <Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
@ -82,6 +83,8 @@
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->
<KcZhihuijiaoshiMonitorLogModal ref="registerModal" @success="handleSuccess"></KcZhihuijiaoshiMonitorLogModal> <KcZhihuijiaoshiMonitorLogModal ref="registerModal" @success="handleSuccess"></KcZhihuijiaoshiMonitorLogModal>
<KcZhihuijiaoshiMonitorStaticLogModal ref="registerStaticModal"></KcZhihuijiaoshiMonitorStaticLogModal>
</div> </div>
</template> </template>
@ -93,10 +96,13 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcZhihuijiaoshiMonitorLog.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcZhihuijiaoshiMonitorLog.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import KcZhihuijiaoshiMonitorLogModal from './components/KcZhihuijiaoshiMonitorLogModal.vue' import KcZhihuijiaoshiMonitorLogModal from './components/KcZhihuijiaoshiMonitorLogModal.vue'
import KcZhihuijiaoshiMonitorStaticLogModal from './staticlist/KcZhihuijiaoshiMonitorStaticLogModal.vue'
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
const registerStaticModal = ref();
//table //table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: { tableProps: {
@ -133,6 +139,11 @@
sm: { span: 16 }, sm: { span: 16 },
}); });
function handleBaobiao(){
registerStaticModal.value.disableSubmit = false;
registerStaticModal.value.add();
}
/** /**
* 新增事件 * 新增事件
*/ */

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/staticList',
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,107 @@
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: 'startTime'
},
{
title: '教学楼名称',
align: "center",
dataIndex: 'jxlName'
},
{
title: '教室名称',
align: "center",
dataIndex: 'jsmc'
},
{
title: '状态正常数量',
align:"center",
dataIndex: 'ztzcNum'
},
{
title: '开启成功数量',
align:"center",
dataIndex: 'kqcgNum'
},
{
title: '开启失败数量',
align:"center",
dataIndex: 'kqsbNum'
},
];
//查询数据
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,243 @@
<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 :span="6">
<a-form-item label="开始时间">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择开始时间'"
v-model:value="queryParam.startTime"
style="width:200px;"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="结束时间">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择结束时间'"
v-model:value="queryParam.endTime"
style="width:200px;"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="教学楼名称">
<a-select placeholder="请选择教学楼" v-model:value="queryParam.jxlName">
<a-select-option :value="undefined">全部</a-select-option>
<a-select-option :value="`逸夫教学楼`">逸夫教学楼</a-select-option>
<a-select-option :value="`净月综合教学楼`">净月综合教学楼</a-select-option>
<a-select-option :value="`惟真楼`">惟真楼</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="教室名称">
<j-input placeholder="请输入教室名称" v-model:value="queryParam.jsmc"></j-input>
</a-form-item>
</a-col>
<a-col :span="6">
<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:export-outlined" @click="onExportXls" style="margin-left: 8px"> 导出</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<!-- <template #action="{ record }">
<TableAction />
</template> -->
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</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>
<!-- 表单区域 -->
</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 './KcZhihuijiaoshiMonitorStaticLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcZhihuijiaoshiMonitorStaticLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { JInput } from '/@/components/Form';
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '智慧教室操作日志报表',
api: list,
columns,
canResize:false,
useSearchForm: false,
showActionColumn: false,//
// actionColumn: {
// width: 120,
// fixed: 'right',
// },
beforeFetch: (params) => {
params.column = '',params.order = '';//
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "智慧教室操作日志报表",
url: getExportUrl,
params: queryParam.value,
},
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 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<KcZhihuijiaoshiMonitorStaticLogList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcZhihuijiaoshiMonitorStaticLogList>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import KcZhihuijiaoshiMonitorStaticLogList from './KcZhihuijiaoshiMonitorStaticLogList.vue'
const title = ref<string>('');
const width = ref<string>('80%');
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;
}
/**
* 编辑
* @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

@ -52,7 +52,7 @@
<a-form-item label="评价类型"> <a-form-item label="评价类型">
<j-dict-select-tag <j-dict-select-tag
placeholder="请选择评价类型" v-model:value="queryParam.col15" placeholder="请选择评价类型" v-model:value="queryParam.col15"
:options="[{ value: '一般听课表', label: '一般听课表'}, { value: '线上听课表', label: '线上听课表'},{ value: '同行评价表', label: '同行评价表'}]" :options="[{ value: '一般听课表', label: '一般听课表'}, { value: '线上听课表', label: '线上听课表'},{ value: '同行评价表', label: '同行评价表'},{ value: '老版评价表', label: '老版评价表'}]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>