vue2-client 1.2.40 → 1.2.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +109 -103
  2. package/docs/notice.md +22 -22
  3. package/package.json +1 -1
  4. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +555 -0
  5. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  6. package/src/base-client/components/common/XAddForm/XAddForm.vue +339 -338
  7. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +2 -1
  8. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  9. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +225 -225
  10. package/src/base-client/components/iot/DataAnalysisView/DataAnalysisView.vue +244 -244
  11. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +452 -452
  12. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  13. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  14. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +121 -121
  15. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  16. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +276 -276
  17. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +469 -469
  18. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +379 -379
  19. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +359 -359
  20. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  21. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +184 -184
  22. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +291 -291
  23. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +236 -236
  24. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +256 -256
  25. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +189 -189
  26. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +722 -722
  27. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  28. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +247 -247
  29. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +370 -370
  30. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  31. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  32. package/src/base-client/plugins/AppData.js +67 -67
  33. package/src/base-client/plugins/GetLoginInfoService.js +252 -252
  34. package/src/components/exception/ExceptionPage.vue +70 -70
  35. package/src/components/setting/Setting.vue +235 -235
  36. package/src/config/default/setting.config.js +35 -35
  37. package/src/config/index.js +3 -3
  38. package/src/layouts/SinglePageView.vue +72 -70
  39. package/src/layouts/header/HeaderNotice.vue +97 -97
  40. package/src/layouts/tabs/TabsView.vue +41 -40
  41. package/src/pages/login/Login.vue +201 -201
  42. package/src/pages/report/ReportTableHome.vue +28 -28
  43. package/src/pages/resourceManage/depListManage.vue +23 -23
  44. package/src/pages/resourceManage/funListManage.vue +23 -23
  45. package/src/pages/resourceManage/index.js +15 -15
  46. package/src/pages/resourceManage/orgListManage.vue +98 -98
  47. package/src/pages/resourceManage/roleListManage.vue +23 -23
  48. package/src/pages/resourceManage/staffListManage.vue +23 -23
  49. package/src/pages/system/ticket/submitTicketSuccess.vue +248 -248
  50. package/src/router/async/config.async.js +26 -26
  51. package/src/router/index.js +27 -27
  52. package/src/services/api/common.js +47 -47
  53. package/src/services/api/index.js +39 -39
  54. package/src/services/user.js +34 -34
  55. package/src/theme/default/style.less +47 -33
  56. package/src/utils/indexedDB.js +146 -146
  57. package/src/utils/routerUtil.js +359 -359
