vue2-client 1.2.50 → 1.2.53

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 (31) hide show
  1. package/.env +15 -14
  2. package/.eslintrc.js +82 -82
  3. package/CHANGELOG.md +139 -130
  4. package/package.json +2 -1
  5. package/src/base-client/all.js +4 -1
  6. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -0
  7. package/src/base-client/components/common/AddressSearchCombobox/index.js +3 -0
  8. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +111 -105
  9. package/src/base-client/components/common/AmapMarker/index.js +3 -3
  10. package/src/base-client/components/common/CitySelect/CitySelect.vue +244 -0
  11. package/src/base-client/components/common/CitySelect/index.js +3 -0
  12. package/src/base-client/components/common/CitySelect/index.md +109 -0
  13. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +483 -1342
  14. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +770 -555
  15. package/src/base-client/components/common/ScrollList/SrcollList.vue +113 -113
  16. package/src/base-client/components/common/ScrollList/index.js +3 -3
  17. package/src/base-client/components/common/Upload/Upload.vue +124 -124
  18. package/src/base-client/components/common/Upload/index.js +3 -3
  19. package/src/base-client/components/common/XAddForm/XAddForm.vue +331 -339
  20. package/src/base-client/components/common/XForm/XForm.vue +268 -275
  21. package/src/base-client/components/common/XForm/XFormItem.vue +348 -285
  22. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +205 -205
  23. package/src/base-client/plugins/AppData.js +72 -57
  24. package/src/config/CreateQueryConfig.js +298 -80
  25. package/src/pages/resourceManage/orgListManage.vue +40 -40
  26. package/src/services/api/manage.js +16 -14
  27. package/src/services/api/restTools.js +24 -24
  28. package/src/utils/map-utils.js +28 -28
  29. package/src/utils/request.js +198 -198
  30. package/src/utils/util.js +222 -176
  31. package/vue.config.js +143 -143
@@ -1,219 +1,219 @@
1
1
  <template>
2
2
  <a-page-header title="物联网运行维护">
