提交 123f756e authored 作者: lhh's avatar lhh

update

上级 7195f4c3
...@@ -34,6 +34,10 @@ let resizeKey = $ref(0) ...@@ -34,6 +34,10 @@ let resizeKey = $ref(0)
function handleResize() { function handleResize() {
resizeKey = Date.now() resizeKey = Date.now()
} }
const goPage = function (url: string) {
window.open(url)
}
</script> </script>
<template> <template>
...@@ -62,6 +66,11 @@ function handleResize() { ...@@ -62,6 +66,11 @@ function handleResize() {
</p> </p>
</div> </div>
<div> <div>
<template v-for="item in detail.competition_platform_configs">
<el-button type="primary" :key="item.id" v-if="item.is_show === '1'" @click="goPage(item.url)">{{
item.name
}}</el-button>
</template>
<el-button type="primary" @click="dialogVisible = true" v-permission="'v1-expert-check-set-score'" <el-button type="primary" @click="dialogVisible = true" v-permission="'v1-expert-check-set-score'"
>评分</el-button >评分</el-button
> >
...@@ -120,11 +129,12 @@ function handleResize() { ...@@ -120,11 +129,12 @@ function handleResize() {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap;
span { span {
color: var(--main-color); color: var(--main-color);
} }
p + p { p {
margin-left: 40px; margin-right: 40px;
} }
} }
</style> </style>
...@@ -54,7 +54,17 @@ const form = reactive({ ...@@ -54,7 +54,17 @@ const form = reactive({
competition_uri: '', competition_uri: '',
dateRange: undefined, dateRange: undefined,
date: undefined, date: undefined,
datetimeRange: undefined datetimeRange: undefined,
train_platform_configs: [
{ name: '1+X理论考试', is_show: '1', type: '1', url: '', platform_key: 'x_exam' },
{ name: '商业数据分析实验', is_show: '0', type: '2', url: '', platform_key: 'career_data_analysis' },
{ name: '数据营销实操', is_show: '0', type: '2', url: '', platform_key: 'data_marketing' }
],
competition_platform_configs: [
{ name: '1+X理论考试', is_show: '1', type: '1', url: '', platform_key: 'x_exam' },
{ name: '商业数据分析实验', is_show: '0', type: '2', url: '', platform_key: 'career_data_analysis' },
{ name: '数据营销实操', is_show: '0', type: '2', url: '', platform_key: 'data_marketing' }
]
}) })
watchEffect(() => { watchEffect(() => {
if (!props.data) return if (!props.data) return
...@@ -108,11 +118,13 @@ const rules = ref<FormRules>({ ...@@ -108,11 +118,13 @@ const rules = ref<FormRules>({
message: '请选择赛项周期内的日期,且必须早于正式比赛日期' message: '请选择赛项周期内的日期,且必须早于正式比赛日期'
} }
], ],
train_platform_uri: [{ required: true, message: '请输入训练平台地址' }], // train_platform_uri: [{ required: true, message: '请输入训练平台地址' }],
competition_uri: [{ required: true, message: '请输入正式比赛地址' }], // competition_uri: [{ required: true, message: '请输入正式比赛地址' }],
status: [{ required: true, message: '请选择有效状态' }], status: [{ required: true, message: '请选择有效状态' }],
logo: [{ required: true, message: '请上传赛项LOGO' }], logo: [{ required: true, message: '请上传赛项LOGO' }],
cover: [{ required: true, message: '请上传赛项封面' }] cover: [{ required: true, message: '请上传赛项封面' }],
train_platform_configs: [{ required: true, message: '请完善信息' }],
competition_platform_configs: [{ required: true, message: '请完善信息' }]
}) })
const isUpdate = $computed(() => { const isUpdate = $computed(() => {
return !!form.id return !!form.id
...@@ -158,15 +170,18 @@ function handleSubmit() { ...@@ -158,15 +170,18 @@ function handleSubmit() {
'status', 'status',
'logo', 'logo',
'cover', 'cover',
'train_platform_uri', // 'train_platform_uri',
'competition_uri', // 'competition_uri',
'teacher_ids' 'teacher_ids',
'train_platform_configs',
'competition_platform_configs'
]) ])
isUpdate ? handleUpdate(params) : handleCreate(params) isUpdate ? handleUpdate(params) : handleCreate(params)
}) })
} }
// 新增 // 新增
function handleCreate(params: ContestCreateParams) { function handleCreate(params: ContestCreateParams) {
// console.log(params, 'aaa')
createContest(params).then(() => { createContest(params).then(() => {
ElMessage({ message: '创建成功', type: 'success' }) ElMessage({ message: '创建成功', type: 'success' })
emit('update') emit('update')
...@@ -197,7 +212,8 @@ function handleDateRangeChange(value: any) { ...@@ -197,7 +212,8 @@ function handleDateRangeChange(value: any) {
:close-on-click-modal="false" :close-on-click-modal="false"
align-center align-center
width="600px" width="600px"
@update:modelValue="$emit('update:modelValue')"> @update:modelValue="$emit('update:modelValue')"
>
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px"> <el-form ref="formRef" :model="form" :rules="rules" label-width="110px">
<el-form-item label="赛项名称" prop="name"> <el-form-item label="赛项名称" prop="name">
<el-input v-model="form.name" :disabled="isUpdate" /> <el-input v-model="form.name" :disabled="isUpdate" />
...@@ -218,7 +234,8 @@ function handleDateRangeChange(value: any) { ...@@ -218,7 +234,8 @@ function handleDateRangeChange(value: any) {
v-for="item in technicalSupportUnitList" v-for="item in technicalSupportUnitList"
:key="item.id" :key="item.id"
:label="item.label" :label="item.label"
:value="item.id"></el-option> :value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="赛项类型" prop="type"> <el-form-item label="赛项类型" prop="type">
...@@ -237,7 +254,8 @@ function handleDateRangeChange(value: any) { ...@@ -237,7 +254,8 @@ function handleDateRangeChange(value: any) {
range-separator="至" range-separator="至"
v-model="form.dateRange" v-model="form.dateRange"
style="width: 100%" style="width: 100%"
@change="handleDateRangeChange" /> @change="handleDateRangeChange"
/>
</el-form-item> </el-form-item>
<el-form-item label="正式比赛日期" prop="date"> <el-form-item label="正式比赛日期" prop="date">
<el-date-picker type="date" v-model="form.date" style="width: 100%" /> <el-date-picker type="date" v-model="form.date" style="width: 100%" />
...@@ -249,16 +267,41 @@ function handleDateRangeChange(value: any) { ...@@ -249,16 +267,41 @@ function handleDateRangeChange(value: any) {
start-placeholder="开始时间" start-placeholder="开始时间"
end-placeholder="结束时间" end-placeholder="结束时间"
v-model="form.datetimeRange" v-model="form.datetimeRange"
style="width: 100%" /> style="width: 100%"
/>
</el-form-item> </el-form-item>
<el-form-item label="报名截止日期" prop="apply_expiration_date"> <el-form-item label="报名截止日期" prop="apply_expiration_date">
<el-date-picker type="date" v-model="form.apply_expiration_date" style="width: 100%" /> <el-date-picker type="date" v-model="form.apply_expiration_date" style="width: 100%" />
</el-form-item> </el-form-item>
<el-form-item label="训练平台地址" prop="train_platform_uri"> <el-form-item label="训练平台地址" prop="train_platform_configs">
<el-input v-model="form.train_platform_uri" /> <el-checkbox
true-label="1"
false-label="0"
style="margin-bottom: 10px"
v-model="item.is_show"
v-for="item in form.train_platform_configs"
:key="item.platform_key"
>
<div style="display: flex; align-items: center">
<span style="margin-right: 10px; width: 180px">{{ item.name }}</span>
<el-input v-model="item.url" />
</div>
</el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="正式比赛地址" prop="competition_uri"> <el-form-item label="正式比赛地址" prop="competition_platform_configs">
<el-input v-model="form.competition_uri" /> <el-checkbox
true-label="1"
false-label="0"
style="margin-bottom: 10px"
v-model="item.is_show"
v-for="item in form.competition_platform_configs"
:key="item.platform_key"
>
<div style="display: flex; align-items: center">
<span style="margin-right: 10px; width: 180px">{{ item.name }}</span>
<el-input v-model="item.url" />
</div>
</el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="有效状态" prop="status"> <el-form-item label="有效状态" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
......
...@@ -30,6 +30,8 @@ export interface ContestItem { ...@@ -30,6 +30,8 @@ export interface ContestItem {
organizers: SystemDictionary[] organizers: SystemDictionary[]
apply_count: number apply_count: number
expert_count: number expert_count: number
train_platform_configs: any[]
competition_platform_configs: any[]
} }
export interface ContestCreateParams { export interface ContestCreateParams {
...@@ -46,9 +48,11 @@ export interface ContestCreateParams { ...@@ -46,9 +48,11 @@ export interface ContestCreateParams {
status: string status: string
logo: string logo: string
cover: string cover: string
train_platform_uri: string // train_platform_uri: string
competition_uri: string // competition_uri: string
teacher_ids: string[] teacher_ids: string[]
train_platform_configs: any[]
competition_platform_configs: any[]
} }
export type ContestUpdateParams = ContestCreateParams & { id: string } export type ContestUpdateParams = ContestCreateParams & { id: string }
......
...@@ -76,3 +76,8 @@ export function uploadExperimentPicture(data: { competition_id: string; pictures ...@@ -76,3 +76,8 @@ export function uploadExperimentPicture(data: { competition_id: string; pictures
export function updateTrainCount(data: { competition_id: string }) { export function updateTrainCount(data: { competition_id: string }) {
return httpRequest.post('/api/lab/v1/student/competition/train-count', data) return httpRequest.post('/api/lab/v1/student/competition/train-count', data)
} }
// 成绩查询
export function getScoreReport(params: { competition_id: string }) {
return httpRequest.get('/api/lab/v1/student/competition/score-report', { params })
}
...@@ -22,10 +22,11 @@ const typeText = $computed(() => { ...@@ -22,10 +22,11 @@ const typeText = $computed(() => {
const canTrain = $computed(() => { const canTrain = $computed(() => {
return dayjs().isBefore(dayjs(parseInt(props.data.end_at) * 1000)) return dayjs().isBefore(dayjs(parseInt(props.data.end_at) * 1000))
}) })
function handleTrain() { function handleTrain(url: string) {
window.open(url)
// 训练计数 // 训练计数
updateTrainCount({ competition_id: props.data.id }) // updateTrainCount({ competition_id: props.data.id })
router.push({ path: `/student/contest/lab/${props.data.id}` }) // router.push({ path: `/student/contest/lab/${props.data.id}` })
} }
// 是否可以报名 // 是否可以报名
const canJoin = $computed(() => { const canJoin = $computed(() => {
...@@ -56,7 +57,21 @@ function formatDate(value: string) { ...@@ -56,7 +57,21 @@ function formatDate(value: string) {
<li>赛项周期:{{ formatDate(data.start_range) }}{{ formatDate(data.end_range) }}</li> <li>赛项周期:{{ formatDate(data.start_range) }}{{ formatDate(data.end_range) }}</li>
<li>正式比赛日期:{{ formatDate(data.start_at) }}</li> <li>正式比赛日期:{{ formatDate(data.start_at) }}</li>
</ul> </ul>
<el-button round type="primary" @click="handleTrain" v-if="canTrain">我要训练</el-button> <!-- {{ data.train_platform_configs }} -->
<!-- <el-button v-if="data.train_platform_configs" round type="primary" @click="handleTrain" v-if="canTrain">我要训练</el-button> -->
<div style="display: flex; flex-wrap: wrap">
<template v-for="item in data.train_platform_configs">
<el-button
v-if="item.is_show === '1'"
style="margin-bottom: 10px"
:key="item"
round
type="primary"
@click="handleTrain(item.url)"
>{{ item.name }}</el-button
>
</template>
</div>
</template> </template>
<template v-else> <template v-else>
<ul class="info-list"> <ul class="info-list">
......
...@@ -21,6 +21,7 @@ export interface Contest { ...@@ -21,6 +21,7 @@ export interface Contest {
train_platform_uri: string train_platform_uri: string
type: string type: string
mode: string mode: string
train_platform_configs: any[]
} }
export type ContestJoinParams = { export type ContestJoinParams = {
......
<script setup lang="ts"></script> <script setup lang="ts">
import { getScoreReport, getMyContestList } from '../api'
let eventValue = $ref('')
let eventOption: any = $ref([])
onMounted(() => {
getMyContestList().then((res: any) => {
eventOption = res.data.list
eventValue = eventOption[0].id
scoreReport()
})
})
let scoreInfo: any = $ref()
const scoreReport = function () {
getScoreReport({ competition_id: eventValue }).then((res: any) => {
scoreInfo = res.data
})
}
const selectChange = function () {
scoreReport()
}
</script>
<template> <template>
<iframe <AppCard>
src="https://bi.ezijing.com/bi//?proc=1&action=viewer&hback=true&isInPreview=true&db=!7d2b!!8346!!6559!!80b2!e-SaaS!2f!!53c2!!8d5b!!9009!!624b!!6210!!7ee9!!660e!!7ec6!.db&platform=PC&browserType=chrome" <h1>2023年全国大学生商业数据分析与应用大赛成绩查询结果</h1>
frameborder="0" <div style="display: flex; align-items: center; padding-top: 30px">
class="iframe"></iframe> <span style="margin-right: 10px">赛项</span>
<el-select v-model="eventValue" placeholder="请选择" @change="selectChange">
<el-option v-for="item in eventOption" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</div>
<h3>考生基础信息</h3>
<el-table :data="scoreInfo?.id ? [scoreInfo] : []" stripe :header-cell-style="{ background: '#ededed' }">
<el-table-column prop="student.name" label="选手姓名" />
<el-table-column prop="id" label="参赛ID" />
<el-table-column label="性别">
<template #default="props">
{{ props.row?.student.gender === '1' ? '男' : '女' }}
</template>
</el-table-column>
<el-table-column prop="org.name" label="学校" />
<el-table-column prop="specialty.name" label="所在专业" />
<el-table-column prop="grade" label="所在年级" />
<el-table-column prop="class.name" label="所在班级" />
</el-table>
<h3>考生成绩</h3>
<!-- columns: [
{ label: '评分规则', type: 'name' },
{ label: '评分方法', prop: 'type' },
{ label: '分值', prop: 'old_score' },
{ label: '占比(%)', prop: 'ratio' },
{ label: '实际得分', prop: 'score' }
] -->
<el-table :data="scoreInfo?.score_detail" stripe :header-cell-style="{ background: '#ededed' }">
<el-table-column prop="name" label="评分规则" />
<el-table-column label="评分方法">
<template #default="props">
{{ props.row?.type === '1' ? '专家评分' : props.row.type === '2' ? '1+x考试' : '线下考试' }}
</template>
</el-table-column>
<el-table-column prop="old_score" label="分值" />
<el-table-column prop="ratio" label="占比(%)" />
<el-table-column prop="score" label="实际得分" />
</el-table>
</AppCard>
</template> </template>
<style scoped> <style scoped>
.iframe { h1 {
width: 100%; font-weight: 500;
height: 100%; font-size: 28px;
color: rgb(171, 42, 65);
line-height: 40px;
text-align: center;
}
h3 {
padding-top: 40px;
line-height: 30px;
} }
</style> </style>
...@@ -26,6 +26,16 @@ export default defineConfig(({ mode }) => ({ ...@@ -26,6 +26,16 @@ export default defineConfig(({ mode }) => ({
cert: fs.readFileSync(path.join(__dirname, './https/ezijing.com.pem')) cert: fs.readFileSync(path.join(__dirname, './https/ezijing.com.pem'))
}, },
proxy: { proxy: {
'/api/resource': {
target: 'http://com-resource-admin-test.ezijing.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/resource/, '')
},
'/api/lab': {
target: 'http://com-resource-api-test.ezijing.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/lab/, '')
},
'/api': 'https://saas-lab.ezijing.com' '/api': 'https://saas-lab.ezijing.com'
} }
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论