Browse Source

no message

linwenxin 10 months ago
parent
commit
cb553e1a03
1 changed files with 111 additions and 47 deletions
  1. 111 47
      src/layout/components/Navbar.vue

+ 111 - 47
src/layout/components/Navbar.vue

@@ -5,11 +5,19 @@
       <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
       <div class="menu_module">
         <div class="menu_module_view">
-          <v-scroll-view :x="true" :y="false" slidingBgClassName="slidingBgClassName"
-            slidingBlockClassName="slidingBlockClassName">
+          <v-scroll-view
+            :x="true"
+            :y="false"
+            slidingBgClassName="slidingBgClassName"
+            slidingBlockClassName="slidingBlockClassName"
+          >
             <div class="menu_module_fj">
-              <div v-for="(item, index) in routes" :key="index" :class="{ item: true, select: path === item.path }"
-                @click="path = item.path">
+              <div
+                v-for="(item, index) in routes"
+                :key="index"
+                :class="{ item: true, select: path === item.path }"
+                @click="path = item.path"
+              >
                 {{ item.meta.title }}
               </div>
             </div>
@@ -24,12 +32,19 @@
         <div class="right-menu-item">
           <el-autocomplete
             v-model="pathurl"
-            :fetch-suggestions="querySearchAsync"s
+            :fetch-suggestions="querySearchAsync"
+            s
             placeholder="搜索菜单"
             @select="handleSelect"
           ></el-autocomplete>
         </div>
-        <div  style="margin-right: 20px; cursor: pointer" @click="getList();isShow = true">
+        <div
+          style="margin-right: 20px; cursor: pointer"
+          @click="
+            getList()
+            isShow = true
+          "
+        >
           <i class="el-icon-message-solid"></i>
           <el-badge :is-dot="isDot1 || isDot2"></el-badge>
         </div>
@@ -57,21 +72,44 @@
       </div>
     </div>
     <notice-bar />
-    <el-drawer title="系统消息" :visible.sync="isShow" :append-to-body="true" :with-header="false" direction="rtl" size="25%">
+    <el-drawer
+      title="系统消息"
+      :visible.sync="isShow"
+      :append-to-body="true"
+      :with-header="false"
+      direction="rtl"
+      size="25%"
+    >
       <div class="message">
         <div class="head">
           <div class="flex_asb">
             <el-radio-group size="small" v-model="messageType" @change="getList">
               <el-badge :is-dot="isDot1" class="item">
                 <el-radio-button
-                  :label="['WBI', 'WBK', 'CRE_ORDER', 'SEND_MALL', 'RP_MALL', 'CR_SALES', 'ENGIN_PAY_ORDER','CR_ES_SALES']">系统消息</el-radio-button>
+                  :label="[
+                    'WBI',
+                    'WBK',
+                    'CRE_ORDER',
+                    'SEND_MALL',
+                    'RP_MALL',
+                    'CR_SALES',
+                    'ENGIN_PAY_ORDER',
+                    'CR_ES_SALES'
+                  ]"
+                  >系统消息</el-radio-button
+                >
               </el-badge>
               <el-badge :is-dot="isDot2" class="item">
                 <el-radio-button :label="['NOTICE']">平台公告</el-radio-button>
               </el-badge>
             </el-radio-group>
-            <el-switch v-model="isOpen" @change="updateIsNotice" inactive-text="消息弹窗" active-color="#13ce66"
-              inactive-color="#ff4949">
+            <el-switch
+              v-model="isOpen"
+              @change="updateIsNotice"
+              inactive-text="消息弹窗"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+            >
             </el-switch>
           </div>
           <el-radio-group size="mini" v-model="dateType" @change="getList" style="margin: 10px 0">
@@ -98,15 +136,17 @@
           </div>
         </div>
         <el-card class="box-card" v-for="(item, index) in messageData" style="margin-top: 10px">
-          <div @click="
-            isShow = false
-          toDetail(
-            item.adminNoticeType,
-            item.paidType,
-            item.adminNoticeType == 'NOTICE' ? item.noticeId : item.orderId,
-            item.id
-          )
-            ">
+          <div
+            @click="
+              isShow = false
+              toDetail(
+                item.adminNoticeType,
+                item.paidType,
+                item.adminNoticeType == 'NOTICE' ? item.noticeId : item.orderId,
+                item.id
+              )
+            "
+          >
             <div v-if="item.adminNoticeType == 'NOTICE'">
               <div class="flex_asb item">
                 <div>
@@ -175,8 +215,14 @@
         </el-card>
         <el-empty v-if="messageData.length == 0" description="暂无数据"></el-empty>
         <div class="flex_ac bottom">
-          <el-pagination @current-change="handleCurrentChange" :current-page="currentPage" :page-size="pageSize"
-            layout="prev, pager, next" background :total="listTotal"></el-pagination>
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="pageSize"
+            layout="prev, pager, next"
+            background
+            :total="listTotal"
+          ></el-pagination>
         </div>
       </div>
     </el-drawer>
