Merge branch 'master' of https://gitee.com/mini-org-project/course_information_center_vue
This commit is contained in:
commit
9ddb60a6d4
|
@ -24,12 +24,15 @@
|
|||
</a-col>
|
||||
<a-col :span="24">
|
||||
<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-col>
|
||||
<a-col :span="24">
|
||||
<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-col>
|
||||
<a-col :span="24">
|
||||
|
@ -89,11 +92,11 @@
|
|||
//表单验证
|
||||
const validatorRules = {
|
||||
gh: [{ required: true, message: '请输入教师!'}, { validator: ghDuplicatevalidate }],
|
||||
tklx: [{ required: true, message: '请输入听课类型!'},],
|
||||
tklx: [{ required: true, message: '请输入身份!'},],
|
||||
dwmc: [{ required: true, message: '请输入单位名称!'},],
|
||||
xm: [{ required: true, message: '请输入教师姓名!'},],
|
||||
zt: [{ required: true, message: '请输入状态!'},],
|
||||
sf: [{ required: true, message: '请输入身份!'},],
|
||||
sf: [{ required: true, message: '请输入听课类型!'},],
|
||||
ytkcs: [{ required: true, message: '请输入每学期应听课次数!'},],
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<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:up-outlined" @click="handleBaobiao" 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'" />
|
||||
|
@ -82,6 +83,8 @@
|
|||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<KcZhihuijiaoshiMonitorLogModal ref="registerModal" @success="handleSuccess"></KcZhihuijiaoshiMonitorLogModal>
|
||||
<KcZhihuijiaoshiMonitorStaticLogModal ref="registerStaticModal"></KcZhihuijiaoshiMonitorStaticLogModal>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -93,10 +96,13 @@
|
|||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcZhihuijiaoshiMonitorLog.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import KcZhihuijiaoshiMonitorLogModal from './components/KcZhihuijiaoshiMonitorLogModal.vue'
|
||||
import KcZhihuijiaoshiMonitorStaticLogModal from './staticlist/KcZhihuijiaoshiMonitorStaticLogModal.vue'
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const registerStaticModal = ref();
|
||||
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
|
@ -133,6 +139,11 @@
|
|||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
function handleBaobiao(){
|
||||
registerStaticModal.value.disableSubmit = false;
|
||||
registerStaticModal.value.add();
|
||||
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
|
|
@ -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 });
|
||||
}
|
|
@ -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,
|
||||
},
|
||||
];
|
|
@ -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>
|
|
@ -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>
|
|
@ -52,7 +52,7 @@
|
|||
<a-form-item label="评价类型">
|
||||
<j-dict-select-tag
|
||||
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-col>
|
||||
|
|
Loading…
Reference in New Issue