1
0
forked from dyf/dyf-vue-ui

Compare commits

...

3 Commits

Author SHA1 Message Date
b7192b761e Merge branch 'main' of http://47.107.152.87:3000/liubiao/dyf-vue-ui 2025-09-15 16:31:21 +08:00
128e4f4074 vite版本回退 2025-09-15 16:31:10 +08:00
d78b7fd15e 修复表单未重置的问题。 2025-09-15 16:30:13 +08:00

View File

@ -77,7 +77,6 @@
</el-table-column> </el-table-column>
<el-table-column label="描述" align="center" prop="description"> </el-table-column> <el-table-column label="描述" align="center" prop="description"> </el-table-column>
<el-table-column label="操作" fixed="right" width="180" class-name="small-padding fixed-width"> <el-table-column label="操作" fixed="right" width="180" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="ShowEdit(scope.row)">编辑</el-button> <el-button link type="primary" @click="ShowEdit(scope.row)">编辑</el-button>
@ -217,7 +216,6 @@ function showSearch() {
} }
} }
function ShowEdit(item) { function ShowEdit(item) {
Status.showEdit = true; Status.showEdit = true;
if (item) { if (item) {
let keys = Object.keys(item); let keys = Object.keys(item);
@ -229,6 +227,14 @@ function ShowEdit(item) {
if (item.coordinates) { if (item.coordinates) {
cEdit.coordinates = JSON.parse(item.coordinates); cEdit.coordinates = JSON.parse(item.coordinates);
} }
} else {
cEdit.id = null;
cEdit.name = '';
cEdit.description = '';
cEdit.areaType = null;
cEdit.coordinates = [];
cEdit.radius = null;
cEdit.isActive = null;
} }
map.clearOverLays(); map.clearOverLays();
setTimeout(() => { setTimeout(() => {
@ -304,7 +310,6 @@ let time = null;
function refreshOverLayer() { function refreshOverLayer() {
clearTimeout(time); clearTimeout(time);
time = setTimeout(() => { time = setTimeout(() => {
if (cEdit.areaType == 1) { if (cEdit.areaType == 1) {
map.DrawCicle(cEdit.coordinates, cEdit.radius, circleDragEnd); map.DrawCicle(cEdit.coordinates, cEdit.radius, circleDragEnd);
} else { } else {
@ -326,7 +331,6 @@ function ClearPoint() {
} }
//添加一个点 //添加一个点
function AddPoint(point, i) { function AddPoint(point, i) {
if (cEdit.areaType == null && !point) { if (cEdit.areaType == null && !point) {
alert('请选择围栏类型'); alert('请选择围栏类型');
return; return;
@ -338,16 +342,13 @@ function AddPoint(point, i) {
let index = i !== undefined ? i : cEdit.coordinates.length; let index = i !== undefined ? i : cEdit.coordinates.length;
let dragEnd = (evt, lay) => { let dragEnd = (evt, lay) => {
map.removePoy(); map.removePoy();
cEdit.coordinates[index].lng = evt.lnglat.lng; cEdit.coordinates[index].lng = evt.lnglat.lng;
cEdit.coordinates[index].lat = evt.lnglat.lat; cEdit.coordinates[index].lat = evt.lnglat.lat;
refreshOverLayer(); refreshOverLayer();
}; };
let pointClick = (evt, lay) => { let pointClick = (evt, lay) => {
confirm( confirm(
'您确认删除该点吗?', '您确认删除该点吗?',
() => { () => {
@ -364,7 +365,9 @@ function AddPoint(point, i) {
let lon = res.lng; let lon = res.lng;
let lat = res.lat; let lat = res.lat;
if(!point){cEdit.coordinates.push({ lng: lon, lat: lat });} if (!point) {
cEdit.coordinates.push({ lng: lon, lat: lat });
}
refreshOverLayer(); refreshOverLayer();
}); });
} }
@ -443,11 +446,8 @@ function getList() {
} }
function Export() { function Export() {
let json = {}; let json = {};
proxy?.download('/api/equipment/geoFence/export', json, `电子围栏列表_${new Date().getTime()}.xlsx`, 'post').finally(() => { proxy?.download('/api/equipment/geoFence/export', json, `电子围栏列表_${new Date().getTime()}.xlsx`, 'post').finally(() => {});
});
} }
//获取已选中的行 //获取已选中的行