|
|
|
|
@ -192,10 +192,11 @@
|
|
|
|
|
<el-button style="margin-right: 16px" @click="batchShild">固定物</el-button>
|
|
|
|
|
</el-popover>
|
|
|
|
|
</div>
|
|
|
|
|
{{ tableData1 }}
|
|
|
|
|
<el-table
|
|
|
|
|
ref="table1Ref"
|
|
|
|
|
highlight-current-row
|
|
|
|
|
:data="tableData1.slice((currentPage1 - 1) * pageSize1, currentPage1 * pageSize1)"
|
|
|
|
|
:data="tableData1Computed"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
@row-click="table1Current"
|
|
|
|
|
>
|
|
|
|
|
@ -694,7 +695,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="jsx">
|
|
|
|
|
import Ruler from "@/components/ruler.vue";
|
|
|
|
|
import {onMounted, ref, watch} from "vue";
|
|
|
|
|
import {onMounted, ref, watch,computed } from "vue";
|
|
|
|
|
import {
|
|
|
|
|
addShildData,
|
|
|
|
|
DeleteCData,
|
|
|
|
|
@ -988,6 +989,10 @@ const getShildTableList = () => {
|
|
|
|
|
|
|
|
|
|
// 障碍物列表
|
|
|
|
|
const tableData1 = ref([])
|
|
|
|
|
const tableData1Computed = computed(() => {
|
|
|
|
|
console.log(tableData1.value.slice((currentPage1.value - 1) * pageSize1.value, currentPage1.value * pageSize1.value))
|
|
|
|
|
return tableData1.value.slice((currentPage1.value - 1) * pageSize1.value, currentPage1.value * pageSize1.value)
|
|
|
|
|
});
|
|
|
|
|
// 上传图片
|
|
|
|
|
const uploadRef = ref(null)
|
|
|
|
|
const uploadFiles = async (e) => {
|
|
|
|
|
@ -1050,7 +1055,7 @@ const openHandleObstacleDialog = (e) => {
|
|
|
|
|
console.log(e.row)
|
|
|
|
|
dialog1.value = true
|
|
|
|
|
dialog1Form.value = {
|
|
|
|
|
dotIndex : e.index,
|
|
|
|
|
dotIndex: e.index,
|
|
|
|
|
index: e.$index,
|
|
|
|
|
time: e.row.time,
|
|
|
|
|
longitude: e.row.Lon,
|
|
|
|
|
@ -1128,7 +1133,10 @@ function lonLatToXY(lon, lat, lat0) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function calcRectangleFromPoints(points) {
|
|
|
|
|
if (!points || points.length !== 4) throw new Error("必须传入4个点");
|
|
|
|
|
if (!points || points.length !== 4) {
|
|
|
|
|
console.log("必须传入4个点");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const p1raw = points.find(p => p.name === "点位1") || points[0];
|
|
|
|
|
const p2raw = points.find(p => p.name === "点位2") || points[1];
|
|
|
|
|
const p3raw = points.find(p => p.name === "点位3") || points[2];
|
|
|
|
|
@ -1162,7 +1170,8 @@ function calcRectangleFromPoints(points) {
|
|
|
|
|
|
|
|
|
|
function getLocalPositionRelativeToP4(point, rectPoints, rectInfo) {
|
|
|
|
|
if (!rectInfo || typeof rectInfo.angle !== 'number') {
|
|
|
|
|
throw new Error("rectInfo.angle 必须是由 calcRectangleFromPoints 得到的角度");
|
|
|
|
|
console.log("rectInfo.angle 必须是由 calcRectangleFromPoints 得到的角度");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const lat0 = rectPoints.reduce((a, b) => a + b.lat, 0) / rectPoints.length;
|
|
|
|
|
@ -1198,12 +1207,12 @@ const getDeviationValue = (e) => {
|
|
|
|
|
}
|
|
|
|
|
// 修正偏差
|
|
|
|
|
const correctDeviation = (e) => {
|
|
|
|
|
let numH = deviationValue.value.y
|
|
|
|
|
let numW = deviationValue.value.x
|
|
|
|
|
let Ratio = e.y / numH
|
|
|
|
|
let numH = deviationValue.value.y || 0
|
|
|
|
|
let numW = deviationValue.value.x || 0
|
|
|
|
|
let Ratio = e?.y / numH
|
|
|
|
|
return {
|
|
|
|
|
...e,
|
|
|
|
|
x: e.x - numW * Ratio
|
|
|
|
|
x: e?.x - numW * Ratio
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const getPoint = (k) => {
|
|
|
|
|
@ -1377,7 +1386,8 @@ const getDotsData = () => {
|
|
|
|
|
}).filter(v => v)]
|
|
|
|
|
}
|
|
|
|
|
watch(() => JSON.stringify([tableData1.value, areaPoints.value]), (oldVal, newVal) => {
|
|
|
|
|
localStorage.setItem('tableData1',JSON.stringify(tableData1.value));
|
|
|
|
|
console.log(tableData1.value)
|
|
|
|
|
localStorage.setItem('tableData1', JSON.stringify(tableData1.value));
|
|
|
|
|
getDotsData()
|
|
|
|
|
}, {deep: true})
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
@ -1387,10 +1397,23 @@ onMounted(() => {
|
|
|
|
|
getShildTableList()
|
|
|
|
|
// testFun()
|
|
|
|
|
getDotsData()
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
tableData1.value = JSON.parse(localStorage.getItem('tableData1') || '[]')
|
|
|
|
|
|
|
|
|
|
},100)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const storedStr = localStorage.getItem('tableData1');
|
|
|
|
|
if (!storedStr) {
|
|
|
|
|
console.log('localStorage中无数据');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const storedData = JSON.parse(storedStr);
|
|
|
|
|
if (!Array.isArray(storedData)) {
|
|
|
|
|
console.error('存储的数据不是数组');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
tableData1.value.splice(0, tableData1.value.length, ...storedData);
|
|
|
|
|
if (table1Ref.value) {
|
|
|
|
|
table1Ref.value.doLayout(); // 强制表格重新计算布局
|
|
|
|
|
}
|
|
|
|
|
console.log('加载成功,数据长度:', tableData1.value.length);
|
|
|
|
|
}, 1000)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|