forked from drone/command-center-dashboard

chenyao
2025-03-31 295eb3cc87aaa5176d64a4ef985cdad0bfefae9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<script setup>
import CommonTitle from '@/components/CommonTitle.vue';
import { pxToRem } from '@/utils/rem';
import overviewImg1 from '@/assets/images/home/homeRight/overview1.png';
import overviewImg2 from '@/assets/images/home/homeRight/overview2.png';
import overviewImg3 from '@/assets/images/home/homeRight/overview3.png';
import overviewImg4 from '@/assets/images/home/homeRight/overview4.png';
import overviewImg5 from '@/assets/images/home/homeRight/overview5.png';
import overviewImg6 from '@/assets/images/home/homeRight/overview6.png';
import completionLeft from '@/assets/images/home/homeRight/completionLeft.png';
import * as echarts from 'echarts';
import CommonDateTime from '@/components/CommonDateTime.vue';
 
const list = ref([
  { name: '待审核', value: 265, img: overviewImg1, color: '#FF8E8E' },
  { name: '待分拨', value: 266, img: overviewImg2, color: '#6FCAFF' },
  { name: '待处理', value: 262, img: overviewImg3, color: '#6FCAFF' },
  { name: '处理中', value: 262, img: overviewImg4, color: '#FFD509' },
  { name: '已完成', value: 246, img: overviewImg5, color: '#FF8E8E' },
  { name: '已完结', value: 262, img: overviewImg6, color: '#8EFFAC' },
]);
const value = ref('');
const echartsRef = ref('');
 
const options = [
  {
    value: 'Option1',
    label: 'Option1',
  },
];
const option = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow',
    },
  },
  grid: {
    top: '5%',
    left: 0,
    right: 0,
    bottom: 0,
    containLabel: true,
  },
  xAxis: [
    {
      type: 'category',
      axisLabel: {
        rotate: -45, // 旋转角度
        interval: 0, // 显示所有标签
        color: '#FFFFFF',
        fontFamily: 'Source Han Sans CN, Source Han Sans CN',
        fontWeight: 400,
        fontSize: 10,
      },
      data: ['暴露垃圾', '占道','暴露垃圾', '占道','暴露垃圾', '占道','暴露垃圾', '占道',],
    },
  ],
  yAxis: [
    {
      type: 'value',
      axisLabel: {
        interval: 0, // 显示所有标签
        color: '#FFFFFF',
        fontFamily: 'Source Han Sans CN, Source Han Sans CN',
        fontWeight: 400,
        fontSize: 10,
      },
      axisLine: {
        lineStyle: {
          color: '#ffffff',
        },
      },
      splitLine: {
        lineStyle: {
          color: 'rgba(255, 255, 255, 0.1)',
          type: 'dashed', // 设置为虚线
        },
      },
    },
  ],
  series: [
    {
      name: '待完成',
      type: 'bar',
      stack: 'Ad',
      emphasis: {
        focus: 'series',
      },
      itemStyle: {
        color: '#FF8E8E', // 设置颜色
      },
      data: [120, 132,120, 132,120, 132,120, 132,],
    },
    {
      name: '已完成',
      type: 'bar',
      stack: 'Ad',
      emphasis: {
        focus: 'series',
      },
      data: [120, 132,120, 132,120, 132,120, 132,],
    },
    {
      name: '已完成1',
      type: 'bar',
      stack: 'Ad',
      emphasis: {
        focus: 'series',
      },
      data: [120, 132,120, 132,120, 132,120, 132,],
    },
    {
      name: '已完成2',
      type: 'bar',
      stack: 'Ad',
      emphasis: {
        focus: 'series',
      },
      data: [120, 132,120, 132,120, 132,120, 132,],
    },
    {
      name: '完成率',
      type: 'line',
      itemStyle: {
        color: '#0CEBF7', // 设置颜色
      },
      lineStyle: {
        width: 2, // 线条宽度
        type: 'solid', // 线条类型
      },
      symbol: 'circle', // 数据点符号
      symbolSize: 6, // 数据点符号大小
      emphasis: {
        focus: 'series',
      },
      data: [50, 55, 60, 65, 70, 75, 80, 85], // 示例数据,根据实际完成率计算
    },
  ],
};
 
