|
@@ -37,7 +37,7 @@
|
|
|
</div>
|
|
|
|
|
|
<Teleport to="body" v-if="isMounted">
|
|
|
- <el-button class="temp_btn" @click="clearPolys">后端全清</el-button>
|
|
|
+ <!-- <el-button class="temp_btn" @click="clearPolys">后端全清</el-button> -->
|
|
|
<div class="draw-global-icon" v-if="isCurrentTab(1) && !isEditDrawingMode" @click="handleBoardDraw">
|
|
|
<el-icon size="30">
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
@@ -267,7 +267,7 @@ const patchPolyName = (data: DrawingDataType) => {
|
|
|
const poly = data.polygons;
|
|
|
poly?.forEach((item) => {
|
|
|
if (!item.name) {
|
|
|
- item.name = "";
|
|
|
+ item.name = "本体边界" + item.id;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -317,34 +317,9 @@ const initPolyTabData = async () => {
|
|
|
|
|
|
const handlePolysDel = (id: string) => {
|
|
|
try {
|
|
|
- // const data = board.getData() as any as DrawingDataType;
|
|
|
- // const obj: DrawingDataType = JSON.parse(JSON.stringify(data))
|
|
|
- // const index = obj.polygons.findIndex(i => id === i.id)
|
|
|
- // console.log('handlePolysDel', id, index)
|
|
|
- // const points = [];
|
|
|
- // if (index > -1) {
|
|
|
- // data.polygons[index].lineIds.forEach(id => {
|
|
|
- // // 当前poly下线段与点都删除
|
|
|
- // const line = data.lines.find(l => l.id === id);
|
|
|
- // line && line.pointIds.forEach(p => points.push(p));
|
|
|
-
|
|
|
- // const lIndex = obj.lines.findIndex(l => l.id === id);
|
|
|
- // lIndex > -1 && obj.lines.splice(lIndex, 1)
|
|
|
- // });
|
|
|
- // new Set(points).forEach((_, i) => {
|
|
|
- // const pIndex = obj.points.findIndex(p => p.id === i);
|
|
|
- // // console.log('pIndex', pIndex, obj.points)
|
|
|
- // obj.points.splice(pIndex, 1)
|
|
|
- // })
|
|
|
- // console.log('points', new Set(points))
|
|
|
- // obj.polygons.splice(index, 1);
|
|
|
- // }
|
|
|
board.polygon().removePolygon(id);
|
|
|
- // board.setData({
|
|
|
- // points: obj.points,
|
|
|
- // lines: obj.lines,
|
|
|
- // polygons: obj.polygons,
|
|
|
- // }, obj.id)
|
|
|
+ handleSyncDataToServer();
|
|
|
+
|
|
|
} catch (error) {
|
|
|
console.error("handlePolysDel", error);
|
|
|
}
|