Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
b7052895
提交
b7052895
authored
8月 26, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
3c7c1184
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
250 行增加
和
4 行删除
+250
-4
base.ts
src/api/base.ts
+22
-0
icon_message.png
src/assets/images/icon_message.png
+0
-0
score_bg.png
src/assets/images/score_bg.png
+0
-0
Message.vue
src/components/Message.vue
+114
-0
ListItem.vue
src/modules/admin/lab/video/components/ListItem.vue
+1
-1
Index.vue
src/modules/home/views/Index.vue
+2
-0
Result.vue
src/modules/student/lab/components/Result.vue
+73
-2
Index.vue
src/modules/student/lab/views/Index.vue
+1
-1
types.ts
src/types.ts
+25
-0
axios.ts
src/utils/axios.ts
+12
-0
没有找到文件。
src/api/base.ts
浏览文件 @
b7052895
...
...
@@ -48,3 +48,25 @@ export function updateUploadVideoAuth(data: { source_id: string }) {
export
function
getProjectList
(
params
:
{
organization_id
?:
string
;
project_id
?:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/util/members'
,
{
params
})
}
// 获取待办消息
// https://gitlab.ezijing.com/root/api-documents/-/blob/master/messages/api/%E4%B8%80%E6%9C%9F%E7%AB%99%E5%86%85%E4%BF%A1%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3.md#%E8%8E%B7%E5%8F%96%E7%AB%99%E5%86%85%E4%BF%A1%E6%B6%88%E6%81%AF%E5%88%97%E8%A1%A8
export
function
getMessages
(
params
:
{
source
:
string
page
?:
number
limit
?:
number
is_read
?:
0
|
1
|
9999
is_platform
?:
0
|
1
|
9999
start_time
?:
string
end_time
?:
string
})
{
return
httpRequest
.
get
(
'https://microservices-message-service-api.ezijing.com/v1/messages/intra-station-messages'
,
{
params
})
}
export
function
readMessages
(
params
:
{
message_id
:
string
})
{
return
httpRequest
.
get
(
'https://microservices-message-service-api.ezijing.com/v1/messages/read'
,
{
params
})
}
src/assets/images/icon_message.png
0 → 100644
浏览文件 @
b7052895
1.0 KB
src/assets/images/score_bg.png
0 → 100644
浏览文件 @
b7052895
5.9 KB
src/components/Message.vue
0 → 100644
浏览文件 @
b7052895
<
script
setup
lang=
"ts"
>
import
type
{
MessageType
}
from
'@/types'
import
{
getMessages
,
readMessages
}
from
'@/api/base'
import
{
useUserStore
}
from
'@/stores/user'
const
userStore
=
useUserStore
()
const
router
=
useRouter
()
let
list
=
$ref
<
MessageType
[]
>
([])
const
currentList
=
$computed
(()
=>
{
return
list
.
map
(
item
=>
{
try
{
item
.
payload
=
JSON
.
parse
(
item
.
payload
)
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
item
})
})
function
fetchList
()
{
getMessages
({
source
:
'RESOURCE_MARKETING'
,
is_read
:
0
,
limit
:
100
}).
then
(
res
=>
{
list
=
res
.
data
.
data
})
}
onMounted
(
fetchList
)
function
handleClick
(
data
:
MessageType
)
{
readMessages
({
message_id
:
data
.
id
}).
then
(()
=>
{
fetchList
()
})
const
payload
=
data
.
payload
||
{}
if
(
userStore
.
role
?.
id
===
5
)
{
// 指导老师
// 实验评分
if
(
payload
?.
channel
===
1
)
{
router
.
push
({
path
:
'/admin/lab/record'
,
query
:
payload
})
}
}
else
{
// 学生
// 实验成绩
if
(
payload
?.
channel
===
2
)
{
router
.
push
({
path
:
'/student/lab'
,
query
:
payload
})
}
}
}
</
script
>
<
template
>
<el-popover
trigger=
"click"
placement=
"top-start"
:width=
"380"
>
<template
#
reference
>
<div
class=
"app-message"
>
<div
class=
"icon"
></div>
<p>
我的待办
</p>
<span
v-if=
"currentList.length"
>
{{
currentList
.
length
}}
</span>
</div>
</
template
>
<ul
class=
"app-message-list"
v-if=
"currentList.length"
>
<li
v-for=
"item in currentList"
:key=
"item.id"
@
click=
"handleClick(item)"
>
{{ item.payload.message }}
</li>
</ul>
<el-empty
description=
"暂无数据"
v-else
/>
</el-popover>
</template>
<
style
lang=
"scss"
scoped
>
.app-message
{
position
:
fixed
;
right
:
40px
;
bottom
:
40px
;
padding
:
1px
;
display
:
flex
;
align-items
:
center
;
min-width
:
130px
;
height
:
40px
;
background-color
:
#fff
;
border-radius
:
20px
;
box-sizing
:
border-box
;
cursor
:
pointer
;
.icon
{
width
:
38px
;
height
:
38px
;
background
:
var
(
--
main-color
)
url(@/assets/images/icon_message.png)
no-repeat
center
center
;
background-size
:
22px
;
border-radius
:
50%
;
overflow
:
hidden
;
}
p
{
margin
:
0
5px
;
font-size
:
14px
;
font-family
:
Source
Han
Sans
CN
;
line-height
:
24px
;
color
:
#666666
;
}
span
{
margin-top
:
-10px
;
width
:
16px
;
height
:
16px
;
font-size
:
12px
;
line-height
:
16px
;
color
:
#ffffff
;
background-color
:
var
(
--
main-color
);
text-align
:
center
;
border-radius
:
50%
;
overflow
:
hidden
;
}
}
.app-message-list
{
li
{
padding
:
8px
;
border-radius
:
6px
;
&
:hover
{
background-color
:
#f8f9fb
;
}
}
}
</
style
>
src/modules/admin/lab/video/components/ListItem.vue
浏览文件 @
b7052895
...
...
@@ -42,7 +42,7 @@ defineProps<Props>()
overflow
:
hidden
;
&
:hover
{
overflow
:
unset
;
transform
:
scale
(
1
.
1
);
transform
:
scale
(
1
.
2
);
z-index
:
1
;
.el-icon
{
display
:
block
;
...
...
src/modules/home/views/Index.vue
浏览文件 @
b7052895
<
script
setup
lang=
"ts"
>
import
AppMessage
from
'@/components/Message.vue'
import
Total
from
'../components/Total.vue'
import
{
useUserStore
}
from
'@/stores/user'
const
userStore
=
useUserStore
()
...
...
@@ -12,6 +13,7 @@ const AdminHome = defineAsyncComponent(() => import('../components/AdminHome.vue
<AdminHome
v-if=
"userStore.role?.id === 5"
></AdminHome>
<StudentHome
v-else
></StudentHome>
</div>
<AppMessage></AppMessage>
</
template
>
<
style
lang=
"scss"
scoped
>
...
...
src/modules/student/lab/components/Result.vue
浏览文件 @
b7052895
...
...
@@ -14,18 +14,63 @@ const isEmpty = $computed(() => {
<
template
>
<el-empty
description=
"暂无数据"
v-if=
"isEmpty"
/>
<template
v-else
>
<h2>
我的成绩
</h2>
<h2>
实验过程
</h2>
<div
class=
"result-score"
v-if=
"detail.status === 2"
>
<h2>
我的成绩
</h2>
<p
class=
"t1"
>
{{
parseFloat
(
detail
.
score
)
}}
</p>
<p
class=
"t2"
>
批改讲师:
{{
detail
.
checker_user
.
real_name
}}
</p>
</div>
<h3>
实验过程
</h3>
<ul
class=
"picture-list"
>
<li
v-for=
"item in detail.pictures"
:key=
"item.url"
>
<img
:src=
"item.url"
/>
<p>
截图时间:
{{
item
.
upload_time
}}
</p>
<div
class=
"cover"
>
<div
class=
"cover-inner"
>
<el-button
type=
"primary"
plain
round
>
查看
</el-button>
<el-button
type=
"primary"
plain
round
>
删除
</el-button>
</div>
</div>
</li>
</ul>
</
template
>
</template>
<
style
lang=
"scss"
scoped
>
.result-score
{
margin-bottom
:
40px
;
text-align
:
center
;
h2
{
font-size
:
18px
;
font-weight
:
400
;
line-height
:
30px
;
color
:
#333333
;
text-align
:
center
;
}
.t1
{
margin
:
20px
auto
10px
;
padding-top
:
64px
;
width
:
80px
;
height
:
110px
;
font-size
:
24px
;
font-weight
:
bold
;
line-height
:
1
;
color
:
#ffffff
;
background
:
url(@/assets/images/score_bg.png)
no-repeat
;
background-size
:
contain
;
box-sizing
:
border-box
;
}
.t2
{
font-size
:
14px
;
line-height
:
24px
;
color
:
#666666
;
}
}
h3
{
font-size
:
16px
;
font-weight
:
400
;
line-height
:
27px
;
color
:
#333333
;
}
.picture-list
{
li
{
position
:
relative
;
...
...
@@ -48,6 +93,32 @@ const isEmpty = $computed(() => {
text-align
:
right
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.5
);
}
&
:hover
{
.cover
{
display
:
block
;
}
}
}
.cover
{
display
:
none
;
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
0
;
bottom
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.5
);
}
.cover-inner
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
.el-button
{
width
:
100px
;
margin
:
10px
0
;
}
}
}
</
style
>
src/modules/student/lab/views/Index.vue
浏览文件 @
b7052895
...
...
@@ -17,7 +17,7 @@ const route = useRoute()
// 左侧
const
form
=
reactive
<
{
course_id
:
string
;
experiment_id
:
string
}
>
({
course_id
:
(
route
.
query
.
course_id
as
string
)
||
''
,
experiment_id
:
''
experiment_id
:
(
route
.
query
.
experiment_id
as
string
)
||
''
})
// 课程列表
const
{
courses
}
=
useGetCourseList
()
...
...
src/types.ts
浏览文件 @
b7052895
...
...
@@ -53,3 +53,28 @@ export interface PermissionType {
type
:
number
tag
:
string
}
export
interface
MessageType
{
cancel_time
:
string
channel
:
0
|
1
|
2
|
3
|
4
|
5
created_at
:
string
fail_detail
:
string
from
:
string
from_source
:
number
id
:
string
is_cancel
:
0
|
1
is_platform
:
number
is_read
:
0
|
1
is_send
:
0
|
1
messagebus_id
:
string
parent_id
:
number
payload
:
any
read_time
:
string
send_time
:
string
source
:
number
template_id
:
number
title
:
string
to
:
string
type
:
1
|
2
updated_at
:
string
}
src/utils/axios.ts
浏览文件 @
b7052895
...
...
@@ -13,6 +13,18 @@ const httpRequest = axios.create({
// 请求拦截
httpRequest
.
interceptors
.
request
.
use
(
function
(
config
)
{
// 权限接口单独签名
// https://gitlab.ezijing.com/root/api-documents/-/blob/master/ezijing_permissions/%E7%AD%BE%E5%90%8D%E9%AA%8C%E8%AF%81.md
if
(
config
.
url
&&
config
.
url
.
includes
(
'microservices-message-service-api'
))
{
// 默认参数
const
defaultHeaders
=
{
timestamp
:
Date
.
now
(),
nonce
:
Math
.
random
().
toString
(
36
).
slice
(
-
8
),
signature
:
'UG7wBenexQhiuD2wpCwuxkU0jqcj006d'
}
// config.headers = Object.assign(config.headers, defaultHeaders)
config
.
params
=
Object
.
assign
(
config
.
params
||
{},
defaultHeaders
)
}
if
(
config
.
headers
?.[
'Content-Type'
]
===
'application/x-www-form-urlencoded'
)
{
config
.
data
=
qs
.
stringify
(
config
.
data
,
{
skipNulls
:
true
})
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论