3
- <div>
4
- <a-row :gutter="24">
5
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
6
- <x-card :loadState="instructSumLoadState" :retry="loadInstructSumCount">
7
- <chart-card title="总指令数" :total="instructSum | NumberFormat">
8
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadInstructSumCount()">
9
- <a-icon type="redo" />
10
- </a-tooltip>
11
- <a-tooltip title="生成的所有指令总数" slot="action">
12
- <a-icon type="info-circle-o" />
13
- </a-tooltip>
14
- <div>
15
- <trend :flag="instructYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
16
- <span slot="term">同周比</span>
17
- {{ instructYoW + '%' }}
18
- </trend>
19
- <trend :flag="instructYoD >= 0 ? 'up' : 'down'">
20
- <span slot="term">日同比</span>
21
- {{ instructYoD + '%' }}
22
- </trend>
23
- </div>
24
- <template slot="footer">昨日新增 <span>{{ instructYesAdd | NumberFormat }}</span></template>
25
- </chart-card>
26
- </x-card>
27
- </a-col>
28
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
29
- <x-card :loadState="metereadSumLoadState" :retry="loadMetereadSumCount">
30
- <chart-card title="总抄表量" :total="metereadSum | NumberFormat">
31
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadMetereadSumCount()">
32
- <a-icon type="redo" />
33
- </a-tooltip>
34
- <a-tooltip title="生成的所有抄表(meteread)总数" slot="action">
35
- <a-icon type="info-circle-o" />
36
- </a-tooltip>
37
- <div>
38
- <mini-area :dataSource="metereadSumDataByWeek" :scale="metereadSumByWeekScale" />
39
- </div>
40
- <template slot="footer">昨日新增 <span> {{ metereadYesAdd | NumberFormat }}</span></template>
41
- </chart-card>
42
- </x-card>
43
- </a-col>
44
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
45
- <x-card :loadState="usingMeterSumLoadState" :retry="loadUsingMeterSumCount">
46
- <chart-card title="在用表具数" :total="usingMeterSum | NumberFormat">
47
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadUsingMeterSumCount()">
48
- <a-icon type="redo" />
49
- </a-tooltip>
50
- <a-tooltip title="开户成功的物联网表总数" slot="action">
51
- <a-icon type="info-circle-o" />
52
- </a-tooltip>
53
- <div>
54
- <mini-bar :dataSource="usingMeterSumDataByWeek" :scale="usingMeterSumByWeekScale" />
55
- </div>
56
- <template slot="footer">昨日新增 <span>{{ usingMeterYesAdd | NumberFormat }}</span></template>
57
- </chart-card>
58
- </x-card>
59
- </a-col>
60
- <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
61
- <x-card :loadState="instructRateOfSuccessLoadState" :retry="loadInstructRateOfSuccess">
62
- <chart-card title="指令下发成功率" :total="instructRateOfSuccessValue + '%'">
63
- <a-tooltip title="刷新" slot="action" :style="{ marginRight: '10px' }" @click="loadInstructRateOfSuccess()">
64
- <a-icon type="redo" />
65
- </a-tooltip>
66
- <a-tooltip title="执行成功和已发送状态的指令占所有指令的比例" slot="action">
67
- <a-icon type="info-circle-o" />
68
- </a-tooltip>
69
- <div>
70
- <mini-progress :color="instructRateOfColor" :target="90" :percentage="instructRateOfSuccessValue" height="8px" />
71
- </div>
72
- <template slot="footer">
73
- <trend :flag="instructRateOfSuccessYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
74
- <span slot="term">同周比</span>
75
- {{ instructRateOfSuccessYoW + '%' }}
76
- </trend>
77
- <trend :flag="instructRateOfSuccessYoD >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
78
- <span slot="term">日同比</span>
79
- {{ instructRateOfSuccessYoD + '%' }}
80
- </trend>
81
- <span slot="term">昨日成功率</span>
82
- {{ yesterdayInstructRateOf + '%' }}
83
- </template>
84
- </chart-card>
85
- </x-card>
86
- </a-col>
87
- </a-row>
3
+ <div>
4
+ <a-row :gutter="24">
5
+ <a-col :md="12" :sm="24" :style="{ marginBottom: '24px' }" :xl="6">
6
+ <x-card :loadState="instructSumLoadState" :retry="loadInstructSumCount">
7
+ <chart-card :total="instructSum | NumberFormat" title="总指令数">
8
+ <a-tooltip slot="action" :style="{ marginRight: '10px' }" title="刷新" @click="loadInstructSumCount()">
9
+ <a-icon type="redo" />
10
+ </a-tooltip>
11
+ <a-tooltip slot="action" title="生成的所有指令总数">
12
+ <a-icon type="info-circle-o" />
13
+ </a-tooltip>
14
+ <div>
15
+ <trend :flag="instructYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
16
+ <span slot="term">同周比</span>
17
+ {{ instructYoW + '%' }}
18
+ </trend>
19
+ <trend :flag="instructYoD >= 0 ? 'up' : 'down'">
20
+ <span slot="term">日同比</span>
21
+ {{ instructYoD + '%' }}
22
+ </trend>
23
+ </div>
24
+ <template slot="footer">昨日新增 <span>{{ instructYesAdd | NumberFormat }}</span></template>
25
+ </chart-card>
26
+ </x-card>
27
+ </a-col>
28
+ <a-col :md="12" :sm="24" :style="{ marginBottom: '24px' }" :xl="6">
29
+ <x-card :loadState="metereadSumLoadState" :retry="loadMetereadSumCount">
30
+ <chart-card :total="metereadSum | NumberFormat" title="总抄表量">
31
+ <a-tooltip slot="action" :style="{ marginRight: '10px' }" title="刷新" @click="loadMetereadSumCount()">
32
+ <a-icon type="redo" />
33
+ </a-tooltip>
34
+ <a-tooltip slot="action" title="生成的所有抄表(meteread)总数">
35
+ <a-icon type="info-circle-o" />
36
+ </a-tooltip>
37
+ <div>
38
+ <mini-area :dataSource="metereadSumDataByWeek" :scale="metereadSumByWeekScale" />
39
+ </div>
40
+ <template slot="footer">昨日新增 <span> {{ metereadYesAdd | NumberFormat }}</span></template>
41
+ </chart-card>
42
+ </x-card>
43
+ </a-col>
44
+ <a-col :md="12" :sm="24" :style="{ marginBottom: '24px' }" :xl="6">
45
+ <x-card :loadState="usingMeterSumLoadState" :retry="loadUsingMeterSumCount">
46
+ <chart-card :total="usingMeterSum | NumberFormat" title="在用表具数">
47
+ <a-tooltip slot="action" :style="{ marginRight: '10px' }" title="刷新" @click="loadUsingMeterSumCount()">
48
+ <a-icon type="redo" />
49
+ </a-tooltip>
50
+ <a-tooltip slot="action" title="开户成功的物联网表总数">
51
+ <a-icon type="info-circle-o" />
52
+ </a-tooltip>
53
+ <div>
54
+ <mini-bar :dataSource="usingMeterSumDataByWeek" :scale="usingMeterSumByWeekScale" />
55
+ </div>
56
+ <template slot="footer">昨日新增 <span>{{ usingMeterYesAdd | NumberFormat }}</span></template>
57
+ </chart-card>
58
+ </x-card>
59
+ </a-col>
60
+ <a-col :md="12" :sm="24" :style="{ marginBottom: '24px' }" :xl="6">
61
+ <x-card :loadState="instructRateOfSuccessLoadState" :retry="loadInstructRateOfSuccess">
62
+ <chart-card :total="instructRateOfSuccessValue + '%'" title="指令下发成功率">
63
+ <a-tooltip slot="action" :style="{ marginRight: '10px' }" title="刷新" @click="loadInstructRateOfSuccess()">
64
+ <a-icon type="redo" />
65
+ </a-tooltip>
66
+ <a-tooltip slot="action" title="执行成功和已发送状态的指令占所有指令的比例">
67
+ <a-icon type="info-circle-o" />
68
+ </a-tooltip>
69
+ <div>
70
+ <mini-progress :color="instructRateOfColor" :percentage="instructRateOfSuccessValue" :target="90" height="8px" />
71
+ </div>
72
+ <template slot="footer">
73
+ <trend :flag="instructRateOfSuccessYoW >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
74
+ <span slot="term">同周比</span>
75
+ {{ instructRateOfSuccessYoW + '%' }}
76
+ </trend>
77
+ <trend :flag="instructRateOfSuccessYoD >= 0 ? 'up' : 'down'" style="margin-right: 16px;">
78
+ <span slot="term">日同比</span>
79
+ {{ instructRateOfSuccessYoD + '%' }}
80
+ </trend>
81
+ <span slot="term">昨日成功率</span>
82
+ {{ yesterdayInstructRateOf + '%' }}
83
+ </template>
84
+ </chart-card>
85
+ </x-card>
86
+ </a-col>
87
+ </a-row>
88
88
 
