fix: 区域管理的编辑的修改
This commit is contained in:
parent
67309da698
commit
6c1917d9c3
|
@ -1,21 +1,45 @@
|
|||
<template>
|
||||
<j-button v-if="!_value.length" type="link">请在地图上描点</j-button>
|
||||
<div v-else>
|
||||
已完成描点<j-button type="link">编辑</j-button>
|
||||
</div>
|
||||
<j-button @click="onClick" v-if="!_value.length" type="link"
|
||||
>请在地图上描点</j-button
|
||||
>
|
||||
<div v-else>已完成描点<j-button type="link" @click="onEdit">编辑</j-button></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue"
|
||||
import { ref, watch, inject } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(['update:value'])
|
||||
const emits = defineEmits(['update:value', 'close']);
|
||||
|
||||
const _value = ref<any[]>([])
|
||||
const _value = ref<any[]>([]);
|
||||
|
||||
const __data: any = inject('system-region')
|
||||
|
||||
const onClick = () => {
|
||||
console.log(__data)
|
||||
__data.type.value = 'edit'
|
||||
emits('close')
|
||||
};
|
||||
|
||||
const onEdit = () => {
|
||||
// __data.type.value = 'edit'
|
||||
// emits('close')
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
() => {
|
||||
console.log(props.value)
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
);
|
||||
</script>
|
|
@ -97,7 +97,7 @@
|
|||
required
|
||||
name="features"
|
||||
>
|
||||
<TracePoint v-model:value="modelRef.features" />
|
||||
<TracePoint @close="emit('close')" v-model:value="modelRef.features" />
|
||||
</j-form-item>
|
||||
</j-form>
|
||||
</div>
|
||||
|
|
|
@ -4,9 +4,10 @@
|
|||
<div class="region">
|
||||
<div class="left">
|
||||
<LeftTree />
|
||||
<div class="mask" v-if="type === 'edit'"></div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<Map :path="path" type="create" />
|
||||
<Map :path="path" :type="mapType" />
|
||||
</div>
|
||||
</div>
|
||||
</full-page>
|
||||
|
@ -17,15 +18,17 @@
|
|||
import LeftTree from './LeftTree/index.vue'
|
||||
import Map from './MapTool/map.vue'
|
||||
import FullPage from "components/Layout/FullPage.vue";
|
||||
import { provide } from 'vue'
|
||||
|
||||
const searchValue = ref()
|
||||
const current = ref<any>({})
|
||||
const path = ref([[121.5273285, 31.21515044], [121.5293285, 31.21515044], [121.5293285, 31.21915044], [121.5273285, 31.21515044]])
|
||||
const type = ref<'view' | 'edit'>('view')
|
||||
const mapType = ref<string>('create')
|
||||
|
||||
const onSave = () => {
|
||||
|
||||
}
|
||||
|
||||
provide('system-region', {
|
||||
type,
|
||||
mapType: '',
|
||||
path
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -37,12 +40,23 @@ const onSave = () => {
|
|||
|
||||
.left {
|
||||
width: 300px;
|
||||
|
||||
position: relative;
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
margin: 18px 0;
|
||||
}
|
||||
|
||||
.mask {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
background-color: lightgray;
|
||||
opacity: .5;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
flex: 1;
|
||||
|
|
Loading…
Reference in New Issue