From 9694b645b1a895b3271f1a81f18325f52656da93 Mon Sep 17 00:00:00 2001 From: 21819 Date: Mon, 18 Mar 2024 15:52:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BB=A5=E5=8F=8A=E8=BD=AE=E6=92=AD=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/datascreen/countyData.vue | 464 +++++++++++++++------------- src/views/datascreen/index.vue | 242 +++++++-------- src/views/work/Dissatisfied.vue | 11 +- src/views/work/Done.vue | 11 +- src/views/work/Fav.vue | 11 +- src/views/work/Query.vue | 23 +- src/views/work/Todo.vue | 11 +- 7 files changed, 394 insertions(+), 379 deletions(-) diff --git a/src/views/datascreen/countyData.vue b/src/views/datascreen/countyData.vue index 3b9f308..6b6adff 100644 --- a/src/views/datascreen/countyData.vue +++ b/src/views/datascreen/countyData.vue @@ -11,13 +11,14 @@
今日值班
-
- +
+
  • -

    {{ item.departName }} {{ item.mobile }} {{ item.policeName }}

    +

    {{ item.departName }} {{ item.mobile + }} {{ item.policeName }}

@@ -27,7 +28,8 @@
  • -

    {{ item.departName }} {{ item.mobile }} {{ item.policeName }}

    +

    {{ item.departName }} {{ item.mobile + }} {{ item.policeName }}

@@ -36,7 +38,8 @@
  • -

    {{ item.departName }} {{ item.mobile }} {{ item.policeName }}

    +

    {{ item.departName }} {{ item.mobile + }} {{ item.policeName }}

@@ -44,7 +47,8 @@
  • -

    {{ item.departName }} {{ item.mobile }} {{ item.policeName }}

    +

    {{ item.departName }} {{ item.mobile + }} {{ item.policeName }}

