vue2-client 1.8.233 → 1.8.234

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.233",
3
+ "version": "1.8.234",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,8 +1,29 @@
1
1
  <template>
2
2
  <div id="addressSearchCombobox">
3
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>
4
+ <a-input-group
5
+ style="display: flex; width: 100%;"
6
+ compact>
7
+ <a-input
8
+ v-model="addressInput"
9
+ :read-only="readOnly"
10
+ style="flex: 1; width: auto; min-width: 0;"
11
+ placeholder="请选择地址信息"/>
12
+ <a-button
13
+ v-if="attr.inputOnAfterName && attr.inputOnAfterFunc"
14
+ style="flex: 1; width: auto; min-width: 4rem;max-width: 6rem"
15
+ type="primary"
16
+ @click="emitFunc(attr.inputOnAfterFunc,addressInput)">
17
+ {{ attr.inputOnAfterName }}
18
+ </a-button>
19
+ <!-- 默认展示该图标 如果配置了按钮插槽展示 primary 央视 -->
20
+ <a-button
21
+ style="width: 2rem; flex-shrink: 0;"
22
+ :type="attr.inputOnAfterName ? 'primary' :''"
23
+ icon="environment"
24
+ @click="visible=true">
25
+ </a-button>
26
+ </a-input-group>
6
27
  </div>
7
28
  <a-modal :visible="visible" title="地址选择" @ok="selected" @cancel="visible=false" :zIndex="m_index">
8
29
  <div id="addressSearchCombobox_map">
@@ -17,15 +38,17 @@
17
38
  @search="fetchFunction"
18
39
  @select="onSelect"
19
40
  >
20
- <a-spin v-if="searching" slot="notFoundContent" size="small" />
41
+ <a-spin v-if="searching" slot="notFoundContent" size="small"/>
21
42
  <template slot="dataSource">
22
43
  <a-select-opt-group v-for="group in option" :key="group.title">
23
44
  <span
24
45
  slot="label">
25
- <a-icon type="bank" /> {{ group.title }}
46
+ <a-icon type="bank"/> {{ group.title }}
26
47
  </span>
27
48
  <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)"></span></p>
49
+ <p class="addressName">
50
+ <a-icon type="environment"/>
51
+ <span v-html="highLight(address.label, address.word)"></span></p>
29
52
  <p v-if="address.address !== '[]'" class="addressRemark">
30
53
  {{ address.address }}
31
54
  </p>
@@ -86,6 +109,16 @@ export default {
86
109
  ...mapState('setting', ['isMobile', 'gaode_key', 'gaode_secret_key'])
87
110
  },
88
111
  props: {
112
+ attr: {
113
+ type: Object,
114
+ default: () => {
115
+ }
116
+ },
117
+ emitFunc: {
118
+ type: Function,
119
+ default: () => {
120
+ }
121
+ },
89
122
  searchResult: {
90
123
  type: String,
91
124
  default: undefined
@@ -100,8 +133,14 @@ export default {
100
133
  // Object 返回格式时 可以自定义key
101
134
  resultKeys: {
102
135
  type: Object,
103
- default: () => { return { address: 'address', coords: 'coords' } }
104
- }
136
+ default: () => {
137
+ return { address: 'address', coords: 'coords' }
138
+ }
139
+ },
140
+ readOnly: {
141
+ type: Boolean,
142
+ default: false
143
+ },
105
144
  },
106
145
  created () {
107
146
  },
@@ -230,8 +269,6 @@ export default {
230
269
  dragEnable: true,
231
270
  animateEnable: false
232
271
  })
233
- console.log(aMap)
234
- console.log(window)
235
272
  this.positionPicker = new window.AMapUI.PositionPicker({
236
273
  mode: 'dragMap',
237
274
  map: this.map
@@ -252,18 +289,19 @@ export default {
252
289
  }
253
290
  </script>
254
291
  <style>
255
- .asc_descriptions .ant-descriptions-item-content{
292
+ .asc_descriptions .ant-descriptions-item-content {
256
293
  width: 80%;
257
294
  }
258
295
  </style>
259
296
  <style lang="less">
260
- #addressSearchCombobox_map{
261
- margin:1% 0;
262
- width:100%;
263
- height:400px;
264
- text-align:center
297
+ #addressSearchCombobox_map {
298
+ margin: 1% 0;
299
+ width: 100%;
300
+ height: 400px;
301
+ text-align: center
265
302
  }
266
- #addressSearchCombobox{
303
+
304
+ #addressSearchCombobox {
267
305
 
268
306
  .certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title {
269
307
  color: #666;
@@ -287,15 +325,18 @@ export default {
287
325
  .certain-category-search-dropdown .ant-select-dropdown-menu {
288
326
  max-height: 300px;
289
327
  }
328
+
290
329
  .certain-category-search-wrapper .certain-search-item-count {
291
330
  position: absolute;
292
331
  color: #999;
293
332
  right: 16px;
294
333
  }
334
+
295
335
  .certain-category-search-wrapper .certain-category-search.ant-select-focused,
296
336
  .certain-category-icon {
297
337
  color: #108ee9;
298
338
  }
339
+
299
340
  .certain-category-search-wrapper .certain-category-icon {
300
341
  color: #6e6e6e;
301
342
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
@@ -380,12 +380,21 @@
380
380
  <x-form-col
381
381
  v-else-if="attr.type === 'addressSearch'"
382
382
  :flex="attr.flex">
383
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
383
+ <a-form-model-item
384
+ :ref="attr.model"
385
+ :label="attr.name"
386
+ :prop="attr.prop ? attr.prop : attr.model"
387
+ :labelCol="layout === 'inline' && attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].labelCol:undefined"
388
+ :wrapperCol="layout === 'inline'&& attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].wrapperCol:undefined"
389
+ :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}">
384
390
  <address-search-combobox
391
+ :emitFunc="emitFunc"
392
+ :attr="attr"
393
+ :read-only="readOnly"
385
394
  v-model="searchResult"
386
395
  :resultKeys="{ address: attr.model, coords: `${attr.model}_lng_lat` }"
387
396
  searchResultType="Object"
388
- @onSelect="form=Object.assign(form,JSON.parse(searchResult))"
397
+ @onSelect="addressSearchComboboxSelect"
389
398
  ></address-search-combobox>
390
399
  </a-form-model-item>
391
400
  </x-form-col>
@@ -596,7 +605,7 @@ export default {
596
605
  xxl: 24
597
606
  }
598
607
  } else {
599
- if (this.attr.type === 'input' && this.attr.occupyCol) {
608
+ if (['input', 'addressSearch'] && this.attr.occupyCol) {
600
609
  // 如果是 input 看是否配置了 占用列配置
601
610
  this.attr.flex = {
602
611
  xs: 8 * this.attr.occupyCol,
@@ -637,6 +646,13 @@ export default {
637
646
  this.initRadioValue()
638
647
  }
639
648
  },
649
+ addressSearchComboboxSelect () {
650
+ this.form = Object.assign(this.form, JSON.parse(this.searchResult))
651
+ this.emitFunc('addressSearchComboboxSelect', {
652
+ key: this.attr.model,
653
+ value: this.searchResult
654
+ })
655
+ },
640
656
  getDataCallback (res) {
641
657
  this.option = res
642
658
  if (this.attr.type === 'treeSelect') {