Commit af79acb9 by 潘建波

feat 修改任务暂停时才允许任务修改

feat 任务修改不允许修改算法
feat 10分钟内不操作自动退出
feat 流量检索增加车头时距和时间占有率
feat 单任务导出及导入功能
feat 全局备份功能
BUG:修改子任务下发设备类型要依据大任务类型
1 parent f50e135f
No preview for this file type
{"commit":"147527b465f70b1c96a69fc30e9f85f15703fade","commitDate":"2020-7-23 18:26","buildDate":"2020-7-23 18:32","version":"2.0.6","info":"数据备份功能"}
\ No newline at end of file
{"commit":"f50e135f98d88e0c746c1624dca76a8db58e319d","commitDate":"2020-7-24 9:56","buildDate":"2020-7-30 17:15","version":"2.0.6","info":"【NEW】导入导出功能 【NEW】详情加视频播放功能 【BUG】添加视频源提示取消后不能回选"}
\ No newline at end of file
......@@ -10,7 +10,7 @@ import ops from "./ops";
let wsIP = "";
switch (process.env.NODE_ENV) {
case "development":
wsIP = "192.168.9.149:20080"; // 测试环境url
wsIP = "192.168.9.233:20080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
break;
case "pre":
......
......@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) {
case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = "http://192.168.9.62:20080"; // 测试环境url
baseUrl = "http://192.168.9.233:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
......
......@@ -59,5 +59,11 @@ export default {
},
suspendAlternate(taskid, subtaskid, suspend) {
return api.get(urls.suspendAlternate(taskid, subtaskid, suspend));
},
exportParams(subtaskid) {
return api.get(urls.exparams(subtaskid));
},
importParams(subtaskid) {
return api.get(urls.upparams(subtaskid));
}
};
......@@ -54,5 +54,11 @@ export default {
},
suspendAlternate: (taskid, subtaskid, suspend) => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_alternate_task?suspend=${suspend}`; // 开启关闭轮询
},
exparams: subtaskid => {
return `${baseUrl}/api/v1/devconf_fx/export/${subtaskid}`; // 参数导出
},
upparams: subtaskid => {
return `${baseUrl}/api/v1/devconf_fx/import/${subtaskid}`; // 参数导出
}
};
......@@ -14,7 +14,7 @@
></span>
<div class="headRight">
<span>{{ curdate }}</span>
<img @click="resetpass" src="../../assets/img/home/user.png" alt="" />
<img @click="resetpass" src="../../assets/img/home/user.png" alt="" />
<span class="exit" @click="logout()"
>退出<i class="el-icon-arrow-down"></i
></span>
......@@ -128,10 +128,14 @@ export default {
localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken");
this.$router.push("/login").catch(err => {err});
this.$router.push("/login").catch(err => {
err;
});
},
resetpass(){
this.$router.push("/resetpass").catch(err => {err});
resetpass() {
this.$router.push("/resetpass").catch(err => {
err;
});
}
},
created() {
......@@ -157,20 +161,28 @@ export default {
console.log(this.conHeight);
//监听退出全屏事件
var that = this;
document.onkeydown = function(event) {
document.onkeydown = function(event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode == 122) {
if (that.isfull) {
that.isfull = false;
console.log(1)
} else {
console.log(1);
} else {
that.isfull = true;
console.log(2)
}
console.log(2);
}
}
};
let app = document.getElementById("app");
app.addEventListener("mousemove", () => {
clearTimeout(this.mousetimer);
this.mousetimer = setTimeout(() => {
clearTimeout(this.mousetimer);
this.mousetimer = null;
this.logout();
}, 600000);
});
// window.onresize = function() {
// console.log("full",that.isfull)
// if (that.isfull) {
......@@ -194,7 +206,7 @@ export default {
// }
// return isFull;
// }
setInterval(() => {
this.getDate();
}, 1000);
......
......@@ -176,9 +176,7 @@ export default {
});
} else {
this.vchandata = vdata.vchan;
setTimeout(() => {
this.getPlayUrl();
}, 2000);
this.getPlayUrl();
}
});
},
......
......@@ -12,7 +12,7 @@
:model="paramform"
v-show="curtype === 'upload'"
>
<el-form-item label="类型">
<!-- <el-form-item label="类型">
<el-select v-model="paramform.fileType">
<el-option
v-for="type in types"
......@@ -24,18 +24,19 @@
</el-form-item>
<el-form-item label="名称">
<el-input v-model="paramform.name"></el-input>
</el-form-item>
</el-form-item> -->
<el-form-item label="文件">
<el-upload
class="upload-demo"
ref="paramsup"
action=""
:action="uploadurl"
:on-change="handlePreview"
multiple
:limit="1"
:auto-upload="false"
:on-success="sucessfile"
:file-list="fileList"
:on-error="errorfile"
>
<el-button size="small" slot="trigger" type="primary"
>点击上传</el-button
......@@ -81,57 +82,49 @@ export default {
fileList: [],
types: [],
curtype: "",
upfile: ""
upfile: "",
uploadurl: "",
subtaskid: ""
};
},
methods: {
show(type) {
show(type, subid) {
this.curtype = type;
this.subtaskid = subid;
this.dialogVisible = true;
this.$store.commit("setocxstate", 1);
this.uploadurl = `http://${location.host}/api/v1/devconf_fx/import/${this.subtaskid}`;
this.$store.commit("setocxstate", 0);
},
handlePreview(file, fileList) {
if (this.uploadFile(file, "application/x-gzip")) {
this.upfile = file;
return false;
} else {
this.fileList = [];
let modalFileExt = file.name.slice(-7);
if (modalFileExt !== ".tar.gz") {
this.$message({
type: "warning",
message: '仅支持"*.tar.gz"文件'
});
this.$refs.paramsup.clearFiles();
return false;
}
},
uploadparams() {
let render = new FileReader();
let file_text = "";
reader.readAsDataURL(this.upfile);
reader.onloadend = () => {
let dataURL = reader.result.split(";base64,");
let file_ext = "";
if (this.upfile.name.slice(-7) === ".tar.gz") {
file_ext = ".tar.gz";
} else if (this.upfile.name.slice(-3) === ".gz") {
file_ext = ".gz";
}
};
let obj = {
command: "put /wsapi/v1/devconf_fx/conf_param",
src_page: "",
params: {
type_code: this.paramform.fileType,
subtask_id: this.subtask_id,
conf_name: this.paramform.name,
file_ext: file_ext,
file_b64: dataURL[1],
is_temp: 1
}
};
this.globalWs.send(JSON.stringify(obj));
console.log(this.upfile);
this.$refs.paramsup.submit();
},
sucessfile() {
this.$message({
message: "导入成功请重新点击任务查看!",
type: "success"
});
this.dialogVisible = false;
this.$store.commit("setocxstate", 1)
},
errorfile(err){
console.log(err);
},
sucessfile() {},
submitParamSet() {},
handleClose(done) {
(this.dialogVisible = false), this.$store.commit("setocxstate", 0);
(this.dialogVisible = false), this.$store.commit("setocxstate", 1);
},
getTypes() {
let params = {
......@@ -142,9 +135,6 @@ export default {
this.types = res.list_data;
});
}
},
created() {
this.getTypes();
}
};
</script>
......
......@@ -64,7 +64,9 @@
<el-tooltip
class="item"
effect="dark"
:content="taskInfo.calibration_status == 0 ? '运行中' : '下发中'"
:content="
taskInfo.calibration_status == 0 ? '运行中' : '下发中'
"
placement="top"
>
<span @click="setDemarcate(scope.row, scope.$index)"
......@@ -98,7 +100,7 @@
效果展示 <span class="set-icon el-icon-s-help"></span>
</div>
</div>
<handleparam ref="handleparam"></handleparam>
<handleparam ref="handleparam" :subtaskid="subtaskid"></handleparam>
</div>
<div class="yt-box">
<ytconfig
......@@ -179,7 +181,15 @@ export default {
}
},
handleparam(type) {
this.$refs.handleparam.show(type);
if (type == "upload") {
this.$refs.handleparam.show(type,this.subtaskid);
} else {
this.$api.task.exportParams(this.subtaskid).then(res => {
if (res.ecode == 200) {
location.href = res.enote;
}
});
}
},
setsounces() {
if (this.checkpollstate()) {
......@@ -240,12 +250,14 @@ export default {
type: "warning"
})
.then(() => {
debugger;
that.taskInfo.mtasks[0].scenes.map(ele => {
debugger;
if (ele.scene_unid == row.scene_unid) {
ele.config = {};
ele.rois[0].roi =
'<?xml version="1.0" encoding="UTF-8" ?><roi><flow_roi><flow_type></flow_type><flow_region><polygon_point_count>0</polygon_point_count></flow_region></flow_roi><plate_detect_region><detect_polygon><polygon_point_count>0</polygon_point_count></detect_polygon></plate_detect_region><lane_line><line_count>0</line_count></lane_line><lanes><lane_count>0</lane_count></lanes><lights><light_count>0</light_count></lights><no_stop_region><region_count>0</region_count></no_stop_region><pedestrian_detection_region><region_count>0</region_count></pedestrian_detection_region><median_lines><lane_count>0</lane_count></median_lines><pedestrian_density_region><region_count>0</region_count></pedestrian_density_region><foreign_detection_region><region_count>0</region_count></foreign_detection_region><test_result_region><region_count>0</region_count></test_result_region></roi>';
if (ele.rois) {
ele.rois[0].roi =
'<?xml version="1.0" encoding="UTF-8" ?><roi><flow_roi><flow_type></flow_type><flow_region><polygon_point_count>0</polygon_point_count></flow_region></flow_roi><plate_detect_region><detect_polygon><polygon_point_count>0</polygon_point_count></detect_polygon></plate_detect_region><lane_line><line_count>0</line_count></lane_line><lanes><lane_count>0</lane_count></lanes><lights><light_count>0</light_count></lights><no_stop_region><region_count>0</region_count></no_stop_region><pedestrian_detection_region><region_count>0</region_count></pedestrian_detection_region><median_lines><lane_count>0</lane_count></median_lines><pedestrian_density_region><region_count>0</region_count></pedestrian_density_region><foreign_detection_region><region_count>0</region_count></foreign_detection_region><test_result_region><region_count>0</region_count></test_result_region></roi>';
}
ele.runtime = 0;
}
});
......@@ -346,10 +358,10 @@ export default {
query: {
taskid: this.taskid,
subtaskid: this.subtaskid,
playurl: this.playurl?this.playurl.rtsp_url:''
playurl: this.playurl ? this.playurl.rtsp_url : ""
}
});
localStorage.setItem('showulr',JSON.stringify(this.playurl))
localStorage.setItem("showulr", JSON.stringify(this.playurl));
setTimeout(() => {
window.open(routeData.href, "_blank");
}, 0);
......
......@@ -161,8 +161,17 @@
</div>
</template>
</el-table-column>
<el-table-column prop="time_occupy" align="center" label="时间占有率%">
<template slot-scope="scope">
<div>
{{ (scope.row.time_occupy * 100).toFixed(2) }}
</div>
</template>
</el-table-column>
<el-table-column prop="sample_dura" align="center" label="统计周期(秒)">
</el-table-column>
<el-table-column prop="dist_time" align="center" label="车头时距(秒)">
</el-table-column>
<el-table-column prop="distance" align="center" label="车头间距(m)">
<template slot-scope="scope">
<div>
......
......@@ -36,6 +36,7 @@
v-model="formData.task_algo_type"
placeholder="请选择"
:popper-append-to-body="false"
:disabled="pedittype == 'edit'"
>
<el-option value="" label="--"></el-option>
<el-option value="0" label="交通"></el-option>
......@@ -108,10 +109,7 @@
</el-select>
</el-form-item>
<el-form-item label="设备类型" class="form-item">
<el-select
v-model="formData.plate_type"
:disabled="pedittype != 'add'"
>
<el-select v-model="formData.plate_type">
<el-option
v-for="(item, index) in platT"
:key="index"
......
......@@ -20,8 +20,8 @@
<span class="subtask-info">{{ subTaskData.video_total }}</span> -->
<span class="label">任务信息</span>
<span class="subtask-info">{{ subTaskData.info }}</span>
<span class="label" hidden>分析设备</span>
<span class="subtask-info" hidden>
<span class="label">分析设备</span>
<span class="subtask-info">
<el-select v-model="assign_id" filterable>
<!-- <el-option
v-for="(item, index) in freeList"
......@@ -43,6 +43,7 @@
? item.license_info.platType
: '')}`
"
v-if="subTaskData.plate_type == item.license_info.platType || subTaskData.plate_type === item.in_ip"
>
{{ item.in_ip }}
{{
......@@ -69,7 +70,7 @@
</el-option> -->
</el-select>
</span>
<span class="label sub-btn" @click="subMove" hidden>确定</span>
<span class="label sub-btn" @click="subMove" >确定</span>
</div>
</template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!