From d19ce951aaa8fbcd4be227387ae81fb41d26e989 Mon Sep 17 00:00:00 2001
From: duxiaoning <17621883433@163.com>
Date: Mon, 4 Dec 2023 18:11:03 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E5=91=8A=E4=B8=89?=
=?UTF-8?q?=E8=A6=81=E7=B4=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/images/compass_one.svg | 37 +
src/components/ration/otgCorrection/index.vue | 344 +-
src/components/ration/qualitative/index.vue | 233 +-
src/components/ration/soilMoisture/index.vue | 341 +-
src/lib/cesiumUtils.js | 17 +-
src/lib/html2canvas.js | 9013 +++++++++++++++++
src/lib/otgCesiumUtils.js | 26 +-
src/lib/utils.js | 128 +
.../Feedback/Inspection/Report/index.vue | 6 +-
.../Daichuli/Feedback/Inspection/index.vue | 457 +-
src/views/Daichuli/index.vue | 4 +-
vue.config.js | 6 +-
12 files changed, 10121 insertions(+), 491 deletions(-)
create mode 100644 src/assets/images/compass_one.svg
create mode 100644 src/lib/html2canvas.js
create mode 100644 src/lib/utils.js
diff --git a/src/assets/images/compass_one.svg b/src/assets/images/compass_one.svg
new file mode 100644
index 0000000..6ef4b63
--- /dev/null
+++ b/src/assets/images/compass_one.svg
@@ -0,0 +1,37 @@
+
+
\ No newline at end of file
diff --git a/src/components/ration/otgCorrection/index.vue b/src/components/ration/otgCorrection/index.vue
index d7d2ebc..8af2f98 100644
--- a/src/components/ration/otgCorrection/index.vue
+++ b/src/components/ration/otgCorrection/index.vue
@@ -7,54 +7,23 @@
-
-
-
-
-
-
选取点
-
保存点
+
+
+ 待检验产品图
+
+
+
+
+
+
+

+
+
+
+
+
+ 制图单位:中国科学院空天信息创新院
+ 制图日期:{{ createImgTime }}
-
+
+
-

