vue2-client 1.2.78 → 1.2.81

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.2.80 - 1.2.81 -2022-07-18 @江超**
5
+ - 功能修改:
6
+ - 更新物联网表统计页面
7
+
8
+ **1.2.79 -2022-06-24 @苗艳强**
9
+ - 问题修复:
10
+ - x-form-table:
11
+ - 修复fixedQueryForm属性变化时查询表单异常清空问题
12
+
4
13
  **1.2.78 -2022-06-24 @江超**
5
14
  - 功能修改:
6
15
  - 更新物联网设备统计页面
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.78",
3
+ "version": "1.2.81",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -104,7 +104,7 @@ export default {
104
104
  formData.append('resUploadStock', this.model.resUploadStock)
105
105
  formData.append('filename', info.file.name)
106
106
  formData.append('filesize', (info.file.size / 1024 / 1024).toFixed(4))
107
- formData.append('f_operator', this.currUser.username)
107
+ formData.append('f_operator', this.currUser ? this.currUser.username : '')
108
108
 
109
109
  // const url = '/webmeteruploadapi/resource'
110
110
  // if (process.env.NODE_ENV === 'production') {
@@ -192,13 +192,11 @@ export default {
192
192
  },
193
193
  fixedQueryForm: {
194
194
  handler () {
195
- this.mainLoading = true
196
195
  this.form = {}
197
196
  indexedDB.getByWeb(this.queryParamsName, commonApi.getColumnsJson, { str: this.queryParamsName }, (ret) => {
198
197
  this.tableColumns = ret.columnJson
199
198
  this.formItems = ret.formJson
200
199
  this.buttonState = ret.buttonState
201
- this.mainLoading = false
202
200
  this.loaded = true
203
201
  })
204
202
  },
@@ -86,21 +86,23 @@
86
86
  </a-col>
87
87
  </a-row>
88
88
 
89
- <a-card :body-style="{padding: '0'}" :bordered="false" :loading="loading">
89
+ <a-card :body-style="{padding: '0'}" :bordered="false">
90
90
  <div class="salesCard">
91
- <a-tabs :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}" default-active-key="1" size="large">
91
+ <a-tabs :activeKey="tabActiveKey" :default-active-key="tabActiveKey" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}" size="large" @change="handleTabChange">
92
92
  <div slot="tabBarExtraContent" class="extra-wrapper">
93
93
  <div class="extra-item">
94
- <a>今日</a>
95
- <a>本周</a>
96
- <a>本月</a>
97
- <a>本年</a>
94
+ <a-radio-group v-model="countMode" button-style="solid" @change="toggleCountMode">
95
+ <a-radio-button value="now">最近24小时</a-radio-button>
96
+ <a-radio-button value="week">近一周</a-radio-button>
97
+ <a-radio-button value="month">近一个月</a-radio-button>
98
+ <a-radio-button value="year">近一年</a-radio-button>
99
+ </a-radio-group>
98
100
  </div>
99
101
  <a-range-picker :style="{width: '256px'}" />
100
102
  </div>
101
103
  <a-tab-pane key="1" tab="抄表情况分析">
102
104
  <a-row :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
103
- <x-card :loadState="radarLoadState" :retry="loadGasView">
105
+ <x-card :loadState="radarLoadState" :retry="getHandPlanCountByMeterBrand">
104
106
  <div id="container" style="padding: 0 0 0 20px;height: 370px" />
105
107
  </x-card>
106
108
  </a-row>
@@ -122,7 +124,7 @@
122
124
  <div :class="!isMobile && 'desktop'" class="antd-pro-pages-dashboard-analysis-twoColLayout">
123
125
  <a-row :gutter="24" :style="{ marginTop: '24px' }" type="flex">
124
126
  <a-col :lg="24" :md="24" :sm="24" :xl="12" :xs="24">
