'更新年度比赛管理'

gst2base
JayChou 5 days ago
parent 6a1066c0bc
commit 68335f6d8e
  1. 50
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.api.ts
  2. 23
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualCompList.vue
  3. 156
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualCompPoint.api.ts
  4. 430
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/components/AnnualCompPointFormscgl.vue
  5. 75
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/components/AnnualCompPointModalscgl.vue
  6. 24
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/components/cardItem.vue

@ -1,12 +1,12 @@
import {defHttp} from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage"; import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage(); const { createConfirm } = useMessage();
enum Api { enum Api {
list = '/annualcomp/annualComp/list', list = '/annualcomp/annualComp/list',
save='/annualcomp/annualComp/add', save = '/annualcomp/annualComp/add',
edit='/annualcomp/annualComp/edit', edit = '/annualcomp/annualComp/edit',
deleteOne = '/annualcomp/annualComp/delete', deleteOne = '/annualcomp/annualComp/delete',
deleteBatch = '/annualcomp/annualComp/deleteBatch', deleteBatch = '/annualcomp/annualComp/deleteBatch',
importExcel = '/annualcomp/annualComp/importExcel', importExcel = '/annualcomp/annualComp/importExcel',
@ -14,6 +14,7 @@ enum Api {
submit = '/annualcomp/annualComp/submit', submit = '/annualcomp/annualComp/submit',
enable = '/annualcomp/annualComp/enable', enable = '/annualcomp/annualComp/enable',
deactivate = '/annualcomp/annualComp/deactivate', deactivate = '/annualcomp/annualComp/deactivate',
bingProject = '/AnnualCompPoint/annualCompPoint/listByCid',
} }
/** /**
* api * api
@ -28,32 +29,31 @@ export const getImportUrl = Api.importExcel;
* *
* @param params * @param params
*/ */
export const list = (params) => export const list = (params) => defHttp.get({ url: Api.list, params });
defHttp.get({url: Api.list, params}); export const submit = (params, handleSuccess) => {
export const submit = (params,handleSuccess) => { return defHttp.get({ url: Api.submit, params }, { joinParamsToUrl: true }).then(() => {
return defHttp.get({url: Api.submit, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess(); handleSuccess();
}); });
} };
export const enable = (params,handleSuccess) => { export const enable = (params, handleSuccess) => {
return defHttp.get({url: Api.enable, params}, {joinParamsToUrl: true}).then(() => { return defHttp.get({ url: Api.enable, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
} };
export const deactivate = (params,handleSuccess) => { export const deactivate = (params, handleSuccess) => {
return defHttp.get({url: Api.deactivate, params}, {joinParamsToUrl: true}).then(() => { return defHttp.get({ url: Api.deactivate, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
} };
/** /**
* *
*/ */
export const deleteOne = (params,handleSuccess) => { export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
} };
/** /**
* *
* @param params * @param params
@ -66,17 +66,21 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
} },
}); });
} };
/** /**
* *
* @param params * @param params
*/ */
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save; let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params}); return defHttp.post({ url: url, params });
} };
// 绑定项目
export const bingProjectApi = (params) => {
return defHttp.get({ url: Api.bingProject, params });
};

@ -43,6 +43,7 @@
@submitChange="handleSubmit" @submitChange="handleSubmit"
@enableChange="handleEnable" @enableChange="handleEnable"
@deactivateChange="handleDeactivate" @deactivateChange="handleDeactivate"
@bindProjectChange="bindProject"
/> />
</div> </div>
<div class="pagination"> <div class="pagination">
@ -51,6 +52,8 @@
</a-card> </a-card>
</div> </div>
<AnnualCompModal @register="registerModal" @success="handleSuccess" /> <AnnualCompModal @register="registerModal" @success="handleSuccess" />
<AnnualCompPointModalscgl ref="registerModalscgl" @success="handleSuccess"></AnnualCompPointModalscgl>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -58,9 +61,10 @@
import { Pagination } from 'ant-design-vue'; import { Pagination } from 'ant-design-vue';
import { ref } from 'vue'; import { ref } from 'vue';
import cardItem from './components/cardItem.vue'; import cardItem from './components/cardItem.vue';
import { list, deleteOne, submit, enable, deactivate } from './AnnualComp.api'; import { list, deleteOne, submit, enable, deactivate,bingProjectApi } from './AnnualComp.api';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import AnnualCompPointModalscgl from './components/AnnualCompPointModalscgl.vue';
import AnnualCompModal from './components/AnnualCompModal.vue'; import AnnualCompModal from './components/AnnualCompModal.vue';
import { getDictItems } from '/@/api/common/api'; import { getDictItems } from '/@/api/common/api';
@ -179,6 +183,23 @@
page.annualid = id; page.annualid = id;
getList(); getList();
}; };
//
const bindProject = async (record) => {
console.log(record);
const res = await bingProjectApi({ id: record });
console.log(res.records[0]);
const data = res.records ? res.records[0] : {};
handleEditscgl(data);
}
const registerModalscgl = ref();
const handleEditscgl = (record) => {
registerModalscgl.value.disableSubmit = false;
console.log(record,'record.value');
registerModalscgl.value.edit(record);
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

@ -0,0 +1,156 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/AnnualCompPoint/annualCompPoint/list',
save='/AnnualCompPoint/annualCompPoint/add',
edit='/AnnualCompPoint/annualCompPoint/edit',
edit1='/AnnualCompPoint/annualCompPoint/edit1',
deleteOne = '/AnnualCompPoint/annualCompPoint/delete',
deleteBatch = '/AnnualCompPoint/annualCompPoint/deleteBatch',
importExcel = '/AnnualCompPoint/annualCompPoint/importExcel',
exportXls = '/AnnualCompPoint/annualCompPoint/exportXls',
exportXlsMb = '/AnnualCompPoint/annualCompPoint/exportXlsMb',
updateApply = '/AnnualCompPoint/annualCompPoint/updateApply',
collectScore = '/annualScore/personalCompScore/collectScore',
pj = '/AnnualCompPoint/annualCompPoint/pj',
cjhz = '/AnnualCompPoint/annualCompPoint/cjhz',
tongfenfuping = '/AnnualCompPoint/annualCompPoint/tongfenfuping',
getProjectlevel = '/projectlevel/projectlevel/getProjectlevel',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
export const getExportUrlMb = Api.exportXlsMb;
/**
* 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();
});
}
export const pj = (params,handleSuccess) => {
return defHttp.get({url: Api.pj, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
export const cjhz = (params,handleSuccess) => {
return defHttp.get({url: Api.cjhz, 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();
});
}
});
}
// 个人积分汇总
export const collectScore = (params,handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认操作',
content: '确认发送请求吗',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.post({url: Api.collectScore,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 });
}
export const saveOrUpdate1 = (params, isUpdate) => {
let url = isUpdate ? Api.edit1 : 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 tongfenfuping = (params,handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认操作',
content: '确认发送请求吗',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.post({url: Api.tongfenfuping,params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
export const getProjectlevel = (params) => {
const url = Api.getProjectlevel;
return defHttp.get({ url: url, params });
};

@ -0,0 +1,430 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="12">
<a-form-item label="年度比赛" v-bind="validateInfos.annualCompId" :labelCol="labelCol" :wrapperCol="wrapperCol">
<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"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="项目(赛道)名称" v-bind="validateInfos.objName" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-model:value="formData.objName" placeholder="请输入项目(赛道)名称"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<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%"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<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%"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="项目(赛道)层次" v-bind="validateInfos.objLevel" :labelCol="labelCol" :wrapperCol="wrapperCol7">
<j-dict-select-tag type="radio" v-model:value="formData.objLevel" placeholder="请选择项目(赛道)层次" dict-code="obj_lever" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="简介" v-bind="validateInfos.introduce" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-textarea v-model:value="formData.introduce" rows="4" placeholder="请输入简介" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="11">
<a-form-item label="参与形式" v-bind="validateInfos.entryForm" :labelCol="labelCol" :wrapperCol="wrapperCol8">
<j-dict-select-tag type="radio" v-model:value="formData.entryForm" placeholder="请选择参与形式" dict-code="joinType" />
</a-form-item>
</a-col>
<a-col :span="6" v-if="formData.entryForm === 'Y'">
<a-form-item label="是否需要领队" v-bind="validateInfos.requireLeader" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<j-switch v-model:value="formData.requireLeader"></j-switch>
</a-form-item>
</a-col>
<a-col :span="7" v-if="formData.entryForm === 'Y'">
<a-form-item label="是否需要队伍名称" v-bind="validateInfos.requireTeamName" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<j-switch type="radio" v-model:value="formData.requireTeamName" dictCode="" placeholder="请选择是否需要队伍名称" />
</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%" />
</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%" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="5">
<a-form-item label="是否报名" v-bind="validateInfos.requireApply" :labelCol="labelCol4" :wrapperCol="wrapperCol4">
<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" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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="5">
<a-form-item label="是否选题" v-bind="validateInfos.requireTopic" :labelCol="labelCol4" :wrapperCol="wrapperCol4">
<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" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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="5">
<a-form-item label="上传作品" v-bind="validateInfos.requireUploadWorks" :labelCol="labelCol4" :wrapperCol="wrapperCol4">
<j-switch v-model:value="formData.requireUploadWorks" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.requireUploadWorks === 'Y'">
<a-form-item label="开始时间" v-bind="validateInfos.uploadStartTime" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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="9" v-if="formData.requireUploadWorks === 'Y'">
<a-form-item label="结束时间" v-bind="validateInfos.uploadEndTime" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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-col :span="24" v-if="formData.requireUploadWorks === 'Y'">
<a-form-item label="上传作品类型" v-bind="validateInfos.uploadWorksType" :labelCol="labelCol6" :wrapperCol="wrapperCol6">
<j-select-multiple
type="list_multi"
v-model:value="formData.uploadWorksType"
dictCode="updateWorksType"
placeholder="请选择上传作品类型"
:disabled="disabled"
:triggerChange="false"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="5">
<a-form-item label="是否评分" v-bind="validateInfos.requireScore" :labelCol="labelCol4" :wrapperCol="wrapperCol4">
<j-switch v-model:value="formData.requireScore" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.requireScore === 'Y'">
<a-form-item label="开始时间" v-bind="validateInfos.scoreStartTime" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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" v-if="formData.requireScore === 'Y'">
<a-form-item label="结束时间" v-bind="validateInfos.scoreEndTime" :labelCol="labelCol5" :wrapperCol="wrapperCol5">
<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>
<p style="color: red">如果需要评分则需要添加开启选题</p>
<a-row v-if="formData.annualCompState === '4'">
<a-col :span="24">
<a-form-item label="驳回原因" v-bind="validateInfos.introduce" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-textarea v-model:value="formData.backinfo" rows="4" placeholder="请输入简介" />
</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 { saveOrUpdate1 } 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: '3',
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: 6 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol1 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
const wrapperCol1 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 9 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const labelCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 13 } });
const wrapperCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const labelCol4 = ref<any>({ xs: { span: 24 }, sm: { span: 14 } });
const wrapperCol4 = ref<any>({ xs: { span: 24 }, sm: { span: 1 } });
const labelCol5 = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
const wrapperCol5 = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol6 = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
const wrapperCol6 = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
const labelCol7 = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
const wrapperCol7 = ref<any>({ xs: { span: 24 }, sm: { span: 24 } });
const wrapperCol8 = ref<any>({ xs: { span: 24 }, sm: { span: 14 } });
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();
// record.applyStartTime='';
// record.applyStartTime='';
// record.applyEndTime='';
// record.topicStartTime='';
// record.topicEndTime='';
// record.uploadStartTime='';
// record.uploadEndTime='';
// record.scoreStartTime='';
// record.scoreEndTime='';
// record.uploadWorksType='';
//
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 saveOrUpdate1(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="关闭">
<AnnualCompPointFormscgl ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></AnnualCompPointFormscgl>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import AnnualCompPointFormscgl from './AnnualCompPointFormscgl.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 = '配置年度比赛';
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>

@ -35,6 +35,8 @@
<div class="submt status-1" @click.stop="submit" v-if="data.state == 0 || data.state == 3 ">{{ data.state == 3 ? '重新提交' : '提交' }}</div> <div class="submt status-1" @click.stop="submit" v-if="data.state == 0 || data.state == 3 ">{{ data.state == 3 ? '重新提交' : '提交' }}</div>
<div class="submt status-2" @click.stop="enable" v-if="data.state == 2 && data.isopen == 0">启用</div> <div class="submt status-2" @click.stop="enable" v-if="data.state == 2 && data.isopen == 0">启用</div>
<div class="submt status-3" @click.stop="deactivate" v-if="data.state == 2 && data.isopen == 1">停用</div> <div class="submt status-3" @click.stop="deactivate" v-if="data.state == 2 && data.isopen == 1">停用</div>
<div class="submt status-1" v-if="data.state == 2" @click.stop="goTo">奖项管理</div>
<div class="submt status-1" v-if="data.state == 2" @click.stop="bindProject(data.id)">配置年度比赛</div>
<!-- <div <!-- <div
class="left" class="left"
:class="data.state == 0 ? ' status-color-1' : data.state == 1 ? ' status-color-1' : data.state == 2 ? ' status-color-2' : data.state == 3 ? ' status-color-3' : ''" :class="data.state == 0 ? ' status-color-1' : data.state == 1 ? ' status-color-1' : data.state == 2 ? ' status-color-2' : data.state == 3 ? ' status-color-3' : ''"
@ -54,13 +56,15 @@
<script lang="ts" setup> <script lang="ts" setup>
import { watch, ref } from 'vue'; import { watch, ref } from 'vue';
import SvgIcon from '/@/components/Icon/src/SvgIcon.vue'; import SvgIcon from '/@/components/Icon/src/SvgIcon.vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
required: true, required: true,
}, },
}); });
const emits = defineEmits(['editChange', 'delChange','infoChange','submitChange','enableChange','deactivateChange']); const emits = defineEmits(['editChange', 'delChange','infoChange','submitChange','enableChange','deactivateChange','bindProjectChange']);
const data = ref(props.data); const data = ref(props.data);
console.log(props, 'props'); console.log(props, 'props');
@ -89,6 +93,13 @@
const deactivate = () => { const deactivate = () => {
emits('deactivateChange',data) emits('deactivateChange',data)
} }
const goTo = () => {
router.push('/awardpersion/AwardPersionList')
}
//
const bindProject = (id) => {
emits('bindProjectChange',id)
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -149,9 +160,13 @@
padding: 0 20px; padding: 0 20px;
} }
.title { .title {
width: 100%;
margin-top: 5px; margin-top: 5px;
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.time { .time {
font-size: 15px; font-size: 15px;
@ -178,6 +193,9 @@
.footer { .footer {
// margin-top: 10px; // margin-top: 10px;
width: 100%; width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
// display: flex; // display: flex;
// justify-content: space-between; // justify-content: space-between;
// .left { // .left {
@ -232,11 +250,11 @@
// } // }
// } // }
.submt { .submt {
width: 100%; width: 30%;
height: 37px; height: 37px;
text-align: center; text-align: center;
line-height: 37px; line-height: 37px;
font-size: 16px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }
.status-1 { .status-1 {

Loading…
Cancel
Save