添加听课统计功能

This commit is contained in:
yangjun 2023-04-01 18:17:41 +08:00
parent 0dde4fcf7f
commit 46ecc4f96f
21 changed files with 2022 additions and 0 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 = '/kcTingke/kcTingke/list',
save='/kcTingke/kcTingke/add',
edit='/kcTingke/kcTingke/edit',
deleteOne = '/kcTingke/kcTingke/delete',
deleteBatch = '/kcTingke/kcTingke/deleteBatch',
importExcel = '/kcTingke/kcTingke/importExcel',
exportXls = '/kcTingke/kcTingke/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,116 @@
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: '$no',
width: '50px',
customRender: (r) => {
return r.index+1;
}
},
{
title: '职工号',
align: "center",
dataIndex: 'userid'
},
{
title: '姓名',
align: "center",
dataIndex: 'username'
},
{
title: '听课人所在单位',
align: "center",
dataIndex: 'tksf1'
},
{
title: '听课身份',
align: "center",
dataIndex: 'tkyq'
},
{
title: '听课要求',
align: "center",
dataIndex: 'sjtksl'
},
{
title: '实际听课数',
align: "center",
dataIndex: 'mltksl'
},
{
title: '其中马列教研室课程数',
align: "center",
dataIndex: 'tkdw'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '听课时间',
field: 'tingketime',
component: 'Input',
},
{
label: '检查时间',
field: 'jianchatime',
component: 'Input',
},
{
label: '课程表id',
field: 'kechengbiaoid',
component: 'Input',
},
{
label: '用户id',
field: 'userid',
component: 'Input',
},
{
label: '用户名',
field: 'username',
component: 'Input',
},
{
label: '用户单位名称',
field: 'userdwmc',
component: 'Input',
},
{
label: 'usertksf1',
field: 'usertksf1',
component: 'Input',
},
{
label: 'usertksf2',
field: 'usertksf2',
component: 'Input',
},
{
label: 'usertksfcode',
field: 'usertksfcode',
component: 'Input',
},
{
label: 'usertkyq',
field: 'usertkyq',
component: 'InputNumber',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,168 @@
<template>
<div class="tktjClass">
<!--查询区域-->
<a-form @keyup.enter.native="searchQuery" :model="queryParam" >
<a-row :gutter="24">
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="听课身份" v-model:value="queryParam.tksf" dictCode="kc_tksf"/>
</a-form-item>
</a-col>
<a-col :span="4">
<a-form-item label="">
<JDictSelectTag placeholder="听课人所在单位" v-model:value="queryParam.szdw" :dictCode="`tkrszdw_view,college,college`"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="开课单位" v-model:value="queryParam.kkdw" :dictCode="`kc_kkdw_view,kkdw,kkdw`"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="课程性质" v-model:value="queryParam.kcxz" dictCode="kc_kcxz"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择开始时间'"
v-model:value="queryParam.startTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择结束时间'"
v-model:value="queryParam.endTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="3">
<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-col>
</span>
</a-col>
</a-row>
</a-form>
<!--引用表格-->
<BasicTable @register="registerTable">
</BasicTable>
<!-- 表单区域 -->
<KcTingkeModal ref="registerModal" @success="handleSuccess"></KcTingkeModal>
</div>
</template>
<script lang="ts" name="kcTingke-kcTingke" setup>
import { ref, reactive ,onMounted} from 'vue';
import { dateFormat } from '/@/utils/common/compUtils';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './KcTingke.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcTingke.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import KcTingkeModal from './components/KcTingkeModal.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
api: list,
columns,
canResize:true,
useSearchForm: false,
showActionColumn: false,
clickToRowSelect: true,
pagination: {
pageSize: 5
},
beforeFetch: (params) => {
params.column = '',params.order = '';
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "听课人员统计",
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 },
});
//
onMounted(() => {
const format = 'yyyy-MM-dd';
const startTime = new Date();
startTime.setTime(startTime.getTime()-60000*60*24*7)
queryParam.value.startTime = dateFormat(startTime, format)
queryParam.value.endTime = dateFormat(new Date(), format)
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
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,181 @@
<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.tingketime">
<a-input v-model:value="formData.tingketime" placeholder="请输入听课时间" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="检查时间" v-bind="validateInfos.jianchatime">
<a-input v-model:value="formData.jianchatime" placeholder="请输入检查时间" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="课程表id" v-bind="validateInfos.kechengbiaoid">
<a-input v-model:value="formData.kechengbiaoid" placeholder="请输入课程表id" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="用户id" v-bind="validateInfos.userid">
<a-input v-model:value="formData.userid" placeholder="请输入用户id" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="用户名" v-bind="validateInfos.username">
<a-input v-model:value="formData.username" placeholder="请输入用户名" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="用户单位名称" v-bind="validateInfos.userdwmc">
<a-input v-model:value="formData.userdwmc" placeholder="请输入用户单位名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="usertksf1" v-bind="validateInfos.usertksf1">
<a-input v-model:value="formData.usertksf1" placeholder="请输入usertksf1" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="usertksf2" v-bind="validateInfos.usertksf2">
<a-input v-model:value="formData.usertksf2" placeholder="请输入usertksf2" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="usertksfcode" v-bind="validateInfos.usertksfcode">
<a-input v-model:value="formData.usertksfcode" placeholder="请输入usertksfcode" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="usertkyq" v-bind="validateInfos.usertkyq">
<a-input-number v-model:value="formData.usertkyq" placeholder="请输入usertkyq" style="width: 100%" :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 { getValueType } from '/@/utils';
import { saveOrUpdate } from '../KcTingke.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: '',
tingketime: '',
jianchatime: '',
kechengbiaoid: '',
userid: '',
username: '',
userdwmc: '',
usertksf1: '',
usertksf2: '',
usertksfcode: '',
usertkyq: undefined,
});
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="关闭">
<KcTingkeForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcTingkeForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import KcTingkeForm from './KcTingkeForm.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,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/kcTingke/kcTingke/getKkdwlist',
save='/kcTingke/kcTingke/add',
edit='/kcTingke/kcTingke/edit',
deleteOne = '/kcTingke/kcTingke/delete',
deleteBatch = '/kcTingke/kcTingke/deleteBatch',
importExcel = '/kcTingke/kcTingke/importExcel',
exportXls = '/kcTingke/kcTingke/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,94 @@
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: '$no',
width: '50px',
customRender: (r) => {
return r.index+1;
}
},
{
title: '开课单位',
align: "center",
dataIndex: 'kkdw'
},
{
title: '开课课堂数',
align: "center",
dataIndex: 'kkkts'
},
{
title: '听课课堂数',
children: [
{
title: '总数',
dataIndex: 'tkkts',
key: 'tkkts',
},
{
title: '本单位数',
dataIndex: 'bdwtks',
key: 'bdwtks',
},
],
},
{
title: '评课课堂数',
children: [
{
title: '总数',
dataIndex: 'pkkts',
key: 'pkkts',
},
{
title: '本单位数',
dataIndex: 'bdwpks',
key: 'bdwpks',
},
],
},
{
title: '听课人次数',
children: [
{
title: '总人次数',
dataIndex: 'tkrcs',
key: 'tkrcs',
},
{
title: '本单位人次数',
dataIndex: 'bdwtkrcs',
key: 'bdwtkrcs',
},
],
},
{
title: '评课人次数',
children: [
{
title: '总人次数',
dataIndex: 'pkrcs',
key: 'pkrcs',
},
{
title: '本单位人次数',
dataIndex: 'bdwpkrcs',
key: 'bdwpkrcs',
},
],
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
];

