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 \ 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 \ No newline at end of file
...@@ -10,7 +10,7 @@ import ops from "./ops"; ...@@ -10,7 +10,7 @@ import ops from "./ops";
let wsIP = ""; let wsIP = "";
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
wsIP = "192.168.9.149:20080"; // 测试环境url wsIP = "192.168.9.233:20080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
break; break;
case "pre": case "pre":
......
...@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV); ...@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url // 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.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
......
...@@ -59,5 +59,11 @@ export default { ...@@ -59,5 +59,11 @@ export default {
}, },
suspendAlternate(taskid, subtaskid, suspend) { suspendAlternate(taskid, subtaskid, suspend) {
return api.get(urls.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 { ...@@ -54,5 +54,11 @@ export default {
}, },
suspendAlternate: (taskid, subtaskid, suspend) => { suspendAlternate: (taskid, subtaskid, suspend) => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_alternate_task?suspend=${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 @@ ...@@ -14,7 +14,7 @@
></span> ></span>
<div class="headRight"> <div class="headRight">
<span>{{ curdate }}</span> <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()" <span class="exit" @click="logout()"
>退出<i class="el-icon-arrow-down"></i >退出<i class="el-icon-arrow-down"></i
></span> ></span>
...@@ -128,10 +128,14 @@ export default { ...@@ -128,10 +128,14 @@ export default {
localStorage.removeItem("curmenu"); localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, ""); this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken"); localStorage.removeItem("atoken");
this.$router.push("/login").catch(err => {err}); this.$router.push("/login").catch(err => {
err;
});
}, },
resetpass(){ resetpass() {
this.$router.push("/resetpass").catch(err => {err}); this.$router.push("/resetpass").catch(err => {
err;
});
} }
}, },
created() { created() {
...@@ -157,20 +161,28 @@ export default { ...@@ -157,20 +161,28 @@ export default {
console.log(this.conHeight); console.log(this.conHeight);
//监听退出全屏事件 //监听退出全屏事件
var that = this; var that = this;
document.onkeydown = function(event) { document.onkeydown = function(event) {
var e = event || window.event || arguments.callee.caller.arguments[0]; var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode == 122) { if (e && e.keyCode == 122) {
if (that.isfull) { if (that.isfull) {
that.isfull = false; that.isfull = false;
console.log(1) console.log(1);
} else { } else {
that.isfull = true; 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() { // window.onresize = function() {
// console.log("full",that.isfull) // console.log("full",that.isfull)
// if (that.isfull) { // if (that.isfull) {
...@@ -194,7 +206,7 @@ export default { ...@@ -194,7 +206,7 @@ export default {
// } // }
// return isFull; // return isFull;
// } // }
setInterval(() => { setInterval(() => {
this.getDate(); this.getDate();
}, 1000); }, 1000);
......
...@@ -176,9 +176,7 @@ export default { ...@@ -176,9 +176,7 @@ export default {
}); });
} else { } else {
this.vchandata = vdata.vchan; this.vchandata = vdata.vchan;
setTimeout(() => { this.getPlayUrl();
this.getPlayUrl();
}, 2000);
} }
}); });
}, },
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
:model="paramform" :model="paramform"
v-show="curtype === 'upload'" v-show="curtype === 'upload'"
> >
<el-form-item label="类型"> <!-- <el-form-item label="类型">
<el-select v-model="paramform.fileType"> <el-select v-model="paramform.fileType">
<el-option <el-option
v-for="type in types" v-for="type in types"
...@@ -24,18 +24,19 @@ ...@@ -24,18 +24,19 @@
</el-form-item> </el-form-item>
<el-form-item label="名称"> <el-form-item label="名称">
<el-input v-model="paramform.name"></el-input> <el-input v-model="paramform.name"></el-input>
</el-form-item> </el-form-item> -->
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="paramsup" ref="paramsup"
action="" :action="uploadurl"
:on-change="handlePreview" :on-change="handlePreview"
multiple multiple
:limit="1" :limit="1"
:auto-upload="false" :auto-upload="false"
:on-success="sucessfile" :on-success="sucessfile"
:file-list="fileList" :file-list="fileList"
:on-error="errorfile"
> >
<el-button size="small" slot="trigger" type="primary" <el-button size="small" slot="trigger" type="primary"
>点击上传</el-button >点击上传</el-button
...@@ -81,57 +82,49 @@ export default { ...@@ -81,57 +82,49 @@ export default {
fileList: [], fileList: [],
types: [], types: [],
curtype: "", curtype: "",
upfile: "" upfile: "",
uploadurl: "",
subtaskid: ""
}; };
}, },
methods: { methods: {
show(type) { show(type, subid) {
this.curtype = type; this.curtype = type;
this.subtaskid = subid;
this.dialogVisible = true; 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) { handlePreview(file, fileList) {
if (this.uploadFile(file, "application/x-gzip")) { let modalFileExt = file.name.slice(-7);
this.upfile = file; if (modalFileExt !== ".tar.gz") {
return false; this.$message({
} else { type: "warning",
this.fileList = []; message: '仅支持"*.tar.gz"文件'
});
this.$refs.paramsup.clearFiles();
return false; return false;
} }
}, },
uploadparams() { uploadparams() {
let render = new FileReader();
let file_text = ""; let file_text = "";
reader.readAsDataURL(this.upfile); this.$refs.paramsup.submit();
reader.onloadend = () => { },
let dataURL = reader.result.split(";base64,"); sucessfile() {
let file_ext = ""; this.$message({
if (this.upfile.name.slice(-7) === ".tar.gz") { message: "导入成功请重新点击任务查看!",
file_ext = ".tar.gz"; type: "success"
} else if (this.upfile.name.slice(-3) === ".gz") { });
file_ext = ".gz"; this.dialogVisible = false;
} this.$store.commit("setocxstate", 1)
}; },
let obj = { errorfile(err){
command: "put /wsapi/v1/devconf_fx/conf_param", console.log(err);
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);
}, },
sucessfile() {},
submitParamSet() {}, submitParamSet() {},
handleClose(done) { handleClose(done) {
(this.dialogVisible = false), this.$store.commit("setocxstate", 0); (this.dialogVisible = false), this.$store.commit("setocxstate", 1);
}, },
getTypes() { getTypes() {
let params = { let params = {
...@@ -142,9 +135,6 @@ export default { ...@@ -142,9 +135,6 @@ export default {
this.types = res.list_data; this.types = res.list_data;
}); });
} }
},
created() {
this.getTypes();
} }
}; };
</script> </script>
......
...@@ -64,7 +64,9 @@ ...@@ -64,7 +64,9 @@
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
:content="taskInfo.calibration_status == 0 ? '运行中' : '下发中'" :content="
taskInfo.calibration_status == 0 ? '运行中' : '下发中'
"
placement="top" placement="top"
> >
<span @click="setDemarcate(scope.row, scope.$index)" <span @click="setDemarcate(scope.row, scope.$index)"
...@@ -98,7 +100,7 @@ ...@@ -98,7 +100,7 @@
效果展示 <span class="set-icon el-icon-s-help"></span> 效果展示 <span class="set-icon el-icon-s-help"></span>
</div> </div>
</div> </div>
<handleparam ref="handleparam"></handleparam> <handleparam ref="handleparam" :subtaskid="subtaskid"></handleparam>
</div> </div>
<div class="yt-box"> <div class="yt-box">
<ytconfig <ytconfig
...@@ -179,7 +181,15 @@ export default { ...@@ -179,7 +181,15 @@ export default {
} }
}, },
handleparam(type) { 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() { setsounces() {
if (this.checkpollstate()) { if (this.checkpollstate()) {
...@@ -240,12 +250,14 @@ export default { ...@@ -240,12 +250,14 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
debugger;
that.taskInfo.mtasks[0].scenes.map(ele => { that.taskInfo.mtasks[0].scenes.map(ele => {
debugger;
if (ele.scene_unid == row.scene_unid) { if (ele.scene_unid == row.scene_unid) {
ele.config = {}; ele.config = {};
ele.rois[0].roi = if (ele.rois) {
'<?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.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; ele.runtime = 0;
} }
}); });
...@@ -346,10 +358,10 @@ export default { ...@@ -346,10 +358,10 @@ export default {
query: { query: {
taskid: this.taskid, taskid: this.taskid,
subtaskid: this.subtaskid, 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(() => { setTimeout(() => {
window.open(routeData.href, "_blank"); window.open(routeData.href, "_blank");
}, 0); }, 0);
......
...@@ -161,8 +161,17 @@ ...@@ -161,8 +161,17 @@
</div> </div>
</template> </template>
</el-table-column> </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 prop="sample_dura" align="center" label="统计周期(秒)">
</el-table-column> </el-table-column>
<el-table-column prop="dist_time" align="center" label="车头时距(秒)">
</el-table-column>
<el-table-column prop="distance" align="center" label="车头间距(m)"> <el-table-column prop="distance" align="center" label="车头间距(m)">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
v-model="formData.task_algo_type" v-model="formData.task_algo_type"
placeholder="请选择" placeholder="请选择"
:popper-append-to-body="false" :popper-append-to-body="false"
:disabled="pedittype == 'edit'"
> >
<el-option value="" label="--"></el-option> <el-option value="" label="--"></el-option>
<el-option value="0" label="交通"></el-option> <el-option value="0" label="交通"></el-option>
...@@ -108,10 +109,7 @@ ...@@ -108,10 +109,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类型" class="form-item"> <el-form-item label="设备类型" class="form-item">
<el-select <el-select v-model="formData.plate_type">
v-model="formData.plate_type"
:disabled="pedittype != 'add'"
>
<el-option <el-option
v-for="(item, index) in platT" v-for="(item, index) in platT"
:key="index" :key="index"
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<span class="subtask-info">{{ subTaskData.video_total }}</span> --> <span class="subtask-info">{{ subTaskData.video_total }}</span> -->
<span class="label">任务信息</span> <span class="label">任务信息</span>
<span class="subtask-info">{{ subTaskData.info }}</span> <span class="subtask-info">{{ subTaskData.info }}</span>
<span class="label" hidden>分析设备</span> <span class="label">分析设备</span>
<span class="subtask-info" hidden> <span class="subtask-info">
<el-select v-model="assign_id" filterable> <el-select v-model="assign_id" filterable>
<!-- <el-option <!-- <el-option
v-for="(item, index) in freeList" v-for="(item, index) in freeList"
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
? item.license_info.platType ? item.license_info.platType
: '')}` : '')}`
" "
v-if="subTaskData.plate_type == item.license_info.platType || subTaskData.plate_type === item.in_ip"
> >
{{ item.in_ip }} {{ item.in_ip }}
{{ {{
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
</el-option> --> </el-option> -->
</el-select> </el-select>
</span> </span>
<span class="label sub-btn" @click="subMove" hidden>确定</span> <span class="label sub-btn" @click="subMove" >确定</span>
</div> </div>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!