Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
ed6401bd
Commit
ed6401bd
authored
Feb 14, 2022
by
杨梦雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查看作业-在线预览
parent
2ed5f13e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
249 additions
and
179 deletions
+249
-179
src/assets/scss/homework/refer.scss
src/assets/scss/homework/refer.scss
+12
-7
src/config/server.js
src/config/server.js
+6
-6
src/views/index/camp/Homework.vue
src/views/index/camp/Homework.vue
+2
-2
src/views/index/camp/SignUp.vue
src/views/index/camp/SignUp.vue
+1
-1
src/views/index/camp/homework/refer.vue
src/views/index/camp/homework/refer.vue
+228
-163
No files found.
src/assets/scss/homework/refer.scss
View file @
ed6401bd
...
...
@@ -181,12 +181,17 @@
>
div
{
width
:
100%
;
.el-image
{
width
:
30px
;
height
:
30px
;
display
:
block
;
margin
:
0
auto
;
// .home_icon {
// width: 30px;
// height: 30px;
// display: block;
// margin: 0 auto;
.el-image
{
width
:
30px
;
height
:
30px
;
display
:
block
;
margin
:
0
auto
;
img
{
width
:
auto
;
height
:
auto
;
...
...
@@ -204,7 +209,7 @@
}
.item_remove
{
width
:
40px
;
//
width: 40px;
font-size
:
12px
;
color
:
#999999
;
font-weight
:
bold
;
...
...
src/config/server.js
View file @
ed6401bd
...
...
@@ -7,10 +7,10 @@
// export const SERVER_WS_URL = "wss://123.56.237.167:20202"; // websocket
// 正式
export
const
SERVER_URL
=
'
https://api1.testgate.cn
'
// 正式环境
export
const
DEVELOPMENT_SERVER_URL
=
'
https://api1.testgate.cn
'
// 开发环境
export
const
SERVER_WS_URL
=
'
wss://api1.testgate.cn
'
// websocket
//
export const SERVER_URL = 'https://api1.testgate.cn' // 正式环境
//
export const DEVELOPMENT_SERVER_URL = 'https://api1.testgate.cn' // 开发环境
//
export const SERVER_WS_URL = 'wss://api1.testgate.cn' // websocket
// 线上测试
//
export const SERVER_URL = "http://api.campcenter.cn/"; // 正式环境
//
export const DEVELOPMENT_SERVER_URL = "http://api.campcenter.cn/"; //开发环境
//
export const SERVER_WS_URL = "ws://api.campcenter.cn"; // websocket
export
const
SERVER_URL
=
"
http://api.campcenter.cn/
"
;
// 正式环境
export
const
DEVELOPMENT_SERVER_URL
=
"
http://api.campcenter.cn/
"
;
//开发环境
export
const
SERVER_WS_URL
=
"
ws://api.campcenter.cn
"
;
// websocket
src/views/index/camp/Homework.vue
View file @
ed6401bd
...
...
@@ -16,8 +16,8 @@
<div
class=
"homework_name flex"
>
<div
class=
"work_name"
>
{{
item
.
work_name
}}
</div>
<span
class=
"status_0"
v-if=
"item.student_status == 0"
>
未完成
</span>
<span
class=
"status_1"
v-if=
"item.student_status == 1"
>
待评
分
</span>
<span
class=
"status_2"
v-if=
"item.student_status == 2"
>
已评
分
</span>
<span
class=
"status_1"
v-if=
"item.student_status == 1"
>
待评
阅
</span>
<span
class=
"status_2"
v-if=
"item.student_status == 2"
>
已评
阅
</span>
</div>
<el-button
class=
"btn_refer"
...
...
src/views/index/camp/SignUp.vue
View file @
ed6401bd
...
...
@@ -45,7 +45,7 @@
width=
"520px"
center
>
-->
<el-dialog
<el-dialog
style=
"font-size: 26px"
class=
"info"
title=
"营地声明"
...
...
src/views/index/camp/homework/refer.vue
View file @
ed6401bd
<
template
>
<el-dialog
:title=
"work_name"
:visible.sync=
"dialogVisible"
width=
"650px"
top=
"0"
:before-close=
"cancelBtn"
:close-on-click-modal=
"false"
@
open=
"open"
>
<div
class=
"referHome"
>
<el-form
:model=
"formData"
:rules=
"referRules"
ref=
"formRef_stu"
label-position=
"top"
class=
"readForm"
>
<!-- 老师布置的作业 -->
<div
class=
"cont_title"
>
<div
class=
"line"
></div>
<div
class=
"lf"
>
<span>
作业要求
</span>
<div>
<el-dialog
:title=
"work_name"
:visible.sync=
"dialogVisible"
width=
"650px"
top=
"0"
:before-close=
"cancelBtn"
:close-on-click-modal=
"false"
@
open=
"open"
>
<div
class=
"referHome"
>
<el-form
:model=
"formData"
:rules=
"referRules"
ref=
"formRef_stu"
label-position=
"top"
class=
"readForm"
>
<!-- 老师布置的作业 -->
<div
class=
"cont_title"
>
<div
class=
"line"
></div>
<div
class=
"lf"
>
<span>
作业要求
</span>
</div>
</div>
</div>
<div
class=
"cont_title_2"
>
作业内容
</div>
<div
v-html=
"work_contexts"
class=
"cont_info"
>
}
</div>
<div
class=
"cont_title_2"
>
相关附件
</div
>
<div
class=
"upload_box
"
>
<div
v-if=
"teaFileList.length > 0"
>
<div
class=
"img_l
ist"
v-for=
"(item, index) in teaFileList
"
:key=
"index"
>
<div
>
<el-image
:src=
"fileImg"
></el-image
>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div
>
<div
class=
"item_remove"
@
click=
"downloadStuFile(item.url)"
>
下载
<div
class=
"cont_title_2"
>
作业内容
</div>
<div
v-html=
"work_contexts"
class=
"cont_info"
>
}
</div>
<div
class=
"cont_title_2"
>
相关附件
</div>
<div
class=
"upload_box"
>
<div
v-if=
"teaFileList.length > 0
"
>
<div
class=
"img_list"
v-for=
"(item, index) in teaFileL
ist"
:key=
"index
"
>
<div
>
<el-image
:src=
"fileImg"
></el-image
>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div
>
<div
class=
"item_remove"
@
click=
"downloadStuFile(item.url)"
>
下载
</div>
</div>
</div>
</div>
</div>
<div
v-if=
"teaFileList.length
<
=
0
"
class=
"img_list"
>
<div>
<div
class=
"item_name"
>
暂无相关附件
</div>
</div>
</div>
<div
style=
"clear: both"
></div>
</div>
<!-- 我的作业(未提交) -->
<div
class=
"cont_title"
>
<div
class=
"line"
></div>
我的作业
</div>
<el-form-item
label=
"文字描述(如超过300字,建议以附件形式上传)"
prop=
"stu_answer"
>
<el-input
ref=
"stu_answer"
type=
"textarea"
v-model=
"formData.stu_answer"
placeholder=
"请输入300字以内的描述"
size=
"small"
:maxlength=
"300"
show-word-limit
:disabled=
"student_status == 1 || student_status == 2"
/>
</el-form-item>
<el-form-item
label=
"相关附件"
prop=
"stu_enclosure_url"
>
<div
class=
"fj_info"
>
1、请上传1-10份相关附件;
</div>
<div
class=
"fj_info"
>
2、单个附件大小不超过100M,支持JPG、JPEG、PNG、docx、doc、pdf、mp4等格式;
</div>
<div
class=
"upload_box"
>
<div
class=
"img_list"
v-for=
"(item, index) in fileList"
:key=
"index"
>
<div
v-if=
"teaFileList.length
<
=
0
"
class=
"img_list"
>
<div>
<el-image
:src=
"fileImg"
></el-image>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div>
<div
v-show=
"student_status == 0"
class=
"item_remove"
@
click=
"handleRemove(item)"
>
删除
</div>
<div
class=
"item_name"
>
暂无相关附件
</div>
</div>
</div>
<el-upload
v-if=
"fileList.length
<
10
&&
student_status =
=
0
"
ref=
"stu_enclosure_url"
name=
"multipartFile"
action=
"#"
:file-list=
"fileList"
:disabled=
"isUploading || fileList.length >= 10"
:limit=
"10"
list-type=
"picture-card"
:show-file-list=
"false"
:before-upload=
"beforeAvatarUpload"
:http-request=
"uploadPicture"
>
<i
v-if=
"!isUploading"
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-if=
"isUploading"
class=
"el-icon-loading avatar-uploader-icon"
></i>
</el-upload>
<div
class=
"upload_box"
v-if=
"student_status == 1 || student_status == 2"
>
<div
style=
"clear: both"
></div>
</div>
<!-- 我的作业(未提交) -->
<div
class=
"cont_title"
>
<div
class=
"line"
></div>
我的作业
</div>
<el-form-item
label=
"文字描述(如超过300字,建议以附件形式上传)"
prop=
"stu_answer"
>
<el-input
ref=
"stu_answer"
type=
"textarea"
v-model=
"formData.stu_answer"
placeholder=
"请输入300字以内的描述"
size=
"small"
:maxlength=
"300"
show-word-limit
:disabled=
"student_status == 1 || student_status == 2"
/>
</el-form-item>
<el-form-item
label=
"相关附件"
prop=
"stu_enclosure_url"
>
<div
class=
"fj_info"
>
1、请上传1-10份相关附件;
</div>
<div
class=
"fj_info"
>
2、单个附件大小不超过100M,支持JPG、JPEG、PNG、docx、doc、pdf、mp4等格式;
</div>
<div
class=
"upload_box"
>
<div
class=
"img_list"
v-for=
"(item, index) in
stu_
fileList"
v-for=
"(item, index) in fileList"
:key=
"index"
>
<div>
<el-image
:src=
"fileImg"
></el-image>
<el-image
class=
"home_icon"
:src=
"fileImg"
></el-image>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div>
<div
class=
"flex"
>
<div
v-show=
"student_status == 0"
class=
"item_remove"
@
click=
"handleRemove(item)"
>
删除
</div>
<div
v-show=
"student_status == 0"
class=
"item_remove"
@
click=
"handleCheck(item.url)"
>
查看作业
</div>
<!--查看作业图片 -->
<el-dialog
title=
"作业"
:visible.sync=
"dialogVisibleImage"
width=
"30%"
:before-close=
"handleImageClose"
append-to-body
>
<el-image
:src=
"item.url"
:preview-src-list=
"srcList"
></el-image>
</el-dialog>
</div>
</div>
</div>
<div
v-if=
"stu_fileList.length
<
=
0
"
class=
"img_list"
>
<div>
<div
class=
"item_name"
>
暂无相关附件
</div>
<el-upload
v-if=
"fileList.length
<
10
&&
student_status =
=
0
"
ref=
"stu_enclosure_url"
name=
"multipartFile"
action=
"#"
:file-list=
"fileList"
:disabled=
"isUploading || fileList.length >= 10"
:limit=
"10"
list-type=
"picture-card"
:show-file-list=
"false"
:before-upload=
"beforeAvatarUpload"
:http-request=
"uploadPicture"
>
<i
v-if=
"!isUploading"
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-if=
"isUploading"
class=
"el-icon-loading avatar-uploader-icon"
></i>
</el-upload>
<div
class=
"upload_box"
v-if=
"student_status == 1 || student_status == 2"
>
<div
class=
"img_list"
v-for=
"(item, index) in stu_fileList"
:key=
"index"
>
<div>
<el-image
:src=
"fileImg"
></el-image>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div>
</div>
</div>
<div
v-if=
"stu_fileList.length
<
=
0
"
class=
"img_list"
>
<div>
<div
class=
"item_name"
>
暂无相关附件
</div>
</div>
</div>
</div>
</div>
</div>
<!--
</div>
-->
</el-form-item>
<!-- 我的作业(已提交待评分 -不可编辑 )-->
<!--
<div
v-if=
"student_status == 1 || student_status == 2"
>
<!--
</div>
-->
</el-form-item>
<!-- 我的作业(已提交待评分 -不可编辑 )-->
<!--
<div
v-if=
"student_status == 1 || student_status == 2"
>
<div
class=
"cont_title"
>
<div
class=
"line"
></div>
我的作业
...
...
@@ -181,50 +204,54 @@
</div>
</el-form-item>
</div>
-->
<!-- 评阅结果 -->
<div
v-if=
"student_status == 2"
style=
"height: 350px"
>
<div
class=
"cont_title"
>
<div
class=
"line"
></div>
<div
class=
"lf"
>
<span>
评阅结果
</span>
<!-- 评阅结果 -->
<div
v-if=
"student_status == 2"
style=
"height: 350px"
>
<div
class=
"cont_title"
>
<div
class=
"line"
></div>
<div
class=
"lf"
>
<span>
评阅结果
</span>
</div>
</div>
</div>
<!--
<div
class=
"cont_title_2"
>
导师评分
</div>
<!--
<div
class=
"cont_title_2"
>
导师评分
</div>
<div
class=
"cont_info"
>
{{
score
}}
</div>
-->
<div
class=
"cont_title_2"
>
导师评语
</div>
<div
v-html=
"teacher_commment"
class=
"cont_info"
>
}
</div>
<div
class=
"cont_title_2"
>
相关附件
</div>
<div
class=
"upload_box"
>
<div
v-if=
"tea_scoreFileList.length > 0"
>
<div
class=
"img_list"
v-for=
"(item, index) in tea_scoreFileList"
:key=
"index"
>
<div>
<el-image
:src=
"fileImg"
></el-image>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div>
<div
class=
"item_remove"
@
click=
"downloadScoreFile(item.url)"
>
下载
<div
class=
"cont_title_2"
>
导师评语
</div>
<div
v-html=
"teacher_commment"
class=
"cont_info"
>
}
</div>
<div
class=
"cont_title_2"
>
相关附件
</div>
<div
class=
"upload_box"
>
<div
v-if=
"tea_scoreFileList.length > 0"
>
<div
class=
"img_list"
v-for=
"(item, index) in tea_scoreFileList"
:key=
"index"
>
<div>
<el-image
:src=
"fileImg"
></el-image>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div>
<div
class=
"item_remove"
@
click=
"downloadScoreFile(item.url)"
>
下载
</div>
</div>
</div>
</div>
</div>
<div
v-if=
"tea_scoreFileList.length
<
=
0
"
class=
"img_list"
>
<div>
<div
class=
"item_name"
>
暂无相关附件
</div>
<div
v-if=
"tea_scoreFileList.length
<
=
0
"
class=
"img_list"
>
<div>
<div
class=
"item_name"
>
暂无相关附件
</div>
</div>
</div>
</div>
</div>
</div>
<el-form-item
class=
"btn"
v-if=
"student_status == 0"
>
<el-button
type=
"primary"
@
click=
"confirm"
>
提交
</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
<el-form-item
class=
"btn"
v-if=
"student_status == 0"
>
<el-button
type=
"primary"
@
click=
"confirm"
>
提交
</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
...
...
@@ -273,6 +300,7 @@ export default {
};
return
{
dialogVisibleImage
:
false
,
referRules
:
{
stu_answer
:
[
{
required
:
true
,
validator
:
validateNum
,
trigger
:
"
blur
"
},
...
...
@@ -302,6 +330,7 @@ export default {
// score: "", //老师评分
teacher_commment
:
""
,
//老师评语
tea_scoreFileList
:
[],
//老师评语的附件
srcList
:
[],
//在线预览图片-放大
};
},
created
()
{
...
...
@@ -626,23 +655,20 @@ export default {
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
console
.
log
(
this
.
fileList
);
//
console.log(this.fileList);
// console.log(this.stu_fileListoss);
this
.
fileList
.
forEach
((
item
,
idx
)
=>
{
console
.
log
(
idx
,
"
idx
"
);
//
console.log(idx, "idx");
// console.log(item.url == file.url);
if
(
item
.
url
==
file
.
url
)
{
this
.
fileList
.
splice
(
idx
,
1
);
let
code
=
this
.
$store
.
state
.
indexIdentity
;
window
.
localStorage
.
setItem
(
"
student_file_
"
+
window
.
localStorage
.
getItem
(
"
phone
"
+
code
)
+
code
,
JSON
.
stringify
(
this
.
stu_fileListoss
)
);
}
});
...
...
@@ -652,7 +678,7 @@ export default {
return
item
.
url
;
})
.
join
(
"
,
"
);
console
.
log
(
this
.
stu_fileListoss
);
//
console.log(this.stu_fileListoss);
// console.log(this.fileList);
this
.
$message
.
success
(
res
.
data
.
message
);
});
...
...
@@ -665,6 +691,42 @@ export default {
});
});
},
// 查看已上传的学生作业
handleCheck
(
url
)
{
console
.
log
(
url
,
"
url
"
);
// console.log(url.match(/\.(jpeg|jpg|gif|png)$/) != null)
// 是否为图片
if
(
url
.
match
(
/
\.(
jpeg|jpg|gif|png
)
$/
)
!=
null
)
{
this
.
dialogVisibleImage
=
true
;
// console.log(url.split(" "),'111')
this
.
srcList
=
url
.
split
(
"
"
);
}
else
{
let
onlineViewType
=
[
"
doc
"
,
"
docx
"
,
"
xls
"
,
"
xlsx
"
,
"
xlsm
"
,
"
ppt
"
,
"
pptx
"
,
];
let
fileTypeName
=
url
.
substring
(
url
.
lastIndexOf
(
"
.
"
)
+
1
,
url
.
length
)
.
split
(
"
?
"
)[
0
];
let
isWord
=
onlineViewType
.
find
((
type
)
=>
type
===
fileTypeName
);
if
(
isWord
)
{
url
=
"
http://view.officeapps.live.com/op/view.aspx?src=
"
+
url
;
}
window
.
open
(
url
,
"
_blank
"
);
}
},
handleImageClose
(
done
)
{
this
.
$confirm
(
"
确认关闭?
"
)
.
then
((
_
)
=>
{
done
();
})
.
catch
((
_
)
=>
{});
},
// 提交按钮
confirm
()
{
this
.
$confirm
(
...
...
@@ -711,6 +773,9 @@ export default {
<
style
scoped
lang=
"scss"
>
@import
"a/scss/btn"
;
@import
"a/scss/homework/refer"
;
.flex
{
display
:
flex
;
}
</
style
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment