vue2-client 1.2.65 → 1.2.66

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