vue2-client 1.2.51 → 1.2.52

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 (34) hide show
  1. package/.env +15 -14
  2. package/.eslintrc.js +82 -82
  3. package/CHANGELOG.md +4 -0
  4. package/package.json +1 -1
  5. package/src/base-client/all.js +64 -61
  6. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -0
  7. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +111 -107
  8. package/src/base-client/components/common/CitySelect/CitySelect.vue +244 -0
  9. package/src/base-client/components/common/CitySelect/index.js +3 -0
  10. package/src/base-client/components/common/CitySelect/index.md +109 -0
  11. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +483 -1342
  12. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +770 -555
  13. package/src/base-client/components/common/Upload/Upload.vue +124 -124
  14. package/src/base-client/components/common/Upload/index.js +3 -3
  15. package/src/base-client/components/common/XAddForm/XAddForm.vue +38 -46
  16. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +316 -316
  17. package/src/base-client/components/common/XForm/XForm.vue +268 -275
  18. package/src/base-client/components/common/XForm/XFormItem.vue +348 -285
  19. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  20. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  21. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +205 -205
  22. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  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/router/async/config.async.js +26 -26
  27. package/src/router/index.js +27 -27
  28. package/src/services/api/manage.js +16 -14
  29. package/src/services/api/restTools.js +24 -24
  30. package/src/theme/default/style.less +47 -47
  31. package/src/utils/map-utils.js +28 -29
  32. package/src/utils/request.js +198 -198
  33. package/src/utils/util.js +222 -176
  34. package/vue.config.js +2 -2
