af-mobile-client-vue3 1.3.88 → 1.3.90
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 +1 -1
- package/src/components/core/ImageUploader/index.vue +11 -4
- package/src/components/data/XCellList/index.vue +1 -1
- package/src/components/data/XOlMap/index.vue +190 -0
- package/src/components/data/XOlMap/types.ts +42 -0
- package/src/router/routes.ts +421 -421
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/views/component/XCellListView/index.vue +48 -21
- package/src/views/component/XFormGroupView/index.vue +82 -78
- package/src/views/component/XFormView/index.vue +42 -41
- package/src/views/component/XOlMapView/index.vue +37 -1
- package/src/views/component/XOlMapView/testData.ts +77 -0
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 根据类型获取日期区间字符串
|
|
3
|
-
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
-
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
-
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
-
*/
|
|
7
|
-
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
-
const now = new Date()
|
|
9
|
-
const year = now.getFullYear()
|
|
10
|
-
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
-
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
-
|
|
13
|
-
if (!show) {
|
|
14
|
-
if (type === 'curYear') {
|
|
15
|
-
return [
|
|
16
|
-
`${year}-01-01 00:00:00`,
|
|
17
|
-
`${year}-12-31 23:59:59`,
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
if (type === 'curMonth') {
|
|
21
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
-
return [
|
|
23
|
-
`${year}-${month}-01 00:00:00`,
|
|
24
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
if (type === 'curDay') {
|
|
28
|
-
return [
|
|
29
|
-
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
-
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (show) {
|
|
35
|
-
if (type === 'curYear') {
|
|
36
|
-
return [
|
|
37
|
-
`${year}-01-01`,
|
|
38
|
-
`${year}-12-31`,
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
if (type === 'curMonth') {
|
|
42
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
-
return [
|
|
44
|
-
`${year}-${month}-01`,
|
|
45
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
if (type === 'curDay') {
|
|
49
|
-
return [
|
|
50
|
-
`${year}-${month}-${day}`,
|
|
51
|
-
`${year}-${month}-${day}`,
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// 兜底返回空字符串数组
|
|
56
|
-
return ['', '']
|
|
57
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 根据类型获取日期区间字符串
|
|
3
|
+
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
+
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
+
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
+
*/
|
|
7
|
+
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
+
const now = new Date()
|
|
9
|
+
const year = now.getFullYear()
|
|
10
|
+
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
+
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
+
|
|
13
|
+
if (!show) {
|
|
14
|
+
if (type === 'curYear') {
|
|
15
|
+
return [
|
|
16
|
+
`${year}-01-01 00:00:00`,
|
|
17
|
+
`${year}-12-31 23:59:59`,
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
if (type === 'curMonth') {
|
|
21
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
+
return [
|
|
23
|
+
`${year}-${month}-01 00:00:00`,
|
|
24
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
if (type === 'curDay') {
|
|
28
|
+
return [
|
|
29
|
+
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
+
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (show) {
|
|
35
|
+
if (type === 'curYear') {
|
|
36
|
+
return [
|
|
37
|
+
`${year}-01-01`,
|
|
38
|
+
`${year}-12-31`,
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
if (type === 'curMonth') {
|
|
42
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
+
return [
|
|
44
|
+
`${year}-${month}-01`,
|
|
45
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
if (type === 'curDay') {
|
|
49
|
+
return [
|
|
50
|
+
`${year}-${month}-${day}`,
|
|
51
|
+
`${year}-${month}-${day}`,
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// 兜底返回空字符串数组
|
|
56
|
+
return ['', '']
|
|
57
|
+
}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
3
|
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
4
5
|
import { defineEmits, ref } from 'vue'
|
|
5
6
|
import { useRouter } from 'vue-router'
|
|
6
7
|
|
|
7
8
|
// 定义事件
|
|
8
9
|
const emit = defineEmits(['deleteRow'])
|
|
10
|
+
|
|
11
|
+
// 多选操作配置
|
|
12
|
+
const multiSelectActions = ref([
|
|
13
|
+
{ name: '批量审核', key: 'batchAudit', color: '#000000', icon: 'passed' },
|
|
14
|
+
])
|
|
15
|
+
|
|
16
|
+
const userInfo = useUserStore().getUserInfo()
|
|
9
17
|
// 访问路由
|
|
10
18
|
const router = useRouter()
|
|
11
19
|
// 获取默认值
|
|
12
|
-
|
|
20
|
+
const idKey = ref('o_id')
|
|
13
21
|
|
|
14
22
|
// 简易crud表单测试
|
|
15
|
-
const configName = ref('
|
|
16
|
-
const serviceName = ref('af-
|
|
23
|
+
const configName = ref('lngChargeAuditMobileCRUD')
|
|
24
|
+
const serviceName = ref('af-gaslink')
|
|
17
25
|
|
|
18
26
|
// 资源权限测试
|
|
19
27
|
// const configName = ref('crud_sources_test')
|
|
@@ -46,16 +54,16 @@ const serviceName = ref('af-safecheck')
|
|
|
46
54
|
// }
|
|
47
55
|
|
|
48
56
|
// 跳转到表单——以表单组来渲染纯表单
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
function toDetail(item) {
|
|
58
|
+
router.push({
|
|
59
|
+
name: 'XFormView',
|
|
60
|
+
query: {
|
|
61
|
+
id: item[idKey.value],
|
|
62
|
+
// id: item.rr_id,
|
|
63
|
+
// o_id: item.o_id,
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
}
|
|
59
67
|
|
|
60
68
|
// 新增功能
|
|
61
69
|
// function addOption(totalCount) {
|
|
@@ -84,20 +92,39 @@ const serviceName = ref('af-safecheck')
|
|
|
84
92
|
// }
|
|
85
93
|
|
|
86
94
|
// 删除功能
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
|
|
95
|
+
function deleteRow(result) {
|
|
96
|
+
emit('deleteRow', result.o_id)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// 多选操作处理
|
|
100
|
+
function handleMultiSelectAction(action: string, selectedItems: any[], selectedItemsArray: any[]) {
|
|
101
|
+
console.log('多选操作:', action, selectedItems, selectedItemsArray)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 选择变化处理
|
|
105
|
+
function handleSelectionChange(selectedItems: any[]) {
|
|
106
|
+
console.log('选择变化,当前选中:', selectedItems.length, '个项目')
|
|
107
|
+
// 可以在这里更新UI状态,比如显示选中数量等
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 数据加载完成后处理 @after-load
|
|
111
|
+
function afterLoad(result) {
|
|
112
|
+
console.log('afterLoad:', result)
|
|
113
|
+
}
|
|
93
114
|
</script>
|
|
94
115
|
|
|
95
116
|
<template>
|
|
96
117
|
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
97
118
|
<template #layout_content>
|
|
98
119
|
<XCellList
|
|
99
|
-
|
|
100
|
-
|
|
120
|
+
config-name="mobile_casualSecurityCheckCRUD"
|
|
121
|
+
service-name="af-safecheck"
|
|
122
|
+
:enable-multi-select="true"
|
|
123
|
+
id-key="rr_id"
|
|
124
|
+
:multi-select-actions="multiSelectActions"
|
|
125
|
+
@to-detail="toDetail"
|
|
126
|
+
@multi-select-action="handleMultiSelectAction"
|
|
127
|
+
@selection-change="handleSelectionChange"
|
|
101
128
|
/>
|
|
102
129
|
</template>
|
|
103
130
|
</NormalDataLayout>
|
|
@@ -1,78 +1,82 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
|
|
3
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
-
import { showDialog } from 'vant'
|
|
5
|
-
import { ref } from 'vue'
|
|
6
|
-
import { useRoute } from 'vue-router'
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// const configName = ref(
|
|
13
|
-
// const serviceName = ref(
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
// const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// function initComponents() {
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
//
|
|
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
|
-
</
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { showDialog } from 'vant'
|
|
5
|
+
import { ref } from 'vue'
|
|
6
|
+
import { useRoute } from 'vue-router'
|
|
7
|
+
|
|
8
|
+
// const configName = ref('reviewFormGroup')
|
|
9
|
+
// const serviceName = ref('af-revenue')
|
|
10
|
+
|
|
11
|
+
// 纯表单
|
|
12
|
+
// const configName = ref('form_check_test')
|
|
13
|
+
// const serviceName = ref('af-system')
|
|
14
|
+
|
|
15
|
+
// const configName = ref("计划下发Form")
|
|
16
|
+
// const serviceName = ref("af-linepatrol")
|
|
17
|
+
|
|
18
|
+
// 表单组
|
|
19
|
+
const configName = ref('lngChargeAuditMobileFormGroup')
|
|
20
|
+
const serviceName = ref('af-gaslink')
|
|
21
|
+
|
|
22
|
+
const formData = ref({})
|
|
23
|
+
const formGroup = ref(null)
|
|
24
|
+
const route = useRoute()
|
|
25
|
+
const isInit = ref(false)
|
|
26
|
+
function submit(_result) {
|
|
27
|
+
showDialog({ message: '提交成功' }).then(() => {
|
|
28
|
+
console.log('12121')
|
|
29
|
+
// history.back()
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 表单组——数据
|
|
34
|
+
// function initComponents () {
|
|
35
|
+
// runLogic('getlngChargeAuditMobileFormGroupData', {id: 29}, 'af-gaslink').then((res) => {
|
|
36
|
+
// formData.value = {...res}
|
|
37
|
+
// })
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
// 纯表单——数据
|
|
41
|
+
// function initComponents() {
|
|
42
|
+
// formData.value = { plan_name: 'af-llllll', plan_point: '1号点位', plan_single: '1号点位', plan_range: '2024-12-12' }
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
// function initComponents() {
|
|
46
|
+
// runLogic('getlngChargeAuditMobileFormGroupData', { id: route.query?.id, o_id: route.query?.o_id }, 'af-gaslink').then((res) => {
|
|
47
|
+
// console.log('res------', res)
|
|
48
|
+
// formData.value = { ...res }
|
|
49
|
+
// formGroup.value.init({
|
|
50
|
+
// configName: configName.value,
|
|
51
|
+
// serviceName: serviceName.value,
|
|
52
|
+
// groupFormData: { ...res },
|
|
53
|
+
// mode: "新增"
|
|
54
|
+
// })
|
|
55
|
+
// isInit.value = true
|
|
56
|
+
// })
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// onBeforeMount(() => {
|
|
60
|
+
// initComponents()
|
|
61
|
+
// })
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
66
|
+
<template #layout_content>
|
|
67
|
+
<!-- v-if="isInit" -->
|
|
68
|
+
<XFormGroup
|
|
69
|
+
ref="formGroup"
|
|
70
|
+
config-name="ApplyAddContractFormGroup"
|
|
71
|
+
service-name="af-apply"
|
|
72
|
+
:group-form-data="formData"
|
|
73
|
+
mode="新增"
|
|
74
|
+
@submit="submit"
|
|
75
|
+
/>
|
|
76
|
+
</template>
|
|
77
|
+
</NormalDataLayout>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<style scoped lang="less">
|
|
81
|
+
|
|
82
|
+
</style>
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
3
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
-
import { ref } from 'vue'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
:
|
|
31
|
-
|
|
32
|
-
:form
|
|
33
|
-
@on-submit="onSubmit"
|
|
34
|
-
/>
|
|
35
|
-
</template>
|
|
36
|
-
</NormalDataLayout>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import {
|
|
6
|
+
Button as VanButton,
|
|
7
|
+
} from 'vant'
|
|
8
|
+
|
|
9
|
+
const configName = ref('测试Form')
|
|
10
|
+
const serviceName = ref('af-safecheck')
|
|
11
|
+
const formGroupAddConstruction = ref()
|
|
12
|
+
|
|
13
|
+
// 提交测试
|
|
14
|
+
function onSubmit(form) {
|
|
15
|
+
console.log('事件触发提交表单----', form)
|
|
16
|
+
}
|
|
17
|
+
async function onAsyncSubmit() {
|
|
18
|
+
const res = await formGroupAddConstruction.value.asyncSubmit()
|
|
19
|
+
console.log('异步提交表单----', res)
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
25
|
+
<template #layout_content>
|
|
26
|
+
<XForm
|
|
27
|
+
ref="formGroupAddConstruction"
|
|
28
|
+
mode="新增"
|
|
29
|
+
:config-name="configName"
|
|
30
|
+
:show-tab-header="false"
|
|
31
|
+
service-name="af-safecheck"
|
|
32
|
+
:is-group-form="true"
|
|
33
|
+
@on-submit="onSubmit"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
36
|
+
</NormalDataLayout>
|
|
37
|
+
<van-button type="primary" @click="onAsyncSubmit">提交</van-button>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<style scoped lang="less">
|
|
41
|
+
|
|
42
|
+
</style>
|
|
@@ -3,7 +3,7 @@ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDat
|
|
|
3
3
|
import { showNotify } from 'vant'
|
|
4
4
|
import { onMounted, ref } from 'vue'
|
|
5
5
|
import XOlMap from '../../../components/data/XOlMap/index.vue'
|
|
6
|
-
import { trackTestData } from './testData'
|
|
6
|
+
import { polygonTestData, trackTestData } from './testData'
|
|
7
7
|
import 'vant/lib/index.css'
|
|
8
8
|
|
|
9
9
|
const mapRef = ref()
|
|
@@ -273,6 +273,33 @@ function handleAddTrack() {
|
|
|
273
273
|
})
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
// 多边形处理函数
|
|
277
|
+
function handlePolygonClick(polygon: any) {
|
|
278
|
+
console.log('>>>> polygon: ', JSON.stringify(polygon))
|
|
279
|
+
showNotify({
|
|
280
|
+
type: 'primary',
|
|
281
|
+
message: `点击了多边形: ${polygon.name}\n类型: ${polygon.extData?.type || '未知'}`,
|
|
282
|
+
})
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// 添加多边形示例
|
|
286
|
+
function handleAddPolygonLayer() {
|
|
287
|
+
mapRef.value.addPolygonLayer({
|
|
288
|
+
id: 1,
|
|
289
|
+
value: '行政区划',
|
|
290
|
+
show: true,
|
|
291
|
+
onClick: handlePolygonClick,
|
|
292
|
+
dataProvider: async () => {
|
|
293
|
+
// 模拟从API获取多边形数据
|
|
294
|
+
return new Promise((resolve) => {
|
|
295
|
+
setTimeout(() => {
|
|
296
|
+
resolve(polygonTestData)
|
|
297
|
+
}, 500)
|
|
298
|
+
})
|
|
299
|
+
},
|
|
300
|
+
})
|
|
301
|
+
}
|
|
302
|
+
|
|
276
303
|
// 导航模式相关
|
|
277
304
|
const isNavigationMode = ref(false)
|
|
278
305
|
|
|
@@ -339,6 +366,15 @@ function stopNavigation() {
|
|
|
339
366
|
</van-button>
|
|
340
367
|
</div>
|
|
341
368
|
|
|
369
|
+
<div class="control-group">
|
|
370
|
+
<div class="group-title">
|
|
371
|
+
多边形示例
|
|
372
|
+
</div>
|
|
373
|
+
<van-button type="success" size="small" @click="handleAddPolygonLayer">
|
|
374
|
+
添加行政区划
|
|
375
|
+
</van-button>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
342
378
|
<div class="control-group">
|
|
343
379
|
<div class="group-title">
|
|
344
380
|
导航模式测试
|
|
@@ -11,6 +11,19 @@ export interface TrackData {
|
|
|
11
11
|
show?: boolean // 是否显示
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
// 多边形数据类型定义
|
|
15
|
+
export interface PolygonData {
|
|
16
|
+
id: number
|
|
17
|
+
name: string
|
|
18
|
+
coordinates: [number, number][]
|
|
19
|
+
fillColor?: string
|
|
20
|
+
strokeColor?: string
|
|
21
|
+
strokeWidth?: number
|
|
22
|
+
opacity?: number
|
|
23
|
+
show?: boolean
|
|
24
|
+
extData?: Record<string, any>
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
/**
|
|
15
28
|
* 生成随机轨迹点
|
|
16
29
|
* @param startPoint - 起始点 [经度, 纬度]
|
|
@@ -62,3 +75,67 @@ export const trackTestData: TrackData[] = [
|
|
|
62
75
|
show: true,
|
|
63
76
|
},
|
|
64
77
|
]
|
|
78
|
+
|
|
79
|
+
// 多边形测试数据
|
|
80
|
+
export const polygonTestData: PolygonData[] = [
|
|
81
|
+
{
|
|
82
|
+
id: 1,
|
|
83
|
+
name: '西安高新区',
|
|
84
|
+
coordinates: [
|
|
85
|
+
[108.93, 34.25],
|
|
86
|
+
[108.97, 34.25],
|
|
87
|
+
[108.97, 34.28],
|
|
88
|
+
[108.93, 34.28],
|
|
89
|
+
[108.93, 34.25],
|
|
90
|
+
],
|
|
91
|
+
fillColor: 'rgba(255, 0, 0, 0.3)',
|
|
92
|
+
strokeColor: '#FF0000',
|
|
93
|
+
strokeWidth: 2,
|
|
94
|
+
show: true,
|
|
95
|
+
extData: {
|
|
96
|
+
type: 'district',
|
|
97
|
+
population: 500000,
|
|
98
|
+
area: '120平方公里',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 2,
|
|
103
|
+
name: '曲江新区',
|
|
104
|
+
coordinates: [
|
|
105
|
+
[108.95, 34.26],
|
|
106
|
+
[108.99, 34.26],
|
|
107
|
+
[108.99, 34.29],
|
|
108
|
+
[108.95, 34.29],
|
|
109
|
+
[108.95, 34.26],
|
|
110
|
+
],
|
|
111
|
+
fillColor: 'rgba(0, 255, 0, 0.3)',
|
|
112
|
+
strokeColor: '#00FF00',
|
|
113
|
+
strokeWidth: 2,
|
|
114
|
+
show: true,
|
|
115
|
+
extData: {
|
|
116
|
+
type: 'district',
|
|
117
|
+
population: 300000,
|
|
118
|
+
area: '80平方公里',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 3,
|
|
123
|
+
name: '经开区',
|
|
124
|
+
coordinates: [
|
|
125
|
+
[108.91, 34.24],
|
|
126
|
+
[108.95, 34.24],
|
|
127
|
+
[108.95, 34.27],
|
|
128
|
+
[108.91, 34.27],
|
|
129
|
+
[108.91, 34.24],
|
|
130
|
+
],
|
|
131
|
+
fillColor: 'rgba(0, 0, 255, 0.3)',
|
|
132
|
+
strokeColor: '#0000FF',
|
|
133
|
+
strokeWidth: 2,
|
|
134
|
+
show: true,
|
|
135
|
+
extData: {
|
|
136
|
+
type: 'district',
|
|
137
|
+
population: 200000,
|
|
138
|
+
area: '60平方公里',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
]
|