parent
6740903020
commit
6a5daf237b
15 changed files with 2831 additions and 881 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,53 @@ |
||||
package org.jeecg.modules.demo.annualcompetitionprojectregistration.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: TODO |
||||
* @Author: Z.H.C |
||||
* @CreateTime: 2023-12-13 11:22 |
||||
* @Version: 1.0 |
||||
*/ |
||||
@Data |
||||
public class StudentSignUpVo implements Serializable { |
||||
|
||||
@ApiModelProperty(value = "年度比赛项目id") |
||||
private String id; |
||||
|
||||
@ApiModelProperty(value = "参赛人姓名") |
||||
private String signUpName; |
||||
|
||||
/** |
||||
* 老师类型 1:指导老师,2:领队老师 |
||||
*/ |
||||
|
||||
/** |
||||
* 指导老师 |
||||
*/ |
||||
@ApiModelProperty(value = "指导老师") |
||||
private String advisorTeacherInstructorSheet; |
||||
|
||||
/** |
||||
* 领队老师名称 |
||||
*/ |
||||
@ApiModelProperty(value = "领队老师") |
||||
private String leaderTeacherInstructorSheet; |
||||
|
||||
|
||||
/** |
||||
* 1:是,0:否 |
||||
* 个人赛,自己是队长,团队赛,报名人是队长 |
||||
*/ |
||||
// @ApiModelProperty(value = "是否队长")
|
||||
// private String captain;
|
||||
|
||||
@ApiModelProperty(value = "团队赛成员名称") |
||||
private String teamManagementList; |
||||
|
||||
@ApiModelProperty(value = "队伍名称") |
||||
private String teamName; |
||||
} |
After Width: | Height: | Size: 812 KiB |
@ -0,0 +1,101 @@ |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import { useMessage } from "/@/hooks/web/useMessage"; |
||||
|
||||
const { createConfirm } = useMessage(); |
||||
|
||||
enum Api { |
||||
list = '/AnnualCompPoint/annualCompPoint/listStudent', |
||||
save='/AnnualCompPoint/annualCompPoint/add', |
||||
edit='/AnnualCompPoint/annualCompPoint/edit', |
||||
deleteOne = '/AnnualCompPoint/annualCompPoint/delete', |
||||
deleteBatch = '/AnnualCompPoint/annualCompPoint/deleteBatch', |
||||
importExcel = '/AnnualCompPoint/annualCompPoint/importExcel', |
||||
exportXls = '/AnnualCompPoint/annualCompPoint/exportXls', |
||||
updateApply = '/AnnualCompPoint/annualCompPoint/updateApply', |
||||
studentSignUp = '/annualcompetitionprojectregistration/annualCompetitionProjectRegistration/studentSignUp', |
||||
} |
||||
|
||||
/** |
||||
* 导出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 }); |
||||
} |
||||
|
||||
/** |
||||
* 提交或申请修改 |
||||
* @param params |
||||
* @param handleSuccess |
||||
*/ |
||||
export const updateApply = (params,handleSuccess) => { |
||||
createConfirm({ |
||||
iconType: 'warning', |
||||
title: '确认操作', |
||||
content: '确认发送请求吗', |
||||
okText: '确认', |
||||
cancelText: '取消', |
||||
onOk: () => { |
||||
return defHttp.post({url: Api.updateApply,params}, {joinParamsToUrl: true}).then(() => { |
||||
handleSuccess(); |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 学生端-学生报名接口 |
||||
*/ |
||||
export const studentSignUp = (params) => { |
||||
return defHttp.post({ url: Api.studentSignUp, params }); |
||||
}; |
@ -0,0 +1,444 @@ |
||||
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: 'annualCompId_dictText' |
||||
}, |
||||
{ |
||||
title: '项目名称', |
||||
align: "center", |
||||
dataIndex: 'objName' |
||||
}, |
||||
{ |
||||
title: '项目层次', |
||||
align: "center", |
||||
dataIndex: 'objLevel_dictText', |
||||
}, |
||||
{ |
||||
title: '参与形式', |
||||
align: "center", |
||||
dataIndex: 'entryForm', |
||||
customRender: ({text}) => { |
||||
return render.renderSwitch(text, [{text: '团队赛', value: 'Y'}, {text: '个人赛', value: 'N'}]); |
||||
}, |
||||
}, |
||||
{ |
||||
title: '是否报名', |
||||
align: "center", |
||||
dataIndex: 'requireApply', |
||||
customRender: ({text}) => { |
||||
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); |
||||
}, |
||||
}, |
||||
{ |
||||
title: '是否选题', |
||||
align: "center", |
||||
dataIndex: 'requireTopic', |
||||
customRender: ({text}) => { |
||||
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); |
||||
}, |
||||
}, |
||||
{ |
||||
title: '是否上传作品', |
||||
align: "center", |
||||
dataIndex: 'requireUploadWorks', |
||||
customRender: ({text}) => { |
||||
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); |
||||
}, |
||||
}, |
||||
{ |
||||
title: '是否评分', |
||||
align: "center", |
||||
dataIndex: 'requireScore', |
||||
customRender: ({text}) => { |
||||
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); |
||||
}, |
||||
}, |
||||
{ |
||||
title: '开始时间', |
||||
align: "center", |
||||
dataIndex: 'starttime' |
||||
}, |
||||
{ |
||||
title: '结束时间', |
||||
align: "center", |
||||
dataIndex: 'endtime' |
||||
}, |
||||
]; |
||||
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = []; |
||||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [ |
||||
{ |
||||
label: '年度比赛', |
||||
field: 'annualCompId', |
||||
component: 'JPopup', |
||||
componentProps: ({formActionType}) => { |
||||
const {setFieldsValue} = formActionType; |
||||
return { |
||||
setFieldsValue: setFieldsValue, |
||||
code: "ndbs", |
||||
fieldConfig: [ |
||||
{source: 'name', target: 'annualCompId'}, |
||||
], |
||||
multi: true |
||||
} |
||||
}, |
||||
|
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入年度比赛id!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '项目名称', |
||||
field: 'objName', |
||||
component: 'Input', |
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入项目名称!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '简介', |
||||
field: 'introduce', |
||||
component: 'InputTextArea', |
||||
}, |
||||
{ |
||||
label: '项目层次', |
||||
field: 'objLevel', |
||||
component: 'JPopup', |
||||
componentProps: ({formActionType}) => { |
||||
const {setFieldsValue} = formActionType; |
||||
return { |
||||
setFieldsValue: setFieldsValue, |
||||
code: "xmcc", |
||||
fieldConfig: [ |
||||
{source: 'level_name', target: 'objLevel'}, |
||||
], |
||||
multi: false |
||||
} |
||||
}, |
||||
}, |
||||
{ |
||||
label: '参与形式', |
||||
field: 'entryForm', |
||||
component: 'JSwitch', |
||||
componentProps: {}, |
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入参与形式!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '队伍人数', |
||||
field: 'teamNumber', |
||||
component: 'InputNumber', |
||||
}, |
||||
{ |
||||
label: '指导老师人数', |
||||
field: 'teacherNumber', |
||||
component: 'InputNumber', |
||||
}, |
||||
{ |
||||
label: '是否需要领队', |
||||
field: 'requireLeader', |
||||
component: 'JSwitch', |
||||
componentProps: {}, |
||||
}, |
||||
{ |
||||
label: '是否需要队伍名称', |
||||
field: 'requireTeamName', |
||||
component: 'JDictSelectTag', |
||||
componentProps: { |
||||
dictCode: "" |
||||
}, |
||||
}, |
||||
{ |
||||
label: '是否报名', |
||||
field: 'requireApply', |
||||
component: 'JSwitch', |
||||
componentProps: {}, |
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入是否报名!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '是否选题', |
||||
field: 'requireTopic', |
||||
component: 'JSwitch', |
||||
componentProps: {}, |
||||
|
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入是否选题!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '是否上传作品', |
||||
field: 'requireUploadWorks', |
||||
component: 'JSwitch', |
||||
componentProps: {}, |
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入是否上传作品!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '上传作品类型', |
||||
field: 'uploadWorksType', |
||||
component: 'JSelectMultiple', |
||||
componentProps: { |
||||
dictCode: "" |
||||
}, |
||||
}, |
||||
{ |
||||
label: '是否评分', |
||||
field: 'requireScore', |
||||
component: 'JSwitch', |
||||
componentProps: {}, |
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入是否评分!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '开始时间', |
||||
field: 'starttime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入开始时间!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '结束时间', |
||||
field: 'endtime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
dynamicRules: ({model, schema}) => { |
||||
return [ |
||||
{required: true, message: '请输入结束时间!'}, |
||||
]; |
||||
}, |
||||
}, |
||||
{ |
||||
label: '开关', |
||||
field: 'annualCompSwitch', |
||||
component: 'JSwitch', |
||||
componentProps: {}, |
||||
}, |
||||
{ |
||||
label: '驳回信息', |
||||
field: 'message', |
||||
component: 'InputTextArea', |
||||
}, |
||||
{ |
||||
label: '报名开始时间', |
||||
field: 'applyStartTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
{ |
||||
label: '报名结束时间', |
||||
field: 'applyEndTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
{ |
||||
label: '选题开始时间', |
||||
field: 'topicStartTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
{ |
||||
label: '选题结束时间', |
||||
field: 'topicEndTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
{ |
||||
label: '上传作品开始时间', |
||||
field: 'uploadStartTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
{ |
||||
label: '上传作品结束时间', |
||||
field: 'uploadEndTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
{ |
||||
label: '评分开始时间', |
||||
field: 'scoreStartTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
{ |
||||
label: '评分结束时间', |
||||
field: 'scoreEndTime', |
||||
component: 'DatePicker', |
||||
componentProps: { |
||||
showTime: true, |
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
}, |
||||
}, |
||||
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{ |
||||
label: '', |
||||
field: 'id', |
||||
component: 'Input', |
||||
show: false, |
||||
}, |
||||
]; |
||||
|
||||
export const formStudentSignUp4PersonSchema: FormSchema[] = [ |
||||
{ |
||||
label: '', |
||||
field: 'id', |
||||
component: 'Input', |
||||
show: false, |
||||
}, |
||||
{ |
||||
field: 'signUpName', |
||||
label: '参赛人', |
||||
component: 'Input', |
||||
componentProps: { |
||||
readOnly: true, |
||||
allowClear: false, |
||||
}, |
||||
}, |
||||
{ |
||||
field: 'advisorTeacherInstructorSheet', |
||||
label: '指导老师', |
||||
required: false, |
||||
component: 'Input', |
||||
// componentProps: {
|
||||
// rowKey: 'username',
|
||||
// labelKey: 'realname',
|
||||
// maxSelectCount: 5,
|
||||
// },
|
||||
}, |
||||
{ |
||||
field: 'leaderTeacherInstructorSheet', |
||||
label: '领队老师', |
||||
required: false, |
||||
component: 'Input', |
||||
// componentProps: {
|
||||
// rowKey: 'username',
|
||||
// labelKey: 'realname',
|
||||
// maxSelectCount: 5,
|
||||
// },
|
||||
}, |
||||
]; |
||||
|
||||
export const formStudentSignUp4TeamSchema: FormSchema[] = [ |
||||
{ |
||||
label: '', |
||||
field: 'id', |
||||
component: 'Input', |
||||
show: false, |
||||
}, |
||||
{ |
||||
field: 'signUpName', |
||||
label: '参赛人(队长)', |
||||
component: 'Input', |
||||
componentProps: { |
||||
readOnly: true, |
||||
allowClear: false, |
||||
}, |
||||
}, |
||||
{ |
||||
field: 'teamName', |
||||
label: '队伍名称', |
||||
required: true, |
||||
component: 'Input', |
||||
// componentProps: {
|
||||
// rowKey: 'username',
|
||||
// labelKey: 'realname',
|
||||
// maxSelectCount: 5,
|
||||
// },
|
||||
}, |
||||
{ |
||||
field: 'teamManagementList', |
||||
label: '团队成员', |
||||
required: true, |
||||
component: 'JSelectUser', |
||||
componentProps: { |
||||
rowKey: 'username', |
||||
labelKey: 'realname', |
||||
maxSelectCount: 8, |
||||
}, |
||||
}, |
||||
{ |
||||
field: 'advisorTeacherInstructorSheet', |
||||
label: '指导老师', |
||||
required: false, |
||||
component: 'Input', |
||||
// componentProps: {
|
||||
// rowKey: 'username',
|
||||
// labelKey: 'realname',
|
||||
// maxSelectCount: 5,
|
||||
// },
|
||||
}, |
||||
{ |
||||
field: 'leaderTeacherInstructorSheet', |
||||
label: '领队老师', |
||||
required: false, |
||||
component: 'Input', |
||||
// componentProps: {
|
||||
// rowKey: 'username',
|
||||
// labelKey: 'realname',
|
||||
// maxSelectCount: 5,
|
||||
// },
|
||||
}, |
||||
]; |
||||
|
||||
|
@ -0,0 +1,293 @@ |
||||
<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-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" /> |
||||
删除 |
||||
</a-menu-item> |
||||
</a-menu> |
||||
</template> |
||||
<a-button |
||||
>批量操作 |
||||
<Icon icon="mdi:chevron-down" /> |
||||
</a-button> |
||||
</a-dropdown> |
||||
</template> |
||||
<!--操作栏--> |
||||
<template #action="{ record }"> |
||||
<TableAction :actions="getTableAction(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> |
||||
<!-- 表单区域 --> |
||||
<AnnualCompPointModal ref="registerModal" @success="handleSuccess" /> |
||||
</div> |
||||
<WorkUpload ref="workUploadRef"/> |
||||
</template> |
||||
|
||||
|
||||
<script lang="ts" name="AnnualCompPoint-annualCompPoint" setup> |
||||
import { ref, reactive } from 'vue'; |
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||
import { useListPage } from '/@/hooks/system/useListPage'; |
||||
import { columns } from './AnnualCompPoint.data'; |
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, updateApply } from './AnnualCompPoint.api.ts'; |
||||
import { downloadFile } from '/@/utils/common/renderUtils'; |
||||
import AnnualCompPointModal from './components/AnnualCompPointModal.vue'; |
||||
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue'; |
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue'; |
||||
import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue'; |
||||
import {canUpload} from "/@/views/UpfilePersion/UpfilePersion.api.ts"; |
||||
import { useModal } from '/@/components/Modal'; |
||||
|
||||
const [registerModal1, { openModal }] = useModal(); |
||||
import AnnualCompetitionProjectRegistrationModal from '/@/views/annualcompetitionprojectregistration/student/components/AnnualCompetitionProjectRegistrationModal.vue'; |
||||
import {useRouter} from "vue-router"; |
||||
import {award} from "/@/views/award/AwardManagement.api.ts"; |
||||
|
||||
const formRef = ref(); |
||||
const queryParam = reactive<any>({}); |
||||
const toggleSearchStatus = ref<boolean>(false); |
||||
const registerModal = ref(); |
||||
const workUploadRef = ref() |
||||
//注册table数据 |
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ |
||||
tableProps: { |
||||
title: '年度比赛项目管理', |
||||
api: list, |
||||
columns, |
||||
canResize: false, |
||||
useSearchForm: false, |
||||
actionColumn: { |
||||
width: 200, |
||||
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(); |
||||
} |
||||
const isCanUpload = ref(false) |
||||
// 上传作品 |
||||
async function handleWorkSubmit(record) { |
||||
isCanUpload.value = false |
||||
await canUpload({...record}) |
||||
isCanUpload.value = true |
||||
if (isCanUpload.value) { |
||||
workUploadRef.value.modalShow(true, record.id) |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 评奖 |
||||
*/ |
||||
const router = useRouter() |
||||
function pingjiang(record: Recordable) { |
||||
router.push({ |
||||
path: '/award/AwardManagementList', |
||||
query: {id: record.id} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 作品管理 |
||||
*/ |
||||
function workManage(record: Recordable) { |
||||
router.push({ |
||||
path: '/workManage/works', |
||||
query: {annualCompPointId: record.id} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 报名 |
||||
*/ |
||||
function application(record: Recordable) { |
||||
router.push({ |
||||
path: '/annualcompetitionprojectregistration/student/AnnualCompetitionProjectRegistrationList', |
||||
query: {annualCompid: record.objName ,entryFormat: record.entryForm === 'N' ? '个人':'团队', id: record.id} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 报名事件 |
||||
*/ |
||||
function handleEdit(record: Recordable) { |
||||
openModal(true, { |
||||
isUpdate: false, |
||||
showFooter: true, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
function handleDetail(record: Recordable) { |
||||
registerModal.value.disableSubmit = true; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 提交审核按钮 |
||||
*/ |
||||
function handleSubmitandApply(record: Recordable) { |
||||
updateApply({ id: record.id, annualCompState: record.annualCompState }, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 删除事件 |
||||
*/ |
||||
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) { |
||||
const actions = [ |
||||
{ |
||||
label: '报名7', |
||||
onClick: application.bind(null, record), |
||||
}, |
||||
{ |
||||
label: '详情', |
||||
onClick: handleDetail.bind(null, record), |
||||
}, |
||||
]; |
||||
// if (record.annualCompState === '2') { |
||||
// actions.unshift({ |
||||
// label: '评奖', |
||||
// onClick: handleSubmitandApply.bind(null, record), |
||||
// }); |
||||
// } |
||||
if (record.requireUploadWorks === 'Y') { |
||||
actions.unshift({ |
||||
label: '作品管理', |
||||
onClick: workManage.bind(null, record), |
||||
}); |
||||
} |
||||
/*if (record.requireTopic === 'Y' && record.annualCompState === '2') { |
||||
actions.unshift({ |
||||
label: '选题', |
||||
onClick: handleSubmitandApply.bind(null, record), |
||||
}); |
||||
}*/ |
||||
|
||||
return actions; |
||||
} |
||||
|
||||
/** |
||||
* 查询 |
||||
*/ |
||||
function searchQuery() { |
||||
reload(); |
||||
} |
||||
|
||||
/** |
||||
* 重置 |
||||
*/ |
||||
function searchReset() { |
||||
formRef.value.resetFields(); |
||||
selectedRowKeys.value = []; |
||||
//刷新数据 |
||||
reload(); |
||||
} |
||||
|
||||
/** |
||||
* popup组件值改变事件 |
||||
*/ |
||||
function setFieldsValue(map) { |
||||
Object.keys(map).map((key) => { |
||||
queryParam[key] = map[key]; |
||||
}); |
||||
} |
||||
</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,336 @@ |
||||
<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-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"/> |
||||
删除 |
||||
</a-menu-item> |
||||
</a-menu> |
||||
</template> |
||||
<a-button |
||||
>批量操作 |
||||
<Icon icon="mdi:chevron-down"/> |
||||
</a-button> |
||||
</a-dropdown> |
||||
</template> |
||||
<!--操作栏--> |
||||
<template #action="{ record }"> |
||||
<TableAction :actions="getTableAction(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> |
||||
<!--学生报名--> |
||||
<StudentSignUp4PersonModal @register="signUp4PersonModal" @success="reload"/> |
||||
<StudentSignUp4TeamModal @register="signUp4TeamModal" @success="reload"/> |
||||
<!-- 表单区域 --> |
||||
<AnnualCompPointModal ref="registerModal" @success="handleSuccess"/> |
||||
</div> |
||||
<WorkUpload ref="workUploadRef"/> |
||||
</template> |
||||
|
||||
|
||||
<script lang="ts" name="AnnualCompPoint-annualCompPoint" setup> |
||||
import {reactive, ref} from 'vue'; |
||||
import {BasicTable, TableAction} from '/@/components/Table'; |
||||
import StudentSignUp4PersonModal from './components/StudentSignUp4PersonModal.vue'; |
||||
import StudentSignUp4TeamModal from './components/StudentSignUp4TeamModal.vue'; |
||||
import {useListPage} from '/@/hooks/system/useListPage'; |
||||
import {columns} from './AnnualCompPoint.data'; |
||||
import { |
||||
batchDelete, |
||||
deleteOne, |
||||
getExportUrl, |
||||
getImportUrl, |
||||
list, |
||||
updateApply |
||||
} from './AnnualCompPoint.api.ts'; |
||||
import {downloadFile} from '/@/utils/common/renderUtils'; |
||||
import AnnualCompPointModal from './components/AnnualCompPointModal.vue'; |
||||
import {canUpload} from "/@/views/UpfilePersion/UpfilePersion.api.ts"; |
||||
import {useModal} from '/@/components/Modal'; |
||||
import {useRouter} from "vue-router"; |
||||
|
||||
|
||||
const [registerModal1, {openModal}] = useModal(); |
||||
|
||||
const formRef = ref(); |
||||
const queryParam = reactive<any>({}); |
||||
const toggleSearchStatus = ref<boolean>(false); |
||||
const registerModal = ref(); |
||||
const workUploadRef = ref() |
||||
|
||||
//代理人model |
||||
const [signUp4PersonModal, {openModal: openSignUp4PersonModal}] = useModal(); |
||||
const [signUp4TeamModal, {openModal: openSignUp4TeamModal}] = useModal(); |
||||
|
||||
//注册table数据 |
||||
const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({ |
||||
tableProps: { |
||||
title: '年度比赛项目管理', |
||||
api: list, |
||||
columns, |
||||
canResize: false, |
||||
useSearchForm: false, |
||||
actionColumn: { |
||||
width: 200, |
||||
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(); |
||||
} |
||||
|
||||
const isCanUpload = ref(false) |
||||
|
||||
// 上传作品 |
||||
async function handleWorkSubmit(record) { |
||||
isCanUpload.value = false |
||||
await canUpload({...record}) |
||||
isCanUpload.value = true |
||||
if (isCanUpload.value) { |
||||
workUploadRef.value.modalShow(true, record.id) |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 评奖 |
||||
*/ |
||||
const router = useRouter() |
||||
|
||||
function pingjiang(record: Recordable) { |
||||
router.push({ |
||||
path: '/award/AwardManagementList', |
||||
query: {id: record.id} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 作品管理 |
||||
*/ |
||||
function workManage(record: Recordable) { |
||||
router.push({ |
||||
path: '/workManage/works', |
||||
query: {annualCompPointId: record.id} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 报名 |
||||
*/ |
||||
function application(record: Recordable) { |
||||
router.push({ |
||||
path: '/annualcompetitionprojectregistration/student/AnnualCompetitionProjectRegistrationList', |
||||
query: { |
||||
annualCompid: record.objName, |
||||
entryFormat: record.entryForm === 'N' ? '个人' : '团队', |
||||
id: record.id |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 报名事件 |
||||
*/ |
||||
function handleEdit(record: Recordable) { |
||||
openModal(true, { |
||||
isUpdate: false, |
||||
showFooter: true, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
function handleDetail(record: Recordable) { |
||||
registerModal.value.disableSubmit = true; |
||||
registerModal.value.edit(record); |
||||
} |
||||
|
||||
/** |
||||
* 年度项目管理 提交审核按钮 |
||||
*/ |
||||
function handleSubmitandApply(record: Recordable) { |
||||
updateApply({id: record.id, annualCompState: record.annualCompState}, handleSuccess); |
||||
} |
||||
|
||||
/** |
||||
* 删除事件 |
||||
*/ |
||||
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 handleSignUpSettings(record) { |
||||
if (record.entryForm === "N") { |
||||
openSignUp4PersonModal(true, {record}); |
||||
} else { |
||||
openSignUp4TeamModal(true, {record}); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 操作栏 |
||||
*/ |
||||
function getTableAction(record) { |
||||
const actions = [ |
||||
{ |
||||
label: '报名', |
||||
// onClick: application.bind(null, record), |
||||
onClick: handleSignUpSettings.bind(null, record), |
||||
|
||||
}, |
||||
{ |
||||
label: '详情', |
||||
onClick: handleDetail.bind(null, record), |
||||
}, |
||||
]; |
||||
// if (record.annualCompState === '2') { |
||||
// actions.unshift({ |
||||
// label: '评奖', |
||||
// onClick: handleSubmitandApply.bind(null, record), |
||||
// }); |
||||
// } |
||||
if (record.requireUploadWorks === 'Y') { |
||||
actions.unshift({ |
||||
label: '作品管理', |
||||
onClick: workManage.bind(null, record), |
||||
}); |
||||
} |
||||
/*if (record.requireTopic === 'Y' && record.annualCompState === '2') { |
||||
actions.unshift({ |
||||
label: '选题', |
||||
onClick: handleSubmitandApply.bind(null, record), |
||||
}); |
||||
}*/ |
||||
|
||||
return actions; |
||||
} |
||||
|
||||
/** |
||||
* 查询 |
||||
*/ |
||||
function searchQuery() { |
||||
reload(); |
||||
} |
||||
|
||||
/** |
||||
* 重置 |
||||
*/ |
||||
function searchReset() { |
||||
formRef.value.resetFields(); |
||||
selectedRowKeys.value = []; |
||||
//刷新数据 |
||||
reload(); |
||||
} |
||||
|
||||
/** |
||||
* popup组件值改变事件 |
||||
*/ |
||||
function setFieldsValue(map) { |
||||
Object.keys(map).map((key) => { |
||||
queryParam[key] = map[key]; |
||||
}); |
||||
} |
||||
</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,370 @@ |
||||
<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.annualCompId"> |
||||
<j-popup |
||||
placeholder="请选择年度比赛" |
||||
v-model:value="formData.annualCompId_dictText" |
||||
code="ndbs" |
||||
:fieldConfig="[ |
||||
{ source: 'name', target: 'annualCompId_dictText' }, |
||||
{ source: 'id', target: 'annualCompId' }, |
||||
]" |
||||
:multi="true" |
||||
:setFieldsValue="setFieldsValue" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
|
||||
</a-row> |
||||
|
||||
<a-row> |
||||
<a-col :span="16"> |
||||
<a-form-item label="项目名称" v-bind="validateInfos.objName"> |
||||
<a-input v-model:value="formData.objName" placeholder="请输入项目名称" |
||||
:disabled="disabled"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="8"> |
||||
<a-form-item label="项目层次" v-bind="validateInfos.objLevel"> |
||||
<j-popup |
||||
placeholder="请选择项目层次" |
||||
v-model:value="formData.objLevel_dictText" |
||||
code="xmcc" |
||||
:fieldConfig="[ |
||||
{ source: 'level_name', target: 'objLevel_dictText' }, |
||||
{ source: 'id', target: 'objLevel' }, |
||||
]" |
||||
:multi="false" |
||||
:setFieldsValue="setFieldsValue" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
|
||||
<a-row> |
||||
<a-col :span="10"> |
||||
<a-form-item label="开始时间" v-bind="validateInfos.starttime"> |
||||
<a-date-picker placeholder="请选择开始时间" v-model:value="formData.starttime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="10"> |
||||
<a-form-item label="结束时间" v-bind="validateInfos.endtime"> |
||||
<a-date-picker placeholder="请选择结束时间" v-model:value="formData.endtime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
|
||||
|
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-item label="简介" v-bind="validateInfos.introduce"> |
||||
<a-textarea v-model:value="formData.introduce" rows="4" placeholder="请输入简介" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
|
||||
<a-row> |
||||
<a-col :span="5"> |
||||
<a-form-item label="参与形式" v-bind="validateInfos.entryForm"> |
||||
<j-switch checkedChildren="团队" unCheckedChildren="个人" v-model:value="formData.entryForm" :disabled="disabled"></j-switch> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="9" v-if="formData.entryForm==='Y'"> |
||||
<a-form-item label="是否需要领队" v-bind="validateInfos.requireLeader"> |
||||
<j-switch v-model:value="formData.requireLeader" :disabled="disabled"></j-switch> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="9" v-if="formData.entryForm==='Y'"> |
||||
<a-form-item label="是否需要队伍名称" v-bind="validateInfos.requireTeamName"> |
||||
<j-dict-select-tag type='radio' v-model:value="formData.requireTeamName" dictCode="" |
||||
placeholder="请选择是否需要队伍名称" :disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
|
||||
<a-row> |
||||
|
||||
<a-col :span="12" v-if="formData.entryForm==='Y'"> |
||||
<a-form-item label="队伍人数" v-bind="validateInfos.teamNumber"> |
||||
<a-input-number v-model:value="formData.teamNumber" placeholder="请输入队伍人数" |
||||
style="width: 100%" :disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="12" v-if="formData.entryForm==='Y'"> |
||||
<a-form-item label="指导老师人数" v-bind="validateInfos.teacherNumber"> |
||||
<a-input-number v-model:value="formData.teacherNumber" placeholder="请输入指导老师人数" |
||||
style="width: 100%" :disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
|
||||
<a-row> |
||||
|
||||
<a-col :span="6"> |
||||
<a-form-item label="是否报名" v-bind="validateInfos.requireApply"> |
||||
<j-switch v-model:value="formData.requireApply" :disabled="disabled"></j-switch> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="9" v-if="formData.requireApply==='Y'"> |
||||
<a-form-item label="开始时间" v-bind="validateInfos.applyStartTime"> |
||||
<a-date-picker placeholder="请选择报名开始时间" v-model:value="formData.applyStartTime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="9" v-if="formData.requireApply==='Y'"> |
||||
<a-form-item label="结束时间" v-bind="validateInfos.applyEndTime"> |
||||
<a-date-picker placeholder="请选择报名结束时间" v-model:value="formData.applyEndTime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
|
||||
<a-row> |
||||
<a-col :span="6"> |
||||
<a-form-item label="是否选题" v-bind="validateInfos.requireTopic"> |
||||
<j-switch v-model:value="formData.requireTopic" :disabled="disabled"></j-switch> |
||||
</a-form-item> |
||||
</a-col> |
||||
|
||||
<a-col :span="9" v-if="formData.requireTopic==='Y'"> |
||||
<a-form-item label="开始时间" v-bind="validateInfos.topicStartTime"> |
||||
<a-date-picker placeholder="请选择选题开始时间" v-model:value="formData.topicStartTime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="9" v-if="formData.requireTopic==='Y'"> |
||||
<a-form-item label="结束时间" v-bind="validateInfos.topicEndTime"> |
||||
<a-date-picker placeholder="请选择选题结束时间" v-model:value="formData.topicEndTime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
|
||||
<a-row> |
||||
<a-col :span="12"> |
||||
<a-form-item label="是否上传作品" v-bind="validateInfos.requireUploadWorks"> |
||||
<j-switch v-model:value="formData.requireUploadWorks" :disabled="disabled"></j-switch> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="12" v-if="formData.requireUploadWorks==='Y'"> |
||||
<a-form-item label="上传作品类型" v-bind="validateInfos.uploadWorksType"> |
||||
<j-select-multiple type="list_multi" v-model:value="formData.uploadWorksType" |
||||
dictCode="" placeholder="请选择上传作品类型" :disabled="disabled" |
||||
:triggerChange="false"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="12" v-if="formData.requireUploadWorks==='Y'"> |
||||
<a-form-item label="上传作品开始时间" v-bind="validateInfos.uploadStartTime"> |
||||
<a-date-picker placeholder="请选择上传作品开始时间" v-model:value="formData.uploadStartTime" |
||||
showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="12" v-if="formData.requireUploadWorks==='Y'"> |
||||
<a-form-item label="上传作品结束时间" v-bind="validateInfos.uploadEndTime"> |
||||
<a-date-picker placeholder="请选择上传作品结束时间" v-model:value="formData.uploadEndTime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
<a-row> |
||||
<a-col :span="6"> |
||||
<a-form-item label="是否评分" v-bind="validateInfos.requireScore"> |
||||
<j-switch v-model:value="formData.requireScore" :disabled="disabled"></j-switch> |
||||
</a-form-item> |
||||
</a-col> |
||||
|
||||
<a-col :span="9"> |
||||
<a-form-item label="开始时间" v-bind="validateInfos.scoreStartTime"> |
||||
<a-date-picker placeholder="请选择评分开始时间" v-model:value="formData.scoreStartTime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="9"> |
||||
<a-form-item label="结束时间" v-bind="validateInfos.scoreEndTime"> |
||||
<a-date-picker placeholder="请选择评分结束时间" v-model:value="formData.scoreEndTime" showTime |
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" |
||||
:disabled="disabled"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import {ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted} from 'vue'; |
||||
import {defHttp} from '/@/utils/http/axios'; |
||||
import {useMessage} from '/@/hooks/web/useMessage'; |
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; |
||||
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue'; |
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue'; |
||||
import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue'; |
||||
import {getValueType} from '/@/utils'; |
||||
import {saveOrUpdate} from '../AnnualCompPoint.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: '', |
||||
annualCompId: '', |
||||
objName: '', |
||||
introduce: '', |
||||
objLevel: '', |
||||
entryForm: 'Y', |
||||
teamNumber: undefined, |
||||
teacherNumber: undefined, |
||||
requireLeader: '', |
||||
requireTeamName: '', |
||||
requireApply: 'Y', |
||||
requireTopic: 'Y', |
||||
requireUploadWorks: 'Y', |
||||
uploadWorksType: '', |
||||
requireScore: 'Y', |
||||
starttime: '', |
||||
endtime: '', |
||||
annualCompSwitch: '', |
||||
message: '', |
||||
applyStartTime: '', |
||||
applyEndTime: '', |
||||
topicStartTime: '', |
||||
topicEndTime: '', |
||||
uploadStartTime: '', |
||||
uploadEndTime: '', |
||||
scoreStartTime: '', |
||||
scoreEndTime: '', |
||||
}); |
||||
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 = { |
||||
annualCompId: [{required: true, message: '请输入年度比赛id!'},], |
||||
objName: [{required: true, message: '请输入项目名称!'},], |
||||
entryForm: [{required: true, message: '请输入参与形式!'},], |
||||
requireApply: [{required: true, message: '请输入是否报名!'},], |
||||
requireTopic: [{required: true, message: '请输入是否选题!'},], |
||||
requireUploadWorks: [{required: true, message: '请输入是否上传作品!'},], |
||||
requireScore: [{required: true, message: '请输入是否评分!'},], |
||||
starttime: [{required: true, message: '请输入开始时间!'},], |
||||
endtime: [{required: true, message: '请输入结束时间!'},], |
||||
}; |
||||
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: true}); |
||||
|
||||
// 表单禁用 |
||||
const disabled = computed(() => { |
||||
if (props.formBpm === true) { |
||||
if (props.formData.disabled === false) { |
||||
return false; |
||||
} else { |
||||
return true; |
||||
} |
||||
} |
||||
return props.formDisabled; |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
function add() { |
||||
edit({}); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
*/ |
||||
function edit(record) { |
||||
nextTick(() => { |
||||
resetFields(); |
||||
//赋值 |
||||
Object.assign(formData, record); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 提交数据 |
||||
*/ |
||||
async function submitForm() { |
||||
// 触发表单验证 |
||||
await validate(); |
||||
confirmLoading.value = true; |
||||
const isUpdate = ref<boolean>(false); |
||||
//时间格式化 |
||||
let model = formData; |
||||
if (model.id) { |
||||
isUpdate.value = true; |
||||
} |
||||
//循环数据 |
||||
for (let data in model) { |
||||
//如果该数据是数组并且是字符串类型 |
||||
if (model[data] instanceof Array) { |
||||
let valueType = getValueType(formRef.value.getProps, data); |
||||
//如果是字符串类型的需要变成以逗号分割的字符串 |
||||
if (valueType === 'string') { |
||||
model[data] = model[data].join(','); |
||||
} |
||||
} |
||||
} |
||||
await saveOrUpdate(model, isUpdate.value) |
||||
.then((res) => { |
||||
if (res.success) { |
||||
createMessage.success(res.message); |
||||
emit('ok'); |
||||
} else { |
||||
createMessage.warning(res.message); |
||||
} |
||||
}) |
||||
.finally(() => { |
||||
confirmLoading.value = false; |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* popup组件值改变事件 |
||||
*/ |
||||
function setFieldsValue(map) { |
||||
Object.keys(map).map((key) => { |
||||
formData[key] = map[key]; |
||||
}); |
||||
} |
||||
|
||||
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="关闭"> |
||||
<AnnualCompPointForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></AnnualCompPointForm> |
||||
</a-modal> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { ref, nextTick, defineExpose } from 'vue'; |
||||
import AnnualCompPointForm from './AnnualCompPointForm.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,52 @@ |
||||
<template> |
||||
<BasicModal v-bind="$attrs" @register="registerModal" :width="800" title="个人赛" @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 { formStudentSignUp4PersonSchema } from '../AnnualCompPoint.data'; |
||||
import { studentSignUp } from '../AnnualCompPoint.api'; |
||||
import { useUserStore } from '/@/store/modules/user'; |
||||
|
||||
const userStore = useUserStore(); |
||||
// 声明Emits |
||||
const emit = defineEmits(['success', 'register']); |
||||
//表单配置 |
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ |
||||
schemas: formStudentSignUp4PersonSchema, |
||||
showActionButtonGroup: false, |
||||
}); |
||||
//表单赋值 |
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { |
||||
//重置表单 |
||||
console.log("----11111---data:",JSON.stringify(data.record)) |
||||
await resetFields(); |
||||
setModalProps({ confirmLoading: false }); |
||||
//查询获取表单数据 |
||||
// const res = await getUserAgent({ userName: data.userName }); |
||||
// data = res.result ? res.result : data; |
||||
data.signUpName = userStore.getUserInfo.realname; |
||||
data.id = data.record.id; |
||||
//表单赋值 |
||||
await setFieldsValue({ ...data }); |
||||
}); |
||||
//表单提交事件 |
||||
async function handleSubmit() { |
||||
try { |
||||
const values = await validate(); |
||||
setModalProps({ confirmLoading: true }); |
||||
// console.log("----values------values:",JSON.stringify(values)) |
||||
//提交表单 |
||||
await studentSignUp(values); |
||||
//关闭弹窗 |
||||
closeModal(); |
||||
//刷新列表 |
||||
emit('success'); |
||||
} finally { |
||||
setModalProps({ confirmLoading: false }); |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,51 @@ |
||||
<template> |
||||
<BasicModal v-bind="$attrs" @register="registerModal" :width="800" title="团队赛" @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 { formStudentSignUp4TeamSchema } from '../AnnualCompPoint.data'; |
||||
import { studentSignUp } from '../AnnualCompPoint.api'; |
||||
import { useUserStore } from '/@/store/modules/user'; |
||||
|
||||
const userStore = useUserStore(); |
||||
// 声明Emits |
||||
const emit = defineEmits(['success', 'register']); |
||||
//表单配置 |
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ |
||||
schemas: formStudentSignUp4TeamSchema, |
||||
showActionButtonGroup: false, |
||||
}); |
||||
//表单赋值 |
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { |
||||
//重置表单 |
||||
// console.log("----11111---data:",JSON.stringify(data.record)) |
||||
await resetFields(); |
||||
setModalProps({ confirmLoading: false }); |
||||
data.signUpName = userStore.getUserInfo.realname; |
||||
data.id = data.record.id; |
||||
// console.log("----2222------data:",data) |
||||
//表单赋值 |
||||
await setFieldsValue({ ...data }); |
||||
}); |
||||
//表单提交事件 |
||||
async function handleSubmit() { |
||||
try { |
||||
const values = await validate(); |
||||
setModalProps({ confirmLoading: true }); |
||||
// console.log("----values------values:",JSON.stringify(values)) |
||||
|
||||
//提交表单 |
||||
await studentSignUp(values); |
||||
//关闭弹窗 |
||||
closeModal(); |
||||
//刷新列表 |
||||
emit('success'); |
||||
} finally { |
||||
setModalProps({ confirmLoading: false }); |
||||
} |
||||
} |
||||
</script> |
Loading…
Reference in new issue