Browse Source

feat:对接坐席监控数据;

zhangchong 1 year ago
parent
commit
91922e7f6d
4 changed files with 25 additions and 3 deletions
  1. 8 1
      src/router/index.ts
  2. 10 0
      src/views/home/index.vue
  3. 0 1
      src/views/index/center.map.ts
  4. 7 1
      src/views/seats/left-bottom.vue

+ 8 - 1
src/router/index.ts

@@ -20,7 +20,14 @@ const routes: Array<RouteRecordRaw> = [
     meta: {
       title: '宜宾市12345坐席监控中心',
     }
-  }
+  },{
+    path: '/home',
+    name: 'home',
+    component: () => import('@/views/home/index.vue'),
+    meta: {
+      title: '',
+    }
+  },
 ]
 const router = createRouter({
   history: createWebHistory(import.meta.env.BASE_URL),

+ 10 - 0
src/views/home/index.vue

@@ -0,0 +1,10 @@
+<template>
+12321
+</template>
+<script setup lang="ts" name="home">
+
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 0 - 1
src/views/index/center.map.ts

@@ -187,7 +187,6 @@ export const optionHandle = (regionCode: string,
                     position: 'left',
                     formatter: function (params: any) {
                         if (params.data) {
-                            console.log(params); //params是echarts的属性
                             const res = params.data; //res等于params下的数据
                             //return回调一个模板字符串,自定义提示框的形状
                             return `

+ 7 - 1
src/views/seats/left-bottom.vue

@@ -202,8 +202,14 @@ watch(()=>props.content,(val:any)=>{
     setOption(data);
   }, 100);
 });
+watch(
+  () => props.data,
+  (newData:any) => {
+    seatsList.value = newData;
+  },
+  { immediate: true }
+);
 onMounted(() => {
-  seatsList.value = props.data;
   mittBus.on('SeatState', (res: any) => {
     const item = seatsList.value.find((item: any) => item.telNo === res.telNo);
     if (item) {