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: '团队' | '个人'
id: string
instructorSheetList?: any[]
teamManagementList?: any[]
teamManagementList?: any[],
file:string
WorkName:any
}
interface MembersOrAdviser {

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

@ -25,11 +25,7 @@
<div class="annual">{{ ndbs.annualid }}年度</div>
<div class="title-box">
<div class="text">{{ ndbs.name }}</div>
<img
style="width: 35px"
src="../../assets/images/编组.png"
alt=""
/>
<img style="width: 35px" src="../../assets/images/编组.png" alt="" />
</div>
</div>
<div class="right">
@ -76,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>
@ -93,23 +83,21 @@
<el-input v-model="ruleForm.entryFormat" type="text" disabled />
</el-form-item>
<el-form-item label="选择题目" prop="topicid">
<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-form-item label="选择题目">
<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-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">
@ -179,16 +167,39 @@
<el-button class="btn" @click="() => router.back()">
{{ isDisable ? '返回' : isEdit ? '取消修改' : '取消报名' }}
</el-button>
<el-button
class="btn cyan"
:loading="subLoading"
@click="submit"
v-if="!isDisable"
>
<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">作品只允许上传一个</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>
@ -199,7 +210,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()
@ -224,21 +235,80 @@ const upData = ref<Parameters<typeof getSignUpApi>[0]>({
id: route.query.edit ? route.query.annualCompid : route.query.id,
instructorSheetList: [],
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 ndbsXm = ref<any>({})
const subLoading = ref(false)
async function submit() {
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: '',
@ -248,8 +318,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',
@ -274,6 +344,9 @@ const ruleForm = reactive<any>({
id: route.query.id,
topicid: '',
objName: route.query.objName,
// requireUploadWorks: ndbsXm.requireUploadWorks,
raceName: WorkName.value,
fileUrl: fileUrl.value
})
const options = ref([])
if (route.query.edit) {
@ -289,7 +362,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,
@ -392,7 +466,7 @@ getTopicListApi()
margin: 0 auto;
width: 1397px;
& > * {
&>* {
background: #ffffff;
}
@ -462,7 +536,8 @@ getTopicListApi()
line-height: 39px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3; /* 限制显示的行数 */
-webkit-line-clamp: 3;
/* 限制显示的行数 */
overflow: hidden;
text-overflow: ellipsis;
}
@ -472,6 +547,7 @@ getTopicListApi()
.right {
.info-box {
width: 210px;
.name {
height: 20px;
font-family:
@ -665,6 +741,11 @@ getTopicListApi()
--color1: #00d0d0;
--color2: #42d9ac;
}
&.temp {
// --color1: #b9e63f;
--color2: #FFA500;
}
}
}
}

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

Loading…
Cancel
Save