vue2-client 1.8.232 → 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.232",
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);
@@ -10,16 +10,32 @@
10
10
  :wrapperCol="layout === 'inline'&& attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].wrapperCol:undefined"
11
11
  :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}"
12
12
  :prop="attr.prop ? attr.prop : attr.model">
13
- <a-input-group v-if="attr.inputOnAfterName && attr.inputOnAfterFunc" compact>
13
+ <!-- 如果配置了后置按钮插槽 -->
14
+ <a-input-group
15
+ v-if="(attr.inputOnAfterName && attr.inputOnAfterFunc) || (attr.inputOnAfterIcon && attr.inputOnAfterIconFunc)"
16
+ style="display: flex; width: 100%;"
17
+ compact>
14
18
  <a-input
15
19
  v-model="form[attr.model]"
16
20
  :read-only="readOnly"
17
21
  :disabled="disabled && !readOnly"
18
- style="width:90%"
22
+ style="flex: 1; width: auto; min-width: 0;"
19
23
  :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
20
- <a-button style="width:10%" type="primary" @click="emitFunc(attr.inputOnAfterFunc,form[attr.model])">
24
+ <a-button
25
+ v-if="attr.inputOnAfterName && attr.inputOnAfterFunc"
26
+ style="flex: 1; width: auto; min-width: 4rem;max-width: 6rem"
27
+ type="primary"
28
+ @click="emitFunc(attr.inputOnAfterFunc,form[attr.model])">
21
29
  {{ attr.inputOnAfterName }}
22
30
  </a-button>
31
+ <!-- 仅可以配置 一个按钮 以及 一个图标插槽 -->
32
+ <a-button
33
+ style="width: 2rem; flex-shrink: 0;"
34
+ v-if="attr.inputOnAfterIcon"
35
+ :type="attr.inputOnAfterIcon && attr.inputOnAfterName ? 'primary' :''"
36
+ :icon="attr.inputOnAfterIcon || 'question'"
37
+ @click="emitFunc(attr.inputOnAfterIconFunc,form[attr.model])">
38
+ </a-button>
23
39
  </a-input-group>
24
40
  <a-input
25
41
  v-else
@@ -364,12 +380,21 @@
364
380
  <x-form-col
365
381
  v-else-if="attr.type === 'addressSearch'"
366
382
  :flex="attr.flex">
367
- <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)`}:{}">
368
390
  <address-search-combobox
391
+ :emitFunc="emitFunc"
392
+ :attr="attr"
393
+ :read-only="readOnly"
369
394
  v-model="searchResult"
370
395
  :resultKeys="{ address: attr.model, coords: `${attr.model}_lng_lat` }"
371
396
  searchResultType="Object"
372
- @onSelect="form=Object.assign(form,JSON.parse(searchResult))"
397
+ @onSelect="addressSearchComboboxSelect"
373
398
  ></address-search-combobox>
374
399
  </a-form-model-item>
375
400
  </x-form-col>
@@ -580,7 +605,7 @@ export default {
580
605
  xxl: 24
581
606
  }
582
607
  } else {
583
- if (this.attr.type === 'input' && this.attr.occupyCol) {
608
+ if (['input', 'addressSearch'] && this.attr.occupyCol) {
584
609
  // 如果是 input 看是否配置了 占用列配置
585
610
  this.attr.flex = {
586
611
  xs: 8 * this.attr.occupyCol,
@@ -621,6 +646,13 @@ export default {
621
646
  this.initRadioValue()
622
647
  }
623
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
+ },
624
656
  getDataCallback (res) {
625
657
  this.option = res
626
658
  if (this.attr.type === 'treeSelect') {