vue2-client 1.2.37-2 → 1.2.40

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 (60) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/docs/notice.md +22 -22
  3. package/package.json +1 -1
  4. package/src/base-client/all.js +61 -61
  5. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +104 -104
  6. package/src/base-client/components/common/AmapMarker/index.js +3 -3
  7. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  8. package/src/base-client/components/common/ScrollList/SrcollList.vue +113 -113
  9. package/src/base-client/components/common/ScrollList/index.js +3 -3
  10. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +315 -315
  11. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  12. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +225 -225
  13. package/src/base-client/components/iot/DataAnalysisView/DataAnalysisView.vue +244 -244
  14. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +452 -452
  15. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +236 -236
  16. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  17. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +121 -121
  18. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +276 -276
  19. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +469 -469
  20. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +379 -379
  21. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +359 -359
  22. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  23. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +184 -184
  24. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +291 -291
  25. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +236 -236
  26. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +256 -256
  27. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +189 -189
  28. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +722 -722
  29. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  30. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +247 -247
  31. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +370 -370
  32. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +3 -3
  33. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  34. package/src/base-client/plugins/AppData.js +67 -67
  35. package/src/base-client/plugins/GetLoginInfoService.js +252 -252
  36. package/src/components/exception/ExceptionPage.vue +70 -70
  37. package/src/components/setting/Setting.vue +235 -237
  38. package/src/config/default/setting.config.js +35 -34
  39. package/src/config/index.js +3 -6
  40. package/src/layouts/SinglePageView.vue +13 -17
  41. package/src/layouts/header/HeaderNotice.vue +97 -97
  42. package/src/layouts/tabs/TabsView.vue +3 -5
  43. package/src/pages/login/Login.vue +201 -198
  44. package/src/pages/report/ReportTableHome.vue +28 -28
  45. package/src/pages/resourceManage/depListManage.vue +23 -23
  46. package/src/pages/resourceManage/funListManage.vue +23 -23
  47. package/src/pages/resourceManage/index.js +15 -15
  48. package/src/pages/resourceManage/orgListManage.vue +98 -98
  49. package/src/pages/resourceManage/roleListManage.vue +23 -23
  50. package/src/pages/resourceManage/staffListManage.vue +23 -23
  51. package/src/pages/system/ticket/index.vue +225 -209
  52. package/src/pages/system/ticket/submitTicketSuccess.vue +248 -248
  53. package/src/router/async/router.map.js +2 -3
  54. package/src/services/api/common.js +47 -47
  55. package/src/services/api/index.js +39 -39
  56. package/src/services/user.js +34 -34
  57. package/src/utils/indexedDB.js +146 -146
  58. package/src/utils/routerUtil.js +359 -360
  59. package/vue.config.js +143 -143
  60. package/src/config/config.js +0 -15