@@ -58,14 +62,14 @@ 派出所三率排名
- +
  • {{ item.name }}
    -
    +

    {{ item.rate }}{{ item.completed }} / {{ item.sum }}

    @@ -81,7 +85,7 @@
  • {{ item.name }}
    -
    +

    {{ item.rate }}{{ item.resolved }} / {{ item.sum }}

    @@ -97,7 +101,7 @@
  • {{ item.name }}
    -
    +

    {{ item.rate }}{{ item.satisfied }} / {{ item.sum }}

    @@ -118,12 +122,42 @@
      -
    • {{ consoleMap.todaySum }}

      今日来信
    • -
    • {{ consoleMap.allSum }}

      来信总数
    • -
    • {{ consoleMap.completed }}

      办结总数
    • -
    • {{ consoleMap.completedrate }}

      办结率
    • -
    • {{ consoleMap.satisfiedrate }}

      满意率
    • -
    • {{ consoleMap.resolvedrate }}

      解决率
    • +
    • +

      {{ consoleMap.todaySum }}

      今日来信 +
    • +
    • +

      {{ consoleMap.allSum }}

      来信总数 +
    • +
    • +

      {{ consoleMap.completed }}

      办结总数 +
    • +
    • + + + + 办结率 +
    • +
    • + + + + 满意率 +
    • +
    • + + + + 解决率 +
    @@ -136,74 +170,37 @@ 来信趋势
    - - + +
    - - + +
    - - + +
    - +
    - -
    + +
    - -
    + +
    @@ -212,13 +209,14 @@
    -
    +
    信件动态
      -
    • -

      {{ item.contactName }} :{{ item.contactPhone }}{{ item.mailState }}

      +
    • +

      {{ item.contactName }} :{{ item.contactPhone }}{{ item.mailState }} +

      {{ formatDate(item.createTime) }}

    @@ -233,13 +231,13 @@
    • - {{item.rownumber}} + {{ item.rownumber }}

      {{ item.category }}

      -

      {{item.sumcount}}

      +

      {{ item.sumcount }}

    • @@ -250,55 +248,78 @@
    - +
    - - \ No newline at end of file + \ No newline at end of file diff --git a/src/views/datascreen/index.vue b/src/views/datascreen/index.vue index 0df389a..813b27d 100644 --- a/src/views/datascreen/index.vue +++ b/src/views/datascreen/index.vue @@ -14,47 +14,47 @@
    - -
    + +
    +
      +
    • +

      {{ item.departName }} {{ item.mobile + }} {{ item.policeName }}

      +
    • + +
    +
    + +
    +
      -
    • +
    • {{ item.departName }} {{ item.mobile }} {{ item.policeName }}

    -
    -
    - -
      -
    • -

      {{ item.departName }} {{ item.mobile - }} {{ item.policeName }}

      -
    • + + +
        +
      • +

        {{ item.departName }} {{ item.mobile + }} {{ item.policeName }}

        +
      • -
      +
    +
    + +
      +
    • +

      {{ item.departName }} {{ item.mobile + }} {{ item.policeName }}

      +
    • - - -
        -
      • -

        {{ item.departName }} {{ item.mobile - }} {{ item.policeName }}

        -
      • - -
      -
      - -
        -
      • -

        {{ item.departName }} {{ item.mobile - }} {{ item.policeName }}

        -
      • - -
      -
      - +
    +
    +
    @@ -70,7 +70,7 @@
    • {{ item.name }} -
      +
      @@ -86,7 +86,7 @@
      • {{ item.name }} -
        +
        @@ -102,7 +102,7 @@
        • {{ item.name }} -
          +
          @@ -296,10 +296,10 @@ let dutyList = ref([]); let typeRankList = ref([]); let rateMap = ref([]); let mailTrendMap = ref([]); -let consoleMap = ref([]); let mailTypeRankList = reactive([]) as any[]; let completeList = reactive([]) as any[]; let dutySjList = reactive([]) as any[]; +const consoleMap = ref({}); const completedrateContent = ref('') const satisfiedrateContent = ref('') const resolvedrateContent = ref('') @@ -379,11 +379,11 @@ const selectYear = (year) => { //console大屏数据 const getConsoleDataMap = async () => { try { - consoleMap = await consoleData() - console.log(consoleMap) - completedrateContent.value = '办结率=办结数/来信总数\n' + consoleMap.completedrate + '=' + consoleMap.completed + '/' + consoleMap.completedsum - satisfiedrateContent.value = '满意率=满意数/来信总数\n' + consoleMap.satisfiedrate + '=' + consoleMap.satisfied + '/' + consoleMap.satisfiedsum - resolvedrateContent.value = '解决率=解决数/来信总数\n' + consoleMap.resolvedrate + '=' + consoleMap.resolved + '/' + consoleMap.resolvedsum + consoleMap.value = await consoleData() + console.log(consoleMap.value) + completedrateContent.value = '办结率=解决数/已办结数\n' + consoleMap.value.completedrate + '=' + consoleMap.value.completed + '/' + consoleMap.value.completedsum + satisfiedrateContent.value = '满意率=满意数/已办结数\n' + consoleMap.value.satisfiedrate + '=' + consoleMap.value.satisfied + '/' + consoleMap.value.satisfiedsum + resolvedrateContent.value = '解决率=解决数/来信总数\n' + consoleMap.value.resolvedrate + '=' + consoleMap.value.resolved + '/' + consoleMap.value.resolvedsum } catch (error) { } } @@ -635,23 +635,26 @@ const changsMap = () => { trigger: 'item', position: 'right', formatter: function (params) { - - if (typeof params.data === 'undefined') { - - } else { - var tt = '
          ' + - '
          ' + params.name + '
          ' + - '
          ' + - '
            ' + - '
          • 今日来信 ' + params.data.todaysum + '
          • ' + - '
          • 来信总数 ' + params.data.allsum + '
          • ' + - '
          • 办结总数 ' + params.data.completed + '
          • ' + - '
          • 办结率 ' + params.data.completedrate + '
          • ' + - '
          • 解决率 ' + params.data.resolvedrate + '
          • ' + - '
          • 满意率 ' + params.data.satisfiedrate + '
          • ' + - '
          ' - return tt; - } + const data = params.data || { + todaysum: 0, + allsum: 0, + completed: 0, + completedrate: '0%', + resolvedrate: '0%', + satisfiedrate: '0%' + }; + var tt = '
          ' + + '
          ' + params.name + '
          ' + + '
          ' + + '
            ' + + '
          • 今日来信 ' + data.todaysum + '
          • ' + + '
          • 来信总数 ' + data.allsum + '
          • ' + + '
          • 办结总数 ' + data.completed + '
          • ' + + '
          • 办结率 ' + data.completedrate + '
          • ' + + '
          • 解决率 ' + data.resolvedrate + '
          • ' + + '
          • 满意率 ' + data.satisfiedrate + '
          • ' + + '
          ' + return tt; }, backgroundColor: '#031577', // borderColor: '#0A2F86', @@ -715,94 +718,79 @@ const changsMap = () => { } - - +const intervalTime = 3000; // 定时器间隔时间设置为3000毫秒 const switchRegion = () => { - const chart = echarts.getInstanceByDom(map.value); + const chart = echarts.getInstanceByDom(map.value); // 获取echarts实例 + if (!chart) { + console.error('ECharts实例未找到'); + return; + } + const option = chart.getOption(); const mapSeriesIndex = option.series.findIndex((series) => series.type === 'map'); if (mapSeriesIndex >= 0) { const mapData = option.series[mapSeriesIndex].data; - const regionCount = mapData.length; - const prevIndex = currentIndex; - currentIndex = (currentIndex + 1) % regionCount; - - - //mapData[prevIndex].selected = false; // 取消上一个区域的选中状态 - // mapData[currentIndex].selected = true; // 设置当前区域为选中状态 - - var hourIndex = 0; - - - carouselTime = setInterval(() => { - //dispatchAction echarts的API:触发图表行为 - chart.dispatchAction({ - type: "downplay", //downplay 取消高亮指定的数据图形 - seriesIndex: 0 - }); - chart.dispatchAction({ - type: "highlight", //highLight 高亮指定的数据图形 - seriesIndex: 0, //系列index - dataIndex: hourIndex //数据index - }); - chart.dispatchAction({ - type: "showTip", //showTip 显示提示框 - seriesIndex: 0, - dataIndex: hourIndex - }); - hourIndex++; - //当循环到数组当中的最后一条数据后,重新进行循环 - if (hourIndex > mapData.length) { - hourIndex = 0; - } - }, 3000); - //鼠标移入组件时停止轮播 - chart.on("mousemove", (e) => { - clearInterval(carouselTime); //清除循环 - chart.dispatchAction({ - type: "downplay", - seriesIndex: 0, - }); - chart.dispatchAction({ - type: "highlight", - seriesIndex: 0, - dataIndex: e.dataIndex - }); - chart.dispatchAction({ - type: "showTip", - seriesIndex: 0, - dataIndex: e.dataIndex - }); - }); - //鼠标移出组件时恢复轮播 - chart.on("mouseout", () => { + if (!mapData || mapData.length === 0) { + console.warn('地图数据为空'); + return; // 没有数据时直接返回 + } + + // 停止已有的轮播(如果有) + clearInterval(carouselTime); + + // 设置定时器轮播逻辑 + const startCarousel = () => { carouselTime = setInterval(() => { - chart.dispatchAction({ - type: "downplay", - seriesIndex: 0, + currentIndex = (currentIndex + 1) % mapData.length; // 更新当前索引 + // 触发echarts的行为 + chart.dispatchAction({ + type: "downplay", // 取消高亮 + seriesIndex: mapSeriesIndex + }); + chart.dispatchAction({ + type: "highlight", // 高亮显示当前index的数据 + seriesIndex: mapSeriesIndex, + dataIndex: currentIndex }); + chart.dispatchAction({ + type: "showTip", // 显示当前数据的tooltip + seriesIndex: mapSeriesIndex, + dataIndex: currentIndex + }); + }, intervalTime); + }; + + // 鼠标移入组件时停止轮播 + chart.off('mousemove'); // 先取消之前可能存在的事件绑定 + chart.on("mousemove", (e) => { + clearInterval(carouselTime); + if (e.dataIndex !== undefined) { chart.dispatchAction({ type: "highlight", - seriesIndex: 0, - dataIndex: hourIndex + seriesIndex: mapSeriesIndex, + dataIndex: e.dataIndex }); chart.dispatchAction({ type: "showTip", - seriesIndex: 0, - dataIndex: hourIndex + seriesIndex: mapSeriesIndex, + dataIndex: e.dataIndex }); - hourIndex++; - if (hourIndex > mapData.length) { - hourIndex = 0; - } - }, 3000); + } }); - chart.setOption(option); + + // 鼠标移出组件时恢复轮播 + chart.off('mouseout'); // 先取消之前可能存在的事件绑定 + chart.on("mouseout", () => { + startCarousel(); + }); + + startCarousel(); // 开始轮播 } }; + const dayEcharts = () => { // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(day_echart.value); diff --git a/src/views/work/Dissatisfied.vue b/src/views/work/Dissatisfied.vue index 2f3bede..5b90d44 100644 --- a/src/views/work/Dissatisfied.vue +++ b/src/views/work/Dissatisfied.vue @@ -96,12 +96,7 @@ - - - @@ -130,6 +125,12 @@ + + + + + + + + + + + + +