提交 ac5e09be authored 作者: lhh's avatar lhh

11.27需求修改

上级 5cd99fb3
...@@ -21,7 +21,7 @@ watchEffect(() => { ...@@ -21,7 +21,7 @@ watchEffect(() => {
...item, ...item,
old_score: parseFloat(item.old_score), old_score: parseFloat(item.old_score),
ratio: parseFloat(item.ratio), ratio: parseFloat(item.ratio),
score: isNaN(parseFloat(item.score)) ? null : parseFloat(item.score) score: isNaN(parseFloat(item.score)) ? 'null' : parseFloat(item.score)
} }
}) })
}) })
...@@ -43,7 +43,9 @@ const score = $computed(() => { ...@@ -43,7 +43,9 @@ const score = $computed(() => {
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
const scores = tableList.map((item: any) => { const scores = tableList.map((item: any) => {
if (item.type === '2') { item.score = 0 } if (item.type === '2') {
item.score = 0
}
return { id: item.id, score: item.score } return { id: item.id, score: item.score }
}) })
const params = { id: detail.id, scores: JSON.stringify(scores) } const params = { id: detail.id, scores: JSON.stringify(scores) }
...@@ -75,7 +77,7 @@ const handleScoreRule = function () { ...@@ -75,7 +77,7 @@ const handleScoreRule = function () {
<el-form-item label="选手姓名">{{ detail.student_name }}</el-form-item> <el-form-item label="选手姓名">{{ detail.student_name }}</el-form-item>
<el-form-item label="选手ID">{{ detail.login_id }}</el-form-item> <el-form-item label="选手ID">{{ detail.login_id }}</el-form-item>
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<el-form-item label="报告"> <el-form-item label="报告" v-if="reportList.length">
<el-dropdown> <el-dropdown>
<el-button text> <el-button text>
查看报告<el-icon class="el-icon--right"><arrow-down /></el-icon> 查看报告<el-icon class="el-icon--right"><arrow-down /></el-icon>
...@@ -89,7 +91,7 @@ const handleScoreRule = function () { ...@@ -89,7 +91,7 @@ const handleScoreRule = function () {
</template> </template>
</el-dropdown> </el-dropdown>
</el-form-item> </el-form-item>
<el-button type="primary" @click="handleScoreRule">查看评分规则</el-button> <el-button type="primary" style="margin-bottom: 20px" @click="handleScoreRule">查看评分规则</el-button>
</div> </div>
</el-form> </el-form>
<el-table :data="tableList" :header-cell-style="{ background: '#ededed' }"> <el-table :data="tableList" :header-cell-style="{ background: '#ededed' }">
...@@ -100,6 +102,7 @@ const handleScoreRule = function () { ...@@ -100,6 +102,7 @@ const handleScoreRule = function () {
<el-table-column label="评分" prop="score" align="center"> <el-table-column label="评分" prop="score" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
:disabled="row.type === '2'"
:controls="false" :controls="false"
v-model="row.score" v-model="row.score"
step-strictly step-strictly
...@@ -107,10 +110,11 @@ const handleScoreRule = function () { ...@@ -107,10 +110,11 @@ const handleScoreRule = function () {
:min="0" :min="0"
:max="row.old_score" :max="row.old_score"
style="width: 100%" style="width: 100%"
placeholder="--"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center" v-if="false">
<template #default="{ row }"> <template #default="{ row }">
<el-button text type="primary" v-if="row.type === '2'"> <el-button text type="primary" v-if="row.type === '2'">
<a :href="`${qaURL}/exam/markingPaper?exam_id=${row.exam_id}&id_number=${detail.id_number}`" target="_blank" <a :href="`${qaURL}/exam/markingPaper?exam_id=${row.exam_id}&id_number=${detail.id_number}`" target="_blank"
......
...@@ -29,7 +29,7 @@ function scoreMethodText(value: string) { ...@@ -29,7 +29,7 @@ function scoreMethodText(value: string) {
</script> </script>
<template> <template>
<el-dialog title="同步1+X考试成绩" :close-on-click-modal="false"> <el-dialog title="同步1+同步线上考试成绩" :close-on-click-modal="false">
<el-form> <el-form>
<el-form-item label="赛项名称"> <el-form-item label="赛项名称">
<el-select v-model="form.competition" value-key="id"> <el-select v-model="form.competition" value-key="id">
......
...@@ -29,10 +29,10 @@ onMounted(() => { ...@@ -29,10 +29,10 @@ onMounted(() => {
fetchCompetition() fetchCompetition()
}) })
const platformKey = ref('career_data_analysis') const platformKey = ref('data_marketing')
const platformKeys = ref([ const platformKeys = ref([
{ platform_key: 'career_data_analysis', name: '商业数据分析实验' }, { platform_key: 'career_data_analysis', name: '商业数据分析实验' },
{ platform_key: 'data_marketing', name: '数据营销实操' }, { platform_key: 'data_marketing', name: '数据营销实操' }
]) ])
// async function fetchPlatformKeys(competition_id: string) { // async function fetchPlatformKeys(competition_id: string) {
// const res = await getPlatformKeys({ competition_id }) // const res = await getPlatformKeys({ competition_id })
...@@ -62,7 +62,7 @@ onUnmounted(() => { ...@@ -62,7 +62,7 @@ onUnmounted(() => {
const statistics = reactive({ const statistics = reactive({
competitor_count: 0, competitor_count: 0,
complete_answer_competitor_count: 0, complete_answer_competitor_count: 0,
starting_answer_competitor_count: 0, starting_answer_competitor_count: 0
}) })
async function fetchStatistics(competition_id: string, platform_key = 'career_data_analysis') { async function fetchStatistics(competition_id: string, platform_key = 'career_data_analysis') {
const res = await getCompetitionStatistics({ competition_id, platform_key }) const res = await getCompetitionStatistics({ competition_id, platform_key })
...@@ -97,8 +97,8 @@ const submittedListOptions = { ...@@ -97,8 +97,8 @@ const submittedListOptions = {
{ label: '所在专业', prop: 'student.specialty_name' }, { label: '所在专业', prop: 'student.specialty_name' },
{ label: '所在班级', prop: 'student.class_name' }, { label: '所在班级', prop: 'student.class_name' },
{ label: '提交时间', prop: 'commit_time' }, { label: '提交时间', prop: 'commit_time' },
{ label: '作答用时', prop: 'answer_time' }, { label: '作答用时', prop: 'answer_time' }
], ]
} }
const submittedLis = computed(() => { const submittedLis = computed(() => {
return competitorsTableData.value.filter((item: any) => item.commit_status == 3) return competitorsTableData.value.filter((item: any) => item.commit_status == 3)
...@@ -114,9 +114,9 @@ const answeringListOptions = { ...@@ -114,9 +114,9 @@ const answeringListOptions = {
{ label: '所在班级', prop: 'student.class_name' }, { label: '所在班级', prop: 'student.class_name' },
{ {
label: '作答用时', label: '作答用时',
prop: 'answer_time', prop: 'answer_time'
}, }
], ]
} }
const answeringList = computed(() => { const answeringList = computed(() => {
return competitorsTableData.value.filter((item: any) => item.commit_status == 2 || item.commit_status == 4) return competitorsTableData.value.filter((item: any) => item.commit_status == 2 || item.commit_status == 4)
...@@ -137,44 +137,44 @@ const listOptions = { ...@@ -137,44 +137,44 @@ const listOptions = {
prop: 'module_1', prop: 'module_1',
computed({ row }: { row: any }) { computed({ row }: { row: any }) {
return getModuleStatus(row, 0) return getModuleStatus(row, 0)
}, }
}, },
{ {
label: '模块二', label: '模块二',
prop: 'module_2', prop: 'module_2',
computed({ row }: { row: any }) { computed({ row }: { row: any }) {
return getModuleStatus(row, 1) return getModuleStatus(row, 1)
}, }
}, },
{ {
label: '模块三', label: '模块三',
prop: 'module_3', prop: 'module_3',
computed({ row }: { row: any }) { computed({ row }: { row: any }) {
return getModuleStatus(row, 2) return getModuleStatus(row, 2)
}, }
}, },
{ {
label: '模块四', label: '模块四',
prop: 'module_4', prop: 'module_4',
computed({ row }: { row: any }) { computed({ row }: { row: any }) {
return getModuleStatus(row, 3) return getModuleStatus(row, 3)
}, }
}, },
{ {
label: '模块五', label: '模块五',
prop: 'module_5', prop: 'module_5',
computed({ row }: { row: any }) { computed({ row }: { row: any }) {
return getModuleStatus(row, 4) return getModuleStatus(row, 4)
}, }
}, },
{ {
label: '模块六', label: '模块六',
prop: 'module_6', prop: 'module_6',
computed({ row }: { row: any }) { computed({ row }: { row: any }) {
return getModuleStatus(row, 5) return getModuleStatus(row, 5)
}, }
}, }
], ]
} }
function getModuleStatus(row: any, index: number) { function getModuleStatus(row: any, index: number) {
try { try {
...@@ -201,12 +201,13 @@ function getModuleStatus(row: any, index: number) { ...@@ -201,12 +201,13 @@ function getModuleStatus(row: any, index: number) {
<el-select v-model="currentCompetition" value-key="id" size="large" style="margin-right: 20px"> <el-select v-model="currentCompetition" value-key="id" size="large" style="margin-right: 20px">
<el-option v-for="item in competitionList" :key="item.id" :value="item" :label="item.name"></el-option> <el-option v-for="item in competitionList" :key="item.id" :value="item" :label="item.name"></el-option>
</el-select> </el-select>
<el-select v-model="platformKey" size="large"> <el-select v-model="platformKey" size="large" v-if="false">
<el-option <el-option
v-for="item in platformKeys" v-for="item in platformKeys"
:key="item.platform_key" :key="item.platform_key"
:value="item.platform_key" :value="item.platform_key"
:label="item.name"></el-option> :label="item.name"
></el-option>
</el-select> </el-select>
</el-row> </el-row>
<ul class="statistics"> <ul class="statistics">
......
...@@ -37,6 +37,7 @@ const listOptions = $computed(() => { ...@@ -37,6 +37,7 @@ const listOptions = $computed(() => {
columns: [ columns: [
{ label: '序号', type: 'index', width: 60 }, { label: '序号', type: 'index', width: 60 },
{ label: '专家姓名', prop: 'name' }, { label: '专家姓名', prop: 'name' },
{ label: '电话', prop: 'mobile' },
{ label: '所在单位', prop: 'company' }, { label: '所在单位', prop: 'company' },
{ {
label: '性别', label: '性别',
......
...@@ -20,6 +20,7 @@ const listOptions = { ...@@ -20,6 +20,7 @@ const listOptions = {
{ label: '序号', type: 'index', width: 60 }, { label: '序号', type: 'index', width: 60 },
{ label: '选手姓名', prop: 'student.name' }, { label: '选手姓名', prop: 'student.name' },
{ label: '参赛ID', prop: 'login_id' }, { label: '参赛ID', prop: 'login_id' },
{ label: '电话', prop: 'mobile' },
{ {
label: '性别', label: '性别',
prop: 'student.gender', prop: 'student.gender',
......
...@@ -43,6 +43,7 @@ const listOptions = $computed(() => { ...@@ -43,6 +43,7 @@ const listOptions = $computed(() => {
{ type: 'expand', slots: 'class' }, { type: 'expand', slots: 'class' },
{ label: '序号', type: 'index', width: 60 }, { label: '序号', type: 'index', width: 60 },
{ label: '专家姓名', prop: 'name' }, { label: '专家姓名', prop: 'name' },
{ label: '电话', prop: 'mobile' },
{ label: '所在单位', prop: 'company' }, { label: '所在单位', prop: 'company' },
{ {
label: '性别', label: '性别',
......
...@@ -11,7 +11,8 @@ export const routes: Array<RouteRecordRaw> = [ ...@@ -11,7 +11,8 @@ export const routes: Array<RouteRecordRaw> = [
component: AppLayout, component: AppLayout,
children: [ children: [
{ path: '', component: () => import('./views/Index.vue') }, { path: '', component: () => import('./views/Index.vue') },
{ path: ':id', component: () => import('./views/View.vue'), props: true } { path: ':id', component: () => import('./views/View.vue'), props: true },
{ path: 'edit/:id', component: () => import('./views/Edit.vue'), props: true }
] ]
} }
] ]
...@@ -34,7 +34,8 @@ export interface ContestItem { ...@@ -34,7 +34,8 @@ export interface ContestItem {
expert_count: number expert_count: number
train_platform_configs: any[] train_platform_configs: any[]
competition_platform_configs: any[] competition_platform_configs: any[]
is_switchable_theory_practice: string is_switchable_theory_practice: string,
is_customer_anti_cheat: string
} }
export interface ContestCreateParams { export interface ContestCreateParams {
......
<script setup lang="ts">
import type { ContestItem } from '../types'
// import { ElMessage } from 'element-plus'
import { getContest } from '../api'
const FormDialog = defineAsyncComponent(() => import('../components/FormDialog.vue'))
interface Props {
id: string
}
const props = defineProps<Props>()
let detail = $ref<ContestItem | null>(null)
provide('detail', $$(detail))
// 获取赛项信息
function fetchInfo() {
getContest({ id: props.id }).then(res => {
detail = res.data.detail
})
}
onMounted(() => {
if (props.id === '1') return
fetchInfo()
})
</script>
<template>
<AppCard title="编辑赛项">
<FormDialog :data="detail"></FormDialog>
</AppCard>
</template>
<style lang="scss">
.top {
display: flex;
.el-descriptions {
flex: 1;
margin-top: 30px;
}
}
.top-cover {
width: 300px;
margin-right: 20px;
p {
font-weight: normal;
line-height: 30px;
font-size: 14px;
}
img {
width: 100%;
}
}
</style>
...@@ -8,7 +8,7 @@ import { useMapStore } from '@/stores/map' ...@@ -8,7 +8,7 @@ import { useMapStore } from '@/stores/map'
// 赛项类型 // 赛项类型
const types = useMapStore().getMapValuesByKey('competition_type') const types = useMapStore().getMapValuesByKey('competition_type')
const FormDialog = defineAsyncComponent(() => import('../components/FormDialog.vue')) // const FormDialog = defineAsyncComponent(() => import('../components/FormDialog.vue'))
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = $ref<InstanceType<typeof AppList> | null>(null)
...@@ -50,31 +50,34 @@ const listOptions = { ...@@ -50,31 +50,34 @@ const listOptions = {
] ]
} }
let dialogVisible = $ref(false) // let dialogVisible = $ref(false)
const rowData = ref<ContestItem | undefined | null>(null) // const rowData = ref<ContestItem | undefined | null>(null)
// 新增 // 新增
function handleAdd() { // function handleAdd() {
rowData.value = null // rowData.value = null
dialogVisible = true // dialogVisible = true
} // }
// 编辑 // // 编辑
function handleUpdate(row: ContestItem) { // function handleUpdate(row: ContestItem) {
rowData.value = row // rowData.value = row
dialogVisible = true // dialogVisible = true
} // }
function onUpdateSuccess() { // function onUpdateSuccess() {
appList?.refetch() // appList?.refetch()
} // }
</script> </script>
<template> <template>
<AppCard title="赛项管理"> <AppCard title="赛项管理">
<AppList v-bind="listOptions" ref="appList"> <AppList v-bind="listOptions" ref="appList">
<template #header-buttons> <template #header-buttons>
<el-button type="primary" :icon="CirclePlus" v-permission="'competition-create'" @click="handleAdd"> <!-- <el-button type="primary" :icon="CirclePlus" v-permission="'competition-create'" @click="handleAdd">
新增赛项 新增赛项
</el-button> -->
<el-button type="primary" :icon="CirclePlus" round v-permission="'competition-create'">
<router-link :to="`/admin/contest/items/edit/1`" target="_blank">新增赛项</router-link>
</el-button> </el-button>
</template> </template>
...@@ -82,9 +85,14 @@ function onUpdateSuccess() { ...@@ -82,9 +85,14 @@ function onUpdateSuccess() {
<el-button type="primary" round v-permission="'competition-detail'"> <el-button type="primary" round v-permission="'competition-detail'">
<router-link :to="`/admin/contest/items/${row.id}`" target="_blank">查看</router-link> <router-link :to="`/admin/contest/items/${row.id}`" target="_blank">查看</router-link>
</el-button> </el-button>
<el-button type="primary" round @click="handleUpdate(row)" v-permission="'competition-edit'">编辑</el-button> <el-button type="primary" round v-permission="'competition-detail'">
<router-link :to="`/admin/contest/items/edit/${row.id}`" target="_blank" v-permission="'competition-edit'"
>编辑</router-link
>
</el-button>
<!-- <el-button type="primary" round @click="handleUpdate(row)" v-permission="'competition-edit'">编辑</el-button> -->
</template> </template>
</AppList> </AppList>
</AppCard> </AppCard>
<FormDialog v-model="dialogVisible" :data="rowData" @update="onUpdateSuccess" v-if="dialogVisible"></FormDialog> <!-- <FormDialog v-model="dialogVisible" :data="rowData" @update="onUpdateSuccess" v-if="dialogVisible"></FormDialog> -->
</template> </template>
...@@ -161,16 +161,16 @@ function handleExperts() { ...@@ -161,16 +161,16 @@ function handleExperts() {
<AppCard title="训练指导书"> <AppCard title="训练指导书">
<ViewBook :id="id"></ViewBook> <ViewBook :id="id"></ViewBook>
</AppCard> </AppCard>
<AppCard title="操作视频"> <AppCard title="训练操作视频">
<ViewVideo :id="id"></ViewVideo> <ViewVideo :id="id"></ViewVideo>
</AppCard> </AppCard>
<AppCard title="大赛试题"> <AppCard title="比赛实操赛题">
<ViewQuestion :id="id"></ViewQuestion> <ViewQuestion :id="id"></ViewQuestion>
</AppCard> </AppCard>
<AppCard title="大赛试卷"> <AppCard title="比赛实操试卷">
<ViewExam :id="id"></ViewExam> <ViewExam :id="id"></ViewExam>
</AppCard> </AppCard>
<AppCard title="关联实验"> <AppCard title="关联营销实验">
<ViewExperiment :id="detail?.id || ''" :pid="id"></ViewExperiment> <ViewExperiment :id="detail?.id || ''" :pid="id"></ViewExperiment>
</AppCard> </AppCard>
<AppCard title="抽签加密"> <AppCard title="抽签加密">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论