Commit b4977852 by 潘建波

提交

1 parent 1a6c93de
No preview for this file type
......@@ -2,11 +2,11 @@
/*
* @Author: panda
* @Date: 2021-12-28 16:16:47
* @LastEditTime: 2022-01-04 21:51:45
* @LastEditTime: 2022-02-14 15:43:56
* @LastEditors: Please set LastEditors
* @Description: 全局配置
* @FilePath: /SDC-Face-Web/public/js/config.js
*/
window.config = {
BASE_URL:'https://'+ location.host
BASE_URL:'http://'+ location.host
}
\ No newline at end of file
/*
* @Author: panda
* @Date: 2021-12-18 13:45:24
* @LastEditTime: 2021-12-27 19:18:50
* @LastEditTime: 2022-01-07 09:47:13
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/api/axios.js
......@@ -80,7 +80,7 @@ service.interceptors.response.use(response => {
err => {
// endLoading();
if (err && err.response) {
Message.error({ message: err.response.data.enote });
// Message.error({ message: err.response.data.enote });
} else {
Message.error({ message: "连接服务器失败!" });
}
......
<!--
* @Author: panda
* @Date: 2021-12-18 12:57:47
* @LastEditTime: 2022-01-04 16:29:58
* @LastEditTime: 2022-02-14 15:32:50
* @LastEditors: Please set LastEditors
* @Description: 算法配置
* @FilePath: /sdc-face/src/views/Algo/index.vue
......@@ -19,6 +19,7 @@
:rois="roidata"
ref="rois"
@roiset="saveConfig"
@imgLoad="imgload"
></roicontent>
</div>
<div class="about-set">
......@@ -89,7 +90,7 @@
>进门线</el-button
>
</el-popover>
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="primary" @click="saveRoi()" size="mini"
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="primary" :disabled="disabled" @click="saveRoi()" size="mini"
>保存</el-button
>
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="defalut" @click="resetRoi()" size="mini"
......@@ -188,6 +189,7 @@ export default {
checked: false,
doorLine: 1,
shape: "rect",
disabled:false,
advvisbale: false,
shapevisible: false,
roiimg: "",
......@@ -280,19 +282,17 @@ export default {
* @return {*}
*/
saveConfig(type,data){
this.disabled = true;
let info = "";
if(type == 'config') {
// this.algconfigData.scene[0].config.json = JSON.stringify(data);
this.algconfigData.scene.config.json.face = data;
info = "参数配置成功!"
} else if(type == 'roi') {
// this.algconfigData.scene[0].rois.roi = JSON.stringify(data)
this.algconfigData.scene.rois = data;
info = "标定配置成功!"
}
this.$api.setAlgo(this.algconfigData).then(res => {
if(res.success) {
this.getConfig('refresh');
// this.algconfigData.scene.config = this.algoform;
this.$message({
message: info,
......@@ -301,6 +301,10 @@ export default {
}
})
},
imgload(){
console.log('============loadingsuccess========')
this.disabled = false;
},
/**
* @description: 保存ROI设置
* @param {*}
......@@ -311,6 +315,7 @@ export default {
},
resetRoi(){
this.$refs.rois.resetRoi()
this.disabled = false;
},
},
created(){
......
<!--
* @Author: your name
* @Date: 2021-12-18 17:18:34
* @LastEditTime: 2022-01-04 16:30:41
* @LastEditTime: 2022-02-16 14:59:08
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/views/Algo/roi.vue
......@@ -47,15 +47,20 @@ export default {
bgUrl: "",
drawWidth: 2,
roitype: "",
xscale:"",
yscale:""
};
},
props: ["dtype", "rois"],
watch: {
rois() {},
// rois() {
// this.initRoI();
// },
},
methods: {
imgload() {
this.initRoI();
this.$emit('imgLoad')
},
setDrawType(val, type) {
//获取所有绘制的对象
......@@ -77,7 +82,7 @@ export default {
initRoI() {
let {
linexysets: [{ coordinates: linec }],
directionxysets: [{ coordinates: directc }],
directionxysets: directc,
recxysets: [{ coordinates: recxc }],
} = this.rois[0].roi;
//绘制设备区域
......@@ -135,7 +140,7 @@ export default {
let mousxy = this.setxy(points[0]);
mouseFrom.x = mousxy.x;
mouseFrom.y = mousxy.y;
let mouseToxy = this.setxy(points[3]);
let mouseToxy = this.setxy(points[2]);
mouseTo.x = mouseToxy.x;
mouseTo.y = mouseToxy.y;
},
......@@ -163,8 +168,14 @@ export default {
this.polygonpoint = pointarr;
},
initArrow(points) {
let mfxy = this.setxy(points[0]);
let mtxy = this.setxy(points[1]);
let mfxy = this.setxy({
x:points[0].beginx,
y:points[0].beginy,
});
let mtxy = this.setxy({
x:points[0].endx,
y:points[0].endy,
});
mouseFrom.x = mfxy.x;
mouseFrom.y = mfxy.y;
......@@ -291,8 +302,15 @@ export default {
cvunselect = false;
});
this.canvasObject.drawtype = drawType;
vthis.canvas.add(this.canvasObject); //.setActiveObject(canvasObject)
drawingObject = this.canvasObject;
if(drawType=='arrow') {
let {lineCoords:{br:{x,y}},path} = this.canvasObject;
this.xscale = path[3][1]/x
this.yscale = path[3][2]/y
}
}
},
addPoint(e) {
......@@ -546,7 +564,7 @@ export default {
activeObj.hasBorders = true
activeObj.hasControls = true
activeObj?this.canvas.setActiveObject(activeObj):null;
this.canvas.renderAll();
// this.canvas.renderAll();
} else if(activeObj && activeObj.drawtype == 'arrow'){
cavArr.map(ele => {
if(ele.drawtype == 'arrow'){
......@@ -686,21 +704,24 @@ export default {
this.rois[0].roi["linexysets"] = linspoint;
} else if (ele.roitype == "recxysets" && ele.drawtype == "rect") {
let { tl, tr, bl, br } = ele.aCoords;
bl.x = parseInt(bl.x * scalWidth);
bl.y = parseInt(bl.y * scalHeight);
br.x = parseInt(br.x * scalWidth);
br.y = parseInt(br.y * scalHeight);
tl.x = parseInt(tl.x * scalWidth);
tl.y = parseInt(tl.y * scalHeight);
tr.x = parseInt(tr.x * scalWidth);
tr.y = parseInt(tr.y * scalHeight);
br.x = parseInt(br.x * scalWidth);
br.y = parseInt(br.y * scalHeight);
bl.x = parseInt(bl.x * scalWidth);
bl.y = parseInt(bl.y * scalHeight);
let obj = {
coordinates: [],
};
obj.coordinates.push(tl);
obj.coordinates.push(tr);
obj.coordinates.push(bl);
obj.coordinates.push(br);
obj.coordinates.push(bl);
obj.coordinates.push(tl);
recxysets.push(obj);
this.rois[0].roi["recxysets"] = recxysets;
areaisActive = true;
......@@ -719,22 +740,24 @@ export default {
this.rois[0].roi["recxysets"] = recxysets;
areaisActive = true;
} else if (ele.roitype == "directionxysets") {
let { path } = ele;
let x = parseInt(path[0][1] * scalWidth);
let y = parseInt(path[0][2] * scalHeight);
let x1 = parseInt(path[3][1] * scalWidth);
let y1 = parseInt(path[3][2] * scalHeight);
let { path,top,left} = ele;
let { br} = ele.lineCoords;
let x = parseInt(left * scalWidth);
let y = parseInt((top-1) * scalHeight);
let x1,y1;
if(path[3][1]/br.x == this.xscale) {
x1 = parseInt(path[3][1] * scalWidth);
y1 = parseInt(path[3][2] * scalHeight);
} else {
x1 = parseInt(br.x*this.xscale * scalWidth);
y1 = parseInt(br.y*this.yscale * scalHeight);
}
let obj = {
coordinates: [
{
x: x,
y: y,
},
{
x: x1,
y: y1,
},
],
beginx: x,
beginy: y,
endx: x1,
endy: y1,
};
directionxysets.push(obj);
this.rois[0].roi["directionxysets"] = directionxysets;
......@@ -749,16 +772,14 @@ export default {
} else if (!doorLineActive) {
info = "请绘制进门线";
} else {
console.log(
"🚀 ~ file: roi.vue ~ line 638 ~ saveRoi ~ this.rois",
this.rois
);
this.$emit("roiset", "roi", this.rois);
}
if(info != "") {
this.$message({
message: info,
type: "warning",
});
}
},
},
mounted() {
......
/*
* @Author: your name
* @Date: 2021-12-24 14:16:06
* @LastEditTime: 2021-12-28 16:32:37
* @LastEditTime: 2022-02-14 15:02:53
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/API20211215/vue.config.js
......@@ -19,7 +19,8 @@ module.exports = {
proxy:{
'/SDCAPI':{ // 路径中有 /api 的请求都会走这个代理 , 可以自己定义一个,下面移除即可
target:'http://huayan.320.io/', // 目标代理接口地址,实际跨域要访问的接口,这个地址会替换掉 axios.defaults.baseURL
// target:'http://huayan.320.io/', // 目标代理接口地址,实际跨域要访问的接口,这个地址会替换掉 axios.defaults.baseURL
target:'http://3d1576a219.wicp.vip/',
secure:false,
changeOrigin:true, // 开启代理,在本地创建一个虚拟服务端
ws:true, // 是否启用 websockets;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!