vue2-client 1.2.47 → 1.2.48
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 +126 -114
- package/package.json +1 -1
- package/src/base-client/all.js +61 -61
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +104 -104
- package/src/base-client/components/common/AmapMarker/index.js +3 -3
- package/src/base-client/components/common/ScrollList/SrcollList.vue +113 -113
- package/src/base-client/components/common/ScrollList/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +339 -339
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +316 -316
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +236 -236
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/plugins/AppData.js +57 -67
- package/src/layouts/header/HeaderNotice.vue +96 -97
- package/src/router/async/config.async.js +26 -26
- package/src/router/index.js +27 -27
- package/src/theme/default/style.less +47 -47
- package/src/utils/map-utils.js +17 -17
- package/vue.config.js +143 -143
|
@@ -1,67 +1,57 @@
|
|
|
1
|
-
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
-
|
|
3
|
-
const GetAppDataService = {
|
|
4
|
-
install (Vue) {
|
|
5
|
-
// 给vue增添对话框显示方法
|
|
6
|
-
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
7
|
-
},
|
|
8
|
-
async load () {
|
|
9
|
-
const params = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
await post(manageApi.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
const str = localStorage.getItem(process.env.
|
|
48
|
-
const object = JSON.parse(str)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const object = JSON.parse(str)
|
|
59
|
-
return object
|
|
60
|
-
},
|
|
61
|
-
getSingleValues () {
|
|
62
|
-
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
63
|
-
const object = JSON.parse(str)
|
|
64
|
-
return object
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
export default GetAppDataService
|
|
1
|
+
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
+
|
|
3
|
+
const GetAppDataService = {
|
|
4
|
+
install (Vue) {
|
|
5
|
+
// 给vue增添对话框显示方法
|
|
6
|
+
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
7
|
+
},
|
|
8
|
+
async load () {
|
|
9
|
+
const params = {
|
|
10
|
+
orgList: []
|
|
11
|
+
}
|
|
12
|
+
await post(manageApi.getDictionaryValue, {}).then((res) => {
|
|
13
|
+
Object.assign(params, res)
|
|
14
|
+
const badgeItemArray = {}
|
|
15
|
+
for (const key of Object.keys(params)) {
|
|
16
|
+
badgeItemArray[key] = {}
|
|
17
|
+
for (const item of params[key]) {
|
|
18
|
+
if (item.status) {
|
|
19
|
+
badgeItemArray[key][item.value] = {
|
|
20
|
+
status: item.status,
|
|
21
|
+
text: item.text
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// 追加参数
|
|
27
|
+
localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
|
|
28
|
+
localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
getDictionaryList (key) {
|
|
32
|
+
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
33
|
+
const object = JSON.parse(str)
|
|
34
|
+
return object[key]
|
|
35
|
+
},
|
|
36
|
+
getParam (key, value) {
|
|
37
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
38
|
+
const object = JSON.parse(str)
|
|
39
|
+
const result = object[key]
|
|
40
|
+
if (result && result.hasOwnProperty(value)) {
|
|
41
|
+
return result[value]
|
|
42
|
+
} else {
|
|
43
|
+
return null
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
getParams () {
|
|
47
|
+
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
48
|
+
const object = JSON.parse(str)
|
|
49
|
+
return object
|
|
50
|
+
},
|
|
51
|
+
getSingleValues () {
|
|
52
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
53
|
+
const object = JSON.parse(str)
|
|
54
|
+
return object
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export default GetAppDataService
|
|
@@ -1,97 +1,96 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-dropdown :trigger="['click']" v-model="show">
|
|
3
|
-
<div slot="overlay">
|
|
4
|
-
<a-spin :spinning="loading">
|
|
5
|
-
<a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
|
|
6
|
-
<a-tab-pane tab="通知" key="1">
|
|
7
|
-
<a-list>
|
|
8
|
-
<a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
|
|
9
|
-
<a-list-item-meta :title="'设备号'+ item.e_f_device_id" :description="item.e_f_error_msg" @click="read(item)">
|
|
10
|
-
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
|
|
11
|
-
</a-list-item-meta>
|
|
12
|
-
</a-list-item>
|
|
13
|
-
</a-list>
|
|
14
|
-
</a-tab-pane>
|
|
15
|
-
<a-tab-pane tab="消息" key="2">
|
|
16
|
-
<a-list class="tab-pane"></a-list>
|
|
17
|
-
</a-tab-pane>
|
|
18
|
-
<a-tab-pane tab="待办" key="3">
|
|
19
|
-
<a-list class="tab-pane"></a-list>
|
|
20
|
-
</a-tab-pane>
|
|
21
|
-
</a-tabs>
|
|
22
|
-
</a-spin>
|
|
23
|
-
</div>
|
|
24
|
-
<span @click="fetchNotice" class="header-notice">
|
|
25
|
-
<a-badge class="notice-badge" :count=" exception.length">
|
|
26
|
-
<a-icon :class="['header-notice-icon']" type="bell" />
|
|
27
|
-
</a-badge>
|
|
28
|
-
</span>
|
|
29
|
-
</a-dropdown>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
import { post } from '@vue2-client/services/api'
|
|
34
|
-
export default {
|
|
35
|
-
name: 'HeaderNotice',
|
|
36
|
-
data () {
|
|
37
|
-
return {
|
|
38
|
-
loading: false,
|
|
39
|
-
show: false,
|
|
40
|
-
exception: []
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
computed: {
|
|
44
|
-
},
|
|
45
|
-
created () {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-dropdown :trigger="['click']" v-model="show">
|
|
3
|
+
<div slot="overlay">
|
|
4
|
+
<a-spin :spinning="loading">
|
|
5
|
+
<a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
|
|
6
|
+
<a-tab-pane tab="通知" key="1">
|
|
7
|
+
<a-list>
|
|
8
|
+
<a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
|
|
9
|
+
<a-list-item-meta :title="'设备号'+ item.e_f_device_id" :description="item.e_f_error_msg" @click="read(item)">
|
|
10
|
+
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
|
|
11
|
+
</a-list-item-meta>
|
|
12
|
+
</a-list-item>
|
|
13
|
+
</a-list>
|
|
14
|
+
</a-tab-pane>
|
|
15
|
+
<a-tab-pane tab="消息" key="2">
|
|
16
|
+
<a-list class="tab-pane"></a-list>
|
|
17
|
+
</a-tab-pane>
|
|
18
|
+
<a-tab-pane tab="待办" key="3">
|
|
19
|
+
<a-list class="tab-pane"></a-list>
|
|
20
|
+
</a-tab-pane>
|
|
21
|
+
</a-tabs>
|
|
22
|
+
</a-spin>
|
|
23
|
+
</div>
|
|
24
|
+
<span @click="fetchNotice" class="header-notice">
|
|
25
|
+
<a-badge class="notice-badge" :count=" exception.length">
|
|
26
|
+
<a-icon :class="['header-notice-icon']" type="bell" />
|
|
27
|
+
</a-badge>
|
|
28
|
+
</span>
|
|
29
|
+
</a-dropdown>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { post } from '@vue2-client/services/api'
|
|
34
|
+
export default {
|
|
35
|
+
name: 'HeaderNotice',
|
|
36
|
+
data () {
|
|
37
|
+
return {
|
|
38
|
+
loading: false,
|
|
39
|
+
show: false,
|
|
40
|
+
exception: []
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
},
|
|
45
|
+
created () {
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
read (item) {
|
|
49
|
+
post('/webmeterapi/saveSingleTable', { data: { tablename: 't_iot_device_exception', param: { id: item.e_id, f_is_read: 1 } } }).then(res => {
|
|
50
|
+
this.refresh()
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
refresh () {
|
|
54
|
+
post('/webmeterapi/commonQuery', { queryParamsName: 'deviceExceptionQueryParams', conditionParams: { e_f_is_read: 0 }, pageNo: 1, pageSize: 999999 }).then(res => {
|
|
55
|
+
this.exception = res.data
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
fetchNotice () {
|
|
59
|
+
if (this.loading) {
|
|
60
|
+
this.loading = false
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
this.loadding = true
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
this.loadding = false
|
|
66
|
+
}, 1000)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style lang="less">
|
|
73
|
+
.header-notice{
|
|
74
|
+
display: inline-block;
|
|
75
|
+
transition: all 0.3s;
|
|
76
|
+
span {
|
|
77
|
+
vertical-align: initial;
|
|
78
|
+
}
|
|
79
|
+
.notice-badge{
|
|
80
|
+
color: inherit;
|
|
81
|
+
.header-notice-icon{
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
padding: 4px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
.dropdown-tabs{
|
|
88
|
+
background-color: @base-bg-color;
|
|
89
|
+
box-shadow: 0 2px 8px @shadow-color;
|
|
90
|
+
border-radius: 4px;
|
|
91
|
+
.tab-pane{
|
|
92
|
+
padding: 0 24px 12px;
|
|
93
|
+
min-height: 250px;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import routerMap from './router.map'
|
|
2
|
-
import { parseRoutes } from '@vue2-client/utils/routerUtil'
|
|
3
|
-
|
|
4
|
-
// 异步路由配置
|
|
5
|
-
const routesConfig = [
|
|
6
|
-
'login',
|
|
7
|
-
'submitTicket',
|
|
8
|
-
'root',
|
|
9
|
-
{
|
|
10
|
-
router: 'exp404',
|
|
11
|
-
path: '*',
|
|
12
|
-
name: '404'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
router: 'exp403',
|
|
16
|
-
path: '/403',
|
|
17
|
-
name: '403'
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
const options = {
|
|
22
|
-
mode: 'history',
|
|
23
|
-
routes: parseRoutes(routesConfig, routerMap)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default options
|
|
1
|
+
import routerMap from './router.map'
|
|
2
|
+
import { parseRoutes } from '@vue2-client/utils/routerUtil'
|
|
3
|
+
|
|
4
|
+
// 异步路由配置
|
|
5
|
+
const routesConfig = [
|
|
6
|
+
'login',
|
|
7
|
+
'submitTicket',
|
|
8
|
+
'root',
|
|
9
|
+
{
|
|
10
|
+
router: 'exp404',
|
|
11
|
+
path: '*',
|
|
12
|
+
name: '404'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
router: 'exp403',
|
|
16
|
+
path: '/403',
|
|
17
|
+
name: '403'
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
const options = {
|
|
22
|
+
mode: 'history',
|
|
23
|
+
routes: parseRoutes(routesConfig, routerMap)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default options
|
package/src/router/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { formatRoutes } from '@vue2-client/utils/routerUtil'
|
|
2
|
-
|
|
3
|
-
// 不需要登录拦截的路由配置
|
|
4
|
-
const loginIgnore = {
|
|
5
|
-
names: ['404', '403'], // 根据路由名称匹配
|
|
6
|
-
paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
|
|
7
|
-
/**
|
|
8
|
-
* 判断路由是否包含在该配置中
|
|
9
|
-
* @param route vue-router 的 route 对象
|
|
10
|
-
* @returns {boolean}
|
|
11
|
-
*/
|
|
12
|
-
includes (route) {
|
|
13
|
-
return this.names.includes(route.name) || this.paths.includes(route.path)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 初始化路由实例
|
|
19
|
-
* @param isAsync 是否异步路由模式
|
|
20
|
-
* @returns {RouterOptions}
|
|
21
|
-
*/
|
|
22
|
-
function initRouter (isAsync) {
|
|
23
|
-
const options = require('./async/config.async').default
|
|
24
|
-
formatRoutes(options.routes)
|
|
25
|
-
return options
|
|
26
|
-
}
|
|
27
|
-
export { loginIgnore, initRouter }
|
|
1
|
+
import { formatRoutes } from '@vue2-client/utils/routerUtil'
|
|
2
|
+
|
|
3
|
+
// 不需要登录拦截的路由配置
|
|
4
|
+
const loginIgnore = {
|
|
5
|
+
names: ['404', '403'], // 根据路由名称匹配
|
|
6
|
+
paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
|
|
7
|
+
/**
|
|
8
|
+
* 判断路由是否包含在该配置中
|
|
9
|
+
* @param route vue-router 的 route 对象
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
includes (route) {
|
|
13
|
+
return this.names.includes(route.name) || this.paths.includes(route.path)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 初始化路由实例
|
|
19
|
+
* @param isAsync 是否异步路由模式
|
|
20
|
+
* @returns {RouterOptions}
|
|
21
|
+
*/
|
|
22
|
+
function initRouter (isAsync) {
|
|
23
|
+
const options = require('./async/config.async').default
|
|
24
|
+
formatRoutes(options.routes)
|
|
25
|
+
return options
|
|
26
|
+
}
|
|
27
|
+
export { loginIgnore, initRouter }
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
.week-mode{
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
filter: invert(80%);
|
|
4
|
-
}
|
|
5
|
-
.beauty-scroll{
|
|
6
|
-
scrollbar-color: @primary-color @primary-2;
|
|
7
|
-
scrollbar-width: thin;
|
|
8
|
-
-ms-overflow-style:none;
|
|
9
|
-
position: relative;
|
|
10
|
-
&::-webkit-scrollbar{
|
|
11
|
-
width: 3px;
|
|
12
|
-
height: 1px;
|
|
13
|
-
}
|
|
14
|
-
&::-webkit-scrollbar-thumb {
|
|
15
|
-
border-radius: 3px;
|
|
16
|
-
background: @primary-color;
|
|
17
|
-
}
|
|
18
|
-
&::-webkit-scrollbar-track {
|
|
19
|
-
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
|
|
20
|
-
border-radius: 3px;
|
|
21
|
-
background: @primary-3;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.split-right{
|
|
25
|
-
&:not(:last-child) {
|
|
26
|
-
border-right: 1px solid rgba(98, 98, 98, 0.2);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
.disabled{
|
|
30
|
-
cursor: not-allowed;
|
|
31
|
-
color: @disabled-color;
|
|
32
|
-
pointer-events: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
::-webkit-scrollbar{
|
|
36
|
-
width: 5px;
|
|
37
|
-
height: 5px;
|
|
38
|
-
}
|
|
39
|
-
::-webkit-scrollbar-thumb {
|
|
40
|
-
border-radius: 3px;
|
|
41
|
-
background: @primary-3;
|
|
42
|
-
}
|
|
43
|
-
::-webkit-scrollbar-track {
|
|
44
|
-
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
|
|
45
|
-
border-radius: 3px;
|
|
46
|
-
background: @primary-1;
|
|
47
|
-
}
|
|
1
|
+
.week-mode{
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
filter: invert(80%);
|
|
4
|
+
}
|
|
5
|
+
.beauty-scroll{
|
|
6
|
+
scrollbar-color: @primary-color @primary-2;
|
|
7
|
+
scrollbar-width: thin;
|
|
8
|
+
-ms-overflow-style:none;
|
|
9
|
+
position: relative;
|
|
10
|
+
&::-webkit-scrollbar{
|
|
11
|
+
width: 3px;
|
|
12
|
+
height: 1px;
|
|
13
|
+
}
|
|
14
|
+
&::-webkit-scrollbar-thumb {
|
|
15
|
+
border-radius: 3px;
|
|
16
|
+
background: @primary-color;
|
|
17
|
+
}
|
|
18
|
+
&::-webkit-scrollbar-track {
|
|
19
|
+
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
|
|
20
|
+
border-radius: 3px;
|
|
21
|
+
background: @primary-3;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.split-right{
|
|
25
|
+
&:not(:last-child) {
|
|
26
|
+
border-right: 1px solid rgba(98, 98, 98, 0.2);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
.disabled{
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
color: @disabled-color;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::-webkit-scrollbar{
|
|
36
|
+
width: 5px;
|
|
37
|
+
height: 5px;
|
|
38
|
+
}
|
|
39
|
+
::-webkit-scrollbar-thumb {
|
|
40
|
+
border-radius: 3px;
|
|
41
|
+
background: @primary-3;
|
|
42
|
+
}
|
|
43
|
+
::-webkit-scrollbar-track {
|
|
44
|
+
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
|
|
45
|
+
border-radius: 3px;
|
|
46
|
+
background: @primary-1;
|
|
47
|
+
}
|
package/src/utils/map-utils.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
//地图相关插件
|
|
2
|
-
|
|
3
|
-
// vuecomp:传入vue组件实例即可
|
|
4
|
-
export function getLocation(vuecomp,address) {
|
|
5
|
-
return new Promise((resolve,reject)=>{
|
|
6
|
-
new vuecomp.$AMap.Geocoder({
|
|
7
|
-
radius: 500 //范围,默认:500
|
|
8
|
-
}).getLocation(address, function(status, result) {
|
|
9
|
-
console.log(result)
|
|
10
|
-
if (status === 'complete'&&result.geocodes.length) {
|
|
11
|
-
resolve({lng:result.geocodes[0].location.lng,lat:result.geocodes[0].location.lat})
|
|
12
|
-
}else{
|
|
13
|
-
reject('根据经纬度查询地址失败')
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
})
|
|
17
|
-
}
|
|
1
|
+
//地图相关插件
|
|
2
|
+
|
|
3
|
+
// vuecomp:传入vue组件实例即可
|
|
4
|
+
export function getLocation(vuecomp,address) {
|
|
5
|
+
return new Promise((resolve,reject)=>{
|
|
6
|
+
new vuecomp.$AMap.Geocoder({
|
|
7
|
+
radius: 500 //范围,默认:500
|
|
8
|
+
}).getLocation(address, function(status, result) {
|
|
9
|
+
console.log(result)
|
|
10
|
+
if (status === 'complete'&&result.geocodes.length) {
|
|
11
|
+
resolve({lng:result.geocodes[0].location.lng,lat:result.geocodes[0].location.lat})
|
|
12
|
+
}else{
|
|
13
|
+
reject('根据经纬度查询地址失败')
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
}
|