Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
06f0cb6a
提交
06f0cb6a
authored
11月 19, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
赛项配置需求修改
上级
1ffc22ab
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
67 行增加
和
14 行删除
+67
-14
FormDialog.vue
src/modules/admin/contest/items/components/FormDialog.vue
+63
-13
types.ts
src/modules/admin/contest/items/types.ts
+3
-0
Index.vue
src/modules/admin/lab/experiment/views/Index.vue
+1
-1
没有找到文件。
src/modules/admin/contest/items/components/FormDialog.vue
浏览文件 @
06f0cb6a
...
@@ -58,6 +58,8 @@ const form = reactive({
...
@@ -58,6 +58,8 @@ const form = reactive({
dateRange
:
undefined
,
dateRange
:
undefined
,
date
:
undefined
,
date
:
undefined
,
datetimeRange
:
undefined
,
datetimeRange
:
undefined
,
datetimeRange2
:
undefined
,
is_switchable_theory_practice
:
0
,
train_platform_configs
:
[
train_platform_configs
:
[
{
name
:
appConfig
.
xTrainLabel
||
'1+X理论考试'
,
is_show
:
'1'
,
type
:
'1'
,
url
:
''
,
platform_key
:
'x_exam'
},
{
name
:
appConfig
.
xTrainLabel
||
'1+X理论考试'
,
is_show
:
'1'
,
type
:
'1'
,
url
:
''
,
platform_key
:
'x_exam'
},
{
{
...
@@ -75,8 +77,8 @@ const form = reactive({
...
@@ -75,8 +77,8 @@ const form = reactive({
is_show
:
'1'
,
is_show
:
'1'
,
type
:
'1'
,
type
:
'1'
,
url
:
''
,
url
:
''
,
platform_key
:
'x_exam
'
,
exam_id
:
'
'
,
exam_id
:
'
'
platform_key
:
'x_exam
'
},
},
// {
// {
// name: appConfig.labExamLabel || '商业数据分析实验',
// name: appConfig.labExamLabel || '商业数据分析实验',
...
@@ -97,6 +99,11 @@ watchEffect(() => {
...
@@ -97,6 +99,11 @@ watchEffect(() => {
const
dateRange
=
[
new
Date
(
props
.
data
.
start_range
*
1000
),
new
Date
(
props
.
data
.
end_range
*
1000
)]
const
dateRange
=
[
new
Date
(
props
.
data
.
start_range
*
1000
),
new
Date
(
props
.
data
.
end_range
*
1000
)]
const
date
=
new
Date
(
props
.
data
.
start_at
*
1000
)
const
date
=
new
Date
(
props
.
data
.
start_at
*
1000
)
const
datetimeRange
=
[
new
Date
(
props
.
data
.
start_at
*
1000
),
new
Date
(
props
.
data
.
end_at
*
1000
)]
const
datetimeRange
=
[
new
Date
(
props
.
data
.
start_at
*
1000
),
new
Date
(
props
.
data
.
end_at
*
1000
)]
const
datetimeRange2
=
[
new
Date
(
props
.
data
.
operational_start_time
*
1000
),
new
Date
(
props
.
data
.
operational_end_time
*
1000
)
]
const
is_switchable_theory_practice
=
parseInt
(
props
.
data
.
is_switchable_theory_practice
)
const
apply_expiration_date
=
props
.
data
.
apply_expiration_date
*
1000
const
apply_expiration_date
=
props
.
data
.
apply_expiration_date
*
1000
Object
.
assign
(
form
,
props
.
data
,
{
Object
.
assign
(
form
,
props
.
data
,
{
host_unit_id
,
host_unit_id
,
...
@@ -106,7 +113,9 @@ watchEffect(() => {
...
@@ -106,7 +113,9 @@ watchEffect(() => {
dateRange
,
dateRange
,
date
,
date
,
datetimeRange
,
datetimeRange
,
apply_expiration_date
datetimeRange2
,
apply_expiration_date
,
is_switchable_theory_practice
})
})
})
})
const
checkApplyExpirationDate
=
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
const
checkApplyExpirationDate
=
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
...
@@ -134,10 +143,18 @@ const checkTrainPlatformConfigs = (rule: any, value: any, callback: any) => {
...
@@ -134,10 +143,18 @@ const checkTrainPlatformConfigs = (rule: any, value: any, callback: any) => {
}
else
{
}
else
{
form
.
train_platform_configs
.
forEach
((
item
:
any
)
=>
{
form
.
train_platform_configs
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
is_show
===
'1'
)
{
if
(
item
.
is_show
===
'1'
)
{
if
(
item
.
url
===
''
)
{
if
(
item
.
type
===
'1'
)
{
callback
(
new
Error
(
`请填写
${
item
.
name
}
的链接`
))
if
(
item
.
exam_id
===
''
)
{
callback
(
new
Error
(
`请选择
${
item
.
name
}
`
))
}
else
{
callback
()
}
}
else
{
}
else
{
callback
()
if
(
item
.
url
===
''
)
{
callback
(
new
Error
(
`请填写
${
item
.
name
}
的链接`
))
}
else
{
callback
()
}
}
}
}
}
})
})
...
@@ -154,10 +171,18 @@ const checkCompetitionPlatformConfigs = (rule: any, value: any, callback: any) =
...
@@ -154,10 +171,18 @@ const checkCompetitionPlatformConfigs = (rule: any, value: any, callback: any) =
}
else
{
}
else
{
form
.
competition_platform_configs
.
forEach
((
item
:
any
)
=>
{
form
.
competition_platform_configs
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
is_show
===
'1'
)
{
if
(
item
.
is_show
===
'1'
)
{
if
(
item
.
url
===
''
)
{
if
(
item
.
type
===
'1'
)
{
callback
(
new
Error
(
`请填写
${
item
.
name
}
的链接`
))
if
(
item
.
exam_id
===
''
)
{
callback
(
new
Error
(
`请选择
${
item
.
name
}
`
))
}
else
{
callback
()
}
}
else
{
}
else
{
callback
()
if
(
item
.
url
===
''
)
{
callback
(
new
Error
(
`请填写
${
item
.
name
}
的链接`
))
}
else
{
callback
()
}
}
}
}
}
})
})
...
@@ -172,7 +197,8 @@ const rules = ref<FormRules>({
...
@@ -172,7 +197,8 @@ const rules = ref<FormRules>({
teacher_ids
:
[{
type
:
'array'
,
required
:
true
,
message
:
'请选择指导教师'
,
trigger
:
'change'
}],
teacher_ids
:
[{
type
:
'array'
,
required
:
true
,
message
:
'请选择指导教师'
,
trigger
:
'change'
}],
dateRange
:
[{
type
:
'array'
,
required
:
true
,
message
:
'请选择赛项周期'
,
trigger
:
'change'
}],
dateRange
:
[{
type
:
'array'
,
required
:
true
,
message
:
'请选择赛项周期'
,
trigger
:
'change'
}],
date
:
[{
required
:
true
,
message
:
'请选择正式比赛日期'
,
trigger
:
'change'
}],
date
:
[{
required
:
true
,
message
:
'请选择正式比赛日期'
,
trigger
:
'change'
}],
datetimeRange
:
[{
type
:
'array'
,
required
:
true
,
message
:
'请选择正式比赛时间'
,
trigger
:
'change'
}],
datetimeRange
:
[{
type
:
'array'
,
required
:
true
,
message
:
'正式比赛理论答题时间'
,
trigger
:
'change'
}],
datetimeRange2
:
[{
type
:
'array'
,
required
:
true
,
message
:
'正式比赛实操答题时间'
,
trigger
:
'change'
}],
apply_expiration_date
:
[
apply_expiration_date
:
[
{
required
:
true
,
message
:
'请选择报名截止日期'
},
{
required
:
true
,
message
:
'请选择报名截止日期'
},
{
{
...
@@ -183,6 +209,7 @@ const rules = ref<FormRules>({
...
@@ -183,6 +209,7 @@ const rules = ref<FormRules>({
// 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
:
'请选择有效状态'
}],
is_switchable_theory_practice
:
[{
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
:
''
},
{
validator
:
checkTrainPlatformConfigs
}],
train_platform_configs
:
[{
required
:
true
,
message
:
''
},
{
validator
:
checkTrainPlatformConfigs
}],
...
@@ -208,6 +235,7 @@ function handleSubmit() {
...
@@ -208,6 +235,7 @@ function handleSubmit() {
formRef
?.
validate
().
then
(()
=>
{
formRef
?.
validate
().
then
(()
=>
{
const
[
firstDate
,
secondDate
]
=
form
.
dateRange
||
[]
const
[
firstDate
,
secondDate
]
=
form
.
dateRange
||
[]
const
[
firstDatetime
,
secondDatetime
]
=
form
.
datetimeRange
||
[]
const
[
firstDatetime
,
secondDatetime
]
=
form
.
datetimeRange
||
[]
const
[
firstDatetime2
,
secondDatetime2
]
=
form
.
datetimeRange2
||
[]
const
year
=
dayjs
(
form
.
date
).
year
()
const
year
=
dayjs
(
form
.
date
).
year
()
const
month
=
dayjs
(
form
.
date
).
month
()
const
month
=
dayjs
(
form
.
date
).
month
()
const
date
=
dayjs
(
form
.
date
).
date
()
const
date
=
dayjs
(
form
.
date
).
date
()
...
@@ -219,22 +247,27 @@ function handleSubmit() {
...
@@ -219,22 +247,27 @@ function handleSubmit() {
end_range
:
dayjs
(
secondDate
).
endOf
(
'date'
).
unix
(),
end_range
:
dayjs
(
secondDate
).
endOf
(
'date'
).
unix
(),
start_at
:
dayjs
(
firstDatetime
).
year
(
year
).
month
(
month
).
date
(
date
).
unix
(),
start_at
:
dayjs
(
firstDatetime
).
year
(
year
).
month
(
month
).
date
(
date
).
unix
(),
end_at
:
dayjs
(
secondDatetime
).
year
(
year
).
month
(
month
).
date
(
date
).
unix
(),
end_at
:
dayjs
(
secondDatetime
).
year
(
year
).
month
(
month
).
date
(
date
).
unix
(),
operational_start_time
:
dayjs
(
firstDatetime2
).
year
(
year
).
month
(
month
).
date
(
date
).
unix
(),
operational_end_time
:
dayjs
(
secondDatetime2
).
year
(
year
).
month
(
month
).
date
(
date
).
unix
(),
apply_expiration_date
:
dayjs
(
form
.
apply_expiration_date
).
endOf
(
'date'
).
unix
()
apply_expiration_date
:
dayjs
(
form
.
apply_expiration_date
).
endOf
(
'date'
).
unix
()
}
}
// 判断正式比赛理论答题时间和选择的考试
// 判断正式比赛理论答题时间和选择的考试
const
findExam
=
examList
.
find
(
item
=>
item
.
exam_id
===
form
.
competition_platform_configs
[
0
].
exam_id
)
const
findExam
=
examList
.
find
(
item
=>
item
.
exam_id
===
form
.
competition_platform_configs
[
0
].
exam_id
)
const
examStartTime
=
new
Date
(
findExam
?.
start_time
||
''
).
getTime
()
const
examStartTime
=
new
Date
(
findExam
?.
start_time
||
''
).
getTime
()
const
examEndTime
=
new
Date
(
findExam
?.
start_time
||
''
).
getTime
()
const
examEndTime
=
new
Date
(
findExam
?.
end_time
||
''
).
getTime
()
console
.
log
(
containsNumber
(
examStartTime
,
mergedForm
.
start_at
),
containsNumber
(
examEndTime
,
mergedForm
.
end_at
))
if
(
if
(
containsNumber
(
examStartTime
,
mergedForm
.
start_at
)
!==
true
||
containsNumber
(
examStartTime
,
mergedForm
.
start_at
)
!==
true
||
containsNumber
(
examEndTime
,
mergedForm
.
start
_at
)
!==
true
containsNumber
(
examEndTime
,
mergedForm
.
end
_at
)
!==
true
)
{
)
{
ElMessage
({
message
:
`正式比赛理论答题时间与
${
findExam
?.
name
}
的考试时间不符
`, type: 'warning' })
ElMessage
({
message
:
`正式比赛理论答题时间与
${
findExam
?.
name
}
的考试时间不符
`, type: 'warning' })
return false
return false
}
}
const params: ContestUpdateParams = pick(mergedForm, [
const params: ContestUpdateParams = pick(mergedForm, [
'operational_start_time',
'operational_end_time',
'id',
'id',
'name',
'name',
'client_id',
'client_id',
...
@@ -254,7 +287,8 @@ function handleSubmit() {
...
@@ -254,7 +287,8 @@ function handleSubmit() {
// 'competition_uri',
// 'competition_uri',
'teacher_ids',
'teacher_ids',
'train_platform_configs',
'train_platform_configs',
'competition_platform_configs'
'competition_platform_configs',
'is_switchable_theory_practice'
])
])
console.log(isUpdate, 'isUpdate')
console.log(isUpdate, 'isUpdate')
isUpdate ? handleUpdate(params) : handleCreate(params)
isUpdate ? handleUpdate(params) : handleCreate(params)
...
@@ -373,6 +407,16 @@ onMounted(() => {
...
@@ -373,6 +407,16 @@ onMounted(() => {
style=
"width: 100%"
style=
"width: 100%"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"正式比赛实操答题时间"
prop=
"datetimeRange2"
>
<el-time-picker
is-range
range-separator=
"至"
start-placeholder=
"开始时间"
end-placeholder=
"结束时间"
v-model=
"form.datetimeRange2"
style=
"width: 100%"
/>
</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>
...
@@ -416,6 +460,12 @@ onMounted(() => {
...
@@ -416,6 +460,12 @@ onMounted(() => {
</div>
</div>
</el-checkbox>
</el-checkbox>
</el-form-item>
</el-form-item>
<el-form-item
label=
"是否允许客户端切换"
prop=
"is_switchable_theory_practice"
>
<el-radio-group
v-model=
"form.is_switchable_theory_practice"
>
<el-radio
:label=
"0"
>
否
</el-radio>
<el-radio
:label=
"1"
>
是
</el-radio>
</el-radio-group>
</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"
>
<el-radio
v-for=
"item in status"
:key=
"item.id"
:label=
"item.value"
>
{{
item
.
label
}}
</el-radio>
<el-radio
v-for=
"item in status"
:key=
"item.id"
:label=
"item.value"
>
{{
item
.
label
}}
</el-radio>
...
...
src/modules/admin/contest/items/types.ts
浏览文件 @
06f0cb6a
...
@@ -13,6 +13,8 @@ export interface ContestItem {
...
@@ -13,6 +13,8 @@ export interface ContestItem {
end_range
:
number
end_range
:
number
start_at
:
number
start_at
:
number
end_at
:
number
end_at
:
number
operational_start_time
:
number
operational_end_time
:
number
apply_expiration_date
:
number
apply_expiration_date
:
number
status
:
string
status
:
string
logo
:
string
logo
:
string
...
@@ -32,6 +34,7 @@ export interface ContestItem {
...
@@ -32,6 +34,7 @@ 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
}
}
export
interface
ContestCreateParams
{
export
interface
ContestCreateParams
{
...
...
src/modules/admin/lab/experiment/views/Index.vue
浏览文件 @
06f0cb6a
...
@@ -165,7 +165,7 @@ async function handleDelete(row: ExperimentItem) {
...
@@ -165,7 +165,7 @@ async function handleDelete(row: ExperimentItem) {
<el-button
type=
"primary"
round
:icon=
"Delete"
@
click=
"handleDelete(row)"
>
删除
</el-button>
<el-button
type=
"primary"
round
:icon=
"Delete"
@
click=
"handleDelete(row)"
>
删除
</el-button>
<!-- 功能按钮移入详情里 s v-if="false" -->
<!-- 功能按钮移入详情里 s v-if="false" -->
<el-dropdown
style=
"margin-left: 12px"
>
<el-dropdown
style=
"margin-left: 12px"
v-if=
"false"
>
<el-button
type=
"primary"
round
:icon=
"MoreFilled"
></el-button>
<el-button
type=
"primary"
round
:icon=
"MoreFilled"
></el-button>
<template
#
dropdown
>
<template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-menu>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论