This commit is contained in:
zhouwentao 2026-02-08 20:15:31 +08:00
parent e04fe73c2c
commit 350d3bec2d
18 changed files with 11133 additions and 7530 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,8 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout';
export const PAGE_NOT_FOUND_NAME = 'PageNotFound'; export const PAGE_NOT_FOUND_NAME = 'PageNotFound';
export const PAGE_NOT_FOUND_NAME1 = 'PageNotFound1';
export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue'); export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue');
/** /**

View File

@ -1,6 +1,6 @@
import type { AppRouteRecordRaw } from '/@/router/types'; import type { AppRouteRecordRaw } from '/@/router/types';
import { t } from '/@/hooks/web/useI18n'; import { t } from '/@/hooks/web/useI18n';
import { REDIRECT_NAME, LAYOUT, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME } from '/@/router/constant'; import { REDIRECT_NAME, LAYOUT, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME, PAGE_NOT_FOUND_NAME1 } from '/@/router/constant';
// 404 on a page // 404 on a page
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = { export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
@ -15,7 +15,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
children: [ children: [
{ {
path: '/:path(.*)*', path: '/:path(.*)*',
name: PAGE_NOT_FOUND_NAME, name: PAGE_NOT_FOUND_NAME1,
component: EXCEPTION_COMPONENT, component: EXCEPTION_COMPONENT,
meta: { meta: {
title: 'ErrorPage', title: 'ErrorPage',

View File

@ -176,6 +176,17 @@ const page: AppRouteModule = {
title: '404', title: '404',
}, },
}, },
{
path: '404',
name: 'PageNotFound1',
component: ExceptionPage,
props: {
status: ExceptionEnum.PAGE_NOT_FOUND,
},
meta: {
title: '404',
},
},
{ {
path: '500', path: '500',
name: 'ServiceError', name: 'ServiceError',

View File

@ -145,6 +145,7 @@ export class VAxios {
...config, ...config,
method: 'POST', method: 'POST',
data: formData, data: formData,
timeout: 60000,
headers: { headers: {
'Content-type': ContentTypeEnum.FORM_DATA, 'Content-type': ContentTypeEnum.FORM_DATA,
ignoreCancelToken: true, ignoreCancelToken: true,

View File

@ -50,5 +50,11 @@ export const searchFormSchema: FormSchema[] = [
label: '用户账号', label: '用户账号',
component: 'Input', component: 'Input',
colProps: { span: 6 }, colProps: { span: 6 },
},
{
field: 'phone',
label: '用户手机号',
component: 'Input',
colProps: { span: 6 },
} }
]; ];

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/yx/yxSchoolGraduateDegree/list',
save='/yx/yxSchoolGraduateDegree/add',
edit='/yx/yxSchoolGraduateDegree/edit',
deleteOne = '/yx/yxSchoolGraduateDegree/delete',
deleteBatch = '/yx/yxSchoolGraduateDegree/deleteBatch',
importExcel = '/yx/yxSchoolGraduateDegree/importExcel',
exportXls = '/yx/yxSchoolGraduateDegree/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,322 @@
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: 'year'
},
{
title: '门类代码',
align: "center",
dataIndex: 'categoryCode'
},
{
title: '门类名称',
align: "center",
dataIndex: 'categoryName'
},
{
title: '学科代码',
align: "center",
dataIndex: 'subjectCode'
},
{
title: '学科领域',
align: "center",
dataIndex: 'disciplineField'
},
{
title: '学位性质',
align: "center",
dataIndex: 'degreeNature'
},
{
title: '专业代码',
align: "center",
dataIndex: 'majorCode'
},
{
title: '专业名称',
align: "center",
dataIndex: 'majorName'
},
{
title: '研究方向',
align: "center",
dataIndex: 'researchDirection'
},
{
title: '院校编码',
align: "center",
dataIndex: 'schoolMasterCode'
},
{
title: '院校名称',
align: "center",
dataIndex: 'schoolName'
},
{
title: '所在地',
align: "center",
dataIndex: 'location'
},
{
title: '研究生院',
align: "center",
dataIndex: 'graduateSchool'
},
{
title: '自划线',
align: "center",
dataIndex: 'selfMarking'
},
{
title: '校博士点',
align: "center",
dataIndex: 'schoolDoctoralProgram'
},
{
title: '博士专业',
align: "center",
dataIndex: 'doctoralMajor'
},
{
title: '第四轮学科评估',
align: "center",
dataIndex: 'fourthRoundSubjectEvaluation'
},
{
title: '双一流学科',
align: "center",
dataIndex: 'doubleFirstClassDisciplines'
},
{
title: '考试方式',
align: "center",
dataIndex: 'examinationMethods'
},
{
title: '院系所',
align: "center",
dataIndex: 'departmentsAndFaculties'
},
{
title: '学习方式',
align: "center",
dataIndex: 'learningStyle'
},
{
title: '指导教师',
align: "center",
dataIndex: 'teacher'
},
{
title: '拟招生人数',
align: "center",
dataIndex: 'intendedEnrollment'
},
{
title: '接收退役',
align: "center",
dataIndex: 'acceptRetirement'
},
{
title: '详细链接',
align: "center",
dataIndex: 'detailedLink'
},
{
title: '备注',
align: "center",
dataIndex: 'detail'
},
{
title: '政治',
align: "center",
dataIndex: 'politics'
},
{
title: '外语',
align: "center",
dataIndex: 'foreignLanguage'
},
{
title: '业务课一',
align: "center",
dataIndex: 'businessCourse1'
},
{
title: '业务课二',
align: "center",
dataIndex: 'businessCourse2'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '年份',
field: 'year',
component: 'Input',
},
{
label: '门类代码',
field: 'categoryCode',
component: 'Input',
},
{
label: '门类名称',
field: 'categoryName',
component: 'Input',
},
{
label: '学科代码',
field: 'subjectCode',
component: 'Input',
},
{
label: '学科领域',
field: 'disciplineField',
component: 'Input',
},
{
label: '学位性质',
field: 'degreeNature',
component: 'Input',
},
{
label: '专业代码',
field: 'majorCode',
component: 'Input',
},
{
label: '专业名称',
field: 'majorName',
component: 'Input',
},
{
label: '研究方向',
field: 'researchDirection',
component: 'Input',
},
{
label: '院校编码',
field: 'schoolMasterCode',
component: 'Input',
},
{
label: '院校名称',
field: 'schoolName',
component: 'Input',
},
{
label: '所在地',
field: 'location',
component: 'Input',
},
{
label: '研究生院',
field: 'graduateSchool',
component: 'Input',
},
{
label: '自划线',
field: 'selfMarking',
component: 'Input',
},
{
label: '校博士点',
field: 'schoolDoctoralProgram',
component: 'Input',
},
{
label: '博士专业',
field: 'doctoralMajor',
component: 'Input',
},
{
label: '第四轮学科评估',
field: 'fourthRoundSubjectEvaluation',
component: 'Input',
},
{
label: '双一流学科',
field: 'doubleFirstClassDisciplines',
component: 'Input',
},
{
label: '考试方式',
field: 'examinationMethods',
component: 'Input',
},
{
label: '院系所',
field: 'departmentsAndFaculties',
component: 'Input',
},
{
label: '学习方式',
field: 'learningStyle',
component: 'Input',
},
{
label: '指导教师',
field: 'teacher',
component: 'Input',
},
{
label: '拟招生人数',
field: 'intendedEnrollment',
component: 'Input',
},
{
label: '接收退役',
field: 'acceptRetirement',
component: 'Input',
},
{
label: '详细链接',
field: 'detailedLink',
component: 'Input',
},
{
label: '备注',
field: 'detail',
component: 'Input',
},
{
label: '政治',
field: 'politics',
component: 'Input',
},
{
label: '外语',
field: 'foreignLanguage',
component: 'Input',
},
{
label: '业务课一',
field: 'businessCourse1',
component: 'Input',
},
{
label: '业务课二',
field: 'businessCourse2',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,239 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :span="6">
<a-form-item label="院校名称">
<a-input v-model:value="qParam.schoolName" placeholder="请输入院校名称" allowClear/>
</a-form-item>
</a-col>
<a-col :span="5">
<a-form-item label="年份">
<a-input v-model:value="qParam.year" placeholder="请输入年份" allowClear/>
</a-form-item>
</a-col>
<a-col :span="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-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-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-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>
<!-- 表单区域 -->
<YxSchoolGraduateDegreeModal ref="registerModal" @success="handleSuccess"></YxSchoolGraduateDegreeModal>
</div>
</template>
<script lang="ts" name="yx-yxSchoolGraduateDegree" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './YxSchoolGraduateDegree.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './YxSchoolGraduateDegree.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import YxSchoolGraduateDegreeModal from './components/YxSchoolGraduateDegreeModal.vue'
const formRef = ref();
const queryParam = reactive<any>({});
const qParam = reactive<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) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "院校硕士研究生信息",
url: getExportUrl,
params: queryParam,
},
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() {
queryParam.schoolName = qParam && qParam.schoolName ? '*' + qParam.schoolName+ '*' : ''
queryParam.year = qParam && qParam.year ? qParam.year : ''
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
queryParam.schoolName = ''
queryParam.year = ''
qParam.schoolName = ''
qParam.year = ''
//
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,302 @@
<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.year">
<a-input v-model:value="formData.year" placeholder="请输入年份" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="门类代码" v-bind="validateInfos.categoryCode">
<a-input v-model:value="formData.categoryCode" placeholder="请输入门类代码" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="门类名称" v-bind="validateInfos.categoryName">
<a-input v-model:value="formData.categoryName" placeholder="请输入门类名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学科代码" v-bind="validateInfos.subjectCode">
<a-input v-model:value="formData.subjectCode" placeholder="请输入学科代码" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学科领域" v-bind="validateInfos.disciplineField">
<a-input v-model:value="formData.disciplineField" placeholder="请输入学科领域" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学位性质" v-bind="validateInfos.degreeNature">
<a-input v-model:value="formData.degreeNature" placeholder="请输入学位性质" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="专业代码" v-bind="validateInfos.majorCode">
<a-input v-model:value="formData.majorCode" placeholder="请输入专业代码" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="专业名称" v-bind="validateInfos.majorName">
<a-input v-model:value="formData.majorName" placeholder="请输入专业名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="研究方向" v-bind="validateInfos.researchDirection">
<a-input v-model:value="formData.researchDirection" placeholder="请输入研究方向" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="院校编码" v-bind="validateInfos.schoolMasterCode">
<a-input v-model:value="formData.schoolMasterCode" placeholder="请输入院校编码" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="院校名称" v-bind="validateInfos.schoolName">
<a-input v-model:value="formData.schoolName" placeholder="请输入院校名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所在地" v-bind="validateInfos.location">
<a-input v-model:value="formData.location" placeholder="请输入所在地" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="研究生院" v-bind="validateInfos.graduateSchool">
<a-input v-model:value="formData.graduateSchool" placeholder="请输入研究生院" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="自划线" v-bind="validateInfos.selfMarking">
<a-input v-model:value="formData.selfMarking" placeholder="请输入自划线" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="校博士点" v-bind="validateInfos.schoolDoctoralProgram">
<a-input v-model:value="formData.schoolDoctoralProgram" placeholder="请输入校博士点" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="博士专业" v-bind="validateInfos.doctoralMajor">
<a-input v-model:value="formData.doctoralMajor" placeholder="请输入博士专业" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="第四轮学科评估" v-bind="validateInfos.fourthRoundSubjectEvaluation">
<a-input v-model:value="formData.fourthRoundSubjectEvaluation" placeholder="请输入第四轮学科评估" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="双一流学科" v-bind="validateInfos.doubleFirstClassDisciplines">
<a-input v-model:value="formData.doubleFirstClassDisciplines" placeholder="请输入双一流学科" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="考试方式" v-bind="validateInfos.examinationMethods">
<a-input v-model:value="formData.examinationMethods" placeholder="请输入考试方式" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="院系所" v-bind="validateInfos.departmentsAndFaculties">
<a-input v-model:value="formData.departmentsAndFaculties" placeholder="请输入院系所" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学习方式" v-bind="validateInfos.learningStyle">
<a-input v-model:value="formData.learningStyle" placeholder="请输入学习方式" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="指导教师" v-bind="validateInfos.teacher">
<a-input v-model:value="formData.teacher" placeholder="请输入指导教师" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="拟招生人数" v-bind="validateInfos.intendedEnrollment">
<a-input v-model:value="formData.intendedEnrollment" placeholder="请输入拟招生人数" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="接收退役" v-bind="validateInfos.acceptRetirement">
<a-input v-model:value="formData.acceptRetirement" placeholder="请输入接收退役" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="详细链接" v-bind="validateInfos.detailedLink">
<a-input v-model:value="formData.detailedLink" placeholder="请输入详细链接" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.detail">
<a-input v-model:value="formData.detail" placeholder="请输入备注" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="政治" v-bind="validateInfos.politics">
<a-input v-model:value="formData.politics" placeholder="请输入政治" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="外语" v-bind="validateInfos.foreignLanguage">
<a-input v-model:value="formData.foreignLanguage" placeholder="请输入外语" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="业务课一" v-bind="validateInfos.businessCourse1">
<a-input v-model:value="formData.businessCourse1" placeholder="请输入业务课一" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="业务课二" v-bind="validateInfos.businessCourse2">
<a-input v-model:value="formData.businessCourse2" placeholder="请输入业务课二" :disabled="disabled"></a-input>
</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 '../YxSchoolGraduateDegree.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: '',
year: '',
categoryCode: '',
categoryName: '',
subjectCode: '',
disciplineField: '',
degreeNature: '',
majorCode: '',
majorName: '',
researchDirection: '',
schoolMasterCode: '',
schoolId: '',
schoolName: '',
location: '',
graduateSchool: '',
selfMarking: '',
schoolDoctoralProgram: '',
doctoralMajor: '',
fourthRoundSubjectEvaluation: '',
doubleFirstClassDisciplines: '',
examinationMethods: '',
departmentsAndFaculties: '',
learningStyle: '',
teacher: '',
intendedEnrollment: '',
acceptRetirement: '',
detailedLink: '',
detail: '',
politics: '',
foreignLanguage: '',
businessCourse1: '',
businessCourse2: '',
});
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="关闭">
<YxSchoolGraduateDegreeForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></YxSchoolGraduateDegreeForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import YxSchoolGraduateDegreeForm from './YxSchoolGraduateDegreeForm.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,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/yx/yxScore/userScoreList_q23f',
save='/yx/yxUserScore/add',
edit='/yx/yxUserScore/edit',
deleteOne = '/yx/yxUserScore/delete',
deleteBatch = '/yx/yxUserScore/deleteBatch',
importExcel = '/yx/yxUserScore/importExcel',
exportXls = '/yx/yxUserScore/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});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
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
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

View File

@ -0,0 +1,268 @@
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: 'phone'
},
{
title: '用户名',
align:"center",
dataIndex: 'username'
},
{
title: '专业类别',
align:"center",
dataIndex: 'professionalCategory'
},
{
title: '子级专业类别',
align:"center",
dataIndex: 'professionalCategoryChildren'
},
{
title: '文理分班',
align:"center",
dataIndex: 'cognitioPolyclinic'
},
{
title: '统考成绩',
align:"center",
dataIndex: 'professionalScore'
},
{
title: '文化成绩',
align:"center",
dataIndex: 'culturalScore',
},
{
title: '创建时间',
align:"center",
dataIndex: 'createTime'
},
{
title: '高考省份',
align:"center",
dataIndex: 'province'
},
{
title: '语文成绩',
align:"center",
dataIndex: 'chineseScore'
},
{
title: '英语成绩',
align:"center",
dataIndex: 'englishScore'
},
{
title: '音乐表演声乐',
align:"center",
dataIndex: 'yybysy'
},
{
title: '音乐表演器乐',
align:"center",
dataIndex: 'yybyqy'
},
{
title: '音乐教育',
align:"center",
dataIndex: 'yyjy'
},
{
title: '服装表演',
align:"center",
dataIndex: 'fzby'
},
{
title: '戏剧影视导演',
align:"center",
dataIndex: 'xjysdy'
},
{
title: '戏剧影视表演',
align:"center",
dataIndex: 'xjysby'
},
{
title: '可冲击专业数量',
align:"center",
dataIndex: 'kcjNum'
},
{
title: '较稳妥专业数量',
align:"center",
dataIndex: 'jwtNum'
},
{
title: '可保底专业数量',
align:"center",
dataIndex: 'kbdNum'
},
{
title: '难录取专业数量',
align:"center",
dataIndex: 'nlqNum'
},
{
title: '记录结果表名',
align:"center",
dataIndex: 'calculationTableName'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '主键',
field: 'id',
component: 'Input',
},
{
label: '专业类别(美术类/...)',
field: 'professionalCategory',
component: 'Input',
},
{
label: '子级专业类别',
field: 'professionalCategoryChildren',
component: 'Input',
},
{
label: '文理分班(文科/理科)',
field: 'cognitioPolyclinic',
component: 'Input',
},
{
label: '专业成绩分(语文,数学,英语...)',
field: 'professionalScore',
component: 'InputNumber',
},
{
label: '创建人',
field: 'createBy',
component: 'Input',
},
{
label: '创建时间',
field: 'createTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '修改人',
field: 'updateBy',
component: 'Input',
},
{
label: '修改时间',
field: 'updateTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '状态(0-未使用,1-使用中)',
field: 'state',
component: 'Input',
},
{
label: '高考省份',
field: 'province',
component: 'Input',
},
{
label: '录取批次',
field: 'batch',
component: 'Input',
},
{
label: '语文成绩',
field: 'chineseScore',
component: 'InputNumber',
},
{
label: '英语成绩',
field: 'englishScore',
component: 'InputNumber',
},
{
label: '音乐表演声乐',
field: 'yybysy',
component: 'InputNumber',
},
{
label: '音乐表演器乐',
field: 'yybyqy',
component: 'InputNumber',
},
{
label: '音乐教育',
field: 'yyjy',
component: 'InputNumber',
},
{
label: '服装表演',
field: 'fzby',
component: 'InputNumber',
},
{
label: '戏剧影视导演',
field: 'xjysdy',
component: 'InputNumber',
},
{
label: '戏剧影视表演',
field: 'xjysby',
component: 'InputNumber',
},
{
label: '可冲击专业数量',
field: 'kcjNum',
component: 'InputNumber',
},
{
label: '较稳妥专业数量',
field: 'jwtNum',
component: 'InputNumber',
},
{
label: '可保底专业数量',
field: 'kbdNum',
component: 'InputNumber',
},
{
label: '难录取专业数量',
field: 'nlqNum',
component: 'InputNumber',
},
{
label: '记录结果表名',
field: 'calculationTableName',
component: 'Input',
},
];
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}

View File

@ -0,0 +1,230 @@
<template>
<a-card title="" :bordered="false">
<!-- 查询区域 -->
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam"
:label-col="labelCol" :wrapper-col="wrapperCol">
<a-row>
<a-col :span="6">
<a-form-item label="手机号">
<a-input v-model:value="queryParam.phone" placeholder="请输入手机号" allowClear/>
</a-form-item>
</a-col>
<a-col :span="12">
<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-col>
</a-row>
</a-form>
<!-- JVxeTable 表格区域 -->
<JVxeTable
toolbar
:toolbarConfig="toolbarConfig"
rowNumber
rowSelection
keepSource
asyncRemove
:height="600"
:loading="loading"
:columns="columns"
:dataSource="dataSource"
:pagination="pagination"
@removed="handleTableRemove"
@edit-closed="handleEditClosed"
@pageChange="handlePageChange"
@selectRowChange="handleSelectRowChange"
/>
</a-card>
</template>
<script lang="ts" setup>
import {reactive, ref} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import {JVxeColumn, JVxeTypes} from '/@/components/jeecg/JVxeTable/types';
import {useMessage} from '/@/hooks/web/useMessage';
// API
import {list, deleteOne, batchDelete} from './YxUserScore.api';
const { createMessage } = useMessage();
// API Endpoints
enum Api {
getData = '/yx/yxUserScore/userScoreList_q23f', // 使list
saveRow = '/yx/yxUserScore/userScoreSave_5rew', //
deleteBatch = '/yx/yxUserScore/deleteBatch', // 使batchDelete
}
// antd
const labelCol = reactive({ xs: {span: 24}, sm: {span: 7} });
const wrapperCol = reactive({ xs: {span: 24}, sm: {span: 16} });
// JVxeTable,
const toolbarConfig = reactive({
btn: [],
});
//
const loading = ref(false);
//
const queryParam = reactive({ phone: '' });
//
const pagination = reactive({
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '50', '100'],
total: 0,
});
//
const dataSource = ref<Recordable[]>([]);
//
const selectedRows = ref<Recordable[]>([]);
// YxUserScore.data.tsJVxeColumn
const columns = ref<JVxeColumn[]>([
{ title: '手机号', key: 'phone', width: 120, type: JVxeTypes.input },
{ title: '用户名', key: 'username', width: 120, type: JVxeTypes.input },
{ title: '专业类别', key: 'professionalCategory', width: 120, type: JVxeTypes.input },
{ title: '子级专业类别', key: 'professionalCategoryChildren', width: 150, type: JVxeTypes.input },
{ title: '文理分班', key: 'cognitioPolyclinic', width: 100, type: JVxeTypes.input },
{ title: '统考成绩', key: 'professionalScore', width: 100, type: JVxeTypes.inputNumber },
{ title: '文化成绩', key: 'culturalScore', width: 100, type: JVxeTypes.inputNumber },
{ title: '创建时间', key: 'createTime', width: 180, type: JVxeTypes.normal }, //
{ title: '高考省份', key: 'province', width: 100, type: JVxeTypes.input },
{ title: '语文成绩', key: 'chineseScore', width: 100, type: JVxeTypes.inputNumber },
{ title: '英语成绩', key: 'englishScore', width: 100, type: JVxeTypes.inputNumber },
{ title: '音乐表演声乐', key: 'yybysy', width: 120, type: JVxeTypes.inputNumber },
{ title: '音乐表演器乐', key: 'yybyqy', width: 120, type: JVxeTypes.inputNumber },
{ title: '音乐教育', key: 'yyjy', width: 100, type: JVxeTypes.inputNumber },
{ title: '服装表演', key: 'fzby', width: 100, type: JVxeTypes.inputNumber },
{ title: '戏剧影视导演', key: 'xjysdy', width: 130, type: JVxeTypes.inputNumber },
{ title: '戏剧影视表演', key: 'xjysby', width: 130, type: JVxeTypes.inputNumber },
{ title: '可冲击专业数量', key: 'kcjNum', width: 130, type: JVxeTypes.inputNumber },
{ title: '较稳妥专业数量', key: 'jwtNum', width: 130, type: JVxeTypes.inputNumber },
{ title: '可保底专业数量', key: 'kbdNum', width: 130, type: JVxeTypes.inputNumber },
{ title: '难录取专业数量', key: 'nlqNum', width: 130, type: JVxeTypes.inputNumber },
{ title: '记录结果表名', key: 'calculationTableName', width: 150, type: JVxeTypes.input },
]);
//
loadData();
/**
* 加载数据
*/
async function loadData() {
loading.value = true;
const params = {
...queryParam,
pageNo: pagination.current,
pageSize: pagination.pageSize,
};
try {
const result = await list(params); // 使list API
pagination.total = result.total;
dataSource.value = result.records;
selectedRows.value = []; //
} catch (error) {
console.error("数据加载失败", error);
createMessage.error("数据加载失败");
} finally {
loading.value = false;
}
}
/**
* 查询按钮点击事件
*/
function searchQuery() {
pagination.current = 1;
loadData();
}
/**
* 重置按钮点击事件
*/
function searchReset() {
queryParam.phone = '';
pagination.current = 1;
loadData();
}
/**
* 分页变化事件
*/
function handlePageChange(event) {
pagination.current = event.current;
pagination.pageSize = event.pageSize;
loadData();
}
/**
* 行选择变化事件
*/
function handleSelectRowChange(event) {
selectedRows.value = event.selectedRows;
}
/**
* 单元格编辑完成事件 (即时保存)
*/
function handleEditClosed(event) {
const {$table, row, column} = event;
const field = column.property;
//
if ($table.isUpdateByRow(row, field)) {
//
$table.validate(row).then(async (errMap) => {
//
if (!errMap) {
const hideLoading = createMessage.loading(`正在保存...`, 0);
try {
// ****: API
// Api.saveRowAPI
// API'put'Api.saveRow
await defHttp.put({ url: Api.saveRow, params: row });
createMessage.success(`保存成功!`);
//
$table.reloadRow(row, null, field);
} catch (e) {
console.error(e);
createMessage.error(`保存失败!`);
} finally {
hideLoading();
}
}
});
}
}
/**
* 删除事件
*/
function handleTableRemove(event) {
const {deleteRows} = event;
// ID
const ids = deleteRows.map(row => row.id).join(',');
if (!ids) {
createMessage.warning('请选择要删除的数据');
return;
}
// API
loading.value = true;
batchDelete({ids: ids}, () => {
createMessage.success('删除成功');
// `confirmRemove`
event.confirmRemove();
//
if (dataSource.value.length === deleteRows.length && pagination.current > 1) {
pagination.current--;
}
loadData(); //
}).finally(() => {
loading.value = false;
});
}
</script>
<style scoped>
/* 可以添加自定义样式 */
</style>

