Bladeren bron

no message

libushang 5 maanden geleden
bovenliggende
commit
14d46daa8a

+ 10 - 1
src/api/InformationReception/InformationReception.ts

@@ -86,5 +86,14 @@ export function getUnreadMsgCount(data) {
     url: "/api/info_publish/msg_center/unread_msg_count",
     method: 'post',
     data: data
-});
+  });
+}
+
+// 消息中心列表
+export function MsgCenterList(params) {
+  return request({
+    url: "/api/info_publish/msg_center/list",
+    method: "get",
+    params: params
+  });
 }

+ 2 - 2
src/components/OnlineRollCall/index.vue

@@ -26,7 +26,7 @@
         <div v-show="!img" class="text1">即将通过摄像头捕捉画面</div>
         <div v-show="!img" class="text2">请稍等</div>
         <div v-show="img" class="btn">
-          上传视频截图
+          上传视频截图中,请稍候...
         </div>
         <div v-show="img" class="text3">已完成</div>
       </div>
@@ -69,7 +69,7 @@ const handleToRollCall = () => {
       }, 3000);
     })
     .catch(err => {
-      showFailToast("访问摄像头被拒绝"+err);
+      showFailToast("访问摄像头被拒绝");
     });
 };
 const answerCall = () => {

+ 40 - 15
src/components/Tabbar/index.vue

@@ -28,6 +28,7 @@
 <script setup lang="ts">
 import { ref, reactive, onMounted, watch } from "vue";
 import useUserStore from "@/store/modules/user";
+import { getUnreadMsgCount } from "@/api/InformationReception/InformationReception";
 
 const active = ref(0);
 let tabBarData = reactive([]);
@@ -131,23 +132,47 @@ const getImageUrl = name => {
   return new URL(`../../assets/images/tabBar/${name}.png`, import.meta.url)
     .href;
 };
-onMounted(() => {
-  /*
-  const mobile_control_status =
-    localStorage.getItem("mobile_control_status") || "0";
-  // 动态切换平时态或者应急态
-  if (mobile_control_status === "1") {
-    tabBarData[1] = {
-      icon: "command",
-      iconActive: "command",
-      title: "移动指挥",
-      to: {
-        name: "MobileControl"
-      }
-    };
+
+// 设置定时器,刷新统计数
+const fetchInterval = process.env.NODE_ENV === 'development' ? 60000 : 10000; // 每60秒刷新一次(刷新太频繁影响调试)
+let intervalId: any | null = null;
+const startFetchingData = () => {
+  if (!intervalId) {
+    intervalId = setInterval(() => {
+      fetchData();
+    }, fetchInterval);
   }
-  */
+};
+
+const stopFetchingData = () => {
+  if (intervalId) {
+    clearInterval(intervalId);
+    intervalId = null;
+  }
+};
+
+const fetchData = async () => {
+  getUnreadMsgCount({"msg_types": "事件管理,值班管理"}).then((res)=>{
+    tabBarData.forEach((v)=>{
+      let obj = res.data.find(item=>item.name === v.title);
+      if(obj) {
+        v.num = ""+obj.num;
+      }
+    })
+  })
+}
+
+onMounted(() => {
+  // 统计数
+  nextTick(()=>{
+    fetchData();
+  });
+  startFetchingData();
+});
+onUnmounted(() => {
+  stopFetchingData();
 });
+
 </script>
 <style lang="scss" scoped>
 .custom-tabbar {

+ 1 - 1
src/router/routes.ts

@@ -218,7 +218,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
     name: "InformationReception",
     component: () => import("@/views/InformationReception/index.vue"),
     meta: {
-      title: "信息发布"
+      title: "消息中心"
     }
   },
   {

+ 95 - 28
src/views/InformationReception/index.vue

@@ -49,40 +49,91 @@
         @click="handleInfo(item)"
       >
           <div class="item-title">
-            <div :class="['info_type', get_info_type_color(item.info_type)]">
-              {{ get_info_type_text(item.info_type) }}
+            <div :class="['info_type', get_info_type_color(item.msg_type)]">
+              {{ item.msg_type }}
             </div>
             <div class="item-title-text">{{ item.title }}</div>
           </div>
           <!--预案通知-->
-          <div v-if="item.info_type === '0'" class="item-content">
+          <div v-if="item.msg_type === '预案通知'" class="item-content">
             <div class="line-item">
               <div class="item-label">预案名称:</div>
-              <div class="item-value">茂名市自然灾害救助应急预案</div>
+              <div class="item-value">{{ item.detail.plan_name }}</div>
             </div>
             <div class="line-item">
               <div class="item-label">响应级别:</div>
-              <div class="item-value">Ⅰ级响应</div>
+              <div class="item-value">{{ item.detail.response_level }}</div>
             </div>
             <div class="line-item">
               <div class="item-label">发布时间:</div>
-              <div class="item-value">{{ item.publish_time }}</div>
+              <div class="item-value">{{ item.detail.sent_time }}</div>
             </div>
             <div class="line-item">
               <div class="item-label">任务内容:</div>
-              <div class="item-value">{{ item.content || "暂无内容" }}</div>
+              <div class="item-value">{{ item.detail.yzy_content || "暂无内容" }}</div>
             </div>
           </div>
-        <div v-else class="item-content">
-          <div class="line-item">
-            <div class="item-label">发布时间:</div>
-            <div class="item-value">{{ item.publish_time }}</div>
+          <!-- 事件接报 -->
+          <div v-else-if="item.msg_type === '事件接报'" class="item-content">
+            <div class="line-item">
+              <div class="item-label">事件名称:</div>
+              <div class="item-value">{{ item.detail.event_title }}</div>
+            </div>
+            <div class="line-item">
+              <div class="item-label">事件等级:</div>
+              <div class="item-value">{{ item.detail.event_level }}</div>
+            </div>
+            <div class="line-item">
+              <div class="item-label">发生时间:</div>
+              <div class="item-value">{{ item.detail.event_time }}</div>
+            </div>
+            <div class="line-item">
+              <div class="item-label">事发地点:</div>
+              <div class="item-value">{{ item.detail.address }}</div>
+            </div>
+          </div>
+          <!-- 任务消息 -->
+          <div v-else-if="item.msg_type === '任务消息'" class="item-content">
+            <div class="line-item">
+              <div class="item-label">事件名称:</div>
+              <div class="item-value">{{ item.detail.event_title }}</div>
+            </div>
+            <div class="line-item">
+              <div class="item-label">发布时间:</div>
+              <div class="item-value">{{ item.detail.creation_time }}</div>
+            </div>
+            <div class="line-item">
+              <div class="item-label">任务内容:</div>
+              <div class="item-value">{{ item.detail.task_description }}</div>
+            </div>
+          </div>
+          <!-- 在线点名 -->
+          <div v-else-if="item.msg_type === '在线点名'" class="item-content">
+            <div class="line-item">
+              {{ item.detail.call_title }}
+            </div>
+            <div class="line-item">
+              <div class="item-label">发送时间:</div>
+              <div class="item-value">{{ item.detail.create_time }}</div>
+            </div>
           </div>
-          <div class="line-item">
-            <div class="item-label">任务内容:</div>
-            <div class="item-value">{{ item.content || "暂无内容" }}</div>
+          <!-- 信息发布 -->
+          <div v-else-if="['预警信息', '灾情信息', '灾情信息', '指挥救援', '公众防范'].includes(item.msg_type)" class="item-content">
+            <div class="line-item">
+              <div class="item-label">发布时间:</div>
+              <div class="item-value">{{ item.recv_time }}</div>
+            </div>
+            <div class="line-item">
+              <div class="item-label">任务内容:</div>
+              <div class="item-value">{{ item.content }}</div>
+            </div>
+          </div>
+
+          <div v-else class="item-content">
+            <div class="line-item">
+              {{ item.content }}
+            </div>
           </div>
-        </div>
       </div>
     </van-list>
   </div>
@@ -90,7 +141,7 @@
 
 <script lang="ts" setup>
 import { useRouter } from "vue-router";
-import { InformationList } from "@/api/InformationReception/InformationReception";
+import { MsgCenterList } from "@/api/InformationReception/InformationReception";
 import searchImg from "@/assets/images/search.png";
 import closeImg from "@/assets/images/close.png";
 import dayjs from "dayjs";
@@ -99,11 +150,24 @@ const router = useRouter();
 
 const opt_info_type = [
   { text: "全部", value: "" },
-  { text: "预警信息", value: "0" },
-  { text: "灾情信息", value: "1" },
-  { text: "处置信息", value: "2" },
-  { text: "指挥救援", value: "3" },
-  { text: "公众防范", value: "4" }
+  { text: "预案通知", value: "预案通知" },
+  { text: "事件接报", value: "事件接报" },
+  { text: "任务消息", value: "任务消息" },
+  { text: "在线点名", value: "在线点名" },
+
+  { text: "隐患巡查", value: "隐患巡查" },
+  { text: "风险排查", value: "风险排查" },
+  { text: "数据采集", value: "数据采集" },
+  
+  { text: "预警信息", value: "预警信息" },
+  { text: "灾情信息", value: "灾情信息" },
+  { text: "处置信息", value: "处置信息" },
+  { text: "指挥救援", value: "指挥救援" },
+  { text: "公众防范", value: "公众防范" },
+
+  { text: "审批消息", value: "审批消息" },
+  { text: "值班消息", value: "值班消息" },
+  { text: "系统消息", value: "系统消息" }
 ];
 
 const opt_info_order = [
@@ -111,12 +175,14 @@ const opt_info_order = [
   { text: "降序", value: "desc" }
 ];
 
-const get_info_type_text = (val) => {
-    return opt_info_type.find(item => item.value == val).text
-}
-
 const get_info_type_color = (val) => {
-  return "info_type_" + val
+  if(val == "任务消息") {
+    return "info_type_2"
+  }
+  else if(['预警信息', '灾情信息', '灾情信息', '指挥救援', '公众防范'].includes(val)) {
+    return "info_type_3"
+  }
+  return "info_type_0"
 }
 
 const onConfirmTime = () => {
@@ -170,7 +236,8 @@ const change_info_order = () => {
 };
 
 const handleInfo = (item) => {
-  router.push("/infoDetails?id=" + item.id);
+  // router.push("/infoDetails?id=" + item.id);
+  router.push(item.detail.detail_url);
 }
 
 const getList = () => {
@@ -179,7 +246,7 @@ const getList = () => {
   params['begin_time_s'] = params.begin_time.join("-");
   params['end_time_s'] = params.end_time.join("-");
   // console.log('params:', queryParams.value, params);
-  InformationList(params)
+  MsgCenterList(params)
     .then(res => {
       var items = res.data || [];
       total.value = res.total;

+ 8 - 6
src/views/event/index.vue

@@ -62,7 +62,7 @@
               v-if="item.event_status == '1'"
               type="danger"
               size="small"
-              @click="handleCloseEvent(item)"
+              @click="handleCloseEvent(index)"
             >
               结束指挥
             </van-button>
@@ -306,16 +306,18 @@ const handleStartEvent = index => {
   return false;
 };
 
-const handleCloseEvent = item => {
+const handleCloseEvent = index => {
+  current_item.value = event_list.value[index];
+  console.log("handleCloseEvent", current_item.value.event_id);
   showConfirmDialog({
     title: "结束指挥",
     message: "是否确定结束指挥?"
   }).then(() => {
     const params = {
-      eventId: item.value.event_id,
-      address: item.value.address,
-      latitude: item.value.latitude,
-      longitude: item.value.longitude
+      eventId: current_item.value.event_id,
+      address: current_item.value.address,
+      latitude: current_item.value.latitude,
+      longitude: current_item.value.longitude
     };
     // 如果 flag 为 true,则直接调用 closeEvent 接口关闭事件
     closeEvent(params).then(() => {

+ 4 - 2
src/views/leader/index.vue

@@ -253,7 +253,7 @@ const stopFetchingData = () => {
 };
 
 const fetchData = async () => {
-  getUnreadMsgCount({"msg_types": "工作审批,事件管理"}).then((res)=>{
+  getUnreadMsgCount({"msg_types": "工作审批,在线点名,事件管理"}).then((res)=>{
     menu.value.forEach((v)=>{
       let obj = res.data.find(item=>item.name === v.name);
       if(obj) {
@@ -267,7 +267,9 @@ onMounted(() => {
   initData();
 
   // 统计数
-  fetchData();
+  nextTick(()=>{
+    fetchData();
+  });
   startFetchingData();
 });
 onUnmounted(() => {

+ 19 - 23
src/views/worker/index.vue

@@ -38,8 +38,8 @@
       <div class="notice-item">
         <div class="notice-header">
           <div class="notice-label-box">
-            <div :class="['notice-label', get_info_type_color(noticeBarState.latestMessages.info_type)]">
-              {{ get_info_type_text(noticeBarState.latestMessages.info_type) }}
+            <div :class="['notice-label', get_info_type_color(noticeBarState.latestMessages.msg_type)]">
+              {{ noticeBarState.latestMessages.msg_type }}
             </div>
           </div>
           <!-- 查看更多的链接 -->
@@ -48,7 +48,7 @@
         <div class="notice-content" @click="handleInfo(noticeBarState.latestMessages)">
           {{ noticeBarState.latestMessages.content }}
         </div>
-        <div class="notice-time">{{ noticeBarState.latestMessages.publish_time }}</div>
+        <div class="notice-time">{{ noticeBarState.latestMessages.recv_time }}</div>
       </div>
     </div>
     <div class="container-content">
@@ -99,15 +99,15 @@ import { useRouter } from "vue-router";
 import closeImg from "@/assets/images/close.png";
 import { getPointInfoComprehensiveSearch } from "@/api/globalMap";
 import OnlineRollCall from "@/components/OnlineRollCall/index.vue";
-import { InformationList, getUnreadMsgCount } from "@/api/InformationReception/InformationReception";
+import { MsgCenterList, getUnreadMsgCount } from "@/api/InformationReception/InformationReception";
 
 const router = useRouter();
 const noticeBarState = reactive({
   show: false,
   latestMessages: {
-    info_type: '',
+    msg_type: '',
     content: '',
-    publish_time: ''
+    recv_time: ''
   }
 });
 
@@ -115,23 +115,16 @@ const goToInformationReception = () => {
   router.push({ name: "InformationReception" });
 };
 
-const get_info_type_text = (val) => {
-    return opt_info_type.find(item => item.value == val).text
-}
-
 const get_info_type_color = (val) => {
-  return "info_type_" + val
+  if(val == "任务消息") {
+    return "info_type_2"
+  }
+  else if(['预警信息', '灾情信息', '灾情信息', '指挥救援', '公众防范'].includes(val)) {
+    return "info_type_3"
+  }
+  return "info_type_0"
 }
 
-const opt_info_type = [
-  { text: "全部", value: "" },
-  { text: "预警信息", value: "0" },
-  { text: "灾情信息", value: "1" },
-  { text: "处置信息", value: "2" },
-  { text: "指挥救援", value: "3" },
-  { text: "公众防范", value: "4" }
-];
-
 // 菜单数据
 const menu = ref([
   { name: "巡查工作", icon: "icon1", num: 0, url: "inspectionWork" },
@@ -175,7 +168,7 @@ const getImageUrl = name => {
 
 // 请求数据
 const initData = async() => {
-  let res = await InformationList({})
+  let res = await MsgCenterList({})
   const data = res.data || [];
   if (data.length > 0) {
     noticeBarState.latestMessages = data[0]
@@ -183,7 +176,8 @@ const initData = async() => {
   }
 }
 const handleInfo = (item) => {
-  router.push("/infoDetails?id=" + item.id);
+  router.push(item.detail.detail_url);
+  //router.push("/infoDetails?id=" + item.id);
 }
 
 // 搜索
@@ -281,7 +275,9 @@ onMounted(() => {
   initData();
 
   // 统计数
-  fetchData();
+  nextTick(()=>{
+    fetchData();
+  });
   startFetchingData();
 });
 onUnmounted(() => {