125
- <a-card :bordered="false" :loading="loading" :style="{ height: '100%' }" title="用气情况排行">
127
+ <x-card :bordered="false" :loadState="useGasLoadState" :retry="loadUseGasData" title="用气情况排行">
126
128
  <a-dropdown slot="extra" :trigger="['click']" placement="bottomLeft">
127
129
  <a class="ant-dropdown-link" href="#">
128
130
  <a-icon type="ellipsis" />
@@ -138,38 +140,38 @@
138
140
  </a-dropdown>
139
141
  <a-row :gutter="68">
140
142
  <a-col :sm="12" :style="{ marginBottom: ' 24px'}" :xs="24">
141
- <number-info :sub-total="17.1" :total="21232.1">
143
+ <number-info :status="useGasSubValue.status" :sub-total="useGasSubValue.subValue" :total="todayUseGasTotalValue">
142
144
  <span slot="subtitle">
143
145
  <span>当天总用气量</span>
144
- <a-tooltip slot="action" title="指标说明">
146
+ <a-tooltip slot="action" title="本日所有物联网表用户总用气量">
145
147
  <a-icon :style="{ marginLeft: '8px' }" type="info-circle-o" />
146
148
  </a-tooltip>
147
149
  </span>
148
150
  </number-info>
149
151
  <!-- miniChart -->
150
152
  <div>
151
- <mini-smooth-area :dataSource="searchUserData" :scale="searchUserScale" :style="{ height: '45px' }" />
153
+ <mini-smooth-area :dataSource="useGasWeekData" :scale="useGasWeekDataScale" :style="{ height: '45px' }" />
152
154
  </div>
153
155
  </a-col>
154
156
  <a-col :sm="12" :style="{ marginBottom: ' 24px'}" :xs="24">
155
- <number-info :sub-total="0.2" :total="0.7" status="up">
157
+ <number-info :status="handPlanUserSubValue.status" :sub-total="handPlanUserSubValue.subValue" :total="todayHandPlanUserCount">
156
158
  <span slot="subtitle">
157
- <span>人均用气量</span>
158
- <a-tooltip slot="action" title="指标说明">
159
+ <span>当天总抄表用户数</span>
160
+ <a-tooltip slot="action" title="当天总抄表用户数">
159
161
  <a-icon :style="{ marginLeft: '8px' }" type="info-circle-o" />
160
162
  </a-tooltip>
161
163
  </span>
162
164
  </number-info>
163
165
  <!-- miniChart -->
164
166
  <div>
165
- <mini-smooth-area :dataSource="searchUserData" :scale="searchUserScale" :style="{ height: '45px' }" />
167
+ <mini-smooth-area :dataSource="handPlanUserData" :scale="handPlanUserDataScale" :style="{ height: '45px' }" />
166
168
  </div>
167
169
  </a-col>
168
170
  </a-row>
169
171
  <div class="ant-table-wrapper">
170
172
  <a-table
171
173
  :columns="searchTableColumns"
172
- :dataSource="searchData"
174
+ :dataSource="gasConsumptionRanking"
173
175
  :pagination="{ pageSize: 5 }"
174
176
  row-key="index"
175
177
  size="small"
@@ -181,10 +183,10 @@
181
183
  </span>
182
184
  </a-table>
183
185
  </div>
184
- </a-card>
186
+ </x-card>
185
187
  </a-col>
186
188
  <a-col :lg="24" :md="24" :sm="24" :xl="12" :xs="24">
187
- <a-card :bordered="false" :loading="loading" :style="{ height: '100%' }" class="antd-pro-pages-dashboard-analysis-salesCard" title="指令类别占比">
189
+ <a-card :bordered="false" :loading="false" :style="{ height: '100%' }" class="antd-pro-pages-dashboard-analysis-salesCard" title="指令类别占比">
188
190
  <div slot="extra" style="height: inherit;">
189
191
  <div class="analysis-salesTypeRadio">
190
192
  <a-radio-group defaultValue="a">
@@ -262,26 +264,15 @@ for (let i = 0; i < 7; i++) {
262
264
  y: Math.ceil(Math.random() * 10)
263
265
  })
