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
7ac47adc
Commit
7ac47adc
authored
Dec 17, 2021
by
杨梦雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
a3ca3264
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
555 additions
and
372 deletions
+555
-372
src/assets/scss/homework/refer.scss
src/assets/scss/homework/refer.scss
+49
-8
src/main.js
src/main.js
+4
-1
src/request/index/certificate.js
src/request/index/certificate.js
+26
-0
src/request/index/homework.js
src/request/index/homework.js
+12
-2
src/request/index/network.js
src/request/index/network.js
+38
-8
src/router/index/camp.js
src/router/index/camp.js
+8
-8
src/store/common.js
src/store/common.js
+10
-0
src/views/index/camp/Certificate.vue
src/views/index/camp/Certificate.vue
+1
-0
src/views/index/camp/Homework.vue
src/views/index/camp/Homework.vue
+48
-29
src/views/index/camp/Index.vue
src/views/index/camp/Index.vue
+11
-11
src/views/index/camp/homework/refer.vue
src/views/index/camp/homework/refer.vue
+348
-305
No files found.
src/assets/scss/homework/refer.scss
View file @
7ac47adc
...
...
@@ -3,14 +3,8 @@
display
:
flex
;
}
.referHome
{
padding
:
20px
;
.lf
{
float
:
left
;
}
.rt
{
float
:
right
;
}
::v-deep
.readForm
{
flex
:
1
;
...
...
@@ -119,7 +113,54 @@
}
}
}
.image_add
{
position
:
relative
;
margin-top
:
24px
;
.image_in
{
.limit_10
{
display
:
none
;
}
.el-upload-list--picture-card
{
.item_img
{
width
:
100%
;
}
}
}
//去除upload组件过渡效果 css
.el-upload-list__item
{
transition
:
none
!
important
;
.is-ready
{
display
:
none
;
}
div
{
height
:
100%
;
}
}
.el-upload--picture-card
{
display
:
inline-block
;
}
.el-upload
{
position
:
relative
;
.el-icon-circle-plus
{
font-size
:
52px
;
color
:
var
(
--
color
);
position
:
absolute
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
}
}
i
{
font-size
:
22px
;
color
:
#ffffff
;
}
.text
{
font-size
:
14px
;
color
:
#a7a2a6
;
text-align
:
center
;
}
}
.upload_box
{
.img_list
{
position
:
relative
;
...
...
src/main.js
View file @
7ac47adc
...
...
@@ -7,12 +7,15 @@ import store from './store'
import
ElementUI
from
'
element-ui
'
import
'
element-ui/lib/theme-chalk/index.css
'
import
'
@/assets/scss/index.scss
'
import
{
download
,
upload
}
from
"
r/index/network.js
"
;
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ElementUI
)
Vue
.
prototype
.
download
=
download
Vue
.
prototype
.
upload
=
upload
Vue
.
prototype
.
$errorScroll
=
function
errorScroll
(
callback
)
{
this
.
$nextTick
(()
=>
{
...
...
src/request/index/certificate.js
0 → 100644
View file @
7ac47adc
/* eslint-disable */
import
{
request
}
from
'
./network
'
import
store
from
'
@/store
'
// 添加地址
export
function
setAddress
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
return
request
({
method
:
'
post
'
,
url
:
'
/web/download/setAddress
'
,
params
:
data
})
}
// 获取地址
export
function
getAddress
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
return
request
({
method
:
'
post
'
,
url
:
'
/web/download/getAddress
'
,
params
:
data
})
}
src/request/index/homework.js
View file @
7ac47adc
...
...
@@ -24,14 +24,24 @@ export function downloadTeacherWork(data) {
})
}
// 获取学生上传作业的oss
export
function
getPostWorkStudent
(
data
)
{
export
function
PostWorkStudentOss
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
return
request
({
method
:
'
post
'
,
url
:
'
/web/download/getPostWorkStudent
'
,
params
:
data
data
})
}
//删除图片
export
function
delPic
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
return
request
({
method
:
'
post
'
,
url
:
'
/web/download/delPic
'
,
params
:
data
})
}
// 获取学生提交营地作业
export
function
getStudentWork
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
...
...
src/request/index/network.js
View file @
7ac47adc
/* eslint-disable */
import
axios
from
'
axios
'
import
store
from
'
@/store
'
import
qs
from
'
qs
'
import
{
tansParams
}
from
'
@/store/common.js
'
import
{
SERVER_URL
,
DEVELOPMENT_SERVER_URL
...
...
@@ -28,6 +30,7 @@ const instance = axios.create({
instance
.
interceptors
.
request
.
use
(
(
config
)
=>
{
if
(
config
.
method
===
"
post
"
&&
!
config
.
notQs
)
{
console
.
log
(
config
)
config
.
data
=
qs
.
stringify
(
config
.
data
);
}
if
(
config
.
url
.
indexOf
(
SERVER_URL
)
===
-
1
)
{
...
...
@@ -50,14 +53,6 @@ instance.interceptors.request.use(
return
Promise
.
reject
(
error
);
}
);
// instance.interceptors.response.use(
// (response) => {
// return response.data;
// },
// (error) => {
// return Promise.reject(error);
// }
// );
export
default
instance
;
...
...
@@ -338,6 +333,41 @@ export function upload(url, data = {}) {
);
});
}
// 通用下载方法
export
function
download
(
url
,
params
,
filename
)
{
console
.
log
(
url
,
params
,
filename
)
return
instance
.
post
(
url
,
params
,
{
transformRequest
:
[
params
=>
{
return
tansParams
(
params
);
}
],
headers
:
{
"
Content-Type
"
:
"
application/x-www-form-urlencoded
"
},
responseType
:
"
blob
"
})
.
then
(
data
=>
{
const
content
=
data
;
console
.
log
(
content
)
const
blob
=
new
Blob
([
content
]);
if
(
"
download
"
in
document
.
createElement
(
"
a
"
))
{
const
elink
=
document
.
createElement
(
"
a
"
);
elink
.
download
=
filename
;
elink
.
style
.
display
=
"
none
"
;
elink
.
href
=
URL
.
createObjectURL
(
blob
);
document
.
body
.
appendChild
(
elink
);
elink
.
click
();
URL
.
revokeObjectURL
(
elink
.
href
);
document
.
body
.
removeChild
(
elink
);
}
else
{
navigator
.
msSaveBlob
(
blob
,
filename
);
}
})
.
catch
(
r
=>
{
console
.
error
(
r
);
});
}
// 合并多个请求
export
function
allRequest
(
arrRequest
)
{
return
axios
.
all
(
arrRequest
)
...
...
src/router/index/camp.js
View file @
7ac47adc
...
...
@@ -15,14 +15,14 @@ export default [{
}
},
{
path
:
'
/homework/refer
'
,
name
:
'
homework-refer
'
,
component
:
()
=>
import
(
'
v/index/camp/homework/refer.vue
'
),
meta
:
{
title
:
'
提交作业
'
},
},
//
{
//
path: '/homework/refer',
//
name: 'homework-refer',
//
component: () => import('v/index/camp/homework/refer.vue'),
//
meta: {
//
title: '提交作业'
//
},
//
},
{
path
:
'
/certificate
'
,
name
:
'
index-certificate
'
,
...
...
src/store/common.js
0 → 100644
View file @
7ac47adc
export
function
tansParams
(
params
)
{
let
result
=
''
Object
.
keys
(
params
).
forEach
((
key
)
=>
{
if
(
!
Object
.
is
(
params
[
key
],
undefined
)
&&
!
Object
.
is
(
params
[
key
],
null
)
&&
!
Object
.
is
(
JSON
.
stringify
(
params
[
key
]),
'
{}
'
))
{
result
+=
encodeURIComponent
(
key
)
+
'
=
'
+
encodeURIComponent
(
params
[
key
])
+
'
&
'
}
})
return
result
}
\ No newline at end of file
src/views/index/camp/Certificate.vue
View file @
7ac47adc
...
...
@@ -132,6 +132,7 @@
<
script
>
/* eslint-disable */
import
{
getProAndCity
,
getSchool
}
from
"
r/index/signUp
"
;
import
{
setAddress
}
from
"
r/index/certificate
"
;
import
validator
from
"
common/validator
"
;
export
default
{
...
...
src/views/index/camp/Homework.vue
View file @
7ac47adc
...
...
@@ -3,14 +3,14 @@
<div
class=
"title"
>
<div
class=
"homework_titile"
>
营地作业
</div>
</div>
<
!--
<div
class=
"empty_conten
t"
>
<
div
class=
"empty_content"
v-if=
"!this.homeworkLis
t"
>
<div>
<img
src=
"@/assets/img/homework/homework.png"
alt=
""
/>
</div>
<p>
同学你好,老师暂未发布作业
</p>
<p>
请于2021年XX年XX月XX日 前往网站查看作业
</p>
</div>
-->
</div>
<div
class=
"home_content"
>
<div
class=
"each_content"
v-for=
"item in homeworkList"
:key=
"item.id"
>
<div
class=
"top flex"
>
...
...
@@ -36,18 +36,33 @@
<div>
<el-pagination
layout=
"prev, pager, next"
:total=
"50"
>
</el-pagination>
</div>
<!-- 下载作业 -->
<refer
:dialogVisibleFu=
"dialogVisibleFu"
:work_contexts=
"work_context"
:enclosure_urls=
"enclosure_url"
:work_nums=
"work_num"
@
closeDialog=
"closeDialog"
></refer>
</div>
</
template
>
<
script
>
/* eslint-disable */
import
refer
from
"
v/index/camp/homework/refer
"
;
import
{
getTeacherWork
}
from
"
r/index/homework
"
;
import
Bus
from
"
config/bus.js
"
;
export
default
{
name
:
"
homework
"
,
components
:
{
refer
,
},
data
()
{
return
{
homeworkList
:
{},
dialogVisibleFu
:
false
,
work_context
:
""
,
enclosure_url
:
""
,
work_num
:
0
,
};
},
created
()
{
...
...
@@ -55,15 +70,19 @@ export default {
},
watch
:
{},
methods
:
{
// 子组件触发,关闭确认报名弹框
closeDialog
(
val
,
type
)
{
this
.
dialogVisibleFu
=
val
;
// if (type) {
// clearInterval(this.timer);
// }
},
toRefer
(
item
)
{
// console.log(val,'val')
let
code
=
this
.
$store
.
state
.
indexIdentity
;
this
.
$router
.
push
(
"
/homework/refer?code=
"
+
code
);
this
.
$emit
(
"
torefer
"
,
3
);
window
.
localStorage
.
setItem
(
"
work_context
"
+
code
,
item
.
work_context
);
window
.
localStorage
.
setItem
(
"
enclosure_url
"
+
code
,
item
.
enclosure_url
);
// Bus.$emit("work_context", item.work_context);
// Bus.$emit("enclosure_url", item.enclosure_url);
this
.
dialogVisibleFu
=
true
;
// console.log(item.work_num,'val')
this
.
work_context
=
item
.
work_context
;
this
.
enclosure_url
=
item
.
enclosure_url
;
this
.
work_num
=
item
.
work_num
;
},
getTeacherWork
()
{
getTeacherWork
({
page
:
1
}).
then
((
res
)
=>
{
...
...
@@ -90,25 +109,25 @@ export default {
// width: 856px;
// 空状态
//
.title {
//
padding: 50px;
//
.homework_titile {
//
font-size: 24px;
//
font-weight: 500;
//
color: #1b1419;
//
line-height: 24px;
//
margin-bottom: 40px;
//
text-align: center;
//
}
//
}
.title
{
padding
:
50px
;
.homework_titile
{
font-size
:
24px
;
font-weight
:
500
;
color
:
#1b1419
;
line-height
:
24px
;
margin-bottom
:
40px
;
text-align
:
center
;
}
}
//
.content_empty {
//
padding-bottom: 200px;
//
p,
//
div {
//
text-align: center;
//
}
//
}
.content_empty
{
padding-bottom
:
200px
;
p
,
div
{
text-align
:
center
;
}
}
// 有作业时候F
.title
{
...
...
src/views/index/camp/Index.vue
View file @
7ac47adc
...
...
@@ -32,12 +32,12 @@
<SignUp
@
getStatus=
"getStatus"
v-if=
"this.campindex_type == 0"
>
</SignUp>
<Homework
v-if=
"this.campindex_type == 1
&& this.homework_val == null
"
@
torefer=
"torefer"
v-if=
"this.campindex_type == 1"
>
</Homework>
<Certificate
v-if=
"this.campindex_type == 2"
>
</Certificate>
<
homeRefer
v-if=
"this.homework_val == 3"
>
</homeRefer
>
<
!--
<homeRefer
v-if=
"this.homework_val == 3"
>
</homeRefer>
--
>
</div>
</div>
</div>
...
...
@@ -56,7 +56,7 @@ import svg3 from "@/assets/img/signUp/icon-2.svg";
import
SignUp
from
"
v/index/camp/SignUp
"
;
import
Homework
from
"
v/index/camp/Homework
"
;
import
Certificate
from
"
v/index/camp/Certificate
"
;
import
homeRefer
from
"
v/index/camp/homework/refer
"
;
//
import homeRefer from "v/index/camp/homework/refer";
export
default
{
name
:
"
campIndex
"
,
...
...
@@ -66,7 +66,7 @@ export default {
SignUp
,
Homework
,
Certificate
,
homeRefer
,
//
homeRefer,
},
// props:{}
data
()
{
...
...
@@ -98,13 +98,13 @@ export default {
campindex_type
:
0
,
index_status
:
""
,
homework_val
:
""
,
//
homework_val: "",
};
},
watch
:
{},
created
()
{
this
.
getStatus
();
this
.
torefer
();
//
this.torefer();
},
mounted
()
{
window
.
addEventListener
(
"
scroll
"
,
this
.
handleScrollX
,
true
);
...
...
@@ -115,10 +115,10 @@ export default {
window
.
removeEventListener
(
"
resize
"
,
this
.
onResize
,
true
);
},
methods
:
{
torefer
(
val
)
{
console
.
log
(
val
,
"
val
"
);
this
.
homework_val
=
val
;
},
//
torefer(val) {
//
console.log(val, "val");
//
this.homework_val = val;
//
},
getStatus
(
val
)
{
// console.log(val, "index_type");
this
.
index_status
=
val
;
...
...
src/views/index/camp/homework/refer.vue
View file @
7ac47adc
This diff is collapsed.
Click to expand it.
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