updates
This commit is contained in:
parent
e04fe73c2c
commit
350d3bec2d
16286
pnpm-lock.yaml
16286
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
|
@ -4,6 +4,8 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout';
|
|||
|
||||
export const PAGE_NOT_FOUND_NAME = 'PageNotFound';
|
||||
|
||||
export const PAGE_NOT_FOUND_NAME1 = 'PageNotFound1';
|
||||
|
||||
export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue');
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { AppRouteRecordRaw } from '/@/router/types';
|
||||
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
|
||||
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
|
||||
|
|
@ -15,7 +15,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
|
|||
children: [
|
||||
{
|
||||
path: '/:path(.*)*',
|
||||
name: PAGE_NOT_FOUND_NAME,
|
||||
name: PAGE_NOT_FOUND_NAME1,
|
||||
component: EXCEPTION_COMPONENT,
|
||||
meta: {
|
||||
title: 'ErrorPage',
|
||||
|
|
|
|||
|
|
@ -176,6 +176,17 @@ const page: AppRouteModule = {
|
|||
title: '404',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '404',
|
||||
name: 'PageNotFound1',
|
||||
component: ExceptionPage,
|
||||
props: {
|
||||
status: ExceptionEnum.PAGE_NOT_FOUND,
|
||||
},
|
||||
meta: {
|
||||
title: '404',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '500',
|
||||
name: 'ServiceError',
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ export class VAxios {
|
|||
...config,
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
timeout: 60000,
|
||||
headers: {
|
||||
'Content-type': ContentTypeEnum.FORM_DATA,
|
||||
ignoreCancelToken: true,
|
||||
|
|
|
|||
|
|
@ -50,5 +50,11 @@ export const searchFormSchema: FormSchema[] = [
|
|||
label: '用户账号',
|
||||
component: 'Input',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '用户手机号',
|
||||
component: 'Input',
|
||||
colProps: { span: 6 },
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
|
|
@ -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,
|
||||
},
|
||||
];
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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});
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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.ts迁移并改造为JVxeColumn格式
|
||||
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.saveRow替换成你真实的API地址
|
||||
// 第二种代码中没有提供单行更新的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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -68,6 +68,19 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'validTime',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '有效日期至',
|
||||
component: "DatePicker",
|
||||
field: 'validDate',
|
||||
required: true,
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
placeholder: '请选择有效日期至',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
label: '所属应用',
|
||||
field: 'programType',
|
||||
|
|
|
|||
|
|
@ -211,21 +211,15 @@ function handleSuccess() {
|
|||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
if (!record.userId) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
}
|
||||
]
|
||||
} else {
|
||||
return [
|
||||
{
|
||||
},{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue