Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
377de966
提交
377de966
authored
9月 23, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
2da7580c
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
69 行增加
和
9 行删除
+69
-9
ScoringExpertsDialog.vue
...s/admin/contest/items/components/ScoringExpertsDialog.vue
+7
-0
View.vue
src/modules/admin/contest/items/views/View.vue
+62
-9
没有找到文件。
src/modules/admin/contest/items/components/ScoringExpertsDialog.vue
浏览文件 @
377de966
...
...
@@ -7,6 +7,7 @@ import { getContestExpertList, updateContestExpert } from '../api'
import
{
useMapStore
}
from
'@/stores/map'
const
emit
=
defineEmits
<
{
(
e
:
'update'
):
void
(
e
:
'update:modelValue'
,
visible
:
boolean
):
void
}
>
()
...
...
@@ -73,8 +74,14 @@ function handleSubmit() {
const
experts
=
list
.
map
((
item
:
any
)
=>
{
return
{
id
:
item
.
id
,
expert_id
:
item
.
expert_id
,
role
:
item
.
info
.
role
}
})
const
expertsLeader
=
experts
.
filter
((
item
:
any
)
=>
item
.
role
===
'1'
)
if
(
expertsLeader
.
length
!==
1
)
{
ElMessage
.
error
(
'必须有且只有一个专家组长'
)
return
}
updateContestExpert
({
id
:
detail
.
id
,
experts
}).
then
(()
=>
{
ElMessage
.
success
(
'保存成功'
)
emit
(
'update'
)
emit
(
'update:modelValue'
,
false
)
})
}
...
...
src/modules/admin/contest/items/views/View.vue
浏览文件 @
377de966
<
script
setup
lang=
"ts"
>
import
type
{
ContestItem
}
from
'../types'
import
{
getContest
}
from
'../api'
import
{
ElMessage
}
from
'element-plus'
import
{
getContest
,
getContestRules
,
getContestExpertList
}
from
'../api'
import
{
useMapStore
}
from
'@/stores/map'
import
dayjs
from
'dayjs'
...
...
@@ -41,12 +42,50 @@ const statusText = $computed(() => {
return
status
.
find
(
item
=>
item
.
value
==
detail
?.
status
)?.
label
})
// 获取赛项信息
function
fetchInfo
()
{
getContest
({
id
:
props
.
id
}).
then
(
res
=>
{
detail
=
res
.
data
.
detail
})
}
onMounted
(
fetchInfo
)
// 获取赛项规则
let
ruleInfo
=
$ref
<
any
>
()
function
fetchRule
()
{
getContestRules
({
competition_id
:
props
.
id
}).
then
(
res
=>
{
ruleInfo
=
res
.
data
.
detail
})
}
// 获取评分专家
let
experts
=
$ref
<
any
>
([])
// 专家组长
const
expertLeaders
=
$computed
(()
=>
{
return
experts
.
filter
((
item
:
any
)
=>
{
return
item
.
info
.
role
===
'1'
})
})
const
expertLeadersText
=
$computed
(()
=>
{
return
expertLeaders
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
'、'
)
})
// 普通专家
const
expertMembers
=
$computed
(()
=>
{
return
experts
.
filter
((
item
:
any
)
=>
{
return
item
.
info
.
role
===
'2'
})
})
const
expertMembersText
=
$computed
(()
=>
{
return
expertMembers
.
map
((
item
:
any
)
=>
item
.
name
).
join
(
'、'
)
})
function
fetchExperts
()
{
getContestExpertList
({
id
:
props
.
id
}).
then
(
res
=>
{
experts
=
res
.
data
.
detail
})
}
onMounted
(()
=>
{
fetchInfo
()
fetchRule
()
fetchExperts
()
})
function
formatDate
(
timestamp
:
number
):
string
{
return
dayjs
(
timestamp
*
1000
).
format
(
'YYYY-MM-DD'
)
...
...
@@ -58,11 +97,19 @@ function formatTime(timestamp: number): string {
// 评分规则
const
scoringRulesVisible
=
$ref
(
false
)
// 评分专家
cons
t
scoringExpertsVisible
=
$ref
(
false
)
le
t
scoringExpertsVisible
=
$ref
(
false
)
// 参赛选手
const
contestantVisible
=
$ref
(
false
)
// 评分细则
const
scoringRulesBookVisible
=
$ref
(
false
)
function
handleExperts
()
{
if
(
!
ruleInfo
)
{
ElMessage
.
error
(
'请先维护评分规则'
)
return
}
scoringExpertsVisible
=
true
}
</
script
>
<
template
>
...
...
@@ -71,9 +118,7 @@ const scoringRulesBookVisible = $ref(false)
<el-button
type=
"primary"
@
click=
"scoringRulesVisible = true"
v-permission=
"'competition-rule'"
>
评分规则
</el-button
>
<el-button
type=
"primary"
@
click=
"scoringExpertsVisible = true"
v-permission=
"'competition-bind-experts'"
>
评分专家
</el-button
>
<el-button
type=
"primary"
@
click=
"handleExperts"
v-permission=
"'competition-bind-experts'"
>
评分专家
</el-button>
<el-button
type=
"primary"
@
click=
"contestantVisible = true"
v-permission=
"'competition-competitor-list'"
>
参赛选手
</el-button
>
...
...
@@ -86,7 +131,7 @@ const scoringRulesBookVisible = $ref(false)
<p>
赛项封面:
</p>
<img
:src=
"detail.cover"
/>
</div>
<el-descriptions
class=
"descriptions-box"
:column=
"2"
>
<el-descriptions
:column=
"2"
>
<el-descriptions-item
label=
"赛项名称:"
>
{{ detail.name }}
</el-descriptions-item>
<el-descriptions-item
label=
"赛项类型:"
>
{{ typeText }}
</el-descriptions-item>
<el-descriptions-item
label=
"主办单位:"
>
{{ detail.host_unit.label }}
</el-descriptions-item>
...
...
@@ -101,6 +146,8 @@ const scoringRulesBookVisible = $ref(false)
<el-descriptions-item
label=
"正式比赛时间:"
>
{{ formatTime(detail.start_at) }} ~ {{ formatTime(detail.end_at) }}
</el-descriptions-item
>
<el-descriptions-item
label=
"专家组长:"
>
{{ expertLeadersText }}
</el-descriptions-item>
<el-descriptions-item
label=
"专家:"
>
{{ expertMembersText }}
</el-descriptions-item>
</el-descriptions>
</div>
</AppCard>
...
...
@@ -111,9 +158,15 @@ const scoringRulesBookVisible = $ref(false)
<ViewVideo
:id=
"id"
></ViewVideo>
</AppCard>
<!-- 评分规则 -->
<ScoringRulesDialog
v-model=
"scoringRulesVisible"
v-if=
"scoringRulesVisible && detail"
></ScoringRulesDialog>
<ScoringRulesDialog
v-model=
"scoringRulesVisible"
@
update=
"fetchRule"
v-if=
"scoringRulesVisible && detail"
></ScoringRulesDialog>
<!-- 评分专家 -->
<ScoringExpertsDialog
v-model=
"scoringExpertsVisible"
v-if=
"scoringExpertsVisible && detail"
></ScoringExpertsDialog>
<ScoringExpertsDialog
v-model=
"scoringExpertsVisible"
@
update=
"fetchExperts"
v-if=
"scoringExpertsVisible && detail"
></ScoringExpertsDialog>
<!-- 参赛选手 -->
<ContestantDialog
v-model=
"contestantVisible"
v-if=
"contestantVisible && detail"
></ContestantDialog>
<!-- 评分细则 -->
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论