添加听课要求列表
This commit is contained in:
parent
8536c6e561
commit
06016b4643
|
@ -81,6 +81,7 @@
|
|||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-button type="primary" @click="handleTkyqList" preIcon="ant-design:plus-outlined"> 听课要求列表查询</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
|
@ -102,7 +103,7 @@
|
|||
<!-- 表单区域 -->
|
||||
<KcExportConfigTpkwcqkjzglxModal ref="registerModal" @success="handleSuccess"></KcExportConfigTpkwcqkjzglxModal>
|
||||
<KcTksfrzbModal ref="registerYqModal" @success="handleSuccess"></KcTksfrzbModal>
|
||||
|
||||
<KcTkypListModal ref="registerTkyplistModal"></KcTkypListModal>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
@ -116,6 +117,7 @@
|
|||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import KcExportConfigTpkwcqkjzglxModal from './components/KcExportConfigTpkwcqkjzglxModal.vue'
|
||||
import KcTksfrzbModal from './components/KcTksfrzbModal.vue'
|
||||
import KcTkypListModal from './tkypList/KcTkypListModal.vue'
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
@ -144,6 +146,7 @@
|
|||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const registerYqModal = ref();
|
||||
const registerTkyplistModal = ref();
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
|
||||
|
@ -204,6 +207,11 @@
|
|||
registerYqModal.value.disableSubmit = false;
|
||||
registerYqModal.value.add();
|
||||
}
|
||||
function handleTkyqList() {
|
||||
registerTkyplistModal.value.disableSubmit = false;
|
||||
registerTkyplistModal.value.add();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/config/kcExportConfigTpkwcqkjzglx/queryTkyqPageList',
|
||||
save='/config/kcExportConfigTpkwcqkjzglx/add',
|
||||
edit='/config/kcExportConfigTpkwcqkjzglx/edit',
|
||||
deleteOne = '/config/kcExportConfigTpkwcqkjzglx/delete',
|
||||
deleteBatch = '/config/kcExportConfigTpkwcqkjzglx/deleteBatch',
|
||||
importExcel = '/config/kcExportConfigTpkwcqkjzglx/importExcel',
|
||||
exportXls = '/config/kcExportConfigTpkwcqkjzglx/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
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: 'sf'
|
||||
},
|
||||
{
|
||||
title: '本学期应听课次数',
|
||||
align: "center",
|
||||
dataIndex: 'ytkcs'
|
||||
},
|
||||
];
|
||||
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: "教师",
|
||||
field: 'gh',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "xxhbuser,xm,gh"
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "听课类型",
|
||||
field: 'tklx',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "tpkwcqkjzglx"
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
];
|
||||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '教师',
|
||||
field: 'gh',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "xxhbuser,xm,gh"
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '听课类型',
|
||||
field: 'tklx',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "tpkwcqkjzglx"
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
|
@ -0,0 +1,246 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" >
|
||||
<template #tableTitle>
|
||||
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction />
|
||||
</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>
|
||||
<!-- 表单区域 -->
|
||||
<KcTksfrzbModal ref="registerYqModal" @success="handleSuccess"></KcTksfrzbModal>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="config-KcTkypdata" setup>
|
||||
import { ref, reactive, computed, watch, nextTick,defineExpose } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './KcTkyp.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcTkyp.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import { getSysConfig } from '/@/views/site/utils/index';
|
||||
import { getUserInfo, getUserId } from '/@/views/site/utils/index';
|
||||
|
||||
const roleList = computed(() => getUserInfo()?.roleList??[]);
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
|
||||
const xqDictTag = ref();
|
||||
|
||||
watch(() => xqDictTag.value?.dictOptions,(d) => {
|
||||
if(d){
|
||||
queryParam.value.xqxn = d[0]?.value
|
||||
if(queryParam.value.xqxn){
|
||||
nextTick(() => {
|
||||
reload();
|
||||
})
|
||||
}
|
||||
}
|
||||
},{
|
||||
deep:true,
|
||||
immediate:true,
|
||||
});
|
||||
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'kc_export_config_tpkwcqkjzglx',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
showActionColumn: false,
|
||||
immediate: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
params.findByDwmc = !roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
params.findGh = getUserId()
|
||||
//params.xqxn = getSysConfig().flag1;
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "人员信息",
|
||||
url: getExportUrl,
|
||||
params: () => {
|
||||
let params:any = {};
|
||||
params.findByDwmc = !roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
params.findGh = getUserId()
|
||||
return Object.assign(params,queryParam.value);
|
||||
}
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
queryParam.value = {};
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
function onExport() {
|
||||
// if(!!roleList.value.filter(x => x.roleCode == 'admin' ).length && !queryParam.value.dwmc) {
|
||||
// createMessage.warn('请选择导出的单位');
|
||||
// return ;
|
||||
// }
|
||||
onExportWord();
|
||||
}
|
||||
|
||||
function init(){
|
||||
reload();
|
||||
}
|
||||
|
||||
async function onExportWord(){
|
||||
let dcType = 'pdf';
|
||||
// let dcType = 'doc';
|
||||
|
||||
let fileName = dcType == 'pdf'?'教学听课情况表.pdf':'教学听课情况表.docx';
|
||||
// let fileName = '教学听课情况表.docx';
|
||||
let paramsForm = queryParam.value;
|
||||
|
||||
paramsForm = { ...paramsForm, findByDwmc: !roleList.value.filter(x => x.roleCode == 'admin' ).length, findGh: getUserId() }
|
||||
|
||||
let url = dcType == 'pdf'?'/config/kcExportConfigTpkwcqkjzglx/exportPdf':'/config/kcExportConfigTpkwcqkjzglx/exportWord'
|
||||
|
||||
const data = await defHttp.get({ url, params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
// const data = await defHttp.get({ url: '/config/kcExportConfigTpkwcqkjzglx/exportWord', params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
if (!data) {
|
||||
createMessage.warning('文件下载失败');
|
||||
return;
|
||||
}
|
||||
|
||||
let blobOptions = dcType == 'pdf'?{ type: 'application/pdf' }:{ type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' };
|
||||
// let blobOptions = { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' };
|
||||
|
||||
let navigator:any = window.navigator;
|
||||
let msSaveBlob = navigator.msSaveBlob;
|
||||
|
||||
if (typeof msSaveBlob !== 'undefined') {
|
||||
msSaveBlob(new Blob([data], blobOptions), fileName);
|
||||
} else {
|
||||
let url = window.URL.createObjectURL(new Blob([data], blobOptions));
|
||||
let link = document.createElement('a');
|
||||
link.style.display = 'none';
|
||||
link.href = url;
|
||||
link.setAttribute('download', fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link); //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
width: calc(50% - 15px);
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<KcTkypList ref="registerTkypForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcTkypList>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import KcTkypList from './KcTkypList.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerTkypForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '听课要求列表信息';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerTkypForm.value.init();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerTkypForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerTkypForm.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>
|
|
@ -63,7 +63,7 @@
|
|||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="听课教师身份">
|
||||
<j-dict-select-tag placeholder="请选择听课教师身份" v-model:value="queryParam.col13" dictCode="SYS_DICT_ITEM,ITEM_TEXT,ITEM_TEXT,DICT_ID = '1682386362753224705' "/>
|
||||
<j-dict-select-tag placeholder="请选择听课教师身份" v-model:value="queryParam.col13" dictCode="tkjssfview,tksf,tksf"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--</template>-->
|
||||
|
|
Loading…
Reference in New Issue