Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BCDH-APP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
首开风险隐患双控平台
BCDH-APP
Commits
7af8103d
Commit
7af8103d
authored
Nov 19, 2021
by
胡占生
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息中心更改
parent
01410880
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1310 additions
and
853 deletions
+1310
-853
src/router/index.js
src/router/index.js
+525
-514
src/service/message.js
src/service/message.js
+85
-8
src/utils/axios.js
src/utils/axios.js
+18
-17
src/views/messageCenter/index.vue
src/views/messageCenter/index.vue
+40
-15
src/views/messageCenter/messageDetails/index.vue
src/views/messageCenter/messageDetails/index.vue
+153
-0
src/views/messageCenter/messageNews/index.vue
src/views/messageCenter/messageNews/index.vue
+164
-164
src/views/messageCenter/noticeInfo/index.vue
src/views/messageCenter/noticeInfo/index.vue
+188
-69
src/views/messageCenter/waitEvent/index.vue
src/views/messageCenter/waitEvent/index.vue
+137
-66
No files found.
src/router/index.js
View file @
7af8103d
...
@@ -27,541 +27,552 @@ import CreateOrder from '../views/CreateOrder.vue'
...
@@ -27,541 +27,552 @@ import CreateOrder from '../views/CreateOrder.vue'
Vue
.
use
(
VueRouter
)
Vue
.
use
(
VueRouter
)
const
routes
=
[{
const
routes
=
[{
path
:
'
/
'
,
path
:
'
/
'
,
name
:
'
home
'
,
name
:
'
home
'
,
redirect
:
'
/login2
'
redirect
:
'
/login2
'
},
},
{
{
path
:
'
/login
'
,
path
:
'
/login
'
,
name
:
'
login
'
,
name
:
'
login
'
,
meta
:
{
meta
:
{
index
:
2
index
:
2
},
},
component
:
()
=>
import
(
/* webpackChunkName: "login" */
'
../views/Login.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "login" */
'
../views/Login.vue
'
),
},
},
{
{
path
:
'
/home
'
,
path
:
'
/home
'
,
name
:
'
home
'
,
name
:
'
home
'
,
meta
:
{
meta
:
{
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "home" */
'
../views/Home.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "home" */
'
../views/Home.vue
'
),
},
},
{
{
path
:
'
/cart
'
,
path
:
'
/cart
'
,
name
:
'
cart
'
,
name
:
'
cart
'
,
meta
:
{
meta
:
{
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "cart" */
'
../views/Cart.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "cart" */
'
../views/Cart.vue
'
),
},
},
{
{
path
:
'
/category
'
,
path
:
'
/category
'
,
name
:
'
category
'
,
name
:
'
category
'
,
meta
:
{
meta
:
{
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "category" */
'
../views/Category.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "category" */
'
../views/Category.vue
'
),
},
},
{
{
path
:
'
/product-list
'
,
path
:
'
/product-list
'
,
name
:
'
product-list
'
,
name
:
'
product-list
'
,
meta
:
{
meta
:
{
index
:
2
index
:
2
},
},
component
:
()
=>
import
(
/* webpackChunkName: "product-list" */
'
../views/ProductList.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "product-list" */
'
../views/ProductList.vue
'
),
},
},
{
{
path
:
'
/product/:id
'
,
path
:
'
/product/:id
'
,
name
:
'
product
'
,
name
:
'
product
'
,
meta
:
{
meta
:
{
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "product" */
'
../views/ProductDetail.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "product" */
'
../views/ProductDetail.vue
'
),
},
},
{
{
path
:
'
/user
'
,
path
:
'
/user
'
,
name
:
'
user
'
,
name
:
'
user
'
,
meta
:
{
meta
:
{
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "user" */
'
../views/User.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "user" */
'
../views/User.vue
'
),
},
},
{
{
path
:
'
/order
'
,
path
:
'
/order
'
,
name
:
'
order
'
,
name
:
'
order
'
,
meta
:
{
meta
:
{
index
:
2
index
:
2
},
},
component
:
()
=>
import
(
/* webpackChunkName: "order" */
'
../views/Order.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "order" */
'
../views/Order.vue
'
),
},
},
{
{
path
:
'
/order-detail
'
,
path
:
'
/order-detail
'
,
name
:
'
order-detail
'
,
name
:
'
order-detail
'
,
meta
:
{
meta
:
{
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "order-detail" */
'
../views/OrderDetail.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "order-detail" */
'
../views/OrderDetail.vue
'
),
},
},
{
{
path
:
'
/setting
'
,
path
:
'
/setting
'
,
name
:
'
setting
'
,
name
:
'
setting
'
,
meta
:
{
meta
:
{
index
:
2
index
:
2
},
},
component
:
()
=>
import
(
/* webpackChunkName: "setting" */
'
../views/Setting.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "setting" */
'
../views/Setting.vue
'
),
},
},
{
{
path
:
'
/address
'
,
path
:
'
/address
'
,
name
:
'
address
'
,
name
:
'
address
'
,
meta
:
{
meta
:
{
index
:
2
index
:
2
},
},
component
:
()
=>
import
(
/* webpackChunkName: "address" */
'
../views/Address.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "address" */
'
../views/Address.vue
'
),
},
},
{
{
path
:
'
/address-edit
'
,
path
:
'
/address-edit
'
,
name
:
'
address-edit
'
,
name
:
'
address-edit
'
,
meta
:
{
meta
:
{
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "address-edit" */
'
../views/AddressEdit.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "address-edit" */
'
../views/AddressEdit.vue
'
),
},
},
{
{
path
:
'
/about
'
,
path
:
'
/about
'
,
name
:
'
about
'
,
name
:
'
about
'
,
meta
:
{
meta
:
{
index
:
2
index
:
2
},
},
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'
../views/About.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'
../views/About.vue
'
),
},
},
{
{
path
:
'
/create-order
'
,
path
:
'
/create-order
'
,
name
:
'
create-order
'
,
name
:
'
create-order
'
,
meta
:
{
meta
:
{
index
:
2
index
:
2
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/CreateOrder.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/CreateOrder.vue
'
),
},
},
{
{
path
:
'
/checked
'
,
path
:
'
/checked
'
,
name
:
'
checked
'
,
name
:
'
checked
'
,
meta
:
{
meta
:
{
title
:
'
检查执行
'
,
title
:
'
检查执行
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked
'
),
},
},
{
{
path
:
'
/problem
'
,
path
:
'
/problem
'
,
name
:
'
problem
'
,
name
:
'
problem
'
,
meta
:
{
meta
:
{
title
:
'
问题上报
'
,
title
:
'
问题上报
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem
'
),
},
},
{
{
path
:
'
/list
'
,
path
:
'
/list
'
,
name
:
'
list
'
,
name
:
'
list
'
,
meta
:
{
meta
:
{
title
:
'
检查问题
'
,
title
:
'
检查问题
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/list
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/list
'
),
},
},
{
{
path
:
'
/note
'
,
path
:
'
/note
'
,
name
:
'
note
'
,
name
:
'
note
'
,
meta
:
{
meta
:
{
title
:
'
问题记录
'
,
title
:
'
问题记录
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/note
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/note
'
),
},
},
{
{
path
:
'
/detail
'
,
path
:
'
/detail
'
,
name
:
'
detail
'
,
name
:
'
detail
'
,
meta
:
{
meta
:
{
title
:
'
问题详情
'
,
title
:
'
问题详情
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/note/detail
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/note/detail
'
),
},
},
{
{
path
:
'
/edit
'
,
path
:
'
/edit
'
,
name
:
'
edit
'
,
name
:
'
edit
'
,
meta
:
{
meta
:
{
title
:
'
问题编辑
'
,
title
:
'
问题编辑
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/note/edit
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/note/edit
'
),
},
},
{
{
path
:
'
/formwork
'
,
path
:
'
/formwork
'
,
name
:
'
formwork
'
,
name
:
'
formwork
'
,
meta
:
{
meta
:
{
title
:
'
问题上报表
'
,
title
:
'
问题上报表
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/formwork
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/checked/problem/formwork
'
),
},
},
{
{
path
:
'
/correct
'
,
path
:
'
/correct
'
,
name
:
'
correct
'
,
name
:
'
correct
'
,
meta
:
{
meta
:
{
title
:
'
检查记录
'
,
title
:
'
检查记录
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/correct
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/correct
'
),
},
},
{
{
path
:
'
/notice
'
,
path
:
'
/notice
'
,
name
:
'
notice
'
,
name
:
'
notice
'
,
meta
:
{
meta
:
{
title
:
'
整改通知
'
,
title
:
'
整改通知
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/notice
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/notice
'
),
},
},
{
{
path
:
'
/noticeList
'
,
path
:
'
/noticeList
'
,
name
:
'
noticeList
'
,
name
:
'
noticeList
'
,
meta
:
{
meta
:
{
title
:
'
整改通知管理列表
'
,
title
:
'
整改通知管理列表
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/notice/noticeList
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/notice/noticeList
'
),
},
},
{
{
path
:
'
/sign
'
,
path
:
'
/sign
'
,
name
:
'
sign
'
,
name
:
'
sign
'
,
meta
:
{
meta
:
{
title
:
'
电子签名
'
,
title
:
'
电子签名
'
,
index
:
3
index
:
3
},
},
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/notice/noticeList/sign
'
),
component
:
()
=>
import
(
/* webpackChunkName: "create-order" */
'
../views/notice/noticeList/sign
'
),
},
},
// 登录页
// 登录页
{
{
path
:
'
/login2
'
,
path
:
'
/login2
'
,
name
:
'
login2
'
,
name
:
'
login2
'
,
meta
:
{
meta
:
{
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/Login2.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/Login2.vue
'
),
},
},
// 消息中心
// 消息中心
{
{
path
:
'
/message-center
'
,
path
:
'
/message-center
'
,
name
:
'
message-center
'
,
name
:
'
message-center
'
,
meta
:
{
meta
:
{
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/messageCenter
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/messageCenter
'
),
},
},
// 安全工作台页面
{
{
path
:
'
/save-workbench
'
,
path
:
'
/message-details
'
,
name
:
'
save-workbench
'
,
name
:
'
message-details
'
,
meta
:
{
meta
:
{
index
:
1
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/saveWorkbench
'
),
},
// 我的地盘页面
{
path
:
'
/my
'
,
name
:
'
my
'
,
meta
:
{
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/my
'
),
},
},
component
:
()
=>
import
(
'
../views/messageCenter/messageDetails
'
),
},
// 安全工作台页面
{
path
:
'
/save-workbench
'
,
name
:
'
save-workbench
'
,
meta
:
{
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/saveWorkbench
'
),
},
// 我的地盘页面
{
path
:
'
/my
'
,
name
:
'
my
'
,
meta
:
{
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/my
'
),
},
{
path
:
'
/add-danger
'
,
name
:
'
add-danger
'
,
meta
:
{
title
:
'
新增隐患
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/addDanger/addDanger
'
),
},
{
path
:
'
/choose-people
'
,
name
:
'
choose-people
'
,
meta
:
{
title
:
'
新增隐患
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/addDanger/manyChoosePeo
'
),
},
{
path
:
'
/report-return
'
,
name
:
'
report-return
'
,
meta
:
{
title
:
'
隐患上报已退回
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/reportReturn
'
),
},
{
{
path
:
'
/confirme-danger
'
,
path
:
'
/add-danger
'
,
name
:
'
confirme-danger
'
,
name
:
'
add-danger
'
,
meta
:
{
meta
:
{
title
:
'
隐患确认
'
,
title
:
'
新增隐患
'
,
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/confirmeDanger
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/addDanger/addDanger
'
),
},
},
{
path
:
'
/choose-people
'
,
name
:
'
choose-people
'
,
meta
:
{
title
:
'
新增隐患
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/addDanger/manyChoosePeo
'
),
},
{
{
path
:
'
/affirm-danger
'
,
path
:
'
/report-return
'
,
name
:
'
affirm-danger
'
,
name
:
'
report-return
'
,
meta
:
{
meta
:
{
title
:
'
隐患确认表单
'
,
title
:
'
隐患上报已退回
'
,
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/confirmeDanger/confirmeDanger
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/reportReturn
'
),
},
},
{
path
:
'
/change-danger
'
,
name
:
'
change-danger
'
,
meta
:
{
title
:
'
隐患整改
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/changeDanger
'
),
},
{
path
:
'
/change-info
'
,
name
:
'
change-info
'
,
meta
:
{
title
:
'
隐患整改保存
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/changeDanger/changeInfo
'
),
},
{
path
:
'
/delay-info
'
,
name
:
'
delay-info
'
,
meta
:
{
title
:
'
隐患整改延期
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/changeDanger/delayInfo
'
),
},
{
{
path
:
'
/review
-danger
'
,
path
:
'
/confirme
-danger
'
,
name
:
'
review
-danger
'
,
name
:
'
confirme
-danger
'
,
meta
:
{
meta
:
{
title
:
'
隐患复查
'
,
title
:
'
隐患确认
'
,
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/review
Danger
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/confirme
Danger
'
),
},
},
{
path
:
'
/affirm-danger
'
,
name
:
'
affirm-danger
'
,
meta
:
{
title
:
'
隐患确认表单
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/confirmeDanger/confirmeDanger
'
),
},
{
path
:
'
/change-danger
'
,
name
:
'
change-danger
'
,
meta
:
{
title
:
'
隐患整改
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/changeDanger
'
),
},
{
path
:
'
/change-info
'
,
name
:
'
change-info
'
,
meta
:
{
title
:
'
隐患整改保存
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/changeDanger/changeInfo
'
),
},
{
path
:
'
/delay-info
'
,
name
:
'
delay-info
'
,
meta
:
{
title
:
'
隐患整改延期
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/changeDanger/delayInfo
'
),
},
{
{
path
:
'
/review-add
'
,
path
:
'
/review-danger
'
,
name
:
'
review-add
'
,
name
:
'
review-danger
'
,
meta
:
{
meta
:
{
title
:
'
隐患复查新增
'
,
title
:
'
隐患复查
'
,
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/reviewDanger/reviewAdd
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/reviewDanger
'
),
},
},
{
path
:
'
/stand-book
'
,
name
:
'
stand-book
'
,
meta
:
{
title
:
'
隐患历史台账
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/standBook
'
),
},
{
path
:
'
/normal-detail
'
,
name
:
'
normal-detail
'
,
meta
:
{
title
:
'
隐患详情
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/standBook/normalDetail
'
),
},
// 隐患督办列表
{
path
:
'
/supervise-danger
'
,
name
:
'
supervise-danger
'
,
meta
:
{
title
:
'
隐患督办
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/superviseDanger
'
),
},
// 隐患督办批示
{
path
:
'
/super-survey
'
,
name
:
'
super-survey
'
,
meta
:
{
title
:
'
隐患督办
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/superviseDanger/superSurvey
'
),
},
// 重大隐患列表
{
path
:
'
/major-danger
'
,
name
:
'
major-danger
'
,
meta
:
{
title
:
'
重大隐患
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/majorDanger
'
),
},
// 重大隐患审批
{
path
:
'
/major-survey
'
,
name
:
'
major-survey
'
,
meta
:
{
title
:
'
重大隐患审批
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/majorDanger/majorSurvey
'
),
},
{
path
:
'
/review-add
'
,
name
:
'
review-add
'
,
meta
:
{
title
:
'
隐患复查新增
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/reviewDanger/reviewAdd
'
),
},
{
path
:
'
/stand-book
'
,
name
:
'
stand-book
'
,
meta
:
{
title
:
'
隐患历史台账
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/standBook
'
),
},
// 延期审批列表
{
{
path
:
'
/normal-detail
'
,
path
:
'
/delay-approval
'
,
name
:
'
normal-detail
'
,
name
:
'
delay-approval
'
,
meta
:
{
meta
:
{
title
:
'
隐患详情
'
,
title
:
'
延期审批
'
,
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/standBook/normalDetail
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/delayApproval
'
),
},
},
// 隐患督办列表
// 延期审批确定
{
{
path
:
'
/supervise-danger
'
,
path
:
'
/ratify-info
'
,
name
:
'
supervise-danger
'
,
name
:
'
ratify-info
'
,
meta
:
{
meta
:
{
title
:
'
隐患督办
'
,
title
:
'
延期审批
'
,
index
:
1
index
:
1
},
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/superviseDanger
'
),
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/delayApproval/ratifyInfo
'
),
},
},
// 隐患督办批示
{
path
:
'
/super-survey
'
,
name
:
'
super-survey
'
,
meta
:
{
title
:
'
隐患督办
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/superviseDanger/superSurvey
'
),
},
// 重大隐患列表
{
path
:
'
/major-danger
'
,
name
:
'
major-danger
'
,
meta
:
{
title
:
'
重大隐患
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/majorDanger
'
),
},
// 重大隐患审批
{
path
:
'
/major-survey
'
,
name
:
'
major-survey
'
,
meta
:
{
title
:
'
重大隐患审批
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/majorDanger/majorSurvey
'
),
},
// 项目经理督办列表
{
path
:
'
/manager-danger
'
,
name
:
'
manager-danger
'
,
meta
:
{
title
:
'
项目经理督办
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/managerDanger
'
),
},
// 项目经理督办批示
{
path
:
'
/manager-survey
'
,
name
:
'
manager-survey
'
,
meta
:
{
title
:
'
项目经理督办
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/managerDanger/managerSurvey
'
),
},
// 延期审批列表
{
path
:
'
/delay-approval
'
,
name
:
'
delay-approval
'
,
meta
:
{
title
:
'
延期审批
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/delayApproval
'
),
},
// 延期审批确定
{
path
:
'
/ratify-info
'
,
name
:
'
ratify-info
'
,
meta
:
{
title
:
'
延期审批
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/delayApproval/ratifyInfo
'
),
},
// 项目经理督办列表
{
path
:
'
/manager-danger
'
,
name
:
'
manager-danger
'
,
meta
:
{
title
:
'
项目经理督办
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/managerDanger
'
),
},
// 项目经理督办批示
{
path
:
'
/manager-survey
'
,
name
:
'
manager-survey
'
,
meta
:
{
title
:
'
项目经理督办
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/danger/managerDanger/managerSurvey
'
),
},
// 风险模块
{
path
:
'
/risk-add
'
,
name
:
'
risk-add
'
,
meta
:
{
title
:
'
风险上报
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAdd
'
),
},
{
path
:
'
/matrix-grad
'
,
name
:
'
matrix-grad
'
,
meta
:
{
title
:
'
矩阵式定级
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAdd/matrixGrad
'
),
},
{
path
:
'
/risk-return
'
,
name
:
'
risk-return
'
,
meta
:
{
title
:
'
风险上报退回列表
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskReturn
'
),
},
{
path
:
'
/risk-confirme
'
,
name
:
'
risk-confirme
'
,
meta
:
{
title
:
'
风险确认
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskConfirme
'
),
},
{
path
:
'
/risk-affirm
'
,
name
:
'
risk-affirm
'
,
meta
:
{
title
:
'
风险确认
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskConfirme/riskAffirm
'
),
},
{
path
:
'
/risk-account
'
,
name
:
'
risk-account
'
,
meta
:
{
title
:
'
风险历史台账
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAccount
'
),
},
{
path
:
'
/risk-big-detail
'
,
name
:
'
risk-big-detail
'
,
meta
:
{
title
:
'
风险详情
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAccount/riskBigDetail
'
),
},
{
// 风险模块
path
:
'
/insert-danger
'
,
{
name
:
'
insert-danger
'
,
path
:
'
/risk-add
'
,
meta
:{
name
:
'
risk-add
'
,
title
:
'
我的上报
'
,
meta
:
{
index
:
1
title
:
'
风险上报
'
,
},
index
:
1
component
:()
=>
import
(
'
@/views/danger/insertDanger/list
'
)
},
}
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAdd
'
),
},
{
path
:
'
/matrix-grad
'
,
name
:
'
matrix-grad
'
,
meta
:
{
title
:
'
矩阵式定级
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAdd/matrixGrad
'
),
},
{
path
:
'
/risk-return
'
,
name
:
'
risk-return
'
,
meta
:
{
title
:
'
风险上报退回列表
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskReturn
'
),
},
{
path
:
'
/risk-confirme
'
,
name
:
'
risk-confirme
'
,
meta
:
{
title
:
'
风险确认
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskConfirme
'
),
},
{
path
:
'
/risk-affirm
'
,
name
:
'
risk-affirm
'
,
meta
:
{
title
:
'
风险确认
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskConfirme/riskAffirm
'
),
},
{
path
:
'
/risk-account
'
,
name
:
'
risk-account
'
,
meta
:
{
title
:
'
风险历史台账
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAccount
'
),
},
{
path
:
'
/risk-big-detail
'
,
name
:
'
risk-big-detail
'
,
meta
:
{
title
:
'
风险详情
'
,
index
:
1
},
component
:
()
=>
import
(
/* webpackChunkName: "SaveWorkbench" */
'
../views/risk/riskAccount/riskBigDetail
'
),
},
{
path
:
'
/insert-danger
'
,
name
:
'
insert-danger
'
,
meta
:
{
title
:
'
我的上报
'
,
index
:
1
},
component
:
()
=>
import
(
'
@/views/danger/insertDanger/list
'
)
}
]
]
const
router
=
new
VueRouter
({
const
router
=
new
VueRouter
({
...
...
src/service/message.js
View file @
7af8103d
...
@@ -9,17 +9,94 @@ import request from '@/utils/axios'
...
@@ -9,17 +9,94 @@ import request from '@/utils/axios'
// })
// })
// }
// }
/* post请求 */
/* post请求 */
export
function
postMessgaelist
(
url
,
data
)
{
return
request
({
//消息信息列表
url
:
url
,
export
function
postMessgaelist
(
data
)
{
method
:
'
post
'
,
return
request
({
data
url
:
'
/messageInfo/list
'
,
})
method
:
'
post
'
,
data
})
}
//未读消息变为已读
export
function
noticeRemove
(
data
)
{
return
request
({
url
:
'
/messageInfo/changeRead
'
,
method
:
'
post
'
,
data
})
}
//清除未读消息列表
export
function
removeAllMessgae
(
data
)
{
return
request
({
url
:
"
/messageInfo/changeStatus
"
,
method
:
'
get
'
,
data
})
}
//删除已读消息
export
function
removeMessgae
(
data
)
{
return
request
({
url
:
"
/messageInfo/remove
"
,
method
:
'
post
'
,
data
})
}
}
export
function
noticeRemove
(
url
,
data
)
{
//待办事项列表
export
function
waitList
(
data
)
{
return
request
({
url
:
"
/backlogInfo/list
"
,
method
:
'
post
'
,
data
})
}
//未读消息数
export
function
badgeNumber
(
data
)
{
return
request
({
url
:
"
/backlogInfo/unReadCount
"
,
method
:
'
get
'
,
data
})
}
//删除已办事项
export
function
removeWaitList
(
data
)
{
return
request
({
url
:
"
/backlogInfo/remove
"
,
method
:
'
post
'
,
data
})
}
//通知公告列表
export
function
notificationList
(
data
)
{
return
request
({
url
:
"
/noticeInfo/list
"
,
method
:
'
post
'
,
data
})
}
//清除通知公告未读
export
function
removeAllNotification
(
data
)
{
return
request
({
url
:
"
/noticeInfo/changeStatus
"
,
method
:
'
get
'
,
data
})
}
//清除通知未读改为已读
export
function
readNotification
(
data
)
{
return
request
({
url
:
"
/noticeInfo/changeRead
"
,
method
:
'
post
'
,
data
})
}
//删除已读通知列表
export
function
removeNotification
(
data
)
{
return
request
({
return
request
({
url
:
url
,
url
:
"
/noticeInfo/remove
"
,
method
:
'
post
'
,
method
:
'
post
'
,
data
data
})
})
...
...
src/utils/axios.js
View file @
7af8103d
...
@@ -8,37 +8,37 @@
...
@@ -8,37 +8,37 @@
*/
*/
import
axios
from
'
axios
'
import
axios
from
'
axios
'
import
router
from
'
../router
'
import
router
from
'
../router
'
import
{
Toast
}
from
'
vant
'
;
import
{
Toast
}
from
'
vant
'
;
import
{
Notify
}
from
'
vant
'
;
import
{
Notify
}
from
'
vant
'
;
import
{
Dialog
}
from
'
vant
'
;
import
{
Dialog
}
from
'
vant
'
;
import
{
getToken
,
removeToken
}
from
'
@/utils/auth
'
// get token from cookie
import
{
getToken
,
removeToken
}
from
'
@/utils/auth
'
// get token from cookie
const
service
=
axios
.
create
({
const
service
=
axios
.
create
({
baseURL
:
'
/hse/app-api
'
,
//前缀路径
baseURL
:
'
/hse/app-api
'
,
//前缀路径
headers
:
{
//请求头部
headers
:
{
//请求头部
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"
content-type
"
:
"
application/json
"
,
"
content-type
"
:
"
application/json
"
,
"
data-type
"
:
"
json
"
"
data-type
"
:
"
json
"
}
}
})
})
//拦截接口请求
//拦截接口请求
service
.
interceptors
.
request
.
use
(
config
=>
{
service
.
interceptors
.
request
.
use
(
config
=>
{
if
(
getToken
())
{
if
(
getToken
())
{
config
.
headers
[
'
token
'
]
=
getToken
()
config
.
headers
[
'
token
'
]
=
getToken
()
}
}
return
config
return
config
},
error
=>
{
},
error
=>
{
return
Promise
.
reject
(
error
)
return
Promise
.
reject
(
error
)
})
})
service
.
interceptors
.
response
.
use
(
response
=>
{
service
.
interceptors
.
response
.
use
(
response
=>
{
const
res
=
response
.
data
//获取请求返回数据
const
res
=
response
.
data
//获取请求返回数据
const
code
=
response
.
status
//获取请求响应码
const
code
=
response
.
status
//获取请求响应码
if
(
code
==
200
)
{
//请求响应码200 代表已经请求到接口
if
(
code
==
200
)
{
//请求响应码200 代表已经请求到接口
if
(
res
.
code
===
0
)
{
//接口响应码0 代表接口代码运行正常
if
(
res
.
code
===
0
)
{
//接口响应码0 代表接口代码运行正常
return
res
return
res
}
else
if
(
res
.
code
===
301
)
{
}
else
if
(
res
.
code
===
301
)
{
// Notify({ type: 'danger', message: res.msg});
// Notify({ type: 'danger', message: res.msg});
return
res
return
res
}
else
if
(
res
.
code
===
403
)
{
}
else
if
(
res
.
code
===
403
)
{
Dialog
.
alert
({
Dialog
.
alert
({
title
:
'
提示
'
,
title
:
'
提示
'
,
message
:
res
.
msg
,
message
:
res
.
msg
,
...
@@ -47,14 +47,15 @@ service.interceptors.response.use(response => {
...
@@ -47,14 +47,15 @@ service.interceptors.response.use(response => {
removeToken
()
removeToken
()
location
.
reload
()
location
.
reload
()
});
});
}
else
{
return
res
}
}
}
else
{
}
else
{
Promise
.
reject
(
new
Error
(
'
Error
'
))
Promise
.
reject
(
new
Error
(
'
Error
'
))
}
}
},
err
=>
{
},
err
=>
{
Toast
.
fail
(
'
请求失败
'
);
Toast
.
fail
(
'
请求失败
'
);
return
Promise
.
reject
(
err
)
return
Promise
.
reject
(
err
)
})
})
export
default
service
export
default
service
\ No newline at end of file
src/views/messageCenter/index.vue
View file @
7af8103d
...
@@ -14,20 +14,28 @@
...
@@ -14,20 +14,28 @@
title-active-color=
"#000000"
title-active-color=
"#000000"
sticky
sticky
offset-top=
"1.333333rem"
offset-top=
"1.333333rem"
@
click=
"onClick"
>
>
<van-tab
title=
"待办事项"
name=
"待办事项"
:badge=
"messageNewsNum.待办事项 > 0 ? messageNewsNum.待办事项 : ''"
>
<wait-event
:actives=
"activeName"
></wait-event>
</van-tab>
<van-tab
<van-tab
title=
"消息信息"
title=
"消息信息"
name=
"消息信息"
name=
"消息信息"
:badge=
"messageNewsNum
> 0 ? messageNewsNum
: ''"
:badge=
"messageNewsNum
.消息信息 > 0 ? messageNewsNum.消息信息
: ''"
>
>
<message-news
@
messageLength=
"getMessageLength"
></message-news>
<message-news
:actives=
"activeName"
></message-news>
</van-tab>
<van-tab
title=
""
name=
""
disabled
badge=
""
>
<wait-event></wait-event>
</van-tab>
</van-tab>
<van-tab
title=
""
name=
""
disabled
badge=
""
>
<van-tab
<notice-info></notice-info>
title=
"通知公告"
name=
"通知公告"
:badge=
"messageNewsNum.通知公告 > 0 ? messageNewsNum.通知公告 : ''"
>
<notice-info
:actives=
"activeName"
></notice-info>
</van-tab>
</van-tab>
</van-tabs>
</van-tabs>
</div>
</div>
...
@@ -42,6 +50,7 @@ import messageNews from "./messageNews";
...
@@ -42,6 +50,7 @@ import messageNews from "./messageNews";
import
waitEvent
from
"
./waitEvent
"
;
import
waitEvent
from
"
./waitEvent
"
;
import
noticeInfo
from
"
./noticeInfo
"
;
import
noticeInfo
from
"
./noticeInfo
"
;
import
tabBar
from
"
@/components/TabBar
"
;
import
tabBar
from
"
@/components/TabBar
"
;
import
{
badgeNumber
}
from
"
@/service/message
"
;
export
default
{
export
default
{
components
:
{
components
:
{
messageNews
,
messageNews
,
...
@@ -51,18 +60,34 @@ export default {
...
@@ -51,18 +60,34 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
activeName
:
"
消息信息
"
,
activeName
:
""
,
messageNewsNum
:
""
,
messageNewsNum
:
{}
,
searchValue
:
''
searchValue
:
""
,
};
};
},
},
created
()
{
this
.
activeName
=
sessionStorage
.
getItem
(
"
activeNames
"
)
?
sessionStorage
.
getItem
(
"
activeNames
"
)
:
""
;
// this.activeName = actives;
this
.
getBadgeNumber
();
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
onSearch
(){
onClick
(
e
)
{
this
.
activeName
=
e
;
sessionStorage
.
setItem
(
"
activeNames
"
,
e
);
sessionStorage
.
setItem
(
"
activeIndex
"
,
0
);
this
.
getBadgeNumber
();
},
onSearch
()
{
console
.
log
(
"
[ 1111 ]
"
,
1111
);
},
},
getMessageLength
(
len
)
{
//获取未读消息数
this
.
messageNewsNum
=
len
;
getBadgeNumber
()
{
badgeNumber
().
then
((
res
)
=>
{
this
.
messageNewsNum
=
res
.
data
;
});
},
},
},
},
};
};
...
...
src/views/messageCenter/messageDetails/index.vue
0 → 100644
View file @
7af8103d
<
template
>
<div>
<LHeader
:text=
"text"
></LHeader>
<van-cell-group
inset
>
<div
class=
"messgae-title"
>
<span>
{{
messageList
.
noticeTitle
}}
</span>
<span>
{{
messageList
.
sendTime
}}
</span>
</div>
<div
class=
"message-content"
>
{{
messageList
.
upcomingUserName
}}
,您好!您有一条来自
{{
messageList
.
createUserName
}}
的
{{
messageList
.
noticeTitle
}}
相关的待处理任务...
</div>
</van-cell-group>
</div>
</
template
>
<
script
>
import
{
Toast
}
from
"
vant
"
;
import
LHeader
from
"
@/components/header.vue
"
;
export
default
{
components
:
{
LHeader
,
},
data
()
{
return
{
messageList
:
{},
text
:
"
消息详情
"
,
messageCategory
:
[
{
key
:
"
0
"
,
category
:
"
全部
"
,
},
{
key
:
"
1
"
,
category
:
"
已办
"
,
},
{
key
:
"
2
"
,
category
:
"
待办
"
,
},
],
activeIndex
:
0
,
searchVal
:
""
,
waitList
:
[],
// 待办列表
// refreshing: false, // 下拉刷新开关
// loading: false, // 列表滚动到底部会触发load事件
// finished: false // 列表数据全部加载完成
};
},
mounted
()
{},
created
()
{
this
.
messageList
=
JSON
.
parse
(
this
.
$route
.
params
.
id
);
console
.
log
(
"
%c [ this.messageList ]
"
,
"
font-size:13px; background:pink; color:#bf2c9f;
"
,
this
.
messageList
);
},
methods
:
{
// 点击类别
selectCategory
(
index
,
data
)
{
this
.
activeIndex
=
index
;
},
// 搜索事件
onSearch
(
val
)
{
if
(
val
!==
""
)
{
console
.
log
(
this
.
search
);
}
},
// // 下拉刷新事件
// onRefresh() {
// // 清空列表数据
// this.finished = false;
// // 重新加载数据
// // 将 loading 设置为 true,表示处于加载状态
// this.loading = true;
// this.onLoad();
// },
// // 列表初始化函数
// onLoad() {
// setTimeout(() => {
// if (this.refreshing) {
// this.refreshing = false;
// }
// // 加载完成后将loading改成 false
// this.loading = false;
// // 为什么会连续触发 load 事件? 先加上这句 this.finished = true; 以后再删
// // this.finished = true;
// // 如果列表数据全部加载完成 则将finished改为true
// // if (this.list.length >= 40) {
// // this.finished = true;
// // }
// }, 5000);
// }
},
};
</
script
>
<
style
lang=
"less"
scoped
>
/* @import url(); 引入css类 */
.message-wrap {
padding: 10px 10px 0;
background-color: #f0f1f5;
// 标签
.category-wrap {
.my-tag-style {
width: 75px;
height: 21px;
font-size: 13px;
border: 1px solid #1989fa;
border-radius: 4px;
color: #1989fa;
display: inline-block;
text-align: center;
line-height: 21px;
margin-right: 10px;
}
.active {
color: white;
background-color: #1989fa;
}
}
// 搜索
.search-wrap {
margin: 10px 0;
.van-search {
border-radius: 5px;
padding: 5px 12px;
}
.van-search__content {
background-color: #ffffff;
}
}
// 内容
.con-list {
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
.message-content {
margin-top: 10px;
}
}
}
}
</
style
>
src/views/messageCenter/messageNews/index.vue
View file @
7af8103d
<
template
>
<
template
>
<div>
<div>
<div
class=
"message-wrap"
>
<van-pull-refresh
<!-- 标签 -->
v-model=
"isLoading"
<div
class=
"category-wrap"
>
success-text=
"刷新成功"
<span
@
refresh=
"onRefresh"
class=
"my-tag-style"
>
:class=
"index == activeIndex ? 'active' : ''"
<div
class=
"message-wrap"
>
v-for=
"(item, index) in messageCategory"
<!-- 标签 -->
:key=
"item.key"
<div
class=
"category-wrap"
>
@
click=
"clickCategory(index, item.category)"
<span
>
{{
item
.
category
}}
</span
class=
"my-tag-style"
>
:class=
"index == activeIndex ? 'active' : ''"
</div>
v-for=
"(item, index) in messageCategory"
:key=
"item.key"
@
click=
"clickCategory(index, item.category)"
>
{{
item
.
category
}}
</span
>
<!-- 搜索 -->
<span
class=
"my-tag-style"
@
click=
"clearNo()"
>
清除未读
</span>
<div
class=
"search-wrap"
>
</div>
<van-search
v-model=
"searchVal"
<!-- 搜索 -->
show-action
<div
class=
"search-wrap"
>
placeholder=
"请输入消息内容"
<van-search
@
search=
"onSearch"
v-model=
"searchVal"
>
show-action
<template
#action
>
placeholder=
"请输入消息内容"
<div
@
click=
"onSearch"
>
搜索
</div>
@
search=
"onSearch"
</
template
>
>
</van-search>
<template
#action
>
<!-- <van-search v-model="searchVal" placeholder="搜索" @search="onSearch" /> -->
<div
@
click=
"onSearch"
>
搜索
</div>
</div>
</
template
>
<!-- 内容列表 -->
</van-search>
<div
class=
"con-list"
@
touchmove=
"showIndex = null"
>
</div>
<!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<!-- 内容列表 -->
<div
class=
"con-list"
@
touchmove=
"showIndex = null"
>
<!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
<van-list
v-model="loading"
v-model="loading"
:finished="finished"
:finished="finished"
finished-text="没有更多了"
finished-text="没有更多了"
@load="onLoad"
@load="onLoad"
> -->
> -->
<van-cell-group
<van-cell-group
inset
inset
v-for=
"(item, index) in messageList"
v-for=
"(item, index) in messageList"
:key=
"index"
:key=
"index"
@
click=
"touchstart(index, item)"
@
click=
"touchstart(index, item)"
>
>
<!--@touchend.prevent="touchend(index)" 长按备份-->
<van-badge
:dot=
"item.status == 0 ? true : false"
>
<div
class=
"messgae-title"
>
<div
style=
"padding: 10px; min-width: calc(100vw - 1.6rem)"
>
<span>
{{ item.noticeTitle }}
</span>
<span>
{{ item.sendTime }}
</span>
<!--@touchend.prevent="touchend(index)" 长按备份-->
</div>
<div
class=
"messgae-title"
>
<div
class=
"message-content"
>
<span>
{{ item.title }}
</span>
{{ item.upcomingUserName }},您好!您有一条来自{{
<span>
{{ item.createTime }}
</span>
item.createUserName
</div>
}}的{{ item.noticeTitle }}相关的待处理任务...
<div
class=
"message-content"
>
</div>
{{ item.messageBy }},您好!您有一条来自{{ item.menuName }}的{{
item.content
<!-- 长按显示遮罩层 -->
}}相关的待处理任务...
</div>
<van-overlay
:show=
"showIndex == index"
v-if=
"item.status == '未读'"
>
</div>
<div
class=
"wrapper"
@
click.stop=
"showIndex = null"
>
</van-badge>
<!-- <van-button round type="primary" @click="goDetail(item)"
</van-cell-group>
>查看</van-button
</div>
> -->
<van-button
round
type=
"info"
@
click=
"read(item)"
v-if=
"item.status == '未读'"
>
已读
</van-button
>
</div>
</van-overlay>
</van-cell-group>
<!-- </van-list>
</van-pull-refresh> -->
</div>
</div>
</
div
>
</
van-pull-refresh
>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
postMessgaelist
,
noticeRemove
}
from
"
@/service/message
"
;
import
{
postMessgaelist
,
noticeRemove
,
removeAllMessgae
,
removeMessgae
,
}
from
"
@/service/message
"
;
export
default
{
export
default
{
props
:
{
actives
:
String
,
default
:
()
=>
""
,
},
data
()
{
data
()
{
return
{
return
{
isLoading
:
false
,
show
:
false
,
messageCategory
:
[
messageCategory
:
[
{
{
key
:
"
0
"
,
key
:
"
0
"
,
...
@@ -109,136 +112,132 @@ export default {
...
@@ -109,136 +112,132 @@ export default {
};
};
},
},
created
()
{
created
()
{
this
.
unRead
();
this
.
activeIndex
=
sessionStorage
.
getItem
(
"
activeIndex
"
)
?
sessionStorage
.
getItem
(
"
activeIndex
"
)
:
0
;
this
.
setMessage
();
this
.
getMessageSort
();
},
},
methods
:
{
methods
:
{
//下拉刷新
onRefresh
()
{
setTimeout
(()
=>
{
this
.
$toast
(
"
刷新成功
"
);
this
.
isLoading
=
false
;
this
.
getMessageSort
();
this
.
$parent
.
$parent
.
$parent
.
$parent
.
getBadgeNumber
();
},
1000
);
},
// 点击类别
// 点击类别
clickCategory
(
index
,
data
)
{
clickCategory
(
index
,
data
)
{
// 关闭遮罩层
this
.
showIndex
=
null
;
this
.
activeIndex
=
index
;
this
.
activeIndex
=
index
;
this
.
getMessageSort
();
this
.
activeVal
=
this
.
messageCategory
[
index
].
category
;
this
.
activeVal
=
this
.
messageCategory
[
index
].
category
;
// 点击全部还是已读还是未读
// 点击全部还是已读还是未读
this
.
se
lectCategory
(
data
);
this
.
se
tMessage
(
);
},
},
// 搜索事件
// 搜索事件
onSearch
(
val
)
{
onSearch
(
val
)
{
this
.
selectCategory
(
this
.
activeVal
,
this
.
searchVal
);
if
(
this
.
activeIndex
==
0
)
{
},
// 封装全部 已读 和 未读的方法
selectCategory
(
data
,
val
=
""
)
{
if
(
data
==
"
全部
"
)
{
if
(
val
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
noticeContent
"
,
val
);
this
.
getMessageList
(
formData
);
}
else
{
this
.
getMessageList
();
}
}
else
{
let
formData
=
new
FormData
();
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
data
);
formData
.
append
(
"
status
"
,
0
);
if
(
val
)
{
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
formData
.
append
(
"
noticeContent
"
,
val
);
this
.
getMessageList
(
formData
);
}
}
else
if
(
this
.
activeIndex
==
1
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
1
);
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getMessageList
(
formData
);
}
else
if
(
this
.
activeIndex
==
2
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getMessageList
(
formData
);
this
.
getMessageList
(
formData
);
}
}
},
},
// 点击消息条目时的点击事件 变成已读
setMessage
()
{
sessionStorage
.
setItem
(
"
activeNames
"
,
this
.
actives
);
sessionStorage
.
setItem
(
"
activeIndex
"
,
this
.
activeIndex
);
},
read
(
data
)
{
read
(
data
)
{
// 判断showIndex是否等于null 如果不等于则先将showIndex改为null
if
(
data
.
status
==
0
)
{
this
.
showIndex
=
null
;
if
(
data
.
status
==
"
未读
"
)
{
let
formData
=
new
FormData
();
let
formData
=
new
FormData
();
formData
.
append
(
"
id
s
"
,
data
.
p
id
);
formData
.
append
(
"
id
"
,
data
.
id
);
noticeRemove
(
"
/mobile/noticeRemove
"
,
formData
).
then
((
res
)
=>
{
noticeRemove
(
formData
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
// 如果请求接口成功 则重新请求一下未读消息的条数
// 如果请求接口成功 则重新请求一下未读消息的条数
this
.
unRead
();
this
.
getMessageSort
();
// 重新请求对应的接口 刷新列表数据
let
val
=
this
.
activeVal
;
this
.
selectCategory
(
val
);
}
}
});
});
}
}
},
},
//根据类别请求接口
// 请求有多少未读消息的接口
getMessageSort
()
{
unRead
(
)
{
if
(
this
.
activeIndex
==
0
)
{
let
formData
=
new
FormData
();
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
"
未读
"
);
formData
.
append
(
"
status
"
,
0
);
postMessgaelist
(
"
/mobile/notice
"
,
formData
).
then
((
res
)
=>
{
this
.
getMessageList
(
formData
);
if
(
res
.
code
==
0
)
{
}
else
if
(
this
.
activeIndex
==
1
)
{
// 向父组件发送消息条数
let
formData
=
new
FormData
();
this
.
$emit
(
"
messageLength
"
,
res
.
total
);
formData
.
append
(
"
status
"
,
1
);
// 给消息列表赋值
this
.
getMessageList
(
formData
);
this
.
messageList
=
res
.
rows
;
}
else
if
(
this
.
activeIndex
==
2
)
{
}
this
.
getMessageList
();
}
);
}
},
},
// 请求消息接口方法
// 请求消息接口方法
getMessageList
(
data
)
{
postMessgaelist
(
"
/mobile/notice
"
,
data
).
then
((
res
)
=>
{
getMessageList
(
Data
)
{
postMessgaelist
(
Data
).
then
((
res
)
=>
{
this
.
messageList
=
res
.
rows
;
this
.
messageList
=
res
.
rows
;
});
});
},
},
// // 下拉刷新事件
// onRefresh() {
// // 清空列表数据
// this.finished = false;
// // 重新加载数据
// // 将 loading 设置为 true,表示处于加载状态
// this.loading = true;
// this.onLoad();
// },
// // 列表初始化函数
// onLoad() {
// setTimeout(() => {
// if (this.refreshing) {
// this.refreshing = false;
// }
// // 加载完成后将loading改成 false
// this.loading = false;
// // 为什么会连续触发 load 事件? 先加上这句 this.finished = true; 以后再删
// // this.finished = true;
// // 如果列表数据全部加载完成 则将finished改为true
// // if (this.list.length >= 40) {
// // this.finished = true;
// // }
// }, 5000);
// }
touchstart
(
index
,
item
)
{
touchstart
(
index
,
item
)
{
// clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
this
.
read
(
item
);
if
(
this
.
showIndex
!=
null
)
{
this
.
$router
.
push
({
this
.
showIndex
=
null
;
name
:
"
message-details
"
,
return
;
params
:
{
}
id
:
JSON
.
stringify
(
item
),
this
.
showIndex
=
index
;
},
// this.Loop = setTimeout(
});
// function() {
// this.showIndex = index;
// }.bind(this),
// 0
// ); // 这里的1000是指需要长按的时间,单位为ms
},
},
// touchend(index) {
// // 这个方法主要是用来将每次手指移出之后将计时器清零 长按备份
// clearTimeout(this.Loop);
// },
// 详情
//清除所有未读
goDetail
(
data
)
{
clearNo
()
{
this
.
showIndex
=
null
;
this
.
$dialog
.
confirm
({
title
:
"
提示
"
,
message
:
"
确定清楚所有未读内容内容
"
,
confirmButtonColor
:
"
#1989FA
"
,
})
.
then
(()
=>
{
removeAllMessgae
()
.
then
((
res
)
=>
{
if
(
res
.
code
==
"
0
"
)
{
this
.
$notify
({
type
:
"
success
"
,
message
:
"
清楚成功
"
});
this
.
$parent
.
$parent
.
$parent
.
$parent
.
getBadgeNumber
();
this
.
getMessageSort
();
}
else
{
this
.
$notify
({
type
:
"
primary
"
,
message
:
"
没有未读消息可以清除
"
,
});
}
})
.
catch
((
err
)
=>
{
console
.
log
(
"
%c [ err ]
"
,
"
font-size:13px; background:pink; color:#bf2c9f;
"
,
err
);
});
})
.
catch
(()
=>
{
// on cancel
});
},
},
},
},
};
};
...
@@ -246,6 +245,7 @@ export default {
...
@@ -246,6 +245,7 @@ export default {
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
/* @import url(); 引入css类 */
/* @import url(); 引入css类 */
.message-wrap {
.message-wrap {
min-height: 58vh;
padding: 10px 10px 0;
padding: 10px 10px 0;
background-color: #f0f1f5;
background-color: #f0f1f5;
// 标签
// 标签
...
...
src/views/messageCenter/noticeInfo/index.vue
View file @
7af8103d
<
template
>
<
template
>
<div>
<div>
<div
class=
"message-wrap"
>
<van-pull-refresh
<!-- 标签 -->
v-model=
"isLoading"
<div
class=
"category-wrap"
>
success-text=
"刷新成功"
<!--
<span
class=
"my-tag-style active"
>
全部
</span>
@
refresh=
"onRefresh"
>
<div
class=
"message-wrap"
>
<!-- 标签 -->
<div
class=
"category-wrap"
>
<!--
<span
class=
"my-tag-style active"
>
全部
</span>
<span
class=
"my-tag-style"
>
已读
</span>
<span
class=
"my-tag-style"
>
已读
</span>
<span
class=
"my-tag-style"
>
未读
</span>
-->
<span
class=
"my-tag-style"
>
未读
</span>
-->
<span
<span
class=
"my-tag-style"
class=
"my-tag-style"
:class=
"index == activeIndex ? 'active' : ''"
:class=
"index == activeIndex ? 'active' : ''"
v-for=
"(item, index) in messageCategory"
v-for=
"(item, index) in messageCategory"
:key=
"item.key"
:key=
"item.key"
@
click=
"selectCategory(index, item.category)"
@
click=
"selectCategory(index, item.category)"
>
{{
item
.
category
}}
</span
>
{{
item
.
category
}}
</span
>
>
</div>
<span
class=
"my-tag-style"
@
click=
"clearNo()"
>
清除未读
</span>
</div>
<!-- 搜索 -->
<!-- 搜索 -->
<div
class=
"search-wrap"
>
<div
class=
"search-wrap"
>
<!--
<van-search
<!--
<van-search
v-model=
"searchVal"
v-model=
"searchVal"
show-action
show-action
placeholder=
"请输入检查名称"
placeholder=
"请输入检查名称"
...
@@ -28,45 +34,63 @@
...
@@ -28,45 +34,63 @@
<div
@
click=
"onSearch"
>
搜索
</div>
<div
@
click=
"onSearch"
>
搜索
</div>
</
template
>
</
template
>
</van-search>
-->
</van-search>
-->
<!-- <van-search
<!-- <van-search
v-model="searchVal"
v-model="searchVal"
placeholder="搜索"
placeholder="搜索"
@search="onSearch"
@search="onSearch"
@confirm="onSearch"
@confirm="onSearch"
/> -->
/> -->
</div>
</div>
<!-- 内容列表 -->
<!-- 内容列表 -->
<div
class=
"con-list"
>
<div
class=
"con-list"
>
<!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-cell-group
<van-list
inset
v-model="loading"
v-for=
"(item, index) in notificationList"
:finished="finished"
:key=
"index"
finished-text="没有更多了"
@
click=
"touchstart(index, item)"
@load="onLoad"
>
> -->
<van-badge
:dot=
"item.status == 0 ? true : false"
>
<!-- <van-cell-group inset>
<div
style=
"padding: 10px; min-width: calc(100vw - 1.6rem)"
>
<div class="messgae-title">隐患确认信息</div>
<div
class=
"messgae-title"
>
<div class="message-content">
<span>
{{ item.title }}
</span>
张大海已确认一般隐患B类,右万宝宝负责整改。
<span>
{{ item.createTime }}
</span>
</div>
<div
class=
"mse_title"
>
{{ item.title }}
</div>
<div
class=
"message-content"
>
{{ item.content }}
</div>
</div>
</div>
</van-
cell-group> --
>
</van-
badge
>
<!-- </van-list
>
</van-cell-group
>
</
van-pull-refresh> --
>
</
div
>
</div>
</div>
</
div
>
</
van-pull-refresh
>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
Toast
}
from
"
vant
"
;
import
{
Toast
}
from
"
vant
"
;
import
{
notificationList
,
removeAllNotification
,
readNotification
,
removeNotification
,
}
from
"
@/service/message
"
;
export
default
{
export
default
{
props
:
{
actives
:
String
,
default
:
()
=>
""
,
},
data
()
{
data
()
{
return
{
return
{
isLoading
:
false
,
messageCategory
:
[
messageCategory
:
[
{
{
key
:
"
0
"
,
key
:
"
0
"
,
category
:
"
全部
"
,
category
:
"
未读
"
,
},
},
{
{
key
:
"
1
"
,
key
:
"
1
"
,
...
@@ -74,65 +98,148 @@ export default {
...
@@ -74,65 +98,148 @@ export default {
},
},
{
{
key
:
"
2
"
,
key
:
"
2
"
,
category
:
"
未读
"
,
category
:
"
全部
"
,
},
},
],
],
activeIndex
:
0
,
activeIndex
:
0
,
searchVal
:
""
,
searchVal
:
""
,
notificationList
:
[],
// refreshing: false, // 下拉刷新开关
// refreshing: false, // 下拉刷新开关
// loading: false, // 列表滚动到底部会触发load事件
// loading: false, // 列表滚动到底部会触发load事件
// finished: false // 列表数据全部加载完成
// finished: false // 列表数据全部加载完成
};
};
},
},
mounted
()
{},
mounted
()
{},
created
()
{
this
.
activeIndex
=
sessionStorage
.
getItem
(
"
activeIndex
"
)
?
sessionStorage
.
getItem
(
"
activeIndex
"
)
:
0
;
this
.
getNotificationSort
();
this
.
setMessage
();
},
methods
:
{
methods
:
{
//下拉刷新
onRefresh
()
{
setTimeout
(()
=>
{
this
.
$toast
(
"
刷新成功
"
);
this
.
isLoading
=
false
;
this
.
getNotificationSort
();
this
.
$parent
.
$parent
.
$parent
.
$parent
.
getBadgeNumber
();
},
1000
);
},
// 点击类别
// 点击类别
selectCategory
(
index
,
data
)
{
selectCategory
(
index
,
data
)
{
this
.
activeIndex
=
index
;
this
.
activeIndex
=
index
;
this
.
getNotificationSort
();
this
.
setMessage
();
},
},
// 搜索事件
// 搜索事件
onSearch
(
val
)
{
onSearch
(
val
)
{
if
(
val
!==
""
)
{
if
(
this
.
activeIndex
==
0
)
{
console
.
log
(
this
.
searchVal
);
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
0
);
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getNotificationList
(
formData
);
}
else
if
(
this
.
activeIndex
==
1
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
1
);
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getNotificationList
(
formData
);
}
else
if
(
this
.
activeIndex
==
2
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getNotificationList
(
formData
);
}
}
},
},
// // 下拉刷新事件
setMessage
()
{
// onRefresh() {
sessionStorage
.
setItem
(
"
activeNames
"
,
this
.
actives
);
// // 清空列表数据
sessionStorage
.
setItem
(
"
activeIndex
"
,
this
.
activeIndex
);
// this.finished = false;
},
//点击消息条目时的点击事件 变成已读
// // 重新加载数据
read
(
data
)
{
// // 将 loading 设置为 true,表示处于加载状态
if
(
data
.
status
==
0
)
{
// this.loading = true;
let
formData
=
new
FormData
();
// this.onLoad();
formData
.
append
(
"
id
"
,
data
.
id
);
// },
readNotification
(
formData
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
// // 列表初始化函数
this
.
getNotificationSort
();
// onLoad() {
}
// setTimeout(() => {
});
// if (this.refreshing) {
}
// this.refreshing = false;
},
// }
//根据类别请求接口
getNotificationSort
()
{
// // 加载完成后将loading改成 false
if
(
this
.
activeIndex
==
0
)
{
// this.loading = false;
let
formData
=
new
FormData
();
// // 为什么会连续触发 load 事件? 先加上这句 this.finished = true; 以后再删
formData
.
append
(
"
status
"
,
0
);
// // this.finished = true;
this
.
getNotificationList
(
formData
);
}
else
if
(
this
.
activeIndex
==
1
)
{
// // 如果列表数据全部加载完成 则将finished改为true
let
formData
=
new
FormData
();
// // if (this.list.length >= 40) {
formData
.
append
(
"
status
"
,
1
);
// // this.finished = true;
this
.
getNotificationList
(
formData
);
// // }
}
else
if
(
this
.
activeIndex
==
2
)
{
// }, 5000);
this
.
getNotificationList
();
// }
}
},
//请求通知全部公告列表
getNotificationList
(
Data
)
{
notificationList
(
Data
).
then
((
res
)
=>
{
this
.
notificationList
=
res
.
rows
;
});
},
touchstart
(
index
,
item
)
{
this
.
read
(
item
);
this
.
$router
.
push
({
name
:
"
message-details
"
,
params
:
{
id
:
JSON
.
stringify
(
item
),
},
});
},
//清除未读
clearNo
()
{
this
.
$dialog
.
confirm
({
title
:
"
提示
"
,
message
:
"
确定清楚所有未读内容内容
"
,
confirmButtonColor
:
"
#1989FA
"
,
})
.
then
(()
=>
{
removeAllNotification
()
.
then
((
res
)
=>
{
if
(
res
.
code
==
"
0
"
)
{
this
.
$notify
({
type
:
"
success
"
,
message
:
"
清楚成功
"
});
this
.
$parent
.
$parent
.
$parent
.
$parent
.
getBadgeNumber
();
this
.
getNotificationSort
();
}
else
{
this
.
$notify
({
type
:
"
primary
"
,
message
:
"
没有未读消息可以清除
"
,
});
}
})
.
catch
((
err
)
=>
{
console
.
log
(
"
%c [ err ]
"
,
"
font-size:13px; background:pink; color:#bf2c9f;
"
,
err
);
});
})
.
catch
(()
=>
{
// on cancel
});
},
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
/* @import url(); 引入css类 */
/* @import url(); 引入css类 */
.message-wrap {
.message-wrap {
min-height: 58vh;
padding: 10px 10px 0;
padding: 10px 10px 0;
background-color: #f0f1f5;
background-color: #f0f1f5;
// 标签
// 标签
...
@@ -172,10 +279,22 @@ export default {
...
@@ -172,10 +279,22 @@ export default {
margin-bottom: 10px;
margin-bottom: 10px;
padding: 10px;
padding: 10px;
font-size: 13px;
font-size: 13px;
.messgae-title {
.mse_title {
margin-top: 10px;
}
}
.message-content {
.message-content {
margin-top: 10px;
margin-top: 10px;
text-indent: 28px;
}
.messgae-title {
display: flex;
justify-content: space-between;
align-items: center;
}
.bot_but {
display: flex;
justify-content: right;
align-items: center;
}
}
}
}
}
}
...
...
src/views/messageCenter/waitEvent/index.vue
View file @
7af8103d
<
template
>
<
template
>
<div>
<div>
<div
class=
"message-wrap"
>
<van-pull-refresh
<!-- 标签 -->
v-model=
"isLoading"
<div
class=
"category-wrap"
>
success-text=
"刷新成功"
<!--
<span
class=
"my-tag-style active"
>
全部
</span>
@
refresh=
"onRefresh"
>
<div
class=
"message-wrap"
>
<!-- 标签 -->
<div
class=
"category-wrap"
>
<!--
<span
class=
"my-tag-style active"
>
全部
</span>
<span
class=
"my-tag-style"
>
已读
</span>
<span
class=
"my-tag-style"
>
已读
</span>
<span
class=
"my-tag-style"
>
未读
</span>
-->
<span
class=
"my-tag-style"
>
未读
</span>
-->
<span
<span
class=
"my-tag-style"
class=
"my-tag-style"
:class=
"index == activeIndex ? 'active' : ''"
:class=
"index == activeIndex ? 'active' : ''"
v-for=
"(item, index) in messageCategory"
v-for=
"(item, index) in messageCategory"
:key=
"item.key"
:key=
"item.key"
@
click=
"selectCategory(index, item.category)"
@
click=
"selectCategory(index, item.category)"
>
{{
item
.
category
}}
</span
>
{{
item
.
category
}}
</span
>
>
</div>
</div>
<!-- 搜索 -->
<!-- 搜索 -->
<div
class=
"search-wrap"
>
<div
class=
"search-wrap"
>
<van-search
<van-search
v-model=
"searchVal"
v-model=
"searchVal"
show-action
show-action
placeholder=
"请输入检查名称"
placeholder=
"请输入检查名称"
@
search=
"onSearch"
@
search=
"onSearch"
>
>
<template
#action
>
<template
#action
>
<div
@
click=
"onSearch"
>
搜索
</div>
<div
@
click=
"onSearch"
>
搜索
</div>
</
template
>
</
template
>
</van-search>
</van-search>
</div>
</div>
<!-- 内容列表 -->
<!-- 内容列表 -->
<div
class=
"con-list"
>
<div
class=
"con-list"
>
<!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-cell-group
<van-list
inset
v-model="loading"
v-for=
"(item, index) in waitList"
:finished="finished"
:key=
"index"
finished-text="没有更多了"
@
click=
"touchstart(index, item)"
@load="onLoad"
>
> -->
<van-badge
:dot=
"item.status == 0 ? true : false"
>
<!-- <van-cell-group inset>
<div
style=
"padding: 10px; min-width: calc(100vw - 1.6rem)"
>
<div class="messgae-title">隐患确认信息</div>
<div
class=
"messgae-title"
>
<div class="message-content">
<span>
{{ item.title }}
</span>
张大海已确认一般隐患B类,右万宝宝负责整改。
<span>
{{ item.createTime }}
</span>
</div>
<div
class=
"message-content"
>
{{ item.content }}
</div>
<div
class=
"bot_but"
>
<van-button
color=
"#33CCFF"
size=
"mini"
>
立即处理
</van-button>
</div>
</div>
</div>
</van-
cell-group> --
>
</van-
badge
>
<!-- </van-list
>
</van-cell-group
>
</
van-pull-refresh> --
>
</
div
>
</div>
</div>
</
div
>
</
van-pull-refresh
>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
Toast
}
from
"
vant
"
;
import
{
Toast
}
from
"
vant
"
;
import
{
waitList
,
removeWaitList
}
from
"
@/service/message
"
;
export
default
{
export
default
{
props
:
{
actives
:
String
,
default
:
()
=>
""
,
},
data
()
{
data
()
{
return
{
return
{
isLoading
:
false
,
messageCategory
:
[
messageCategory
:
[
{
{
key
:
"
0
"
,
key
:
"
0
"
,
category
:
"
全部
"
,
category
:
"
待办
"
,
},
},
{
{
key
:
"
1
"
,
key
:
"
1
"
,
category
:
"
已
读
"
,
category
:
"
已
办
"
,
},
},
{
{
key
:
"
2
"
,
key
:
"
2
"
,
category
:
"
未读
"
,
category
:
"
全部
"
,
},
},
],
],
activeIndex
:
0
,
activeIndex
:
0
,
searchVal
:
""
,
searchVal
:
""
,
waitList
:
[],
// 待办列表
// refreshing: false, // 下拉刷新开关
// refreshing: false, // 下拉刷新开关
// loading: false, // 列表滚动到底部会触发load事件
// loading: false, // 列表滚动到底部会触发load事件
// finished: false // 列表数据全部加载完成
// finished: false // 列表数据全部加载完成
};
};
},
},
mounted
()
{},
mounted
()
{},
created
()
{
this
.
activeIndex
=
sessionStorage
.
getItem
(
"
activeIndex
"
)
?
sessionStorage
.
getItem
(
"
activeIndex
"
)
:
0
;
this
.
getWaitSort
();
this
.
setMessage
();
},
methods
:
{
methods
:
{
//下拉刷新
onRefresh
()
{
setTimeout
(()
=>
{
this
.
$toast
(
"
刷新成功
"
);
this
.
isLoading
=
false
;
this
.
getWaitSort
();
this
.
$parent
.
$parent
.
$parent
.
$parent
.
getBadgeNumber
();
},
1000
);
},
// 点击类别
// 点击类别
selectCategory
(
index
,
data
)
{
selectCategory
(
index
,
data
)
{
this
.
activeIndex
=
index
;
this
.
activeIndex
=
index
;
this
.
getWaitSort
();
this
.
setMessage
();
},
},
// 搜索事件
// 搜索事件
onSearch
(
val
)
{
onSearch
(
val
)
{
if
(
val
!==
""
)
{
if
(
this
.
activeIndex
==
0
)
{
console
.
log
(
this
.
search
)
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
0
);
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getWaitList
(
formData
);
}
else
if
(
this
.
activeIndex
==
1
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
1
);
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getWaitList
(
formData
);
}
else
if
(
this
.
activeIndex
==
2
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
keyword
"
,
this
.
searchVal
);
this
.
getWaitList
(
formData
);
}
},
setMessage
()
{
sessionStorage
.
setItem
(
"
activeNames
"
,
this
.
actives
);
sessionStorage
.
setItem
(
"
activeIndex
"
,
this
.
activeIndex
);
},
//根据类别请求接口
getWaitSort
()
{
if
(
this
.
activeIndex
==
0
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
0
);
this
.
getWaitList
(
formData
);
}
else
if
(
this
.
activeIndex
==
1
)
{
let
formData
=
new
FormData
();
formData
.
append
(
"
status
"
,
1
);
this
.
getWaitList
(
formData
);
}
else
if
(
this
.
activeIndex
==
2
)
{
this
.
getWaitList
();
}
}
},
},
// // 下拉刷新事件
// 请求消息接口方法
// onRefresh() {
getWaitList
(
Data
)
{
// // 清空列表数据
waitList
(
Data
).
then
((
res
)
=>
{
// this.finished = false;
this
.
waitList
=
res
.
rows
;
});
// // 重新加载数据
},
// // 将 loading 设置为 true,表示处于加载状态
// this.loading = true;
// this.onLoad();
// },
// // 列表初始化函数
// onLoad() {
// setTimeout(() => {
// if (this.refreshing) {
// this.refreshing = false;
// }
touchstart
(
index
,
item
)
{
this
.
$router
.
push
({
path
:
item
.
appUrl
,
query
:
{},
});
},
// // 加载完成后将loading改成 false
// // 加载完成后将loading改成 false
// this.loading = false;
// this.loading = false;
// // 为什么会连续触发 load 事件? 先加上这句 this.finished = true; 以后再删
// // 为什么会连续触发 load 事件? 先加上这句 this.finished = true; 以后再删
...
@@ -127,6 +187,7 @@ export default {
...
@@ -127,6 +187,7 @@ export default {
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
/* @import url(); 引入css类 */
/* @import url(); 引入css类 */
.message-wrap {
.message-wrap {
min-height: 58vh;
padding: 10px 10px 0;
padding: 10px 10px 0;
background-color: #f0f1f5;
background-color: #f0f1f5;
// 标签
// 标签
...
@@ -164,11 +225,21 @@ export default {
...
@@ -164,11 +225,21 @@ export default {
.van-cell-group--inset {
.van-cell-group--inset {
margin: 0;
margin: 0;
margin-bottom: 10px;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
font-size: 13px;
padding: 10px;
.message-content {
.message-content {
margin-top: 10px;
margin-top: 10px;
}
}
.messgae-title {
display: flex;
justify-content: space-between;
align-items: center;
}
.bot_but {
display: flex;
justify-content: right;
align-items: center;
}
}
}
}
}
}
}
...
...
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