@@ -1,107 +1,111 @@
1
- <template >
2
- <div id="amap_point_rendering_map" :style="mapStyle">
3
- <div v-show="false">
4
- <div id="amap_point_rendering_template">
5
- <a-descriptions :column="1">
6
- <a-descriptions-item v-for="(des, index) in describeList" :key="index" :label="des.describe" >{{ markers[des.field] }}</a-descriptions-item>
7
- </a-descriptions>
8
- </div>
9
- </div>
10
- </div>
11
- </template>
12
- <script>
13
- import { GetGDMap } from '@vue2-client/utils/map-utils'
14
- export default {
15
- name: 'AmapPointRendering',
16
- props: {
17
- // 选中点位后需要展示的信息描述
18
- describeList: {
19
- type: Array,
20
- // eslint-disable-next-line vue/require-valid-default-prop
21
- default: () => { return [ ] } // lng:描述信息 lat:描述信息对应的值的字段名 { describe: '用户名称', field: 'name' }
22
- },
23
- // 需要渲染的点位数据
24
- markers: {
25
- type: Object,
26
- default: null // lng:经度值 lat:纬度值
27
- },
28
- // 渲染点位的图片
29
- imgurl: {
30
- type: String,
31
- default: '/image/success1.png'
32
- },
33
- mapStyle: {
34
- type: Object,
35
- default: () => {
36
- return {
37
- width: '100%',
38
- height: '85vh',
39
- border: '2px solid lightgray',
40
- 'border-radius': '5px'
41
- }
42
- }
43
- }
44
- },
45
- data () {
46
- return {
47
- map: null,
48
- geocoder: null, // 逆地理编码
49
- infoWindow: null,
50
- selectrow: {}
51
- }
52
- },
53
- created () {
54
- },
55
- async mounted () {
56
- await this.initMap()
57
- await this.initData()
58
- },
59
- methods: {
60
- async initData () {
61
- const aMap = GetGDMap()
62
- // 创建一个 Marker 实例:
63
- if (this.markers && this.markers.lng && this.markers.lat) {
64
- const that = this
65
- const marker = new (aMap).Marker({
66
- position: new (aMap).LngLat(this.markers.lng, this.markers.lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
67
- title: '北京',
68
- icon: new (aMap).Icon({
69
- size: new (aMap).Size(26, 28), // 图标大小
70
- url: this.imgurl, // 报警图标URL
71
- anchor: new (aMap).Pixel(0, 0), // 图标偏移位置
72
- }),
73
- extData: this.markers
74
- })
75
- marker.on('click', function (e) {
76
- that.infoWindow.setContent(document.getElementById('amap_point_rendering_template'))
77
- that.infoWindow.open(that.map, [e.target.getExtData().lng, e.target.getExtData().lat])
78
- })
79
- // 将创建的点标记添加到已有的地图实例:
80
- this.map.add(marker)
81
- this.map.setFitView()
82
- }
83
- },
84
- async initMap () {
85
- const aMap = GetGDMap()
86
- this.map = new (aMap).Map('amap_point_rendering_map', { // 设置地图容器id
87
- resizeEnable: true, // 是否监控地图容器尺寸变化
88
- zoom: 17, // 初始化地图层级
89
- center: [108.943784, 34.265] // 初始化地图中心点
90
- })
91
- this.geocoder = new (aMap).Geocoder({
92
- radius: 500 // 范围,默认:500
93
- })
94
- this.map.addControl(new (aMap).ToolBar()) // 初始化工具插件
95
- // 初始化窗体
96
- this.infoWindow = new (aMap).InfoWindow({
97
- anchor: 'bottom-center',
98
- isCustom: false, // 使用自定义窗体
99
- autoMove: true,
100
- content: '',
101
- showShadow: true,
102
- offset: new (aMap).Pixel(0, -25)
103
- })
104
- }
105
- }
106
- }
107
- </script>
1
+ <template >
2
+ <div id="amap_point_rendering_map" :style="mapStyle">
3
+ <div v-show="false">
4
+ <div id="amap_point_rendering_template">
5
+ <a-descriptions :column="1">
6
+ <a-descriptions-item v-for="(des, index) in describeList" :key="index" :label="des.describe" >{{ markers[des.field] }}</a-descriptions-item>
7
+ </a-descriptions>
8
+ </div>
9
+ </div>
10
+ </div>
11
+ </template>
12
+ <script>
13
+ import { GetGDMap } from '@vue2-client/utils/map-utils'
14
+ export default {
15
+ name: 'AmapPointRendering',
16
+ props: {
17
+ // 选中点位后需要展示的信息描述
18
+ describeList: {
19
+ type: Array,
20
+ // eslint-disable-next-line vue/require-valid-default-prop
21
+ default: () => { return [ ] } // lng:描述信息 lat:描述信息对应的值的字段名 { describe: '用户名称', field: 'name' }
22
+ },
23
+ // 需要渲染的点位数据
24
+ markers: {
25
+ type: Object,
26
+ default: null // lng:经度值 lat:纬度值
27
+ },
28
+ // 渲染点位的图片
29
+ imgurl: {
30
+ type: String,
31
+ default: '/image/success1.png'
32
+ },
33
+ mapStyle: {
34
+ type: Object,
35
+ default: () => {
36
+ return {
37
+ width: '100%',
38
+ height: '85vh',
39
+ border: '2px solid lightgray',
40
+ 'border-radius': '5px'
41
+ }
42
+ }
43
+ }
44
+ },
45
+ data () {
46
+ return {
47
+ map: null,
48
+ geocoder: null, // 逆地理编码
49
+ infoWindow: null,
50
+ selectrow: {}
51
+ }
52
+ },
53
+ created () {
54
+ },
55
+ mounted () {
56
+ GetGDMap().then(aMap => {
57
+ this.initMap(aMap)
58
+ this.initData(aMap)
59
+ })
60
+ },
61
+ methods: {
62
+ initMap (aMap) {
63
+ this.map = new (aMap).Map('amap_point_rendering_map', { // 设置地图容器id
64
+ resizeEnable: true, // 是否监控地图容器尺寸变化
65
+ zoom: 17, // 初始化地图层级
66
+ center: [108.943784, 34.265] // 初始化地图中心点
67
+ })
68
+ this.geocoder = new (aMap).Geocoder({
69
+ radius: 500 // 范围,默认:500
70
+ })
71
+ this.map.addControl(new (aMap).ToolBar()) // 初始化工具插件
72
+ // 初始化窗体
73
+ this.infoWindow = new (aMap).InfoWindow({
74
+ anchor: 'bottom-center',
75
+ isCustom: false, // 使用自定义窗体
76
+ autoMove: true,
77
+ content: '',
78
+ showShadow: true,
79
+ offset: new (aMap).Pixel(0, -25)
80
+ })
81
+ },
82
+ initData (aMap) {
83
+ // 创建一个 Marker 实例:
84
+ if (this.markers && this.markers.lng && this.markers.lat) {
85
+ const that = this
86
+ const marker = new (aMap).Marker({
87
+ // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
88
+ position: new (aMap).LngLat(this.markers.lng, this.markers.lat),
89
+ title: '北京',
90
+ icon: new (aMap).Icon({
91
+ // 图标大小
92
+ size: new (aMap).Size(26, 28),
93
+ // 报警图标URL
94
+ url: this.imgurl,
95
+ // 图标偏移位置
96
+ anchor: new (aMap).Pixel(0, 0),
97
+ }),
98
+ extData: this.markers
99
+ })
100
+ marker.on('click', function (e) {
101
+ that.infoWindow.setContent(document.getElementById('amap_point_rendering_template'))
102
+ that.infoWindow.open(that.map, [e.target.getExtData().lng, e.target.getExtData().lat])
103
+ })
104
+ // 将创建的点标记添加到已有的地图实例:
105
+ this.map.add(marker)
106
+ this.map.setFitView()
107
+ }
108
+ }
109
+ }
110
+ }
111
+ </script>
@@ -0,0 +1,244 @@
1
+ <template>
2
+ <div>
3
+ <a-cascader
4
+ v-if="type === 'cascader'"
5
+ :options="tagData.divisionsForTree"
6
+ :placeholder="placeholder"
7
+ style="width: 100%;"
8
+ :size="size"
9
+ />
10
+ <a-select
11
+ ref="select"
12
+ :size="size"
13
+ :value="valueView"
14
+ style="width: 100%;"
15
+ :dropdownMatchSelectWidth="false"
16
+ :dropdownStyle="dropdownStyle"
17
+ :placeholder="placeholder"
18
+ @blur="selectBlurHandle"
19
+ :getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
20
+ :style="inputStyle">
21
+ <div slot="dropdownRender" @mousedown.prevent>
22
+ <a-tabs v-model="activeKey" :size="size">
23
+ <a-tab-pane
24
+ :tab="view.key"
25
+ v-for="(view,index) in viewArr"
26
+ :key="view.key"
27
+ v-if="contexts > index"
28
+ :disabled="tagData[view.value].length === 0">
29
+
30
+ <a-checkable-tag
31
+ :style="tagStyle"
32
+ v-for="item of tagData[view.value]"
33
+ :key="item.code"
34
+ @change="tagClick(view.key,item)">
35
+ <a-tooltip
36
+ placement="top"
37
+ :mouseEnterDelay="0.5"
38
+ :title="item.name"
39
+ :getPopupContainer=" triggerNode => { return triggerNode.parentElement } "
40
+ >
41
+ {{ item.name.length > 8 ?`${item.name.slice(0, 8)}...`:item.name }}
42
+ </a-tooltip>
43
+ </a-checkable-tag>
44
+ </a-tab-pane>
45
+ </a-tabs>
46
+ </div>
47
+ </a-select>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ const viewArr = [
53
+ {
54
+ key: '省/直辖市',
55
+ value: 'divisionsForTree',
56
+ }, {
57
+ key: '市',
58
+ value: 'cityData',
59
+ }, {
60
+ key: '区',
61
+ value: 'areaData',
62
+ }, {
63
+ key: '街道',
64
+ value: 'streetData',
65
+ }
66
+ ]
67
+ export default {
68
+ name: 'CitySelect',
69
+ data () {
70
+ return {
71
+ open: false,
72
+ tagData: {
73
+ divisionsForTree: this.$appdata.getDivisionsOhChinaForTree(),
74
+ // 市
75
+ cityData: [],
76
+ // 区
77
+ areaData: [],
78
+ // 街道
79
+ streetData: [],
80
+ },
81
+ // model: {
82
+ // provinceModel: { name: '', code: '' },
83
+ // cityModel: { name: '', code: '' },
84
+ // areaModel: { name: '', code: '' },
85
+ // streetModel: { name: '', code: '' }
86
+ // },
87
+ model: [
88
+ { name: '', code: '' },
89
+ { name: '', code: '' },
90
+ { name: '', code: '' },
91
+ { name: '', code: '' }
92
+ ],
93
+ // 控制标签
94
+ activeKey: '省/直辖市',
95
+ // 遍历以渲染页面
96
+ viewArr,
97
+ // 框内显示值 valueView
98
+ valueView: undefined
99
+ }
100
+ },
101
+ mounted () {
102
+
103
+ },
104
+ model: {
105
+ prop: 'value',
106
+ event: 'onChange'
107
+ },
108
+ computed: {},
109
+ props: {
110
+ // 页面渲染内容 默认 省市区街道 四个 所以是4
111
+ contexts: {
112
+ type: Number,
113
+ default: 3
114
+ },
115
+ placeholder: {
116
+ type: String,
117
+ default: '请选择省市区'
118
+ },
119
+ // small lage 输入框大小
120
+ size: {
121
+ type: String,
122
+ default: undefined
123
+ },
124
+ // 类型 simple / undefined
125
+ // simple 就是用的 cascader 不穿就是用的 自己封装的
126
+ type: {
127
+ type: String,
128
+ default: undefined
129
+ },
130
+ // 框的样式
131
+ inputStyle: {
132
+ type: Object,
133
+ default: () => {
134
+ }
135
+ },
136
+ // 下拉框的样式
137
+ dropdownStyle: {
138
+ type: Object,
139
+ default: () => {
140
+ return {
141
+ width: '35rem',
142
+ padding: '1%'
143
+ }
144
+ }
145
+ },
146
+ // 标签的样式
147
+ tagStyle: {
148
+ type: Object,
149
+ default: () => {
150
+ return {
151
+ fontSize: '0.88rem',
152
+ width: '23%',
153
+ textAlign: 'left',
154
+ margin: '0.5%',
155
+ cursor: 'pointer'
156
+ }
157
+ }
158
+ },
159
+ // 用于v-model 绑定
160
+ value: {
161
+ type: String,
162
+ default: undefined
163
+ },
164
+ // 用于v-model 绑定 code :最后一级的code address: 所有级拼接的地址
165
+ valueType: {
166
+ type: String,
167
+ default: 'address'
168
+ }
169
+ },
170
+ watch: {},
171
+ methods: {
172
+ tagClick (e, item) {
173
+ if (e === '省/直辖市') {
174
+ // 如果是同一个标签
175
+ if (this.model[0].name !== item.name) {
176
+ this.tagData.cityData = item.children
177
+ this.tagData.areaData = []
178
+ this.tagData.streetData = []
179
+ this.model[0].name = item.name
180
+ this.model[0].code = item.code
181
+ this.model[1] = { name: '', code: '' }
182
+ this.model[2] = { name: '', code: '' }
183
+ this.model[3] = { name: '', code: '' }
184
+ }
185
+ if (this.contexts !== 1) {
186
+ this.activeKey = '市'
187
+ }
188
+ this.getResultText(1)
189
+ } else if (e === '市') {
190
+ if (this.model[1].name !== item.name) {
191
+ this.tagData.areaData = item.children
192
+ this.tagData.streetData = []
193
+ this.model[1].name = item.name
194
+ this.model[1].code = item.code
195
+ this.model[2] = { name: '', code: '' }
196
+ this.model[3] = { name: '', code: '' }
197
+ }
198
+ if (this.contexts !== 2) {
199
+ this.activeKey = '区'
200
+ }
201
+ this.getResultText(2)
202
+ } else if (e === '区') {
203
+ if (this.model[2].name !== item.name) {
204
+ this.tagData.streetData = item.children
205
+ this.model[2].name = item.name
206
+ this.model[2].code = item.code
207
+ this.model[3] = { name: '', code: '' }
208
+ }
209
+ if (this.contexts !== 3) {
210
+ this.activeKey = '街道'
211
+ }
212
+ this.getResultText(3)
213
+ } else if (e === '街道') {
214
+ if (this.model[3].name !== item.name) {
215
+ this.model[3].name = item.name
216
+ this.model[3].code = item.code
217
+ }
218
+ this.getResultText(4)
219
+ }
220
+ },
221
+ getResultText (tag) {
222
+ const address = []
223
+ let code = ''
224
+ for (let i = 0; i < this.contexts; i++) {
225
+ if (this.model[i].name && this.model[i].name !== '') {
226
+ address.push(this.model[i].name)
227
+ }
228
+ code = this.model[i].code ?? ''
229
+ }
230
+ this.valueView = this.valueType === 'address' ? address.join('/') : code
231
+ if (tag === this.contexts) {
232
+ this.$refs.select.blur()
233
+ this.$emit('onChange', this.valueType === 'address' ? address.join('') : code)
234
+ }
235
+ },
236
+ // 失去焦点回调
237
+ selectBlurHandle () {
238
+ if (!this.model[this.contexts - 1].code || this.model[this.contexts - 1].code === '') {
239
+ this.valueView = undefined
240
+ }
241
+ }
242
+ }
243
+ }
244
+ </script>
@@ -0,0 +1,3 @@
1
+ import CitySelect from './CitySelect'
2
+
3
+ export default CitySelect
@@ -0,0 +1,109 @@
1
+ # 省市区修改组件
2
+
3
+ > 下拉框数据从库里查询 divisions_of_china 表
4
+ > 省市区数据存储格式
5
+
6
+ +---------+-----+------------+--------+--------+----------+
7
+ |code |name |provinceCode|cityCode|areaCode|parentCode|
8
+ +---------+-----+------------+--------+--------+----------+
9
+ |11 |北京市 |NULL |NULL |NULL |NULL |
10
+ |1101 |市辖区 |11 |NULL |NULL |11 |
11
+ |110101 |东城区 |11 |1101 |NULL |1101 |
12
+ |110101001|东华门街道|11 |1101 |110101 |1101 |
13
+ |110101002|景山街道 |11 |1101 |110101 |1101 |
14
+ +---------+-----+------------+--------+--------+----------+
15
+
16
+
17
+ 查询出来之后转成tree 作为数据 (截取了一段数据)
18
+
19
+ ```json
20
+ [
21
+ {
22
+ "code": "11",
23
+ "name": "北京",
24
+ "label": "北京",
25
+ "value": "北京",
26
+ "children":
27
+ [
28
+ {
29
+ "code": "1101",
30
+ "parentcode": "11",
31
+ "name": "辖区",
32
+ "label": "辖区",
33
+ "value": "辖区",
34
+ "children":
35
+ [
36
+ {
37
+ "code": "110101",
38
+ "parentcode": "1101",
39
+ "name": "东城区",
40
+ "label": "东城区",
41
+ "value": "东城区"
42
+ }
43
+ ]}]}]
44
+ ```
45
+
46
+ 可传递参数
47
+ ```js
48
+ props = {
49
+ // 页面渲染内容 默认 省市区街道 四个 所以是4
50
+ contexts: {
51
+ type: Number,
52
+ default: 3
53
+ },
54
+ placeholder: {
55
+ type: String,
56
+ default: '请选择省市区'
57
+ },
58
+ // small lage 输入框大小
59
+ size: {
60
+ type: String,
61
+ default: undefined
62
+ },
63
+ // 类型 simple / undefined
64
+ // simple 就是用的 cascader 不穿就是用的 自己封装的
65
+ type: {
66
+ type: String,
67
+ default: undefined
68
+ },
69
+ // 框的样式
70
+ inputStyle: {
71
+ type: Object,
72
+ default: () => {
73
+ }
74
+ },
75
+ // 下拉框的样式
76
+ dropdownStyle: {
77
+ type: Object,
78
+ default: () => {
79
+ return {
80
+ width: '35rem',
81
+ padding: '1%'
82
+ }
83
+ }
84
+ },
85
+ // 标签的样式
86
+ tagStyle: {
87
+ type: Object,
88
+ default: () => {
89
+ return {
90
+ fontSize: '0.88rem',
91
+ width: '23%',
92
+ textAlign: 'left',
93
+ margin: '0.5%',
94
+ cursor: 'pointer'
95
+ }
96
+ }
97
+ },
98
+ // 用于v-model 绑定
99
+ value: {
100
+ type: String,
101
+ default: undefined
102
+ },
103
+ // 用于v-model 绑定 code :最后一级的code address: 所有级拼接的地址
104
+ valueType: {
105
+ type: String,
106
+ default: 'address'
107
+ }
108
+ }
109
+ ```