Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
2fa8d884
提交
2fa8d884
authored
3月 20, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 新增理论考试在实验详情
上级
7ade14e2
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
183 行增加
和
7 行删除
+183
-7
api.ts
src/modules/admin/lab/experiment/api.ts
+19
-7
ViewExam.vue
src/modules/admin/lab/experiment/components/ViewExam.vue
+79
-0
ViewExamFormDialog.vue
...es/admin/lab/experiment/components/ViewExamFormDialog.vue
+81
-0
View.vue
src/modules/admin/lab/experiment/views/View.vue
+4
-0
没有找到文件。
src/modules/admin/lab/experiment/api.ts
浏览文件 @
2fa8d884
...
@@ -86,11 +86,7 @@ export function getExperimentReportRule(params: { experiment_id: string }) {
...
@@ -86,11 +86,7 @@ export function getExperimentReportRule(params: { experiment_id: string }) {
return
httpRequest
.
get
(
'/api/resource/v1/backend/experiment-report/detail'
,
{
params
})
return
httpRequest
.
get
(
'/api/resource/v1/backend/experiment-report/detail'
,
{
params
})
}
}
// 更新实验报告规则
// 更新实验报告规则
export
function
updateExperimentReportRule
(
data
:
{
export
function
updateExperimentReportRule
(
data
:
{
experiment_id
:
string
;
report_upload_way
:
number
;
detail_list
:
string
})
{
experiment_id
:
string
report_upload_way
:
number
detail_list
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/backend/experiment-report/save'
,
data
)
return
httpRequest
.
post
(
'/api/resource/v1/backend/experiment-report/save'
,
data
)
}
}
...
@@ -153,4 +149,21 @@ export function getQuestionTags(params: { experiment_id: string }) {
...
@@ -153,4 +149,21 @@ export function getQuestionTags(params: { experiment_id: string }) {
// 获取群组
// 获取群组
export
function
getQuestionGroup
(
params
:
{
experiment_id
:
string
})
{
export
function
getQuestionGroup
(
params
:
{
experiment_id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/experiment-question/groups'
,
{
params
})
return
httpRequest
.
get
(
'/api/resource/v1/backend/experiment-question/groups'
,
{
params
})
}
}
\ No newline at end of file
// 获取实验下的所有理论考试
export
function
getAllExamList
(
params
:
{
project
:
string
;
q
?:
string
;
name
?:
string
;
page
?:
number
;
'per-page'
?:
number
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/exam/search-all-exam'
,
{
params
})
}
// 获取实验的理论考试列表
export
function
getExamList
(
params
:
{
experiment_id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/experiment/exam-list'
,
{
params
})
}
// 更新实验的理论考试
export
function
updateExam
(
data
:
{
experiment_id
:
string
;
exam_id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/backend/experiment/exam-save'
,
data
)
}
// 删除实验的理论考试
export
function
deleteExam
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/backend/experiment/exam-delete'
,
data
)
}
src/modules/admin/lab/experiment/components/ViewExam.vue
0 → 100644
浏览文件 @
2fa8d884
<
script
setup
lang=
"ts"
>
import
{
CirclePlus
}
from
'@element-plus/icons-vue'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
AppList
from
'@/components/base/AppList.vue'
import
{
getExamList
,
deleteExam
}
from
'../api'
const
FormDialog
=
defineAsyncComponent
(()
=>
import
(
'./ViewExamFormDialog.vue'
))
interface
Props
{
id
:
string
}
const
props
=
defineProps
<
Props
>
()
const
appList
=
$ref
<
InstanceType
<
typeof
AppList
>
|
null
>
(
null
)
// 列表配置
const
listOptions
=
{
hasPagination
:
false
,
remote
:
{
httpRequest
:
getExamList
,
params
:
{
experiment_id
:
props
.
id
},
callback
(
res
:
any
)
{
return
res
?.
list
?
{
list
:
res
.
list
}
:
{
list
:
[]
}
}
},
columns
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'考试名称'
,
prop
:
'exam_info.name'
},
{
label
:
'创建人'
,
prop
:
'created_operator_name'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
},
{
label
:
'更新时间'
,
prop
:
'updated_time'
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
120
}
]
}
let
dialogVisible
=
$ref
(
false
)
const
rowData
=
ref
<
any
>
()
// 新增
function
handleAdd
()
{
rowData
.
value
=
undefined
dialogVisible
=
true
}
// 编辑
function
handleUpdate
(
row
:
any
)
{
rowData
.
value
=
row
dialogVisible
=
true
}
// 查阅
// function handleView(row: any) {
// const [paper] = row.exam_info.paper_list
// if (!paper) return
// const qaURL = `${import.meta.env.VITE_QA_CENTER_URL}/paper/detail/${paper.paper_id}`
// window.open(qaURL)
// }
// 删除
function
handleRemove
(
row
:
any
)
{
ElMessageBox
.
confirm
(
'确定要删除吗?'
,
'提示'
).
then
(()
=>
{
deleteExam
({
id
:
row
.
id
}).
then
(()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
onUpdateSuccess
()
})
})
}
function
onUpdateSuccess
()
{
appList
?.
refetch
()
}
</
script
>
<
template
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-buttons
>
<el-button
type=
"primary"
:icon=
"CirclePlus"
@
click=
"handleAdd"
v-permission=
"'competition-book-create'"
>
新增
</el-button>
</
template
>
<
template
#
table-x=
"{ row }"
>
<el-button
link
round
type=
"primary"
@
click=
"handleUpdate(row)"
v-permission=
"'competition-book-update'"
>
编辑
</el-button>
<el-button
link
round
type=
"danger"
@
click=
"handleRemove(row)"
v-permission=
"'competition-book-delete'"
>
删除
</el-button>
</
template
>
</AppList>
<FormDialog
v-model=
"dialogVisible"
:id=
"id"
:data=
"rowData"
@
update=
"onUpdateSuccess"
v-if=
"dialogVisible"
></FormDialog>
</template>
src/modules/admin/lab/experiment/components/ViewExamFormDialog.vue
0 → 100644
浏览文件 @
2fa8d884
<
script
setup
lang=
"ts"
>
import
type
{
FormInstance
,
FormRules
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
import
{
pick
}
from
'lodash-es'
import
{
updateExam
,
getAllExamList
}
from
'../api'
interface
Props
{
id
:
string
data
?:
any
}
const
props
=
defineProps
<
Props
>
()
const
emit
=
defineEmits
<
{
(
e
:
'update'
):
void
(
e
:
'update:modelValue'
,
visible
:
boolean
):
void
}
>
()
const
formRef
=
ref
<
FormInstance
>
()
const
form
=
reactive
<
any
>
({
experiment_id
:
props
.
id
,
exam_id
:
''
})
watchEffect
(()
=>
{
if
(
!
props
.
data
)
return
Object
.
assign
(
form
,
props
.
data
)
})
const
rules
=
ref
<
FormRules
>
({
exam_id
:
[{
required
:
true
,
message
:
'请选择考试'
,
trigger
:
'change'
}]
})
const
isUpdate
=
$computed
(()
=>
{
return
!!
props
.
data
?.
id
})
const
title
=
computed
(()
=>
{
return
isUpdate
?
'编辑理论考试'
:
'新增理论考试'
})
const
examList
=
ref
<
Record
<
string
,
any
>
[]
>
([])
// 获取关联考试列表
function
fetchExamList
()
{
getAllExamList
({
project
:
'x1'
,
'per-page'
:
1000
}).
then
(
res
=>
{
examList
.
value
=
res
.
data
.
list
||
[]
})
}
onMounted
(()
=>
{
fetchExamList
()
})
// 提交
function
handleSubmit
()
{
formRef
.
value
?.
validate
().
then
(()
=>
{
const
params
=
Object
.
assign
({},
pick
(
form
,
[
'experiment_id'
,
'exam_id'
]))
isUpdate
?
handleUpdate
(
params
)
:
handleUpdate
(
params
)
})
}
// 修改
function
handleUpdate
(
params
:
any
)
{
params
.
id
=
props
.
data
?.
id
updateExam
(
params
).
then
(()
=>
{
ElMessage
({
message
:
'修改成功'
,
type
:
'success'
})
emit
(
'update'
)
emit
(
'update:modelValue'
,
false
)
})
}
</
script
>
<
template
>
<el-dialog
:title=
"title"
:close-on-click-modal=
"false"
width=
"600px"
@
update:modelValue=
"value => $emit('update:modelValue', value)"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
label-width=
"90px"
>
<el-form-item
label=
"考试名称"
prop=
"exam_id"
>
<el-select
v-model=
"form.exam_id"
filterable
style=
"width: 100%"
>
<el-option
v-for=
"item in examList"
:key=
"item.exam_id"
:label=
"item.name"
:value=
"item.exam_id"
></el-option>
</el-select>
</el-form-item>
<el-row
justify=
"center"
>
<el-button
type=
"primary"
round
auto-insert-space
@
click=
"handleSubmit"
>
保存
</el-button>
<el-button
round
auto-insert-space
@
click=
"$emit('update:modelValue', false)"
>
取消
</el-button>
</el-row>
</el-form>
</el-dialog>
</
template
>
src/modules/admin/lab/experiment/views/View.vue
浏览文件 @
2fa8d884
...
@@ -13,6 +13,7 @@ const StudentGroupDialog = defineAsyncComponent(() => import('../components/Stud
...
@@ -13,6 +13,7 @@ const StudentGroupDialog = defineAsyncComponent(() => import('../components/Stud
const
StudentListDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/StudentListDialog.vue'
))
const
StudentListDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/StudentListDialog.vue'
))
const
ViewGradeRules
=
defineAsyncComponent
(()
=>
import
(
'../components/ViewGradeRules.vue'
))
const
ViewGradeRules
=
defineAsyncComponent
(()
=>
import
(
'../components/ViewGradeRules.vue'
))
const
ViewReportRules
=
defineAsyncComponent
(()
=>
import
(
'../components/ViewReportRules.vue'
))
const
ViewReportRules
=
defineAsyncComponent
(()
=>
import
(
'../components/ViewReportRules.vue'
))
const
ViewExam
=
defineAsyncComponent
(()
=>
import
(
'../components/ViewExam.vue'
))
interface
Props
{
interface
Props
{
id
:
string
id
:
string
...
@@ -122,6 +123,9 @@ const dmlURL = computed(() => {
...
@@ -122,6 +123,9 @@ const dmlURL = computed(() => {
</
template
>
</
template
>
</AppList>
</AppList>
</AppCard>
</AppCard>
<AppCard
title=
"理论考试"
>
<ViewExam
:id=
"id"
></ViewExam>
</AppCard>
<!-- 关联班级 -->
<!-- 关联班级 -->
<SelectClassDialog
v-model=
"selectClassVisible"
@
update=
"handleRefetch"
v-if=
"selectClassVisible"
></SelectClassDialog>
<SelectClassDialog
v-model=
"selectClassVisible"
@
update=
"handleRefetch"
v-if=
"selectClassVisible"
></SelectClassDialog>
<!-- 学生分组 -->
<!-- 学生分组 -->
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论