@@ -466,7 +466,7 @@
466
466
  handleCloseOk () {
467
467
  return post(TicketDetailsViewApi.manualCloseTicket, {
468
468
  ticketId: this.ticketId,
469
- time: new Date()
469
+ time: this.format(new Date(), 'yyyy-MM-dd hh:mm:ss')
470
470
  })
471
471
  .then(res => {
472
472
  if (res !== 0) {
@@ -495,7 +495,7 @@
495
495
  this.getCurrentEmpId()
496
496
  return post(TicketDetailsViewApi.confirmTicket, {
497
497
  ticketId: this.ticketId,
498
- time: new Date(),
498
+ time: this.format(new Date(), 'yyyy-MM-dd hh:mm:ss'),
499
499
  empId: this.empIdInDataBase
500
500
  })
501
501
  .then(res => {
@@ -559,7 +559,7 @@
559
559
  } else {
560
560
  return post(TicketDetailsViewApi.transferTicketToOthers, {
561
561
  ticketId: this.ticketId,
562
- endTime: new Date(),
562
+ endTime: this.format(new Date(), 'yyyy-MM-dd hh:mm:ss'),
563
563
  transferTo: this.transferTo,
564
564
  note: this.note,
565
565
  images: this.fileList
@@ -1,260 +1,260 @@
1
- <template>
2
- <div>
3
- <a-card :bordered="false" :loading="loading">
4
- <a-timeline ref="timeline" :pending="pendingText" :reverse="true" mode="alternate" style="max-width: 800px;margin: 0 auto;">
5
- <a-timeline-item v-if="index < 3 ? true : advanced" :key="index" v-for="(value,index) in workFLowList" color="green">
6
- <div style="color: #0d1a26;font-weight: 500;">
7
- <span style="font-size: 16px;">{{ value.name }}</span>
8
- <span style="margin-left: 5px;">({{ format(value.created_time,'yyyy-MM-dd hh:mm:ss') }} 至 {{ format(value.end_time,'yyyy-MM-dd hh:mm:ss') }})</span>
9
- </div>
10
- <div class="antd-pro-pages-profile-advanced-style-stepDescription" style="margin-top: 5px;margin-bottom: 5px">
11
- <span class="note" style="font-size: 1.1em;margin-top: 5px;margin-bottom: 5px">留言:{{ value.note }}</span>
12
- </div>
13
- <img
14
- v-for="(item,n) in value.images"
15
- :src="'data:image/png;base64,' + item.url"
16
- :key="'s' + n"
17
- @click="changePhotoClass(item)"
18
- class="img_sm"
19
- >
20
- </a-timeline-item>
21
- </a-timeline>
22
- <a-col :md="!advanced && 8 || 24" :sm="24" v-if="workFLowList.length > 3">
23
- <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
24
- <a @click="toggleAdvanced" style="margin-left: 8px">
25
- {{ advanced ? '收起' : '展开' }}
26
- <a-icon :type="advanced ? 'up' : 'down'"/>
27
- </a>
28
- </span>
29
- </a-col>
30
- </a-card>
31
- </div>
32
- </template>
33
- <script>
34
- import { formatDate } from '@vue2-client/utils/util'
35
- import { mapState } from 'vuex'
36
- import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
37
-
38
- export default {
39
- name: 'TicketDetailsFlow',
40
- props: {
41
- ticketId: {
42
- type: String,
43
- required: true
44
- },
45
- disableCloseBtn: {
46
- type: Boolean,
47
- required: true
48
- },
49
- id: {
50
- type: Number,
51
- required: true
52
- }
53
- },
54
- computed: {
55
- ...mapState('setting', ['isMobile'])
56
- },
57
- data () {
58
- return {
59
- // 历史操作 展开/关闭
60
- advanced: false,
61
- workFLowList: [],
62
- loading: false,
63
- pendingText: '持续记录中...',
64
- // 工单流转留言,详细信息框可见性
65
- workFlowDetailsVisible: false,
66
- // 模态框中内容
67
- modalData: {
68
- note: '',
69
- images: []
70
- },
71
- // 选中照片是否显示
72
- selectedImageShow: false,
73
- // 选中的照片
74
- selectedImage: null
75
- }
76
- },
77
- mounted () {
78
- this.getTicketWorkFlowDetail(this.ticketId)
79
- },
80
- methods: {
81
- format (date, format) {
82
- return formatDate(date, format)
83
- },
84
- // 图像点击切换放大缩小
85
- changePhotoClass (item) {
86
- this.$emit('imageClick', item)
87
- },
88
- // 获取流转工单详情
89
- getTicketWorkFlowDetail (num) {
90
- if (this.disableCloseBtn) {
91
- this.pendingText = ''
92
- } else {
93
- this.pendingText = '持续记录中...'
94
- }
95
- this.loading = true
96
- return post(TicketDetailsViewApi.getTicketWorkFlowDetails, {
97
- ticketId: num
98
- }).then(res => {
99
- this.workFLowDetails = res
100
- // 解析workFLowDetails数据
101
- this.workFLowList = []
102
- const len = this.workFLowDetails.length
103
- for (let i = 0; i < len; i++) {
104
- if (this.workFLowDetails[i].note === undefined) {
105
- this.workFLowDetails[i].note = ''
106
- }
107
- if (this.workFLowDetails[i].images === undefined) {
108
- this.workFLowDetails[i].images = []
109
- }
110
- this.workFLowList.push({
111
- name: this.workFLowDetails[i].name,
112
- created_time: this.workFLowDetails[i].created_time,
113
- end_time: this.workFLowDetails[i].end_time,
114
- note: this.workFLowDetails[i].note,
115
- images: this.workFLowDetails[i].images
116
- })
117
- for (let j = 0; j < this.workFLowDetails[i].images.length; j++) {
118
- this.workFLowDetails[i].images[j].isLarge = false
119
- }
120
- }
121
- this.workFLowList = this.workFLowList.reverse()
122
- this.loading = false
123
- })
124
- },
125
- toggleAdvanced () {
126
- this.advanced = !this.advanced
127
- }
128
- },
129
- watch: {
130
- 'ticketId' () {
131
- this.getTicketWorkFlowDetail(this.ticketId)
132
- },
133
- 'disableCloseBtn' () {
134
- this.getTicketWorkFlowDetail(this.ticketId)
135
- },
136
- 'id' () {
137
- this.getTicketWorkFlowDetail(this.ticketId)
138
- }
139
- }
140
- }
141
- </script>
142
-
143
- <style lang="less" scoped>
144
- .card_view {
145
- width: 70%;
146
- min-width: 700px;
147
- }
148
-
149
- .card_view_mobile {
150
- width: 100%;
151
- }
152
-
153
- .card_details_title {
154
- margin: 4px 0;
155
- font-size: 14px;
156
- }
157
-
158
- .card_details_value {
159
- font-size: 16px;
160
- font-weight: bold;
161
- color: #444;
162
- margin-bottom: 0;
163
- overflow: hidden;
164
- text-overflow:ellipsis;
165
- white-space: nowrap;
166
- }
167
-
168
- .card_guid {
169
- width: 25%;
170
- text-align:left;
171
- }
172
-
173
- .card_guid_mobile {
174
- width: 50%;
175
- text-align:left;
176
- }
177
-
178
- .detail-layout {
179
- margin-left: 44px;
180
- }
181
- .text {
182
- color: rgba(0, 0, 0, .45);
183
- }
184
-
185
- .heading {
186
- color: rgba(0, 0, 0, .85);
187
- font-size: 20px;
188
- }
189
-
190
- .no-data {
191
- color: rgba(0, 0, 0, .25);
192
- text-align: center;
193
- line-height: 64px;
194
- font-size: 16px;
195
-
196
- i {
197
- font-size: 24px;
198
- margin-right: 16px;
199
- position: relative;
200
- top: 3px;
201
- }
202
- }
203
-
204
- .mobile {
205
- .detail-layout {
206
- margin-left: unset;
207
- }
208
- .text {
209
-
210
- }
211
- .status-list {
212
- text-align: left;
213
- }
214
- }
215
-
216
- .img_sm {
217
- border: rgba(84, 84, 84, 0.2) solid 1.5px;
218
- border-radius: 5px;
219
- padding: 10px;
220
- width: 160px;
221
- height: 120px;
222
- }
223
- .img_xl {
224
- position: absolute;
225
- top:0;bottom:0;left:0;right:0;
226
- margin: auto;
227
- width: 100%;
228
- max-width: 1000px;
229
- cursor: zoom-out;
230
- z-index: 9999;
231
- animation: imgZoomIn 0.4s;
232
- -webkit-animation: imgZoomIn 0.4s;
233
- }
234
- @keyframes imgZoomIn
235
- {
236
- from {width: 160px;}
237
- to {width: 100%;}
238
- }
239
- .img_sm:hover {
240
- opacity: 0.6;
241
- cursor: zoom-in;
242
- }
243
- .img_sm_dark{
244
- filter: grayscale(100%);
245
- opacity: 0.6;
246
- border: rgba(84, 84, 84, 0.2) solid 1.5px;
247
- border-radius: 5px;
248
- padding: 10px;
249
- width: 160px;
250
- height: 120px;
251
- }
252
- .imgBackground {
253
- position: absolute;
254
- top:0;bottom:0;left:0;right:0;
255
- width: 100%;
256
- height: 100%;
257
- z-index: 9998;
258
- background-color: rgba(0,0,0,0.7);
259
- }
260
- </style>
1
+ <template>
2
+ <div>
3
+ <a-card :bordered="false" :loading="loading">
4
+ <a-timeline ref="timeline" :pending="pendingText" :reverse="true" mode="alternate" style="max-width: 800px;margin: 0 auto;">
5
+ <a-timeline-item v-if="index < 3 ? true : advanced" :key="index" v-for="(value,index) in workFLowList" color="green">
6
+ <div style="color: #0d1a26;font-weight: 500;">
7
+ <span style="font-size: 16px;">{{ value.name }}</span>
8
+ <span style="margin-left: 5px;">({{ format(value.created_time,'yyyy-MM-dd hh:mm:ss') }} 至 {{ format(value.end_time,'yyyy-MM-dd hh:mm:ss') }})</span>
9
+ </div>
10
+ <div class="antd-pro-pages-profile-advanced-style-stepDescription" style="margin-top: 5px;margin-bottom: 5px">
11
+ <span class="note" style="font-size: 1.1em;margin-top: 5px;margin-bottom: 5px">留言:{{ value.note }}</span>
12
+ </div>
13
+ <img
14
+ v-for="(item,n) in value.images"
15
+ :src="'data:image/png;base64,' + item.url"
16
+ :key="'s' + n"
17
+ @click="changePhotoClass(item)"
18
+ class="img_sm"
19
+ >
20
+ </a-timeline-item>
21
+ </a-timeline>
22
+ <a-col :md="!advanced && 8 || 24" :sm="24" v-if="workFLowList.length > 3">
23
+ <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
24
+ <a @click="toggleAdvanced" style="margin-left: 8px">
25
+ {{ advanced ? '收起' : '展开' }}
26
+ <a-icon :type="advanced ? 'up' : 'down'"/>
27
+ </a>
28
+ </span>
29
+ </a-col>
30
+ </a-card>
31
+ </div>
32
+ </template>
33
+ <script>
34
+ import { formatDate } from '@vue2-client/utils/util'
35
+ import { mapState } from 'vuex'
36
+ import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
37
+
38
+ export default {
39
+ name: 'TicketDetailsFlow',
40
+ props: {
41
+ ticketId: {
42
+ type: String,
43
+ required: true
44
+ },
45
+ disableCloseBtn: {
46
+ type: Boolean,
47
+ required: true
48
+ },
49
+ id: {
50
+ type: Number,
51
+ required: true
52
+ }
53
+ },
54
+ computed: {
55
+ ...mapState('setting', ['isMobile'])
56
+ },
57
+ data () {
58
+ return {
59
+ // 历史操作 展开/关闭
60
+ advanced: false,
61
+ workFLowList: [],
62
+ loading: false,
63
+ pendingText: '持续记录中...',
64
+ // 工单流转留言,详细信息框可见性
65
+ workFlowDetailsVisible: false,
66
+ // 模态框中内容
67
+ modalData: {
68
+ note: '',
69
+ images: []
70
+ },
71
+ // 选中照片是否显示
72
+ selectedImageShow: false,
73
+ // 选中的照片
74
+ selectedImage: null
75
+ }
76
+ },
77
+ mounted () {
78
+ this.getTicketWorkFlowDetail(this.ticketId)
79
+ },
80
+ methods: {
81
+ format (date, format) {
82
+ return formatDate(date, format)
83
+ },
84
+ // 图像点击切换放大缩小
85
+ changePhotoClass (item) {
86
+ this.$emit('imageClick', item)
87
+ },
88
+ // 获取流转工单详情
89
+ getTicketWorkFlowDetail (num) {
90
+ if (this.disableCloseBtn) {
91
+ this.pendingText = ''
92
+ } else {
93
+ this.pendingText = '持续记录中...'
94
+ }
95
+ this.loading = true
96
+ return post(TicketDetailsViewApi.getTicketWorkFlowDetails, {
97
+ ticketId: num
98
+ }).then(res => {
99
+ this.workFLowDetails = res
100
+ // 解析workFLowDetails数据
101
+ this.workFLowList = []
102
+ const len = this.workFLowDetails.length
103
+ for (let i = 0; i < len; i++) {
104
+ if (this.workFLowDetails[i].note === undefined) {
105
+ this.workFLowDetails[i].note = ''
106
+ }
107
+ if (this.workFLowDetails[i].images === undefined) {
108
+ this.workFLowDetails[i].images = []
109
+ }
110
+ this.workFLowList.push({
111
+ name: this.workFLowDetails[i].name,
112
+ created_time: this.workFLowDetails[i].created_time,
113
+ end_time: this.workFLowDetails[i].end_time,
114
+ note: this.workFLowDetails[i].note,
115
+ images: this.workFLowDetails[i].images
116
+ })
117
+ for (let j = 0; j < this.workFLowDetails[i].images.length; j++) {
118
+ this.workFLowDetails[i].images[j].isLarge = false
119
+ }
120
+ }
121
+ this.workFLowList = this.workFLowList.reverse()
122
+ this.loading = false
123
+ })
124
+ },
125
+ toggleAdvanced () {
126
+ this.advanced = !this.advanced
127
+ }
128
+ },
129
+ watch: {
130
+ 'ticketId' () {
131
+ this.getTicketWorkFlowDetail(this.ticketId)
132
+ },
133
+ 'disableCloseBtn' () {
134
+ this.getTicketWorkFlowDetail(this.ticketId)
135
+ },
136
+ 'id' () {
137
+ this.getTicketWorkFlowDetail(this.ticketId)
138
+ }
139
+ }
140
+ }
141
+ </script>
142
+
143
+ <style lang="less" scoped>
144
+ .card_view {
145
+ width: 70%;
146
+ min-width: 700px;
147
+ }
148
+
149
+ .card_view_mobile {
150
+ width: 100%;
151
+ }
152
+
153
+ .card_details_title {
154
+ margin: 4px 0;
155
+ font-size: 14px;
156
+ }
157
+
158
+ .card_details_value {
159
+ font-size: 16px;
160
+ font-weight: bold;
161
+ color: #444;
162
+ margin-bottom: 0;
163
+ overflow: hidden;
164
+ text-overflow:ellipsis;
165
+ white-space: nowrap;
166
+ }
167
+
168
+ .card_guid {
169
+ width: 25%;
170
+ text-align:left;
171
+ }
172
+
173
+ .card_guid_mobile {
174
+ width: 50%;
175
+ text-align:left;
176
+ }
177
+
178
+ .detail-layout {
179
+ margin-left: 44px;
180
+ }
181
+ .text {
182
+ color: rgba(0, 0, 0, .45);
183
+ }
184
+
185
+ .heading {
186
+ color: rgba(0, 0, 0, .85);
187
+ font-size: 20px;
188
+ }
189
+
190
+ .no-data {
191
+ color: rgba(0, 0, 0, .25);
192
+ text-align: center;
193
+ line-height: 64px;
194
+ font-size: 16px;
195
+
196
+ i {
197
+ font-size: 24px;
198
+ margin-right: 16px;
199
+ position: relative;
200
+ top: 3px;
201
+ }
202
+ }
203
+
204
+ .mobile {
205
+ .detail-layout {
206
+ margin-left: unset;
207
+ }
208
+ .text {
209
+
210
+ }
211
+ .status-list {
212
+ text-align: left;
213
+ }
214
+ }
215
+
216
+ .img_sm {
217
+ border: rgba(84, 84, 84, 0.2) solid 1.5px;
218
+ border-radius: 5px;
219
+ padding: 10px;
220
+ width: 160px;
221
+ height: 120px;
222
+ }
223
+ .img_xl {
224
+ position: absolute;
225
+ top:0;bottom:0;left:0;right:0;
226
+ margin: auto;
227
+ width: 100%;
228
+ max-width: 1000px;
229
+ cursor: zoom-out;
230
+ z-index: 9999;
231
+ animation: imgZoomIn 0.4s;
232
+ -webkit-animation: imgZoomIn 0.4s;
233
+ }
234
+ @keyframes imgZoomIn
235
+ {
236
+ from {width: 160px;}
237
+ to {width: 100%;}
238
+ }
239
+ .img_sm:hover {
240
+ opacity: 0.6;
241
+ cursor: zoom-in;
242
+ }
243
+ .img_sm_dark{
244
+ filter: grayscale(100%);
245
+ opacity: 0.6;
246
+ border: rgba(84, 84, 84, 0.2) solid 1.5px;
247
+ border-radius: 5px;
248
+ padding: 10px;
249
+ width: 160px;
250
+ height: 120px;
251
+ }
252
+ .imgBackground {
253
+ position: absolute;
254
+ top:0;bottom:0;left:0;right:0;
255
+ width: 100%;
256
+ height: 100%;
257
+ z-index: 9998;
258
+ background-color: rgba(0,0,0,0.7);
259
+ }
260
+ </style>
@@ -1,67 +1,67 @@
1
- import { manageApi, post } from '@vue2-client/services/api'
2
-
3
- const GetAppDataService = {
4
- install (Vue) {
5
- // 给vue增添对话框显示方法
6
- Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
7
- },
8
- async load () {
9
- const params = {}
10
- // 查询燃气公司列表
11
- const orgList = []
12
- await post(manageApi.orgList, {}).then(async res => {
13
- for (let i = 0, len = res.length; i < len; i++) {
14
- orgList.push({
15
- label: res[i],
16
- value: res[i],
17
- text: res[i]
18
- })
19
- }
20
- params['orgList'] = orgList
21
- await post(manageApi.getDictionaryValue, {}).then((res) => {
22
- Object.assign(params, res)
23
- const badgeItemArray = {}
24
- for (const key of Object.keys(params)) {
25
- badgeItemArray[key] = {}
26
- for (const item of params[key]) {
27
- if (item.status) {
28
- badgeItemArray[key][item.value] = {
29
- status: item.status,
30
- text: item.text
31
- }
32
- }
33
- }
34
- }
35
- // 追加参数
36
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
37
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
38
- })
39
- })
40
- },
41
- getDictionaryList (key) {
42
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
43
- const object = JSON.parse(str)
44
- return object[key]
45
- },
46
- getParam (key, value) {
47
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
48
- const object = JSON.parse(str)
49
- const result = object[key]
50
- if (result && result.hasOwnProperty(value)) {
51
- return result[value]
52
- } else {
53
- return null
54
- }
55
- },
56
- getParams () {
57
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
58
- const object = JSON.parse(str)
59
- return object
60
- },
61
- getSingleValues () {
62
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
63
- const object = JSON.parse(str)
64
- return object
65
- }
66
- }
67
- export default GetAppDataService
1
+ import { manageApi, post } from '@vue2-client/services/api'
2
+
3
+ const GetAppDataService = {
4
+ install (Vue) {
5
+ // 给vue增添对话框显示方法
6
+ Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
7
+ },
8
+ async load () {
9
+ const params = {}
10
+ // 查询燃气公司列表
11
+ const orgList = []
12
+ await post(manageApi.orgList, {}).then(async res => {
13
+ for (let i = 0, len = res.length; i < len; i++) {
14
+ orgList.push({
15
+ label: res[i],
16
+ value: res[i],
17
+ text: res[i]
18
+ })
19
+ }
20
+ params['orgList'] = orgList
21
+ await post(manageApi.getDictionaryValue, {}).then((res) => {
22
+ Object.assign(params, res)
23
+ const badgeItemArray = {}
24
+ for (const key of Object.keys(params)) {
25
+ badgeItemArray[key] = {}
26
+ for (const item of params[key]) {
27
+ if (item.status) {
28
+ badgeItemArray[key][item.value] = {
29
+ status: item.status,
30
+ text: item.text
31
+ }
32
+ }
33
+ }
34
+ }
35
+ // 追加参数
36
+ localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
37
+ localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
38
+ })
39
+ })
40
+ },
41
+ getDictionaryList (key) {
42
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
43
+ const object = JSON.parse(str)
44
+ return object[key]
45
+ },
46
+ getParam (key, value) {
47
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
48
+ const object = JSON.parse(str)
49
+ const result = object[key]
50
+ if (result && result.hasOwnProperty(value)) {
51
+ return result[value]
52
+ } else {
53
+ return null
54
+ }
55
+ },
56
+ getParams () {
57
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
58
+ const object = JSON.parse(str)
59
+ return object
60
+ },
61
+ getSingleValues () {
62
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
63
+ const object = JSON.parse(str)
64
+ return object
65
+ }
66
+ }
67
+ export default GetAppDataService