diff --git a/src/lib/utils.js b/src/lib/utils.js
index d90349d..34e4e35 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -1,16 +1,16 @@
// 绘制黑白相间比例尺
export function drawScaleTwo(value, currentScaleUnit) {
- var canvas = document.querySelector('#scaleBar');
- var ctx = canvas.getContext('2d');
+ var canvas = document.querySelector("#scaleBar");
+ var ctx = canvas.getContext("2d");
canvas.height = 23;
// canvas.style.border = "1px solid #000"
// 把当前的上下文的状态保存起来
ctx.transform(1, 0, 0, 1, 15, 0);
ctx.save();
//设置比例尺文字样式
- const fontSize = '12';
+ const fontSize = "12";
ctx.font = "normal bold " + fontSize + "px Arial";
- ctx.fillStyle = 'white'
+ ctx.fillStyle = "white";
ctx.textBaseline = "hanging";
//比例尺最小格宽度、高度
const width = 35;
@@ -20,7 +20,7 @@ export function drawScaleTwo(value, currentScaleUnit) {
// if (i < 1) {
// ctx.fillText(0, width * i, 0);
// } else {
- ctx.fillText(parseFloat((i / 5 * value).toFixed(1)), width * i, 0);
+ ctx.fillText(parseFloat(((i / 5) * value).toFixed(1)), width * i, 0);
// }
}
ctx.transform(1, 0, 0, 1, 8, 0);
@@ -36,63 +36,89 @@ export function drawScaleTwo(value, currentScaleUnit) {
//描边的意思
ctx.stroke();
//设置填充的样式
- i % 2 === 0 ? ctx.fillStyle = 'black' : ctx.fillStyle = 'white'
+ i % 2 === 0 ? (ctx.fillStyle = "black") : (ctx.fillStyle = "white");
//进行填充的工作
ctx.fill();
}
}
//绘制格网
export function drawGrid(row, col, viewDom, extent) {
- var canvas = document.querySelector('#grid')
- const thematicMapDom = getcurrentdomwidth('mapContent')
- canvas.width = thematicMapDom.w
- canvas.height = thematicMapDom.h
+ var canvas = document.querySelector("#grid");
+ const thematicMapDom = getcurrentdomwidth("mapContent");
+ canvas.width = thematicMapDom.w;
+ canvas.height = thematicMapDom.h;
// canvas.style.border = '1px solid black'
- var ctx = canvas.getContext('2d')
+ var ctx = canvas.getContext("2d");
//获取格网dom真实宽高
- const gridDom = getcurrentdomwidth('grid')
+ const gridDom = getcurrentdomwidth("grid");
//获取专题图dom真实宽高
- const map2dDom = getcurrentdomwidth(viewDom)
+ const map2dDom = getcurrentdomwidth(viewDom);
//每一小格宽度
- const gridW = map2dDom.concentW / col
+ const gridW = map2dDom.concentW / col;
//每一小格高度
- const gridH = map2dDom.concentH / row
+ const gridH = map2dDom.concentH / row;
//每一小格高度
// const gridH=10
for (let i = 0; i < col; i++) {
//绘制上下格网
- ctx.moveTo(i * gridW + (thematicMapDom.paddingL) + 1, thematicMapDom.paddingT) //画笔移动到100,100点
- ctx.lineTo(i * gridW + (thematicMapDom.paddingL) + 1, thematicMapDom.paddingT - 2) //从画笔位置,画一条直线到200,100点
- ctx.moveTo(i * gridW + (thematicMapDom.paddingL - gridDom.paddingL) + 1, thematicMapDom.concentH + thematicMapDom.paddingT) //画笔移动到100,100点
- ctx.lineTo(i * gridW + (thematicMapDom.paddingL - gridDom.paddingL) + 1, thematicMapDom.concentH + thematicMapDom.paddingT + 6) //从画笔位置,画一条直线到200,100点
+ ctx.moveTo(i * gridW + thematicMapDom.paddingL + 1, thematicMapDom.paddingT); //画笔移动到100,100点
+ ctx.lineTo(i * gridW + thematicMapDom.paddingL + 1, thematicMapDom.paddingT - 2); //从画笔位置,画一条直线到200,100点
+ ctx.moveTo(
+ i * gridW + (thematicMapDom.paddingL - gridDom.paddingL) + 1,
+ thematicMapDom.concentH + thematicMapDom.paddingT
+ ); //画笔移动到100,100点
+ ctx.lineTo(
+ i * gridW + (thematicMapDom.paddingL - gridDom.paddingL) + 1,
+ thematicMapDom.concentH + thematicMapDom.paddingT + 6
+ ); //从画笔位置,画一条直线到200,100点
//设置线宽
- ctx.lineWidth = 1
+ ctx.lineWidth = 1;
//设置描边样式
- ctx.strokeStyle = 'blue' //rgb(),rgba(),red,#fff
- ctx.stroke() //描边
+ ctx.strokeStyle = "blue"; //rgb(),rgba(),red,#fff
+ ctx.stroke(); //描边
//绘制上下坐标文字[113, 30.2, 115, 32.2]
- const fontSize = '12'
- ctx.font = "normal bold " + fontSize + "px Arial"
- ctx.textBaseline = "bottom"
- ctx.fillText(DegreesCoverttoDuFenMiao(((extent[2] - extent[0]) / col * i + extent[0]).toString()) + 'E', i * gridW + (thematicMapDom.paddingL - gridDom.paddingL) - 18, thematicMapDom.paddingT)
+ const fontSize = "12";
+ ctx.font = "normal bold " + fontSize + "px Arial";
+ ctx.textBaseline = "bottom";
+ const ftMsg = ((extent[0] - extent[2]) / col) * i + extent[2];
+ const ftMsgUnit = ftMsg === 0 ? "" : ftMsg < 0 ? "W" : "E";
+ ctx.fillText(
+ DegreesCoverttoDuFenMiao(Math.abs(ftMsg).toString()) +
+ ftMsgUnit,
+ i * gridW + (thematicMapDom.paddingL - gridDom.paddingL) - 18,
+ thematicMapDom.paddingT
+ );
}
for (let i = 0; i < row; i++) {
//绘制左右格网
- ctx.moveTo(thematicMapDom.paddingL, i * gridH + thematicMapDom.paddingT + 1)
- ctx.lineTo(thematicMapDom.paddingL - 2, i * gridH + thematicMapDom.paddingT + 1)
- ctx.moveTo(thematicMapDom.paddingL + thematicMapDom.concentW + 4, i * gridH + thematicMapDom.paddingT + 1)
- ctx.lineTo(thematicMapDom.paddingL + thematicMapDom.concentW + 6, i * gridH + thematicMapDom.paddingT + 1)
+ ctx.moveTo(thematicMapDom.paddingL, i * gridH + thematicMapDom.paddingT + 1);
+ ctx.lineTo(thematicMapDom.paddingL - 2, i * gridH + thematicMapDom.paddingT + 1);
+ ctx.moveTo(
+ thematicMapDom.paddingL + thematicMapDom.concentW + 4,
+ i * gridH + thematicMapDom.paddingT + 1
+ );
+ ctx.lineTo(
+ thematicMapDom.paddingL + thematicMapDom.concentW + 6,
+ i * gridH + thematicMapDom.paddingT + 1
+ );
//设置线宽
- ctx.lineWidth = 2
+ ctx.lineWidth = 2;
//设置描边样式
- ctx.strokeStyle = 'blue' //rgb(),rgba(),red,#fff
- ctx.stroke() //描边
+ ctx.strokeStyle = "blue"; //rgb(),rgba(),red,#fff
+ ctx.stroke(); //描边
//设置比例尺文字样式
- ctx.textAlign = "right"
- const fontSize = '12'
- ctx.font = "normal bold " + fontSize + "px Arial"
- ctx.textBaseline = "hanging"
- ctx.fillText(DegreesCoverttoDuFenMiao(((extent[3] - extent[1]) / col * i + extent[1]).toString()) + 'N', thematicMapDom.paddingL - 2, i * gridH + thematicMapDom.paddingT + 1)
+ ctx.textAlign = "right";
+ const fontSize = "12";
+ ctx.font = "normal bold " + fontSize + "px Arial";
+ ctx.textBaseline = "hanging";
+ const ftMsg = ((extent[3] - extent[1]) / col) * i + extent[1];
+ const ftMsgUnit = ftMsg === 0 ? "" : ftMsg > 0 ? "N" : "S";
+ ctx.fillText(
+ DegreesCoverttoDuFenMiao(Math.abs(ftMsg).toString()) +
+ ftMsgUnit,
+ thematicMapDom.paddingL - 2,
+ i * gridH + thematicMapDom.paddingT + 1
+ );
}
}
function getcurrentdomwidth(dom) {
@@ -101,22 +127,26 @@ function getcurrentdomwidth(dom) {
const clientHeight = domObj.clientHeight;
const offsetWidth = domObj.offsetWidth;
const offsetHeight = domObj.offsetHeight;
- const clientLeft = parseFloat(getComputedStyle(domObj).getPropertyValue('padding-left'));
- const clientTop = parseFloat(getComputedStyle(domObj).getPropertyValue('padding-top'));
+ const clientLeft = parseFloat(getComputedStyle(domObj).getPropertyValue("padding-left"));
+ const clientTop = parseFloat(getComputedStyle(domObj).getPropertyValue("padding-top"));
return {
w: clientWidth,
h: clientHeight,
concentW: offsetWidth,
concentH: offsetHeight,
paddingL: clientLeft,
- paddingT: clientTop,
- }
+ paddingT: clientTop
+ };
}
function DegreesCoverttoDuFenMiao(degrees) {
let du = degrees.split(".")[0];
- let fen = ("0." + degrees.split(".")[1]) * 60 + '';
- let miao = (("0." + fen.split(".")[1]) * 60).toFixed(0);
- return du + "°" + fen.split(".")[0] + "′" + miao + "″";
+ if (degrees.split(".")[1] !== undefined) {
+ const fen = ("0." + degrees.split(".")[1]) * 60 + "";
+ const miao = (("0." + fen.split(".")[1]) * 60).toFixed(0);
+ return du + "°" + fen.split(".")[0] + "′" + miao + "″";
+ } else {
+ return du + "°";
+ }
}
//获取当前日期函数
export function getNowFormatDate() {
@@ -124,5 +154,5 @@ export function getNowFormatDate() {
year = date.getFullYear(),
month = date.getMonth() + 1,
strDate = date.getDate();
- return `${year}年${month}月${strDate}日`
-}
\ No newline at end of file
+ return `${year}年${month}月${strDate}日`;
+}
diff --git a/src/views/Daichuli/Feedback/Inspection/Report/index.vue b/src/views/Daichuli/Feedback/Inspection/Report/index.vue
index 6e1b701..5812e60 100644
--- a/src/views/Daichuli/Feedback/Inspection/Report/index.vue
+++ b/src/views/Daichuli/Feedback/Inspection/Report/index.vue
@@ -368,7 +368,8 @@ export default {
productImg: rpm.imgRes.productImg,
microwaveDataJson: asmp.microwaveDataJson,
satellite: asmm.satellite,
- load: asmm.load
+ load: asmm.load,
+ pixelHandleMsg:rpm.pixelHandleMsg
};
const pdfName = productTypeMap(self.pdSubType) + "报告";
exportWord(
diff --git a/src/views/Daichuli/Feedback/Inspection/index.vue b/src/views/Daichuli/Feedback/Inspection/index.vue
index f59725d..2fcfa56 100644
--- a/src/views/Daichuli/Feedback/Inspection/index.vue
+++ b/src/views/Daichuli/Feedback/Inspection/index.vue
@@ -404,6 +404,26 @@ export default {
this.$nextTick(function () {
this.screenCapture(this.sampleList, this.geoLayerPos).then(imgRes => {
const rm = res.data;
+ let pixelHandleMsg = null;
+ if (this.pixelFun !== ""){
+ switch(this.pixelFun){
+ case "1":
+ pixelHandleMsg = "均值法"
+ break;
+ case "6":
+ pixelHandleMsg = "最邻近法"
+ break;
+ case "7":
+ pixelHandleMsg = "克里格法"
+ break;
+ case "9":
+ pixelHandleMsg = "块克里格法"
+ break;
+ case "10":
+ pixelHandleMsg = "MSN法"
+ break;
+ }
+ }
const reportMsg = {
pdSubType: this.productSubType,
reportResult: rm,
@@ -419,7 +439,8 @@ export default {
token: this.token,
orderMsg: this.orderMsg,
productMsg: this.productMsg,
- imgRes: imgRes
+ imgRes: imgRes,
+ pixelHandleMsg:pixelHandleMsg
};
localStorage.setItem(
this.configration.path.inspection,
@@ -430,7 +451,6 @@ export default {
type: "success",
});
this.checkRealityWait = false;
- // console.log(reportMsg, imgRes);
this.$router.push({ name: "报告生成", params: reportMsg });
});
})
diff --git a/src/views/Daichuli/index.vue b/src/views/Daichuli/index.vue
index 0ef1262..5338c27 100644
--- a/src/views/Daichuli/index.vue
+++ b/src/views/Daichuli/index.vue
@@ -165,7 +165,7 @@ export default {
// 适配完成产品
// 土壤盐:153079 干涉形变:153086 干涉大气 153087 正射:152945
- this.$router.push("/orderUnprocessed?orderId=153047&token=WEB*1702299264098@DA43_ZZX-yg000087_0149c8db76114f06a91e15707f103a0d");
+ this.$router.push("/orderUnprocessed?orderId=153883&token=WEB*1715412734577@BYT9_ZZX-gxfw001132_8906acd45c0a45feb0b584207a8f2568");
},
},
};
diff --git a/vue.config.js b/vue.config.js
index 5f935a7..df2eb32 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -35,16 +35,16 @@ module.exports = {
}
},
[process.env.VUE_APP_REALITY_API]: {
- target: "http://124.16.188.131:28092/microwave",
- // target: "http://192.168.8.181:18092/microwave",
+ // target: "http://124.16.188.131:28092/microwave",
+ target: "http://192.168.1.79:18092/microwave",
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_REALITY_API]: ""
}
},
[process.env.VUE_APP_FILE_API]: {
- target: "http://124.16.188.131:28093/file",
- // target: "http://192.168.8.181:18093/file",
+ // target: "http://124.16.188.131:28093/file",
+ target: "http://192.168.1.79:18093/file",
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_FILE_API]: ""