View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../YxUserScore.data';
import {saveOrUpdate} from '../YxUserScore.api';
export default defineComponent({
name: "YxUserScoreForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/yx/yxUserScore/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

View File

@ -0,0 +1,66 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../YxUserScore.data';
import {saveOrUpdate} from '../YxUserScore.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
}
:deep(.ant-calendar-picker){
width: 100%
}
</style>

View File

@ -68,6 +68,19 @@ export const formSchema: FormSchema[] = [
field: 'validTime', field: 'validTime',
component: 'InputNumber', component: 'InputNumber',
}, },
{
label: '有效日期至',
component: "DatePicker",
field: 'validDate',
required: true,
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss',
placeholder: '请选择有效日期至',
getPopupContainer: () => document.body,
},
},
{ {
label: '所属应用', label: '所属应用',
field: 'programType', field: 'programType',

View File

@ -211,21 +211,15 @@ function handleSuccess() {
* 操作栏 * 操作栏
*/ */
function getTableAction(record) { function getTableAction(record) {
if (!record.userId) {
return [ return [
{ {
label: '编辑', label: '编辑',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record),
} },{
]
} else {
return [
{
label: '详情', label: '详情',
onClick: handleDetail.bind(null, record), onClick: handleDetail.bind(null, record),
} }
] ]
}
} }
/** /**