Commit 7af8103d authored by 胡占生's avatar 胡占生 🇨🇳

消息中心更改

parent 01410880
...@@ -30,120 +30,120 @@ const routes = [{ ...@@ -30,120 +30,120 @@ 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: {
...@@ -151,8 +151,8 @@ const routes = [{ ...@@ -151,8 +151,8 @@ const routes = [{
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: {
...@@ -160,8 +160,8 @@ const routes = [{ ...@@ -160,8 +160,8 @@ const routes = [{
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: {
...@@ -169,8 +169,8 @@ const routes = [{ ...@@ -169,8 +169,8 @@ const routes = [{
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: {
...@@ -178,8 +178,8 @@ const routes = [{ ...@@ -178,8 +178,8 @@ const routes = [{
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: {
...@@ -187,8 +187,8 @@ const routes = [{ ...@@ -187,8 +187,8 @@ const routes = [{
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: {
...@@ -196,8 +196,8 @@ const routes = [{ ...@@ -196,8 +196,8 @@ const routes = [{
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: {
...@@ -205,8 +205,8 @@ const routes = [{ ...@@ -205,8 +205,8 @@ const routes = [{
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: {
...@@ -214,8 +214,8 @@ const routes = [{ ...@@ -214,8 +214,8 @@ const routes = [{
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: {
...@@ -223,8 +223,8 @@ const routes = [{ ...@@ -223,8 +223,8 @@ const routes = [{
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: {
...@@ -232,8 +232,8 @@ const routes = [{ ...@@ -232,8 +232,8 @@ const routes = [{
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: {
...@@ -241,47 +241,58 @@ const routes = [{ ...@@ -241,47 +241,58 @@ const routes = [{
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: '/message-details',
name: 'message-details',
meta: {
index: 1
}, },
// 安全工作台页面 component: () => import('../views/messageCenter/messageDetails'),
{
},
// 安全工作台页面
{
path: '/save-workbench', path: '/save-workbench',
name: 'save-workbench', name: 'save-workbench',
meta: { meta: {
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/saveWorkbench'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/saveWorkbench'),
}, },
// 我的地盘页面 // 我的地盘页面
{ {
path: '/my', path: '/my',
name: 'my', name: 'my',
meta: { meta: {
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/my'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/my'),
}, },
{ {
path: '/add-danger', path: '/add-danger',
name: 'add-danger', name: 'add-danger',
meta: { meta: {
...@@ -289,8 +300,8 @@ const routes = [{ ...@@ -289,8 +300,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger/addDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger/addDanger'),
}, },
{ {
path: '/choose-people', path: '/choose-people',
name: 'choose-people', name: 'choose-people',
meta: { meta: {
...@@ -298,9 +309,9 @@ const routes = [{ ...@@ -298,9 +309,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger/manyChoosePeo'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger/manyChoosePeo'),
}, },
{ {
path: '/report-return', path: '/report-return',
name: 'report-return', name: 'report-return',
meta: { meta: {
...@@ -308,9 +319,9 @@ const routes = [{ ...@@ -308,9 +319,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/reportReturn'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/reportReturn'),
}, },
{ {
path: '/confirme-danger', path: '/confirme-danger',
name: 'confirme-danger', name: 'confirme-danger',
meta: { meta: {
...@@ -318,9 +329,9 @@ const routes = [{ ...@@ -318,9 +329,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmeDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmeDanger'),
}, },
{ {
path: '/affirm-danger', path: '/affirm-danger',
name: 'affirm-danger', name: 'affirm-danger',
meta: { meta: {
...@@ -328,8 +339,8 @@ const routes = [{ ...@@ -328,8 +339,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmeDanger/confirmeDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmeDanger/confirmeDanger'),
}, },
{ {
path: '/change-danger', path: '/change-danger',
name: 'change-danger', name: 'change-danger',
meta: { meta: {
...@@ -337,8 +348,8 @@ const routes = [{ ...@@ -337,8 +348,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/changeDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/changeDanger'),
}, },
{ {
path: '/change-info', path: '/change-info',
name: 'change-info', name: 'change-info',
meta: { meta: {
...@@ -346,8 +357,8 @@ const routes = [{ ...@@ -346,8 +357,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/changeDanger/changeInfo'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/changeDanger/changeInfo'),
}, },
{ {
path: '/delay-info', path: '/delay-info',
name: 'delay-info', name: 'delay-info',
meta: { meta: {
...@@ -355,9 +366,9 @@ const routes = [{ ...@@ -355,9 +366,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/changeDanger/delayInfo'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/changeDanger/delayInfo'),
}, },
{ {
path: '/review-danger', path: '/review-danger',
name: 'review-danger', name: 'review-danger',
meta: { meta: {
...@@ -365,10 +376,10 @@ const routes = [{ ...@@ -365,10 +376,10 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/reviewDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/reviewDanger'),
}, },
{ {
path: '/review-add', path: '/review-add',
name: 'review-add', name: 'review-add',
meta: { meta: {
...@@ -376,8 +387,8 @@ const routes = [{ ...@@ -376,8 +387,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/reviewDanger/reviewAdd'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/reviewDanger/reviewAdd'),
}, },
{ {
path: '/stand-book', path: '/stand-book',
name: 'stand-book', name: 'stand-book',
meta: { meta: {
...@@ -385,9 +396,9 @@ const routes = [{ ...@@ -385,9 +396,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'),
}, },
{ {
path: '/normal-detail', path: '/normal-detail',
name: 'normal-detail', name: 'normal-detail',
meta: { meta: {
...@@ -395,9 +406,9 @@ const routes = [{ ...@@ -395,9 +406,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook/normalDetail'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook/normalDetail'),
}, },
// 隐患督办列表 // 隐患督办列表
{ {
path: '/supervise-danger', path: '/supervise-danger',
name: 'supervise-danger', name: 'supervise-danger',
meta: { meta: {
...@@ -405,9 +416,9 @@ const routes = [{ ...@@ -405,9 +416,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/superviseDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/superviseDanger'),
}, },
// 隐患督办批示 // 隐患督办批示
{ {
path: '/super-survey', path: '/super-survey',
name: 'super-survey', name: 'super-survey',
meta: { meta: {
...@@ -415,9 +426,9 @@ const routes = [{ ...@@ -415,9 +426,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/superviseDanger/superSurvey'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/superviseDanger/superSurvey'),
}, },
// 重大隐患列表 // 重大隐患列表
{ {
path: '/major-danger', path: '/major-danger',
name: 'major-danger', name: 'major-danger',
meta: { meta: {
...@@ -425,9 +436,9 @@ const routes = [{ ...@@ -425,9 +436,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/majorDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/majorDanger'),
}, },
// 重大隐患审批 // 重大隐患审批
{ {
path: '/major-survey', path: '/major-survey',
name: 'major-survey', name: 'major-survey',
meta: { meta: {
...@@ -435,12 +446,12 @@ const routes = [{ ...@@ -435,12 +446,12 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/majorDanger/majorSurvey'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/majorDanger/majorSurvey'),
}, },
// 延期审批列表 // 延期审批列表
{ {
path: '/delay-approval', path: '/delay-approval',
name: 'delay-approval', name: 'delay-approval',
meta: { meta: {
...@@ -448,9 +459,9 @@ const routes = [{ ...@@ -448,9 +459,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/delayApproval'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/delayApproval'),
}, },
// 延期审批确定 // 延期审批确定
{ {
path: '/ratify-info', path: '/ratify-info',
name: 'ratify-info', name: 'ratify-info',
meta: { meta: {
...@@ -458,10 +469,10 @@ const routes = [{ ...@@ -458,10 +469,10 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/delayApproval/ratifyInfo'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/delayApproval/ratifyInfo'),
}, },
// 项目经理督办列表 // 项目经理督办列表
{ {
path: '/manager-danger', path: '/manager-danger',
name: 'manager-danger', name: 'manager-danger',
meta: { meta: {
...@@ -469,9 +480,9 @@ const routes = [{ ...@@ -469,9 +480,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/managerDanger'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/managerDanger'),
}, },
// 项目经理督办批示 // 项目经理督办批示
{ {
path: '/manager-survey', path: '/manager-survey',
name: 'manager-survey', name: 'manager-survey',
meta: { meta: {
...@@ -479,13 +490,13 @@ const routes = [{ ...@@ -479,13 +490,13 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/managerDanger/managerSurvey'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/managerDanger/managerSurvey'),
}, },
// 风险模块 // 风险模块
{ {
path: '/risk-add', path: '/risk-add',
name: 'risk-add', name: 'risk-add',
meta: { meta: {
...@@ -493,8 +504,8 @@ const routes = [{ ...@@ -493,8 +504,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd'),
}, },
{ {
path: '/matrix-grad', path: '/matrix-grad',
name: 'matrix-grad', name: 'matrix-grad',
meta: { meta: {
...@@ -502,9 +513,9 @@ const routes = [{ ...@@ -502,9 +513,9 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd/matrixGrad'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd/matrixGrad'),
}, },
{ {
path: '/risk-return', path: '/risk-return',
name: 'risk-return', name: 'risk-return',
meta: { meta: {
...@@ -512,10 +523,10 @@ const routes = [{ ...@@ -512,10 +523,10 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskReturn'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskReturn'),
}, },
{ {
path: '/risk-confirme', path: '/risk-confirme',
name: 'risk-confirme', name: 'risk-confirme',
meta: { meta: {
...@@ -523,8 +534,8 @@ const routes = [{ ...@@ -523,8 +534,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskConfirme'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskConfirme'),
}, },
{ {
path: '/risk-affirm', path: '/risk-affirm',
name: 'risk-affirm', name: 'risk-affirm',
meta: { meta: {
...@@ -532,8 +543,8 @@ const routes = [{ ...@@ -532,8 +543,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskConfirme/riskAffirm'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskConfirme/riskAffirm'),
}, },
{ {
path: '/risk-account', path: '/risk-account',
name: 'risk-account', name: 'risk-account',
meta: { meta: {
...@@ -541,8 +552,8 @@ const routes = [{ ...@@ -541,8 +552,8 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAccount'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAccount'),
}, },
{ {
path: '/risk-big-detail', path: '/risk-big-detail',
name: 'risk-big-detail', name: 'risk-big-detail',
meta: { meta: {
...@@ -550,17 +561,17 @@ const routes = [{ ...@@ -550,17 +561,17 @@ const routes = [{
index: 1 index: 1
}, },
component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAccount/riskBigDetail'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAccount/riskBigDetail'),
}, },
{ {
path:'/insert-danger', path: '/insert-danger',
name:'insert-danger', name: 'insert-danger',
meta:{ meta: {
title:'我的上报', title: '我的上报',
index:1 index: 1
}, },
component:()=>import('@/views/danger/insertDanger/list') component: () => import('@/views/danger/insertDanger/list')
} }
] ]
......
...@@ -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) {
//消息信息列表
export function postMessgaelist(data) {
return request({
url: '/messageInfo/list',
method: 'post',
data
})
}
//未读消息变为已读
export function noticeRemove(data) {
return request({ return request({
url: url, 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', method: 'post',
data 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
}) })
......
...@@ -11,7 +11,7 @@ import router from '../router' ...@@ -11,7 +11,7 @@ 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: {//请求头部
...@@ -26,19 +26,19 @@ service.interceptors.request.use(config => { ...@@ -26,19 +26,19 @@ service.interceptors.request.use(config => {
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
...@@ -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;
});
}, },
}, },
}; };
......
<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>
<template> <template>
<div> <div>
<van-pull-refresh
v-model="isLoading"
success-text="刷新成功"
@refresh="onRefresh"
>
<div class="message-wrap"> <div class="message-wrap">
<!-- 标签 --> <!-- 标签 -->
<div class="category-wrap"> <div class="category-wrap">
...@@ -11,6 +16,8 @@ ...@@ -11,6 +16,8 @@
@click="clickCategory(index, item.category)" @click="clickCategory(index, item.category)"
>{{ item.category }}</span >{{ item.category }}</span
> >
<span class="my-tag-style" @click="clearNo()">清除未读</span>
</div> </div>
<!-- 搜索 --> <!-- 搜索 -->
...@@ -25,7 +32,6 @@ ...@@ -25,7 +32,6 @@
<div @click="onSearch">搜索</div> <div @click="onSearch">搜索</div>
</template> </template>
</van-search> </van-search>
<!-- <van-search v-model="searchVal" placeholder="搜索" @search="onSearch" /> -->
</div> </div>
<!-- 内容列表 --> <!-- 内容列表 -->
<div class="con-list" @touchmove="showIndex = null"> <div class="con-list" @touchmove="showIndex = null">
...@@ -42,46 +48,43 @@ ...@@ -42,46 +48,43 @@
:key="index" :key="index"
@click="touchstart(index, item)" @click="touchstart(index, item)"
> >
<van-badge :dot="item.status == 0 ? true : false">
<div style="padding: 10px; min-width: calc(100vw - 1.6rem)">
<!--@touchend.prevent="touchend(index)" 长按备份--> <!--@touchend.prevent="touchend(index)" 长按备份-->
<div class="messgae-title"> <div class="messgae-title">
<span>{{ item.noticeTitle }}</span> <span>{{ item.sendTime }}</span> <span>{{ item.title }}</span>
<span>{{ item.createTime }}</span>
</div> </div>
<div class="message-content"> <div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{ {{ item.messageBy }},您好!您有一条来自{{ item.menuName }}的{{
item.createUserName item.content
}}的{{ item.noticeTitle }}相关的待处理任务... }}相关的待处理任务...
</div> </div>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index" v-if="item.status == '未读'">
<div class="wrapper" @click.stop="showIndex = null">
<!-- <van-button round type="primary" @click="goDetail(item)"
>查看</van-button
> -->
<van-button
round
type="info"
@click="read(item)"
v-if="item.status == '未读'"
>已读</van-button
>
</div> </div>
</van-overlay> </van-badge>
</van-cell-group> </van-cell-group>
<!-- </van-list>
</van-pull-refresh> -->
</div> </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.selectCategory(data); this.setMessage();
}, },
// 搜索事件 // 搜索事件
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(); let formData = new FormData();
formData.append("noticeContent", val); formData.append("status", 0);
formData.append("keyword", this.searchVal);
this.getMessageList(formData); this.getMessageList(formData);
} else { } else if (this.activeIndex == 1) {
this.getMessageList();
}
} else {
let formData = new FormData(); let formData = new FormData();
formData.append("status", data); formData.append("status", 1);
if (val) { formData.append("keyword", this.searchVal);
formData.append("noticeContent", val); 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("ids", data.pid); 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;
// 标签 // 标签
......
<template> <template>
<div> <div>
<van-pull-refresh
v-model="isLoading"
success-text="刷新成功"
@refresh="onRefresh"
>
<div class="message-wrap"> <div class="message-wrap">
<!-- 标签 --> <!-- 标签 -->
<div class="category-wrap"> <div class="category-wrap">
...@@ -14,6 +19,7 @@ ...@@ -14,6 +19,7 @@
@click="selectCategory(index, item.category)" @click="selectCategory(index, item.category)"
>{{ item.category }}</span >{{ item.category }}</span
> >
<span class="my-tag-style" @click="clearNo()">清除未读</span>
</div> </div>
<!-- 搜索 --> <!-- 搜索 -->
...@@ -38,35 +44,53 @@ ...@@ -38,35 +44,53 @@
<!-- 内容列表 --> <!-- 内容列表 -->
<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">
<span>{{ item.title }}</span>
<span>{{ item.createTime }}</span>
</div>
<div class="mse_title">
{{ item.title }}
</div>
<div class="message-content"> <div class="message-content">
张大海已确认一般隐患B类,右万宝宝负责整改。 {{ 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;
} }
} }
} }
......
<template> <template>
<div> <div>
<van-pull-refresh
v-model="isLoading"
success-text="刷新成功"
@refresh="onRefresh"
>
<div class="message-wrap"> <div class="message-wrap">
<!-- 标签 --> <!-- 标签 -->
<div class="category-wrap"> <div class="category-wrap">
...@@ -32,84 +37,139 @@ ...@@ -32,84 +37,139 @@
<!-- 内容列表 --> <!-- 内容列表 -->
<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>
</van-cell-group> -->
<!-- </van-list>
</van-pull-refresh> -->
</div> </div>
</van-badge>
</van-cell-group>
</div> </div>
</div> </div>
</van-pull-refresh>
</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;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment