Jelajahi Sumber

Merge branch '站内信' into 250217外协发出一键选择工序,报工维护修改,分选包装后自动周转

ezhizao_zx 4 bulan lalu
induk
melakukan
943d27992f

+ 4 - 1
.env.development

@@ -23,4 +23,7 @@ VITE_HOST_URL = 'http://120.46.159.163:401'
 
 VITE_HOST_INNET = 'http://localhost:81'
 
-VITE_HOST_OUTNET = 'http://localhost:81'
+VITE_HOST_OUTNET = 'http://localhost:81'
+
+#站内信地址
+VITE_WS_API = '/ws'

+ 4 - 1
.env.production

@@ -26,4 +26,7 @@ VITE_HOST_IP = '192.168.10.40'
 
 VITE_HOST_INNET = 'http://192.168.10.41=2:82/onlinePreview?url='
 
-VITE_HOST_OUTNET = 'http://120.46.159.163:8012/onlinePreview?url='
+VITE_HOST_OUTNET = 'http://120.46.159.163:8012/onlinePreview?url='
+
+#站内信地址
+VITE_WS_API = '/ws'

+ 24 - 0
nginx.conf

@@ -13,6 +13,10 @@ http {
     keepalive_timeout  65;
     client_max_body_size 50m;
 
+    # upstream websocket_backend {
+    #     server websocket_server_address:port;  # 替换为你的 WebSocket 服务器地址和端口
+    # }
+
     server { 
 	listen 88;
 	server_name 120.46.159.163;
@@ -58,6 +62,26 @@ http {
 	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 	proxy_pass http://120.46.159.163:7004/;
     }
+    location /ws/{
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "Upgrade";
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header X-Forwarded-Proto $scheme;
+        proxy_pass http://120.46.159.163:7001/ws/
+    }
+    location /ws-production/ {
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "Upgrade";
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header X-Forwarded-Proto $scheme;
+        proxy_pass http://120.46.159.163:7003/wsExport/
+    }
 
         error_page   500 502 503 504  /50x.html;
         location = /50x.html {

+ 2 - 1
package.json

@@ -39,7 +39,8 @@
     "vue": "3.2.45",
     "vue-cropper": "1.0.3",
     "vue-router": "4.1.4",
-    "vxe-table": "^4.7.59"
+    "vxe-table": "^4.7.59",
+    "ws": "^8.18.0"
   },
   "devDependencies": {
     "@vitejs/plugin-vue": "3.1.0",

+ 45 - 0
src/api/business/message.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+const baseUrl = import.meta.env.VITE_APP_BASE_API
+// 查询项目成员列表
+export function listMessage(query) {
+  return request({
+    url: baseUrl + '/business/message/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询项目成员详细
+export function getMessage(id) {
+  return request({
+    url: baseUrl + '/business/message/' + id,
+    method: 'get'
+  })
+}
+
+// 新增项目成员
+export function addMessage(data) {
+  return request({
+    url: baseUrl + '/business/message',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改项目成员
+export function updateMessage(data) {
+  return request({
+    url: baseUrl + '/business/message',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除项目成员
+export function delMessage(id) {
+  return request({
+    url: baseUrl + '/business/message/' + id,
+    method: 'delete'
+  })
+}

+ 5 - 1
src/components/Pagination/index.vue

@@ -2,7 +2,7 @@
   <div :class="{ 'hidden': hidden }" class="pagination-container">
     <el-pagination :background="background" v-model:current-page="currentPage" v-model:page-size="pageSize"
       :layout="layout" :page-sizes="pageSizes" :pager-count="pagerCount" :total="total" @size-change="handleSizeChange"
-      @current-change="handleCurrentChange" />
+      @current-change="handleCurrentChange" :size="size" />
   </div>
 </template>
 
@@ -48,6 +48,10 @@ const props = defineProps({
   hidden: {
     type: Boolean,
     default: false
+  },
+  size: {
+    type: String,
+    default: 'default'
   }
 })
 

+ 155 - 8
src/layout/components/Navbar.vue

@@ -1,17 +1,18 @@
 <template>
   <div class="navbar">
-    <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
+    <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container"
+      @toggleClick="toggleSideBar" />
     <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!settingsStore.topNav" />
     <top-nav id="topmenu-container" class="topmenu-container" v-if="settingsStore.topNav" />
 
     <div class="right-menu">
       <div style="color: #fff; padding-right: 16px; font-size: 14px">
         <span>当前厂别:</span>
-        <template v-if="currentTenantName!='超级管理员'">
-             <span style="cursor: pointer"  @click="handleShowTenantDialog">{{ currentTenantName }}</span>
+        <template v-if="currentTenantName != '超级管理员'">
+          <span style="cursor: pointer" @click="handleShowTenantDialog">{{ currentTenantName }}</span>
         </template>
         <template v-else>
-          <span style="cursor: pointer"  >{{ currentTenantName }}</span>
+          <span style="cursor: pointer">{{ currentTenantName }}</span>
         </template>
         <!-- <span style="cursor: pointer"  @click="handleShowTenantDialog">{{ currentTenantName }}</span> -->
       </div>
@@ -44,6 +45,14 @@
               <el-dropdown-item command="setLayout">
                 <span>布局设置</span>
               </el-dropdown-item>
+              <el-dropdown-item command="message" v-if="settingsStore.showMessage">
+                <el-badge :value="messageCount" :max="99" class="item" :hidden="messageCount == 0">
+                  <span>站内信</span>
+                </el-badge>
+              </el-dropdown-item>
+              <el-dropdown-item command="sendMessage" v-if="settingsStore.showMessage">
+                <span>发站内信</span>
+              </el-dropdown-item>
               <el-dropdown-item divided command="logout">
                 <span>退出登录</span>
               </el-dropdown-item>
@@ -58,11 +67,63 @@
         <el-table-column label="厂别" prop="orgName" header-align="center" />
         <el-table-column label="选择" prop="createTime" width="50" align="center">
           <template #default="scope">
-            <el-button link type="success" icon="Check" size="small"  @click="handleChangeTenant(scope.row)" >选择</el-button>
+            <el-button link type="success" icon="Check" size="small"
+              @click="handleChangeTenant(scope.row)">选择</el-button>
           </template>
         </el-table-column>
       </el-table>
     </el-dialog>
+    <el-dialog title="站内信" v-model="showMessageDialog" width="450" center @close="showMessageDialog = false">
+      <div class="page-container column-container">
+        <el-table ref="dialogTable" :data="messageList" height="460px" row-key="id" align="center">
+          <el-table-column label="行号" type="index" width="50" align="center" />
+          <el-table-column label="消息来源" prop="fromNickName" align="center" />
+          <el-table-column label="消息内容" prop="message" align="center" show-overflow-tooltip />
+          <el-table-column label="查看" width="120" align="center">
+            <template #default="scope">
+              <el-button type="success" icon="view" circle @click="handleView(scope.row)" />
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize" @pagination="getMessages" size="small"
+          layout="total, prev, next, jumper" />
+      </div>
+    </el-dialog>
+    <el-dialog title="发消息" v-model="addMessageDialog" width="450" center @close="closeMessageFormDialog">
+      <el-form ref="addMessageFormRef" v-model="messageData" label-width="100">
+        <el-row :gutter="10">
+          <el-col :span="24">
+            <el-form-item label="收件人">
+              <el-autocomplete :fetch-suggestions="querySearchAsync" :trigger-on-focus="true" style="width: 100%"
+                v-model="messageData.toNickName" placeholder="选择人员" popper-class="my-autocomplete"
+                @select="handleSelectEmployee">
+                <template #default="{ item }">
+                  <div style="
+                      display: flex;
+                      flex-direction: row;
+                      justify-content: space-between;
+                    ">
+                    <div class="name" style="font-size: 12px">
+                      {{ item.nickName }}
+                    </div>
+                    <span class="code" style="font-size: 10px; color: darkgrey">{{ item.userName }}</span>
+                  </div>
+                </template>
+              </el-autocomplete>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="发送信息">
+              <el-input type="textarea" v-model="messageData.message"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <el-button @click="sendMessage">发送</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -72,6 +133,7 @@ import Breadcrumb from '@/components/Breadcrumb'
 import TopNav from '@/components/TopNav'
 import Hamburger from '@/components/Hamburger'
 import Screenfull from '@/components/Screenfull'
+import { selectUserList, getInfo } from "@/api/business/noCurrentReject";
 // import SizeSelect from '@/components/SizeSelect'
 // import HeaderSearch from '@/components/HeaderSearch'
 // import RuoYiGit from '@/components/RuoYi/Git'
@@ -81,17 +143,35 @@ import useUserStore from '@/store/modules/user'
 import useSettingsStore from '@/store/modules/settings'
 import { setTenant, getTenant } from '@/utils/auth'
 import { listTenant } from '@/api/business/tenant.js'
+import { listMessage } from '@/api/business/message.js'
 import router from '@/router'
+import useMessageStore from '@/store/modules/message'
+import { nextTick, onBeforeUnmount, onMounted } from 'vue'
 
 const { proxy } = getCurrentInstance()
 const appStore = useAppStore()
 const userStore = useUserStore()
 const settingsStore = useSettingsStore()
-
+const messageCount = ref(0)
+const showMessageDialog = ref(false)
 const tenantLoading = ref(false)
 const showDialog = ref(false)
+const addMessageDialog = ref(false)
 const tenantList = ref([])
+const messageList = ref([])
+const messageData = ref({
+  fromUserId: useUserStore().user.userId,
+  toUserId: null,
+  toUserName: null,
+  toNickName: null,
+  message: null
+})
 const currentTenantName = ref(getTenant().tenantName)
+const total = ref(0)
+const queryParams = ref({
+  pageSize: 10,
+  pageNum: 1
+})
 
 function toggleSideBar() {
   appStore.toggleSideBar()
@@ -105,6 +185,13 @@ function handleCommand(command) {
     case 'logout':
       logout()
       break
+    case 'message':
+      showMessageDialog.value = true
+      getMessages()
+      break
+    case 'sendMessage':
+      addMessageDialog.value = true
+      break
     default:
       break
   }
@@ -122,7 +209,7 @@ function logout() {
         location.href = '/index'
       })
     })
-    .catch(() => {})
+    .catch(() => { })
 }
 
 const emits = defineEmits(['setLayout'])
@@ -154,7 +241,7 @@ const handleChangeTenant = (row) => {
       })
       location.reload()
     })
-    .catch(() => {})
+    .catch(() => { })
 }
 
 const loadTenant = () => {
@@ -166,6 +253,66 @@ const loadTenant = () => {
     tenantLoading.value = false
   })
 }
+
+const messageCountChanged = (count) => {
+
+}
+const getMessages = () => {
+  console.log(userStore)
+  queryParams.value.toUserId = useUserStore().user.userId
+  listMessage(queryParams.value).then(res => {
+    if (res.code === 200) {
+      messageList.value = res.rows
+      total.value = res.total
+    } else {
+      messageList.value = []
+      total.value = 0
+    }
+
+  })
+}
+
+const closeMessageFormDialog = () => {
+  addMessageDialog.value = false
+  messageData.value = {
+    fromUserId: useUserStore().user.userId,
+    toUserId: null,
+    toUserName: null,
+    toNickName: null,
+    message: null
+  }
+}
+function querySearchAsync(queryString, cb) {
+  if (queryString) {
+    selectUserList(queryString).then((res) => {
+      cb(res.rows);
+    });
+  }
+}
+
+function handleSelectEmployee(item) {
+  messageData.value.toNickName = item.nickName;
+  messageData.value.toUserId = item.userId;
+  messageData.value.toUserName = item.userName;
+}
+
+function sendMessage() {
+  useMessageStore().sendMsg(messageData.value)
+  closeMessageFormDialog()
+}
+
+onMounted(() => {
+  window.addEventListener('messageChange', (target) => {
+    const count = target.detail
+    if (count != messageCount.value) {
+      messageCount.value = count
+    }
+    // console.log(messageCount)
+  })
+})
+onBeforeUnmount(() => {
+  window.removeEventListener('messageChange')
+})
 </script>
 
 <style lang="scss" scoped>

+ 8 - 0
src/permission.js

@@ -8,6 +8,7 @@ import { isRelogin } from '@/utils/request'
 import useUserStore from '@/store/modules/user'
 import useSettingsStore from '@/store/modules/settings'
 import usePermissionStore from '@/store/modules/permission'
+import useMessageStore from './store/modules/message'
 
 NProgress.configure({ showSpinner: false });
 
@@ -18,6 +19,8 @@ router.beforeEach((to, from, next) => {
   if (getToken()) {
     to.meta.title && useSettingsStore().setTitle(to.meta.title)
     useSettingsStore().initGenLotBySub()
+    useSettingsStore().initShowMessage()
+    useSettingsStore().initShowNotification()
     /* has token*/
     if (to.path === '/login') {
       next({ path: '/' })
@@ -37,6 +40,11 @@ router.beforeEach((to, from, next) => {
             })
             next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
           })
+          // console.log(useUserStore().user.userId)
+          if (useSettingsStore().showMessage) {
+            useMessageStore().connection(useUserStore().user.userId, getToken())
+            useMessageStore().initWebsocket()
+          }
         }).catch(err => {
           useUserStore().logOut().then(() => {
             ElMessage.error(err)

+ 2 - 2
src/plugins/notification.js

@@ -7,11 +7,11 @@ document.body.appendChild(div)
 
 export default (data) => {
   // console.log(data)
-  const { title, content } = data
+  const { title, content, updateContent } = data
   // console.log(notification)
   console.log(div)
   // 创建虚拟 DOM
-  const VNode = createVNode(notification, { title, content })
+  const VNode = createVNode(notification, { title, content: updateContent })
   // console.log(VNode)
   // 通过 render 函数挂载到页面中
   render(VNode, div)

+ 124 - 0
src/store/modules/message.js

@@ -0,0 +1,124 @@
+// const webSocket = require('ws')
+const wsUrl = 'ws://localhost:8080/ws/'
+
+const useMessageStore = defineStore('message', {
+  status: () => ({
+    // 未读消息数量
+    messageNum: 0,
+    ws: null,
+    latestMessage: null,
+    heartTimeOut: 40000,
+    lockReconnect: false,
+    timerReconnect: undefined,
+    timerHeart: undefined,
+    timerServerHeart: undefined,
+    handClose: false,
+    messageCount: 0
+  }),
+  actions: {
+    getMessageNum(message) {
+      this.messageNum++
+      this.latestMessage = message
+      // console.log(this.messageNum)
+      // console.log(this.latestMessage)
+      this.messageCount = this.latestMessage.data
+      const value = this.messageCount != null ? Number(this.messageCount) : 0
+      this.broadcastMessage(value)
+    },
+    broadcastMessage(count) {
+      const event = new CustomEvent('messageChange', { detail: count });
+      window.dispatchEvent(event);
+    },
+    acceptWs: () => {
+    },
+    async createWebSocket(id, token) {
+      // console.log(id, wsUrl, token)
+      try {
+        this.ws = new WebSocket(wsUrl + id, [token])
+      } catch (e) {
+        // console.log(e)
+        this.reconnection()
+      }
+    },
+    async connection(id, token) {
+      // this.getMessageNum('1')
+      // console.log(id, wsUrl, token)
+      // console.log(window)
+      // if("webSocket" in window) {
+      await this.createWebSocket(id, token)
+      // } else {
+      //   console.log('浏览器不支持websocket')
+      // }
+    },
+    initWebsocket() {
+      this.ws.onopen = (e) => {
+        this.ws.send("open server")
+        console.log("链接成功")
+        this.heartCheck()
+      }
+      this.ws.onmessage = (message) => {
+        this.getMessageNum(message)
+        this.heartCheck()
+      }
+      this.ws.onerror = (e) => {
+        console.log('链接失败')
+        this.reconnection()
+      }
+      this.ws.onclose = (e) => {
+        console.log("关闭连接")
+        if (!this.handClose) {
+          this.reconnection()
+        }
+      }
+    },
+    clearTimer() {
+      this.timerReconnect && clearTimeout(this.timerReconnect)
+      this.timerHeart && clearTimeout(this.timerHeart)
+      this.timerServerHeart && clearTimeout(this.timerServerHeart)
+    },
+    reconnection() {
+      console.log("重新连接")
+      if (this.lockReconnect) {
+        return
+      }
+      this.lockReconnect = true
+      if (this.timerReconnect) {
+        this.clearTimer(timerReconnect)
+      }
+      //没连上会一直重连, 设置迟延,避免请求过多
+      this.timerReconnect = setTimeout(() => {
+        //setTimeout 到点了执行
+        this.connection()
+        this.lockReconnect = false
+      }, 5000);
+    },
+    heartCheck() {
+      console.log('心跳检测')
+      if (this.timerHeart) {
+        clearTimeout(this.timerHeart)
+      }
+      this.timerHeart = setTimeout(() => {
+        // console.log("ping")
+        this.ws.send("ping")
+        this.lockReconnect = false
+      }, this.heartTimeOut)
+    },
+    sendMsg(data) {
+      console.log("发送信息")
+      if (this.ws.readyState === WebSocket.OPEN) {
+        this.ws.send(JSON.stringify(data))
+      }
+    },
+    closeWs() {
+      console.log("关闭ws")
+      this.handClose = true
+      this.clearTimer()
+      this.ws.close()
+    },
+    initMessageCount() {
+
+    }
+  }
+})
+
+export default useMessageStore

+ 17 - 1
src/store/modules/settings.js

@@ -19,7 +19,9 @@ const useSettingsStore = defineStore(
       fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
       sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
       dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle,
-      genLotBySub: false
+      genLotBySub: false,
+      showMessage: false,
+      showNotification: false
     }),
     actions: {
       // 修改布局设置
@@ -39,6 +41,20 @@ const useSettingsStore = defineStore(
           // console.log(res)
           this.genLotBySub = res.msg == 'true'
         })
+      },
+      initShowMessage(config) {
+        getConfigKey('business.sys.message').then(res => {
+          // console.log(res)
+          this.showMessage = res.msg == 'true'
+          console.log('是否显示站内信', this.showMessage)
+        })
+      },
+      initShowNotification(config) {
+        getConfigKey('business.sys.showAffiche').then(res => {
+          // console.log(res)
+          this.showNotification = res.msg == 'true'
+          console.log('是否显示公告', this.showNotification)
+        })
       }
     }
   })

+ 38 - 18
src/utils/request.js

@@ -6,11 +6,25 @@ import { tansParams, blobValidate } from '@/utils/ruoyi'
 import cache from '@/plugins/cache'
 import { saveAs } from 'file-saver'
 import useUserStore from '@/store/modules/user'
+import useSettingsStore from '@/store/modules/settings'
 import Notification from '../plugins/notification'
 // import emitter from '../eventBus'
 // import { getCurrentInstance } from 'vue';
 // import { reject } from 'lodash-es'
 
+const beforeNotification = ['\/ezhizao-dms-sys\/getInfo', '\/ezhizao-dms-sys\/getRouters', '\/ezhizao-dms-sys\/system\/config\/configKey\/']
+const checkBeforeUrl = (url) => {
+  let checked = false
+  // console.log(url)
+  beforeNotification.forEach(t => {
+    let reg = new RegExp('^' + t)
+    // console.log(t, reg.test(url))
+    checked = checked || reg.test(url)
+  })
+  // console.log(checked)
+  return checked
+}
+
 let downloadLoadingInstance
 // 是否显示重新登录
 export let isRelogin = { show: false }
@@ -51,24 +65,30 @@ service.interceptors.request.use(
     let notifications = []
     // 当登录状态为已登录时才可以获取公告
     // console.log(config)
-    if (getToken() && !isToken && tenantInfo && config.url != '/ezhizao-dms-sys/getInfo' && config.url != '/ezhizao-dms-sys/getRouters') {
+    // console.log(checkBeforeUrl(config.url))
+    if (getToken() && !isToken && tenantInfo && !checkBeforeUrl(config.url)) {
       // 所有条件都具备的情况下需先请求公告
-      // let url = import.meta.env.VITE_APP_BASE_API + '/business/notification/getUnshowedNotification'
-      // const res = await axios({
-      //   url: url,
-      //   method: 'get',
-      //   headers: {
-      //     Authorization: 'Bearer ' + getToken(),
-      //     tenantId: getTenant().tenantId,
-      //     appKey: 'ezhizao-identity'
-      //   }
-      // })
-      // if (res.data.code == 200) {
-
-      // } else if (res.data.code == 202) {
-      //   notifications = res.data.data
-      //   requestable = false
-      // }
+      let url = import.meta.env.VITE_APP_BASE_API + '/business/notification/getUnshowedNotification'
+      const showNotification = useSettingsStore().showNotification
+      console.log('是否显示公告', showNotification)
+      if (showNotification) {
+        const res = await axios({
+          url: url,
+          method: 'get',
+          headers: {
+            Authorization: 'Bearer ' + getToken(),
+            tenantId: getTenant().tenantId,
+            appKey: 'ezhizao-identity'
+          }
+        })
+        if (res.data.code == 200) {
+        } else if (res.data.code == 202) {
+          notifications = res.data.data
+          requestable = false
+          // showDialog()
+        }
+      }
+      // 
     }
     // get请求映射params参数
     if (config.method === 'get' && config.params) {
@@ -168,7 +188,7 @@ service.interceptors.response.use(
       ElMessage({ message: message, type: 'error', duration: 5 * 1000 })
     } else if (message.includes('SHOW NOTIFICATION')) {
       // showDialog(data)
-      // Notification(data[0])
+      Notification(data[0])
     } else {
       ElMessage({ message: message, type: 'error', duration: 5 * 1000 })
     }

+ 16 - 12
src/views/index.vue

@@ -13,8 +13,8 @@
           </div>
           <div class="number-label">{{ totalCompanies }} 人</div>
         </div> -->
-        <!-- <div class="notifications-header">公告</div>
-        <el-row :gutter="5">
+        <div v-if="showNotification" class="notifications-header">公告</div>
+        <el-row v-if="showNotification" :gutter="5">
           <el-col :span="8" v-for="item in notifications">
             <el-card style="width: 100%;margin-bottom: 5px;" shadow="always" @click="showNotifiaction(item)">
               <template #header>
@@ -23,16 +23,16 @@
                   </div>
                 </div>
               </template>
-<div style="height: 40px;overflow: clip;">
-  <div v-html="item.content" style="height: 100%;">
-  </div>
-</div>
-<div class="footer">
-  {{ item.createTime }}
-</div>
-</el-card>
-</el-col>
-</el-row> -->
+              <div style="height: 40px;overflow: clip;">
+                <div v-html="item.content" style="height: 100%;">
+                </div>
+              </div>
+              <div class="footer">
+                {{ item.createTime }}
+              </div>
+            </el-card>
+          </el-col>
+        </el-row>
 
         <!-- <el-row v-for="item in notifications" style="padding: 5px 10px;">
           {{ item.title }}
@@ -71,6 +71,7 @@
 import { parseTime } from '@/utils/tools.js'
 import { listNotification } from '@/api/business/notification'
 import notification from '@/views/dialog/notification'
+import useSettingsStore from '@/store/modules/settings'
 
 // import { index } from '@/api/business/production'
 
@@ -151,12 +152,15 @@ let currentMonth = ref('')
 let statisticDom, statistic
 const notifications = ref([])
 const notificationRef = ref(null)
+const showNotification = ref(false)
 
 onMounted(() => {
   currentMonth.value = parseTime(new Date(), '{y}-{m}')
   //statisticDom = document.getElementById('information-statistic')
   //statistic = echarts.init(statisticDom)
   //getCurrentMonthDayArr()
+  console.log(useSettingsStore().showNotification)
+  showNotification.value = useSettingsStore().showNotification
   getList()
 })