264
266
  }
265
- const searchUserScale = [
266
- {
267
- dataKey: 'x',
268
- alias: '时间'
269
- },
270
- {
271
- dataKey: 'y',
272
- alias: '用气量',
273
- min: 0,
274
- max: 10
275
- }]
276
267
 
277
268
  const searchTableColumns = [
278
269
  {
279
- dataIndex: 'index',
270
+ dataIndex: 'f_userinfo_id',
280
271
  title: '用户编号',
281
272
  width: 90
282
273
  },
283
274
  {
284
- dataIndex: 'keyword',
275
+ dataIndex: 'f_user_name',
285
276
  title: '用户姓名'
286
277
  },
287
278
  {
@@ -363,6 +354,7 @@ export default {
363
354
  screenWidth: document.documentElement.clientWidth,
364
355
  // 客户名称
365
356
  customerName: '',
357
+ // >> 指令总数统计
366
358
  // 指令数统计Loading
367
359
  instructSumLoadState: 'loading',
368
360
  // 总指令数
@@ -373,6 +365,7 @@ export default {
373
365
  instructYoD: 0,
374
366
  // 昨日新增指令数
375
367
  instructYesAdd: 0,
368
+ // >> 抄表量统计
376
369
  // 抄表量统计Loading
377
370
  metereadSumLoadState: 'loading',
378
371
  // 总抄表量
@@ -392,8 +385,7 @@ export default {
392
385
  alias: '抄表量'
393
386
  }
394
387
  ],
395
- // 抄表情况分析Loading
396
- radarLoadState: 'loading',
388
+ // >> 在用表具数统计
397
389
  // 在用表具统计Loading
398
390
  usingMeterSumLoadState: 'loading',
399
391
  // 在用表具总量
@@ -413,9 +405,8 @@ export default {
413
405
  alias: '开户数'
414
406
  }
415
407
  ],
416
- // 指令成功率统计Loading
417
- instructRateOfSuccessLoadState: 'loading',
418
- // 指令成功率
408
+ // >> 表具指令下发成功率统计
409
+ // 表具指令成功率
419
410
  instructRateOfSuccessValue: 0,
420
411
  // 昨日指令成功率
421
412
  yesterdayInstructRateOf: 0,
@@ -425,13 +416,59 @@ export default {
425
416
  instructRateOfSuccessYoD: 0,
426
417
  // 指令成功率进度色
427
418
  instructRateOfColor: 'rgb(19, 194, 194)',
428
- // 是否刷新加载中
429
- loading: false,
419
+ // 表具指令下发成功率加载状态
420
+ instructRateOfSuccessLoadState: 'loading',
421
+
422
+ // 统计模式
423
+ countMode: 'now',
424
+ // 统计类型
425
+ tabActiveKey: '1',
426
+ // >> 表具上报情况统计
427
+ // 上报统计图表
428
+ uploadCountPlot: undefined,
429
+ // 抄表情况分析Loading
430
+ radarLoadState: 'loading',
431
+ // >> 用气情况排行统计
432
+ // 用气情况排行统计Loading
433
+ useGasLoadState: 'loading',
434
+ // 当天总用气量
435
+ todayUseGasTotalValue: 0,
436
+ // 昨天总用气量
437
+ yesterdayUseGasTotalValue: 0,
438
+ // 近一周的每天用气情况
439
+ useGasWeekData: [],
440
+ useGasWeekDataScale: [
441
+ {
442
+ dataKey: 'x',
443
+ alias: '时间'
444
+ },
445
+ {
446
+ dataKey: 'y',
447
+ alias: '用气量'
448
+ }
449
+ ],
450
+ // 当天抄表用户数
451
+ todayHandPlanUserCount: 0,
452
+ // 昨天抄表用户数
453
+ yesterdayHandPlanUserCount: 0,
454
+ // 近一周的每天抄表情况
455
+ handPlanUserData: [],
456
+ handPlanUserDataScale: [
457
+ {
458
+ dataKey: 'x',
459
+ alias: '时间'
460
+ },
461
+ {
462
+ dataKey: 'y',
463
+ alias: '用户数'
464
+ }
465
+ ],
466
+ // 用气排行榜
467
+ gasConsumptionRanking: [],
430
468
  rankList,
431
469
 
432
470
  // 搜索用户数
433
471
  searchUserData,
434
- searchUserScale,
435
472
  searchTableColumns,
436
473
  searchData,
437
474
 
@@ -457,18 +494,37 @@ export default {
457
494
  this.loadUsingMeterSumCount()
458
495
  // 加载指令成功率统计
459
496
  this.loadInstructRateOfSuccess()
460
- // 加载g2图表
461
- this.loadGasView()
497
+ // 加载各表厂表具上报情况统计
498
+ this.getHandPlanCountByMeterBrand()
499
+ // 加载用气量统计
500
+ this.loadUseGasData()
462
501
  },
463
502
  computed: {
464
- ...mapState('setting', ['isMobile'])
465
- },
466
- props: {
503
+ ...mapState('setting', ['isMobile']),
504
+ useGasSubValue: function () {
505
+ const subValue = this.todayUseGasTotalValue - this.yesterdayUseGasTotalValue
506
+ const status = subValue >= 0 ? 'up' : 'down'
507
+ return {
508
+ subValue: subValue,
509
+ status: status
510
+ }
511
+ },
512
+ handPlanUserSubValue: function () {
513
+ const subValue = this.todayHandPlanUserCount - this.yesterdayHandPlanUserCount
514
+ const status = subValue >= 0 ? 'up' : 'down'
515
+ return {
516
+ subValue: subValue,
517
+ status: status
518
+ }
519
+ },
467
520
  },
468
521
  methods: {
522
+ /**
523
+ * 加载指令总数统计
524
+ */
469
525
  loadInstructSumCount () {
470
526
  this.instructSumLoadState = 'loading'
471
- return post(WebmeterAnalysisViewApi.instructSumCount, {}).then(res => {
527
+ post(WebmeterAnalysisViewApi.instructSumCount, {}).then(res => {
472
528
  this.instructSum = res.instructSum
473
529
  this.instructYoW = res.instructYoW
474
530
  this.instructYoD = res.instructYoD
@@ -479,10 +535,13 @@ export default {
479
535
  this.instructSumLoadState = 'error'
480
536
  })
481
537
  },
538
+ /**
539
+ * 加载抄表总数统计
540
+ */
482
541
  loadMetereadSumCount () {
483
542
  this.metereadSumDataByWeek = []
484
543
  this.metereadSumLoadState = 'loading'
485
- return post(WebmeterAnalysisViewApi.meteReadSumCount, {}).then(res => {
544
+ post(WebmeterAnalysisViewApi.meteReadSumCount, {}).then(res => {
486
545
  // 加载近一周抄表数图表
487
546
  post(WebmeterAnalysisViewApi.meteReadDataByWeek, {}).then(res => {
488
547
  for (let i = 0, len = res.length; i < len; i++) {
@@ -500,6 +559,9 @@ export default {
500
559
  this.metereadSumLoadState = 'error'
501
560
  })
502
561
  },
562
+ /**
563
+ * 加载在用表具总数情况
564
+ */
503
565
  loadUsingMeterSumCount () {
504
566
  this.usingMeterSumDataByWeek = []
505
567
  this.usingMeterSumLoadState = 'loading'
@@ -521,9 +583,12 @@ export default {
521
583
  this.usingMeterSumLoadState = 'error'
522
584
  })
523
585
  },
586
+ /**
587
+ * 加载表具指令下发成功率
588
+ */
524
589
  loadInstructRateOfSuccess () {
525
590
  this.instructRateOfSuccessLoadState = 'loading'
526
- return post(WebmeterAnalysisViewApi.instructRateOfSuccess, {}).then(res => {
591
+ post(WebmeterAnalysisViewApi.instructRateOfSuccess, {}).then(res => {
527
592
  this.instructRateOfSuccessValue = res.instructRateOfSuccessValue * 1.0
528
593
  if (this.instructRateOfSuccessValue < 70.0) {
529
594
  this.instructRateOfColor = 'rgb(242, 99, 123)'
@@ -541,21 +606,52 @@ export default {
541
606
  this.instructRateOfSuccessLoadState = 'error'
542
607
  })
543
608
  },
609
+ /**
610
+ * 格式化日期
611
+ * @param date 日期字符串
612
+ * @param format 格式化方式
613
+ * @returns {string|*} 格式化结果
614
+ */
544
615
  format (date, format) {
545
616
  return formatDate(date, format)
546
617
  },
547
- loadGasView () {
548
- const _this = this
549
- _this.getHandPlanCountByMeterBrand()
618
+ /**
619
+ * 切换周期
620
+ */
621
+ toggleCountMode () {
622
+ this.updateDataByKey()
550
623
  },
624
+ /**
625
+ * Tab切换
626
+ */
627
+ handleTabChange (key) {
628
+ this.tabActiveKey = key + ''
629
+ this.updateDataByKey()
630
+ },
631
+ /**
632
+ * 根据模式更新数据
633
+ */
634
+ updateDataByKey () {
635
+ if (this.tabActiveKey === '1') {
636
+ this.getHandPlanCountByMeterBrand()
637
+ } else {
638
+ // this.getDeviceLostContactCountData()
639
+ // this.getDeviceLostContactRankData()
640
+ }
641
+ },
642
+ /**
643
+ * 获取各表厂表具上报情况
644
+ */
551
645
  getHandPlanCountByMeterBrand () {
552
646
  this.radarLoadState = 'loading'
553
- fetch('/webmeterapi/foreignaidHandMeterSumCountData', {
647
+ fetch(WebmeterAnalysisViewApi.handMeterSumCountData, {
554
648
  method: 'POST',
555
- body: JSON.stringify({})
649
+ body: JSON.stringify({
650
+ type: this.countMode
651
+ })
556
652
  }).then((res) => res.json())
557
653
  .then((data) => {
558
- const linePlot = new Line('container', {
654
+ const plotOption = {
559
655
  data,
560
656
  xField: 'date',
561
657
  yField: 'value',
@@ -571,20 +667,47 @@ export default {
571
667
  },
572
668
  interactions: [{ type: 'brush' }],
573
669
  slider: {
574
- start: 0.5,
670
+ start: 0,
575
671
  end: 1
576
672
  },
577
673
  legend: {
578
- position: 'top'
674
+ position: 'top',
675
+ radio: true,
676
+ flipPage: false
579
677
  },
580
678
  smooth: true
581
- })
582
- linePlot.render()
679
+ }
680
+ if (this.uploadCountPlot) {
681
+ this.uploadCountPlot.update(plotOption)
682
+ } else {
683
+ this.uploadCountPlot = new Line('container', plotOption)
684
+ this.uploadCountPlot.render()
685
+ }
583
686
  this.radarLoadState = 'success'
584
687
  })
585
- .catch((ex) => {
586
- console.error(ex)
587
- this.radarLoadState = 'error'
688
+ .catch((ex) => {
689
+ console.error(ex)
690
+ this.radarLoadState = 'error'
691
+ })
692
+ },
693
+ /**
694
+ * 获取用气请求排行
695
+ */
696
+ loadUseGasData () {
697
+ this.gasConsumptionRanking = []
698
+ this.useGasLoadState = 'loading'
699
+ return post(WebmeterAnalysisViewApi.useGasSumCount, {}).then(res => {
700
+ this.gasConsumptionRanking = res.gasConsumptionRanking
701
+ this.todayUseGasTotalValue = res.todayUseGasTotalValue
702
+ this.todayHandPlanUserCount = res.todayHandPlanUserCount
703
+ this.yesterdayUseGasTotalValue = res.yesterdayUseGasTotalValue
704
+ this.yesterdayHandPlanUserCount = res.yesterdayHandPlanUserCount
705
+ this.useGasWeekData = res.useGasWeekData
706
+ this.handPlanUserData = res.handPlanUserData
707
+ this.useGasLoadState = 'success'
708
+ }, err => {
709
+ console.warn(err)
710
+ this.useGasLoadState = 'error'
588
711
  })
589
712
  }
590
713
  }
@@ -1,30 +1,20 @@
1
- const WebmeterAnalysisViewApi = {
2
- // 查询:指令数统计
3
- instructSumCount: '/webmeterapi/foreignaidInstructSumCountData',
4
- // 查询:抄表数统计
5
- meteReadSumCount: '/webmeterapi/foreignaidMetereadSumCountData',
6
- // 查询:近一周抄表量数据
7
- meteReadDataByWeek: '/webmeterapi/foreignaidMetereadDataByWeekData',
8
- // 查询:在用表具数
9
- usingMeterSumCount: '/webmeterapi/foreignaidUsingMeterSumCountData',
10
- // 查询:近一周在用表具数数据
11
- usingMeterDataByWeek: '/webmeterapi/foreignaidUsingMeterDataByWeekData',
12
- // 查询:指令成功率统计
13
- instructRateOfSuccess: '/webmeterapi/foreignaidInstructRateOfSuccessData',
14
- // 查询:用气量趋势统计
15
- VerticalChartOfGasConsumption: '/webmeterapi/VerticalChartOfGasConsumption',
16
- // 查询:用气排行榜趋势统计
17
- GasConsumptionRanking: '/webmeterapi/GasConsumptionRanking',
18
- // 查询:指令圆形统计图
19
- InstructionStateDiagram: '/webmeterapi/InstructionStateDiagram',
20
- // 查询:用户气量分析
21
- AnalysisOfUserGasConsumption: '/webmeterapi/AnalysisOfUserGasConsumption',
22
- // 查询:用户气量统计图分析
23
- LineChartOfTotalGasConsumption: '/webmeterapi/LineChartOfTotalGasConsumption',
24
- // 查询:用户用气量分析折线图平均值
25
- LineChartOfPerCapitaGasConsumption: '/webmeterapi/LineChartOfPerCapitaGasConsumption',
26
- // 查询:周用用气量排行榜
27
- RankingOfGasConsumptionAnalysis: '/webmeterapi/RankingOfGasConsumptionAnalysis'
28
- }
29
-
30
- export { WebmeterAnalysisViewApi }
1
+ const WebmeterAnalysisViewApi = {
2
+ // 查询:指令数统计
3
+ instructSumCount: '/webmeterapi/foreignaidInstructSumCountData',
4
+ // 查询:抄表数统计
5
+ meteReadSumCount: '/webmeterapi/foreignaidMetereadSumCountData',
6
+ // 查询:近一周抄表量数据
7
+ meteReadDataByWeek: '/webmeterapi/foreignaidMetereadDataByWeekData',
8
+ // 查询:在用表具数
9
+ usingMeterSumCount: '/webmeterapi/foreignaidUsingMeterSumCountData',
10
+ // 查询:近一周在用表具数数据
11
+ usingMeterDataByWeek: '/webmeterapi/foreignaidUsingMeterDataByWeekData',
12
+ // 查询:指令成功率统计
13
+ instructRateOfSuccess: '/webmeterapi/foreignaidInstructRateOfSuccessData',
14
+ // 查询:按表厂抄表量统计
15
+ handMeterSumCountData: '/webmeterapi/foreignaidHandMeterSumCountData',
16
+ // 查询:统计用气量数据
17
+ useGasSumCount: '/webmeterapi/foreignaidUseGasSumCountData'
18
+ }
19
+
20
+ export { WebmeterAnalysisViewApi }