|
|
|
@ -25,7 +25,7 @@ |
|
|
|
|
<div class="annual">{{ ndbs.annualid }}年度</div> |
|
|
|
|
<div class="title-box"> |
|
|
|
|
<div class="text">{{ ndbs.name }}</div> |
|
|
|
|
<img src="../../assets/images/编组.png" alt="" /> |
|
|
|
|
<img style="width: 35px" src="../../assets/images/编组.png" alt="" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="right"> |
|
|
|
@ -72,16 +72,10 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
</div> |
|
|
|
|
<el-acrd> |
|
|
|
|
<el-card> |
|
|
|
|
<div> |
|
|
|
|
<el-form |
|
|
|
|
ref="ruleFormRef" |
|
|
|
|
style="max-width: 600px" |
|
|
|
|
:model="ruleForm" |
|
|
|
|
status-icon |
|
|
|
|
label-width="auto" |
|
|
|
|
class="demo-ruleForm" |
|
|
|
|
> |
|
|
|
|
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" status-icon label-width="auto" |
|
|
|
|
class="demo-ruleForm"> |
|
|
|
|
<el-form-item label="年度比赛项目"> |
|
|
|
|
<el-input v-model="ruleForm.objName" type="text" disabled /> |
|
|
|
|
</el-form-item> |
|
|
|
@ -89,19 +83,21 @@ |
|
|
|
|
<el-input v-model="ruleForm.entryFormat" type="text" disabled /> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="选择题目" prop="topicid"> |
|
|
|
|
<el-form-item label="选择题目" v-show="false"> |
|
|
|
|
<el-select v-model="ruleForm.topicid" placeholder="请选择题目" :disabled="isDisable"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in options" |
|
|
|
|
:key="item.value" |
|
|
|
|
:label="item.label" |
|
|
|
|
:value="item.value" |
|
|
|
|
/> |
|
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="作品文件" v-if="ndbsXm.requireUploadWorks === 'Y'"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<el-input style="width: auto;" v-model="WorkName" disabled> |
|
|
|
|
</el-input> |
|
|
|
|
<el-button type="primary" style="margin-left:15px ;" @click="uploadZp(ruleForm.id)">上传作品</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
</el-acrd> |
|
|
|
|
</el-card> |
|
|
|
|
<el-card class="center"> |
|
|
|
|
<div class="personage-info"> |
|
|
|
|
<div class="head"> |
|
|
|
@ -168,12 +164,43 @@ |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<div class="bottom"> |
|
|
|
|
<el-button class="btn" @click="() => router.back()">{{ isDisable ? '返回' : isEdit ? '取消修改' : '取消报名' }}</el-button> |
|
|
|
|
<el-button class="btn cyan" :loading="subLoading" @click="submit" :disabled="isDisable"> |
|
|
|
|
{{ isEdit ? '确认修改' : '确认报名' }} |
|
|
|
|
<el-button class="btn" @click="() => router.back()"> |
|
|
|
|
{{ isDisable ? '返回' : isEdit ? '取消修改' : '取消报名' }} |
|
|
|
|
</el-button> |
|
|
|
|
<el-button class="btn temp" @click="submit('2')" v-if="!isDisable">暂存信息</el-button> |
|
|
|
|
<el-button class="btn cyan" :loading="subLoading" @click="submit('1')" v-if="!isDisable"> |
|
|
|
|
{{ isEdit ? '确认修改' : '确认报名' }} |
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-dialog v-model="dialogVisible" title="上传作品" width="500" :before-close="handleClose" v-if="dialogVisible" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<el-form label-width="80" style="padding-right: 30px"> |
|
|
|
|
<el-form-item label="作品名称"> |
|
|
|
|
<el-input v-model="raceName" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="作品"> |
|
|
|
|
<el-upload ref="upload" class="upload-demo" action="#" v-model:file-list="fileList" :limit="1" |
|
|
|
|
:auto-upload="false"> |
|
|
|
|
<template #trigger> |
|
|
|
|
<el-button type="primary">选择文件</el-button> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template #tip> |
|
|
|
|
<div class="el-upload__tip text-red">作品只允许上传一个,格式为{{ndbsXm.uploadWorksType}}</div> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
<el-button @click="handleClose">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitWork">确认</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
@ -184,7 +211,7 @@ import { useRoute, useRouter } from 'vue-router' |
|
|
|
|
import userStore from '@/store/module/user' |
|
|
|
|
import { getNdbswxqList, getComppxqList } from '@/api/person' |
|
|
|
|
import { getOldRaceList, getOldRaceInfo } from '@/api/oldRace' |
|
|
|
|
import { getTopicList } from '@/api/race' |
|
|
|
|
import { getTopicList, uploadFileZp, uploadFile } from '@/api/race' |
|
|
|
|
|
|
|
|
|
const user = userStore() |
|
|
|
|
const route = useRoute() |
|
|
|
@ -208,22 +235,81 @@ const upData = ref<Parameters<typeof getSignUpApi>[0]>({ |
|
|
|
|
entryFormat: '个人', |
|
|
|
|
id: route.query.edit ? route.query.annualCompid : route.query.id, |
|
|
|
|
instructorSheetList: [], |
|
|
|
|
teamManagementList: [{ realname: '', captain: '', teamSeq: '', userId: '' }], |
|
|
|
|
teamManagementList: [{ realname: '', captain: '1', teamSeq: '', userId: '' }], |
|
|
|
|
// WorkName:WorkName.value, |
|
|
|
|
// file:fileUrl.value |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//作品 |
|
|
|
|
const dialogVisible = ref(false) |
|
|
|
|
const fileList = ref<any>([]) |
|
|
|
|
const annualCompid = ref('') |
|
|
|
|
const raceName = ref<any>('') |
|
|
|
|
|
|
|
|
|
const uploadZp = (id: any) => { |
|
|
|
|
|
|
|
|
|
console.log(id) |
|
|
|
|
annualCompid.value = id |
|
|
|
|
dialogVisible.value = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleClose = () => { |
|
|
|
|
dialogVisible.value = false |
|
|
|
|
fileList.value = [] |
|
|
|
|
raceName.value = '' |
|
|
|
|
annualCompid.value = '' |
|
|
|
|
} |
|
|
|
|
const WorkName = ref<string>('') |
|
|
|
|
// const fileUrl = ref<string>('') |
|
|
|
|
const fileUrl = ref<string[]>([]); |
|
|
|
|
const submitWork = async () => { |
|
|
|
|
if (!raceName.value) return ElMessage.warning('请输入作品名称') |
|
|
|
|
if (!fileList.value.length) return ElMessage.warning('请上传作品') |
|
|
|
|
console.log(fileList.value[0].raw, raceName.value, 'fileList.value[0].raw') |
|
|
|
|
const fromData = new FormData() |
|
|
|
|
fromData.append('annualCompid', annualCompid.value) |
|
|
|
|
console.log(annualCompid.value); |
|
|
|
|
fromData.append('file', fileList.value[0].raw) |
|
|
|
|
// fileUrl.value = fileList.value[0].raw.name |
|
|
|
|
fromData.append('workName', raceName.value) |
|
|
|
|
const res: any = await uploadFile(fromData) |
|
|
|
|
if (res && Array.isArray(res.message)) { |
|
|
|
|
fileUrl.value = res.message; |
|
|
|
|
} else { |
|
|
|
|
fileUrl.value = [res.message]; |
|
|
|
|
} |
|
|
|
|
WorkName.value = raceName.value; |
|
|
|
|
handleClose(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fromData.append('annualCompid', annualCompid.value) |
|
|
|
|
// fromData.append('workName', raceName.value) |
|
|
|
|
// const res: any = await uploadFileZp(fromData).then((res: any) => { |
|
|
|
|
// console.log(res) |
|
|
|
|
// if (res.code == 500) return ElMessage.warning(res.message) |
|
|
|
|
// ElMessage.success(res.message) |
|
|
|
|
// }) |
|
|
|
|
// console.log(res) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 比赛信息、项目信息 |
|
|
|
|
const ndbs = ref<any>({}) |
|
|
|
|
const ndbsXm = ref<any>({}) |
|
|
|
|
|
|
|
|
|
const subLoading = ref(false) |
|
|
|
|
async function submit() { |
|
|
|
|
console.log(ruleForm, 'ruleForm'); |
|
|
|
|
|
|
|
|
|
async function submit(substa:string) { |
|
|
|
|
console.log(ruleForm, 'ruleForm') |
|
|
|
|
if (!ruleForm.topicid) return ElMessage.warning('请选择题目') |
|
|
|
|
upData.value.teamManagementList[0].realname = info.value.realname |
|
|
|
|
upData.value.teamManagementList[0].userId = info.value.id |
|
|
|
|
upData.value.annualCompid = route.query.annualCompid |
|
|
|
|
upData.value.topicid = ruleForm.topicid |
|
|
|
|
upData.value.workName = WorkName.value |
|
|
|
|
upData.value.files = fileUrl.value |
|
|
|
|
upData.value.substa = substa |
|
|
|
|
// if (!upData.value.teamName) { |
|
|
|
|
// ElMessage({ |
|
|
|
|
// message: '队伍名称不能为空', |
|
|
|
@ -233,8 +319,8 @@ async function submit() { |
|
|
|
|
// } |
|
|
|
|
try { |
|
|
|
|
subLoading.value = true |
|
|
|
|
const res: any = await getSignUpApi(upData.value) |
|
|
|
|
|
|
|
|
|
const res: any = await getSignUpApi({ ...upData.value }) |
|
|
|
|
console.log(res, 999999999) |
|
|
|
|
ElMessage({ |
|
|
|
|
message: res?.message || res?.result || '报名成功', |
|
|
|
|
type: 'success', |
|
|
|
@ -258,7 +344,10 @@ const ruleForm = reactive<any>({ |
|
|
|
|
entryFormat: '个人', |
|
|
|
|
id: route.query.id, |
|
|
|
|
topicid: '', |
|
|
|
|
objName:route.query.objName |
|
|
|
|
objName: route.query.objName, |
|
|
|
|
// requireUploadWorks: ndbsXm.requireUploadWorks, |
|
|
|
|
raceName: WorkName.value, |
|
|
|
|
fileUrl: fileUrl.value |
|
|
|
|
}) |
|
|
|
|
const options = ref([]) |
|
|
|
|
if (route.query.edit) { |
|
|
|
@ -274,7 +363,8 @@ if (route.query.edit) { |
|
|
|
|
ruleForm.teamName = res.result.teamName |
|
|
|
|
ruleForm.topicid = res.result.topicObj ? res.result.topicObj.id : '' |
|
|
|
|
ruleForm.objName = res.result.annualCompPointName |
|
|
|
|
|
|
|
|
|
ruleForm.requireUploadWorks = res.result.requireUploadWorks |
|
|
|
|
WorkName.value = res.result.uploadFile.topicName |
|
|
|
|
options.value = res.result.topicList.map((item) => { |
|
|
|
|
return { |
|
|
|
|
value: item.id, |
|
|
|
@ -377,7 +467,7 @@ getTopicListApi() |
|
|
|
|
margin: 0 auto; |
|
|
|
|
width: 1397px; |
|
|
|
|
|
|
|
|
|
& > * { |
|
|
|
|
&>* { |
|
|
|
|
background: #ffffff; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -445,6 +535,12 @@ getTopicListApi() |
|
|
|
|
font-size: 32px; |
|
|
|
|
color: #ffffff; |
|
|
|
|
line-height: 39px; |
|
|
|
|
display: -webkit-box; |
|
|
|
|
-webkit-box-orient: vertical; |
|
|
|
|
-webkit-line-clamp: 3; |
|
|
|
|
/* 限制显示的行数 */ |
|
|
|
|
overflow: hidden; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -452,6 +548,7 @@ getTopicListApi() |
|
|
|
|
.right { |
|
|
|
|
.info-box { |
|
|
|
|
width: 210px; |
|
|
|
|
|
|
|
|
|
.name { |
|
|
|
|
height: 20px; |
|
|
|
|
font-family: |
|
|
|
@ -645,6 +742,11 @@ getTopicListApi() |
|
|
|
|
--color1: #00d0d0; |
|
|
|
|
--color2: #42d9ac; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
&.temp { |
|
|
|
|
// --color1: #b9e63f; |
|
|
|
|
--color2: #FFA500; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|