vue2-client 1.6.42 → 1.6.43

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 (118) hide show
  1. package/.env +15 -15
  2. package/.eslintrc.js +82 -82
  3. package/CHANGELOG.md +3 -0
  4. package/index.js +30 -30
  5. package/package.json +1 -1
  6. package/src/assets/img/querySlotDemo.svg +15 -15
  7. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
  8. package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
  9. package/src/base-client/components/common/CitySelect/index.js +3 -3
  10. package/src/base-client/components/common/CitySelect/index.md +109 -109
  11. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
  12. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
  13. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +140 -140
  14. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  15. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  16. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +210 -210
  17. package/src/base-client/components/common/PersonSetting/index.js +3 -3
  18. package/src/base-client/components/common/Upload/Upload.vue +168 -168
  19. package/src/base-client/components/common/Upload/index.js +3 -3
  20. package/src/base-client/components/common/XAddForm/XAddForm.vue +326 -326
  21. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +279 -279
  22. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  23. package/src/base-client/components/common/XForm/XForm.vue +180 -180
  24. package/src/base-client/components/common/XForm/XFormItem.vue +500 -471
  25. package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
  26. package/src/base-client/components/common/XFormTable/XFormTable.vue +336 -336
  27. package/src/base-client/components/common/XFormTable/index.md +97 -97
  28. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
  29. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
  30. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  31. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  32. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  33. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  34. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  35. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  36. package/src/base-client/plugins/AppData.js +76 -76
  37. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  38. package/src/base-client/plugins/PagedList.js +177 -177
  39. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  40. package/src/base-client/plugins/i18n-extend.js +32 -32
  41. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  42. package/src/components/Ellipsis/index.md +38 -38
  43. package/src/components/NumberInfo/index.md +43 -43
  44. package/src/components/STable/README.md +341 -341
  45. package/src/components/STable/index.js +318 -318
  46. package/src/components/Trend/index.md +45 -45
  47. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  48. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  49. package/src/components/exception/ExceptionPage.vue +70 -70
  50. package/src/components/form/FormRow.vue +52 -52
  51. package/src/components/index.js +36 -36
  52. package/src/components/menu/SideMenu.vue +62 -62
  53. package/src/components/menu/menu.js +273 -273
  54. package/src/components/page/header/index.less +40 -40
  55. package/src/components/setting/Setting.vue +235 -235
  56. package/src/components/table/StandardTable.vue +141 -141
  57. package/src/components/table/advance/ActionColumns.vue +158 -158
  58. package/src/components/table/advance/SearchArea.vue +355 -355
  59. package/src/components/tool/AStepItem.vue +60 -60
  60. package/src/components/tool/AvatarList.vue +68 -68
  61. package/src/components/tool/Drawer.vue +142 -142
  62. package/src/components/tool/TagSelect.vue +83 -83
  63. package/src/components/transition/PageToggleTransition.vue +97 -97
  64. package/src/config/CreateQueryConfig.js +307 -307
  65. package/src/config/default/admin.config.js +18 -18
  66. package/src/config/default/setting.config.js +46 -46
  67. package/src/config/replacer/resolve.config.js +67 -67
  68. package/src/layouts/CommonLayout.vue +42 -42
  69. package/src/layouts/ComponentLayoutOne.vue +47 -47
  70. package/src/layouts/PageLayout.vue +151 -151
  71. package/src/layouts/SinglePageView.vue +116 -116
  72. package/src/layouts/footer/PageFooter.vue +49 -49
  73. package/src/layouts/header/AdminHeader.vue +134 -134
  74. package/src/layouts/header/HeaderAvatar.vue +64 -64
  75. package/src/layouts/header/HeaderNotice.vue +176 -176
  76. package/src/layouts/header/HeaderSearch.vue +67 -67
  77. package/src/layouts/header/InstitutionDetail.vue +181 -181
  78. package/src/layouts/header/index.less +92 -92
  79. package/src/layouts/tabs/TabsHead.vue +190 -190
  80. package/src/layouts/tabs/TabsView.vue +379 -379
  81. package/src/mock/goods/index.js +108 -108
  82. package/src/pages/login/Login.vue +366 -366
  83. package/src/pages/report/ReportTable.js +124 -124
  84. package/src/pages/report/ReportTableHome.vue +28 -28
  85. package/src/pages/resourceManage/orgListManage.vue +98 -98
  86. package/src/pages/system/file/index.vue +317 -317
  87. package/src/pages/system/settings/index.vue +126 -126
  88. package/src/pages/system/settings/modifyPassword.vue +109 -109
  89. package/src/router/async/config.async.js +28 -28
  90. package/src/router/async/router.map.js +68 -68
  91. package/src/router/index.js +27 -27
  92. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  93. package/src/services/api/LogDetailsViewApi.js +10 -10
  94. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  95. package/src/services/api/TicketDetailsViewApi.js +34 -34
  96. package/src/services/api/cas.js +79 -79
  97. package/src/services/api/commonTempTable.js +10 -10
  98. package/src/services/api/index.js +17 -17
  99. package/src/services/api/logininfor/index.js +6 -6
  100. package/src/services/api/manage.js +8 -8
  101. package/src/services/api/restTools.js +24 -24
  102. package/src/services/apiService.js +14 -14
  103. package/src/services/user.js +67 -67
  104. package/src/store/modules/index.js +4 -4
  105. package/src/theme/default/nprogress.less +76 -76
  106. package/src/theme/default/style.less +58 -58
  107. package/src/utils/EncryptUtil.js +53 -53
  108. package/src/utils/colors.js +107 -107
  109. package/src/utils/excel/Blob.js +180 -180
  110. package/src/utils/excel/Export2Excel.js +141 -141
  111. package/src/utils/formatter.js +68 -68
  112. package/src/utils/i18n.js +80 -80
  113. package/src/utils/map-utils.js +37 -37
  114. package/src/utils/request.js +311 -311
  115. package/src/utils/theme-color-replacer-extend.js +91 -91
  116. package/src/utils/themeUtil.js +100 -100
  117. package/src/utils/util.js +230 -230
  118. package/vue.config.js +106 -106