89
- <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}">
90
- <div class="salesCard">
91
- <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
92
- <div class="extra-wrapper" slot="tabBarExtraContent">
93
- <div class="extra-item">
94
- <a>今日</a>
95
- <a>本周</a>
96
- <a>本月</a>
97
- <a>本年</a>
98
- </div>
99
- <a-range-picker :style="{width: '256px'}" />
89
+ <a-card :body-style="{padding: '0'}" :bordered="false" :loading="loading">
90
+ <div class="salesCard">
91
+ <a-tabs :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}" default-active-key="1" size="large">
92
+ <div slot="tabBarExtraContent" class="extra-wrapper">
93
+ <div class="extra-item">
94
+ <a>今日</a>
95
+ <a>本周</a>
96
+ <a>本月</a>
97
+ <a>本年</a>
100
98
  </div>
101
- <a-tab-pane tab="抄表情况分析" key="1">
102
- <a-row :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
103
- <x-card :loadState="radarLoadState" :retry="loadGasView">
104
- <div style="padding: 0 0 0 20px;height: 370px" id="container" />
105
- </x-card>
106
- </a-row>
107
- </a-tab-pane>
108
- <a-tab-pane tab="访问量" key="2">
109
- <a-row>
110
- <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
111
- <bar :data="barData2" title="销售额趋势" />
112
- </a-col>
113
- <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
114
- <rank-list title="门店销售排行榜" :list="rankList"/>
115
- </a-col>
116
- </a-row>
117
- </a-tab-pane>
118
- </a-tabs>
119
- </div>
120
- </a-card>
99
+ <a-range-picker :style="{width: '256px'}" />
100
+ </div>
101
+ <a-tab-pane key="1" tab="抄表情况分析">
102
+ <a-row :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
103
+ <x-card :loadState="radarLoadState" :retry="loadGasView">
104
+ <div id="container" style="padding: 0 0 0 20px;height: 370px" />
105
+ </x-card>
106
+ </a-row>
107
+ </a-tab-pane>
108
+ <a-tab-pane key="2" tab="访问量">
109
+ <a-row>
110
+ <a-col :lg="12" :md="12" :sm="24" :xl="16" :xs="24">
111
+ <bar :data="barData2" title="销售额趋势" />
112
+ </a-col>
113
+ <a-col :lg="12" :md="12" :sm="24" :xl="8" :xs="24">
114
+ <rank-list :list="rankList" title="门店销售排行榜"/>
115
+ </a-col>
116
+ </a-row>
117
+ </a-tab-pane>
118
+ </a-tabs>
119
+ </div>
120
+ </a-card>
121
121
 
