Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
ffd34d6b
提交
ffd34d6b
authored
5月 21, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改1+x实训需求
上级
1b996464
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
137 行增加
和
32 行删除
+137
-32
DragPanel.vue
src/components/DragPanel.vue
+7
-3
FormDialog.vue
src/modules/admin/lab/experiment/components/FormDialog.vue
+49
-6
types.ts
src/modules/admin/lab/experiment/types.ts
+1
-0
types.ts
src/modules/student/lab/types.ts
+1
-0
Index.vue
src/modules/student/lab/views/Index.vue
+79
-23
没有找到文件。
src/components/DragPanel.vue
浏览文件 @
ffd34d6b
...
...
@@ -5,6 +5,8 @@ const emit = defineEmits<{
(
e
:
'resize'
):
void
}
>
()
const
props
=
defineProps
<
{
isLeftShow
?:
number
}
>
()
const
leftPanelVisible
=
$ref
<
boolean
>
(
true
)
const
leftPanelWidth
=
useStorage
(
'leftPanelWidth'
,
400
)
const
leftPanelWidthText
=
$computed
(()
=>
{
...
...
@@ -40,7 +42,7 @@ onMounted(() => {
<
template
>
<section
class=
"drag-panel"
>
<div
class=
"drag-panel-left"
:class=
"
{ 'is-hidden': !leftPanelVisible }">
<div
v-show=
"isLeftShow !== 1"
class=
"drag-panel-left"
:class=
"
{ 'is-hidden': !leftPanelVisible }">
<div
class=
"drag-cover"
v-if=
"dragFlag"
></div>
<slot
name=
"left"
></slot>
<div
class=
"panel-resize"
id=
"panel-resize"
></div>
...
...
@@ -50,12 +52,14 @@ onMounted(() => {
<path
class=
"path-wapper"
d=
"M0 0l14.12 8.825A4 4 0 0116 12.217v61.566a4 4 0 01-1.88 3.392L0 86V0z"
fill=
"#e1e4eb"
></path>
fill=
"#e1e4eb"
></path>
<path
class=
"path-arrow"
d=
"M10.758 48.766a.778.778 0 000-1.127L6.996 43l3.762-4.639a.778.778 0 000-1.127.85.85 0 00-1.172 0l-4.344 5.202a.78.78 0 000 1.128l4.344 5.202a.85.85 0 001.172 0z"
fill=
"#8D9EA7"
fill-rule=
"nonzero"
></path>
fill-rule=
"nonzero"
></path>
</g>
</svg>
</div>
...
...
src/modules/admin/lab/experiment/components/FormDialog.vue
浏览文件 @
ffd34d6b
...
...
@@ -8,6 +8,8 @@ import { useGetProjectList } from '@/composables/useGetProjectList'
import
{
useGetCourseList
}
from
'../composables/useGetCourseList'
import
{
useGetTeacherList
}
from
'../composables/useGetTeacherList'
import
{
useMapStore
}
from
'@/stores/map'
import
{
useAppConfig
}
from
'@/composables/useAppConfig'
const
appConfig
=
useAppConfig
()
interface
Props
{
data
?:
ExperimentItem
|
null
...
...
@@ -41,7 +43,8 @@ const form = reactive<ExperimentCreateItem>({
purpose
:
''
,
requirements
:
''
,
content
:
''
,
procedure
:
''
procedure
:
''
,
exam_status
:
'0'
})
watchEffect
(()
=>
{
if
(
!
props
.
data
)
return
...
...
@@ -111,7 +114,12 @@ function handleUpdate(params: ExperimentCreateItem) {
</
script
>
<
template
>
<el-dialog
:title=
"title"
:close-on-click-modal=
"false"
width=
"600px"
@
update:modelValue=
"value => $emit('update:modelValue', value)"
>
<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=
"145px"
>
<el-form-item
label=
"实验所属部门/学校"
prop=
"organ_id"
>
<el-select
v-model=
"form.organ_id"
style=
"width: 100%"
:disabled=
"isUpdate"
@
change=
"handleOrgChange"
>
...
...
@@ -142,17 +150,52 @@ function handleUpdate(params: ExperimentCreateItem) {
<el-form-item
label=
"实验总成绩"
prop=
"score"
>
<el-input-number
v-model=
"form.score"
:min=
"1"
:max=
"150"
step-strictly
style=
"width: 100%"
/>
</el-form-item>
<el-form-item
label=
"是否有理论考试"
v-if=
"appConfig.system === 'x'"
>
<el-radio-group
v-model=
"form.exam_status"
>
<el-radio
label=
"0"
>
否
</el-radio>
<el-radio
label=
"1"
>
是
</el-radio>
</el-radio-group>
<!--
<el-input-number
v-model=
"form.score"
:min=
"1"
:max=
"150"
step-strictly
style=
"width: 100%"
/>
-->
</el-form-item>
<el-form-item
label=
"实验目的"
prop=
"purpose"
>
<el-input
v-model=
"form.purpose"
:autosize=
"
{ minRows: 4 }" type="textarea" maxlength="200" show-word-limit placeholder="请输入实验目的" />
<el-input
v-model=
"form.purpose"
:autosize=
"
{ minRows: 4 }"
type="textarea"
maxlength="200"
show-word-limit
placeholder="请输入实验目的"
/>
</el-form-item>
<el-form-item
label=
"实验要求"
prop=
"requirements"
>
<el-input
v-model=
"form.requirements"
:autosize=
"
{ minRows: 4 }" type="textarea" maxlength="200" show-word-limit placeholder="请输入实验要求" />
<el-input
v-model=
"form.requirements"
:autosize=
"
{ minRows: 4 }"
type="textarea"
maxlength="200"
show-word-limit
placeholder="请输入实验要求"
/>
</el-form-item>
<el-form-item
label=
"实验内容及原理"
prop=
"content"
>
<el-input
v-model=
"form.content"
:autosize=
"
{ minRows: 4 }" type="textarea" maxlength="200" show-word-limit placeholder="请输入实验内容及原理" />
<el-input
v-model=
"form.content"
:autosize=
"
{ minRows: 4 }"
type="textarea"
maxlength="200"
show-word-limit
placeholder="请输入实验内容及原理"
/>
</el-form-item>
<el-form-item
label=
"实验步骤及过程"
prop=
"procedure"
>
<el-input
v-model=
"form.procedure"
:autosize=
"
{ minRows: 4 }" type="textarea" maxlength="200" show-word-limit placeholder="请输入实验步骤及过程" />
<el-input
v-model=
"form.procedure"
:autosize=
"
{ minRows: 4 }"
type="textarea"
maxlength="200"
show-word-limit
placeholder="请输入实验步骤及过程"
/>
</el-form-item>
<el-form-item
label=
"有效状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
...
...
src/modules/admin/lab/experiment/types.ts
浏览文件 @
ffd34d6b
...
...
@@ -48,6 +48,7 @@ export interface ExperimentCreateItem {
requirements
:
string
content
:
string
procedure
:
string
exam_status
:
string
}
export
interface
ClassItem
{
...
...
src/modules/student/lab/types.ts
浏览文件 @
ffd34d6b
...
...
@@ -140,6 +140,7 @@ export interface ExperimentInfo {
student
:
ExperimentStudent
is_commit_report
:
boolean
is_commit
:
boolean
exam_status
:
number
}
interface
IdName
{
...
...
src/modules/student/lab/views/Index.vue
浏览文件 @
ffd34d6b
...
...
@@ -99,18 +99,21 @@ const examURL = ref('')
// 右侧
const
cookies
=
useCookies
([
'TGC'
])
const
LAB_URL
=
computed
(()
=>
{
const
LAB_URL
:
any
=
computed
(()
=>
{
if
(
tabActive
.
value
===
'exam'
&&
examURL
.
value
)
return
examURL
.
value
return
experimentInfo
?.
type
===
4
?
`
${
appConfig
.
dmlURL
||
import
.
meta
.
env
.
VITE_DML_URL
}
/trip/my?experiment_id=
${
form
.
experiment_id
}
`
:
`
${
appConfig
.
dmlURL
||
import
.
meta
.
env
.
VITE_LAB_URL
}
&token=
${
cookies
.
get
(
'TGC'
)}
`
})
let
iframeKey
=
$ref
(
Date
.
now
())
// 返回首页
function
handleBackHome
()
{
ElMessageBox
.
confirm
(
'此操作将会强制返回到实验室首页,您当前的操作内容有可能丢失,确定返回首页吗?'
,
'提示'
).
then
(()
=>
{
iframeKey
=
Date
.
now
()
})
ElMessageBox
.
confirm
(
'此操作将会强制返回到实验室首页,您当前的操作内容有可能丢失,确定返回首页吗?'
,
'提示'
).
then
(
()
=>
{
iframeKey
=
Date
.
now
()
}
)
}
const
reportDialogVisible
=
$ref
(
false
)
...
...
@@ -167,12 +170,14 @@ function uploadPicture(url: string) {
}
// 提交实验
function
handleSubmit
()
{
ElMessageBox
.
confirm
(
'此操作将会提交该实验,状态会变为已提交,您将不能再操作该实验,确定提交实验吗?'
,
'提示'
).
then
(()
=>
{
submitExperimentRecord
({
experiment_id
:
form
.
experiment_id
}).
then
(()
=>
{
ElMessage
({
message
:
'提交成功'
,
type
:
'success'
})
fetchExperimentRecord
()
})
})
ElMessageBox
.
confirm
(
'此操作将会提交该实验,状态会变为已提交,您将不能再操作该实验,确定提交实验吗?'
,
'提示'
).
then
(
()
=>
{
submitExperimentRecord
({
experiment_id
:
form
.
experiment_id
}).
then
(()
=>
{
ElMessage
({
message
:
'提交成功'
,
type
:
'success'
})
fetchExperimentRecord
()
})
}
)
}
let
resizeKey
=
$ref
(
0
)
function
handleResize
()
{
...
...
@@ -223,7 +228,7 @@ function handleReportPreviewReady() {
</
script
>
<
template
>
<DragPanel
@
resize=
"handleResize"
>
<DragPanel
@
resize=
"handleResize"
:isLeftShow=
"experimentInfo?.exam_status"
>
<template
#
left
>
<div
class=
"lab-left"
>
<el-form
:model=
"form"
label-suffix=
":"
hide-required-asterisk
>
...
...
@@ -267,30 +272,67 @@ function handleReportPreviewReady() {
</div>
</
template
>
<
template
#
right
>
<AppCard>
<div
class=
"exam-status"
v-if=
"experimentInfo?.exam_status === 1"
>
<el-button
type=
"primary"
@
click=
"tabActive = 'qa'"
>
实操系统
</el-button>
<el-button
type=
"primary"
@
click=
"tabActive = 'exam'"
>
理论试题
</el-button>
</div>
<AppCard
v-else
>
<el-row
justify=
"space-between"
>
<div>
<el-button
type=
"primary"
:icon=
"HomeFilled"
:disabled=
"submitted"
@
click=
"handleBackHome"
>
返回首页
</el-button>
<el-button
type=
"primary"
:icon=
"HomeFilled"
:disabled=
"submitted"
@
click=
"handleBackHome"
>
返回首页
</el-button
>
<el-button
type=
"primary"
:disabled=
"disabled"
@
click=
"handleSubmit"
>
提交实验
</el-button>
</div>
<div>
<el-button
type=
"primary"
:disabled=
"disabled"
:loading=
"screenshotLoading"
@
click=
"handleCapture"
>
截图
</el-button>
<el-button
type=
"primary"
:disabled=
"disabled"
:loading=
"screenshotLoading"
@
click=
"handleCapture"
>
截图
</el-button
>
<el-button
type=
"primary"
:disabled=
"disabled"
@
click=
"prepareDialogVisible = true"
>
实验准备
</el-button>
<el-button
type=
"primary"
:disabled=
"disabled"
@
click=
"resultDialogVisible = true"
>
实验结果
</el-button>
<el-button
type=
"primary"
:disabled=
"disabled"
v-if=
"experimentInfo?.report_upload_way === 2 && !experimentInfo?.is_commit_report"
>
<el-button
type=
"primary"
:disabled=
"disabled"
v-if=
"experimentInfo?.report_upload_way === 2 && !experimentInfo?.is_commit_report"
>
<router-link
:to=
"`/student/lab/report/$
{form.experiment_id}`" target="_blank">在线实验报告
</router-link>
</el-button>
<el-button
type=
"primary"
:disabled=
"disabled"
@
click=
"reportDialogVisible = true"
v-if=
"experimentInfo?.report_upload_way === 1 && !submitted"
<el-button
type=
"primary"
:disabled=
"disabled"
@
click=
"reportDialogVisible = true"
v-if=
"experimentInfo?.report_upload_way === 1 && !submitted"
>
上传实验报告
</el-button
>
<el-button
type=
"primary"
@
click=
"handleReportView"
v-if=
"experimentInfo?.is_commit_report"
>
查看实验报告
</el-button>
<el-button
type=
"primary"
@
click=
"handleReportExport"
v-if=
"detail?.status === 2 && experimentInfo?.is_commit_report"
>
导出实验报告
</el-button>
<el-button
type=
"primary"
@
click=
"handleReportView"
v-if=
"experimentInfo?.is_commit_report"
>
查看实验报告
</el-button
>
<el-button
type=
"primary"
@
click=
"handleReportExport"
v-if=
"detail?.status === 2 && experimentInfo?.is_commit_report"
>
导出实验报告
</el-button
>
</div>
</el-row>
</AppCard>
<div
class=
"lab-box"
>
<el-empty
description=
"您已经提交该实验,不能再进行操作,切换其他实验再做操作吧。"
v-if=
"submitted"
/>
<iframe
allowfullscreen
:src=
"LAB_URL"
:key=
"iframeKey"
frameborder=
"0"
class=
"iframe"
ref=
"iframeRef"
v-else
></iframe>
<iframe
allowfullscreen
:src=
"LAB_URL"
:key=
"iframeKey"
frameborder=
"0"
class=
"iframe"
ref=
"iframeRef"
v-else
></iframe>
<div
style=
"padding:10px;background-color: #fff; max-width: 300px; min-width: 300px"
v-if=
"experimentInfo?.exam_status === 1 && tabActive === 'qa'"
>
<Question
:experiment_id=
"form.experiment_id"
></Question>
</div>
</div>
</
template
>
</DragPanel>
...
...
@@ -300,13 +342,26 @@ function handleReportPreviewReady() {
v-model=
"reportDialogVisible"
:data=
"experimentInfo"
@
update=
"fetchExperimentRecord"
v-if=
"reportDialogVisible && experimentInfo"
></ReportDialog>
<ReportFilePreview
v-model=
"reportFilePreviewVisible"
:data=
"experimentInfo"
v-if=
"reportFilePreviewVisible && experimentInfo"
></ReportFilePreview>
v-if=
"reportDialogVisible && experimentInfo"
></ReportDialog>
<ReportFilePreview
v-model=
"reportFilePreviewVisible"
:data=
"experimentInfo"
v-if=
"reportFilePreviewVisible && experimentInfo"
></ReportFilePreview>
<!-- 实验准备 -->
<PrepareDialog
v-model=
"prepareDialogVisible"
:data=
"experimentInfo"
v-if=
"prepareDialogVisible && experimentInfo"
></PrepareDialog>
<PrepareDialog
v-model=
"prepareDialogVisible"
:data=
"experimentInfo"
v-if=
"prepareDialogVisible && experimentInfo"
></PrepareDialog>
<!-- 实验结果 -->
<ResultDialog
v-model=
"resultDialogVisible"
:data=
"experimentInfo"
v-if=
"resultDialogVisible && experimentInfo"
></ResultDialog>
<ResultDialog
v-model=
"resultDialogVisible"
:data=
"experimentInfo"
v-if=
"resultDialogVisible && experimentInfo"
></ResultDialog>
<!-- 导出在线报告 -->
<
template
v-if=
"experimentInfo?.id && isExport"
>
...
...
@@ -348,6 +403,7 @@ function handleReportPreviewReady() {
flex
:
1
;
width
:
100%
;
margin-top
:
20px
;
display
:
flex
;
}
.iframe
{
width
:
100%
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论