@@ -218,7 +264,7 @@ export default {
       isShow: false,
       isOpen: true,
       checked: false,
-      messageType: ['WBI', 'WBK', 'CRE_ORDER', 'SEND_MALL', 'RP_MALL', 'CR_SALES', 'ENGIN_PAY_ORDER','CR_ES_SALES'],
+      messageType: ['WBI', 'WBK', 'CRE_ORDER', 'SEND_MALL', 'RP_MALL', 'CR_SALES', 'ENGIN_PAY_ORDER', 'CR_ES_SALES'],
       messageData: [],
       dateType: '',
       readFlag: '',
@@ -235,8 +281,8 @@ export default {
     routes() {
       return global.antRouter.filter(item => item.meta)
     },
-    bigViewsBool(){
-      return !!global.antRouter.find(item => item.code=="bigViews")
+    bigViewsBool() {
+      return !!global.antRouter.find(item => item.code == 'bigViews')
     },
     noticeVisible() {
       return this.noticeCount > 0
@@ -247,22 +293,28 @@ export default {
       if (this.dateType === '') {
         return ['', '']
       } else {
-        var date = new Date();
-        var base = Date.parse(date); // 转换为时间戳
-        var year = date.getFullYear(); //获取当前年份
-        var mon = date.getMonth() + 1; //获取当前月份
-        var day = date.getDate(); //获取当前日
+        var date = new Date()
+        var base = Date.parse(date) // 转换为时间戳
+        var year = date.getFullYear() //获取当前年份
+        var mon = date.getMonth() + 1 //获取当前月份
+        var day = date.getDate() //获取当前日
         var oneDay = 24 * 3600 * 1000
 
         var daytimeArr = []
-        var now = new Date((base - oneDay * this.dateType));
-        var myear = now.getFullYear();
-        var month = now.getMonth() + 1;
+        var now = new Date(base - oneDay * this.dateType)
+        var myear = now.getFullYear()
+        var month = now.getMonth() + 1
         var mday = now.getDate()
         if (this.dateType == 1) {
-          return [`${myear}-${month > 9 ? month : '0' + month}-${mday > 9 ? mday : '0' + mday} 00:00:00`, `${myear}-${month > 9 ? month : '0' + month}-${mday > 9 ? mday : '0' + mday} 23:59:59`]
+          return [
+            `${myear}-${month > 9 ? month : '0' + month}-${mday > 9 ? mday : '0' + mday} 00:00:00`,
+            `${myear}-${month > 9 ? month : '0' + month}-${mday > 9 ? mday : '0' + mday} 23:59:59`
+          ]
         } else {
-          return [`${myear}-${month > 9 ? month : '0' + month}-${mday > 9 ? mday : '0' + mday} 00:00:00`, `${year}-${mon > 9 ? mon : '0' + mon}-${day > 9 ? day : '0' + day} 23:59:59`]
+          return [
+            `${myear}-${month > 9 ? month : '0' + month}-${mday > 9 ? mday : '0' + mday} 00:00:00`,
+            `${year}-${mon > 9 ? mon : '0' + mon}-${day > 9 ? day : '0' + day} 23:59:59`
+          ]
         }
       }
     },
@@ -275,9 +327,9 @@ export default {
           CRE_ORDER: '创建工单',
           SEND_MALL: '商城订单发货',
           RP_MALL: '商城订单维权',
-          CR_SALES: '订单支付成功',
-		  ENGIN_PAY_ORDER: '工程收款单',
-		  CR_ES_SALES: '二手商品订单'
+          CR_SALES: '订单',
+          ENGIN_PAY_ORDER: '工程收款单',
+          CR_ES_SALES: '二手商品订单'
         }
         return MAP[val]
       }
@@ -291,9 +343,18 @@ export default {
           CRE_ORDER: 'workOrderPool',
           SEND_MALL: 'order_detail',
           RP_MALL: 'order_refund_detail',
-          CR_SALES: (paidType == 'M' ? 'auxiliarySalesOrder' : paidType == 'P' ? 'attachmentSalesOrder' : paidType == 'YB' ? 'orderSettleManag' : paidType == 'MALL' ? 'order_detail' : ''),
-		  ENGIN_PAY_ORDER: 'projectCollectionManagement',
-		  CR_ES_SALES: 'orderManagement'
+          CR_SALES:
+            paidType == 'M'
+              ? 'auxiliarySalesOrder'
+              : paidType == 'P'
+              ? 'attachmentSalesOrder'
+              : paidType == 'YB'
+              ? 'orderSettleManag'
+              : paidType == 'MALL'
+              ? 'order_detail'
+              : '',
+          ENGIN_PAY_ORDER: 'projectCollectionManagement',
+          CR_ES_SALES: 'orderManagement'
         }
         return MAP[val]
       }
@@ -327,10 +388,10 @@ export default {
     this.$store.commit('app/SET_L1_PATH', this.path)
   },
   methods: {
-    goBigViews(){
+    goBigViews() {
       this.$router.push({
-	  		name: 'bigViews',
-	  	})
+        name: 'bigViews'
+      })
     },
     handlePage() {
       let link = null
@@ -342,7 +403,10 @@ export default {
       window.open(link)
     },
     querySearchAsync(queryString, cb) {
-      var data = pages.filter(item => !~item.path.indexOf(":pageName?/:pageType?/:pageCode?/:pagePam?") && !!~item.meta.title.indexOf(queryString))
+      var data = pages.filter(
+        item =>
+          !~item.path.indexOf(':pageName?/:pageType?/:pageCode?/:pagePam?') && !!~item.meta.title.indexOf(queryString)
+      )
       cb(
         data.map(item => ({
           value: item.meta.title,
@@ -566,7 +630,7 @@ export default {
         params: {
           noticeIds: id
         }
-      }).then(res => { })
+      }).then(res => {})
     }
   }
 }
@@ -727,7 +791,7 @@ export default {
     height: 100%;
     line-height: 50px;
 
-    &>div {
+    & > div {
       float: left;
     }
 
@@ -774,7 +838,7 @@ export default {
       }
 
       .right-menu-item {
-        .notice-icon>i {
+        .notice-icon > i {
           font-size: 18px;
         }