+
点之记
- 近景
+ 近景
远景
-
+
@@ -200,7 +136,7 @@ import SampleSetting from "@/components/ration/sampleSetting/index.vue";
import WKT from "terraformer-wkt-parser";
import Formator from "@/mixins/formator";
import cu from "@/lib/cesiumUtils";
-
+import { drawScaleTwo, drawGrid, getNowFormatDate } from "@/lib/utils"
export default {
components: { Pagination, SampleSetting, OtgProductInfo },
mixins: [Formator],
@@ -240,6 +176,9 @@ export default {
projection: {
require: true,
},
+ checkRealityWait: {
+ require: true,
+ }
},
data() {
return {
@@ -266,6 +205,8 @@ export default {
funcOpt: [],
isDeepSpace: false,
depthList: [],
+ createImgTime: null,
+ screenImgStg: true,
};
},
mounted() {
@@ -286,7 +227,105 @@ export default {
this.getSqlData();
this.initParam();
},
+ watch: {
+ checkRealityWait(val) {
+ if (val) {
+ this.screenImgStg = false;
+ this.addPointInScreenImg();
+ window.selfDefine.farViewer.scene.postRender.addEventListener(this.addScale);
+ window.selfDefine.farViewer.scene.postRender.addEventListener(this.addGrid);
+ this.createImgTime = getNowFormatDate();
+ } else {
+ this.removeListener();
+ this.createImgTime = null;
+ this.screenImgStg = true;
+ }
+ }
+ },
+ destroyed() {
+ this.removeListener();
+ },
methods: {
+ addScale() {
+ let barWidth = undefined;
+ let currentScaleUnit = undefined;
+ var geodesic = new Cesium.EllipsoidGeodesic();
+ var distances = [
+ 1, 2, 3, 5, 10, 20, 30, 50, 100, 200, 300, 500, 1000, 2000, 3000, 5000,
+ 10000, 20000, 30000, 50000, 100000, 200000, 300000, 500000, 1000000,
+ 2000000, 3000000, 5000000, 10000000, 20000000, 30000000, 50000000,
+ ];
+ // Find the distance between two pixels at the bottom center of the screen.
+ let scene = window.selfDefine.farViewer.scene;
+ let width = scene.canvas.clientWidth;
+ let height = scene.canvas.clientHeight;
+ let left = scene.camera.getPickRay(
+ new Cesium.Cartesian2((width / 2) | 0, height - 1)
+ );
+ let right = scene.camera.getPickRay(
+ new Cesium.Cartesian2((1 + width / 2) | 0, height - 1)
+ );
+ let globe = scene.globe;
+ let leftPosition = globe.pick(left, scene);
+ let rightPosition = globe.pick(right, scene);
+ if (!Cesium.defined(leftPosition) || !Cesium.defined(rightPosition)) {
+ barWidth = undefined;
+ currentScaleUnit = undefined;
+ return;
+ }
+ let leftCartographic =
+ globe.ellipsoid.cartesianToCartographic(leftPosition);
+ let rightCartographic =
+ globe.ellipsoid.cartesianToCartographic(rightPosition);
+ geodesic.setEndPoints(leftCartographic, rightCartographic);
+ let pixelDistance = geodesic.surfaceDistance;
+ // Find the first distance that makes the scale bar less than 100 pixels.
+ let maxBarWidth = 100;
+ let distance;
+ for (
+ let i = distances.length - 1;
+ !Cesium.defined(distance) && i >= 0;
+ --i
+ ) {
+ if (distances[i] / pixelDistance < maxBarWidth) {
+ distance = distances[i];
+ }
+ }
+ if (Cesium.defined(distance)) {
+ currentScaleUnit =
+ distance >= 1000
+ ? "km" : "m";
+ barWidth = distance >= 1000
+ ? (distance / 1000).toString()
+ : distance.toString();
+ } else {
+ barWidth = undefined;
+ currentScaleUnit = undefined;
+ }
+ drawScaleTwo(barWidth, currentScaleUnit)
+ },
+ addGrid() {
+ const cesiumExtent = window.selfDefine.farViewer.camera.computeViewRectangle();
+ const params = {};
+ params.xmax = Cesium.Math.toDegrees(cesiumExtent.east);
+ params.ymax = Cesium.Math.toDegrees(cesiumExtent.north);
+ params.xmin = Cesium.Math.toDegrees(cesiumExtent.west);
+ params.ymin = Cesium.Math.toDegrees(cesiumExtent.south);
+ drawGrid(6, 6, 'farViewer', [params.xmax, params.ymax, params.xmin, params.ymin])
+ },
+ removeListener() {
+ window.selfDefine.farViewer.scene.postRender.removeEventListener(this.addScale);
+ window.selfDefine.farViewer.scene.postRender.removeEventListener(this.addGrid);
+ },
+ addPointInScreenImg() {
+ const dl = this.multipleSelection;
+ for (let i in dl) {
+ const lon = dl[i].measureLong,
+ lat = dl[i].measureLat,
+ alt = 10;
+ otgCesiumUtils.addPointToViewer(lon, lat, alt);
+ }
+ },
handleStepSampling(newVal) {
this.stepSampling = newVal;
},
@@ -374,7 +413,7 @@ export default {
}
ssForm.append("splCount", ssn);
getSamplesByLayer(ssForm).then((res) => {
- if (res.length === 0 || res === []) {
+ if (res.length === 0 || res == []) {
self.multipleSelection = self.simpleData = [];
cu.removePoint();
this.$message.error("当前分层设置返回列表为空");
@@ -499,7 +538,7 @@ export default {
this.multipleSelection =
this.allSampleData =
this.simpleData =
- res.data.list;
+ res.data.list;
this.loading = false;
this.$refs.multipleTable.toggleAllSelection();
let min = Number.MAX_SAFE_INTEGER;
@@ -576,7 +615,82 @@ export default {
margin: 5px 15px 0 15px;
width: 33%;
height: 360px;
- background-color: rgb(110, 110, 207);
+ // background-color: rgb(110, 110, 207);
+ position: relative;
+
+ .topContent {
+ height: 23px;
+ width: 100%;
+ text-align: center;
+ line-height: 23px;
+
+ .mapTitle {
+ font-size: 20px;
+ font-weight: bold;
+ }
+ }
+
+ #mapContent {
+ height: calc(100% - 100px);
+ position: relative;
+ padding-left: 70px;
+ padding-top: 30px;
+
+ #grid {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ left: 0;
+ }
+
+ .compass {
+ width: 50px;
+ height: 50px;
+ position: absolute;
+ top: 10px;
+ right: 20px;
+ z-index: 2;
+ }
+
+ #scaleBar {
+ width: 200px;
+ height: 40px;
+ position: absolute;
+ bottom: 10px;
+ left: 20px;
+ z-index: 2;
+ }
+ }
+
+ #cesiumContent {
+ height: 100%;
+ position: relative;
+ }
+
+ #farViewer {
+ // width: calc(100% - 5px);
+ width: 100%;
+ // height: calc(100% - 5px);
+ height: 100%;
+ overflow: hidden;
+ position: relative;
+ // border: 2px solid black;
+ }
+
+ .bottomCont {
+ height: 60px;
+ text-align: left;
+ width: fit-content;
+ transform: translateX(-100%);
+ margin-left: 100%;
+ white-space: nowrap;
+ }
+}
+
+.onBorder {
+ border: 1px solid;
+ background-color: #fff;
}
.imgCtrl {
diff --git a/src/components/ration/qualitative/index.vue b/src/components/ration/qualitative/index.vue
index 1527923..40328f3 100644
--- a/src/components/ration/qualitative/index.vue
+++ b/src/components/ration/qualitative/index.vue
@@ -52,10 +52,10 @@
+ element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" :data="simpleData"
+ tooltip-effect="dark" :header-cell-style="headerRowClass" style="width: 98%; margin-left: 1%"
+ @selection-change="handleSelectionChange" :stripe="true" :cell-style="tableRowClassName" height="400"
+ size="medium">
@@ -107,7 +107,25 @@
待检验产品及样本分布结果
-
+
+
+ 待检验产品图
+
+
+
+
+
+

+
+
+
+
+
+ 制图单位:中国科学院空天信息创新院
+ 制图日期:{{ createImgTime }}
+
+
+