@@ -1,316 +1,316 @@
1
- <template>
2
- <div id="addressSearchCombobox">
3
- <div>
4
- <a-input style="width: 88%" v-model="addressInput" @change="change"/>
5
- <a-button style="width: 10%;padding: 0px" type="link" @click="visible=true"><img style="width: 100%" src="@vue2-client/assets/img/location.png"/></a-button>
6
- </div>
7
- <a-modal :visible="visible" title="地址选择" @ok="selected" @cancel="visible=false" :zIndex="m_index">
8
- <div id="addressSearchCombobox_map">
9
- <div class="certain-category-search-wrapper">
10
- <a-auto-complete
11
- style="right: 0px;width: 90%;z-index:2;margin-top:2%;"
12
- :disabled="!mapAutocomplete"
13
- class="certain-category-search"
14
- dropdown-class-name="certain-category-search-dropdown"
15
- option-label-prop="value"
16
- placeholder="输入地址关键字搜索"
17
- @search="fetchFunction"
18
- @select="onSelect"
19
- >
20
- <a-spin v-if="searching" slot="notFoundContent" size="small" />
21
- <template slot="dataSource">
22
- <a-select-opt-group v-for="group in option" :key="group.title">
23
- <span
24
- slot="label">
25
- <a-icon type="bank" /> {{ group.title }}
26
- </span>
27
- <a-select-option v-for="address in group.children" :key="address.label + ' <' + address.value + '>'">
28
- <p class="addressName"><a-icon type="environment" /> <span v-html="highLight(address.label, address.word)">{{ address.label }}</span></p>
29
- <p v-if="address.address !== '[]'" class="addressRemark">
30
- {{ address.address }}
31
- </p>
32
- </a-select-option>
33
- </a-select-opt-group>
34
- </template>
35
- <a-input>
36
- <a-icon slot="suffix" class="certain-category-icon" type="search"/>
37
- </a-input>
38
- </a-auto-complete>
39
- </div>
40
- </div>
41
- <a-descriptions
42
- bordered
43
- class="asc_descriptions"
44
- :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 1, xs: 1 }"
45
- >
46
- <a-descriptions-item label="坐标" span="2"><span>{{ addressObj.lng_lat }}</span></a-descriptions-item>
47
- <a-descriptions-item label="地址" span="2"><span>{{ addressObj.address }}</span></a-descriptions-item>
48
- </a-descriptions>
49
- </a-modal>
50
- <!-- -->
51
- </div>
52
- </template>
53
- <script>
54
-
55
- import { post } from '@vue2-client/services/api'
56
- import { GetGDMap } from '@vue2-client/utils/map-utils'
57
- import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
58
- import { mapState } from 'vuex'
59
-
60
- export default {
61
- name: 'AddressSearchCombobox',
62
- data () {
63
- // 检索去抖
64
- this.fetchFunction = debounce(this.fetchFunction, 300)
65
- return {
66
- // 地址搜索联想
67
- mapAutocomplete: undefined,
68
- // 检索结果
69
- option: [],
70
- // 最后检索版本
71
- lastFetchId: 0,
72
- // 检索中
73
- searching: false,
74
- addressObj: {
75
- lng_lat: '',
76
- address: '',
77
- },
78
- visible: false,
79
- map: null,
80
- m_index: 1002,
81
- positionPicker: null,
82
- addressInput: this.searchResult
83
- }
84
- },
85
- computed: {
86
- ...mapState('setting', ['isMobile', 'gaode_key', 'gaode_secret_key'])
87
- },
88
- props: {
89
- searchResult: {
90
- type: String,
91
- default: undefined
92
- },
93
- // 返回数据格式
94
- searchResultType: {
95
- type: String,
96
- default: 'Default'
97
- // default: 'Array'
98
- // default: 'Object'
99
- },
100
- // Object 返回格式时 可以自定义key
101
- resultKeys: {
102
- type: Object,
103
- default: () => { return { address: 'address', coords: 'coords' } }
104
- }
105
- },
106
- created () {
107
- },
108
- mounted () {
109
- },
110
- methods: {
111
- change (value) {
112
- this.$emit('update:searchResult', this.addressInput)
113
- },
114
- initMap (aMap) {
115
- this.map = new (aMap).Map('addressSearchCombobox_map', { // 设置地图容器id
116
- resizeEnable: true, // 是否监控地图容器尺寸变化
117
- zoom: 10, // 初始化地图层级
118
- })
119
- this.geocoder = new (aMap).Geocoder({
120
- radius: 500 // 范围,默认:500
121
- })
122
- this.map.addControl(new (aMap).ToolBar()) // 初始化工具插件
123
- // 初始化窗体
124
- /* this.infoWindow = new (aMap).InfoWindow({
125
- anchor: 'bottom-center',
126
- isCustom: false, // 使用自定义窗体
127
- autoMove: true,
128
- content: '',
129
- showShadow: true,
130
- offset: new (aMap).Pixel(0, -25)
131
- }) */
132
- },
133
- onSelect (value) {
134
- console.log(' value--- ', this.searchResult)
135
- const _arr = value.replace('>', '').split('<')
136
- this.addressObj.address = _arr[0]
137
- this.addressObj.lng_lat = _arr[1]
138
- this.map.setCenter(this.addressObj.lng_lat.split(','))
139
- },
140
- selected () {
141
- let result
142
- if (this.searchResultType !== 'Default') {
143
- if (this.searchResultType === 'Array') {
144
- result = [this.addressObj.address, this.addressObj.lng_lat]
145
- } else {
146
- result = {}
147
- result[this.resultKeys.address] = this.addressObj.address
148
- result[this.resultKeys.coords] = this.addressObj.lng_lat
149
- }
150
- }
151
- this.addressInput = this.addressObj.address
152
- console.log(' result--- ', result)
153
- this.visible = false
154
- this.$emit('onSelect', JSON.stringify(result))
155
- // this.$emit('onClick', result || value)
156
- },
157
- // 懒加载检索方法
158
- fetchFunction (value) {
159
- if (value && this.mapAutocomplete) {
160
- this.searching = true
161
- this.lastFetchId += 1
162
- const fetchId = this.lastFetchId
163
- this.mapAutocomplete.search(value, (status, result) => {
164
- if (fetchId !== this.lastFetchId) {
165
- return
166
- }
167
- if (status === 'complete') {
168
- this.option = []
169
- const addressMap = {}
170
- result.tips.forEach((res) => {
171
- if (res.location) {
172
- if (!addressMap.hasOwnProperty(res.district)) {
173
- addressMap[res.district] = []
174
- }
175
- addressMap[res.district].push({
176
- label: res.name,
177
- value: res.location.lng + ',' + res.location.lat,
178
- address: res.address + '',
179
- word: value
180
- })
181
- }
182
- })
183
- for (const key of Object.keys(addressMap)) {
184
- this.option.push({
185
- title: key,
186
- children: addressMap[key]
187
- })
188
- }
189
- }
190
- this.searching = false
191
- })
192
- }
193
- },
194
- // 获取数据
195
- getData (value, callback) {
196
- if (value !== '') {
197
- const logicName = this.attr.keyName
198
- const logic = logicName.substring(6)
199
- post('/api/af-system/logic/' + logic, value).then(res => {
200
- callback(res)
201
- })
202
- }
203
- },
204
- // 关键字高亮
205
- highLight (value, word) {
206
- // 如果标题中包含,关键字就替换一下
207
- if (value.includes(word)) {
208
- value = value.replace(word,
209
- // 这里是替换成html格式的数据,最好再加一个样式权重,保险一点
210
- '<span style="color:red!important;">' + word + '</span>'
211
- )
212
- return value
213
- // eslint-disable-next-line brace-style
214
- }
215
- // 不包含的话还用这个
216
- else {
217
- return value
218
- }
219
- }
220
- },
221
- watch: {
222
- 'visible' (val) {
223
- console.log('val', val)
224
- if (val) {
225
- GetGDMap(this.gaode_secret_key, this.gaode_key).then(aMap => {
226
- this.initMap(aMap)
227
- this.mapAutocomplete = new (aMap).AutoComplete({
228
- // city 限定城市,默认全国
229
- city: '全国',
230
- dragEnable: true,
231
- animateEnable: false
232
- })
233
- console.log(aMap)
234
- console.log(window)
235
- this.positionPicker = new window.AMapUI.PositionPicker({
236
- mode: 'dragMap',
237
- map: this.map
238
- })
239
- this.positionPicker.on('success', (positionResult) => {
240
- console.log(positionResult)
241
- console.log(positionResult.position)
242
- this.addressObj.address = positionResult.address
243
- this.addressObj.lng_lat = `${positionResult.position.lng},${positionResult.position.lat}`
244
- })
245
- this.positionPicker.on('fail', function (positionResult) {
246
- })
247
- this.positionPicker.start()
248
- })
249
- }
250
- }
251
- }
252
- }
253
- </script>
254
- <style>
255
- .asc_descriptions .ant-descriptions-item-content{
256
- width: 80%;
257
- }
258
- </style>
259
- <style lang="less">
260
- #addressSearchCombobox_map{
261
- margin:1% 0;
262
- width:100%;
263
- height:400px;
264
- text-align:center
265
- }
266
- #addressSearchCombobox{
267
-
268
- .certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title {
269
- color: #666;
270
- font-weight: bold;
271
- font-size: 14px;
272
- }
273
-
274
- .certain-category-search-dropdown .ant-select-dropdown-menu-item-group {
275
- border-bottom: 1px solid #f6f6f6;
276
- }
277
-
278
- .certain-category-search-dropdown .ant-select-dropdown-menu-item {
279
- padding-left: 16px;
280
- }
281
-
282
- .certain-category-search-dropdown .ant-select-dropdown-menu-item.show-all {
283
- text-align: center;
284
- cursor: default;
285
- }
286
-
287
- .certain-category-search-dropdown .ant-select-dropdown-menu {
288
- max-height: 300px;
289
- }
290
- .certain-category-search-wrapper .certain-search-item-count {
291
- position: absolute;
292
- color: #999;
293
- right: 16px;
294
- }
295
- .certain-category-search-wrapper .certain-category-search.ant-select-focused,
296
- .certain-category-icon {
297
- color: #108ee9;
298
- }
299
- .certain-category-search-wrapper .certain-category-icon {
300
- color: #6e6e6e;
301
- transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
302
- font-size: 16px;
303
- }
304
-
305
- .addressName {
306
- margin-bottom: 0;
307
- font-size: 14px;
308
- font-weight: bold;
309
- }
310
-
311
- .addressRemark {
312
- margin-bottom: 0;
313
- font-size: 12px;
314
- }
315
- }
316
- </style>
1
+ <template>
2
+ <div id="addressSearchCombobox">
3
+ <div>
4
+ <a-input style="width: 88%" v-model="addressInput" @change="change"/>
5
+ <a-button style="width: 10%;padding: 0px" type="link" @click="visible=true"><img style="width: 100%" src="@vue2-client/assets/img/location.png"/></a-button>
6
+ </div>
7
+ <a-modal :visible="visible" title="地址选择" @ok="selected" @cancel="visible=false" :zIndex="m_index">
8
+ <div id="addressSearchCombobox_map">
9
+ <div class="certain-category-search-wrapper">
10
+ <a-auto-complete
11
+ style="right: 0px;width: 90%;z-index:2;margin-top:2%;"
12
+ :disabled="!mapAutocomplete"
13
+ class="certain-category-search"
14
+ dropdown-class-name="certain-category-search-dropdown"
15
+ option-label-prop="value"
16
+ placeholder="输入地址关键字搜索"
17
+ @search="fetchFunction"
18
+ @select="onSelect"
19
+ >
20
+ <a-spin v-if="searching" slot="notFoundContent" size="small" />
21
+ <template slot="dataSource">
22
+ <a-select-opt-group v-for="group in option" :key="group.title">
23
+ <span
24
+ slot="label">
25
+ <a-icon type="bank" /> {{ group.title }}
26
+ </span>
27
+ <a-select-option v-for="address in group.children" :key="address.label + ' <' + address.value + '>'">
28
+ <p class="addressName"><a-icon type="environment" /> <span v-html="highLight(address.label, address.word)">{{ address.label }}</span></p>
29
+ <p v-if="address.address !== '[]'" class="addressRemark">
30
+ {{ address.address }}
31
+ </p>
32
+ </a-select-option>
33
+ </a-select-opt-group>
34
+ </template>
35
+ <a-input>
36
+ <a-icon slot="suffix" class="certain-category-icon" type="search"/>
37
+ </a-input>
38
+ </a-auto-complete>
39
+ </div>
40
+ </div>
41
+ <a-descriptions
42
+ bordered
43
+ class="asc_descriptions"
44
+ :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 1, xs: 1 }"
45
+ >
46
+ <a-descriptions-item label="坐标" span="2"><span>{{ addressObj.lng_lat }}</span></a-descriptions-item>
47
+ <a-descriptions-item label="地址" span="2"><span>{{ addressObj.address }}</span></a-descriptions-item>
48
+ </a-descriptions>
49
+ </a-modal>
50
+ <!-- -->
51
+ </div>
52
+ </template>
53
+ <script>
54
+
55
+ import { post } from '@vue2-client/services/api'
56
+ import { GetGDMap } from '@vue2-client/utils/map-utils'
57
+ import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
58
+ import { mapState } from 'vuex'
59
+
60
+ export default {
61
+ name: 'AddressSearchCombobox',
62
+ data () {
63
+ // 检索去抖
64
+ this.fetchFunction = debounce(this.fetchFunction, 300)
65
+ return {
66
+ // 地址搜索联想
67
+ mapAutocomplete: undefined,
68
+ // 检索结果
69
+ option: [],
70
+ // 最后检索版本
71
+ lastFetchId: 0,
72
+ // 检索中
73
+ searching: false,
74
+ addressObj: {
75
+ lng_lat: '',
76
+ address: '',
77
+ },
78
+ visible: false,
79
+ map: null,
80
+ m_index: 1002,
81
+ positionPicker: null,
82
+ addressInput: this.searchResult
83
+ }
84
+ },
85
+ computed: {
86
+ ...mapState('setting', ['isMobile', 'gaode_key', 'gaode_secret_key'])
87
+ },
88
+ props: {
89
+ searchResult: {
90
+ type: String,
91
+ default: undefined
92
+ },
93
+ // 返回数据格式
94
+ searchResultType: {
95
+ type: String,
96
+ default: 'Default'
97
+ // default: 'Array'
98
+ // default: 'Object'
99
+ },
100
+ // Object 返回格式时 可以自定义key
101
+ resultKeys: {
102
+ type: Object,
103
+ default: () => { return { address: 'address', coords: 'coords' } }
104
+ }
105
+ },
106
+ created () {
107
+ },
108
+ mounted () {
109
+ },
110
+ methods: {
111
+ change (value) {
112
+ this.$emit('update:searchResult', this.addressInput)
113
+ },
114
+ initMap (aMap) {
115
+ this.map = new (aMap).Map('addressSearchCombobox_map', { // 设置地图容器id
116
+ resizeEnable: true, // 是否监控地图容器尺寸变化
117
+ zoom: 10, // 初始化地图层级
118
+ })
119
+ this.geocoder = new (aMap).Geocoder({
120
+ radius: 500 // 范围,默认:500
121
+ })
122
+ this.map.addControl(new (aMap).ToolBar()) // 初始化工具插件
123
+ // 初始化窗体
124
+ /* this.infoWindow = new (aMap).InfoWindow({
125
+ anchor: 'bottom-center',
126
+ isCustom: false, // 使用自定义窗体
127
+ autoMove: true,
128
+ content: '',
129
+ showShadow: true,
130
+ offset: new (aMap).Pixel(0, -25)
131
+ }) */
132
+ },
133
+ onSelect (value) {
134
+ console.log(' value--- ', this.searchResult)
135
+ const _arr = value.replace('>', '').split('<')
136
+ this.addressObj.address = _arr[0]
137
+ this.addressObj.lng_lat = _arr[1]
138
+ this.map.setCenter(this.addressObj.lng_lat.split(','))
139
+ },
140
+ selected () {
141
+ let result
142
+ if (this.searchResultType !== 'Default') {
143
+ if (this.searchResultType === 'Array') {
144
+ result = [this.addressObj.address, this.addressObj.lng_lat]
145
+ } else {
146
+ result = {}
147
+ result[this.resultKeys.address] = this.addressObj.address
148
+ result[this.resultKeys.coords] = this.addressObj.lng_lat
149
+ }
150
+ }
151
+ this.addressInput = this.addressObj.address
152
+ console.log(' result--- ', result)
153
+ this.visible = false
154
+ this.$emit('onSelect', JSON.stringify(result))
155
+ // this.$emit('onClick', result || value)
156
+ },
157
+ // 懒加载检索方法
158
+ fetchFunction (value) {
159
+ if (value && this.mapAutocomplete) {
160
+ this.searching = true
161
+ this.lastFetchId += 1
162
+ const fetchId = this.lastFetchId
163
+ this.mapAutocomplete.search(value, (status, result) => {
164
+ if (fetchId !== this.lastFetchId) {
165
+ return
166
+ }
167
+ if (status === 'complete') {
168
+ this.option = []
169
+ const addressMap = {}
170
+ result.tips.forEach((res) => {
171
+ if (res.location) {
172
+ if (!addressMap.hasOwnProperty(res.district)) {
173
+ addressMap[res.district] = []
174
+ }
175
+ addressMap[res.district].push({
176
+ label: res.name,
177
+ value: res.location.lng + ',' + res.location.lat,
178
+ address: res.address + '',
179
+ word: value
180
+ })
181
+ }
182
+ })
183
+ for (const key of Object.keys(addressMap)) {
184
+ this.option.push({
185
+ title: key,
186
+ children: addressMap[key]
187
+ })
188
+ }
189
+ }
190
+ this.searching = false
191
+ })
192
+ }
193
+ },
194
+ // 获取数据
195
+ getData (value, callback) {
196
+ if (value !== '') {
197
+ const logicName = this.attr.keyName
198
+ const logic = logicName.substring(6)
199
+ post('/api/af-system/logic/' + logic, value).then(res => {
200
+ callback(res)
201
+ })
202
+ }
203
+ },
204
+ // 关键字高亮
205
+ highLight (value, word) {
206
+ // 如果标题中包含,关键字就替换一下
207
+ if (value.includes(word)) {
208
+ value = value.replace(word,
209
+ // 这里是替换成html格式的数据,最好再加一个样式权重,保险一点
210
+ '<span style="color:red!important;">' + word + '</span>'
211
+ )
212
+ return value
213
+ // eslint-disable-next-line brace-style
214
+ }
215
+ // 不包含的话还用这个
216
+ else {
217
+ return value
218
+ }
219
+ }
220
+ },
221
+ watch: {
222
+ 'visible' (val) {
223
+ console.log('val', val)
224
+ if (val) {
225
+ GetGDMap(this.gaode_secret_key, this.gaode_key).then(aMap => {
226
+ this.initMap(aMap)
227
+ this.mapAutocomplete = new (aMap).AutoComplete({
228
+ // city 限定城市,默认全国
229
+ city: '全国',
230
+ dragEnable: true,
231
+ animateEnable: false
232
+ })
233
+ console.log(aMap)
234
+ console.log(window)
235
+ this.positionPicker = new window.AMapUI.PositionPicker({
236
+ mode: 'dragMap',
237
+ map: this.map
238
+ })
239
+ this.positionPicker.on('success', (positionResult) => {
240
+ console.log(positionResult)
241
+ console.log(positionResult.position)
242
+ this.addressObj.address = positionResult.address
243
+ this.addressObj.lng_lat = `${positionResult.position.lng},${positionResult.position.lat}`
244
+ })
245
+ this.positionPicker.on('fail', function (positionResult) {
246
+ })
247
+ this.positionPicker.start()
248
+ })
249
+ }
250
+ }
251
+ }
252
+ }
253
+ </script>
254
+ <style>
255
+ .asc_descriptions .ant-descriptions-item-content{
256
+ width: 80%;
257
+ }
258
+ </style>
259
+ <style lang="less">
260
+ #addressSearchCombobox_map{
261
+ margin:1% 0;
262
+ width:100%;
263
+ height:400px;
264
+ text-align:center
265
+ }
266
+ #addressSearchCombobox{
267
+
268
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title {
269
+ color: #666;
270
+ font-weight: bold;
271
+ font-size: 14px;
272
+ }
273
+
274
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item-group {
275
+ border-bottom: 1px solid #f6f6f6;
276
+ }
277
+
278
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item {
279
+ padding-left: 16px;
280
+ }
281
+
282
+ .certain-category-search-dropdown .ant-select-dropdown-menu-item.show-all {
283
+ text-align: center;
284
+ cursor: default;
285
+ }
286
+
287
+ .certain-category-search-dropdown .ant-select-dropdown-menu {
288
+ max-height: 300px;
289
+ }
290
+ .certain-category-search-wrapper .certain-search-item-count {
291
+ position: absolute;
292
+ color: #999;
293
+ right: 16px;
294
+ }
295
+ .certain-category-search-wrapper .certain-category-search.ant-select-focused,
296
+ .certain-category-icon {
297
+ color: #108ee9;
298
+ }
299
+ .certain-category-search-wrapper .certain-category-icon {
300
+ color: #6e6e6e;
301
+ transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
302
+ font-size: 16px;
303
+ }
304
+
305
+ .addressName {
306
+ margin-bottom: 0;
307
+ font-size: 14px;
308
+ font-weight: bold;
309
+ }
310
+
311
+ .addressRemark {
312
+ margin-bottom: 0;
313
+ font-size: 12px;
314
+ }
315
+ }
316
+ </style>