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
Show 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
{
// .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
src/views/index/camp/homework/refer.vue
View file @
ed6401bd
<
template
>
<div>
<el-dialog
:title=
"work_name"
:visible.sync=
"dialogVisible"
...
...
@@ -83,8 +84,9 @@
: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"
...
...
@@ -92,6 +94,27 @@
>
删除
</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>
...
...
@@ -204,7 +227,10 @@
<div>
<el-image
:src=
"fileImg"
></el-image>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div>
<div
class=
"item_remove"
@
click=
"downloadScoreFile(item.url)"
>
<div
class=
"item_remove"
@
click=
"downloadScoreFile(item.url)"
>
下载
</div>
</div>
...
...
@@ -225,6 +251,7 @@
</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