Commit b4977852 by 潘建波

提交

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