122
- <div class="antd-pro-pages-dashboard-analysis-twoColLayout" :class="!isMobile && 'desktop'">
123
- <a-row :gutter="24" type="flex" :style="{ marginTop: '24px' }">
124
- <a-col :xl="12" :lg="24" :md="24" :sm="24" :xs="24">
125
- <a-card :loading="loading" :bordered="false" title="用气情况排行" :style="{ height: '100%' }">
126
- <a-dropdown :trigger="['click']" placement="bottomLeft" slot="extra">
127
- <a class="ant-dropdown-link" href="#">
128
- <a-icon type="ellipsis" />
129
- </a>
130
- <a-menu slot="overlay">
131
- <a-menu-item>
132
- <a href="javascript:">操作一</a>
133
- </a-menu-item>
134
- <a-menu-item>
135
- <a href="javascript;">操作二</a>
136
- </a-menu-item>
137
- </a-menu>
138
- </a-dropdown>
139
- <a-row :gutter="68">
140
- <a-col :xs="24" :sm="12" :style="{ marginBottom: ' 24px'}">
141
- <number-info :total="21232.1" :sub-total="17.1">
142
- <span slot="subtitle">
143
- <span>当天总用气量</span>
144
- <a-tooltip title="指标说明" slot="action">
145
- <a-icon type="info-circle-o" :style="{ marginLeft: '8px' }" />
146
- </a-tooltip>
147
- </span>
148
- </number-info>
149
- <!-- miniChart -->
150
- <div>
151
- <mini-smooth-area :style="{ height: '45px' }" :dataSource="searchUserData" :scale="searchUserScale" />
152
- </div>
153
- </a-col>
154
- <a-col :xs="24" :sm="12" :style="{ marginBottom: ' 24px'}">
155
- <number-info :total="0.7" :sub-total="0.2" status="up">
156
- <span slot="subtitle">
157
- <span>人均用气量</span>
158
- <a-tooltip title="指标说明" slot="action">
159
- <a-icon type="info-circle-o" :style="{ marginLeft: '8px' }" />
160
- </a-tooltip>
161
- </span>
162
- </number-info>
163
- <!-- miniChart -->
164
- <div>
165
- <mini-smooth-area :style="{ height: '45px' }" :dataSource="searchUserData" :scale="searchUserScale" />
166
- </div>
167
- </a-col>
168
- </a-row>
169
- <div class="ant-table-wrapper">
170
- <a-table
171
- row-key="index"
172
- size="small"
173
- :columns="searchTableColumns"
174
- :dataSource="searchData"
175
- :pagination="{ pageSize: 5 }"
176
- >
177
- <span slot="range" slot-scope="text, record">
178
- <trend :flag="record.status === 0 ? 'up' : 'down'">
179
- {{ text }}%
180
- </trend>
122
+ <div :class="!isMobile && 'desktop'" class="antd-pro-pages-dashboard-analysis-twoColLayout">
123
+ <a-row :gutter="24" :style="{ marginTop: '24px' }" type="flex">
124
+ <a-col :lg="24" :md="24" :sm="24" :xl="12" :xs="24">
125
+ <a-card :bordered="false" :loading="loading" :style="{ height: '100%' }" title="用气情况排行">
126
+ <a-dropdown slot="extra" :trigger="['click']" placement="bottomLeft">
127
+ <a class="ant-dropdown-link" href="#">
128
+ <a-icon type="ellipsis" />
129
+ </a>
130
+ <a-menu slot="overlay">
131
+ <a-menu-item>
132
+ <a href="javascript:">操作一</a>
133
+ </a-menu-item>
134
+ <a-menu-item>
135
+ <a href="javascript;">操作二</a>
136
+ </a-menu-item>
137
+ </a-menu>
138
+ </a-dropdown>
139
+ <a-row :gutter="68">
140
+ <a-col :sm="12" :style="{ marginBottom: ' 24px'}" :xs="24">
141
+ <number-info :sub-total="17.1" :total="21232.1">
142
+ <span slot="subtitle">
143
+ <span>当天总用气量</span>
144
+ <a-tooltip slot="action" title="指标说明">
145
+ <a-icon :style="{ marginLeft: '8px' }" type="info-circle-o" />
146
+ </a-tooltip>
181
147
  </span>
