fix: 区域管理的编辑的修改

This commit is contained in:
100011797 2023-10-27 10:19:21 +08:00
parent 67309da698
commit 6c1917d9c3
3 changed files with 65 additions and 27 deletions

View File

@ -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>

View File

@ -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>

View File

@ -1,15 +1,16 @@
<template>
<page-container>
<full-page>
<div class="region">
<div class="left">
<LeftTree />
<full-page>
<div class="region">
<div class="left">
<LeftTree />
<div class="mask" v-if="type === 'edit'"></div>
</div>
<div class="right">
<Map :path="path" :type="mapType" />
</div>
</div>
<div class="right">
<Map :path="path" type="create" />
</div>
</div>
</full-page>
</full-page>
</page-container>
</template>
@ -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;