@@ -1,722 +1,722 @@
1
- <template>
2
- <a-drawer
3
- title="物联网综合分析"
4
- placement="right"
5
- :width="isMobile ? screenWidth : screenWidth * 0.85"
6
- :visible="visible"
7
- @close="onClose"
8
- >
9
- <a-page-header :title="selectOrgName +' - 物联网运行维护'">
10
- <div>
11
- <a-row :gutter="24">
12
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
13
- <x-card :loadState="instructSumLoadState" :retry="loadInstructSumCount">
14
- <chart-card title="总指令数" :total="instructSum | NumberFormat">
15
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadInstructSumCount()">
16
- <a-icon type="redo" />
17
- </a-tooltip>
18
- <a-tooltip title="生成的所有指令总数" slot="action">
19
- <a-icon type="info-circle-o" />
20
- </a-tooltip>
21
- <div>
22
- <trend :flag="instructYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
23
- <span slot="term">同周比</span>
24
- {{ instructYoW + '%' }}
25
- </trend>
26
- <trend :flag="instructYoD >= 0 ? 'up' : 'down'">
27
- <span slot="term">日同比</span>
28
- {{ instructYoD + '%' }}
29
- </trend>
30
- </div>
31
- <template slot="footer">昨日新增 <span>{{ instructYesAdd | NumberFormat }}</span></template>
32
- </chart-card>
33
- </x-card>
34
- </a-col>
35
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
36
- <x-card :loadState="metereadSumLoadState" :retry="loadMetereadSumCount">
37
- <chart-card title="总抄表量" :total="metereadSum | NumberFormat">
38
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadMetereadSumCount()">
39
- <a-icon type="redo" />
40
- </a-tooltip>
41
- <a-tooltip title="生成的所有抄表(meteread)总数" slot="action">
42
- <a-icon type="info-circle-o" />
43
- </a-tooltip>
44
- <div>
45
- <mini-area :dataSource="metereadSumDataByWeek" :scale="metereadSumByWeekScale" />
46
- </div>
47
- <template slot="footer">昨日新增 <span> {{ metereadYesAdd | NumberFormat }}</span></template>
48
- </chart-card>
49
- </x-card>
50
- </a-col>
51
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
52
- <x-card :loadState="usingMeterSumLoadState" :retry="loadUsingMeterSumCount">
53
- <chart-card title="在用表具数" :total="usingMeterSum | NumberFormat">
54
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadUsingMeterSumCount()">
55
- <a-icon type="redo" />
56
- </a-tooltip>
57
- <a-tooltip title="开户成功的物联网表总数" slot="action">
58
- <a-icon type="info-circle-o" />
59
- </a-tooltip>
60
- <div>
61
- <mini-bar :dataSource="usingMeterSumDataByWeek" :scale="usingMeterSumByWeekScale" />
62
- </div>
63
- <template slot="footer">昨日新增 <span>{{ usingMeterYesAdd | NumberFormat }}</span></template>
64
- </chart-card>
65
- </x-card>
66
- </a-col>
67
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
68
- <x-card :loadState="instructRateOfSuccessLoadState" :retry="loadInstructRateOfSuccess">
69
- <chart-card title="指令下发成功率" :total="instructRateOfSuccessValue + '%'">
70
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadInstructRateOfSuccess()">
71
- <a-icon type="redo" />
72
- </a-tooltip>
73
- <a-tooltip title="执行成功和已发送状态的指令占所有指令的比例" slot="action">
74
- <a-icon type="info-circle-o" />
75
- </a-tooltip>
76
- <div>
77
- <mini-progress :color="instructRateOfColor" :target="90" :percentage="instructRateOfSuccessValue" height="8px" />
78
- </div>
79
- <template slot="footer">
80
- <trend :flag="instructRateOfSuccessYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
81
- <span slot="term">同周比</span>
82
- {{ instructRateOfSuccessYoW + '%' }}
83
- </trend>
84
- <trend :flag="instructRateOfSuccessYoD >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
85
- <span slot="term">日同比</span>
86
- {{ instructRateOfSuccessYoD + '%' }}
87
- </trend>
88
- <span slot="term">昨日成功率</span>
89
- {{ yesterdayInstructRateOf + '%' }}
90
- </template>
91
- </chart-card>
92
- </x-card>
93
- </a-col>
94
- </a-row>
95
-
96
- <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}">
97
- <div class="salesCard">
98
- <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
99
- <div class="extra-wrapper" slot="tabBarExtraContent">
100
- <div class="extra-item">
101
- <a>今日</a>
102
- <a>本周</a>
103
- <a>本月</a>
104
- <a>本年</a>
105
- </div>
106
- <a-range-picker :style="{width: '256px'}" />
107
- </div>
108
- <a-tab-pane tab="抄表情况分析" key="1">
109
- <a-row :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
110
- <x-card :loadState="radarLoadState" :retry="loadGasView">
111
- <div style="padding: 0 0 0 20px;height: 370px" id="container" />
112
- </x-card>
113
- </a-row>
114
- </a-tab-pane>
115
- <a-tab-pane tab="访问量" key="2">
116
- <a-row>
117
- <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
118
- <bar :data="barData2" title="销售额趋势" />
119
- </a-col>
120
- <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
121
- <rank-list title="门店销售排行榜" :list="rankList"/>
122
- </a-col>
123
- </a-row>
124
- </a-tab-pane>
125
- </a-tabs>
126
- </div>
127
- </a-card>
128
-
129
- <div class="antd-pro-pages-dashboard-analysis-twoColLayout" :class="!isMobile && 'desktop'">
130
- <a-row :gutter="24" type="flex" :style="{ marginTop: '24px' }">
131
- <a-col :xl="12" :lg="24" :md="24" :sm="24" :xs="24">
132
- <a-card :loading="loading" :bordered="false" title="用气情况排行" :style="{ height: '100%' }">
133
- <a-dropdown :trigger="['click']" placement="bottomLeft" slot="extra">
134
- <a class="ant-dropdown-link" href="#">
135
- <a-icon type="ellipsis" />
136
- </a>
137
- <a-menu slot="overlay">
138
- <a-menu-item>
139
- <a href="javascript:">操作一</a>
140
- </a-menu-item>
141
- <a-menu-item>
142
- <a href="javascript;">操作二</a>
143
- </a-menu-item>
144
- </a-menu>
145
- </a-dropdown>
146
- <a-row :gutter="68">
147
- <a-col :xs="24" :sm="12" :style="{ marginBottom: ' 24px'}">
148
- <number-info :total="21232.1" :sub-total="17.1">
149
- <span slot="subtitle">
150
- <span>当天总用气量</span>
151
- <a-tooltip title="指标说明" slot="action">
152
- <a-icon type="info-circle-o" :style="{ marginLeft: '8px' }" />
153
- </a-tooltip>
154
- </span>
155
- </number-info>
156
- <!-- miniChart -->
157
- <div>
158
- <mini-smooth-area :style="{ height: '45px' }" :dataSource="searchUserData" :scale="searchUserScale" />
159
- </div>
160
- </a-col>
161
- <a-col :xs="24" :sm="12" :style="{ marginBottom: ' 24px'}">
162
- <number-info :total="0.7" :sub-total="0.2" status="up">
163
- <span slot="subtitle">
164
- <span>人均用气量</span>
165
- <a-tooltip title="指标说明" slot="action">
166
- <a-icon type="info-circle-o" :style="{ marginLeft: '8px' }" />
167
- </a-tooltip>
168
- </span>
169
- </number-info>
170
- <!-- miniChart -->
171
- <div>
172
- <mini-smooth-area :style="{ height: '45px' }" :dataSource="searchUserData" :scale="searchUserScale" />
173
- </div>
174
- </a-col>
175
- </a-row>
176
- <div class="ant-table-wrapper">
177
- <a-table
178
- row-key="index"
179
- size="small"
180
- :columns="searchTableColumns"
181
- :dataSource="searchData"
182
- :pagination="{ pageSize: 5 }"
183
- >
184
- <span slot="range" slot-scope="text, record">
185
- <trend :flag="record.status === 0 ? 'up' : 'down'">
186
- {{ text }}%
187
- </trend>
188
- </span>
189
- </a-table>
190
- </div>
191
- </a-card>
192
- </a-col>
193
- <a-col :xl="12" :lg="24" :md="24" :sm="24" :xs="24">
194
- <a-card class="antd-pro-pages-dashboard-analysis-salesCard" :loading="loading" :bordered="false" title="指令类别占比" :style="{ height: '100%' }">
195
- <div slot="extra" style="height: inherit;">
196
- <div class="analysis-salesTypeRadio">
197
- <a-radio-group defaultValue="a">
198
- <a-radio-button value="a">本日</a-radio-button>
199
- <a-radio-button value="b">本周</a-radio-button>
200
- <a-radio-button value="c">本月</a-radio-button>
201
- </a-radio-group>
202
- </div>
203
- </div>
204
- <h4></h4>
205
- <div>
206
- <!-- style="width: calc(100% - 240px);" -->
207
- <div>
208
- <v-chart :force-fit="true" :height="405" :data="pieData" :scale="pieScale">
209
- <v-tooltip :showTitle="false" dataKey="item*percent" />
210
- <v-axis />
211
- <!-- position="right" :offsetX="-140" -->
212
- <v-legend dataKey="item"/>
213
- <v-pie position="percent" color="item" :vStyle="pieStyle" />
214
- <v-coord type="theta" :radius="0.75" :innerRadius="0.6" />
215
- </v-chart>
216
- </div>
217
- </div>
218
- </a-card>
219
- </a-col>
220
- </a-row>
221
- </div>
222
- </div>
223
- </a-page-header>
224
- </a-drawer>
225
- </template>
226
-
227
- <script>
228
- import moment from 'moment'
229
- import {
230
- ChartCard,
231
- MiniArea,
232
- MiniBar,
233
- MiniProgress,
234
- RankList,
235
- Bar,
236
- Trend,
237
- NumberInfo,
238
- MiniSmoothArea
239
- } from '@vue2-client/components'
240
- import { formatDate } from '@vue2-client/utils/util'
241
- import { Line } from '@antv/g2plot'
242
- import { mapState } from 'vuex'
243
- import { WebmeterAnalysisViewApi, post } from '@vue2-client/services/api'
244
-
245
- const barData = []
246
- const barData2 = []
247
- for (let i = 0; i < 12; i += 1) {
248
- barData.push({
249
- x: `${i + 1}月`,
250
- y: Math.floor(Math.random() * 1000) + 200
251
- })
252
- barData2.push({
253
- x: `${i + 1}月`,
254
- y: Math.floor(Math.random() * 1000) + 200
255
- })
256
- }
257
-
258
- const rankList = []
259
- for (let i = 0; i < 7; i++) {
260
- rankList.push({
261
- name: '白鹭岛 ' + (i + 1) + ' 号店',
262
- total: 1234.56 - i * 100
263
- })
264
- }
265
-
266
- const searchUserData = []
267
- for (let i = 0; i < 7; i++) {
268
- searchUserData.push({
269
- x: moment().add(i, 'days').format('YYYY-MM-DD'),
270
- y: Math.ceil(Math.random() * 10)
271
- })
272
- }
273
- const searchUserScale = [
274
- {
275
- dataKey: 'x',
276
- alias: '时间'
277
- },
278
- {
279
- dataKey: 'y',
280
- alias: '用气量',
281
- min: 0,
282
- max: 10
283
- }]
284
-
285
- const searchTableColumns = [
286
- {
287
- dataIndex: 'index',
288
- title: '用户编号',
289
- width: 90
290
- },
291
- {
292
- dataIndex: 'keyword',
293
- title: '用户姓名'
294
- },
295
- {
296
- dataIndex: 'count',
297
- title: '用气量'
298
- },
299
- {
300
- dataIndex: 'range',
301
- title: '周涨幅',
302
- align: 'right',
303
- sorter: (a, b) => a.range - b.range,
304
- scopedSlots: { customRender: 'range' }
305
- }
306
- ]
307
-
308
- const userInfoArray = [
309
- '德昌鸿公司2',
310
- '瑞鑫宇公司',
311
- '保康县熊绎中学',
312
- '文康置业有限公司',
313
- '湖北省旗星文化旅游实业有限公司'
314
- ]
315
-
316
- const searchData = []
317
- let j = 0
318
- for (let i = 0; i < 5; i += 1) {
319
- searchData.push({
320
- index: Math.floor(Math.random() * 10000000),
321
- keyword: userInfoArray[j],
322
- count: Math.floor(Math.random() * 1000),
323
- range: Math.floor(Math.random() * 10),
324
- status: Math.floor((Math.random() * 10) % 2)
325
- })
326
- j++
327
- }
328
-
329
- const DataSet = require('@antv/data-set')
330
-
331
- const sourceData = [
332
- { item: '远程开户', count: 32.2 },
333
- { item: '远程充值', count: 21 },
334
- { item: '阀门控制', count: 17 },
335
- { item: '远程调价', count: 13 },
336
- { item: '设置参数', count: 9 },
337
- { item: '远程注销', count: 7.8 }
338
- ]
339
-
340
- const pieScale = [{
341
- dataKey: 'percent',
342
- min: 0,
343
- formatter: '.0%'
344
- }]
345
-
346
- const dv = new DataSet.View().source(sourceData)
347
- dv.transform({
348
- type: 'percent',
349
- field: 'count',
350
- dimension: 'item',
351
- as: 'percent'
352
- })
353
- const pieData = dv.rows
354
-
355
- export default {
356
- name: 'WebmeterAnalysisView',
357
- components: {
358
- ChartCard,
359
- MiniArea,
360
- MiniBar,
361
- MiniProgress,
362
- RankList,
363
- Bar,
364
- Trend,
365
- NumberInfo,
366
- MiniSmoothArea
367
- },
368
- data () {
369
- return {
370
- // 页面宽度
371
- screenWidth: document.documentElement.clientWidth,
372
- // 客户名称
373
- customerName: '',
374
- // 指令数统计Loading
375
- instructSumLoadState: 'loading',
376
- // 总指令数
377
- instructSum: 0,
378
- // 同周比
379
- instructYoW: 0,
380
- // 日同比
381
- instructYoD: 0,
382
- // 昨日新增指令数
383
- instructYesAdd: 0,
384
- // 抄表量统计Loading
385
- metereadSumLoadState: 'loading',
386
- // 总抄表量
387
- metereadSum: 0,
388
- // 昨日新增抄表量
389
- metereadYesAdd: 0,
390
- // 近一周抄表量明细
391
- metereadSumDataByWeek: [],
392
- // 近一周抄表量明细列
393
- metereadSumByWeekScale: [
394
- {
395
- dataKey: 'x',
396
- alias: '时间'
397
- },
398
- {
399
- dataKey: 'y',
400
- alias: '抄表量'
401
- }
402
- ],
403
- // 抄表情况分析Loading
404
- radarLoadState: 'loading',
405
- // 在用表具统计Loading
406
- usingMeterSumLoadState: 'loading',
407
- // 在用表具总量
408
- usingMeterSum: 0,
409
- // 昨日新增在用表具量
410
- usingMeterYesAdd: 0,
411
- // 近一周新增在用表具明细
412
- usingMeterSumDataByWeek: [],
413
- // 近一周新增在用表具明细列
414
- usingMeterSumByWeekScale: [
415
- {
416
- dataKey: 'x',
417
- alias: '时间'
418
- },
419
- {
420
- dataKey: 'y',
421
- alias: '开户数'
422
- }
423
- ],
424
- // 指令成功率统计Loading
425
- instructRateOfSuccessLoadState: 'loading',
426
- // 指令成功率
427
- instructRateOfSuccessValue: 0,
428
- // 昨日指令成功率
429
- yesterdayInstructRateOf: 0,
430
- // 同周比
431
- instructRateOfSuccessYoW: 0,
432
- // 日同比
433
- instructRateOfSuccessYoD: 0,
434
- // 指令成功率进度色
435
- instructRateOfColor: 'rgb(19, 194, 194)',
436
- // 是否刷新加载中
437
- loading: false,
438
- rankList,
439
-
440
- // 搜索用户数
441
- searchUserData,
442
- searchUserScale,
443
- searchTableColumns,
444
- searchData,
445
-
446
- barData,
447
- barData2,
448
-
449
- //
450
- pieScale,
451
- pieData,
452
- sourceData,
453
- pieStyle: {
454
- stroke: '#fff',
455
- lineWidth: 1
456
- }
457
- }
458
- },
459
- mounted () {
460
- // 加载指令数统计
461
- this.loadInstructSumCount()
462
- // 加载抄表量统计
463
- this.loadMetereadSumCount()
464
- // 加载在用表具量统计
465
- this.loadUsingMeterSumCount()
466
- // 加载指令成功率统计
467
- this.loadInstructRateOfSuccess()
468
- // 加载g2图表
469
- this.loadGasView()
470
- },
471
- computed: {
472
- ...mapState('setting', ['isMobile'])
473
- },
474
- props: {
475
- selectOrgName: {
476
- type: String,
477
- required: true
478
- },
479
- webmeterUrl: {
480
- type: String,
481
- required: true
482
- },
483
- systemVersion: {
484
- type: String,
485
- required: true
486
- },
487
- dataSource: {
488
- type: String,
489
- required: true
490
- },
491
- visible: {
492
- type: Boolean,
493
- default: false
494
- }
495
- },
496
- methods: {
497
- onClose () {
498
- this.$emit('update:visible', false)
499
- },
500
- loadInstructSumCount () {
501
- this.instructSumLoadState = 'loading'
502
- return post(WebmeterAnalysisViewApi.instructSumCount, {
503
- webmeterUrl: this.webmeterUrl,
504
- systemVersion: this.systemVersion,
505
- dataSource: this.dataSource
506
- }).then(res => {
507
- this.instructSum = res.instructSum
508
- this.instructYoW = res.instructYoW
509
- this.instructYoD = res.instructYoD
510
- this.instructYesAdd = res.instructYesAdd
511
- this.instructSumLoadState = 'success'
512
- }, err => {
513
- console.warn(err)
514
- this.instructSumLoadState = 'error'
515
- })
516
- },
517
- loadMetereadSumCount () {
518
- this.metereadSumDataByWeek = []
519
- this.metereadSumLoadState = 'loading'
520
- return post(WebmeterAnalysisViewApi.meteReadSumCount, {
521
- webmeterUrl: this.webmeterUrl,
522
- systemVersion: this.systemVersion,
523
- dataSource: this.dataSource
524
- }).then(res => {
525
- // 加载近一周抄表数图表
526
- post(WebmeterAnalysisViewApi.meteReadDataByWeek, {
527
- webmeterUrl: this.webmeterUrl,
528
- systemVersion: this.systemVersion,
529
- dataSource: this.dataSource
530
- }).then(res => {
531
- for (let i = 0, len = res.length; i < len; i++) {
532
- this.metereadSumDataByWeek.push({
533
- x: res[i].date,
534
- y: res[i].num
535
- })
536
- }
537
- })
538
- this.metereadSum = res.metereadSum
539
- this.metereadYesAdd = res.metereadYesAdd
540
- this.metereadSumLoadState = 'success'
541
- }, err => {
542
- console.warn(err)
543
- this.metereadSumLoadState = 'error'
544
- })
545
- },
546
- loadUsingMeterSumCount () {
547
- this.usingMeterSumDataByWeek = []
548
- this.usingMeterSumLoadState = 'loading'
549
- return post(WebmeterAnalysisViewApi.usingMeterSumCount, {
550
- webmeterUrl: this.webmeterUrl,
551
- systemVersion: this.systemVersion,
552
- dataSource: this.dataSource
553
- }).then(res => {
554
- // 加载近一周开户数图表
555
- post(WebmeterAnalysisViewApi.usingMeterDataByWeek, {
556
- webmeterUrl: this.webmeterUrl,
557
- systemVersion: this.systemVersion,
558
- dataSource: this.dataSource
559
- }).then(res => {
560
- for (let i = 0, len = res.length; i < len; i++) {
561
- this.usingMeterSumDataByWeek.push({
562
- x: res[i].date,
563
- y: res[i].num
564
- })
565
- }
566
- })
567
- this.usingMeterSum = res.usingMeterSum
568
- this.usingMeterYesAdd = res.usingMeterYesAdd
569
- this.usingMeterSumLoadState = 'success'
570
- }, err => {
571
- console.warn(err)
572
- this.usingMeterSumLoadState = 'error'
573
- })
574
- },
575
- loadInstructRateOfSuccess () {
576
- this.instructRateOfSuccessLoadState = 'loading'
577
- return post(WebmeterAnalysisViewApi.instructRateOfSuccess, {
578
- webmeterUrl: this.webmeterUrl,
579
- systemVersion: this.systemVersion,
580
- dataSource: this.dataSource
581
- }).then(res => {
582
- this.instructRateOfSuccessValue = res.instructRateOfSuccessValue * 1.0
583
- if (this.instructRateOfSuccessValue < 70.0) {
584
- this.instructRateOfColor = 'rgb(242, 99, 123)'
585
- } else if (this.instructRateOfSuccessValue < 90.0) {
586
- this.instructRateOfColor = 'rgb(251, 212, 55)'
587
- } else {
588
- this.instructRateOfColor = 'rgb(19, 194, 194)'
589
- }
590
- this.instructRateOfSuccessYoW = res.instructRateOfSuccessYoW
591
- this.instructRateOfSuccessYoD = res.instructRateOfSuccessYoD
592
- this.yesterdayInstructRateOf = res.yesterdayInstructRateOf
593
- this.instructRateOfSuccessLoadState = 'success'
594
- }, err => {
595
- console.warn(err)
596
- this.instructRateOfSuccessLoadState = 'error'
597
- })
598
- },
599
- format (date, format) {
600
- return formatDate(date, format)
601
- },
602
- loadGasView () {
603
- const _this = this
604
- _this.getHandPlanCountByMeterBrand()
605
- },
606
- getHandPlanCountByMeterBrand () {
607
- this.radarLoadState = 'loading'
608
- fetch('/webmeterapi/foreignaidHandMeterSumCountData', {
609
- method: 'POST',
610
- body: JSON.stringify({
611
- webmeterUrl: this.webmeterUrl,
612
- systemVersion: this.systemVersion,
613
- dataSource: this.dataSource
614
- })
615
- }).then((res) => res.json())
616
- .then((data) => {
617
- const linePlot = new Line('container', {
618
- data,
619
- xField: 'date',
620
- yField: 'value',
621
- seriesField: 'name',
622
- yAxis: {
623
- label: {
624
- // 数值格式化为千分位
625
- formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`)
626
- }
627
- },
628
- tooltip: {
629
- shared: true
630
- },
631
- interactions: [{ type: 'brush' }],
632
- slider: {
633
- start: 0.5,
634
- end: 1
635
- },
636
- legend: {
637
- position: 'top'
638
- },
639
- smooth: true
640
- })
641
- linePlot.render()
642
- this.radarLoadState = 'success'
643
- })
644
- .catch((ex) => {
645
- console.error(ex)
646
- this.radarLoadState = 'error'
647
- })
648
- }
649
- },
650
- watch: {
651
- 'visible' (val) {
652
- if (val) {
653
- // 加载指令数统计
654
- this.loadInstructSumCount()
655
- // 加载抄表量统计
656
- this.loadMetereadSumCount()
657
- // 加载在用表具量统计
658
- this.loadUsingMeterSumCount()
659
- // 加载指令成功率统计
660
- this.loadInstructRateOfSuccess()
661
- // 加载g2图表
662
- this.loadGasView()
663
- }
664
- }
665
- }
666
- }
667
- </script>
668
-
669
- <style lang="less" scoped>
670
-
671
- .text {
672
- color: rgba(0, 0, 0, .45);
673
- }
674
-
675
- .heading {
676
- color: rgba(0, 0, 0, .85);
677
- font-size: 20px;
678
- }
679
-
680
- .extra-wrapper {
681
- line-height: 55px;
682
- padding-right: 24px;
683
-
684
- .extra-item {
685
- display: inline-block;
686
- margin-right: 24px;
687
-
688
- a {
689
- margin-left: 24px;
690
- }
691
- }
692
- }
693
-
694
- .antd-pro-pages-dashboard-analysis-twoColLayout {
695
- position: relative;
696
- display: flex;
697
- display: block;
698
- flex-flow: row wrap;
699
- }
700
-
701
- .antd-pro-pages-dashboard-analysis-salesCard {
702
- height: calc(100% - 24px);
703
- /deep/ .ant-card-head {
704
- position: relative;
705
- }
706
- }
707
-
708
- .dashboard-analysis-iconGroup {
709
- i {
710
- margin-left: 16px;
711
- color: rgba(0,0,0,.45);
712
- cursor: pointer;
713
- transition: color .32s;
714
- color: black;
715
- }
716
- }
717
- .analysis-salesTypeRadio {
718
- position: absolute;
719
- right: 54px;
720
- bottom: 12px;
721
- }
722
- </style>
1
+ <template>
2
+ <a-drawer
3
+ title="物联网综合分析"
4
+ placement="right"
5
+ :width="isMobile ? screenWidth : screenWidth * 0.85"
6
+ :visible="visible"
7
+ @close="onClose"
8
+ >
9
+ <a-page-header :title="selectOrgName +' - 物联网运行维护'">
10
+ <div>
11
+ <a-row :gutter="24">
12
+ <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
13
+ <x-card :loadState="instructSumLoadState" :retry="loadInstructSumCount">
14
+ <chart-card title="总指令数" :total="instructSum | NumberFormat">
15
+ <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadInstructSumCount()">
16
+ <a-icon type="redo" />
17
+ </a-tooltip>
18
+ <a-tooltip title="生成的所有指令总数" slot="action">
19
+ <a-icon type="info-circle-o" />
20
+ </a-tooltip>
21
+ <div>
22
+ <trend :flag="instructYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
23
+ <span slot="term">同周比</span>
24
+ {{ instructYoW + '%' }}
25
+ </trend>
26
+ <trend :flag="instructYoD >= 0 ? 'up' : 'down'">
27
+ <span slot="term">日同比</span>
28
+ {{ instructYoD + '%' }}
29
+ </trend>
30
+ </div>
31
+ <template slot="footer">昨日新增 <span>{{ instructYesAdd | NumberFormat }}</span></template>
32
+ </chart-card>
33
+ </x-card>
34
+ </a-col>
35
+ <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
36
+ <x-card :loadState="metereadSumLoadState" :retry="loadMetereadSumCount">
37
+ <chart-card title="总抄表量" :total="metereadSum | NumberFormat">
38
+ <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadMetereadSumCount()">
39
+ <a-icon type="redo" />
40
+ </a-tooltip>
41
+ <a-tooltip title="生成的所有抄表(meteread)总数" slot="action">
42
+ <a-icon type="info-circle-o" />
43
+ </a-tooltip>
44
+ <div>
45
+ <mini-area :dataSource="metereadSumDataByWeek" :scale="metereadSumByWeekScale" />
46
+ </div>
47
+ <template slot="footer">昨日新增 <span> {{ metereadYesAdd | NumberFormat }}</span></template>
48
+ </chart-card>
49
+ </x-card>
50
+ </a-col>
51
+ <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
52
+ <x-card :loadState="usingMeterSumLoadState" :retry="loadUsingMeterSumCount">
53
+ <chart-card title="在用表具数" :total="usingMeterSum | NumberFormat">
54
+ <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadUsingMeterSumCount()">
55
+ <a-icon type="redo" />
56
+ </a-tooltip>
57
+ <a-tooltip title="开户成功的物联网表总数" slot="action">
58
+ <a-icon type="info-circle-o" />
59
+ </a-tooltip>
60
+ <div>
61
+ <mini-bar :dataSource="usingMeterSumDataByWeek" :scale="usingMeterSumByWeekScale" />
62
+ </div>
63
+ <template slot="footer">昨日新增 <span>{{ usingMeterYesAdd | NumberFormat }}</span></template>
64
+ </chart-card>
65
+ </x-card>
66
+ </a-col>
67
+ <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
68
+ <x-card :loadState="instructRateOfSuccessLoadState" :retry="loadInstructRateOfSuccess">
69
+ <chart-card title="指令下发成功率" :total="instructRateOfSuccessValue + '%'">
70
+ <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadInstructRateOfSuccess()">
71
+ <a-icon type="redo" />
72
+ </a-tooltip>
73
+ <a-tooltip title="执行成功和已发送状态的指令占所有指令的比例" slot="action">
74
+ <a-icon type="info-circle-o" />
75
+ </a-tooltip>
76
+ <div>
77
+ <mini-progress :color="instructRateOfColor" :target="90" :percentage="instructRateOfSuccessValue" height="8px" />
78
+ </div>
79
+ <template slot="footer">
80
+ <trend :flag="instructRateOfSuccessYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
81
+ <span slot="term">同周比</span>
82
+ {{ instructRateOfSuccessYoW + '%' }}
83
+ </trend>
84
+ <trend :flag="instructRateOfSuccessYoD >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
85
+ <span slot="term">日同比</span>
86
+ {{ instructRateOfSuccessYoD + '%' }}
87
+ </trend>
88
+ <span slot="term">昨日成功率</span>
89
+ {{ yesterdayInstructRateOf + '%' }}
90
+ </template>
91
+ </chart-card>
92
+ </x-card>
93
+ </a-col>
94
+ </a-row>
95
+
96
+ <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}">
97
+ <div class="salesCard">
98
+ <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
99
+ <div class="extra-wrapper" slot="tabBarExtraContent">
100
+ <div class="extra-item">
101
+ <a>今日</a>
102
+ <a>本周</a>
103
+ <a>本月</a>
104
+ <a>本年</a>
105
+ </div>
106
+ <a-range-picker :style="{width: '256px'}" />
107
+ </div>
108
+ <a-tab-pane tab="抄表情况分析" key="1">
109
+ <a-row :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
110
+ <x-card :loadState="radarLoadState" :retry="loadGasView">
111
+ <div style="padding: 0 0 0 20px;height: 370px" id="container" />
112
+ </x-card>
113
+ </a-row>
114
+ </a-tab-pane>
115
+ <a-tab-pane tab="访问量" key="2">
116
+ <a-row>
117
+ <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
118
+ <bar :data="barData2" title="销售额趋势" />
119
+ </a-col>
120
+ <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
121
+ <rank-list title="门店销售排行榜" :list="rankList"/>
122
+ </a-col>
123
+ </a-row>
124
+ </a-tab-pane>
125
+ </a-tabs>
126
+ </div>
127
+ </a-card>
128
+
129
+ <div class="antd-pro-pages-dashboard-analysis-twoColLayout" :class="!isMobile && 'desktop'">
130
+ <a-row :gutter="24" type="flex" :style="{ marginTop: '24px' }">
131
+ <a-col :xl="12" :lg="24" :md="24" :sm="24" :xs="24">
132
+ <a-card :loading="loading" :bordered="false" title="用气情况排行" :style="{ height: '100%' }">
133
+ <a-dropdown :trigger="['click']" placement="bottomLeft" slot="extra">
134
+ <a class="ant-dropdown-link" href="#">
135
+ <a-icon type="ellipsis" />
136
+ </a>
137
+ <a-menu slot="overlay">
138
+ <a-menu-item>
139
+ <a href="javascript:">操作一</a>
140
+ </a-menu-item>
141
+ <a-menu-item>
142
+ <a href="javascript;">操作二</a>
143
+ </a-menu-item>
144
+ </a-menu>
145
+ </a-dropdown>
146
+ <a-row :gutter="68">
147
+ <a-col :xs="24" :sm="12" :style="{ marginBottom: ' 24px'}">
148
+ <number-info :total="21232.1" :sub-total="17.1">
149
+ <span slot="subtitle">
150
+ <span>当天总用气量</span>
151
+ <a-tooltip title="指标说明" slot="action">
152
+ <a-icon type="info-circle-o" :style="{ marginLeft: '8px' }" />
153
+ </a-tooltip>
154
+ </span>
155
+ </number-info>
156
+ <!-- miniChart -->
157
+ <div>
158
+ <mini-smooth-area :style="{ height: '45px' }" :dataSource="searchUserData" :scale="searchUserScale" />
159
+ </div>
160
+ </a-col>
161
+ <a-col :xs="24" :sm="12" :style="{ marginBottom: ' 24px'}">
162
+ <number-info :total="0.7" :sub-total="0.2" status="up">
163
+ <span slot="subtitle">
164
+ <span>人均用气量</span>
165
+ <a-tooltip title="指标说明" slot="action">
166
+ <a-icon type="info-circle-o" :style="{ marginLeft: '8px' }" />
167
+ </a-tooltip>
168
+ </span>
169
+ </number-info>
170
+ <!-- miniChart -->
171
+ <div>
172
+ <mini-smooth-area :style="{ height: '45px' }" :dataSource="searchUserData" :scale="searchUserScale" />
173
+ </div>
174
+ </a-col>
175
+ </a-row>
176
+ <div class="ant-table-wrapper">
177
+ <a-table
178
+ row-key="index"
179
+ size="small"
180
+ :columns="searchTableColumns"
181
+ :dataSource="searchData"
182
+ :pagination="{ pageSize: 5 }"
183
+ >
184
+ <span slot="range" slot-scope="text, record">
185
+ <trend :flag="record.status === 0 ? 'up' : 'down'">
186
+ {{ text }}%
187
+ </trend>
188
+ </span>
189
+ </a-table>
190
+ </div>
191
+ </a-card>
192
+ </a-col>
193
+ <a-col :xl="12" :lg="24" :md="24" :sm="24" :xs="24">
194
+ <a-card class="antd-pro-pages-dashboard-analysis-salesCard" :loading="loading" :bordered="false" title="指令类别占比" :style="{ height: '100%' }">
195
+ <div slot="extra" style="height: inherit;">
196
+ <div class="analysis-salesTypeRadio">
197
+ <a-radio-group defaultValue="a">
198
+ <a-radio-button value="a">本日</a-radio-button>
199
+ <a-radio-button value="b">本周</a-radio-button>
200
+ <a-radio-button value="c">本月</a-radio-button>
201
+ </a-radio-group>
202
+ </div>
203
+ </div>
204
+ <h4></h4>
205
+ <div>
206
+ <!-- style="width: calc(100% - 240px);" -->
207
+ <div>
208
+ <v-chart :force-fit="true" :height="405" :data="pieData" :scale="pieScale">
209
+ <v-tooltip :showTitle="false" dataKey="item*percent" />
210
+ <v-axis />
211
+ <!-- position="right" :offsetX="-140" -->
212
+ <v-legend dataKey="item"/>
213
+ <v-pie position="percent" color="item" :vStyle="pieStyle" />
214
+ <v-coord type="theta" :radius="0.75" :innerRadius="0.6" />
215
+ </v-chart>
216
+ </div>
217
+ </div>
218
+ </a-card>
219
+ </a-col>
220
+ </a-row>
221
+ </div>
222
+ </div>
223
+ </a-page-header>
224
+ </a-drawer>
225
+ </template>
226
+
227
+ <script>
228
+ import moment from 'moment'
229
+ import {
230
+ ChartCard,
231
+ MiniArea,
232
+ MiniBar,
233
+ MiniProgress,
234
+ RankList,
235
+ Bar,
236
+ Trend,
237
+ NumberInfo,
238
+ MiniSmoothArea
239
+ } from '@vue2-client/components'
240
+ import { formatDate } from '@vue2-client/utils/util'
241
+ import { Line } from '@antv/g2plot'
242
+ import { mapState } from 'vuex'
243
+ import { WebmeterAnalysisViewApi, post } from '@vue2-client/services/api'
244
+
245
+ const barData = []
246
+ const barData2 = []
247
+ for (let i = 0; i < 12; i += 1) {
248
+ barData.push({
249
+ x: `${i + 1}月`,
250
+ y: Math.floor(Math.random() * 1000) + 200
251
+ })
252
+ barData2.push({
253
+ x: `${i + 1}月`,
254
+ y: Math.floor(Math.random() * 1000) + 200
255
+ })
256
+ }
257
+
258
+ const rankList = []
259
+ for (let i = 0; i < 7; i++) {
260
+ rankList.push({
261
+ name: '白鹭岛 ' + (i + 1) + ' 号店',
262
+ total: 1234.56 - i * 100
263
+ })
264
+ }
265
+
266
+ const searchUserData = []
267
+ for (let i = 0; i < 7; i++) {
268
+ searchUserData.push({
269
+ x: moment().add(i, 'days').format('YYYY-MM-DD'),
270
+ y: Math.ceil(Math.random() * 10)
271
+ })
272
+ }
273
+ const searchUserScale = [
274
+ {
275
+ dataKey: 'x',
276
+ alias: '时间'
277
+ },
278
+ {
279
+ dataKey: 'y',
280
+ alias: '用气量',
281
+ min: 0,
282
+ max: 10
283
+ }]
284
+
285
+ const searchTableColumns = [
286
+ {
287
+ dataIndex: 'index',
288
+ title: '用户编号',
289
+ width: 90
290
+ },
291
+ {
292
+ dataIndex: 'keyword',
293
+ title: '用户姓名'
294
+ },
295
+ {
296
+ dataIndex: 'count',
297
+ title: '用气量'
298
+ },
299
+ {
300
+ dataIndex: 'range',
301
+ title: '周涨幅',
302
+ align: 'right',
303
+ sorter: (a, b) => a.range - b.range,
304
+ scopedSlots: { customRender: 'range' }
305
+ }
306
+ ]
307
+
308
+ const userInfoArray = [
309
+ '德昌鸿公司2',
310
+ '瑞鑫宇公司',
311
+ '保康县熊绎中学',
312
+ '文康置业有限公司',
313
+ '湖北省旗星文化旅游实业有限公司'
314
+ ]
315
+
316
+ const searchData = []
317
+ let j = 0
318
+ for (let i = 0; i < 5; i += 1) {
319
+ searchData.push({
320
+ index: Math.floor(Math.random() * 10000000),
321
+ keyword: userInfoArray[j],
322
+ count: Math.floor(Math.random() * 1000),
323
+ range: Math.floor(Math.random() * 10),
324
+ status: Math.floor((Math.random() * 10) % 2)
325
+ })
326
+ j++
327
+ }
328
+
329
+ const DataSet = require('@antv/data-set')
330
+
331
+ const sourceData = [
332
+ { item: '远程开户', count: 32.2 },
333
+ { item: '远程充值', count: 21 },
334
+ { item: '阀门控制', count: 17 },
335
+ { item: '远程调价', count: 13 },
336
+ { item: '设置参数', count: 9 },
337
+ { item: '远程注销', count: 7.8 }
338
+ ]
339
+
340
+ const pieScale = [{
341
+ dataKey: 'percent',
342
+ min: 0,
343
+ formatter: '.0%'
344
+ }]
345
+
346
+ const dv = new DataSet.View().source(sourceData)
347
+ dv.transform({
348
+ type: 'percent',
349
+ field: 'count',
350
+ dimension: 'item',
351
+ as: 'percent'
352
+ })
353
+ const pieData = dv.rows
354
+
355
+ export default {
356
+ name: 'WebmeterAnalysisView',
357
+ components: {
358
+ ChartCard,
359
+ MiniArea,
360
+ MiniBar,
361
+ MiniProgress,
362
+ RankList,
363
+ Bar,
364
+ Trend,
365
+ NumberInfo,
366
+ MiniSmoothArea
367
+ },
368
+ data () {
369
+ return {
370
+ // 页面宽度
371
+ screenWidth: document.documentElement.clientWidth,
372
+ // 客户名称
373
+ customerName: '',
374
+ // 指令数统计Loading
375
+ instructSumLoadState: 'loading',
376
+ // 总指令数
377
+ instructSum: 0,
378
+ // 同周比
379
+ instructYoW: 0,
380
+ // 日同比
381
+ instructYoD: 0,
382
+ // 昨日新增指令数
383
+ instructYesAdd: 0,
384
+ // 抄表量统计Loading
385
+ metereadSumLoadState: 'loading',
386
+ // 总抄表量
387
+ metereadSum: 0,
388
+ // 昨日新增抄表量
389
+ metereadYesAdd: 0,
390
+ // 近一周抄表量明细
391
+ metereadSumDataByWeek: [],
392
+ // 近一周抄表量明细列
393
+ metereadSumByWeekScale: [
394
+ {
395
+ dataKey: 'x',
396
+ alias: '时间'
397
+ },
398
+ {
399
+ dataKey: 'y',
400
+ alias: '抄表量'
401
+ }
402
+ ],
403
+ // 抄表情况分析Loading
404
+ radarLoadState: 'loading',
405
+ // 在用表具统计Loading
406
+ usingMeterSumLoadState: 'loading',
407
+ // 在用表具总量
408
+ usingMeterSum: 0,
409
+ // 昨日新增在用表具量
410
+ usingMeterYesAdd: 0,
411
+ // 近一周新增在用表具明细
412
+ usingMeterSumDataByWeek: [],
413
+ // 近一周新增在用表具明细列
414
+ usingMeterSumByWeekScale: [
415
+ {
416
+ dataKey: 'x',
417
+ alias: '时间'
418
+ },
419
+ {
420
+ dataKey: 'y',
421
+ alias: '开户数'
422
+ }
423
+ ],
424
+ // 指令成功率统计Loading
425
+ instructRateOfSuccessLoadState: 'loading',
426
+ // 指令成功率
427
+ instructRateOfSuccessValue: 0,
428
+ // 昨日指令成功率
429
+ yesterdayInstructRateOf: 0,
430
+ // 同周比
431
+ instructRateOfSuccessYoW: 0,
432
+ // 日同比
433
+ instructRateOfSuccessYoD: 0,
434
+ // 指令成功率进度色
435
+ instructRateOfColor: 'rgb(19, 194, 194)',
436
+ // 是否刷新加载中
437
+ loading: false,
438
+ rankList,
439
+
440
+ // 搜索用户数
441
+ searchUserData,
442
+ searchUserScale,
443
+ searchTableColumns,
444
+ searchData,
445
+
446
+ barData,
447
+ barData2,
448
+
449
+ //
450
+ pieScale,
451
+ pieData,
452
+ sourceData,
453
+ pieStyle: {
454
+ stroke: '#fff',
455
+ lineWidth: 1
456
+ }
457
+ }
458
+ },
459
+ mounted () {
460
+ // 加载指令数统计
461
+ this.loadInstructSumCount()
462
+ // 加载抄表量统计
463
+ this.loadMetereadSumCount()
464
+ // 加载在用表具量统计
465
+ this.loadUsingMeterSumCount()
466
+ // 加载指令成功率统计
467
+ this.loadInstructRateOfSuccess()
468
+ // 加载g2图表
469
+ this.loadGasView()
470
+ },
471
+ computed: {
472
+ ...mapState('setting', ['isMobile'])
473
+ },
474
+ props: {
475
+ selectOrgName: {
476
+ type: String,
477
+ required: true
478
+ },
479
+ webmeterUrl: {
480
+ type: String,
481
+ required: true
482
+ },
483
+ systemVersion: {
484
+ type: String,
485
+ required: true
486
+ },
487
+ dataSource: {
488
+ type: String,
489
+ required: true
490
+ },
491
+ visible: {
492
+ type: Boolean,
493
+ default: false
494
+ }
495
+ },
496
+ methods: {
497
+ onClose () {
498
+ this.$emit('update:visible', false)
499
+ },
500
+ loadInstructSumCount () {
501
+ this.instructSumLoadState = 'loading'
502
+ return post(WebmeterAnalysisViewApi.instructSumCount, {
503
+ webmeterUrl: this.webmeterUrl,
504
+ systemVersion: this.systemVersion,
505
+ dataSource: this.dataSource
506
+ }).then(res => {
507
+ this.instructSum = res.instructSum
508
+ this.instructYoW = res.instructYoW
509
+ this.instructYoD = res.instructYoD
510
+ this.instructYesAdd = res.instructYesAdd
511
+ this.instructSumLoadState = 'success'
512
+ }, err => {
513
+ console.warn(err)
514
+ this.instructSumLoadState = 'error'
515
+ })
516
+ },
517
+ loadMetereadSumCount () {
518
+ this.metereadSumDataByWeek = []
519
+ this.metereadSumLoadState = 'loading'
520
+ return post(WebmeterAnalysisViewApi.meteReadSumCount, {
521
+ webmeterUrl: this.webmeterUrl,
522
+ systemVersion: this.systemVersion,
523
+ dataSource: this.dataSource
524
+ }).then(res => {
525
+ // 加载近一周抄表数图表
526
+ post(WebmeterAnalysisViewApi.meteReadDataByWeek, {
527
+ webmeterUrl: this.webmeterUrl,
528
+ systemVersion: this.systemVersion,
529
+ dataSource: this.dataSource
530
+ }).then(res => {
531
+ for (let i = 0, len = res.length; i < len; i++) {
532
+ this.metereadSumDataByWeek.push({
533
+ x: res[i].date,
534
+ y: res[i].num
535
+ })
536
+ }
537
+ })
538
+ this.metereadSum = res.metereadSum
539
+ this.metereadYesAdd = res.metereadYesAdd
540
+ this.metereadSumLoadState = 'success'
541
+ }, err => {
542
+ console.warn(err)
543
+ this.metereadSumLoadState = 'error'
544
+ })
545
+ },
546
+ loadUsingMeterSumCount () {
547
+ this.usingMeterSumDataByWeek = []
548
+ this.usingMeterSumLoadState = 'loading'
549
+ return post(WebmeterAnalysisViewApi.usingMeterSumCount, {
550
+ webmeterUrl: this.webmeterUrl,
551
+ systemVersion: this.systemVersion,
552
+ dataSource: this.dataSource
553
+ }).then(res => {
554
+ // 加载近一周开户数图表
555
+ post(WebmeterAnalysisViewApi.usingMeterDataByWeek, {
556
+ webmeterUrl: this.webmeterUrl,
557
+ systemVersion: this.systemVersion,
558
+ dataSource: this.dataSource
559
+ }).then(res => {
560
+ for (let i = 0, len = res.length; i < len; i++) {
561
+ this.usingMeterSumDataByWeek.push({
562
+ x: res[i].date,
563
+ y: res[i].num
564
+ })
565
+ }
566
+ })
567
+ this.usingMeterSum = res.usingMeterSum
568
+ this.usingMeterYesAdd = res.usingMeterYesAdd
569
+ this.usingMeterSumLoadState = 'success'
570
+ }, err => {
571
+ console.warn(err)
572
+ this.usingMeterSumLoadState = 'error'
573
+ })
574
+ },
575
+ loadInstructRateOfSuccess () {
576
+ this.instructRateOfSuccessLoadState = 'loading'
577
+ return post(WebmeterAnalysisViewApi.instructRateOfSuccess, {
578
+ webmeterUrl: this.webmeterUrl,
579
+ systemVersion: this.systemVersion,
580
+ dataSource: this.dataSource
581
+ }).then(res => {
582
+ this.instructRateOfSuccessValue = res.instructRateOfSuccessValue * 1.0
583
+ if (this.instructRateOfSuccessValue < 70.0) {
584
+ this.instructRateOfColor = 'rgb(242, 99, 123)'
585
+ } else if (this.instructRateOfSuccessValue < 90.0) {
586
+ this.instructRateOfColor = 'rgb(251, 212, 55)'
587
+ } else {
588
+ this.instructRateOfColor = 'rgb(19, 194, 194)'
589
+ }
590
+ this.instructRateOfSuccessYoW = res.instructRateOfSuccessYoW
591
+ this.instructRateOfSuccessYoD = res.instructRateOfSuccessYoD
592
+ this.yesterdayInstructRateOf = res.yesterdayInstructRateOf
593
+ this.instructRateOfSuccessLoadState = 'success'
594
+ }, err => {
595
+ console.warn(err)
596
+ this.instructRateOfSuccessLoadState = 'error'
597
+ })
598
+ },
599
+ format (date, format) {
600
+ return formatDate(date, format)
601
+ },
602
+ loadGasView () {
603
+ const _this = this
604
+ _this.getHandPlanCountByMeterBrand()
605
+ },
606
+ getHandPlanCountByMeterBrand () {
607
+ this.radarLoadState = 'loading'
608
+ fetch('/webmeterapi/foreignaidHandMeterSumCountData', {
609
+ method: 'POST',
610
+ body: JSON.stringify({
611
+ webmeterUrl: this.webmeterUrl,
612
+ systemVersion: this.systemVersion,
613
+ dataSource: this.dataSource
614
+ })
615
+ }).then((res) => res.json())
616
+ .then((data) => {
617
+ const linePlot = new Line('container', {
618
+ data,
619
+ xField: 'date',
620
+ yField: 'value',
621
+ seriesField: 'name',
622
+ yAxis: {
623
+ label: {
624
+ // 数值格式化为千分位
625
+ formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`)
626
+ }
627
+ },
628
+ tooltip: {
629
+ shared: true
630
+ },
631
+ interactions: [{ type: 'brush' }],
632
+ slider: {
633
+ start: 0.5,
634
+ end: 1
635
+ },
636
+ legend: {
637
+ position: 'top'
638
+ },
639
+ smooth: true
640
+ })
641
+ linePlot.render()
642
+ this.radarLoadState = 'success'
643
+ })
644
+ .catch((ex) => {
645
+ console.error(ex)
646
+ this.radarLoadState = 'error'
647
+ })
648
+ }
649
+ },
650
+ watch: {
651
+ 'visible' (val) {
652
+ if (val) {
653
+ // 加载指令数统计
654
+ this.loadInstructSumCount()
655
+ // 加载抄表量统计
656
+ this.loadMetereadSumCount()
657
+ // 加载在用表具量统计
658
+ this.loadUsingMeterSumCount()
659
+ // 加载指令成功率统计
660
+ this.loadInstructRateOfSuccess()
661
+ // 加载g2图表
662
+ this.loadGasView()
663
+ }
664
+ }
665
+ }
666
+ }
667
+ </script>
668
+
669
+ <style lang="less" scoped>
670
+
671
+ .text {
672
+ color: rgba(0, 0, 0, .45);
673
+ }
674
+
675
+ .heading {
676
+ color: rgba(0, 0, 0, .85);
677
+ font-size: 20px;
678
+ }
679
+
680
+ .extra-wrapper {
681
+ line-height: 55px;
682
+ padding-right: 24px;
683
+
684
+ .extra-item {
685
+ display: inline-block;
686
+ margin-right: 24px;
687
+
688
+ a {
689
+ margin-left: 24px;
690
+ }
691
+ }
692
+ }
693
+
694
+ .antd-pro-pages-dashboard-analysis-twoColLayout {
695
+ position: relative;
696
+ display: flex;
697
+ display: block;
698
+ flex-flow: row wrap;
699
+ }
700
+
701
+ .antd-pro-pages-dashboard-analysis-salesCard {
702
+ height: calc(100% - 24px);
703
+ /deep/ .ant-card-head {
704
+ position: relative;
705
+ }
706
+ }
707
+
708
+ .dashboard-analysis-iconGroup {
709
+ i {
710
+ margin-left: 16px;
711
+ color: rgba(0,0,0,.45);
712
+ cursor: pointer;
713
+ transition: color .32s;
714
+ color: black;
715
+ }
716
+ }
717
+ .analysis-salesTypeRadio {
718
+ position: absolute;
719
+ right: 54px;
720
+ bottom: 12px;
721
+ }
722
+ </style>