182
- </a-table>
183
- </div>
184
- </a-card>
185
- </a-col>
186
- <a-col :xl="12" :lg="24" :md="24" :sm="24" :xs="24">
187
- <a-card class="antd-pro-pages-dashboard-analysis-salesCard" :loading="loading" :bordered="false" title="指令类别占比" :style="{ height: '100%' }">
188
- <div slot="extra" style="height: inherit;">
189
- <div class="analysis-salesTypeRadio">
190
- <a-radio-group defaultValue="a">
191
- <a-radio-button value="a">本日</a-radio-button>
192
- <a-radio-button value="b">本周</a-radio-button>
193
- <a-radio-button value="c">本月</a-radio-button>
194
- </a-radio-group>
148
+ </number-info>
149
+ <!-- miniChart -->
150
+ <div>
151
+ <mini-smooth-area :dataSource="searchUserData" :scale="searchUserScale" :style="{ height: '45px' }" />
195
152
  </div>
196
- </div>
197
- <h4></h4>
198
- <div>
199
- <!-- style="width: calc(100% - 240px);" -->
153
+ </a-col>
154
+ <a-col :sm="12" :style="{ marginBottom: ' 24px'}" :xs="24">
155
+ <number-info :sub-total="0.2" :total="0.7" status="up">
156
+ <span slot="subtitle">
157
+ <span>人均用气量</span>
158
+ <a-tooltip slot="action" title="指标说明">
159
+ <a-icon :style="{ marginLeft: '8px' }" type="info-circle-o" />
160
+ </a-tooltip>
161
+ </span>
162
+ </number-info>
163
+ <!-- miniChart -->
200
164
  <div>
201
- <v-chart :force-fit="true" :height="405" :data="pieData" :scale="pieScale">
202
- <v-tooltip :showTitle="false" dataKey="item*percent" />
203
- <v-axis />
204
- <!-- position="right" :offsetX="-140" -->
205
- <v-legend dataKey="item"/>
206
- <v-pie position="percent" color="item" :vStyle="pieStyle" />
207
- <v-coord type="theta" :radius="0.75" :innerRadius="0.6" />
208
- </v-chart>
165
+ <mini-smooth-area :dataSource="searchUserData" :scale="searchUserScale" :style="{ height: '45px' }" />
209
166
  </div>
167
+ </a-col>
168
+ </a-row>
169
+ <div class="ant-table-wrapper">
170
+ <a-table
171
+ :columns="searchTableColumns"
172
+ :dataSource="searchData"
173
+ :pagination="{ pageSize: 5 }"
174
+ row-key="index"
175
+ size="small"
176
+ >
177
+ <span slot="range" slot-scope="text, record">
178
+ <trend :flag="record.status === 0 ? 'up' : 'down'">
179
+ {{ text }}%
180
+ </trend>
181
+ </span>
182
+ </a-table>
183
+ </div>
184
+ </a-card>
185
+ </a-col>
186
+ <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="指令类别占比">
188
+ <div slot="extra" style="height: inherit;">
189
+ <div class="analysis-salesTypeRadio">
190
+ <a-radio-group defaultValue="a">
191
+ <a-radio-button value="a">本日</a-radio-button>
192
+ <a-radio-button value="b">本周</a-radio-button>
193
+ <a-radio-button value="c">本月</a-radio-button>
194
+ </a-radio-group>
210
195
  </div>
