提交表单完善、地图微调

master
贾肃 5 months ago
parent b491cd3ec4
commit 6fd57f051d
  1. 2
      src/components/Hamburger/index.vue
  2. 3
      src/components/LeftDrawer/index.vue
  3. 2
      src/main.js
  4. 23
      src/views/system/base/massifForm.vue
  5. 196
      src/views/system/base/massifMap.vue

@ -3,7 +3,7 @@
<i-menu-unfold-one class="hamburger"
:class="{'is-active':isActive}" theme="outline" size="22" :fill="fill"/>
<div>
<left-drawer v-model="showDrawer" z-index="195">
<left-drawer v-model="showDrawer" :z-index="195">
<div>
<div class="classify" style="margin: 0 0 10px 0;">
<i-chart-line theme="outline" size="24" fill="#338572"/>

@ -38,7 +38,9 @@ const close = () => {
<slot></slot>
</div>
<template #footer>
<div style="text-align: center">
<slot name="footer"></slot>
</div>
</template>
</el-drawer>
</template>
@ -57,6 +59,7 @@ const close = () => {
height: calc(100% - 50px);
}
.close-icon {
z-index: 200;
position: fixed;
top: 20px;
right: 20px;

@ -55,7 +55,6 @@ import VueAMap, {initAMapApiLoader} from '@vuemap/vue-amap';
// import VueAMapExtra from '@vuemap/vue-amap-extra';
import '@vuemap/vue-amap/dist/style.css'
// collapse
import { ElCollapseTransition } from 'element-plus'
const app = createApp(App)
initAMapApiLoader({
key: '62c3411d6528d67db00ad510a7ee5fb9',
@ -87,7 +86,6 @@ app.component('RightToolbar', RightToolbar)
app.component('Editor', Editor)
app.component('LeftDrawer', LeftDrawer)
app.component('titleDivider', titleDivider)
app.component(ElCollapseTransition.name, ElCollapseTransition)
app.use(VueAMap)
app.use(router)
app.use(store)

@ -26,6 +26,8 @@ const selectOptions = reactive({
{label: '其他', value: 9},
]
})
let emit = defineEmits(['beforeSubmit','submitSuccess']);
const loading = ref(false)
const showDrawer = ref(false)
const formData = ref({})
const resetForm = (params) => {
@ -35,7 +37,6 @@ const resetForm = (params) => {
{},
{},
{},
{},
],
//
coordinateType: 1,
@ -93,6 +94,15 @@ const uploadJson = (file) => {
}
}
}
const saveMassif = () => {
emit('beforeSubmit', formData.value)
loading.value = true
setTimeout(() => {
loading.value = false
emit('submitSuccess')
showDrawer.value = false
},2000)
}
defineExpose({
toAdd
})
@ -193,17 +203,17 @@ defineExpose({
<el-col v-if="formData.coordinateType === 1" :span="24" v-for="(item,index) in formData.coordinateList"
:key="index" style="margin-top: 10px">
<el-row :gutter="10">
<el-col :span="10">
<el-col :span="11">
<el-form-item :label="`坐标${index+1}经度`" prop="name">
<el-input v-model="item.longitude" placeholder="请输入坐标经度"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-col :span="11">
<el-form-item prop="name" :label="`坐标${index+1}纬度`">
<el-input v-model="item.latitude" placeholder="请输入坐标纬度"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" class="delete-icon">
<el-col :span="2" class="delete-icon">
<el-icon v-if="index > 2" :color="theme" size="22" @click="formData.coordinateList.splice(index,1)">
<Delete/>
</el-icon>
@ -223,8 +233,11 @@ defineExpose({
</el-col>
</el-row>
</el-form>
</div>
<template #footer>
<el-button type="primary" :loading="loading" @click="saveMassif"></el-button>
<el-button @click="showDrawer = false">取消</el-button>
</template>
</left-drawer>
</div>
</template>

@ -13,8 +13,6 @@ const settingsStore = useSettingsStore()
const theme = computed(() => settingsStore.theme)
//
const showMassifList = ref(true)
//
const showMassifForm = ref(false)
const massifFormRef = ref(null)
//
const currentMassif = ref(null)
@ -56,9 +54,9 @@ const protract = ref(false)
//
const createdMouse = ref(false)
//
// -
const componentText = ref([])
// 线
// 线-线
const gridLines = ref([])
//
const polygonList = reactive([
@ -115,6 +113,157 @@ const polygonList = reactive([
fillColor: undefined
}
])
//
const ridgeList = ref([
{
id:1,
polygonId:1,
title:'测试垄1',
path:[
[
116.337386,
39.979027
],
[
116.337395,
39.978409
]
]
},
{
id:2,
polygonId:1,
title:'测试垄2',
path:[
[
116.337528,
39.979023
],
[
116.337535,
39.97841
]
]
},
{
id:3,
polygonId:2,
title:'测试垄3',
path:[
[
116.338439,
39.978878
],
[
116.338442,
39.978705
]
]
},
])
//
const plantList = ref([
{
id:1,
polygonId:1,
title:'001',
path:
[
116.337387,
39.978945
]
},
{
id:2,
polygonId:1,
title:'002',
path:
[
116.337388,
39.978853
]
},
{
id:3,
polygonId:1,
title:'003',
path:
[
116.337387,
39.978761
]
},
{
id:4,
polygonId:1,
title:'004',
path:
[
116.33739,
39.978668
]
},
{
id:5,
polygonId:1,
title:'005',
path:
[
116.337395,
39.978581
]
},
{
id:6,
polygonId:1,
title:'006',
path:
[
116.33739,
39.978492
]
},
{
id:7,
polygonId:1,
title:'007',
path:
[
116.337529,
39.978852
]
},
{
id:8,
polygonId:1,
title:'008',
path:
[
116.337531,
39.978672
]
},
{
id:9,
polygonId:2,
title:'002',
path:
[
116.338442,
39.97879
]
},
{
id:10,
polygonId:2,
title:'003',
path:
[
116.338445,
39.978705
]
},
])
const polygonTemp = ref(null)
//
const draw = (value) => {
@ -328,6 +477,7 @@ const toAddMassif = () => {
:path="polygonTemp"
@addnode="updateMassif"
@removenode="updateMassif"
:zooms="[13,20]"
@adjust="updateMassif"
:visible="true"
:editable="true"
@ -336,17 +486,52 @@ const toAddMassif = () => {
<el-amap-marker
v-if="control.massifLabel"
v-for="comText in componentText"
:zooms="[13,20]"
:position="comText.position"
:visible="true"
:label="{content:comText.text,offset:[-50,0]}">
:label="{content:comText.text,offset:[-25,0]}">
<div></div>
</el-amap-marker>
<!--折线-网格线-->
<el-amap-polyline
v-if="control.massifGrid"
v-for="grid in gridLines"
:zooms="[16,20]"
stroke-color="#e36ea4"
:path="grid"
:visible="true">
</el-amap-polyline>
<!--折线--->
<el-amap-polyline
v-if="control.showRidge"
v-for="ridge in ridgeList"
:zooms="[16,20]"
:strokeWeight="5"
strokeColor="#a4e36e"
:path="ridge.path"
:visible="true">
</el-amap-polyline>
<!--点标记-垄标签-->
<el-amap-marker
v-if="control.ridgeLabel"
v-for="ridge in ridgeList"
:position="ridge.path[0]"
:zooms="[16,20]"
:visible="true"
:label="{content:`<span style='color: #a4e36e'>${ridge.title}</span>`,offset:[-25,-10]}">
<div></div>
</el-amap-marker>
<!--点标记-植株标签-->
<el-amap-marker
v-if="control.plantLabel"
v-for="plant in plantList"
:position="plant.path"
:visible="true"
:zooms="[16,20]"
:label="{content:`<span style='color: #a4e36e'>${plant.title}</span>`,offset:[0,0]}">
<div v-if="control.showPlant" style="border-radius: 50%;height: 15px;width: 15px" :style="{background:'#a4e36e'}"></div>
<div v-else></div>
</el-amap-marker>
<div class="top-block">
<base-right-control v-if="!protract" v-model="control"/>
<!--左侧操作区-->
@ -508,6 +693,7 @@ const toAddMassif = () => {
//
.massif-list {
max-height: 650px;
.title-icon {
padding: 6px 5px 4px 5px;
display: inline-block;

Loading…
Cancel
Save