Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
7d6ca75d
提交
7d6ca75d
authored
4月 16, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
办事大厅
上级
a496f911
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
86 行增加
和
18 行删除
+86
-18
package-lock.json
client/package-lock.json
+5
-0
package.json
client/package.json
+2
-1
OtherAction.js
client/src/action/OtherAction.js
+6
-1
index.js
client/src/action/index.js
+0
-1
other_api.js
client/src/api/other_api.js
+6
-1
navigation.vue
client/src/components/learnSysLayout/navigation.vue
+9
-6
main.js
client/src/main.js
+2
-1
message.vue
client/src/pages/other/message.vue
+28
-7
index.js
client/src/store/index.js
+23
-0
package-lock.json
package-lock.json
+5
-0
没有找到文件。
client/package-lock.json
浏览文件 @
7d6ca75d
...
@@ -10460,6 +10460,11 @@
...
@@ -10460,6 +10460,11 @@
"resolved"
:
"https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz"
,
"integrity"
:
"sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw=="
"integrity"
:
"sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw=="
},
},
"vuex"
:
{
"version"
:
"3.1.3"
,
"resolved"
:
"https://registry.npmjs.org/vuex/-/vuex-3.1.3.tgz"
,
"integrity"
:
"sha512-k8vZqNMSNMgKelVZAPYw5MNb2xWSmVgCKtYKAptvm9YtZiOXnRXFWu//Y9zQNORTrm3dNj1n/WaZZI26tIX6Mw=="
},
"watchpack"
:
{
"watchpack"
:
{
"version"
:
"1.6.1"
,
"version"
:
"1.6.1"
,
"resolved"
:
"https://registry.npmjs.org/watchpack/-/watchpack-1.6.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/watchpack/-/watchpack-1.6.1.tgz"
,
...
...
client/package.json
浏览文件 @
7d6ca75d
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
"vue-loader"
:
"^15.9.1"
,
"vue-loader"
:
"^15.9.1"
,
"vue-meta-info"
:
"^0.1.7"
,
"vue-meta-info"
:
"^0.1.7"
,
"vue-router"
:
"^3.1.6"
,
"vue-router"
:
"^3.1.6"
,
"vue-template-compiler"
:
"^2.6.11"
"vue-template-compiler"
:
"^2.6.11"
,
"vuex"
:
"^3.1.3"
}
}
}
}
client/src/action/OtherAction.js
浏览文件 @
7d6ca75d
...
@@ -11,13 +11,18 @@ export default class OtherAction extends BaseACTION {
...
@@ -11,13 +11,18 @@ export default class OtherAction extends BaseACTION {
id
:
_
.
id
,
id
:
_
.
id
,
text
:
_
.
message_body
,
text
:
_
.
message_body
,
time
:
_
.
created_time
,
time
:
_
.
created_time
,
isShow
:
false
// 该字段用来做 每条信息的打开、关闭
isShow
:
_
.
status
// 该字段用来做 每条信息的打开、关闭
}
}
})
})
return
json
return
json
})
})
}
}
getNavMsg
()
{
return
Other
.
getNavMsg
().
then
(
res
=>
res
)
}
/**
* 设置消息已读未读
*/
setMyMsg
(
rid
)
{
return
Other
.
setMyMsg
(
rid
).
then
(
res
=>
res
)
}
/**
/**
* 当前登录用户,检测是否该系统有权限
* 当前登录用户,检测是否该系统有权限
*/
*/
...
...
client/src/action/index.js
浏览文件 @
7d6ca75d
...
@@ -41,7 +41,6 @@ const cAction = {
...
@@ -41,7 +41,6 @@ const cAction = {
* @param {[function]} obj.finallyCallback 最终finally回调,必传
* @param {[function]} obj.finallyCallback 最终finally回调,必传
*/
*/
export
const
request
=
(
obj
)
=>
{
export
const
request
=
(
obj
)
=>
{
console
.
log
(
obj
,
'==========='
)
cAction
[
obj
.
actionName
][
obj
.
functionName
](
obj
.
data
).
then
(
res
=>
{
cAction
[
obj
.
actionName
][
obj
.
functionName
](
obj
.
data
).
then
(
res
=>
{
obj
.
thenCallback
(
res
)
obj
.
thenCallback
(
res
)
}).
catch
(
e
=>
{
}).
catch
(
e
=>
{
...
...
client/src/api/other_api.js
浏览文件 @
7d6ca75d
...
@@ -5,11 +5,16 @@ export default class OtherAPI extends BaseAPI {
...
@@ -5,11 +5,16 @@ export default class OtherAPI extends BaseAPI {
/**
/**
* 当前登录用户,检测是否该系统有权限
* 当前登录用户,检测是否该系统有权限
*/
*/
getInfo
=
()
=>
this
.
post
(
'/user_center/get_user_info'
,
{},
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
getInfo
=
()
=>
this
.
post
(
'/user_center/get_user_info'
,
{},
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
/**
/**
* 获取我的消息信息
* 获取我的消息信息
*/
*/
getMyMsg
=
()
=>
this
.
get
(
'/v2/education/message/my'
,
{})
getMyMsg
=
()
=>
this
.
get
(
'/v2/education/message/my'
,
{})
/**
* 标记已读未读
*/
setMyMsg
=
(
rid
)
=>
this
.
post
(
`/v2/education/message/
${
rid
}
`
,
{})
getNavMsg
=
(
rid
)
=>
this
.
get
(
'/v2/education/message/num'
,
{})
/**
/**
* 调用退出登录
* 调用退出登录
*/
*/
...
...
client/src/components/learnSysLayout/navigation.vue
浏览文件 @
7d6ca75d
...
@@ -6,34 +6,37 @@
...
@@ -6,34 +6,37 @@
</div>
</div>
<!--
<s-language></s-language>
-->
<!--
<s-language></s-language>
-->
<div
class=
"notify"
@
click=
"goNotify()"
>
{{
$t
(
'components.learnSysLayout.navigation.tip'
)
}}
<div
class=
"notify"
@
click=
"goNotify()"
>
{{
$t
(
'components.learnSysLayout.navigation.tip'
)
}}
<div
class=
"num"
v-if=
"
num"
>
{{
num
}}
</div>
<div
class=
"num"
v-if=
"
this.$store.getters.myMsg"
>
{{
this
.
$store
.
getters
.
myMsg
}}
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
// import sLanguage from '@/components/languageSwitch/index.vue'
// import sLanguage from '@/components/languageSwitch/index.vue'
// import cAction from '@
action'
import
cAction
from
'../../
action'
export
default
{
export
default
{
components
:
{},
components
:
{},
data
()
{
data
()
{
return
{
return
{
num
:
0
num
:
this
.
$store
.
getters
.
myMsg
}
}
},
},
mounted
()
{
mounted
()
{
// request({
// request({
// component: this,
// component: this,
// actionName: '
msgAction
',
// actionName: '
Other
',
// functionName: 'get
My
Msg',
// functionName: 'get
Nav
Msg',
// data: {},
// data: {},
// thenCallback: data => {
// thenCallback: data => {
// this.
num = data.length
// this.
$store.commit('myMsg', data.num)
// },
// },
// catchCallback: () => {},
// catchCallback: () => {},
// finallyCallback: () => {}
// finallyCallback: () => {}
// })
// })
cAction
.
Other
.
getNavMsg
().
then
(
data
=>
{
this
.
$store
.
commit
(
'myMsg'
,
data
.
num
)
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
},
},
methods
:
{
methods
:
{
goNotify
()
{
goNotify
()
{
...
...
client/src/main.js
浏览文件 @
7d6ca75d
...
@@ -11,6 +11,7 @@ import Element from 'element-ui'
...
@@ -11,6 +11,7 @@ import Element from 'element-ui'
import
modules
from
'./modules'
import
modules
from
'./modules'
import
createBefore
from
'./components/beforeEnter'
import
createBefore
from
'./components/beforeEnter'
import
store
from
'./store'
/* 兼容处理 start */
/* 兼容处理 start */
/* 处理低版本浏览器支持axios finally问题 */
/* 处理低版本浏览器支持axios finally问题 */
...
@@ -44,4 +45,4 @@ router.beforeEach((to, from, next) => {
...
@@ -44,4 +45,4 @@ router.beforeEach((to, from, next) => {
next
()
next
()
})
})
window
.
G
.
$instance_vue
=
new
Vue
({
router
,
i18n
,
render
:
(
h
)
=>
h
(
App
)
}).
$mount
(
'#app'
)
window
.
G
.
$instance_vue
=
new
Vue
({
router
,
i18n
,
store
,
render
:
(
h
)
=>
h
(
App
)
}).
$mount
(
'#app'
)
client/src/pages/other/message.vue
浏览文件 @
7d6ca75d
...
@@ -2,9 +2,17 @@
...
@@ -2,9 +2,17 @@
<div>
<div>
<div
class=
"con-title"
>
消息通知
</div>
<div
class=
"con-title"
>
消息通知
</div>
<div
class=
"con-box"
>
<div
class=
"con-box"
>
<el-collapse
v-model=
"activeNames"
@
change=
"handleChange"
>
<el-collapse
accordion
v-model=
"activeNames"
@
change=
"handleChange"
>
<template
v-for=
"(item, index) in msgList"
>
<template
v-for=
"(item, index) in msgList"
>
<el-collapse-item
v-bind:key=
"index"
title=
"系统通知"
:name=
"index"
>
<el-collapse-item
v-bind:key=
"index"
:name=
"index"
>
<template
slot=
"title"
>
<template
v-if=
"!item.isShow"
>
<el-badge
is-dot
class=
"item"
>
系统通知
</el-badge>
</
template
>
<
template
v-if=
"item.isShow"
>
系统通知
</
template
>
</template>
<div
v-html=
"item.text"
></div>
<div
v-html=
"item.text"
></div>
</el-collapse-item>
</el-collapse-item>
</template>
</template>
...
@@ -26,19 +34,32 @@ export default {
...
@@ -26,19 +34,32 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
cAction
.
Other
.
getMyMsg
().
then
(
json
=>
{
this
.
getData
()
this
.
msgList
=
json
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
},
},
methods
:
{
methods
:
{
handleChange
(
val
)
{
handleChange
(
val
)
{
console
.
log
(
val
)
if
(
typeof
val
===
'number'
&&
this
.
msgList
[
val
].
isShow
===
0
)
{
cAction
.
Other
.
setMyMsg
(
this
.
msgList
[
val
].
id
).
then
(
json
=>
{
this
.
getData
()
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
cAction
.
Other
.
getNavMsg
().
then
(
data
=>
{
this
.
$store
.
commit
(
'myMsg'
,
data
.
num
)
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
}
},
getData
()
{
cAction
.
Other
.
getMyMsg
().
then
(
json
=>
{
this
.
msgList
=
json
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
>
.el-collapse-item__header
{
line-height
:
15px
;
}
.total-core
,
.compulsory-core
,
.elective-core
{
.total-core
,
.compulsory-core
,
.elective-core
{
margin-top
:
0
.1rem
;
margin-top
:
0
.1rem
;
font-size
:
16px
;
font-size
:
16px
;
...
...
client/src/store/index.js
0 → 100644
浏览文件 @
7d6ca75d
import
Vue
from
'vue'
import
Vuex
from
'vuex'
Vue
.
use
(
Vuex
)
const
state
=
{
myMsg
:
111
}
const
getters
=
{
myMsg
(
state
)
{
return
state
.
myMsg
}
}
const
mutations
=
{
myMsg
(
state
,
sum
)
{
state
.
myMsg
=
sum
}
}
const
store
=
new
Vuex
.
Store
({
state
,
getters
,
mutations
})
export
default
store
package-lock.json
浏览文件 @
7d6ca75d
...
@@ -11,6 +11,11 @@
...
@@ -11,6 +11,11 @@
"version"
:
"0.7.3"
,
"version"
:
"0.7.3"
,
"resolved"
:
"https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz"
,
"resolved"
:
"https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz"
,
"integrity"
:
"sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
"integrity"
:
"sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
},
"vuex"
:
{
"version"
:
"3.1.3"
,
"resolved"
:
"https://registry.npmjs.org/vuex/-/vuex-3.1.3.tgz"
,
"integrity"
:
"sha512-k8vZqNMSNMgKelVZAPYw5MNb2xWSmVgCKtYKAptvm9YtZiOXnRXFWu//Y9zQNORTrm3dNj1n/WaZZI26tIX6Mw=="
}
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论