View File

@ -0,0 +1,167 @@
<template>
<div class="tktjClass">
<!--查询区域-->
<a-form @keyup.enter.native="searchQuery" :model="queryParam" >
<a-row :gutter="24">
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="听课身份" v-model:value="queryParam.tksf" dictCode="kc_tksf"/>
</a-form-item>
</a-col>
<a-col :span="4">
<a-form-item label="">
<JDictSelectTag placeholder="听课人所在单位" v-model:value="queryParam.szdw" :dictCode="`tkrszdw_view,college,college`"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="开课单位" v-model:value="queryParam.kkdw" :dictCode="`kc_kkdw_view,kkdw,kkdw`"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="课程性质" v-model:value="queryParam.kcxz" dictCode="kc_kcxz"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择开始时间'"
v-model:value="queryParam.startTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择结束时间'"
v-model:value="queryParam.endTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="3">
<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-col>
</span>
</a-col>
</a-row>
</a-form>
<!--引用表格-->
<BasicTable @register="registerTable">
</BasicTable>
<!-- 表单区域 -->
</div>
</template>
<script lang="ts" name="kcTingke-kkdw" setup>
import { ref, reactive, onMounted } from 'vue';
import { BasicTable} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './kkdw.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './kkdw.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { dateFormat } from '/@/utils/common/compUtils';
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:true,
useSearchForm: false,
showActionColumn: false,
clickToRowSelect: true,
pagination: {
pageSize: 5
},
beforeFetch: (params) => {
params.column = '',params.order = '';
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "开课单位统计",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
//
onMounted(() => {
const format = 'yyyy-MM-dd';
const startTime = new Date();
startTime.setTime(startTime.getTime()-60000*60*24*7)
queryParam.value.startTime = dateFormat(startTime, format)
queryParam.value.endTime = dateFormat(new Date(), format)
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
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 = '/kcTingke/kcTingke/list',
save='/kcTingke/kcTingke/add',
edit='/kcTingke/kcTingke/edit',
deleteOne = '/kcTingke/kcTingke/delete',
deleteBatch = '/kcTingke/kcTingke/deleteBatch',
importExcel = '/kcTingke/kcTingke/importExcel',
exportXls = '/kcTingke/kcTingke/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,89 @@
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: '$no',
width: '50px',
customRender: (r) => {
return r.index+1;
}
},
{
title: '开课单位',
align: "center",
dataIndex: 'userid'
},
{
title: '开课课堂数',
children: [
{
title: '总数',
dataIndex: 'userid',
key: 'userid',
},
{
title: '本单位数',
dataIndex: 'userid',
key: 'userid',
},
],
},
{
title: '评课课堂数',
children: [
{
title: '总数',
dataIndex: 'userid',
key: 'userid',
},
{
title: '本单位数',
dataIndex: 'userid',
key: 'userid',
},
],
},
{
title: '听课人次数',
children: [
{
title: '总人次数',
dataIndex: 'userid',
key: 'userid',
},
{
title: '本单位人次数',
dataIndex: 'userid',
key: 'userid',
},
],
},
{
title: '评课人次数',
children: [
{
title: '总人次数',
dataIndex: 'userid',
key: 'userid',
},
{
title: '本单位人次数',
dataIndex: 'userid',
key: 'userid',
},
],
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
];

View File

@ -0,0 +1,167 @@
<template>
<div class="tktjClass">
<!--查询区域-->
<a-form @keyup.enter.native="searchQuery" :model="queryParam" >
<a-row :gutter="24">
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="听课身份" v-model:value="queryParam.kcxz" dictCode="is_open"/>
</a-form-item>
</a-col>
<a-col :span="4">
<a-form-item label="">
<JDictSelectTag placeholder="听课人所在单位" v-model:value="queryParam.kcxz" dictCode="is_open"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="开课单位" v-model:value="queryParam.kcxz" dictCode="is_open"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="课程性质" v-model:value="queryParam.kcxz" dictCode="is_open"/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择开始时间'"
v-model:value="queryParam.startTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择结束时间'"
v-model:value="queryParam.endTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="3">
<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-col>
</span>
</a-col>
</a-row>
</a-form>
<!--引用表格-->
<BasicTable @register="registerTable">
</BasicTable>
<!-- 表单区域 -->
</div>
</template>
<script lang="ts" name="kcTingke-kkdw" setup>
import { ref, reactive, onMounted } from 'vue';
import { BasicTable} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './tkmx.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './tkmx.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { dateFormat } from '/@/utils/common/compUtils';
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:true,
useSearchForm: false,
showActionColumn: false,
clickToRowSelect: true,
pagination: {
pageSize: 5
},
beforeFetch: (params) => {
params.column = '',params.order = '';
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "开课单位统计",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
//
onMounted(() => {
const format = 'yyyy-MM-dd';
const startTime = new Date();
startTime.setTime(startTime.getTime()-60000*60*24*7)
queryParam.value.startTime = dateFormat(startTime, format)
queryParam.value.endTime = dateFormat(new Date(), format)
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
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,17 @@
<template>
<div class="tktjClass">
<a-tabs v-model:activeKey="activeKey" type="card">
<a-tab-pane key="1" tab="听课人员统计"><KcTingkeList ref="KcTingkeListModal"></KcTingkeList></a-tab-pane>
<a-tab-pane key="2" tab="开课单位统计"><kkdw ref="kkdwModal"></kkdw></a-tab-pane>
</a-tabs>
</div>
</template>
<script lang="ts" name="kcTingke-tkrytj" setup>
import { ref } from 'vue';
import KcTingkeList from './KcTingkeList.vue'//
import kkdw from './kkdw.vue'//
let activeKey = ref('1');
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,69 @@
<template>
<div class="tktjClass">
<a-row>
<a-col :span="24" style="text-align: center;"><strong style="font-size: 16px;">听课周统计</strong></a-col>
<a-col :span="24">
<a-row>
<a-col :span="6">
<a-form-item label="" style="padding: 10px;">
<JDictSelectTag placeholder="听课身份" v-model:value="queryParam.tksf" dictCode="kc_tksf" @change="loadData" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="" style="padding: 10px;">
<JDictSelectTag placeholder="听课人所在单位" v-model:value="queryParam.szdw" :dictCode="`tkrszdw_view,college,college`" @change="loadData"/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="" style="padding: 10px;">
<JDictSelectTag placeholder="课程性质" v-model:value="queryParam.kcxz" dictCode="kc_kcxz" @change="loadData"/>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :span="24">
<div style="margin-top:0px;z-index: 0;">
<tkfglTjt :chartData="barMultiData" height="300px" type="line"></tkfglTjt>
</div>
</a-col>
</a-row>
</div>
</template>
<script lang="ts" name="kcTingke-tkztj" setup>
import { ref,reactive,onMounted } from 'vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import tkfglTjt from '/@/views/kc/tktj/tkfgl/tkfglTjt.vue';
import { dateFormat } from '/@/utils/common/compUtils';
import { defHttp } from '/@/utils/http/axios';
const barMultiData = reactive<any>([]);
const queryParam = ref<any>({});
const list = (queryParam) => defHttp.get({ url: '/kcTingke/kcTingke/getTkfglList', params:queryParam });
//
onMounted(() => {
const format = 'yyyy-MM-dd';
const startTime = new Date('2023-02-19');
queryParam.value.startTime = dateFormat(startTime, format)
queryParam.value.endTime = dateFormat(new Date(), format)
loadData()
});
function loadData(){
barMultiData.length = 0
list(queryParam.value).then(res=>{
var list = res
for(var i=0;i<list.length;i++){
barMultiData.push({name: list[i].dwjc, value: parseFloat(list[i].ljtkv), type: '累计听课率', seriesType: 'bar'})
barMultiData.push({name: list[i].dwjc, value: parseFloat(list[i].avgtkv), type: '累计全校平均听课率', seriesType: 'line'})
barMultiData.push({name: list[i].dwjc, value: parseFloat(list[i].jrtkv), type: '今日听课率', seriesType: 'line'})
barMultiData.push({name: list[i].dwjc, value: parseFloat(list[i].jravgtkv), type: '今日全校平均听课率', seriesType: 'line'})
}
})
}
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,109 @@
<template>
<div ref="chartRef" :style="{ height, width }"></div>
</template>
<script lang="ts">
import { defineComponent, PropType, ref, Ref, reactive, watchEffect,onMounted } from 'vue';
import { useECharts } from '/@/hooks/web/useECharts';
export default defineComponent({
name: 'lineMulti',
props: {
chartData: {
type: Array,
default: () => [],
required: true,
},
option: {
type: Object,
default: () => ({}),
},
type: {
type: String as PropType<string>,
default: 'bar',
},
width: {
type: String as PropType<string>,
default: '100%',
},
height: {
type: String as PropType<string>,
default: 'calc(100vh - 78px)',
},
},
emits: ['click'],
setup(props, { emit }) {
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions, getInstance } = useECharts(chartRef as Ref<HTMLDivElement>);
const option = reactive({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
label: {
show: true,
backgroundColor: '#333',
},
},
},
legend: {
bottom: 0,
},
grid: {
top: 10,
bottom: 100,
left: 60,
right: 10,
},
xAxis: {
type: 'category',
data: [],
axisLabel:{interval:0,rotate:45}
},
yAxis: {
name:'听课率(%)',
nameLocation : 'middle',
type: 'value',
nameGap: 35
},
series: [],
});
watchEffect(() => {
props.chartData && initCharts();
});
onMounted(() => {
initCharts();
})
function initCharts() {
if (props.option) {
Object.assign(option, props.option);
}
//
let typeArr = Array.from(new Set(props.chartData.map((item) => item.type)));
//
let xAxisData = Array.from(new Set(props.chartData.map((item) => item.name)));
let seriesData = [];
typeArr.forEach((type) => {
let obj = { name: type, type: props.type };
let chartArr = props.chartData.filter((item) => type === item.type);
//data
obj['data'] = chartArr.map((item) => item.value);
obj['type'] = chartArr[0].seriesType;
seriesData.push(obj);
});
option.series = seriesData;
option.xAxis.data = xAxisData;
setOptions(option);
getInstance()?.off('click', onClick);
getInstance()?.on('click', onClick);
}
function onClick(params) {
emit('click', params);
}
return { chartRef,initCharts };
},
});
</script>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/kcTingke/kcTingke/getTkmxlist',
save='/kcTingke/kcTingke/add',
edit='/kcTingke/kcTingke/edit',
deleteOne = '/kcTingke/kcTingke/delete',
deleteBatch = '/kcTingke/kcTingke/deleteBatch',
importExcel = '/kcTingke/kcTingke/importExcel',
exportXls = '/kcTingke/kcTingke/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,79 @@
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: '$no',
width: '50px',
customRender: (r) => {
return r.index+1;
}
},
{
title: '工号',
align: "center",
dataIndex: 'userid'
},
{
title: '姓名',
align: "center",
dataIndex: 'username'
},
{
title: '所在单位',
align: "center",
dataIndex: 'college'
},
{
title: '听课身份',
align: "center",
dataIndex: 'tksf'
},
{
title: '开课单位',
align: "center",
dataIndex: 'kkdw'
},
{
title: '课程名称',
align: "center",
dataIndex: 'kcmc'
},
{
title: '课程性质',
align: "center",
dataIndex: 'kcxz'
},
{
title: '任课教师',
align: "center",
dataIndex: 'skjs'
},
{
title: '周次',
align: "center",
dataIndex: 'zc'
},
{
title: '节次',
align: "center",
dataIndex: 'jc'
},
{
title: '听课时间',
align: "center",
dataIndex: 'tingketime'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
];

View File

@ -0,0 +1,163 @@
<template>
<div class="tktjClass">
<div style="font-size: 22px;font-weight: bold;margin: 20px;">听课明细</div>
<!--查询区域-->
<a-form @keyup.enter.native="searchQuery" :model="queryParam" >
<a-row :gutter="24">
<a-col :span="3">
<a-form-item label="">
<JDictSelectTag placeholder="听课身份" v-model:value="queryParam.tksf" dictCode="kc_tksf"/>
</a-form-item>
</a-col>
<a-col :span="4">
<a-form-item label="">
<JDictSelectTag placeholder="听课人所在单位" v-model:value="queryParam.szdw" :dictCode="`tkrszdw_view,college,college`"/>
</a-form-item>
</a-col>
<a-col :span="4">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择开始时间'"
v-model:value="queryParam.startTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="4">
<a-form-item label="">
<a-date-picker
:showTime="false"
valueFormat="YYYY-MM-DD"
:placeholder="'请选择结束时间'"
v-model:value="queryParam.endTime"
></a-date-picker>
</a-form-item>
</a-col>
<a-col :span="3">
<a-form-item label="">
<a-input placeholder="填写教师名称" v-model:value="queryParam.jsxm" dictCode="is_open"/>
</a-form-item>
</a-col>
<a-col :span="3">
<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-col>
</span>
</a-col>
</a-row>
</a-form>
<!--引用表格-->
<BasicTable @register="registerTable">
</BasicTable>
<!-- 表单区域 -->
</div>
</template>
<script lang="ts" name="kcTingke-kkdw" setup>
import { ref, reactive, onMounted } from 'vue';
import { BasicTable} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './tkmx.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './tkmx.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { dateFormat } from '/@/utils/common/compUtils';
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:true,
useSearchForm: false,
showActionColumn: false,
clickToRowSelect: true,
pagination: {
pageSize: 5
},
beforeFetch: (params) => {
params.column = '',params.order = '';
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "开课单位统计",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
//
onMounted(() => {
const format = 'yyyy-MM-dd';
const startTime = new Date();
startTime.setTime(startTime.getTime()-60000*60*24*7)
queryParam.value.startTime = dateFormat(startTime, format)
queryParam.value.endTime = dateFormat(new Date(), format)
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
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,41 @@
<template>
<div style="max-width: 1430px;">
<a-row>
<a-col :span="16">
<tkztj ref="tkztjModal"></tkztj>
</a-col>
<a-col :span="8">
<zxdt ref="zxdtModal"></zxdt>
</a-col>
<a-col :span="24">
<tkfgl ref="tkfglModal"></tkfgl>
</a-col>
<a-col :span="24">
<tkrytj ref="tkrytjModal"></tkrytj>
</a-col>
<a-col :span="24">
<tkmx ref="tkmxModal"></tkmx>
</a-col>
</a-row>
</div>
</template>
<script lang="ts" name="kcTingke-tktjmain" setup>
import tkztj from './tkztj/tkztj.vue'//
import zxdt from './zxdt/zxdt.vue'//
import tkfgl from './tkfgl/tkfgl.vue'//
import tkrytj from './kcTingke/tkrytj.vue'//
import tkmx from './tkmx/tkmx.vue'//
</script>
<style scoped>
.tktjClass{
background-color: #fff;
margin: 10px;
padding: 10px;
min-height: 420px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<div class="tktjClass">
<a-row>
<a-col :span="24" style="text-align: center;"><strong style="font-size: 16px;">听课周统计</strong></a-col>
<a-col :span="24">
<a-row>
<a-col :span="6">
<a-form-item label="" style="padding: 10px;">
<JDictSelectTag placeholder="听课身份" v-model:value="queryParam.tksf" dictCode="kc_tksf" @change="loadData" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="" style="padding: 10px;">
<JDictSelectTag placeholder="听课人所在单位" v-model:value="queryParam.szdw" :dictCode="`tkrszdw_view,college,college`" @change="loadData"/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="" style="padding: 10px;">
<JDictSelectTag placeholder="课程性质" v-model:value="queryParam.kcxz" dictCode="kc_kcxz" @change="loadData"/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="" style="padding: 10px;">
<JDictSelectTag placeholder="开课单位" v-model:value="queryParam.kkdw" :dictCode="`kc_kkdw_view,kkdw,kkdw`" @change="loadData"/>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :span="24">
<div style="margin-top:0px;z-index: 0;">
<tkztjTjt :chartData="barMultiData" height="300px" type="line"></tkztjTjt>
</div>
</a-col>
</a-row>
</div>
</template>
<script lang="ts" name="kcTingke-tkztj" setup>
import { ref,reactive,onMounted } from 'vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import tkztjTjt from '/@/views/kc/tktj/tkztj/tkztjTjt.vue';
import { dateFormat } from '/@/utils/common/compUtils';
import { defHttp } from '/@/utils/http/axios';
const barMultiData = reactive<any>([]);
const queryParam = ref<any>({});
const list = (queryParam) => defHttp.get({ url: '/kcTingke/kcTingke/getTkztjList', params:queryParam });
//
onMounted(() => {
const format = 'yyyy-MM-dd';
const startTime = new Date();
startTime.setTime(startTime.getTime()-60000*60*24*7)
queryParam.value.startTime = dateFormat(startTime, format)
queryParam.value.endTime = dateFormat(new Date(), format)
loadData()
});
function loadData(){
barMultiData.length = 0
list(queryParam.value).then(res=>{
console.log(`🚀 ~ file: tkztj.vue:59 ~ list ~ res:`, res)
var list = res
for(var i=0;i<list.length;i++){
barMultiData.push({name: list[i].skrq, value: parseInt(list[i].kssl), type: '开课课堂数', seriesType: 'line'})
barMultiData.push({name: list[i].skrq, value: parseInt(list[i].tkkts), type: '听课课堂数', seriesType: 'line'})
barMultiData.push({name: list[i].skrq, value: parseInt(list[i].tkrcs), type: '听课人次', seriesType: 'line'})
}
console.log(`🚀 ~ file: tkztj.vue:67 ~ list ~ barMultiData:`, barMultiData)
})
}
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,105 @@
<template>
<div ref="chartRef" :style="{ height, width }"></div>
</template>
<script lang="ts">
import { defineComponent, PropType, ref, Ref, reactive, watchEffect,onMounted } from 'vue';
import { useECharts } from '/@/hooks/web/useECharts';
export default defineComponent({
name: 'lineMulti',
props: {
chartData: {
type: Array,
default: () => [],
required: true,
},
option: {
type: Object,
default: () => ({}),
},
type: {
type: String as PropType<string>,
default: 'bar',
},
width: {
type: String as PropType<string>,
default: '100%',
},
height: {
type: String as PropType<string>,
default: 'calc(100vh - 78px)',
},
},
emits: ['click'],
setup(props, { emit }) {
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions, getInstance } = useECharts(chartRef as Ref<HTMLDivElement>);
const option = reactive({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
label: {
show: true,
backgroundColor: '#333',
},
},
},
legend: {
bottom: 0,
},
grid: {
top: 10,
bottom: 60,
left: 30,
right: 10,
},
xAxis: {
type: 'category',
data: [],
axisLabel:{interval:0}
},
yAxis: {
type: 'value',
},
series: [],
});
watchEffect(() => {
props.chartData && initCharts();
});
onMounted(() => {
initCharts();
})
function initCharts() {
if (props.option) {
Object.assign(option, props.option);
}
//
let typeArr = Array.from(new Set(props.chartData.map((item) => item.type)));
//
let xAxisData = Array.from(new Set(props.chartData.map((item) => item.name)));
let seriesData = [];
typeArr.forEach((type) => {
let obj = { name: type, type: props.type };
let chartArr = props.chartData.filter((item) => type === item.type);
//data
obj['data'] = chartArr.map((item) => item.value);
seriesData.push(obj);
});
option.series = seriesData;
option.xAxis.data = xAxisData;
setOptions(option);
getInstance()?.off('click', onClick);
getInstance()?.on('click', onClick);
}
function onClick(params) {
emit('click', params);
}
return { chartRef,initCharts };
},
});
</script>

View File

@ -0,0 +1,19 @@
<template>
<div class="tktjClass">
<a-row>
<a-col :span="24"><strong style="font-size: 16px;margin-left: 20px;">最新动态</strong></a-col>
<a-col :span="24"><p style="width:100%;height:1px;margin:0px auto;padding:0px;background-color:#D5D5D5;overflow:hidden;margin-top: 5px;"></p></a-col>
<a-col :span="24" style="text-align: center;"><strong style="font-size: 16px;margin-left: 20px;margin-top: 10px;">暂无数据</strong></a-col>
</a-row>
</div>
</template>
<script lang="ts" name="kcTingke-zxdt" setup>
</script>
<style lang="less" scoped>
</style>