修改bug

This commit is contained in:
yangjun 2023-04-02 14:39:54 +08:00
parent 8ff3e20afc
commit de62a631f6
22 changed files with 2336 additions and 9 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 = '/kcTplb/kcTplb/list',
save='/kcTplb/kcTplb/add',
edit='/kcTplb/kcTplb/edit',
deleteOne = '/kcTplb/kcTplb/delete',
deleteBatch = '/kcTplb/kcTplb/deleteBatch',
importExcel = '/kcTplb/kcTplb/importExcel',
exportXls = '/kcTplb/kcTplb/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,57 @@
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: 'title'
},
{
title: '图片地址',
align: "center",
dataIndex: 'picPath',
customRender: render.renderImage,
// slots: { customRender: 'img' },
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'title',
component: 'Input',
dynamicDisabled: true
},
{
label: '图片地址',
field: 'picPath',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '内容',
field: 'content',
component: 'JEditor',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,217 @@
<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-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-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 #img="{ text }">
<j-image-upload v-model:value="text" ></j-image-upload>
</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>
<!-- 表单区域 -->
<KcTplbModal ref="registerModal" @success="handleSuccess"></KcTplbModal>
</div>
</template>
<script lang="ts" name="kcTplb-kcTplb" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction ,TableImg} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './KcTplb.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcTplb.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import KcTplbModal from './components/KcTplbModal.vue'
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
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,
actionColumn: {
width: 120,
fixed: 'right',
},
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 },
});
/**
* 新增事件
*/
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),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
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,141 @@
<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.title">
<a-input v-model:value="formData.title" placeholder="请输入标题" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="图片地址" v-bind="validateInfos.picPath">
<j-image-upload v-model:value="formData.picPath" :disabled="disabled"></j-image-upload>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="内容" v-bind="validateInfos.content">
<j-editor v-model:value="formData.content" :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 JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../KcTplb.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: '',
title: '',
picPath: '',
content: '',
});
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="关闭">
<KcTplbForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcTplbForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import KcTplbForm from './KcTplbForm.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 = '/kcNotice/kcNotice/list',
save='/kcNotice/kcNotice/add',
edit='/kcNotice/kcNotice/edit',
deleteOne = '/kcNotice/kcNotice/delete',
deleteBatch = '/kcNotice/kcNotice/deleteBatch',
importExcel = '/kcNotice/kcNotice/importExcel',
exportXls = '/kcNotice/kcNotice/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,157 @@
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: 'ntitle'
},
{
title: '类型',
align: "center",
dataIndex: 'ntype_dictText'
},
{
title: '状态',
align: "center",
dataIndex: 'nstatus_dictText'
},
{
title: '链接',
align: "center",
dataIndex: 'nlink'
},
{
title: '发布日期',
align: "center",
dataIndex: 'ndate'
},
{
title: '是否置顶',
align: "center",
dataIndex: 'ontop_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "标题",
field: 'ntitle',
component: 'Input',
colProps: {span: 6},
},
{
label: "类型",
field: 'ntype',
component: 'JDictSelectTag',
componentProps:{
dictCode: "ntype"
},
colProps: {span: 6},
},
{
label: "状态",
field: 'nstatus',
component: 'JDictSelectTag',
componentProps:{
dictCode: "nstatus"
},
colProps: {span: 6},
},
{
label: "发布日期",
field: 'ndate',
component: 'DatePicker',
componentProps: {
showTime: true,
},
colProps: {span: 6},
},
{
label: "是否置顶",
field: 'ontop',
component: 'JDictSelectTag',
componentProps:{
dictCode: "ontop"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'ntitle',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入标题!'},
];
},
},
{
label: '类型',
field: 'ntype',
component: 'JDictSelectTag',
componentProps:{
dictCode: "ntype"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入类型'},
];
},
},
{
label: '状态',
field: 'nstatus',
component: 'JDictSelectTag',
componentProps:{
dictCode: "nstatus"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入状态!'},
];
},
},
{
label: '内容',
field: 'ncontentString',
component: 'JEditor',
},
{
label: '链接',
field: 'nlink',
component: 'Input',
},
{
label: '发布日期',
field: 'ndate',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '是否置顶',
field: 'ontop',
component: 'JDictSelectTag',
componentProps:{
dictCode: "ontop"
},
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,248 @@
<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.ntitle"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="类型">
<j-dict-select-tag placeholder="请选择类型" v-model:value="queryParam.ntype" dictCode="ntype"/>
</a-form-item>
</a-col>
<!--<template v-if="toggleSearchStatus">-->
<a-col :lg="8">
<a-form-item label="状态">
<j-dict-select-tag placeholder="请选择状态" v-model:value="queryParam.nstatus" dictCode="nstatus"/>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="是否置顶">
<j-dict-select-tag placeholder="请选择是否置顶" v-model:value="queryParam.ontop" dictCode="ontop"/>
</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-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>
<!-- 表单区域 -->
<KcNoticeModal ref="registerModal" @success="handleSuccess"></KcNoticeModal>
</div>
</template>
<script lang="ts" name="kcNotice-kcNotice" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './KcNotice.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcNotice.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import KcNoticeModal from './components/KcNoticeModal.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: {
title: 'kc_notice',
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_notice",
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),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
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,168 @@
<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.ntitle">
<a-input v-model:value="formData.ntitle" placeholder="请输入标题" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="类型" v-bind="validateInfos.ntype">
<j-dict-select-tag type='radio' v-model:value="formData.ntype" dictCode="ntype" placeholder="请选择类型" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="状态" v-bind="validateInfos.nstatus">
<j-dict-select-tag type='radio' v-model:value="formData.nstatus" dictCode="nstatus" placeholder="请选择状态" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="内容" v-bind="validateInfos.ncontentString">
<j-editor v-model:value="formData.ncontentString" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="链接" v-bind="validateInfos.nlink">
<a-input v-model:value="formData.nlink" placeholder="请输入链接" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="发布日期" v-bind="validateInfos.ndate">
<a-date-picker placeholder="请选择发布日期" v-model:value="formData.ndate" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否置顶" v-bind="validateInfos.ontop">
<j-dict-select-tag type='radio' v-model:value="formData.ontop" dictCode="ontop" 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 JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../KcNotice.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: '',
ntitle: '',
ntype: undefined,
nstatus: undefined,
ncontentString: '',
nlink: '',
ndate: '',
ontop: 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 = {
ntitle: [{ required: true, message: '请输入标题!'},],
ntype: [{ required: true, message: '请输入类型!'},],
nstatus: [{ required: true, message: '请输入状态!'},],
};
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="关闭">
<KcNoticeForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcNoticeForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import KcNoticeForm from './KcNoticeForm.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,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="kcPingke-pkfgl" setup>
import { ref,reactive,onMounted } from 'vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import tkfglTjt from '/@/views/kc/pktj/pkfgl/pkfglTjt.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: '/kcEvaluation/kcEvaluation/getPkfglTjt', 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 = '/kcEvaluation/kcEvaluation/getPkmxbList',
save='/kcEvaluation/kcEvaluation/add',
edit='/kcEvaluation/kcEvaluation/edit',
deleteOne = '/kcEvaluation/kcEvaluation/delete',
deleteBatch = '/kcEvaluation/kcEvaluation/deleteBatch',
importExcel = '/kcEvaluation/kcEvaluation/importExcel',
exportXls = '/kcEvaluation/kcEvaluation/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,70 @@
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: '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,168 @@
<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="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-pkmxb" setup>
import { ref, reactive, onMounted } from 'vue';
import { BasicTable} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './pkmxb.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './pkmxb.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 = '/kcEvaluation/kcEvaluation/getPktjbList',
save='/kcEvaluation/kcEvaluation/add',
edit='/kcEvaluation/kcEvaluation/edit',
deleteOne = '/kcEvaluation/kcEvaluation/delete',
deleteBatch = '/kcEvaluation/kcEvaluation/deleteBatch',
importExcel = '/kcEvaluation/kcEvaluation/importExcel',
exportXls = '/kcEvaluation/kcEvaluation/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: '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,166 @@
<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="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="kcPingke-kcPingke" 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 './pktjb.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './pktjb.api';
import { downloadFile } from '/@/utils/common/renderUtils';
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,41 @@
<template>
<div style="max-width: 1430px;">
<a-row>
<a-col :span="16">
<pkztj ref="pkztjModal"></pkztj>
</a-col>
<a-col :span="8">
<zxdt ref="zxdtModal"></zxdt>
</a-col>
<a-col :span="24">
<pkfgl ref="pkfglModal"></pkfgl>
</a-col>
<a-col :span="24">
<pktjb ref="pktjbModal"></pktjb>
</a-col>
<a-col :span="24">
<pkmxb ref="pkmxbModal"></pkmxb>
</a-col>
</a-row>
</div>
</template>
<script lang="ts" name="kcpingke-pktjmain" setup>
import pkztj from './pkztj/pkztj.vue'//
import zxdt from '/@/views/kc/tktj/zxdt/zxdt.vue'//
import pkfgl from './pkfgl/pkfgl.vue'//
import pktjb from './pktjb/pktjb.vue'//
import pkmxb from './pkmxb/pkmxb.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;">
<pkztjTjt :chartData="barMultiData" height="300px" type="line"></pkztjTjt>
</div>
</a-col>
</a-row>
</div>
</template>
<script lang="ts" name="kcTingke-pkztj" setup>
import { ref,reactive,onMounted } from 'vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import pkztjTjt from '/@/views/kc/pktj/pkztj/pkztjTjt.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: '/kcEvaluation/kcEvaluation/getPkztjTjt', 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

@ -4,15 +4,6 @@ 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",