|
|
@@ -46,7 +46,7 @@ const store = useStore()
|
|
|
const mapService = new MapService()
|
|
|
const props = withDefaults(defineProps<{
|
|
|
zoom?: number,
|
|
|
- Item?: { contrlSelect: { title: string, option: Any[], icon: string, checked:string[] }, key:string }
|
|
|
+ Item?: { contrlSelect: { title: string, option: Any[], icon: string, checked: string[] }, key: string }
|
|
|
}>(), {
|
|
|
zoom: 13,
|
|
|
Item: () => ({
|
|
|
@@ -61,7 +61,7 @@ const emit = defineEmits<{(evt: 'update:contrlSelect', value: Any): void
|
|
|
const checkBoxs = ref(props.Item.contrlSelect.checked)
|
|
|
|
|
|
// checkBox勾选
|
|
|
-function checkBoxsChange(params:string[], mate:{actionType:string, value:string}) {
|
|
|
+function checkBoxsChange(params: string[], mate: { actionType: string, value: string }) {
|
|
|
const { marks } = mapService
|
|
|
console.log('勾选', marks[props.Item.key][mate.value])
|
|
|
if (!Object.keys(marks[props.Item.key][mate.value]).length) return
|
|
|
@@ -106,13 +106,19 @@ watch(() => store.socektData, (v) => {
|
|
|
|
|
|
// 菜单切换显示隐藏
|
|
|
watch(() => props.Item.key, (v) => {
|
|
|
- console.log('菜单切换需要重新初始化mark', v)
|
|
|
+ checkBoxs.value = props.Item.contrlSelect.checked
|
|
|
const { marks } = mapService
|
|
|
+ // 添加marks
|
|
|
+ console.log('菜单切换需要重新初始化mark', v, marks, props)
|
|
|
+ if (!Object.keys(marks).includes(v)) {
|
|
|
+ mapService._initMarks(v, props.Item.contrlSelect.checked, props.Item.contrlSelect)
|
|
|
+ }
|
|
|
+ // 切换显示或者隐藏
|
|
|
for (const k in marks) {
|
|
|
for (const j in marks[k]) {
|
|
|
if (Object.keys(marks[k][j]).length) {
|
|
|
for (const z in marks[k][j]) {
|
|
|
- if (k === props.Item.key) {
|
|
|
+ if (k === v) {
|
|
|
marks[k][j][z].markMap.show()
|
|
|
} else {
|
|
|
marks[k][j][z].markMap.hide()
|