onMounted(() => {
  const chart = echarts.init(echartsRef.value);
  chart.setOption(option);
  window.addEventListener('resize', () => {
    chart.resize();
  });
});
</script>
 
<template>
  <CommonTitle title="事件概况" />
  <div :style="{ marginLeft: pxToRem(14) }">
    <div class="eventOverview">
      <div class="overviewData">
        <div class="totalBox">
          <div class="totalNumber">8096</div>
          <div class="totalLabel">总事件数</div>
        </div>
        <div class="contentBox">
          <div class="overviewItem" v-for="item in list" :key="item.name">
            <div class="itemName"><img :src="item.img" alt="" />{{ item.name }}</div>
            <div class="itemValue" :style="{ color: item.color }">{{ item.value }}</div>
          </div>
        </div>
      </div>
      <CommonDateTime class="dateTime" />
 
      <el-select class="homeRightSelect" v-model="value" placeholder="请选择" size="large">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
 
      <div class="completion">
        <img class="completion-left-img" :src="completionLeft" />
        <div class="completion-text">事件类型完成率情况</div>
        <div class="completion-separator"></div>
        <img class="completion-left-img" :src="completionLeft" />
      </div>
 
      <div class="chart" ref="echartsRef"></div>
    </div>
  </div>
</template>
 
<style scoped lang="scss">
.homeRightSelect {
  width: 356px;
  :deep() {
    .el-select__wrapper {
      background: linear-gradient(90deg, #195bad 0%, rgba(25, 91, 173, 0) 100%);
      min-height: 28px;
      height: 28px;
      box-shadow: none;
      border: 1px solid #306fca;
    }
 
    .el-select__placeholder {
      font-family: Microsoft YaHei, Microsoft YaHei, serif;
      color: #ffffff;
      font-size: 14px;
    }
  }
}
 
.eventOverview {
  width: 390px;
  height: 445px;
  background: linear-gradient(
    270deg,
    #1f3e7a 0%,
    rgba(31, 62, 122, 0.35) 79%,
    rgba(31, 62, 122, 0) 100%
  );
  border-radius: 0px 0px 0px 0px;
  opacity: 0.85;
  margin: 3px 0 0 0;
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
 
  .dateTime{
    width: 356px;
    margin: 15px 0 8px 0;
  }
 
  .overviewData {
    width: 360px;
    height: 122px;
    background: url('@/assets/images/home/homeRight/overviewBg.png') no-repeat center / 100% 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 11px;
 
    .totalBox {
      .totalNumber {
        font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
        font-weight: 400;
        font-size: 26px;
        color: #ffffff;
        line-height: 30px;
        text-align: center;
      }
 
      .totalLabel {
        font-family: Source Han Sans CN, Source Han Sans CN;
        font-weight: 400;
        font-size: 14px;
        color: #ffffff;
        line-height: 20px;
        text-align: center;
      }
    }
 
    .contentBox {
      width: 246px;
      display: flex;
      flex-wrap: wrap;
      gap: 13px 0;
      font-family: Source Han Sans CN, Source Han Sans CN, serif;
      font-weight: 400;
      font-size: 14px;
      color: #ffffff;
      line-height: 14px;
 
      .overviewItem {
        width: calc(100% / 3);
 
        .itemName {
          display: flex;
          align-items: center;
          margin-bottom: 6px;
 
          img {
            width: 16px;
            height: 16px;
          }
        }
 
        .itemValue {
          font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
          font-weight: 400;
          font-size: 24px;
          line-height: 18px;
        }
      }
    }
  }
 
  .completion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 356px;
    height: 23px;
    margin-top: 16px;
 
    &--left-img {
      width: 16px;
      height: 16px;
    }
 
    &-text {
      font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
      font-weight: 400;
      font-size: 18px;
      color: #ffffff;
      line-height: 21px;
    }
 
    &-separator {
      width: 149px;
      height: 0px;
      border: 1px solid #4ca6ff;
      opacity: 0.2;
    }
  }
 
  .chart {
    width: 356px;
    height: 190px;
  }
}
</style>