vue2-client 1.2.0 → 1.2.3

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 (134) hide show
  1. package/README.md +65 -65
  2. package/babel.config.js +1 -0
  3. package/docs/notice.md +22 -0
  4. package/index.js +28 -28
  5. package/package.json +1 -1
  6. package/src/App.vue +93 -93
  7. package/src/assets/img/SunClientDownload.png +0 -0
  8. package/src/assets/img/SunClientManual/1.png +0 -0
  9. package/src/assets/img/SunClientManual/2.png +0 -0
  10. package/src/assets/img/SunClientManual/3.png +0 -0
  11. package/src/assets/img/SunClientManual/4.png +0 -0
  12. package/src/assets/img/ToDeskDownload.png +0 -0
  13. package/src/assets/img/ToDeskManual/1.png +0 -0
  14. package/src/assets/img/ToDeskManual/2.png +0 -0
  15. package/src/assets/img/ToDeskManual/3.png +0 -0
  16. package/src/assets/img/ToDeskManual/4.png +0 -0
  17. package/src/assets/sound/newNote.mp3 +0 -0
  18. package/src/base-client/all.js +57 -57
  19. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1157 -1159
  20. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  21. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
  22. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  23. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  24. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
  25. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  26. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  27. package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
  28. package/src/base-client/components/common/XAddForm/index.md +60 -60
  29. package/src/base-client/components/common/XBadge/index.md +39 -39
  30. package/src/base-client/components/common/XCard/index.md +43 -43
  31. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  32. package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
  33. package/src/base-client/components/common/XForm/index.md +196 -196
  34. package/src/base-client/components/common/XFormCol/index.md +35 -35
  35. package/src/base-client/components/common/XFormTable/XFormTable.vue +407 -405
  36. package/src/base-client/components/common/XFormTable/index.md +89 -89
  37. package/src/base-client/components/common/XTable/XTable.vue +262 -262
  38. package/src/base-client/components/common/XTable/index.md +255 -255
  39. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
  40. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
  41. package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -41
  42. package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -127
  43. package/src/base-client/components/iot/DataAnalysisView/DataAnalysisView.vue +244 -250
  44. package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
  45. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
  46. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
  47. package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
  48. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  49. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  50. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -122
  51. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
  52. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -225
  53. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -135
  54. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
  55. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
  56. package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
  57. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
  58. package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
  59. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
  60. package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
  61. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  62. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
  63. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
  64. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
  65. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
  66. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
  67. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
  68. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
  69. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  70. package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
  71. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
  72. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +371 -406
  73. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +838 -486
  74. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +261 -184
  75. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +528 -303
  76. package/src/base-client/plugins/AppData.js +69 -69
  77. package/src/base-client/plugins/GetLoginInfoService.js +221 -221
  78. package/src/base-client/plugins/index.js +21 -21
  79. package/src/bootstrap.js +27 -27
  80. package/src/components/Ellipsis/Ellipsis.vue +64 -64
  81. package/src/components/Ellipsis/index.md +38 -38
  82. package/src/components/NumberInfo/index.md +43 -43
  83. package/src/components/STable/README.md +341 -341
  84. package/src/components/Trend/index.md +45 -45
  85. package/src/components/cache/AKeepAlive.js +172 -172
  86. package/src/components/checkbox/index.js +7 -7
  87. package/src/components/index.js +36 -36
  88. package/src/components/menu/menu.js +273 -273
  89. package/src/components/setting/Setting.vue +237 -237
  90. package/src/components/table/advance/AdvanceTable.vue +275 -275
  91. package/src/components/transition/PageToggleTransition.vue +97 -97
  92. package/src/layouts/CommonLayout.vue +42 -42
  93. package/src/layouts/PageLayout.vue +151 -151
  94. package/src/layouts/SinglePageView.vue +74 -74
  95. package/src/layouts/header/AdminHeader.vue +109 -109
  96. package/src/layouts/header/HeaderAvatar.vue +60 -60
  97. package/src/layouts/header/HeaderNotice.vue +97 -97
  98. package/src/layouts/tabs/TabsHead.vue +190 -190
  99. package/src/layouts/tabs/TabsView.vue +355 -355
  100. package/src/main.js +20 -20
  101. package/src/mock/goods/index.js +108 -108
  102. package/src/mock/index.js +12 -12
  103. package/src/mock/project/index.js +17 -17
  104. package/src/mock/user/current.js +13 -13
  105. package/src/mock/user/login.js +39 -39
  106. package/src/mock/workplace/index.js +15 -15
  107. package/src/pages/exception/403.vue +25 -25
  108. package/src/pages/exception/404.vue +25 -25
  109. package/src/pages/exception/500.vue +25 -25
  110. package/src/pages/login/Login.vue +194 -194
  111. package/src/pages/report/ReportTableHome.vue +28 -28
  112. package/src/pages/resourceManage/resourceManageMain.vue +55 -55
  113. package/src/pages/system/applyInstallView/Core.vue +570 -570
  114. package/src/pages/system/applyInstallView/index.vue +34 -34
  115. package/src/pages/system/dictionary/index.vue +41 -41
  116. package/src/pages/system/queryParams/index.vue +41 -41
  117. package/src/router/async/config.async.js +25 -25
  118. package/src/router/async/router.map.js +59 -59
  119. package/src/router/guards.js +104 -104
  120. package/src/router/index.js +27 -27
  121. package/src/services/api/EmployeeDetailsViewApi.js +3 -1
  122. package/src/services/api/TicketDetailsViewApi.js +9 -1
  123. package/src/services/api/common.js +37 -39
  124. package/src/services/api/restTools.js +23 -23
  125. package/src/services/dataSource.js +12 -12
  126. package/src/services/user.js +34 -34
  127. package/src/store/modules/setting.js +114 -114
  128. package/src/utils/i18n.js +80 -80
  129. package/src/utils/indexedDB.js +146 -146
  130. package/src/utils/request.js +197 -197
  131. package/src/utils/routerUtil.js +15 -2
  132. package/tests/unit/ReportTable.spec.js +15 -15
  133. package/vue.config.js +153 -153
  134. package/webpack.config.js +12 -12
