vue2-client 1.6.19 → 1.6.20
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/CHANGELOG.md +4 -0
- package/index.js +30 -30
- package/package.json +1 -1
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +226 -226
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +140 -140
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/XAddForm/XAddForm.vue +326 -326
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XForm/XForm.vue +180 -180
- package/src/base-client/components/common/XFormTable/XFormTable.vue +336 -336
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +109 -109
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/FilePreview/FilePreview.vue +166 -166
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +62 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +46 -44
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +111 -111
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -104
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/mock/goods/index.js +108 -108
- package/src/pages/exception/404.vue +25 -25
- package/src/pages/login/Login.vue +363 -363
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +68 -68
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +64 -64
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +47 -47
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/request.js +311 -311
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import { initRouter } from '@vue2-client/router'
|
|
3
|
-
import { initI18n } from '@vue2-client/utils/i18n'
|
|
4
|
-
import bootstrap from '@vue2-client/bootstrap'
|
|
5
|
-
import { modules } from '@vue2-client/store'
|
|
6
|
-
import '@vue2-client/theme/index.less'
|
|
7
|
-
import '@vue2-client/utils/filter'
|
|
8
|
-
import 'animate.css/source/animate.css'
|
|
9
|
-
import 'moment/locale/zh-cn'
|
|
10
|
-
import Antd from 'ant-design-vue'
|
|
11
|
-
import Viser from 'viser-vue'
|
|
12
|
-
// 插件
|
|
13
|
-
import Plugins from '@vue2-client/base-client/plugins'
|
|
14
|
-
|
|
15
|
-
const routerOptions = initRouter()
|
|
16
|
-
const i18n = initI18n('CN', 'US')
|
|
17
|
-
|
|
18
|
-
Vue.use(Antd)
|
|
19
|
-
Vue.use(Viser)
|
|
20
|
-
Vue.use(Plugins)
|
|
21
|
-
Vue.config.productionTip = false
|
|
22
|
-
const message = Vue.prototype.$message
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
routerOptions,
|
|
26
|
-
modules,
|
|
27
|
-
i18n,
|
|
28
|
-
message,
|
|
29
|
-
bootstrap
|
|
30
|
-
}
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { initRouter } from '@vue2-client/router'
|
|
3
|
+
import { initI18n } from '@vue2-client/utils/i18n'
|
|
4
|
+
import bootstrap from '@vue2-client/bootstrap'
|
|
5
|
+
import { modules } from '@vue2-client/store'
|
|
6
|
+
import '@vue2-client/theme/index.less'
|
|
7
|
+
import '@vue2-client/utils/filter'
|
|
8
|
+
import 'animate.css/source/animate.css'
|
|
9
|
+
import 'moment/locale/zh-cn'
|
|
10
|
+
import Antd from 'ant-design-vue'
|
|
11
|
+
import Viser from 'viser-vue'
|
|
12
|
+
// 插件
|
|
13
|
+
import Plugins from '@vue2-client/base-client/plugins'
|
|
14
|
+
|
|
15
|
+
const routerOptions = initRouter()
|
|
16
|
+
const i18n = initI18n('CN', 'US')
|
|
17
|
+
|
|
18
|
+
Vue.use(Antd)
|
|
19
|
+
Vue.use(Viser)
|
|
20
|
+
Vue.use(Plugins)
|
|
21
|
+
Vue.config.productionTip = false
|
|
22
|
+
const message = Vue.prototype.$message
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
routerOptions,
|
|
26
|
+
modules,
|
|
27
|
+
i18n,
|
|
28
|
+
message,
|
|
29
|
+
bootstrap
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,226 +1,226 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="certain-category-search-wrapper">
|
|
3
|
-
<a-auto-complete
|
|
4
|
-
style="right: -12px"
|
|
5
|
-
:disabled="!mapAutocomplete"
|
|
6
|
-
:dropdown-match-select-width="false"
|
|
7
|
-
:dropdown-style="{ width: '400px' }"
|
|
8
|
-
class="certain-category-search"
|
|
9
|
-
dropdown-class-name="certain-category-search-dropdown"
|
|
10
|
-
option-label-prop="value"
|
|
11
|
-
placeholder="输入地址关键字搜索"
|
|
12
|
-
@search="fetchFunction"
|
|
13
|
-
@select="onSelect"
|
|
14
|
-
>
|
|
15
|
-
<a-spin v-if="searching" slot="notFoundContent" size="small" />
|
|
16
|
-
<template slot="dataSource">
|
|
17
|
-
<a-select-opt-group v-for="group in option" :key="group.title">
|
|
18
|
-
<span
|
|
19
|
-
slot="label">
|
|
20
|
-
<a-icon type="bank" /> {{ group.title }}
|
|
21
|
-
</span>
|
|
22
|
-
<a-select-option v-for="address in group.children" :key="address.label + ' <' + address.value + '>'">
|
|
23
|
-
<p class="addressName"><a-icon type="environment" /> <span v-html="highLight(address.label, address.word)">{{ address.label }}</span></p>
|
|
24
|
-
<p v-if="address.address !== '[]'" class="addressRemark">
|
|
25
|
-
{{ address.address }}
|
|
26
|
-
</p>
|
|
27
|
-
</a-select-option>
|
|
28
|
-
</a-select-opt-group>
|
|
29
|
-
</template>
|
|
30
|
-
<a-input>
|
|
31
|
-
<a-icon slot="suffix" class="certain-category-icon" type="search"/>
|
|
32
|
-
</a-input>
|
|
33
|
-
</a-auto-complete>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
36
|
-
<script>
|
|
37
|
-
|
|
38
|
-
import { post } from '@vue2-client/services/api'
|
|
39
|
-
import { GetGDMap } from '@vue2-client/utils/map-utils'
|
|
40
|
-
import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
name: 'AddressSearchCombobox',
|
|
44
|
-
data () {
|
|
45
|
-
// 检索去抖
|
|
46
|
-
this.fetchFunction = debounce(this.fetchFunction, 300)
|
|
47
|
-
return {
|
|
48
|
-
// 地址搜索联想
|
|
49
|
-
mapAutocomplete: undefined,
|
|
50
|
-
// 检索结果
|
|
51
|
-
option: [],
|
|
52
|
-
// 最后检索版本
|
|
53
|
-
lastFetchId: 0,
|
|
54
|
-
// 检索中
|
|
55
|
-
searching: false
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
model: {
|
|
59
|
-
prop: 'searchResult',
|
|
60
|
-
event: 'onSelect'
|
|
61
|
-
},
|
|
62
|
-
props: {
|
|
63
|
-
searchResult: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: undefined
|
|
66
|
-
},
|
|
67
|
-
// 返回数据格式
|
|
68
|
-
searchResultType: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: 'Default'
|
|
71
|
-
// default: 'Array'
|
|
72
|
-
// default: 'Object'
|
|
73
|
-
},
|
|
74
|
-
// Object 返回格式时 可以自定义key
|
|
75
|
-
resultKeys: {
|
|
76
|
-
type: Object,
|
|
77
|
-
default: () => { return { address: 'address', coords: 'coords' } }
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
created () {
|
|
81
|
-
},
|
|
82
|
-
mounted () {
|
|
83
|
-
GetGDMap().then(aMap => {
|
|
84
|
-
this.mapAutocomplete = new (aMap).Autocomplete({})
|
|
85
|
-
})
|
|
86
|
-
},
|
|
87
|
-
methods: {
|
|
88
|
-
onSelect (value) {
|
|
89
|
-
let result
|
|
90
|
-
if (this.searchResultType !== 'Default') {
|
|
91
|
-
const _arr = value.replace('>', '').split('<')
|
|
92
|
-
if (this.searchResultType === 'Array') {
|
|
93
|
-
result = _arr
|
|
94
|
-
} else {
|
|
95
|
-
result = {}
|
|
96
|
-
result[this.resultKeys.address] = _arr[0]
|
|
97
|
-
result[this.resultKeys.coords] = _arr[1]
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
this.$emit('onSelect', JSON.stringify(result) || value)
|
|
101
|
-
// this.$emit('onClick', result || value)
|
|
102
|
-
},
|
|
103
|
-
// 懒加载检索方法
|
|
104
|
-
fetchFunction (value) {
|
|
105
|
-
if (value && this.mapAutocomplete) {
|
|
106
|
-
this.searching = true
|
|
107
|
-
this.lastFetchId += 1
|
|
108
|
-
const fetchId = this.lastFetchId
|
|
109
|
-
this.mapAutocomplete.search(value, (status, result) => {
|
|
110
|
-
if (fetchId !== this.lastFetchId) {
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
if (status === 'complete') {
|
|
114
|
-
this.option = []
|
|
115
|
-
const addressMap = {}
|
|
116
|
-
result.tips.forEach((res) => {
|
|
117
|
-
if (res.location) {
|
|
118
|
-
if (!addressMap.hasOwnProperty(res.district)) {
|
|
119
|
-
addressMap[res.district] = []
|
|
120
|
-
}
|
|
121
|
-
addressMap[res.district].push({
|
|
122
|
-
label: res.name,
|
|
123
|
-
value: res.location.lng + ',' + res.location.lat,
|
|
124
|
-
address: res.address + '',
|
|
125
|
-
word: value
|
|
126
|
-
})
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
for (const key of Object.keys(addressMap)) {
|
|
130
|
-
this.option.push({
|
|
131
|
-
title: key,
|
|
132
|
-
children: addressMap[key]
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
this.searching = false
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
// 获取数据
|
|
141
|
-
getData (value, callback) {
|
|
142
|
-
if (value !== '') {
|
|
143
|
-
const logicName = this.attr.keyName
|
|
144
|
-
const logic = logicName.substring(6)
|
|
145
|
-
post('/api/af-system/logic/' + logic, value).then(res => {
|
|
146
|
-
callback(res)
|
|
147
|
-
})
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
// 关键字高亮
|
|
151
|
-
highLight (value, word) {
|
|
152
|
-
// 如果标题中包含,关键字就替换一下
|
|
153
|
-
if (value.includes(word)) {
|
|
154
|
-
value = value.replace(word,
|
|
155
|
-
// 这里是替换成html格式的数据,最好再加一个样式权重,保险一点
|
|
156
|
-
'<span style="color:red!important;">' + word + '</span>'
|
|
157
|
-
)
|
|
158
|
-
return value
|
|
159
|
-
// eslint-disable-next-line brace-style
|
|
160
|
-
}
|
|
161
|
-
// 不包含的话还用这个
|
|
162
|
-
else {
|
|
163
|
-
return value
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
</script>
|
|
169
|
-
|
|
170
|
-
<style>
|
|
171
|
-
.certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title {
|
|
172
|
-
color: #666;
|
|
173
|
-
font-weight: bold;
|
|
174
|
-
font-size: 14px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.certain-category-search-dropdown .ant-select-dropdown-menu-item-group {
|
|
178
|
-
border-bottom: 1px solid #f6f6f6;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.certain-category-search-dropdown .ant-select-dropdown-menu-item {
|
|
182
|
-
padding-left: 16px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.certain-category-search-dropdown .ant-select-dropdown-menu-item.show-all {
|
|
186
|
-
text-align: center;
|
|
187
|
-
cursor: default;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.certain-category-search-dropdown .ant-select-dropdown-menu {
|
|
191
|
-
max-height: 300px;
|
|
192
|
-
}
|
|
193
|
-
</style>
|
|
194
|
-
<style scoped>
|
|
195
|
-
.certain-category-search-wrapper,
|
|
196
|
-
>>> .certain-category-search.ant-select-auto-complete,
|
|
197
|
-
.ant-input-affix-wrapper,
|
|
198
|
-
.ant-input-suffix {
|
|
199
|
-
right: 12px;
|
|
200
|
-
}
|
|
201
|
-
.certain-category-search-wrapper >>> .certain-search-item-count {
|
|
202
|
-
position: absolute;
|
|
203
|
-
color: #999;
|
|
204
|
-
right: 16px;
|
|
205
|
-
}
|
|
206
|
-
.certain-category-search-wrapper >>> .certain-category-search.ant-select-focused,
|
|
207
|
-
.certain-category-icon {
|
|
208
|
-
color: #108ee9;
|
|
209
|
-
}
|
|
210
|
-
.certain-category-search-wrapper >>> .certain-category-icon {
|
|
211
|
-
color: #6e6e6e;
|
|
212
|
-
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
213
|
-
font-size: 16px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.addressName {
|
|
217
|
-
margin-bottom: 0;
|
|
218
|
-
font-size: 14px;
|
|
219
|
-
font-weight: bold;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.addressRemark {
|
|
223
|
-
margin-bottom: 0;
|
|
224
|
-
font-size: 12px;
|
|
225
|
-
}
|
|
226
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="certain-category-search-wrapper">
|
|
3
|
+
<a-auto-complete
|
|
4
|
+
style="right: -12px"
|
|
5
|
+
:disabled="!mapAutocomplete"
|
|
6
|
+
:dropdown-match-select-width="false"
|
|
7
|
+
:dropdown-style="{ width: '400px' }"
|
|
8
|
+
class="certain-category-search"
|
|
9
|
+
dropdown-class-name="certain-category-search-dropdown"
|
|
10
|
+
option-label-prop="value"
|
|
11
|
+
placeholder="输入地址关键字搜索"
|
|
12
|
+
@search="fetchFunction"
|
|
13
|
+
@select="onSelect"
|
|
14
|
+
>
|
|
15
|
+
<a-spin v-if="searching" slot="notFoundContent" size="small" />
|
|
16
|
+
<template slot="dataSource">
|
|
17
|
+
<a-select-opt-group v-for="group in option" :key="group.title">
|
|
18
|
+
<span
|
|
19
|
+
slot="label">
|
|
20
|
+
<a-icon type="bank" /> {{ group.title }}
|
|
21
|
+
</span>
|
|
22
|
+
<a-select-option v-for="address in group.children" :key="address.label + ' <' + address.value + '>'">
|
|
23
|
+
<p class="addressName"><a-icon type="environment" /> <span v-html="highLight(address.label, address.word)">{{ address.label }}</span></p>
|
|
24
|
+
<p v-if="address.address !== '[]'" class="addressRemark">
|
|
25
|
+
{{ address.address }}
|
|
26
|
+
</p>
|
|
27
|
+
</a-select-option>
|
|
28
|
+
</a-select-opt-group>
|
|
29
|
+
</template>
|
|
30
|
+
<a-input>
|
|
31
|
+
<a-icon slot="suffix" class="certain-category-icon" type="search"/>
|
|
32
|
+
</a-input>
|
|
33
|
+
</a-auto-complete>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
<script>
|
|
37
|
+
|
|
38
|
+
import { post } from '@vue2-client/services/api'
|
|
39
|
+
import { GetGDMap } from '@vue2-client/utils/map-utils'
|
|
40
|
+
import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'AddressSearchCombobox',
|
|
44
|
+
data () {
|
|
45
|
+
// 检索去抖
|
|
46
|
+
this.fetchFunction = debounce(this.fetchFunction, 300)
|
|
47
|
+
return {
|
|
48
|
+
// 地址搜索联想
|
|
49
|
+
mapAutocomplete: undefined,
|
|
50
|
+
// 检索结果
|
|
51
|
+
option: [],
|
|
52
|
+
// 最后检索版本
|
|
53
|
+
lastFetchId: 0,
|
|
54
|
+
// 检索中
|
|
55
|
+
searching: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
model: {
|
|
59
|
+
prop: 'searchResult',
|
|
60
|
+
event: 'onSelect'
|
|
61
|
+
},
|
|
62
|
+
props: {
|
|
63
|
+
searchResult: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: undefined
|
|
66
|
+
},
|
|
67
|
+
// 返回数据格式
|
|
68
|
+
searchResultType: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'Default'
|
|
71
|
+
// default: 'Array'
|
|
72
|
+
// default: 'Object'
|
|
73
|
+
},
|
|
74
|
+
// Object 返回格式时 可以自定义key
|
|
75
|
+
resultKeys: {
|
|
76
|
+
type: Object,
|
|
77
|
+
default: () => { return { address: 'address', coords: 'coords' } }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
created () {
|
|
81
|
+
},
|
|
82
|
+
mounted () {
|
|
83
|
+
GetGDMap().then(aMap => {
|
|
84
|
+
this.mapAutocomplete = new (aMap).Autocomplete({})
|
|
85
|
+
})
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
onSelect (value) {
|
|
89
|
+
let result
|
|
90
|
+
if (this.searchResultType !== 'Default') {
|
|
91
|
+
const _arr = value.replace('>', '').split('<')
|
|
92
|
+
if (this.searchResultType === 'Array') {
|
|
93
|
+
result = _arr
|
|
94
|
+
} else {
|
|
95
|
+
result = {}
|
|
96
|
+
result[this.resultKeys.address] = _arr[0]
|
|
97
|
+
result[this.resultKeys.coords] = _arr[1]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
this.$emit('onSelect', JSON.stringify(result) || value)
|
|
101
|
+
// this.$emit('onClick', result || value)
|
|
102
|
+
},
|
|
103
|
+
// 懒加载检索方法
|
|
104
|
+
fetchFunction (value) {
|
|
105
|
+
if (value && this.mapAutocomplete) {
|
|
106
|
+
this.searching = true
|
|
107
|
+
this.lastFetchId += 1
|
|
108
|
+
const fetchId = this.lastFetchId
|
|
109
|
+
this.mapAutocomplete.search(value, (status, result) => {
|
|
110
|
+
if (fetchId !== this.lastFetchId) {
|
|
111
|
+
return
|
|
112
|
+
}
|
|
113
|
+
if (status === 'complete') {
|
|
114
|
+
this.option = []
|
|
115
|
+
const addressMap = {}
|
|
116
|
+
result.tips.forEach((res) => {
|
|
117
|
+
if (res.location) {
|
|
118
|
+
if (!addressMap.hasOwnProperty(res.district)) {
|
|
119
|
+
addressMap[res.district] = []
|
|
120
|
+
}
|
|
121
|
+
addressMap[res.district].push({
|
|
122
|
+
label: res.name,
|
|
123
|
+
value: res.location.lng + ',' + res.location.lat,
|
|
124
|
+
address: res.address + '',
|
|
125
|
+
word: value
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
for (const key of Object.keys(addressMap)) {
|
|
130
|
+
this.option.push({
|
|
131
|
+
title: key,
|
|
132
|
+
children: addressMap[key]
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
this.searching = false
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
// 获取数据
|
|
141
|
+
getData (value, callback) {
|
|
142
|
+
if (value !== '') {
|
|
143
|
+
const logicName = this.attr.keyName
|
|
144
|
+
const logic = logicName.substring(6)
|
|
145
|
+
post('/api/af-system/logic/' + logic, value).then(res => {
|
|
146
|
+
callback(res)
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
// 关键字高亮
|
|
151
|
+
highLight (value, word) {
|
|
152
|
+
// 如果标题中包含,关键字就替换一下
|
|
153
|
+
if (value.includes(word)) {
|
|
154
|
+
value = value.replace(word,
|
|
155
|
+
// 这里是替换成html格式的数据,最好再加一个样式权重,保险一点
|
|
156
|
+
'<span style="color:red!important;">' + word + '</span>'
|
|
157
|
+
)
|
|
158
|
+
return value
|
|
159
|
+
// eslint-disable-next-line brace-style
|
|
160
|
+
}
|
|
161
|
+
// 不包含的话还用这个
|
|
162
|
+
else {
|
|
163
|
+
return value
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
<style>
|
|
171
|
+
.certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title {
|
|
172
|
+
color: #666;
|
|
173
|
+
font-weight: bold;
|
|
174
|
+
font-size: 14px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.certain-category-search-dropdown .ant-select-dropdown-menu-item-group {
|
|
178
|
+
border-bottom: 1px solid #f6f6f6;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.certain-category-search-dropdown .ant-select-dropdown-menu-item {
|
|
182
|
+
padding-left: 16px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.certain-category-search-dropdown .ant-select-dropdown-menu-item.show-all {
|
|
186
|
+
text-align: center;
|
|
187
|
+
cursor: default;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.certain-category-search-dropdown .ant-select-dropdown-menu {
|
|
191
|
+
max-height: 300px;
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
194
|
+
<style scoped>
|
|
195
|
+
.certain-category-search-wrapper,
|
|
196
|
+
>>> .certain-category-search.ant-select-auto-complete,
|
|
197
|
+
.ant-input-affix-wrapper,
|
|
198
|
+
.ant-input-suffix {
|
|
199
|
+
right: 12px;
|
|
200
|
+
}
|
|
201
|
+
.certain-category-search-wrapper >>> .certain-search-item-count {
|
|
202
|
+
position: absolute;
|
|
203
|
+
color: #999;
|
|
204
|
+
right: 16px;
|
|
205
|
+
}
|
|
206
|
+
.certain-category-search-wrapper >>> .certain-category-search.ant-select-focused,
|
|
207
|
+
.certain-category-icon {
|
|
208
|
+
color: #108ee9;
|
|
209
|
+
}
|
|
210
|
+
.certain-category-search-wrapper >>> .certain-category-icon {
|
|
211
|
+
color: #6e6e6e;
|
|
212
|
+
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
213
|
+
font-size: 16px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.addressName {
|
|
217
|
+
margin-bottom: 0;
|
|
218
|
+
font-size: 14px;
|
|
219
|
+
font-weight: bold;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.addressRemark {
|
|
223
|
+
margin-bottom: 0;
|
|
224
|
+
font-size: 12px;
|
|
225
|
+
}
|
|
226
|
+
</style>
|