GST002
JayChou 3 months ago
commit c64f1540d8
  1. 4
      src/api/person.ts
  2. 6
      src/views/home/index.vue
  3. 163
      src/views/registrationPersonage/index.vue
  4. 59
      src/views/userInfo/components/reacList.vue

@ -59,7 +59,9 @@ interface SignUpData {
entryFormat: '团队' | '个人' entryFormat: '团队' | '个人'
id: string id: string
instructorSheetList?: any[] instructorSheetList?: any[]
teamManagementList?: any[] teamManagementList?: any[],
file:string
WorkName:any
} }
interface MembersOrAdviser { interface MembersOrAdviser {

@ -130,9 +130,9 @@ const toNewsDetail = (id: number) => {
const newList = ref<any>([]) const newList = ref<any>([])
const getNewsList = async () => { const getNewsList = async () => {
const res: any = await getColumnListApi() const res: any = await getColumnListApi()
console.log(res) // console.log(res)
newList.value = res.result.slice(0, 4) newList.value = res.result.slice(0, 4)
console.log(newList.value, 'newList.value') // console.log(newList.value, 'newList.value')
newInfo.value = newList.value[0] newInfo.value = newList.value[0]
getNewInfo(newList.value[0].id) getNewInfo(newList.value[0].id)
} }
@ -145,7 +145,7 @@ const childrenNewList = ref<any>([])
const getNewInfo = async (id: any) => { const getNewInfo = async (id: any) => {
const res: any = await queryEssayListApi(id) const res: any = await queryEssayListApi(id)
childrenNewList.value = res.result.records childrenNewList.value = res.result.records
console.log(childrenNewList, 'childrenNewList') // console.log(childrenNewList, 'childrenNewList')
} }
// tab // tab

@ -25,11 +25,7 @@
<div class="annual">{{ ndbs.annualid }}年度</div> <div class="annual">{{ ndbs.annualid }}年度</div>
<div class="title-box"> <div class="title-box">
<div class="text">{{ ndbs.name }}</div> <div class="text">{{ ndbs.name }}</div>
<img <img style="width: 35px" src="../../assets/images/编组.png" alt="" />
style="width: 35px"
src="../../assets/images/编组.png"
alt=""
/>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
@ -76,16 +72,10 @@
</div> </div>
</el-card> </el-card>
</div> </div>
<el-acrd> <el-card>
<div> <div>
<el-form <el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" status-icon label-width="auto"
ref="ruleFormRef" class="demo-ruleForm">
style="max-width: 600px"
:model="ruleForm"
status-icon
label-width="auto"
class="demo-ruleForm"
>
<el-form-item label="年度比赛项目"> <el-form-item label="年度比赛项目">
<el-input v-model="ruleForm.objName" type="text" disabled /> <el-input v-model="ruleForm.objName" type="text" disabled />
</el-form-item> </el-form-item>
@ -93,23 +83,21 @@
<el-input v-model="ruleForm.entryFormat" type="text" disabled /> <el-input v-model="ruleForm.entryFormat" type="text" disabled />
</el-form-item> </el-form-item>
<el-form-item label="选择题目" prop="topicid"> <el-form-item label="选择题目">
<el-select <el-select v-model="ruleForm.topicid" placeholder="请选择题目" :disabled="isDisable">
v-model="ruleForm.topicid" <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
placeholder="请选择题目"
:disabled="isDisable"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </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> </el-form>
</div> </div>
</el-acrd> </el-card>
<el-card class="center"> <el-card class="center">
<div class="personage-info"> <div class="personage-info">
<div class="head"> <div class="head">
@ -179,16 +167,39 @@
<el-button class="btn" @click="() => router.back()"> <el-button class="btn" @click="() => router.back()">
{{ isDisable ? '返回' : isEdit ? '取消修改' : '取消报名' }} {{ isDisable ? '返回' : isEdit ? '取消修改' : '取消报名' }}
</el-button> </el-button>
<el-button <el-button class="btn temp" @click="submit('2')" v-if="!isDisable">暂存信息</el-button>
class="btn cyan" <el-button class="btn cyan" :loading="subLoading" @click="submit('1')" v-if="!isDisable">
:loading="subLoading"
@click="submit"
v-if="!isDisable"
>
{{ isEdit ? '确认修改' : '确认报名' }} {{ isEdit ? '确认修改' : '确认报名' }}
</el-button> </el-button>
</div> </div>
</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">作品只允许上传一个</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> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -199,7 +210,7 @@ import { useRoute, useRouter } from 'vue-router'
import userStore from '@/store/module/user' import userStore from '@/store/module/user'
import { getNdbswxqList, getComppxqList } from '@/api/person' import { getNdbswxqList, getComppxqList } from '@/api/person'
import { getOldRaceList, getOldRaceInfo } from '@/api/oldRace' import { getOldRaceList, getOldRaceInfo } from '@/api/oldRace'
import { getTopicList } from '@/api/race' import { getTopicList, uploadFileZp, uploadFile } from '@/api/race'
const user = userStore() const user = userStore()
const route = useRoute() const route = useRoute()
@ -224,21 +235,80 @@ const upData = ref<Parameters<typeof getSignUpApi>[0]>({
id: route.query.edit ? route.query.annualCompid : route.query.id, id: route.query.edit ? route.query.annualCompid : route.query.id,
instructorSheetList: [], instructorSheetList: [],
teamManagementList: [{ realname: '', captain: '', teamSeq: '', userId: '' }], teamManagementList: [{ realname: '', captain: '', 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 ndbs = ref<any>({})
const ndbsXm = ref<any>({}) const ndbsXm = ref<any>({})
const subLoading = ref(false) const subLoading = ref(false)
async function submit() { async function submit(substa:string) {
console.log(ruleForm, 'ruleForm') console.log(ruleForm, 'ruleForm')
if (!ruleForm.topicid) return ElMessage.warning('请选择题目') if (!ruleForm.topicid) return ElMessage.warning('请选择题目')
upData.value.teamManagementList[0].realname = info.value.realname upData.value.teamManagementList[0].realname = info.value.realname
upData.value.teamManagementList[0].userId = info.value.id upData.value.teamManagementList[0].userId = info.value.id
upData.value.annualCompid = route.query.annualCompid upData.value.annualCompid = route.query.annualCompid
upData.value.topicid = ruleForm.topicid upData.value.topicid = ruleForm.topicid
upData.value.workName = WorkName.value
upData.value.files = fileUrl.value
upData.value.substa = substa
// if (!upData.value.teamName) { // if (!upData.value.teamName) {
// ElMessage({ // ElMessage({
// message: '', // message: '',
@ -248,8 +318,8 @@ async function submit() {
// } // }
try { try {
subLoading.value = true subLoading.value = true
const res: any = await getSignUpApi(upData.value) const res: any = await getSignUpApi({ ...upData.value })
console.log(res, 999999999)
ElMessage({ ElMessage({
message: res?.message || res?.result || '报名成功', message: res?.message || res?.result || '报名成功',
type: 'success', type: 'success',
@ -274,6 +344,9 @@ const ruleForm = reactive<any>({
id: route.query.id, id: route.query.id,
topicid: '', topicid: '',
objName: route.query.objName, objName: route.query.objName,
// requireUploadWorks: ndbsXm.requireUploadWorks,
raceName: WorkName.value,
fileUrl: fileUrl.value
}) })
const options = ref([]) const options = ref([])
if (route.query.edit) { if (route.query.edit) {
@ -289,7 +362,8 @@ if (route.query.edit) {
ruleForm.teamName = res.result.teamName ruleForm.teamName = res.result.teamName
ruleForm.topicid = res.result.topicObj ? res.result.topicObj.id : '' ruleForm.topicid = res.result.topicObj ? res.result.topicObj.id : ''
ruleForm.objName = res.result.annualCompPointName ruleForm.objName = res.result.annualCompPointName
ruleForm.requireUploadWorks = res.result.requireUploadWorks
WorkName.value = res.result.uploadFile.topicName
options.value = res.result.topicList.map((item) => { options.value = res.result.topicList.map((item) => {
return { return {
value: item.id, value: item.id,
@ -392,7 +466,7 @@ getTopicListApi()
margin: 0 auto; margin: 0 auto;
width: 1397px; width: 1397px;
& > * { &>* {
background: #ffffff; background: #ffffff;
} }
@ -462,7 +536,8 @@ getTopicListApi()
line-height: 39px; line-height: 39px;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 3; /* 限制显示的行数 */ -webkit-line-clamp: 3;
/* 限制显示的行数 */
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
@ -472,6 +547,7 @@ getTopicListApi()
.right { .right {
.info-box { .info-box {
width: 210px; width: 210px;
.name { .name {
height: 20px; height: 20px;
font-family: font-family:
@ -665,6 +741,11 @@ getTopicListApi()
--color1: #00d0d0; --color1: #00d0d0;
--color2: #42d9ac; --color2: #42d9ac;
} }
&.temp {
// --color1: #b9e63f;
--color2: #FFA500;
}
} }
} }
} }

@ -4,7 +4,7 @@
<template #header> <template #header>
<div style="font-size: 16px; font-weight: 600">我的比赛</div> <div style="font-size: 16px; font-weight: 600">我的比赛</div>
</template> </template>
<el-table :data="list" v-loading="isLoading"> <el-table :data="list" v-loading="isLoading" >
<el-table-column <el-table-column
label="年度比赛名称" label="年度比赛名称"
prop="compName" prop="compName"
@ -16,11 +16,11 @@
<el-table-column label="比赛类型" prop="entryFormat" /> <el-table-column label="比赛类型" prop="entryFormat" />
<el-table-column label="报名编号" prop="enrollCode" /> <el-table-column label="报名编号" prop="enrollCode" />
<el-table-column label="比赛状态" prop="enrollStatic_dictText" /> <el-table-column label="比赛状态" prop="enrollStatic_dictText" />
<el-table-column label="报名状态"> <!-- <el-table-column label="报名状态">-->
<template #default="{ row }"> <!-- <template #default="{ row }">-->
{{ formatstatus(row.workStatus) }} <!-- {{ formatstatus(row.workStatus) }}-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="作品名称" prop="fileName" /> <el-table-column label="作品名称" prop="fileName" />
<el-table-column label="作品文件" prop="fileName"> <el-table-column label="作品文件" prop="fileName">
<template #default="{ row }"> <template #default="{ row }">
@ -37,28 +37,29 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上传作品"> <!-- <el-table-column label="上传作品">-->
<template #default="{ row }"> <!-- <template #default="{ row }">-->
<el-button <!-- <el-button-->
link <!-- link-->
:type="row.enrollStatic == '2' ? 'primary': 'warning' " <!-- :type="row.enrollStatic == '2' ? 'primary': 'warning' "-->
size="small" <!-- size="small"-->
@click="uploadZp(row.annualCompid, row.enrollStatic)" <!-- @click="uploadZp(row.annualCompid, row.enrollStatic)"-->
v-if="row.uploadWorkFlag != 'yes'" <!-- v-if="row.uploadWorkFlag != 'yes'"-->
> <!-- >-->
{{row.enrollStatic == '2' ? '上传作品' : '未审核'}} <!-- {{row.enrollStatic == '2' ? '上传作品' : '未审核'}}-->
</el-button> <!-- </el-button>-->
<el-tag v-else>已上传作品</el-tag> <!-- <el-tag v-else>已上传作品</el-tag>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="操作" prop="fileName"> <el-table-column label="操作" prop="fileName">
<template #default="{ row }"> <template #default="{ row }">
<div class="action-buttons">
<el-button <el-button
link link
type="primary" type="primary"
size="small" size="small"
@click="saveEvent(row.enrollCode)" @click="saveEvent(row.enrollCode)"
v-if="row.workStatus == '4' || row.enrollStatic == '3'" v-if="row.enrollStatic == '0' || row.enrollStatic == '3'"
> >
提交 提交
</el-button> </el-button>
@ -67,7 +68,7 @@
type="primary" type="primary"
size="small" size="small"
@click="editEvent(row.id,row.annualCompid,row.enrollCode,row.entryFormat)" @click="editEvent(row.id,row.annualCompid,row.enrollCode,row.entryFormat)"
v-if="row.enrollStatic == '1' || row.enrollStatic == '3'" v-if="row.enrollStatic == '0' || row.enrollStatic == '3'"
> >
编辑 编辑
</el-button> </el-button>
@ -89,6 +90,7 @@
> >
取消 取消
</el-button> </el-button>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -173,7 +175,7 @@ const dialogVisible = ref(false)
const annualCompid = ref('') const annualCompid = ref('')
const uploadZp = (id: any, staus: any) => { const uploadZp = (id: any, staus: any) => {
if (staus != 2) return ElMessage.warning('审核后方可上传作品') if (staus != 2) return ElMessage.warning('审核后方可上传作品')
console.log(id) //console.log(id)
annualCompid.value = id annualCompid.value = id
dialogVisible.value = true dialogVisible.value = true
} }
@ -212,7 +214,7 @@ const download = async (url:any,name:any) => {
const a = document.createElement('a') const a = document.createElement('a')
a.style.display = 'none' a.style.display = 'none'
document.body.appendChild(a) document.body.appendChild(a)
a.href = import.meta.env.VITE_APP_BASE_API + '/sys/common/zuopin/' + url a.href = import.meta.env.VITE_APP_BASE_API + '/sys/common' + url
a.setAttribute('download', name); a.setAttribute('download', name);
a.click() a.click()
document.body.removeChild(a) document.body.removeChild(a)
@ -322,6 +324,11 @@ const cancelEvent = async (id: any) => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.action-buttons {
display: flex;
justify-content: space-between; /* 平均分布间距 */
align-items: center;
}
.container { .container {
margin-top: 25px; margin-top: 25px;
.page { .page {
@ -333,4 +340,8 @@ const cancelEvent = async (id: any) => {
:deep(.el-table__row) { :deep(.el-table__row) {
height: 50px; height: 50px;
} }
:deep(.el-button){
margin-left: 0px !important;
}
</style> </style>

Loading…
Cancel
Save