vue2-client 1.2.72 → 1.2.75

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 (46) hide show
  1. package/.env +15 -15
  2. package/.eslintrc.js +82 -82
  3. package/CHANGELOG.md +13 -0
  4. package/package.json +46 -46
  5. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
  6. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +113 -113
  7. package/src/base-client/components/common/CitySelect/CitySelect.vue +244 -244
  8. package/src/base-client/components/common/CitySelect/index.js +3 -3
  9. package/src/base-client/components/common/CitySelect/index.md +109 -109
  10. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +539 -523
  11. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +773 -773
  12. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +310 -310
  13. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +553 -553
  14. package/src/base-client/components/common/Upload/Upload.vue +151 -151
  15. package/src/base-client/components/common/Upload/index.js +3 -3
  16. package/src/base-client/components/common/XAddForm/XAddForm.vue +345 -345
  17. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +322 -322
  18. package/src/base-client/components/common/XForm/XForm.vue +268 -268
  19. package/src/base-client/components/common/XForm/XFormItem.vue +358 -358
  20. package/src/base-client/components/common/XFormTable/XFormTable.vue +491 -491
  21. package/src/base-client/components/common/XTable/XTable.vue +269 -271
  22. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +232 -230
  23. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +623 -330
  24. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  25. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  26. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +300 -300
  27. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +647 -647
  28. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  29. package/src/base-client/plugins/AppData.js +70 -70
  30. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  31. package/src/components/Charts/ChartCard.vue +14 -0
  32. package/src/config/CreateQueryConfig.js +301 -301
  33. package/src/pages/resourceManage/orgListManage.vue +98 -98
  34. package/src/router/async/config.async.js +26 -26
  35. package/src/router/async/router.map.js +60 -60
  36. package/src/router/index.js +27 -27
  37. package/src/services/api/common.js +56 -56
  38. package/src/services/api/index.js +39 -39
  39. package/src/services/api/iot/DeviceDetailsView/DeviceDetailsCountApi.js +14 -0
  40. package/src/services/api/manage.js +16 -16
  41. package/src/services/api/restTools.js +24 -24
  42. package/src/theme/default/style.less +47 -47
  43. package/src/utils/map-utils.js +28 -28
  44. package/src/utils/request.js +198 -198
  45. package/src/utils/util.js +222 -222
  46. package/vue.config.js +153 -153