211
- </a-card>
212
- </a-col>
213
- </a-row>
214
- </div>
196
+ </div>
197
+ <h4></h4>
198
+ <div>
199
+ <!-- style="width: calc(100% - 240px);" -->
200
+ <div>
201
+ <v-chart :data="pieData" :force-fit="true" :height="405" :scale="pieScale">
202
+ <v-tooltip :showTitle="false" dataKey="item*percent" />
203
+ <v-axis />
204
+ <!-- position="right" :offsetX="-140" -->
205
+ <v-legend dataKey="item"/>
206
+ <v-pie :vStyle="pieStyle" color="item" position="percent" />
207
+ <v-coord :innerRadius="0.6" :radius="0.75" type="theta" />
208
+ </v-chart>
209
+ </div>
210
+ </div>
211
+ </a-card>
212
+ </a-col>
213
+ </a-row>
215
214
  </div>
216
- </a-page-header>
215
+ </div>
216
+ </a-page-header>
217
217
  </template>
218
218
 
219
219
  <script>
@@ -1,57 +1,72 @@
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
- orgList: []
11
- }
12
- await post(manageApi.getDictionaryValue, {}).then((res) => {
13
- Object.assign(params, res)
14
- const badgeItemArray = {}
15
- for (const key of Object.keys(params)) {
16
- badgeItemArray[key] = {}
17
- for (const item of params[key]) {
18
- if (item.status) {
19
- badgeItemArray[key][item.value] = {
20
- status: item.status,
21
- text: item.text
22
- }
23
- }
24
- }
25
- }
26
- // 追加参数
27
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
28
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
29
- })
30
- },
31
- getDictionaryList (key) {
32
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
33
- const object = JSON.parse(str)
34
- return object[key]
35
- },
36
- getParam (key, value) {
37
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
38
- const object = JSON.parse(str)
39
- const result = object[key]
40
- if (result && result.hasOwnProperty(value)) {
41
- return result[value]
42
- } else {
43
- return null
44
- }
45
- },
46
- getParams () {
47
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
48
- const object = JSON.parse(str)
49
- return object
50
- },
51
- getSingleValues () {
52
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
53
- const object = JSON.parse(str)
54
- return object
55
- }
56
- }
57
- export default GetAppDataService
1
+ import { manageApi, post } from '@vue2-client/services/api'
2
+ import { handleTree } from '@vue2-client/utils/util'
3
+ const GetAppDataService = {
4
+ install (Vue) {
5
+ // 给vue增添对话框显示方法
6
+ Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
7
+ },
8
+ async load () {
9
+ const params = {
10
+ orgList: []
11
+ }
12
+ await post(manageApi.getDictionaryValue, {}).then((res) => {
13
+ Object.assign(params, res)
14
+ const badgeItemArray = {}
15
+ for (const key of Object.keys(params)) {
16
+ badgeItemArray[key] = {}
17
+ for (const item of params[key]) {
18
+ if (item.status) {
19
+ badgeItemArray[key][item.value] = {
20
+ status: item.status,
21
+ text: item.text
22
+ }
23
+ }
24
+ }
25
+ }
26
+ // 追加参数
27
+ localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
28
+ localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
29
+ })
30
+ // 获取省市区数据
31
+ await post(manageApi.getDivisionsOhChina, {}).then((res) => {
32
+ // 追加参数
33
+ localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
34
+ })
35
+ },
36
+ // 返回树形省市区
37
+ getDivisionsOhChinaForTree () {
38
+ const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
39
+ return handleTree(JSON.parse(str), 'code', 'parentcode')
40
+ },
41
+ // 返回列表省市区
42
+ getDivisionsOhChinaForList () {
43
+ const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
44
+ return JSON.parse(str)
45
+ },
46
+ getDictionaryList (key) {
47
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
48
+ const object = JSON.parse(str)
49
+ return object[key]
50
+ },
51
+ getParam (key, value) {
52
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
53
+ const object = JSON.parse(str)
54
+ const result = object[key]
55
+ if (result && result.hasOwnProperty(value)) {
56
+ return result[value]
57
+ } else {
58
+ return null
59
+ }
60
+ },
61
+ getParams () {
62
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
63
+ const object = JSON.parse(str)
64
+ return object
65
+ },
66
+ getSingleValues () {
67
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
68
+ const object = JSON.parse(str)
69
+ return object
70
+ }
71
+ }
72
+ export default GetAppDataService