@@ -1,723 +1,723 @@
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 { post } from '@vue2-client/services/api/restTools'
244
- import { WebmeterAnalysisViewApi } from '@vue2-client/services/api/WebmeterAnalysisViewApi'
245
-
246
- const barData = []
247
- const barData2 = []
248
- for (let i = 0; i < 12; i += 1) {
249
- barData.push({
250
- x: `${i + 1}月`,
251
- y: Math.floor(Math.random() * 1000) + 200
252
- })
253
- barData2.push({
254
- x: `${i + 1}月`,
255
- y: Math.floor(Math.random() * 1000) + 200
256
- })
257
- }
258
-
259
- const rankList = []
260
- for (let i = 0; i < 7; i++) {
261
- rankList.push({
262
- name: '白鹭岛 ' + (i + 1) + ' 号店',
263
- total: 1234.56 - i * 100
264
- })
265
- }
266
-
267
- const searchUserData = []
268
- for (let i = 0; i < 7; i++) {
269
- searchUserData.push({
270
- x: moment().add(i, 'days').format('YYYY-MM-DD'),
271
- y: Math.ceil(Math.random() * 10)
272
- })
273
- }
274
- const searchUserScale = [
275
- {
276
- dataKey: 'x',
277
- alias: '时间'
278
- },
279
- {
280
- dataKey: 'y',
281
- alias: '用气量',
282
- min: 0,
283
- max: 10
284
- }]
285
-
286
- const searchTableColumns = [
287
- {
288
- dataIndex: 'index',
289
- title: '用户编号',
290
- width: 90
291
- },
292
- {
293
- dataIndex: 'keyword',
294
- title: '用户姓名'
295
- },
296
- {
297
- dataIndex: 'count',
298
- title: '用气量'
299
- },
300
- {
301
- dataIndex: 'range',
302
- title: '周涨幅',
303
- align: 'right',
304
- sorter: (a, b) => a.range - b.range,
305
- scopedSlots: { customRender: 'range' }
306
- }
307
- ]
308
-
309
- const userInfoArray = [
310
- '德昌鸿公司2',
311
- '瑞鑫宇公司',
312
- '保康县熊绎中学',
313
- '文康置业有限公司',
314
- '湖北省旗星文化旅游实业有限公司'
315
- ]
316
-
317
- const searchData = []
318
- let j = 0
319
- for (let i = 0; i < 5; i += 1) {
320
- searchData.push({
321
- index: Math.floor(Math.random() * 10000000),
322
- keyword: userInfoArray[j],
323
- count: Math.floor(Math.random() * 1000),
324
- range: Math.floor(Math.random() * 10),
325
- status: Math.floor((Math.random() * 10) % 2)
326
- })
327
- j++
328
- }
329
-
330
- const DataSet = require('@antv/data-set')
331
-
332
- const sourceData = [
333
- { item: '远程开户', count: 32.2 },
334
- { item: '远程充值', count: 21 },
335
- { item: '阀门控制', count: 17 },
336
- { item: '远程调价', count: 13 },
337
- { item: '设置参数', count: 9 },
338
- { item: '远程注销', count: 7.8 }
339
- ]
340
-
341
- const pieScale = [{
342
- dataKey: 'percent',
343
- min: 0,
344
- formatter: '.0%'
345
- }]
346
-
347
- const dv = new DataSet.View().source(sourceData)
348
- dv.transform({
349
- type: 'percent',
350
- field: 'count',
351
- dimension: 'item',
352
- as: 'percent'
353
- })
354
- const pieData = dv.rows
355
-
356
- export default {
357
- name: 'WebmeterAnalysisView',
358
- components: {
359
- ChartCard,
360
- MiniArea,
361
- MiniBar,
362
- MiniProgress,
363
- RankList,
364
- Bar,
365
- Trend,
366
- NumberInfo,
367
- MiniSmoothArea
368
- },
369
- data () {
370
- return {
371
- // 页面宽度
372
- screenWidth: document.documentElement.clientWidth,
373
- // 客户名称
374
- customerName: '',
375
- // 指令数统计Loading
376
- instructSumLoadState: 'loading',
377
- // 总指令数
378
- instructSum: 0,
379
- // 同周比
380
- instructYoW: 0,
381
- // 日同比
382
- instructYoD: 0,
383
- // 昨日新增指令数
384
- instructYesAdd: 0,
385
- // 抄表量统计Loading
386
- metereadSumLoadState: 'loading',
387
- // 总抄表量
388
- metereadSum: 0,
389
- // 昨日新增抄表量
390
- metereadYesAdd: 0,
391
- // 近一周抄表量明细
392
- metereadSumDataByWeek: [],
393
- // 近一周抄表量明细列
394
- metereadSumByWeekScale: [
395
- {
396
- dataKey: 'x',
397
- alias: '时间'
398
- },
399
- {
400
- dataKey: 'y',
401
- alias: '抄表量'
402
- }
403
- ],
404
- // 抄表情况分析Loading
405
- radarLoadState: 'loading',
406
- // 在用表具统计Loading
407
- usingMeterSumLoadState: 'loading',
408
- // 在用表具总量
409
- usingMeterSum: 0,
410
- // 昨日新增在用表具量
411
- usingMeterYesAdd: 0,
412
- // 近一周新增在用表具明细
413
- usingMeterSumDataByWeek: [],
414
- // 近一周新增在用表具明细列
415
- usingMeterSumByWeekScale: [
416
- {
417
- dataKey: 'x',
418
- alias: '时间'
419
- },
420
- {
421
- dataKey: 'y',
422
- alias: '开户数'
423
- }
424
- ],
425
- // 指令成功率统计Loading
426
- instructRateOfSuccessLoadState: 'loading',
427
- // 指令成功率
428
- instructRateOfSuccessValue: 0,
429
- // 昨日指令成功率
430
- yesterdayInstructRateOf: 0,
431
- // 同周比
432
- instructRateOfSuccessYoW: 0,
433
- // 日同比
434
- instructRateOfSuccessYoD: 0,
435
- // 指令成功率进度色
436
- instructRateOfColor: 'rgb(19, 194, 194)',
437
- // 是否刷新加载中
438
- loading: false,
439
- rankList,
440
-
441
- // 搜索用户数
442
- searchUserData,
443
- searchUserScale,
444
- searchTableColumns,
445
- searchData,
446
-
447
- barData,
448
- barData2,
449
-
450
- //
451
- pieScale,
452
- pieData,
453
- sourceData,
454
- pieStyle: {
455
- stroke: '#fff',
456
- lineWidth: 1
457
- }
458
- }
459
- },
460
- mounted () {
461
- // 加载指令数统计
462
- this.loadInstructSumCount()
463
- // 加载抄表量统计
464
- this.loadMetereadSumCount()
465
- // 加载在用表具量统计
466
- this.loadUsingMeterSumCount()
467
- // 加载指令成功率统计
468
- this.loadInstructRateOfSuccess()
469
- // 加载g2图表
470
- this.loadGasView()
471
- },
472
- computed: {
473
- ...mapState('setting', ['isMobile'])
474
- },
475
- props: {
476
- selectOrgName: {
477
- type: String,
478
- required: true
479
- },
480
- webmeterUrl: {
481
- type: String,
482
- required: true
483
- },
484
- systemVersion: {
485
- type: String,
486
- required: true
487
- },
488
- dataSource: {
489
- type: String,
490
- required: true
491
- },
492
- visible: {
493
- type: Boolean,
494
- default: false
495
- }
496
- },
497
- methods: {
498
- onClose () {
499
- this.$emit('update:visible', false)
500
- },
501
- loadInstructSumCount () {
502
- this.instructSumLoadState = 'loading'
503
- return post(WebmeterAnalysisViewApi.instructSumCount, {
504
- webmeterUrl: this.webmeterUrl,
505
- systemVersion: this.systemVersion,
506
- dataSource: this.dataSource
507
- }).then(res => {
508
- this.instructSum = res.instructSum
509
- this.instructYoW = res.instructYoW
510
- this.instructYoD = res.instructYoD
511
- this.instructYesAdd = res.instructYesAdd
512
- this.instructSumLoadState = 'success'
513
- }, err => {
514
- console.warn(err)
515
- this.instructSumLoadState = 'error'
516
- })
517
- },
518
- loadMetereadSumCount () {
519
- this.metereadSumDataByWeek = []
520
- this.metereadSumLoadState = 'loading'
521
- return post(WebmeterAnalysisViewApi.meteReadSumCount, {
522
- webmeterUrl: this.webmeterUrl,
523
- systemVersion: this.systemVersion,
524
- dataSource: this.dataSource
525
- }).then(res => {
526
- // 加载近一周抄表数图表
527
- post(WebmeterAnalysisViewApi.meteReadDataByWeek, {
528
- webmeterUrl: this.webmeterUrl,
529
- systemVersion: this.systemVersion,
530
- dataSource: this.dataSource
531
- }).then(res => {
532
- for (let i = 0, len = res.length; i < len; i++) {
533
- this.metereadSumDataByWeek.push({
534
- x: res[i].date,
535
- y: res[i].num
536
- })
537
- }
538
- })
539
- this.metereadSum = res.metereadSum
540
- this.metereadYesAdd = res.metereadYesAdd
541
- this.metereadSumLoadState = 'success'
542
- }, err => {
543
- console.warn(err)
544
- this.metereadSumLoadState = 'error'
545
- })
546
- },
547
- loadUsingMeterSumCount () {
548
- this.usingMeterSumDataByWeek = []
549
- this.usingMeterSumLoadState = 'loading'
550
- return post(WebmeterAnalysisViewApi.usingMeterSumCount, {
551
- webmeterUrl: this.webmeterUrl,
552
- systemVersion: this.systemVersion,
553
- dataSource: this.dataSource
554
- }).then(res => {
555
- // 加载近一周开户数图表
556
- post(WebmeterAnalysisViewApi.usingMeterDataByWeek, {
557
- webmeterUrl: this.webmeterUrl,
558
- systemVersion: this.systemVersion,
559
- dataSource: this.dataSource
560
- }).then(res => {
561
- for (let i = 0, len = res.length; i < len; i++) {
562
- this.usingMeterSumDataByWeek.push({
563
- x: res[i].date,
564
- y: res[i].num
565
- })
566
- }
567
- })
568
- this.usingMeterSum = res.usingMeterSum
569
- this.usingMeterYesAdd = res.usingMeterYesAdd
570
- this.usingMeterSumLoadState = 'success'
571
- }, err => {
572
- console.warn(err)
573
- this.usingMeterSumLoadState = 'error'
574
- })
575
- },
576
- loadInstructRateOfSuccess () {
577
- this.instructRateOfSuccessLoadState = 'loading'
578
- return post(WebmeterAnalysisViewApi.instructRateOfSuccess, {
579
- webmeterUrl: this.webmeterUrl,
580
- systemVersion: this.systemVersion,
581
- dataSource: this.dataSource
582
- }).then(res => {
583
- this.instructRateOfSuccessValue = res.instructRateOfSuccessValue * 1.0
584
- if (this.instructRateOfSuccessValue < 70.0) {
585
- this.instructRateOfColor = 'rgb(242, 99, 123)'
586
- } else if (this.instructRateOfSuccessValue < 90.0) {
587
- this.instructRateOfColor = 'rgb(251, 212, 55)'
588
- } else {
589
- this.instructRateOfColor = 'rgb(19, 194, 194)'
590
- }
591
- this.instructRateOfSuccessYoW = res.instructRateOfSuccessYoW
592
- this.instructRateOfSuccessYoD = res.instructRateOfSuccessYoD
593
- this.yesterdayInstructRateOf = res.yesterdayInstructRateOf
594
- this.instructRateOfSuccessLoadState = 'success'
595
- }, err => {
596
- console.warn(err)
597
- this.instructRateOfSuccessLoadState = 'error'
598
- })
599
- },
600
- format (date, format) {
601
- return formatDate(date, format)
602
- },
603
- loadGasView () {
604
- const _this = this
605
- _this.getHandPlanCountByMeterBrand()
606
- },
607
- getHandPlanCountByMeterBrand () {
608
- this.radarLoadState = 'loading'
609
- fetch('/webmeterapi/foreignaidHandMeterSumCountData', {
610
- method: 'POST',
611
- body: JSON.stringify({
612
- webmeterUrl: this.webmeterUrl,
613
- systemVersion: this.systemVersion,
614
- dataSource: this.dataSource
615
- })
616
- }).then((res) => res.json())
617
- .then((data) => {
618
- const linePlot = new Line('container', {
619
- data,
620
- xField: 'date',
621
- yField: 'value',
622
- seriesField: 'name',
623
- yAxis: {
624
- label: {
625
- // 数值格式化为千分位
626
- formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`)
627
- }
628
- },
629
- tooltip: {
630
- shared: true
631
- },
632
- interactions: [{ type: 'brush' }],
633
- slider: {
634
- start: 0.5,
635
- end: 1
636
- },
637
- legend: {
638
- position: 'top'
639
- },
640
- smooth: true
641
- })
642
- linePlot.render()
643
- this.radarLoadState = 'success'
644
- })
645
- .catch((ex) => {
646
- console.error(ex)
647
- this.radarLoadState = 'error'
648
- })
649
- }
650
- },
651
- watch: {
652
- 'visible' (val) {
653
- if (val) {
654
- // 加载指令数统计
655
- this.loadInstructSumCount()
656
- // 加载抄表量统计
657
- this.loadMetereadSumCount()
658
- // 加载在用表具量统计
659
- this.loadUsingMeterSumCount()
660
- // 加载指令成功率统计
661
- this.loadInstructRateOfSuccess()
662
- // 加载g2图表
663
- this.loadGasView()
664
- }
665
- }
666
- }
667
- }
668
- </script>
669
-
670
- <style lang="less" scoped>
671
-
672
- .text {
673
- color: rgba(0, 0, 0, .45);
674
- }
675
-
676
- .heading {
677
- color: rgba(0, 0, 0, .85);
678
- font-size: 20px;
679
- }
680
-
681
- .extra-wrapper {
682
- line-height: 55px;
683
- padding-right: 24px;
684
-
685
- .extra-item {
686
- display: inline-block;
687
- margin-right: 24px;
688
-
689
- a {
690
- margin-left: 24px;
691
- }
692
- }
693
- }
694
-
695
- .antd-pro-pages-dashboard-analysis-twoColLayout {
696
- position: relative;
697
- display: flex;
698
- display: block;
699
- flex-flow: row wrap;
700
- }
701
-
702
- .antd-pro-pages-dashboard-analysis-salesCard {
703
- height: calc(100% - 24px);
704
- /deep/ .ant-card-head {
705
- position: relative;
706
- }
707
- }
708
-
709
- .dashboard-analysis-iconGroup {
710
- i {
711
- margin-left: 16px;
712
- color: rgba(0,0,0,.45);
713
- cursor: pointer;
714
- transition: color .32s;
715
- color: black;
716
- }
717
- }
718
- .analysis-salesTypeRadio {
719
- position: absolute;
720
- right: 54px;
721
- bottom: 12px;
722
- }
723
- </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 { post } from '@vue2-client/services/api/restTools'
244
+ import { WebmeterAnalysisViewApi } from '@vue2-client/services/api/WebmeterAnalysisViewApi'
245
+
246
+ const barData = []
247
+ const barData2 = []
248
+ for (let i = 0; i < 12; i += 1) {
249
+ barData.push({
250
+ x: `${i + 1}月`,
251
+ y: Math.floor(Math.random() * 1000) + 200
252
+ })
253
+ barData2.push({
254
+ x: `${i + 1}月`,
255
+ y: Math.floor(Math.random() * 1000) + 200
256
+ })
257
+ }
258
+
259
+ const rankList = []
260
+ for (let i = 0; i < 7; i++) {
261
+ rankList.push({
262
+ name: '白鹭岛 ' + (i + 1) + ' 号店',
263
+ total: 1234.56 - i * 100
264
+ })
265
+ }
266
+
267
+ const searchUserData = []
268
+ for (let i = 0; i < 7; i++) {
269
+ searchUserData.push({
270
+ x: moment().add(i, 'days').format('YYYY-MM-DD'),
271
+ y: Math.ceil(Math.random() * 10)
272
+ })
273
+ }
274
+ const searchUserScale = [
275
+ {
276
+ dataKey: 'x',
277
+ alias: '时间'
278
+ },
279
+ {
280
+ dataKey: 'y',
281
+ alias: '用气量',
282
+ min: 0,
283
+ max: 10
284
+ }]
285
+
286
+ const searchTableColumns = [
287
+ {
288
+ dataIndex: 'index',
289
+ title: '用户编号',
290
+ width: 90
291
+ },
292
+ {
293
+ dataIndex: 'keyword',
294
+ title: '用户姓名'
295
+ },
296
+ {
297
+ dataIndex: 'count',
298
+ title: '用气量'
299
+ },
300
+ {
301
+ dataIndex: 'range',
302
+ title: '周涨幅',
303
+ align: 'right',
304
+ sorter: (a, b) => a.range - b.range,
305
+ scopedSlots: { customRender: 'range' }
306
+ }
307
+ ]
308
+
309
+ const userInfoArray = [
310
+ '德昌鸿公司2',
311
+ '瑞鑫宇公司',
312
+ '保康县熊绎中学',
313
+ '文康置业有限公司',
314
+ '湖北省旗星文化旅游实业有限公司'
315
+ ]
316
+
317
+ const searchData = []
318
+ let j = 0
319
+ for (let i = 0; i < 5; i += 1) {
320
+ searchData.push({
321
+ index: Math.floor(Math.random() * 10000000),
322
+ keyword: userInfoArray[j],
323
+ count: Math.floor(Math.random() * 1000),
324
+ range: Math.floor(Math.random() * 10),
325
+ status: Math.floor((Math.random() * 10) % 2)
326
+ })
327
+ j++
328
+ }
329
+
330
+ const DataSet = require('@antv/data-set')
331
+
332
+ const sourceData = [
333
+ { item: '远程开户', count: 32.2 },
334
+ { item: '远程充值', count: 21 },
335
+ { item: '阀门控制', count: 17 },
336
+ { item: '远程调价', count: 13 },
337
+ { item: '设置参数', count: 9 },
338
+ { item: '远程注销', count: 7.8 }
339
+ ]
340
+
341
+ const pieScale = [{
342
+ dataKey: 'percent',
343
+ min: 0,
344
+ formatter: '.0%'
345
+ }]
346
+
347
+ const dv = new DataSet.View().source(sourceData)
348
+ dv.transform({
349
+ type: 'percent',
350
+ field: 'count',
351
+ dimension: 'item',
352
+ as: 'percent'
353
+ })
354
+ const pieData = dv.rows
355
+
356
+ export default {
357
+ name: 'WebmeterAnalysisView',
358
+ components: {
359
+ ChartCard,
360
+ MiniArea,
361
+ MiniBar,
362
+ MiniProgress,
363
+ RankList,
364
+ Bar,
365
+ Trend,
366
+ NumberInfo,
367
+ MiniSmoothArea
368
+ },
369
+ data () {
370
+ return {
371
+ // 页面宽度
372
+ screenWidth: document.documentElement.clientWidth,
373
+ // 客户名称
374
+ customerName: '',
375
+ // 指令数统计Loading
376
+ instructSumLoadState: 'loading',
377
+ // 总指令数
378
+ instructSum: 0,
379
+ // 同周比
380
+ instructYoW: 0,
381
+ // 日同比
382
+ instructYoD: 0,
383
+ // 昨日新增指令数
384
+ instructYesAdd: 0,
385
+ // 抄表量统计Loading
386
+ metereadSumLoadState: 'loading',
387
+ // 总抄表量
388
+ metereadSum: 0,
389
+ // 昨日新增抄表量
390
+ metereadYesAdd: 0,
391
+ // 近一周抄表量明细
392
+ metereadSumDataByWeek: [],
393
+ // 近一周抄表量明细列
394
+ metereadSumByWeekScale: [
395
+ {
396
+ dataKey: 'x',
397
+ alias: '时间'
398
+ },
399
+ {
400
+ dataKey: 'y',
401
+ alias: '抄表量'
402
+ }
403
+ ],
404
+ // 抄表情况分析Loading
405
+ radarLoadState: 'loading',
406
+ // 在用表具统计Loading
407
+ usingMeterSumLoadState: 'loading',
408
+ // 在用表具总量
409
+ usingMeterSum: 0,
410
+ // 昨日新增在用表具量
411
+ usingMeterYesAdd: 0,
412
+ // 近一周新增在用表具明细
413
+ usingMeterSumDataByWeek: [],
414
+ // 近一周新增在用表具明细列
415
+ usingMeterSumByWeekScale: [
416
+ {
417
+ dataKey: 'x',
418
+ alias: '时间'
419
+ },
420
+ {
421
+ dataKey: 'y',
422
+ alias: '开户数'
423
+ }
424
+ ],
425
+ // 指令成功率统计Loading
426
+ instructRateOfSuccessLoadState: 'loading',
427
+ // 指令成功率
428
+ instructRateOfSuccessValue: 0,
429
+ // 昨日指令成功率
430
+ yesterdayInstructRateOf: 0,
431
+ // 同周比
432
+ instructRateOfSuccessYoW: 0,
433
+ // 日同比
434
+ instructRateOfSuccessYoD: 0,
435
+ // 指令成功率进度色
436
+ instructRateOfColor: 'rgb(19, 194, 194)',
437
+ // 是否刷新加载中
438
+ loading: false,
439
+ rankList,
440
+
441
+ // 搜索用户数
442
+ searchUserData,
443
+ searchUserScale,
444
+ searchTableColumns,
445
+ searchData,
446
+
447
+ barData,
448
+ barData2,
449
+
450
+ //
451
+ pieScale,
452
+ pieData,
453
+ sourceData,
454
+ pieStyle: {
455
+ stroke: '#fff',
456
+ lineWidth: 1
457
+ }
458
+ }
459
+ },
460
+ mounted () {
461
+ // 加载指令数统计
462
+ this.loadInstructSumCount()
463
+ // 加载抄表量统计
464
+ this.loadMetereadSumCount()
465
+ // 加载在用表具量统计
466
+ this.loadUsingMeterSumCount()
467
+ // 加载指令成功率统计
468
+ this.loadInstructRateOfSuccess()
469
+ // 加载g2图表
470
+ this.loadGasView()
471
+ },
472
+ computed: {
473
+ ...mapState('setting', ['isMobile'])
474
+ },
475
+ props: {
476
+ selectOrgName: {
477
+ type: String,
478
+ required: true
479
+ },
480
+ webmeterUrl: {
481
+ type: String,
482
+ required: true
483
+ },
484
+ systemVersion: {
485
+ type: String,
486
+ required: true
487
+ },
488
+ dataSource: {
489
+ type: String,
490
+ required: true
491
+ },
492
+ visible: {
493
+ type: Boolean,
494
+ default: false
495
+ }
496
+ },
497
+ methods: {
498
+ onClose () {
499
+ this.$emit('update:visible', false)
500
+ },
501
+ loadInstructSumCount () {
502
+ this.instructSumLoadState = 'loading'
503
+ return post(WebmeterAnalysisViewApi.instructSumCount, {
504
+ webmeterUrl: this.webmeterUrl,
505
+ systemVersion: this.systemVersion,
506
+ dataSource: this.dataSource
507
+ }).then(res => {
508
+ this.instructSum = res.instructSum
509
+ this.instructYoW = res.instructYoW
510
+ this.instructYoD = res.instructYoD
511
+ this.instructYesAdd = res.instructYesAdd
512
+ this.instructSumLoadState = 'success'
513
+ }, err => {
514
+ console.warn(err)
515
+ this.instructSumLoadState = 'error'
516
+ })
517
+ },
518
+ loadMetereadSumCount () {
519
+ this.metereadSumDataByWeek = []
520
+ this.metereadSumLoadState = 'loading'
521
+ return post(WebmeterAnalysisViewApi.meteReadSumCount, {
522
+ webmeterUrl: this.webmeterUrl,
523
+ systemVersion: this.systemVersion,
524
+ dataSource: this.dataSource
525
+ }).then(res => {
526
+ // 加载近一周抄表数图表
527
+ post(WebmeterAnalysisViewApi.meteReadDataByWeek, {
528
+ webmeterUrl: this.webmeterUrl,
529
+ systemVersion: this.systemVersion,
530
+ dataSource: this.dataSource
531
+ }).then(res => {
532
+ for (let i = 0, len = res.length; i < len; i++) {
533
+ this.metereadSumDataByWeek.push({
534
+ x: res[i].date,
535
+ y: res[i].num
536
+ })
537
+ }
538
+ })
539
+ this.metereadSum = res.metereadSum
540
+ this.metereadYesAdd = res.metereadYesAdd
541
+ this.metereadSumLoadState = 'success'
542
+ }, err => {
543
+ console.warn(err)
544
+ this.metereadSumLoadState = 'error'
545
+ })
546
+ },
547
+ loadUsingMeterSumCount () {
548
+ this.usingMeterSumDataByWeek = []
549
+ this.usingMeterSumLoadState = 'loading'
550
+ return post(WebmeterAnalysisViewApi.usingMeterSumCount, {
551
+ webmeterUrl: this.webmeterUrl,
552
+ systemVersion: this.systemVersion,
553
+ dataSource: this.dataSource
554
+ }).then(res => {
555
+ // 加载近一周开户数图表
556
+ post(WebmeterAnalysisViewApi.usingMeterDataByWeek, {
557
+ webmeterUrl: this.webmeterUrl,
558
+ systemVersion: this.systemVersion,
559
+ dataSource: this.dataSource
560
+ }).then(res => {
561
+ for (let i = 0, len = res.length; i < len; i++) {
562
+ this.usingMeterSumDataByWeek.push({
563
+ x: res[i].date,
564
+ y: res[i].num
565
+ })
566
+ }
567
+ })
568
+ this.usingMeterSum = res.usingMeterSum
569
+ this.usingMeterYesAdd = res.usingMeterYesAdd
570
+ this.usingMeterSumLoadState = 'success'
571
+ }, err => {
572
+ console.warn(err)
573
+ this.usingMeterSumLoadState = 'error'
574
+ })
575
+ },
576
+ loadInstructRateOfSuccess () {
577
+ this.instructRateOfSuccessLoadState = 'loading'
578
+ return post(WebmeterAnalysisViewApi.instructRateOfSuccess, {
579
+ webmeterUrl: this.webmeterUrl,
580
+ systemVersion: this.systemVersion,
581
+ dataSource: this.dataSource
582
+ }).then(res => {
583
+ this.instructRateOfSuccessValue = res.instructRateOfSuccessValue * 1.0
584
+ if (this.instructRateOfSuccessValue < 70.0) {
585
+ this.instructRateOfColor = 'rgb(242, 99, 123)'
586
+ } else if (this.instructRateOfSuccessValue < 90.0) {
587
+ this.instructRateOfColor = 'rgb(251, 212, 55)'
588
+ } else {
589
+ this.instructRateOfColor = 'rgb(19, 194, 194)'
590
+ }
591
+ this.instructRateOfSuccessYoW = res.instructRateOfSuccessYoW
592
+ this.instructRateOfSuccessYoD = res.instructRateOfSuccessYoD
593
+ this.yesterdayInstructRateOf = res.yesterdayInstructRateOf
594
+ this.instructRateOfSuccessLoadState = 'success'
595
+ }, err => {
596
+ console.warn(err)
597
+ this.instructRateOfSuccessLoadState = 'error'
598
+ })
599
+ },
600
+ format (date, format) {
601
+ return formatDate(date, format)
602
+ },
603
+ loadGasView () {
604
+ const _this = this
605
+ _this.getHandPlanCountByMeterBrand()
606
+ },
607
+ getHandPlanCountByMeterBrand () {
608
+ this.radarLoadState = 'loading'
609
+ fetch('/webmeterapi/foreignaidHandMeterSumCountData', {
610
+ method: 'POST',
611
+ body: JSON.stringify({
612
+ webmeterUrl: this.webmeterUrl,
613
+ systemVersion: this.systemVersion,
614
+ dataSource: this.dataSource
615
+ })
616
+ }).then((res) => res.json())
617
+ .then((data) => {
618
+ const linePlot = new Line('container', {
619
+ data,
620
+ xField: 'date',
621
+ yField: 'value',
622
+ seriesField: 'name',
623
+ yAxis: {
624
+ label: {
625
+ // 数值格式化为千分位
626
+ formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`)
627
+ }
628
+ },
629
+ tooltip: {
630
+ shared: true
631
+ },
632
+ interactions: [{ type: 'brush' }],
633
+ slider: {
634
+ start: 0.5,
635
+ end: 1
636
+ },
637
+ legend: {
638
+ position: 'top'
639
+ },
640
+ smooth: true
641
+ })
642
+ linePlot.render()
643
+ this.radarLoadState = 'success'
644
+ })
645
+ .catch((ex) => {
646
+ console.error(ex)
647
+ this.radarLoadState = 'error'
648
+ })
649
+ }
650
+ },
651
+ watch: {
652
+ 'visible' (val) {
653
+ if (val) {
654
+ // 加载指令数统计
655
+ this.loadInstructSumCount()
656
+ // 加载抄表量统计
657
+ this.loadMetereadSumCount()
658
+ // 加载在用表具量统计
659
+ this.loadUsingMeterSumCount()
660
+ // 加载指令成功率统计
661
+ this.loadInstructRateOfSuccess()
662
+ // 加载g2图表
663
+ this.loadGasView()
664
+ }
665
+ }
666
+ }
667
+ }
668
+ </script>
669
+
670
+ <style lang="less" scoped>
671
+
672
+ .text {
673
+ color: rgba(0, 0, 0, .45);
674
+ }
675
+
676
+ .heading {
677
+ color: rgba(0, 0, 0, .85);
678
+ font-size: 20px;
679
+ }
680
+
681
+ .extra-wrapper {
682
+ line-height: 55px;
683
+ padding-right: 24px;
684
+
685
+ .extra-item {
686
+ display: inline-block;
687
+ margin-right: 24px;
688
+
689
+ a {
690
+ margin-left: 24px;
691
+ }
692
+ }
693
+ }
694
+
695
+ .antd-pro-pages-dashboard-analysis-twoColLayout {
696
+ position: relative;
697
+ display: flex;
698
+ display: block;
699
+ flex-flow: row wrap;
700
+ }
701
+
702
+ .antd-pro-pages-dashboard-analysis-salesCard {
703
+ height: calc(100% - 24px);
704
+ /deep/ .ant-card-head {
705
+ position: relative;
706
+ }
707
+ }
708
+
709
+ .dashboard-analysis-iconGroup {
710
+ i {
711
+ margin-left: 16px;
712
+ color: rgba(0,0,0,.45);
713
+ cursor: pointer;
714
+ transition: color .32s;
715
+ color: black;
716
+ }
717
+ }
718
+ .analysis-salesTypeRadio {
719
+ position: absolute;
720
+ right: 54px;
721
+ bottom: 12px;
722
+ }
723
+ </style>