@@ -1,300 +1,300 @@
1
- <template>
2
- <div>
3
- <a-drawer
4
- :visible="visible"
5
- :width="isMobile ? screenWidth : screenWidth * 0.85"
6
- placement="right"
7
- title="设备类型详情"
8
- @close="onClose"
9
- >
10
- <create-query
11
- :to-edit-json="getColumnJson()"
12
- :visible.sync="createQueryVisible"
13
- @saveQueryParams="saveQueryParams"
14
- />
15
- <a-spin :spinning="loadDeviceTypeDetails">
16
- <a-page-header :title="details.f_name">
17
- <div class="row">
18
- <div class="content">
19
- <a-descriptions :column="isMobile ? 1 : 2" size="small">
20
- <a-descriptions-item label="设备类型状态">{{ details.f_state }}</a-descriptions-item>
21
- <a-descriptions-item label="创建人">{{ details.f_inputtor }}</a-descriptions-item>
22
- <a-descriptions-item label="创建时间">{{ details.f_input_date }}</a-descriptions-item>
23
- <a-descriptions-item label="描述">{{ details.f_describe }}</a-descriptions-item>
24
- </a-descriptions>
25
- </div>
26
- </div>
27
- <!-- actions -->
28
- <template v-slot:extra>
29
- <a-button-group style="margin-right: 4px;">
30
- <a-button :loading="loadDeviceTypeDetails" type="dashed" @click="initView">刷新</a-button>
31
- </a-button-group>
32
- <a-button-group style="margin-right: 4px;">
33
- </a-button-group>
34
- </template>
35
- <template slot="footer">
36
- <a-tabs :activeKey="tabActiveKey" :default-active-key="tabActiveKey" style="margin-bottom: 23px;" @change="handleTabChange">
37
- <template v-for="value in tabList">
38
- <a-tab-pane :key="value.key" :tab="value.tab"/>
39
- </template>
40
- </a-tabs>
41
- <div v-if="!loadDeviceTypeDetails">
42
- <div v-if="tabActiveKey === '1'">
43
- <a-button type="primary" @click="toCreateQuery">
44
- <a-icon :style="iconStyle" type="api"/>编辑设备上报数据
45
- </a-button>
46
- <a-card :bordered="true" size="small" style="margin-top: 20px;" title="设备上报数据预览">
47
- <json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :expand-depth="parseInt('100')" :value="getColumnJson()" style="overflow: auto;max-height: 440px"></json-viewer>
48
- </a-card>
49
- </div>
50
- <div v-if="tabActiveKey === '2'">
51
- <a-button type="primary" @click="toCreateQuery">
52
- <a-icon :style="iconStyle" type="api"/>编辑设备数据
53
- </a-button>
54
- <a-card :bordered="true" size="small" style="margin-top: 20px;" title="设备数据预览">
55
- <json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :expand-depth="parseInt('100')" :value="getColumnJson()" style="overflow: auto;max-height: 440px"></json-viewer>
56
- </a-card>
57
- </div>
58
- <div v-if="tabActiveKey === '3'">
59
- <x-form-table
60
- :fixed-add-form="fixedAddForm"
61
- :fixed-query-form="fixedQueryForm"
62
- queryParamsName="deviceTypeToInstructQueryParams"
63
- title="指令配置">
64
- </x-form-table>
65
- </div>
66
- </div>
67
- </template>
68
- </a-page-header>
69
- </a-spin>
70
- </a-drawer>
71
- </div>
72
- </template>
73
-
74
- <script>
75
- import JsonViewer from 'vue-json-viewer'
76
- import { mapState, mapGetters } from 'vuex'
77
- import { DeviceTypeDetailsViewApi, post } from '@vue2-client/services/api'
78
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
79
-
80
- export default {
81
- name: 'DeviceTypeDetailsView',
82
- components: {
83
- JsonViewer,
84
- XFormTable
85
- },
86
- data () {
87
- return {
88
- // 页面宽度
89
- screenWidth: document.documentElement.clientWidth,
90
- // Tab页签
91
- tabActiveKey: '1',
92
- // 图标样式
93
- iconStyle: {
94
- position: 'relative',
95
- top: '1px'
96
- },
97
- // 是否显示生成查询配置抽屉
98
- createQueryVisible: false,
99
- // 设备类型详情
100
- details: {
101
- f_name: '',
102
- f_describe: '',
103
- f_state: '',
104
- f_columns_json: '',
105
- f_input_date: '',
106
- f_inputtor: ''
107
- },
108
- fixedAddForm: {},
109
- fixedQueryForm: {},
110
- tabList: [
111
- { key: '1', tab: '抄表查询配置' },
112
- { key: '2', tab: '设备查询配置' },
113
- { key: '3', tab: '指令配置' }
114
- ],
115
- // 设备类型详情加载
116
- loadDeviceTypeDetails: false
117
- }
118
- },
119
- mounted () {
120
- this.initView()
121
- },
122
- computed: {
123
- ...mapGetters(['account/user']),
124
- ...mapState('account', { currUser: 'user' }),
125
- ...mapState('setting', ['isMobile'])
126
- },
127
- props: {
128
- typeId: {
129
- type: Number,
130
- required: true
131
- },
132
- visible: {
133
- type: Boolean,
134
- default: false
135
- }
136
- },
137
- methods: {
138
- // 初始化组件
139
- initView () {
140
- this.tabActiveKey = '1'
141
- this.fixedQueryForm['m_f_device_type_id'] = this.typeId
142
- this.fixedAddForm['m_f_device_type_id'] = this.typeId
143
- this.getDeviceType(this.typeId)
144
- },
145
- toCreateQuery () {
146
- this.createQueryVisible = true
147
- },
148
- getColumnJson () {
149
- if (this.tabActiveKey === '1') {
150
- if (this.details.f_columns_json) {
151
- return JSON.parse(this.details.f_columns_json)
152
- } else {
153
- return {}
154
- }
155
- } else {
156
- if (this.details.f_device_columns_json) {
157
- return JSON.parse(this.details.f_device_columns_json)
158
- } else {
159
- return {}
160
- }
161
- }
162
- },
163
- onClose () {
164
- this.$emit('update:visible', false)
165
- },
166
- // 通用徽标过滤器
167
- badgeFilter (key, value) {
168
- const object = this.$appdata.getParam(key)
169
- if (object.hasOwnProperty(value)) {
170
- return object[value]
171
- } else {
172
- return {
173
- 'status': 'default',
174
- 'text': '未知类型:' + value
175
- }
176
- }
177
- },
178
- // 获取设备类型详情信息
179
- getDeviceType (typeId) {
180
- this.loadDeviceTypeDetails = true
181
- return post(DeviceTypeDetailsViewApi.getDeviceTypeDetails, {
182
- id: typeId
183
- }).then(res => {
184
- this.details = res
185
- this.loadDeviceTypeDetails = false
186
- }, err => {
187
- this.loadDeviceTypeDetails = false
188
- console.error(err)
189
- })
190
- },
191
- // 存储查询配置信息
192
- saveQueryParams (source) {
193
- let params
194
- if (this.tabActiveKey === '1') {
195
- params = {
196
- id: this.typeId,
197
- type: 1,
198
- source: source
199
- }
200
- } else {
201
- params = {
202
- id: this.typeId,
203
- type: 2,
204
- source: source
205
- }
206
- }
207
- return post('/webmeterapi/updateDeviceTypeQueryParams', params).then(res => {
208
- this.$message.success('保存查询配置成功')
209
- this.getDeviceType(this.typeId)
210
- }, err => {
211
- console.error(err)
212
- })
213
- },
214
- // Tab切换
215
- handleTabChange (key) {
216
- this.tabActiveKey = key
217
- }
218
- },
219
- watch: {
220
- 'visible' (val) {
221
- if (val) {
222
- this.initView()
223
- }
224
- }
225
- }
226
- }
227
- </script>
228
-
229
- <style lang="less" scoped>
230
- .business {
231
- color: #ffffff;
232
- }
233
- .business:enabled:hover {
234
- background-color: #85CE61 !important;
235
- border-color: #85CE61 !important;
236
- }
237
- .business:enabled {
238
- background-color: #67c23a;
239
- border-color: #67c23a;
240
- }
241
- .business:disabled {
242
- color: rgba(0, 0, 0, 0.25);
243
- }
244
- .detail-layout {
245
- margin-left: 44px;
246
- }
247
- .text {
248
- color: rgba(0, 0, 0, .45);
249
- }
250
-
251
- .heading {
252
- color: rgba(0, 0, 0, .85);
253
- font-size: 20px;
254
- }
255
-
256
- .no-data {
257
- color: rgba(0, 0, 0, .25);
258
- text-align: center;
259
- line-height: 64px;
260
- font-size: 16px;
261
-
262
- i {
263
- font-size: 24px;
264
- margin-right: 16px;
265
- position: relative;
266
- top: 3px;
267
- }
268
- }
269
-
270
- .mobile {
271
- .detail-layout {
272
- margin-left: unset;
273
- }
274
- .text {
275
-
276
- }
277
- .status-list {
278
- text-align: left;
279
- }
280
- }
281
-
282
- .row {
283
- display: flex;
284
-
285
- .content {
286
- -webkit-box-flex: 1;
287
- flex: auto;
288
- -ms-flex: auto;
289
- }
290
-
291
- .extra {
292
- flex: 0 1 auto;
293
- -webkit-box-flex: 0;
294
- -ms-flex: 0 1 auto;
295
- min-width: 242px;
296
- margin-left: 88px;
297
- text-align: right;
298
- }
299
- }
300
- </style>
1
+ <template>
2
+ <div>
3
+ <a-drawer
4
+ :visible="visible"
5
+ :width="isMobile ? screenWidth : screenWidth * 0.85"
6
+ placement="right"
7
+ title="设备类型详情"
8
+ @close="onClose"
9
+ >
10
+ <create-query
11
+ :to-edit-json="getColumnJson()"
12
+ :visible.sync="createQueryVisible"
13
+ @saveQueryParams="saveQueryParams"
14
+ />
15
+ <a-spin :spinning="loadDeviceTypeDetails">
16
+ <a-page-header :title="details.f_name">
17
+ <div class="row">
18
+ <div class="content">
19
+ <a-descriptions :column="isMobile ? 1 : 2" size="small">
20
+ <a-descriptions-item label="设备类型状态">{{ details.f_state }}</a-descriptions-item>
21
+ <a-descriptions-item label="创建人">{{ details.f_inputtor }}</a-descriptions-item>
22
+ <a-descriptions-item label="创建时间">{{ details.f_input_date }}</a-descriptions-item>
23
+ <a-descriptions-item label="描述">{{ details.f_describe }}</a-descriptions-item>
24
+ </a-descriptions>
25
+ </div>
26
+ </div>
27
+ <!-- actions -->
28
+ <template v-slot:extra>
29
+ <a-button-group style="margin-right: 4px;">
30
+ <a-button :loading="loadDeviceTypeDetails" type="dashed" @click="initView">刷新</a-button>
31
+ </a-button-group>
32
+ <a-button-group style="margin-right: 4px;">
33
+ </a-button-group>
34
+ </template>
35
+ <template slot="footer">
36
+ <a-tabs :activeKey="tabActiveKey" :default-active-key="tabActiveKey" style="margin-bottom: 23px;" @change="handleTabChange">
37
+ <template v-for="value in tabList">
38
+ <a-tab-pane :key="value.key" :tab="value.tab"/>
39
+ </template>
40
+ </a-tabs>
41
+ <div v-if="!loadDeviceTypeDetails">
42
+ <div v-if="tabActiveKey === '1'">
43
+ <a-button type="primary" @click="toCreateQuery">
44
+ <a-icon :style="iconStyle" type="api"/>编辑设备上报数据
45
+ </a-button>
46
+ <a-card :bordered="true" size="small" style="margin-top: 20px;" title="设备上报数据预览">
47
+ <json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :expand-depth="parseInt('100')" :value="getColumnJson()" style="overflow: auto;max-height: 440px"></json-viewer>
48
+ </a-card>
49
+ </div>
50
+ <div v-if="tabActiveKey === '2'">
51
+ <a-button type="primary" @click="toCreateQuery">
52
+ <a-icon :style="iconStyle" type="api"/>编辑设备数据
53
+ </a-button>
54
+ <a-card :bordered="true" size="small" style="margin-top: 20px;" title="设备数据预览">
55
+ <json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :expand-depth="parseInt('100')" :value="getColumnJson()" style="overflow: auto;max-height: 440px"></json-viewer>
56
+ </a-card>
57
+ </div>
58
+ <div v-if="tabActiveKey === '3'">
59
+ <x-form-table
60
+ :fixed-add-form="fixedAddForm"
61
+ :fixed-query-form="fixedQueryForm"
62
+ queryParamsName="deviceTypeToInstructQueryParams"
63
+ title="指令配置">
64
+ </x-form-table>
65
+ </div>
66
+ </div>
67
+ </template>
68
+ </a-page-header>
69
+ </a-spin>
70
+ </a-drawer>
71
+ </div>
72
+ </template>
73
+
74
+ <script>
75
+ import JsonViewer from 'vue-json-viewer'
76
+ import { mapState, mapGetters } from 'vuex'
77
+ import { DeviceTypeDetailsViewApi, post } from '@vue2-client/services/api'
78
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
79
+
80
+ export default {
81
+ name: 'DeviceTypeDetailsView',
82
+ components: {
83
+ JsonViewer,
84
+ XFormTable
85
+ },
86
+ data () {
87
+ return {
88
+ // 页面宽度
89
+ screenWidth: document.documentElement.clientWidth,
90
+ // Tab页签
91
+ tabActiveKey: '1',
92
+ // 图标样式
93
+ iconStyle: {
94
+ position: 'relative',
95
+ top: '1px'
96
+ },
97
+ // 是否显示生成查询配置抽屉
98
+ createQueryVisible: false,
99
+ // 设备类型详情
100
+ details: {
101
+ f_name: '',
102
+ f_describe: '',
103
+ f_state: '',
104
+ f_columns_json: '',
105
+ f_input_date: '',
106
+ f_inputtor: ''
107
+ },
108
+ fixedAddForm: {},
109
+ fixedQueryForm: {},
110
+ tabList: [
111
+ { key: '1', tab: '抄表查询配置' },
112
+ { key: '2', tab: '设备查询配置' },
113
+ { key: '3', tab: '指令配置' }
114
+ ],
115
+ // 设备类型详情加载
116
+ loadDeviceTypeDetails: false
117
+ }
118
+ },
119
+ mounted () {
120
+ this.initView()
121
+ },
122
+ computed: {
123
+ ...mapGetters(['account/user']),
124
+ ...mapState('account', { currUser: 'user' }),
125
+ ...mapState('setting', ['isMobile'])
126
+ },
127
+ props: {
128
+ typeId: {
129
+ type: Number,
130
+ required: true
131
+ },
132
+ visible: {
133
+ type: Boolean,
134
+ default: false
135
+ }
136
+ },
137
+ methods: {
138
+ // 初始化组件
139
+ initView () {
140
+ this.tabActiveKey = '1'
141
+ this.fixedQueryForm['m_f_device_type_id'] = this.typeId
142
+ this.fixedAddForm['m_f_device_type_id'] = this.typeId
143
+ this.getDeviceType(this.typeId)
144
+ },
145
+ toCreateQuery () {
146
+ this.createQueryVisible = true
147
+ },
148
+ getColumnJson () {
149
+ if (this.tabActiveKey === '1') {
150
+ if (this.details.f_columns_json) {
151
+ return JSON.parse(this.details.f_columns_json)
152
+ } else {
153
+ return {}
154
+ }
155
+ } else {
156
+ if (this.details.f_device_columns_json) {
157
+ return JSON.parse(this.details.f_device_columns_json)
158
+ } else {
159
+ return {}
160
+ }
161
+ }
162
+ },
163
+ onClose () {
164
+ this.$emit('update:visible', false)
165
+ },
166
+ // 通用徽标过滤器
167
+ badgeFilter (key, value) {
168
+ const object = this.$appdata.getParam(key)
169
+ if (object.hasOwnProperty(value)) {
170
+ return object[value]
171
+ } else {
172
+ return {
173
+ 'status': 'default',
174
+ 'text': '未知类型:' + value
175
+ }
176
+ }
177
+ },
178
+ // 获取设备类型详情信息
179
+ getDeviceType (typeId) {
180
+ this.loadDeviceTypeDetails = true
181
+ return post(DeviceTypeDetailsViewApi.getDeviceTypeDetails, {
182
+ id: typeId
183
+ }).then(res => {
184
+ this.details = res
185
+ this.loadDeviceTypeDetails = false
186
+ }, err => {
187
+ this.loadDeviceTypeDetails = false
188
+ console.error(err)
189
+ })
190
+ },
191
+ // 存储查询配置信息
192
+ saveQueryParams (source) {
193
+ let params
194
+ if (this.tabActiveKey === '1') {
195
+ params = {
196
+ id: this.typeId,
197
+ type: 1,
198
+ source: source
199
+ }
200
+ } else {
201
+ params = {
202
+ id: this.typeId,
203
+ type: 2,
204
+ source: source
205
+ }
206
+ }
207
+ return post('/webmeterapi/updateDeviceTypeQueryParams', params).then(res => {
208
+ this.$message.success('保存查询配置成功')
209
+ this.getDeviceType(this.typeId)
210
+ }, err => {
211
+ console.error(err)
212
+ })
213
+ },
214
+ // Tab切换
215
+ handleTabChange (key) {
216
+ this.tabActiveKey = key
217
+ }
218
+ },
219
+ watch: {
220
+ 'visible' (val) {
221
+ if (val) {
222
+ this.initView()
223
+ }
224
+ }
225
+ }
226
+ }
227
+ </script>
228
+
229
+ <style lang="less" scoped>
230
+ .business {
231
+ color: #ffffff;
232
+ }
233
+ .business:enabled:hover {
234
+ background-color: #85CE61 !important;
235
+ border-color: #85CE61 !important;
236
+ }
237
+ .business:enabled {
238
+ background-color: #67c23a;
239
+ border-color: #67c23a;
240
+ }
241
+ .business:disabled {
242
+ color: rgba(0, 0, 0, 0.25);
243
+ }
244
+ .detail-layout {
245
+ margin-left: 44px;
246
+ }
247
+ .text {
248
+ color: rgba(0, 0, 0, .45);
249
+ }
250
+
251
+ .heading {
252
+ color: rgba(0, 0, 0, .85);
253
+ font-size: 20px;
254
+ }
255
+
256
+ .no-data {
257
+ color: rgba(0, 0, 0, .25);
258
+ text-align: center;
259
+ line-height: 64px;
260
+ font-size: 16px;
261
+
262
+ i {
263
+ font-size: 24px;
264
+ margin-right: 16px;
265
+ position: relative;
266
+ top: 3px;
267
+ }
268
+ }
269
+
270
+ .mobile {
271
+ .detail-layout {
272
+ margin-left: unset;
273
+ }
274
+ .text {
275
+
276
+ }
277
+ .status-list {
278
+ text-align: left;
279
+ }
280
+ }
281
+
282
+ .row {
283
+ display: flex;
284
+
285
+ .content {
286
+ -webkit-box-flex: 1;
287
+ flex: auto;
288
+ -ms-flex: auto;
289
+ }
290
+
291
+ .extra {
292
+ flex: 0 1 auto;
293
+ -webkit-box-flex: 0;
294
+ -ms-flex: 0 1 auto;
295
+ min-width: 242px;
296
+ margin-left: 88px;
297
+ text-align: right;
298
+ }
299
+ }
300
+ </style>