Commit de24949e by 罗鑫霖

Merge branch 'huaweiaqhx' of http://git.keliuyun.com:55676/platform/fanxing_new into huaweiaqhx

2 parents 9ba5a094 bf265bc4
No preview for this file type
window._ENUM = {
algorTypeList: [
{
value: "",
name: "全部"
},{
value: "0",
name: "城市电警卡口",
},{
value: "6",
name: "农交安"
},{
value: "7",
name: "高速"
},{
value: "1",
name: "客流"
},{
value: "3",
name: "违停"
},{
value: "5",
name: "交通行人"
}
]
}
\ No newline at end of file
......@@ -23,6 +23,10 @@
<script src="<%= BASE_URL %>js/keymaster.js"></script>
<script src="<%= BASE_URL %>js/config.js"></script>
<script src="<%= BASE_URL %>js/flv.js"></script>
<script src="<%= BASE_URL %>enum/index.js"></script>
<script>
window._versionTime = parseInt('<%=new Date().getTime()%>');
</script>
<!-- <script src="<%= BASE_URL %>js/NodePlayer-full.min.js"></script> -->
</head>
<body id="theme-name">
......
......@@ -19,9 +19,10 @@ window.config = {
"huasanDD": 'http://aaa.zzgx.gov.cn/oauth/authorize?response_type=code&scope=read&client_id=KLjmdAH0',
"ddwsurl":"123.6.38.39:29090",
"isdd":false, //是否开启钉钉登录
"version":"2.1.0",
"version":"2.1.1",
"encrypt":false,//是否加密true采用sha1加密,false不加密
"nvsUrl":'http://47.94.37.10:8888',
"nvsRegex":'rtsp://47.94.37.10/lskjapp/',
"isNvs3000":true,//是否开启nvs3000拉取功能
"isGaoXinQu": true, //是否是郑州高新区
}
{"commit":"4b64e700aabddfd8a3571739b1bece4194641df5","commitDate":"2021-9-27 18:45","buildDate":"2021-11-11 16:23","version":"2.1.0","info":"【BUG】存储配置导出"}
{"commit":"0e5038400902761c6f098626feeb8634c767e7a7","commitDate":"2022-4-17 16:25","buildDate":"2022-5-6 16:10","version":"2.1.0","info":"高新区-软测修改"}
\ No newline at end of file
......@@ -30,10 +30,10 @@ export default {
window.opsTableHeight = document.body.clientHeight - 260 + "px";
if (document.body.clientWidth > 1366) {
window.oneSearchTableHeight = document.body.clientHeight - 280 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 320 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 330 + "px";
} else {
window.oneSearchTableHeight = document.body.clientHeight - 280 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 315 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 320 + "px";
}
}
};
......
......@@ -21,7 +21,7 @@ let wsIP = "";
let flvIP = "";
switch (process.env.NODE_ENV) {
case "development":
wsIP = window.config.https?"192.168.9.227":"123.6.38.39:20080:20080"; // 测试环境url
wsIP = window.config.https?"192.168.9.227":"192.168.9.233:20080"; // 测试环境url
flvIP = window.config.https?"192.168.9.233":"192.168.9.233";
break;
case "pre":
......
......@@ -9,21 +9,21 @@
let baseUrl = "/api"; // 本地代理
import axios from "axios";
switch (process.env.NODE_ENV) {
switch (process.env.NODE_ENV) {
case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = window.config.https?"https://192.168.9.245:20070":"http://123.6.38.39:20080"; // 测试环境url
// baseUrl = window.config.https ? "https://192.168.9.245:20070" : "http://192.168.9.233:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
baseUrl = "http://123.6.38.39:20080";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
break;
case "pre":
baseUrl = "https://pre-server.feleti.cn"; // 预上线环境url
break;
case "production":
baseUrl = window.config.https?`https://${location.host}`:`http://${location.host}`; // 生产环境url
baseUrl = window.config.https ? `https://${location.host}` : `http://${location.host}`; // 生产环境url
break;
}
}
export default baseUrl;
\ No newline at end of file
......@@ -25,15 +25,26 @@ export default {
case "短视频":
url = "/vchans?vchan_type=vfile";
break;
case "视频云设备":
url = "/video_cloud?vchan_type=cloud";
break;
}
if (window.config.bigtree) {
if(devname == "外部设备") {
return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
} else if (devname == "视频云设备") {
return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
} else {
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`;
}
if(window.config.bigtree && devname == "外部设备") {
return `${baseUrl}/api/v1/devconf_fx${url}` //ztree版本
} else if(devname == "外部设备"){
} else {
if(devname == "外部设备") {
return api.get(`${baseUrl}/api/v1/devconf_fx/${url}`, params);
} else if(window.config.bigtree){
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`
}else {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`)
} else if (devname == "视频云设备") {
return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
} else {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`);
}
}
},
......@@ -99,5 +110,11 @@ export default {
},
saveConfig:(id,params) => {
return api.post(`${baseUrl}/api/v1/devconf_fx/content/${id}`,params)
}
},
refreshCloudDev: (params) => {
return api.get(`${baseUrl}/api/v1/devconf_fx/video_cloud/refresh`,params)
},
getCloudDev: (params) => {
return api.get(`${baseUrl}/api/v1/devconf_fx/video_cloud`,params)
},
};
......@@ -136,7 +136,7 @@ export default {
},
getcatalogs(params){
return api.get(
`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params
`${baseUrl}/api/v1/devconf_fx/device_catalogs`, params
);
},
refreshcatlog(){
......
......@@ -8,6 +8,9 @@ export default {
detailImg(params, id) {
return api.get(urls.detailImg + id, params);
},
detailImgBatch(params) {
return api.post(urls.detailImgBatch, params);
},
detailVideo(params, id) {
return api.get(urls.detailvideo + id, params);
},
......
......@@ -6,6 +6,8 @@ export default {
eventTableList: baseUrl + '/api/v1/behavior/events',
// 获取详情图片
detailImg: baseUrl + '/api/v1/web/pics/',
//批量获取照片
detailImgBatch: baseUrl + '/api/v1/web/pics/batch_get',
// 删除
delVehicle: baseUrl + '/api/v1/traffic/events/',
// 批量删除
......
......@@ -56,9 +56,8 @@ class Codes {
publicCode() {
try {
// eslint-disable-next-line camelcase
let shoot_dt = this.timeForm(this.result.pics[0].shoot_dt, "local").split(
" "
);
const _time = this.result.pics[0].shoot_dt || this.result.event_dt;
let shoot_dt = this.timeForm(_time, "local").split(" ");
this.result.shoot_date = shoot_dt[0];
this.result.shoot_time = shoot_dt[1];
} catch (error) {
......@@ -144,17 +143,17 @@ class Codes {
try {
this.result.illegalTypestate = parseInt(this.allData.event_data.illegal.state);
this.result.illegalType =
parseInt(this.allData.event_data.illegal.state) === 1
? this.getCode("违法类型", this.allData.event_data.illegal.code)
: "正常";
parseInt(this.allData.event_data.illegal.state) === 1 ?
this.getCode("违法类型", this.allData.event_data.illegal.code) :
"正常";
} catch (err) {
this.result.illegalType = "未识别";
}
try {
this.result.location_name =
this.allData.event_data.location.name === ""
? "未知"
: this.allData.event_data.location.name;
this.allData.event_data.location.name === "" ?
"未知" :
this.allData.event_data.location.name;
} catch (e) {
this.result.location_name = "未识别";
}
......@@ -290,9 +289,9 @@ class Codes {
// 违法类型
try {
this.result.illegalType =
parseInt(this.allData.event_data.illegal.state) === 1
? this.getCode("违法类型", this.allData.event_data.illegal.code)
: "正常";
parseInt(this.allData.event_data.illegal.state) === 1 ?
this.getCode("违法类型", this.allData.event_data.illegal.code) :
"正常";
} catch (err) {
this.result.illegalType = "未识别";
}
......@@ -334,9 +333,9 @@ class Codes {
// 地点名称
try {
this.result.location_name =
this.allData.event_data.location.name === ""
? "未知"
: this.allData.event_data.location.name;
this.allData.event_data.location.name === "" ?
"未知" :
this.allData.event_data.location.name;
} catch (e) {
this.result.location_name = "未识别";
}
......@@ -371,27 +370,37 @@ class Codes {
this.result.xcycle_type_text = "未识别";
}
}
console.log('company',this.allData.event_data.xcycle.company.code)
try {
if (this.result.xcycle_type_text === "自行车") {
this.result.company = this.allData.event_data.xcycle.company.name;
} else if (this.result.xcycle_type_text === "摩托车") {
this.result.company = this.getCode(
"外卖公司",
this.allData.event_data.xcycle.company.code
);
} else if (this.result.xcycle_type_text === "三轮车") {
if (this.event_type === 'xcycle') {
this.result.company = this.getCode(
"快递公司",
"运营公司",
this.allData.event_data.xcycle.company.code
);
} else {
this.result.company = "";
this.result.company = "未识别";
}
} catch (error) {
this.result.company = "未识别";
}
// try {
// if (this.result.xcycle_type_text === "自行车") {
// this.result.company = this.allData.event_data.xcycle.company.name;
// } else if (this.result.xcycle_type_text === "摩托车") {
// this.result.company = this.getCode(
// "外卖公司",
// this.allData.event_data.xcycle.company.code
// );
// } else if (this.result.xcycle_type_text === "三轮车") {
// this.result.company = this.getCode(
// "快递公司",
// this.allData.event_data.xcycle.company.code
// );
// } else {
// this.result.company = "无";
// }
// } catch (error) {
// this.result.company = "未识别";
// }
}
// 客流
pflow() {}
......@@ -403,7 +412,7 @@ class Codes {
}
getCode(codeName, code) {
var name = window.localStorage.getItem(codeName + "-" + code);
name = name || "";
name = name || "未识别";
return name;
}
/**
......
import Vue from "vue";
import { buildImgurl } from "@/libs/utils";
Vue.prototype.dev_unid = "2cb6e39adc5176b81879f6c22f1d9e1c";
/**
* @param {unid} 设备id
*/
Vue.prototype.setDevunid = function(devuid) {
Vue.prototype.setDevunid = function (devuid) {
Vue.prototype.dev_unid = devuid;
};
/**
* tar文件上传设置
*/
Vue.prototype.uploadFile = function(file, type, size) {
Vue.prototype.uploadFile = function (file, type, size) {
const isType = file.raw.type === type;
let isSize = true;
if (size) {
......@@ -27,7 +28,7 @@ Vue.prototype.uploadFile = function(file, type, size) {
};
Vue.prototype.globalWs = null;
Vue.prototype.getCode = function(codeName, code) {
Vue.prototype.getCode = function (codeName, code) {
var name = window.localStorage.getItem(codeName + "-" + code);
name = name ? name : "";
return name;
......@@ -36,10 +37,10 @@ Vue.prototype.getCode = function(codeName, code) {
* @param {src} 图片路径
* 图片放大
*/
Vue.prototype.zoomImg = function(data) {
Vue.prototype.zoomImg = function (data) {
store.commit("setImgsrc", data);
};
Vue.filter("sexfn", function(value) {
Vue.filter("sexfn", function (value) {
if (!value) return;
var str = "";
if (value == 1) str = "男";
......@@ -47,7 +48,7 @@ Vue.filter("sexfn", function(value) {
return str;
});
Vue.filter("dbnamefn", function(value) {
Vue.filter("dbnamefn", function (value) {
let dbData = store.state.initinfo.facedbdata,
dbname = "";
dbData.forEach(ele => {
......@@ -58,7 +59,7 @@ Vue.filter("dbnamefn", function(value) {
return dbname;
});
Vue.filter("filterDeployType", function(value) {
Vue.filter("filterDeployType", function (value) {
let dbData = store.state.alarmtype,
dbname = "";
dbData.forEach(ele => {
......@@ -73,7 +74,7 @@ Vue.filter("filterDeployType", function(value) {
* @param {provenceid} 省份id
* @param {cityid} 城市id
*/
Vue.prototype.showCity = function(provenceid, cityid) {
Vue.prototype.showCity = function (provenceid, cityid) {
this.cData = this.$store.state.initinfo.province;
var province = provenceid;
var provinceNmae = "";
......@@ -81,7 +82,7 @@ Vue.prototype.showCity = function(provenceid, cityid) {
var curProvince = "";
var city = cityid;
if (province) {
this.cData.forEach(function(ele) {
this.cData.forEach(function (ele) {
if (ele.code == province) {
if (ele.cities) curProvince = ele.cities;
provinceNmae = ele.name;
......@@ -89,7 +90,7 @@ Vue.prototype.showCity = function(provenceid, cityid) {
}, this);
if (city) {
if (curProvince)
curProvince.list_data.forEach(function(ele) {
curProvince.list_data.forEach(function (ele) {
if (ele.code == city) {
cityName = ele.name;
}
......@@ -105,7 +106,7 @@ Vue.prototype.showCity = function(provenceid, cityid) {
* @param {obj}
* 格式化时间
*/
Vue.prototype.timeForm = function(obj) {
Vue.prototype.timeForm = function (obj) {
var nowY = obj.getFullYear();
var nowM =
obj.getMonth() + 1 < 10 ? "0" + (obj.getMonth() + 1) : obj.getMonth() + 1;
......@@ -117,12 +118,12 @@ Vue.prototype.timeForm = function(obj) {
nowY + "-" + nowM + "-" + nowD + " " + nowH + ":" + nowMi + ":" + nowS;
return timeNow;
};
Vue.prototype.yesterDay = function() {
Vue.prototype.yesterDay = function () {
var data = new Date().getTime() - 24 * 60 * 60 * 1000;
var curdate = this.timeForm(new Date(data));
return curdate.split(" ")[0] + " " + "00:00:00";
};
Vue.prototype.nowDay = function(){
Vue.prototype.nowDay = function () {
var data = new Date();
return this.timeForm(data);
};
......@@ -130,7 +131,7 @@ Vue.prototype.nowDay = function(){
* @param {obj}
* UTC时间处理
*/
Vue.prototype.setUtcTime = function(obj) {
Vue.prototype.setUtcTime = function (obj) {
if (obj && obj != "") {
let num = new Date(obj).getTime();
let offset = Math.abs(new Date().getTimezoneOffset());
......@@ -168,7 +169,7 @@ function checkIE() {
}
}
let sha1 = require('js-sha1')
Vue.prototype.baseencode = function(str){
Vue.prototype.baseencode = function (str) {
// return str
// let base = "";
// let version = window.config.version
......@@ -190,7 +191,7 @@ Vue.prototype.baseencode = function(str){
return base
// return sha1(str);
}
Vue.prototype.showLocalTime = function(obj) {
Vue.prototype.showLocalTime = function (obj) {
if (obj == undefined) return;
let dt = "",
ndt = "";
......@@ -223,7 +224,7 @@ Vue.prototype.showLocalTime = function(obj) {
* @param {*} key
* @param {*} val
*/
Vue.prototype.uuid = function() {
Vue.prototype.uuid = function () {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
......@@ -239,7 +240,7 @@ Vue.prototype.uuid = function() {
/**
* 本地存储相机信息
*/
Vue.prototype.setCameralocalStor = function(key, val) {
Vue.prototype.setCameralocalStor = function (key, val) {
if (window.localStorage) {
localStorage[key] = val;
} else {
......@@ -251,7 +252,7 @@ Vue.prototype.setCameralocalStor = function(key, val) {
* @param {key}
* 获取本地存储相机信息
*/
Vue.prototype.getCameralocalStor = function(key) {
Vue.prototype.getCameralocalStor = function (key) {
var val = "";
if (window.localStorage) {
val = localStorage[key];
......@@ -264,7 +265,7 @@ Vue.prototype.getCameralocalStor = function(key) {
/**
* 图片上传限制
*/
Vue.prototype.uploadImgCondition = function(file) {
Vue.prototype.uploadImgCondition = function (file) {
const isJPG = file.type === "image/jpeg";
const isLt2M = file.size / 1024 / 1024 < 2;
......@@ -280,7 +281,7 @@ Vue.prototype.uploadImgCondition = function(file) {
/**
* base64图片
*/
Vue.prototype.base64Img = function(file) {
Vue.prototype.base64Img = function (file) {
// eslint-disable-next-line no-redeclare
var file = file.file;
return new Promise((resolve, reject) => {
......@@ -289,7 +290,7 @@ Vue.prototype.base64Img = function(file) {
if (file) {
reader.readAsDataURL(file);
}
reader.onloadend = function(evt) {
reader.onloadend = function (evt) {
srcs = reader.result.split(",")[1];
let data = {
pic_base64: srcs,
......@@ -305,18 +306,14 @@ Vue.prototype.base64Img = function(file) {
/**
* 判断是否是chrome浏览器
*/
Vue.prototype.checkchrome = function() {
Vue.prototype.checkchrome = function () {
var isWebKit = navigator.userAgent.indexOf('WebKit') > -1 //
return isWebKit
};
/**
* https路径处理
*/
Vue.prototype.buildImgurl = function(url){
let uri = window.config.https? url.replace('http','https'):url;
let result = window.config.https? uri.replace('20080','20070'):uri;
return result
}
Vue.prototype.buildImgurl = buildImgurl;
/**
* code操作
......
......@@ -182,6 +182,9 @@
.el-table--small td, .el-table--small th{
padding: 8px 0;
}
.ten-table-wrapper td, .ten-table-wrapper th {
padding: 16px 0;
}
.el-table--border::after, .el-table--group::after, .el-table::before{
// background-color: rgba(0,0,0,0);
}
......@@ -267,6 +270,9 @@ display: table-cell!important;
.el-dialog .el-select--small{
width: 100%;
}
.el-form--inline .el-form-item__content {
vertical-align: middle;
}
/* .el-dialog .el-form-item--small .el-form-item__content,.el-dialog .el-form-item--small .el-form-item__label{
line-height: 26px;
} */
......@@ -285,7 +291,7 @@ display: table-cell!important;
margin-left: -10px;
}
.el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
margin-bottom: 4px;
margin-bottom: 15px;
line-height: 32px;
}
/* 切换 */
......
......@@ -566,6 +566,9 @@ a:active{
transform:none;
left: 0;
}
.el-image-viewer__wrapper {
z-index: 3600 !important;
}
.detailDialog .el-icon-circle-close{
color: #fff;
}
......@@ -649,7 +652,7 @@ a:active{
}
.listboxitem .el-form-item--small .el-form-item__content, .el-form-item--small .el-form-item__label {
line-height: 20px!important;
line-height: 32px!important;
padding-left: 5px;
}
.displaybtn-box {
......
<template>
<div style="width: 100%;height: 100%;position: relative;">
<p style="position: absolute;top: 113px;z-index: 99;text-align: center;width: 100%;" v-if="noIE">请选择IE9以上版本查看视频!</p>
<object v-show="videoShow" id="nvrTotalOcx" name="nvrTotalOcx"
<div style="width: 100%; height: 100%; position: relative">
<p
style="
position: absolute;
top: 113px;
z-index: 99;
text-align: center;
width: 100%;
"
v-if="noIE"
>
请选择IE9以上版本查看视频!
</p>
<object
v-show="videoShow"
id="nvrTotalOcx"
name="nvrTotalOcx"
classid="CLSID:96DFBBAF-4220-4978-9681-4ABA534A7718"
codebase="./static/OcxInstall/VionNvrVideoInstall.exe#version=1,0,24"
style="width: 100%; height:100%;">
style="width: 100%; height: 100%"
>
<param name="BorderStyle" value="1" />
<param name="MousePointer" value="0" />
<param name="Enabled" value="1" />
<param name="Min" value="0" />
<param name="Max" value="10" />
<embed wmode="opaque"/>
<param name="wmode" value="transparent"/>
<embed wmode="opaque" />
<param name="wmode" value="transparent" />
</object>
<!--安装弹框-->
<el-dialog title="提示" :visible.sync="stepDialogVisible" width='252px' :close-on-click-modal='false' @close="stepClose">
<span>本网站需要安装视频插件才可正常使用,请安装完成后请手动重启浏览器</span>
<el-dialog
title="提示"
:visible.sync="stepDialogVisible"
width="252px"
:close-on-click-modal="false"
@close="stepClose"
>
<span
>本网站需要安装视频插件才可正常使用,请安装完成后请手动重启浏览器</span
>
<div slot="footer" class="dialog-footer">
<el-button @click="stepDialogVisible = false">关闭</el-button>
</div>
</el-dialog>
<!--更新弹框-->
<el-dialog title="提示" :visible.sync="updateDialogVisible" width='252px' :close-on-click-modal='false' @close="stepClose">
<span>该网站当前视频插件版本为{{currentVersion}},可能导致部分功能不完善,请更新到最新版本1.0.33</span>
<el-dialog
title="提示"
:visible.sync="updateDialogVisible"
width="252px"
:close-on-click-modal="false"
@close="stepClose"
>
<span
>该网站当前视频插件版本为{{
currentVersion
}},可能导致部分功能不完善,请更新到最新版本1.0.33</span
>
<div slot="footer" class="dialog-footer">
<el-button @click="updateDialogVisible = false">关闭</el-button>
</div>
......@@ -31,103 +64,106 @@
</template>
<script>
export default{
data(){
return{
videoShow:true,
noIE:false,
currentVersion:0,
updateDialogVisible:false,
stepDialogVisible:false
}
export default {
data() {
return {
videoShow: true,
noIE: false,
currentVersion: 0,
updateDialogVisible: false,
stepDialogVisible: false,
};
},
mounted(){
setTimeout(()=>{
mounted() {
setTimeout(() => {
this.initVideo();
},300)
}, 300);
},
methods:{
stepClose(){
this.videoShow=true;
methods: {
stepClose() {
this.videoShow = true;
},
initVideo(){
var ieVer=this.IEVersion();
if(ieVer==7||ieVer==8||ieVer==6||ieVer=='-1'){
this.noIE=true
}else{
this.noIE=false
try{
this.currentVersion=document.getElementById('nvrTotalOcx').GetOcxVersion();
var versionArr=this.currentVersion.split('.');
var versionNum=0;
versionArr.forEach((item,index,arr)=>{
versionNum=versionNum+Number(item);
})
if(versionNum<34){
this.videoShow=false;
this.updateDialogVisible=true;
window.open('./OcxInstall/NvrVideoInstall_1.0.33.exe')
initVideo() {
var ieVer = this.IEVersion();
if (ieVer == 7 || ieVer == 8 || ieVer == 6 || ieVer == "-1") {
this.noIE = true;
} else {
this.noIE = false;
try {
this.currentVersion = document
.getElementById("nvrTotalOcx")
.GetOcxVersion();
var versionArr = this.currentVersion.split(".");
var versionNum = 0;
versionArr.forEach((item, index, arr) => {
versionNum = versionNum + Number(item);
});
if (versionNum < 34) {
this.videoShow = false;
this.updateDialogVisible = true;
window.open("./OcxInstall/NvrVideoInstall_1.0.33.exe");
}
}catch(e){
this.videoShow=false;
this.stepDialogVisible=true;
window.open('./OcxInstall/NvrVideoInstall_1.0.33.exe')
return false
} catch (e) {
this.videoShow = false;
this.stepDialogVisible = true;
window.open("./OcxInstall/NvrVideoInstall_1.0.33.exe");
return false;
}
}
if(typeof nvrTotalOcx != 'undefined'){
var testStr = 'Null';
if (typeof nvrTotalOcx != "undefined") {
var testStr = "Null";
nvrTotalOcx.Init(0, testStr, 1);
nvrTotalOcx.SetSingleWindow(true);
nvrTotalOcx.SetParam("VideoSize", 0);
var medianame = '视频0';
var medianame = "视频0";
// var hostname = window.location.hostname;
var hostname = '192.168.9.120';
var port=8554;
var url = "rtsp://"+hostname+":"+port+"/ch0";
nvrTotalOcx.PlayRealVideo(url,1,'video',hostname,0);
window.onbeforeunload=function(){
nvrTotalOcx.CloseVideoByChannelnum(1)
}
var hostname = "192.168.9.120";
var port = 8554;
var url = "rtsp://" + hostname + ":" + port + "/ch0";
nvrTotalOcx.PlayRealVideo(url, 1, "video", hostname, 0);
window.onbeforeunload = function () {
nvrTotalOcx.CloseVideoByChannelnum(1);
};
}
},
IEVersion() {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
var isIE =
userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
if(isIE) {
var isIE11 =
userAgent.indexOf("Trident") > -1 && userAgent.indexOf("rv:11.0") > -1;
if (isIE) {
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if(fIEVersion == 7) {
if (fIEVersion == 7) {
return 7;
} else if(fIEVersion == 8) {
} else if (fIEVersion == 8) {
return 8;
} else if(fIEVersion == 9) {
} else if (fIEVersion == 9) {
return 9;
} else if(fIEVersion == 10) {
} else if (fIEVersion == 10) {
return 10;
} else {
return 6;//IE版本<=7
return 6; //IE版本<=7
}
} else if(isEdge) {
return 'edge';//edge
} else if(isIE11) {
} else if (isEdge) {
return "edge"; //edge
} else if (isIE11) {
return 11; //IE11
}else{
return -1;//不是ie浏览器
} else {
return -1; //不是ie浏览器
}
},
hideHanlde(){
this.videoShow=false;
hideHanlde() {
this.videoShow = false;
},
showHanlde(){
this.videoShow=true;
}
}
}
showHanlde() {
this.videoShow = true;
},
},
};
</script>
<style>
......
......@@ -11,24 +11,24 @@
<script>
// import {config} from '../../public/js/config'
export default {
data () {
export default {
data() {
return {
videoDialogVisible: false,
domTimer: null,
player: ''
}
player: "",
};
},
methods: {
playvideos: function (play_url) {
let _this = this;
this.videoDialogVisible = true;
this.domTimer = setTimeout(() => {
this.player = document.getElementById('playerVideo');
this.player = document.getElementById("playerVideo");
this.player.loop = true;
if(window.config.https) {
let loc = location.host
this.player.src = `https://${loc}/${play_url.split(":20080")[1]}`
if (window.config.https) {
let loc = location.host;
this.player.src = `https://${loc}/${play_url.split(":20080")[1]}`;
} else {
this.player.src = play_url;
}
......@@ -37,24 +37,24 @@
},
closeVideoDialog: function () {
let _this = this;
window.clearTimeout(_this.domTimer)
window.clearTimeout(_this.domTimer);
this.domTimer = null;
this.player.src = '';
this.player = '';
this.player.src = "";
this.player = "";
this.videoDialogVisible = false;
}
}
}
},
},
};
</script>
<style scoped>
.dom-video {
.dom-video {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
.player-footer button {
.player-footer button {
padding: 0 2%;
}
}
</style>
const algorTypeEnumTemp = {};
window._ENUM.algorTypeList.forEach(d => {
if (d.name) {
algorTypeEnumTemp[d.name] = d.value;
}
if (d.value) {
algorTypeEnumTemp[d.value] = d.name;
}
});
export const algorTypeList = window._ENUM.algorTypeList;
export const algorTypeEnum = algorTypeEnumTemp;
\ No newline at end of file
import api from "@/api/search";
import {
buildCode
} from "@/assets/js/buildcodes";
const splitUrlOrigin = (url) => {
if (url.includes("://")) {
let temp = url.split("://")[1].split("/"),
newUrl = "";
temp.forEach((e, i) => {
if (i != 0) {
newUrl += "/" + e;
}
})
return newUrl;
} else {
return url;
}
};
export const splitUrlOriginG = splitUrlOrigin;
export const buildImgurl = (url) => {
let isHttps = window.config.https,
origin = window.location.origin;
if (isHttps) {
url.replace('http', 'https');
url.replace('20080', '20070')
}
if (!origin.includes("localhost")) {
url = origin + splitUrlOrigin(url);
}
return url;
};
export const matchDetailImg = (picUnidArr) => {
return new Promise((resolve, reject) => {
api.detailImgBatch({
pic_unids: picUnidArr,
})
.then((res) => {
let imgUnidEnum = {};
if (res.length > 0) {
res.forEach((item) => {
imgUnidEnum[item.pic_unid] = buildImgurl(item.pic_url);
});
}
resolve({
imgUnidEnum: imgUnidEnum
});
});
});
};
export const getDataList = (params, type = "") => {
let httpRequest = null;
if (type == "event") {
httpRequest = api.eventTableList;
} else {
httpRequest = api.tableList;
}
let origin = window.location.origin,
isLocalhost = false;
if (origin.includes("localhost")) {
isLocalhost = true;
}
return new Promise(async (resolve, reject) => {
const res = await httpRequest(params);
let formatterData = [],
picUnid_Arr = [];
res.list_data.forEach((item, index) => {
if (item.pics[0].pic_unid) {
picUnid_Arr.push(item.pics[0].pic_unid);
}
});
let imgUnidEnum = {};
if (picUnid_Arr.length > 0) {
const imgRes = await matchDetailImg(picUnid_Arr);
console.log('imgRes', imgRes);
imgUnidEnum = imgRes.imgUnidEnum;
}
console.log('imgUnidEnum', imgUnidEnum)
res.list_data.forEach((item, index) => {
const pic_unid = item.pics ? item.pics[0].pic_unid : null;
if (pic_unid) {
item.pics[0].src_url = imgUnidEnum[pic_unid] || "";
} else {
item.pics[0].src_url = "";
}
const videoSrc_url = item.video ? item.video[0].src_url : null;
if (videoSrc_url) {
if (!isLocalhost) {
item.video[0].src_url = origin + splitUrlOrigin(videoSrc_url);
}
}
formatterData.push(buildCode.init(item));
});
console.log('formatterData', formatterData)
resolve({
total_num: res.total_num,
formatterData: formatterData,
list_data: res.list_data
})
});
}
\ No newline at end of file
......@@ -23,6 +23,8 @@ Vue.prototype.$moment = moment;
Vue.prototype.$buildCode = buildCode;
Vue.prototype.oParse = new XML.ObjTree();
Vue.prototype.axios = axios;
Vue.prototype.$pageSizeOpts = [10, 30, 50, 100];
Vue.prototype.$pageSize = 10;
// import VueParticles from "vue-particles";
Vue.use(api);
Vue.use(log);
......
<template>
<div>
</div>
<div></div>
</template>
<script>
export default {
data() {
return {
}
return {};
},
created(){
}
}
created() {},
};
</script>
<style>
</style>>
\ No newline at end of file
......@@ -12,6 +12,16 @@
}"
@click="openmenu"
></span>
<div class="jump-san-box">
<span
v-for="(item, index) in jumpSanList"
:key="index"
class="jump-item"
@click="jumpHandler(item)"
>
<span class="jump-name">{{ item.name }}</span>
</span>
</div>
<div class="headRight">
<span class="timerbox">{{ curdate }}</span>
<el-dropdown class="zt-box" @command="handleCommand">
......@@ -70,9 +80,17 @@ export default {
headertitle: "",
topbarArr: [],
uname: "",
jumpSanList: []
};
},
methods: {
jumpHandler(item) {
if(item.ddPath && location.href.includes('code')) {
window.open(item.ddPath);
} else {
window.open(item.path);
}
},
setTopBar(data) {
if (this.topbarArr.length < 1) {
this.topbarArr.push(data);
......@@ -177,6 +195,20 @@ export default {
},
},
created() {
if(window.config.isGaoXinQu) {
this.jumpSanList = [
{
name: "渣土车综合管控系统",
path: window.config.zhatucheWin || "http://123.6.38.39/#/login",
ddPath: window.config.zhatucheddWin || "http://123.6.38.39/#/ddlogin",
},{
name: "AI图片分析系统",
path:
window.config.aiPicWin ||
"http://123.6.38.39:20080/web/picplat/dist/index.html#/Login"
}
];
}
this.headertitle = window.config.hadertitle;
this.uname = localStorage.getItem("uname");
this.$api.device.getDev().then((m) => {
......@@ -308,7 +340,7 @@ export default {
color: #fff;
font-size: 25px;
margin-left: 25px;
margin-top: 20px;
vertical-align: -4px;
}
.headRight img {
......@@ -352,4 +384,21 @@ export default {
.uname-box {
padding-right: 10px;
}
.jump-san-box {
display: inline-block;
line-height: 60px;
color: #fff;
font-size: 18px;
padding: 0 0 0 60px;
}
.jump-item {
padding: 0 20px;
cursor pointer;
}
.jump-item:hover {
display: inline-block;
background: #1810ff;
line-height: 60px;
}
</style>
......@@ -71,8 +71,14 @@
</template>
<script>
import moment from "moment";
let particlesConfig = require("../assets/js/particles.json");
let versioninfo = window.config.version;
let versionTime = window._versionTime;
if (versionTime) {
versionTime = moment(new Date(versionTime)).format("YYYY-MM-DD");
}
let versioninfo =
window.config.version + (versionTime ? "-" + versionTime : "");
let sha1 = require("js-sha1");
import types from "../store/types.js";
export default {
......@@ -143,7 +149,7 @@ export default {
})
.then((res) => {
if (!res.ecode) {
if(res.user_name !== this.ruleForm.username){
if (res.user_name !== this.ruleForm.username) {
return false;
}
this.loginMount(res, "user");
......@@ -151,7 +157,7 @@ export default {
if (res.ecode == "1000") {
localStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("atoken", res.atoken);
this.$router.push("/resetpass")
this.$router.push("/resetpass");
} else {
this.$logs.oplogs(res, "serv_login", res.enote);
this.$message({
......@@ -343,7 +349,7 @@ export default {
let { href } = window.location,
code = "";
if (href.includes("code")) {
this.$router.push('/ddlogin')
this.$router.push("/ddlogin");
}
},
created() {
......
<template>
<div class="passform-container">
<div class="passform-box">
<div class="re-header">重置密码</div>
<el-form
......@@ -34,23 +35,30 @@
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
let sha1 = require('js-sha1')
let sha1 = require("js-sha1");
export default {
data() {
var validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
if(value == this.ruleForm.oldpassword) {
if (value == this.ruleForm.oldpassword) {
callback(new Error("新旧密码不能重复!"));
return
return;
}
var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,30}');
var pwdRegex = new RegExp(
"(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,30}"
);
if (!pwdRegex.test(value)) {
callback(new Error("您的密码复杂度太低(密码中必须包含大写和小写字母、数字、特殊字符长度大于8位),请及时修改密码!"))
callback(
new Error(
"您的密码复杂度太低(密码中必须包含大写和小写字母、数字、特殊字符长度大于8位),请及时修改密码!"
)
);
}
if (this.ruleForm.checkPass !== "") {
this.$refs.ruleForm.validateField("checkPass");
......@@ -71,54 +79,60 @@ export default {
ruleForm: {
oldpassword: "",
newpassword: "",
checknewpassword: ""
checknewpassword: "",
},
rules: {
oldpassword: [
{ required: true, message: "请输入旧密码", trigger: "blur" }
{ required: true, message: "请输入旧密码", trigger: "blur" },
],
newpassword: [
{ validator: validatePass, trigger: "blur" },
{ required: true, message: "", trigger: "blur" }
{ required: true, message: "", trigger: "blur" },
],
checknewpassword: [
{ validator: validatePass2, trigger: "blur" },
{ required: true, message: "", trigger: "blur" }
]
}
{ required: true, message: "", trigger: "blur" },
],
},
};
},
methods: {
submitForm(formName) {
let data = {
old_pwd: window.config.encrypt?sha1(this.ruleForm.oldpassword):this.baseencode(this.ruleForm.oldpassword),
new_pwd: window.config.encrypt?sha1(this.ruleForm.newpassword):this.baseencode(this.ruleForm.newpassword),
old_pwd: window.config.encrypt
? sha1(this.ruleForm.oldpassword)
: this.baseencode(this.ruleForm.oldpassword),
new_pwd: window.config.encrypt
? sha1(this.ruleForm.newpassword)
: this.baseencode(this.ruleForm.newpassword),
};
this.$refs[formName].validate(valid => {
this.$refs[formName].validate((valid) => {
if (valid) {
let user_unid = localStorage.getItem("user_unid");
this.$api.ops.resetPwd(data, user_unid).then(res => {
if(res.ecode == 200){
this.$api.ops
.resetPwd(data, user_unid)
.then((res) => {
if (res.ecode == 200) {
this.$logs.oplogs(res, "serv_login", `修改密码`);
this.$router.push("/login");
this.$message({
type: "success",
message: res.enote
message: res.enote,
});
} else {
this.$logs.oplogs(res, "serv_login", `修改密码${res.enote}`);
this.$message({
type: "error",
message: res.enote
message: res.enote,
});
}
}).catch(err => {
})
.catch((err) => {
if (err.response) {
this.$message({
type: "error",
message: err.response.data.enote
message: err.response.data.enote,
});
}
});
......@@ -133,12 +147,18 @@ export default {
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
}
},
},
};
</script>
<style>
.passform-container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
.passform {
margin: 20px;
width: 400px;
......@@ -146,10 +166,11 @@ export default {
.passformitem {
margin-bottom: 20px;
}
.passform-box{
.passform-box {
width: 400px;
margin-top: 10%;
}
.re-header{
.re-header {
margin-left: 60px;
margin-top: 20px;
}
......
<template>
<div class="info-dialog" v-if="infoDialogShow">
<iframe :src="iframeSrc" ref="infoIframe" frameborder="0" class="info-iframe"></iframe>
<iframe
:src="iframeSrc"
ref="infoIframe"
frameborder="0"
class="info-iframe"
></iframe>
</div>
</template>
<script>
import Vue from 'vue'
export default {
data () {
import Vue from "vue";
export default {
data() {
return {
infoDialogShow: false,
iframeSrc: '',
visiableTimer: null
}
iframeSrc: "",
visiableTimer: null,
};
},
methods: {
showInfo(info, isVisible, type) {
this.infoDialogShow = true;
window.infoDialogVm = this;
if(arguments.length > 1) {
if (arguments.length > 1) {
this.infoDialogShow = isVisible;
switch (type) {
case 'info':
this.iframeSrc = 'static/infoDialog.html';
case "info":
this.iframeSrc = "static/infoDialog.html";
break;
case 'picDetail':
this.iframeSrc = 'static/picDetailDialog.html';
case "picDetail":
this.iframeSrc = "static/picDetailDialog.html";
break;
case 'paramSetting':
this.iframeSrc = 'static/paramSettingDialog.html';
case "paramSetting":
this.iframeSrc = "static/paramSettingDialog.html";
break;
default:
break;
}
} else if(arguments.length == 1) {
this.iframeSrc = 'static/infoDialog.html';
} else if (arguments.length == 1) {
this.iframeSrc = "static/infoDialog.html";
} else {
return;
}
if(this.infoDialogShow) {
if (this.infoDialogShow) {
let self = this;
if(self && !self._isDestroyed) {
if (self && !self._isDestroyed) {
self.visiableTimer = setTimeout(() => {
try {
this.$refs.infoIframe.contentWindow.globalVm = this;
} catch (error) { }
if(type == undefined) {
} catch (error) {}
if (type == undefined) {
try {
if(this.$refs.infoIframe.contentWindow) {
if (this.$refs.infoIframe.contentWindow) {
this.$refs.infoIframe.contentWindow.changeText(info, this);
}
} catch (err) {
this.infoDialogShow = false;
eval("console.log('自定义弹窗changeText异常:', err.message)")
eval("console.log('自定义弹窗changeText异常:', err.message)");
}
} else {
try {
if(this.$refs.infoIframe.contentWindow) {
if (this.$refs.infoIframe.contentWindow) {
this.$refs.infoIframe.contentWindow.filterType(info);
}
} catch (err) {
......@@ -71,25 +76,25 @@
hide() {
this.infoDialogShow = false;
window.clearTimeout(this.visiableTimer);
}
}
}
},
},
};
</script>
<style scoped>
.info-dialog {
.info-dialog {
width: 100%;
height: 100%;
position: relative;
z-index: 99990;
}
.info-iframe {
}
.info-iframe {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
/* z-index: 99990; */
}
}
</style>
......@@ -9,12 +9,20 @@
<template>
<div class="config-box">
<div class="switch-box">
<el-radio v-model="radio" label="defaultConfig">正常配置</el-radio>
<el-radio v-model="radio" label="illegalStopDefaultConfig">违停配置</el-radio>
<el-radio v-model="radio" label="defaultConfigTemplate"
>正常配置</el-radio
>
<el-radio v-model="radio" label="illegalStopDefaultConfigTemplate"
>违停配置</el-radio
>
</div>
<el-row>
<el-col :span="3" class="search-box">
<el-input placeholder="请输入内容" v-model="paramsval" class="input-with-select">
<el-input
placeholder="请输入内容"
v-model="paramsval"
class="input-with-select"
>
<el-button
slot="append"
icon="el-icon-search"
......@@ -36,88 +44,90 @@
></iframe>
</el-col>
<el-col :span="1" :offset="19">
<el-button type="primary" @click="saveConfig" class="save-btn">保存</el-button>
<el-button type="primary" @click="saveConfig" class="save-btn"
>保存</el-button
>
</el-col>
</el-row>
</div>
</template>
<script>
import xml from './baseConfig.js'
import xml from "./baseConfig.js";
export default {
data() {
return {
paramsval:'',
radio: 'defaultConfig',
config:'',
configid:''
}
paramsval: "",
radio: "defaultConfigTemplate",
config: "",
configid: "",
};
},
watch:{
radio(val){
this.getbaseConf(val)
}
watch: {
radio(val) {
this.getbaseConf(val);
},
methods:{
xmlInit: function(obj) {
},
methods: {
xmlInit: function (obj) {
this.$refs.iframeconfig.contentWindow.loadParameterTree(
obj.content,
'<?xml version="1.0" encoding="GBK"?><root></root>'
);
},
getbaseConf(type){
this.$api.device.getConfig(type).then(res => {
this.config = res.data.content
this.configid = res.data.id
this.xmlInit(res.data)
})
getbaseConf(type) {
this.$api.device.getConfig(type).then((res) => {
this.config = res.data.content;
this.configid = res.data.id;
this.xmlInit(res.data);
});
},
saveConfig(){
saveConfig() {
this.$refs.iframeconfig.contentWindow.submit();
//ifram 传递回来的饿xml
let XMLStr = this.$refs.iframeconfig.contentWindow.xmlStr;
if(!XMLStr) {
XMLStr = this.config
if (!XMLStr) {
XMLStr = this.config;
}
this.$api.device.saveConfig(this.configid,{content:XMLStr}).then(res => {
if(res.ecode == 200) {
this.$api.device
.saveConfig(this.configid, { content: XMLStr })
.then((res) => {
if (res.ecode == 200) {
this.$message({
type: "success",
message: '保存成功!'
message: "保存成功!",
});
} else {
this.$message({
type: "error",
message: '保存失败!'
message: "保存失败!",
});
}
})
});
},
},
mounted(){
mounted() {
setTimeout(() => {
this.getbaseConf('defaultConfig')
this.getbaseConf("defaultConfig");
}, 2000);
}
}
},
};
</script>
<style>
.config-box{
margin:10px;
.config-box {
margin: 10px;
background: #fff;
overflow: hidden;
}
.switch-box{
margin:10px 0 0 10px
.switch-box {
margin: 10px 0 0 10px;
}
.search-box,.content-box{
margin:10px;
.search-box,
.content-box {
margin: 10px;
}
.save-btn{
.save-btn {
float: right;
margin-bottom: 20px;
}
......
<template>
<div class="contentBox">
<div class="content">
<div style="padding:8px 20px;">
<div style="padding: 8px 20px">
<span class="inputBox">
<el-input
v-model="storename"
......@@ -10,17 +10,17 @@
</span>
<el-button
type="primary"
style="position: relative;top: -2px;"
style="position: relative; top: -2px"
@click="query"
>查询</el-button
>
<span style="float: right;">
<span style="float: right">
<el-button type="info" icon="el-icon-search" @click="add"
>添加</el-button
>
</span>
</div>
<div style="padding: 0 15px 20px 23px;">
<div style="padding: 0 15px 20px 23px">
<el-table
:height="tableHeight"
:data="tableData"
......@@ -33,7 +33,7 @@
<el-table-column align="center" label="上传时间">
<template slot-scope="scope">
<div>
{{showLocalTime(scope.row.create_dt,'local')}}
{{ showLocalTime(scope.row.create_dt, "local") }}
</div>
</template>
</el-table-column>
......@@ -94,9 +94,9 @@
</template>
</el-table-column>
</el-table>
<div style="margin-top: 28px;">
<div style="margin-top: 28px">
<el-pagination
style="float: right;"
style="float: right"
background
prev-text="上一页"
next-text="下一页"
......@@ -108,7 +108,7 @@
:total="total"
>
</el-pagination>
<div style="clear: both;"></div>
<div style="clear: both"></div>
</div>
</div>
</div>
......@@ -125,15 +125,17 @@
action="uploadUrl"
:http-request="httpRequest"
:on-success="uploadsuccess"
:before-upload="beforeUpload"
multiple
name="file"
:auto-upload="false"
:auto-upload="true"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
>
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> -->
</el-upload>
<div>提示:上传文件仅支持xml格式!</div>
</el-form-item>
</el-form>
</div>
......@@ -162,7 +164,7 @@ export default {
props: {
label: "name",
children: "child",
isLeaf: "leaf"
isLeaf: "leaf",
},
detailData: [],
dev_unid: localStorage.getItem("dev_unid"),
......@@ -170,7 +172,7 @@ export default {
picture_busy: 0,
picture_free: 0,
video_busy: 0,
video_free: 0
video_free: 0,
},
total: 0,
page: 1,
......@@ -181,7 +183,7 @@ export default {
detailVisible: false,
storename: "",
curentSubList: [],
tableHeight: window.opsTableHeight
tableHeight: window.opsTableHeight,
};
},
components: {},
......@@ -189,6 +191,13 @@ export default {
this.query();
},
methods: {
beforeUpload(file) {
let isXML = file.type == "text/xml";
if (!isXML) {
this.$message.error("上传文件只能是 XML 格式!");
}
return isXML;
},
// 自定义的上传函数
httpRequest(param) {
this.file = [];
......@@ -196,27 +205,27 @@ export default {
this.file.push(param.file);
},
save() {
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
// this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
// 最重要的就是这段代码
var upData = new FormData(); // 首先创建FormData对象
this.file.forEach(file => {
this.file.forEach((file) => {
upData.append("file", file); // 因为要上传多个文件,所以需要遍历一下才行
upData.append("name", this.names);
upData.append("is_temp", 0);
});
this.$api.resource.uploadStore(upData).then(res => {
this.$api.resource.uploadStore(upData).then((res) => {
if (res.unid) {
this.addVisible = false;
this.query();
this.$logs.oplogs(res,'serv_store',`上传配置:${ this.names}`);
this.$logs.oplogs(res, "serv_store", `上传配置:${this.names}`);
this.$message({
type: "success",
message: "上传成功!"
message: "上传成功!",
});
} else {
this.$message({
type: "error",
message: res.enote
message: res.enote,
});
}
});
......@@ -230,11 +239,11 @@ export default {
}
if (node.level > 1) return resolve([]);
this.$api.resource.getSubTask({}, node.data.unid).then(res => {
this.$api.resource.getSubTask({}, node.data.unid).then((res) => {
if (res.list_data == null) {
res.list_data = [];
}
res.list_data.forEach(item => {
res.list_data.forEach((item) => {
item.name = item.subtask_name;
item["leaf"] = true;
});
......@@ -249,20 +258,20 @@ export default {
{
limit: this.pageSize,
offset: offset,
name__like: this.storename
name__like: this.storename,
},
this.dev_unid
)
.then(res => {
.then((res) => {
this.total = res.total_num;
if (res.list_data == null) {
this.tableData = [];
} else {
this.tableData = res.list_data;
}
this.tableData.forEach(list => {
this.tableData.forEach((list) => {
let ellipsisText = "";
list.task_list.forEach(item => {
list.task_list.forEach((item) => {
ellipsisText += item.name + ",";
});
ellipsisText = ellipsisText.substring(0, ellipsisText.length - 1);
......@@ -272,14 +281,14 @@ export default {
});
console.log(this.tableData);
})
.catch(error => {});
.catch((error) => {});
},
add() {
this.addVisible = true;
},
taskFormatter(row, column, cellValue, index) {
let columnText = "";
row.task_list.forEach(item => {
row.task_list.forEach((item) => {
columnText += item.name + ",";
});
columnText = columnText.substring(0, columnText.length - 1);
......@@ -302,16 +311,16 @@ export default {
this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
type: "warning",
})
.then(() => {
this.$api.resource.delStore({}, row.unid).then(res => {
this.$api.resource.delStore({}, row.unid).then((res) => {
if (res.ecode == 200) {
this.$message({
type: "success",
message: "删除成功!"
message: "删除成功!",
});
this.$logs.oplogs(res,'serv_store',`删除配置:${ row.name}`);
this.$logs.oplogs(res, "serv_store", `删除配置:${row.name}`);
this.query();
}
});
......@@ -319,15 +328,15 @@ export default {
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
message: "已取消删除",
});
});
},
exportFun(index, row){
exportFun(index, row) {
let url = location.origin;
location.href = `${url}/api/v1/devconf_fx/store_confs/export/${row.unid}`
}
}
location.href = `${url}/api/v1/devconf_fx/store_confs/export/${row.unid}`;
},
},
};
</script>
<style lang="scss" scoped>
......
......@@ -12,12 +12,19 @@
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>
<span class="tree-label">{{
data.label
}}</span>
<span class="tree-label">{{ data.label }}</span>
</span>
<span class="tree-btn" v-if="node.label=='平台同步资源'">
<i :class="{'el-icon-refresh':true,'animterefresh':refreshload}" @click.stop="nodeRefreshClick(node, data)"></i>
<span class="tree-btn" v-if="node.label == '平台同步资源'">
<i
:class="{ 'el-icon-refresh': true, animterefresh: refreshload }"
@click.stop="nodeRefreshClick(node, data)"
></i>
</span>
<span class="tree-btn" v-if="node.label == '视频云平台同步资源'">
<i
:class="{ 'el-icon-refresh': true, animterefresh: cloudRefreshload }"
@click.stop="cloudNodeRefreshClick(node, data)"
></i>
</span>
</span>
</el-tree>
......@@ -30,31 +37,39 @@ export default {
data() {
return {
isLoadingTree: false,
refreshload:false,
refreshload: false,
cloudRefreshload: false,
syncTreeData: [
{
id: "0",
unid: "0",
label: "平台同步资源",
root: "平台同步资源",
children: []
}
children: [],
},
{
id: "-1",
unid: "-1",
label: "视频云平台同步资源",
root: "视频云平台同步资源",
children: [],
},
],
defaultProps: {
children: "children",
label: "label"
}
label: "label",
},
};
},
props: {
filterText: {
type: String,
default: ""
default: "",
},
treeDatas: {
type: Array,
defalut: []
}
defalut: [],
},
},
components: {},
watch: {
......@@ -66,7 +81,7 @@ export default {
},
treeDatas(val) {
this.treeData[0].childs = val;
}
},
},
methods: {
initTree(data) {
......@@ -74,15 +89,20 @@ export default {
this.refreshload = false;
this.isLoadingTree = true;
},
initCloudTree(data) {
this.syncTreeData[1].children = data;
this.cloudRefreshload = false;
this.isLoadingTree = true;
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
handleNodeClick(data) {
debugger
debugger;
if (data.label !== "平台同步资源" && data.is_leaf) {
this.$emit("syncTable", data);
};
}
},
handleRefresh(s, d, n) {
// console.log(s, d, n)
......@@ -92,16 +112,26 @@ export default {
id: "1",
label: "平台同步资源",
root: "平台同步资源",
children: []
}
children: [],
},
{
id: "2",
label: "视频云平台同步资源",
root: "视频云平台同步资源",
children: [],
},
];
this.$parent.getSyncTree();
},
nodeRefreshClick(){
nodeRefreshClick() {
this.refreshload = true;
this.$emit('refreshData')
}
}
this.$emit("refreshData");
},
cloudNodeRefreshClick() {
this.cloudRefreshload = true;
this.$emit("cloudRefreshData");
},
},
};
</script>
......@@ -110,14 +140,30 @@ export default {
/* max-height: 216px; */
/* overflow: hidden; */
}
.animterefresh{
animation:turn 1s linear infinite;
.animterefresh {
animation: turn 1s linear infinite;
}
@keyframes turn{
0%{-webkit-transform:rotate(0deg);}
25%{-webkit-transform:rotate(90deg);}
50%{-webkit-transform:rotate(180deg);}
75%{-webkit-transform:rotate(270deg);}
100%{-webkit-transform:rotate(360deg);}
@keyframes turn {
0% {
-webkit-transform: rotate(0deg);
}
25% {
-webkit-transform: rotate(90deg);
}
50% {
-webkit-transform: rotate(180deg);
}
75% {
-webkit-transform: rotate(270deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
</style>
\ No newline at end of file
......@@ -9,7 +9,7 @@
<el-col :span="24">
<div class="pic-wrap">
<el-image
style="width: 100%;"
style="width: 100%"
:src="curPicData.bigpic"
:preview-src-list="srcList"
>
......@@ -17,7 +17,7 @@
<img
:src="curPicData.bigpic"
alt=""
style="width: 30%;display: block;margin: 0 auto;"
style="width: 30%; display: block; margin: 0 auto"
/>
</div>
</el-image>
......@@ -57,27 +57,21 @@
"
>
<ul class="pic-info">
<li
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.vehicle_body_type_text"
>
<div v-if="curPicData.event_type === 'vehicle'">
<li :title="curPicData.vehicle_body_type_text">
<span>车辆类型:</span>
<span>{{ curPicData.vehicle_body_type_text }}</span>
</li>
<li
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.vehicle_plate_text"
>
<li :title="curPicData.vehicle_plate_text">
<span>车牌号码:</span>
<span>{{ curPicData.vehicle_plate_text }}</span>
</li>
<li
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.plate_type_text"
>
<li :title="curPicData.plate_type_text">
<span>车牌类型:</span>
<span>{{ curPicData.plate_type_text }}</span>
</li>
</div>
<li :title="curPicData.shoot_date">
<span>经过日期:</span>
<span>{{ curPicData.shoot_date }}</span>
......@@ -90,133 +84,87 @@
<span>经过地点:</span>
<span>{{ curPicData.location_name }}</span>
</li>
<li
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.vehicle_body_logo_text"
>
<div v-if="curPicData.event_type === 'vehicle'">
<li :title="curPicData.vehicle_body_logo_text">
<span>车辆品牌:</span>
<span>{{ curPicData.vehicle_body_logo_text }}</span>
</li>
<!-- <li :title="curPicData.vehicle_body_type_text">
<span>车辆类型:</span>
<span>{{ curPicData.vehicle_body_type_text }}</span>
</li> -->
<!-- 机动车 -->
<li
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.plate_color_text"
>
<li :title="curPicData.plate_color_text">
<span>车牌颜色:</span>
<span>{{ curPicData.plate_color_text }}</span>
</li>
<li
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.vehicle_body_color_text"
>
<li :title="curPicData.vehicle_body_color_text">
<span>车身颜色:</span>
<span>{{ curPicData.vehicle_body_color_text }}</span>
</li>
<li
hidden
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.RefinedFeature_text"
>
<li hidden :title="curPicData.RefinedFeature_text">
<span>标志物:</span>
<span>{{ curPicData.RefinedFeature_text }}</span>
</li>
</div>
<!-- 非机动车 -->
<li
v-if="curPicData.event_type === 'xcycle'"
:title="curPicData.xcycle_type_text"
>
<div v-if="curPicData.event_type === 'xcycle'">
<li :title="curPicData.xcycle_type_text">
<span>骑车类型:</span>
<span>{{ curPicData.xcycle_type_text }}</span>
</li>
<li
v-if="curPicData.event_type === 'xcycle'"
:title="curPicData.xcycle_color_type"
>
<li :title="curPicData.xcycle_color_type">
<span>车辆颜色:</span>
<span>{{ curPicData.xcycle_color_type }}</span>
</li>
<li
:title="curPicData.driver_face_sex"
v-if="curPicData.event_type === 'xcycle'"
>
<li :title="curPicData.driver_face_sex">
<span>性别:</span>
<span>{{ curPicData.driver_face_sex }}</span>
</li>
<li
v-if="curPicData.event_type === 'xcycle'"
:title="curPicData.company"
>
<li :title="curPicData.company">
<span>运营公司:</span>
<span>{{ curPicData.company }}</span>
</li>
<li
v-if="curPicData.event_type === 'xcycle'"
:title="curPicData.driver_face_upbody_text"
>
<li :title="curPicData.driver_face_upbody_text">
<span>上身颜色:</span>
<span>{{ curPicData.driver_face_upbody_text }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'xcycle'"
>
<li :title="curPicData.driver_face_lobody_text">
<span>速度:</span>
<span>{{ curPicData.location_speed }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'xcycle'"
>
<li :title="curPicData.driver_face_lobody_text">
<span>戴帽子:</span>
<span>{{ curPicData.driver_face_with_hats }}</span>
</li>
</div>
<!-- 行人 -->
<li
:title="curPicData.driver_face_sex"
v-if="curPicData.event_type === 'pedestrian'"
>
<div v-if="curPicData.event_type === 'pedestrian'">
<li :title="curPicData.driver_face_sex">
<span>性别:</span>
<span>{{ curPicData.driver_face_sex }}</span>
</li>
<li
:title="curPicData.driver_face_upbody_text"
v-if="curPicData.event_type === 'pedestrian'"
>
<li :title="curPicData.driver_face_upbody_text">
<span>上身颜色:</span>
<span>{{ curPicData.driver_face_upbody_text }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'pedestrian'"
>
<li :title="curPicData.driver_face_lobody_text">
<span>下身颜色:</span>
<span>{{ curPicData.driver_face_lobody_text }}</span>
</li>
<li
:title="curPicData.pedestrian_height"
v-if="curPicData.event_type === 'pedestrian'"
>
<li :title="curPicData.pedestrian_height">
<span>身高:</span>
<span>{{ curPicData.pedestrian_height }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'pedestrian'"
>
<li :title="curPicData.driver_face_lobody_text">
<span>速度:</span>
<span>{{ curPicData.location_speed }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'pedestrian'"
>
<li :title="curPicData.driver_face_lobody_text">
<span>戴帽子:</span>
<span>{{ curPicData.driver_face_with_hats }}</span>
</li>
</div>
<li v-if="curPicData.illegalType" :title="curPicData.illegalType">
<span>违法类型:</span>
<span>{{ curPicData.illegalType }}</span>
......@@ -239,9 +187,7 @@
</li>
<li :title="getCode('安防事件', curPicData.event_type)">
<span>事件类型:</span>
<span>{{
curPicData.event_type
}}</span>
<span>{{ curPicData.event_type }}</span>
</li>
<li
:title="curPicData.shoot_time"
......@@ -272,14 +218,15 @@ export default {
carImg: "",
isShow: false,
curPicData: {},
srcList: []
srcList: [],
};
},
methods: {
detailInfo: function(data) {
detailInfo: function (data) {
this.curPicData = {};
this.curPicData = data;
this.srcList = [];
console.log('curPicData', this.curPicData);
setTimeout(() => {
if (data.bigpic) {
this.srcList.push(data.bigpic);
......@@ -288,11 +235,11 @@ export default {
this.isShow = true;
this.$store.commit("setocxstate", 0);
},
beforeHideModal: function() {
beforeHideModal: function () {
this.isShow = false;
this.$emit("closeDetailModal");
},
picMove: function(e) {
picMove: function (e) {
var e = e || window.event;
if (e.target.getAttribute("class").indexOf("small") > -1) {
let imgWidth = e.target.width;
......@@ -304,8 +251,8 @@ export default {
} else {
return;
}
}
}
},
},
};
</script>
......
......@@ -23,7 +23,7 @@
:class="{
'task-lsit': true,
runningtask: item.status == 'Running',
stoptask: item.status != 'Running'
stoptask: item.status != 'Running',
}"
>
<!-- <i
......@@ -47,7 +47,7 @@
v-show="subTask.enableStatus != 1"
:class="[
{ subtaskActive: subTask.subtask_id == currentSubtaskId },
{ disabledColor: subTask.enableStatus == 5 }
{ disabledColor: subTask.enableStatus == 5 },
]"
:data-subtask="subTask.subtask_id"
:id="subTask.vchan.vdev_unid + ',' + subTask.vchan.vchan_refid"
......@@ -63,7 +63,11 @@
<el-col :span="15" class="ht100">
<div class="video-box">
<div class="play-box">
<videoplay ref="videoplay" :playurl="playurl" v-if="!ischrome"></videoplay>
<videoplay
ref="videoplay"
:playurl="playurl"
v-if="!ischrome"
></videoplay>
<flvvideo ref="flvideo" v-if="ischrome"></flvvideo>
</div>
<div class>
......@@ -90,7 +94,7 @@
</template>
<script>
import videoplay from "../public/videoPlay";
import flvvideo from "../public/flvvideo"
import flvvideo from "../public/flvvideo";
import InfoDialog from "../public/infodialog";
import setting from "./setting";
import eventtab from "./eventTab";
......@@ -100,7 +104,7 @@ export default {
InfoDialog,
setting,
flvvideo,
eventtab
eventtab,
},
data() {
return {
......@@ -112,21 +116,21 @@ export default {
subindex: -1,
playurl: "",
taskID: "",
streamclock:null,
streamclock: null,
currentSubtaskId: "",
defaultProps: {
children: "children",
label: "label"
label: "label",
},
timer: null,
searchstate: null
searchstate: null,
};
},
methods: {
selecttask(data, index) {
this.subTasks = [];
this.subindex = index;
this.$api.task.getSubTask(data.task_id).then(res => {
this.$api.task.getSubTask(data.task_id).then((res) => {
this.subTasks = res.list_data;
this.taskID = data.task_id;
});
......@@ -143,7 +147,7 @@ export default {
if (vdata.running_status != "Running") {
this.$message({
message: "该任务没有运行,无法获取分析视频和抓拍信息",
type: "error"
type: "error",
});
return;
}
......@@ -154,109 +158,108 @@ export default {
let that = this;
this.$api.task
.getTask({
task_name: this.searchInfo
task_name: this.searchInfo,
})
.then(res => {
.then((res) => {
that.taskdata = res.list_data;
console.log(res);
});
},
//发送推流请求
pushSteam(vdata) {
this.steam(vdata).then(m => {
this.steam(vdata).then((m) => {
if (m.ecode) {
this.$message({
message: "发送推流请求失败:" + m.enote,
type: "error"
type: "error",
});
} else {
this.vchandata = vdata.vchan;
clearInterval(this.streamclock)
clearInterval(this.streamclock);
this.streamclock = null;
this.getPlayUrl();
}
})
});
},
steam(vdata){
return new Promise((resolve, reject) =>{
steam(vdata) {
return new Promise((resolve, reject) => {
let data = {
send_stream: true,
task_id: this.currentSubtaskId,
is_analyse: true
is_analyse: true,
};
this.$api.task
.getStream(this.dev_unid, vdata.vchan.vchan_refid, data)
.then(m => {
.then((m) => {
resolve(m);
});
})
});
},
getPlayUrl: function() {
if(this.ischrome) {
getPlayUrl: function () {
if (this.ischrome) {
let ip = this.$api.flvIP;
let url = `${window.config.https?'https':'http'}://${ip}:${window.config.https?'20070':'8080'}/live/${this.currentSubtaskId}.flv`
console.log("FLV播放地址:", url)
debugger
let url = `${window.config.https ? "https" : "http"}://${ip}:${
window.config.https ? "20070" : "20080"
}/live/${this.currentSubtaskId}.flv`;
console.log("FLV播放地址:", url);
debugger;
this.$refs.flvideo.startFunc(url);
this.streamclock = setInterval(()=> {
this.steam(this.subtaskdata)
},9000)
this.streamclock = setInterval(() => {
this.steam(this.subtaskdata);
}, 9000);
}
if(this.subtaskdata.task_algo_type == '12') {
console.log(this.subtaskdata)
this.playurl = {rtsp_url:this.subtaskdata.vchan.url};
console.log("bkurl",this.playurl)
if (this.subtaskdata.task_algo_type == "12") {
console.log(this.subtaskdata);
this.playurl = { rtsp_url: this.subtaskdata.vchan.url };
console.log("bkurl", this.playurl);
setTimeout(() => {
this.$refs.videoplay.videoPlay();
}, 2000);
return false;
}
this.$api.task.getPlayUrl(this.currentSubtaskId).then(res => {
this.$api.task.getPlayUrl(this.currentSubtaskId).then((res) => {
this.playurl = res;
if (this.playurl.rtsp_url) {
this.$message({
message: "获取播放地址成功,请耐心等待视频加载",
type: "success"
type: "success",
});
setTimeout(() => {
!this.ischrome?this.$refs.videoplay.videoPlay():null;
!this.ischrome ? this.$refs.videoplay.videoPlay() : null;
}, 2000);
console.info("视频播放地址:", this.playurl.rtsp_url);
} else {
this.$message({
message: "获取rtsp播放地址失败!请重试!",
type: "error"
type: "error",
});
}
});
},
getVchansIsSending() {
this.axios.get(this.API.task.getstream()).then(res => {});
this.axios.get(this.API.task.getstream()).then((res) => {});
},
debounce(fn, wait) {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
fn;
}, wait);
}
},
},
watch: {
searchInfo(val) {
this.debounce(this.getTask(), 800);
}
},
},
created() {
this.getTask();
this.ischrome = this.checkchrome();
},
mounted() {
},
beforeDestroy(){
mounted() {},
beforeDestroy() {
clearInterval(this.streamclock);
this.streamclock = null;
}
},
};
</script>
......@@ -352,7 +355,6 @@ export default {
.runningtask {
// color rgba(1, 206, 184, 0.56);
@include font-colr(runtask_color);
}
.stoptask {
......@@ -405,7 +407,7 @@ export default {
.subtaskActive {
position: relative;
color: #333;
padding-right:10px;
padding-right: 10px;
}
.subtaskActive::before {
......
......@@ -178,7 +178,7 @@
background
prev-text="上一页"
next-text="下一页"
:page-sizes="[30, 50, 100, 200]"
:page-sizes="$pageSizeOpts"
layout="total, prev, pager, next,sizes, jumper"
:current-page="page"
@size-change="handleSizeChange"
......@@ -297,7 +297,7 @@ export default {
formattterData: [],
total: 0,
page: 1,
pageSize: 30,
pageSize: this.$pageSize,
selectcheck: [],
currentIndex: 0,
taskList: [],
......
......@@ -180,7 +180,7 @@
background
prev-text="上一页"
next-text="下一页"
:page-sizes="[30, 50, 100, 200]"
:page-sizes="$pageSizeOpts"
layout="total, prev, pager, next,sizes, jumper"
:current-page="page"
@size-change="handleSizeChange"
......@@ -300,7 +300,7 @@ export default {
formatterData: [],
total: 0,
page: 1,
pageSize: 30,
pageSize: this.$pageSize,
selectcheck: [],
currentIndex: 0,
taskList: [],
......
......@@ -109,6 +109,7 @@
stripe
v-loading="loading"
border
:class="$pageSizeOpts[0] === 10 ? 'ten-table-wrapper' : ''"
>
<el-table-column
prop="index"
......@@ -200,7 +201,7 @@
background
prev-text="上一页"
next-text="下一页"
:page-sizes="[30, 50, 100, 200]"
:page-sizes="$pageSizeOpts"
layout="total, prev, pager, next,sizes, jumper"
:current-page="page"
@size-change="handleSizeChange"
......@@ -232,7 +233,7 @@ export default {
formatterData: [],
total: 0,
page: 1,
pageSize: 30,
pageSize: this.$pageSize,
taskList: [],
subTaskList: [],
tableHeight: window.oneSearchTableHeight
......
......@@ -129,7 +129,7 @@
background
prev-text="上一页"
next-text="下一页"
:page-sizes="[30, 50, 100, 200]"
:page-sizes="$pageSizeOpts"
layout="total, prev, pager, next,sizes, jumper"
:current-page="page"
@size-change="handleSizeChange"
......@@ -255,7 +255,7 @@ export default {
formattterData: [],
total: 0,
page: 1,
pageSize: 30,
pageSize: this.$pageSize,
selectcheck: [],
currentIndex: 0
};
......
......@@ -19,7 +19,7 @@
prop="task_name"
class="form-item"
:rules="[
{ required: true, message: '请输入任务名称', trigger: 'blur' }
{ required: true, message: '请输入任务名称', trigger: 'blur' },
]"
>
<el-input
......@@ -38,14 +38,12 @@
:popper-append-to-body="false"
:disabled="pedittype == 'edit'"
>
<el-option value="" label="--"></el-option>
<el-option value="0" label="交通"></el-option>
<el-option value="1" label="客流"></el-option>
<el-option value="2" label="安防"></el-option>
<el-option value="2" label="行为分析"></el-option>
<el-option value="12" label="行为分析_BG"></el-option>
<el-option value="3" label="违停"></el-option>
<el-option value="5" label="交通行人"></el-option>
<el-option
v-for="(item, index) in algorTypeList"
:key="index"
:value="item.value"
:label="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="场景占用" class="form-item" prop="resource_use">
......@@ -82,7 +80,7 @@
></el-date-picker> -->
<el-time-picker
is-range
style="width:100%"
style="width: 100%"
value-format="HH:mm:ss"
v-model="timer"
range-separator="至"
......@@ -144,6 +142,7 @@
</template>
<script>
import { algorTypeList } from "@/enum/index";
export default {
data() {
var checkStore = (rule, value, callback) => {
......@@ -157,44 +156,45 @@ export default {
setvisible: false,
timer: ["00:00:00", "23:59:59"],
backpdata: "",
headertitle:"添加任务",
headertitle: "添加任务",
formData: {
task_name: "",
task_algo_type: 0,
is_send: 0,
store_conf: {
unid: ""
unid: "",
},
priority: "normal",
period: true
period: true,
},
pedittype:"add",
pedittype: "add",
vchanAry: [],
platT: [],
sessionData: {},
store_confs: [],
algorTypeList: algorTypeList,
rules: {
task_algo_type: [
{ required: true, message: "请选择算法类型", trigger: "change" }
{ required: true, message: "请选择算法类型", trigger: "change" },
],
stores: [
{ required: true, message: "存储配置不能为空!", trigger: "change" }
{ required: true, message: "存储配置不能为空!", trigger: "change" },
],
resource_use: [
{ required: true, message: "场景占用不能为空!", trigger: "change" }
{ required: true, message: "场景占用不能为空!", trigger: "change" },
],
store_conf_unid: [
{ required: true, validator: checkStore, trigger: "change" }
]
}
{ required: true, validator: checkStore, trigger: "change" },
],
},
};
},
props: {
freeList: {
type: Array,
// eslint-disable-next-line vue/require-valid-default-prop
default: []
}
default: [],
},
},
watch: {},
mounted() {},
......@@ -203,7 +203,7 @@ export default {
if (this.freeList && this.freeList.length > 0) {
var freeArr = [];
let that = this;
this.freeList.forEach(ele => {
this.freeList.forEach((ele) => {
if (ele.license_info && ele.license_info.platType) {
if (that.platT.length == 0) {
that.platT.push(ele.license_info.platType);
......@@ -228,23 +228,23 @@ export default {
this.platT = [];
this.setvisible = true;
if (type == "add") {
this.headertitle = "新建任务"
this.headertitle = "新建任务";
//timer单独拿到form外层是因为element一个bug放到内层后不能修改时间
this.timer = ["00:00:00", "23:59:59"];
this.formData = {
task_name: "",
task_algo_type: "0",
store_conf: {
unid: ""
unid: "",
},
priority: "normal",
plate_type: "",
plate_time: "",
period: true
period: true,
};
}
if (type == "edit") {
this.headertitle = "修改任务"
this.headertitle = "修改任务";
this.pedittype = type;
if (pdata.start_time) {
let startT = pdata.start_time;
......@@ -255,7 +255,7 @@ export default {
}
this.formData = JSON.parse(JSON.stringify(pdata));
this.backpdata = JSON.parse(JSON.stringify(pdata));
this.$api.task.getSubTask(pdata.task_id).then(res => {
this.$api.task.getSubTask(pdata.task_id).then((res) => {
let ary = [];
let data = res.list_data;
for (let i in data) {
......@@ -266,7 +266,7 @@ export default {
data.vchan = {
subtask_id: data[i].subtask_id,
refid: "",
vchan_name: data[i].subtask_name
vchan_name: data[i].subtask_name,
};
}
ary.push(data[i].vchan);
......@@ -305,7 +305,7 @@ export default {
plate_type: this.formData.plate_type,
resource_use: this.formData.resource_use,
task_type: "normal",
enable_status: true
enable_status: true,
// algo_comb_unid: this.formData.store_conf,
};
......@@ -321,24 +321,28 @@ export default {
}
},
addTask(data) {
this.$refs["taskForm"].validate(valid => {
this.$refs["taskForm"].validate((valid) => {
if (valid) {
this.$api.task
.addTask(data, {
"content-type": "multipart/form-data"
"content-type": "multipart/form-data",
})
.then(res => {
.then((res) => {
if (res.ecode && res.ecode != 500) {
this.setvisible = false;
this.$emit("refresh");
} else {
this.$message({
message: res.enote,
type: "error"
type: "error",
});
}
debugger
this.$logs.oplogs(res,'serv_task',`添加任务${this.formData.task_name}`);
debugger;
this.$logs.oplogs(
res,
"serv_task",
`添加任务${this.formData.task_name}`
);
});
} else {
console.log("error submit!!");
......@@ -347,21 +351,21 @@ export default {
},
editTask(data) {
data.is_send = this.sendstatus(data);
this.$api.task.editTask(data, this.formData.task_id).then(res => {
this.$api.task.editTask(data, this.formData.task_id).then((res) => {
if (res.ecode == "200") {
this.setvisible = false;
this.$emit("refresh");
this.$message({
message: res.enote,
type: "success"
type: "success",
});
} else {
this.$message({
message: res.enote,
type: "error"
type: "error",
});
}
this.$logs.oplogs(res,'serv_task',`修改了任务${data.task_name}`);
this.$logs.oplogs(res, "serv_task", `修改了任务${data.task_name}`);
});
},
sendstatus(data) {
......@@ -382,22 +386,21 @@ export default {
getStore() {
let params = {
offset: 0,
limit: ""
limit: "",
};
this.$api.device.getStore(params).then(res => {
this.$api.device.getStore(params).then((res) => {
this.store_confs = res.list_data;
});
},
},
created() {
this.getStore();
}
},
};
</script>
<style lang="stylus" scoped>
.form-item {
margin-bottom 13px
margin-bottom: 13px;
}
</style>
......@@ -156,6 +156,14 @@ export default {
tableData: [],
zNodes: [
{
name: "视频云设备",
id: "-1",
count: 500,
times: 1,
isParent: true,
dev_unid: this.dev_unid,
},
{
name: "外部设备",
id: "0",
count: 500,
......@@ -347,11 +355,26 @@ export default {
} else if (parentNode.name === "内部设备") {
let vchans = childNodes.vchan_struct || childNodes.list_data;
treenode = vchans
} else {
} else if (parentNode.name === "外部设备") {
treenode = childNodes.result.childs;
} else if (parentNode.name === "视频云设备") {
this.dealCloudTree(childNodes.data);
treenode = childNodes.data;
console.log('childNodes', childNodes);
}
return treenode;
},
dealCloudTree(list) {
list.forEach(d => {
if (d.orgName) d.name = d.orgName;
console.log('d', d)
d.vchan_type = "cloud";
if (d.child && d.child.length > 0) {
d.childs = d.child;
this.dealCloudTree(d.child);
}
});
},
showModal(val) {
this.taskData = val;
this.tableData = [];
......@@ -426,6 +449,7 @@ export default {
let status = true;
let subData = [];
this.tableData.map((e) => {
console.log(e);
let vchan = e;
let data = {
is_dome: false,
......@@ -435,10 +459,11 @@ export default {
vchan_duid: vchan.duid || vchan.vchan_duid,
vdev_unid: this.dev_unid,
vchan_name: vchan.name,
vchan_type: vchan.vchan_type || ""
},
assign_to: {
id: this.taskData.plate_type,
flag: 1,
flag: 1
},
};
subData.push(data);
......@@ -555,10 +580,18 @@ export default {
}
});
},
serchVchan(){
async serchVchan(){
if(this.searchText == '') {
var zNodes = [
{
name: "视频云设备",
id: "-1",
count: 500,
times: 1,
isParent: true,
dev_unid: this.dev_unid,
},
{
name: "外部设备",
id: "0",
count: 500,
......@@ -584,24 +617,25 @@ export default {
},
]
var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, zNodes);
return
return;
}
this.$api.resource.getcatalogs({vchan_name_like:this.searchText }).then(res => {
this.$api.device.getDevtreeLike(this.dev_unid,'内部设备',{vchan_name_like:this.searchText }).then(camerares => {
this.$api.device.getDevtreeLike(this.dev_unid,'短视频',{vchan_name_like:this.searchText }).then(vchanres => {
var params = {
vchan_name_like: this.searchText
};
const res = await this.$api.resource.getcatalogs(params);
const camerares = await this.$api.device.getDevtreeLike(this.dev_unid,'内部设备', params);
const vchanres = await this.$api.device.getDevtreeLike(this.dev_unid,'短视频', params);
const cloudres = await this.$api.device.getCloudDev(params);
this.dealCloudTree(cloudres.data);
setTimeout(() => {
this.zNodes[0].childs = res.result?res.result.childs:[]
this.zNodes[1].childs = camerares.vchan_struct
this.zNodes[2].childs = vchanres.list_data
this.zNodes[0].childs = cloudres?cloudres.data:[];
this.zNodes[1].childs = res.result?res.result.childs:[];
this.zNodes[2].childs = camerares.vchan_struct;
this.zNodes[3].childs = vchanres.list_data;
var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes);
ztree.expandAll(true)
this.checkvckan()
ztree.expandAll(true);
this.checkvckan();
}, 10);
})
})
})
},
rowclick(row) {
//播放视频
......
......@@ -43,7 +43,7 @@
</div>
</div>
<div class="content">
<div style="padding: 20px 15px 20px 23px;">
<div style="padding: 20px 15px 20px 23px">
<span class="inputBox">
<el-input v-model="task_name" placeholder="请输入任务名称"></el-input>
</span>
......@@ -53,27 +53,31 @@
placeholder="请选择"
:popper-append-to-body="false"
>
<el-option value="" label="全部"></el-option>
<el-option value="0" label="交通"></el-option>
<el-option value="1" label="客流"></el-option>
<el-option value="12" label="行为分析"></el-option>
<el-option value="7" label="综合流量"></el-option>
<!-- <el-option value="4" label='人脸'></el-option> -->
<el-option
v-for="(item, index) in algorTypeList"
:key="index"
:value="item.value"
:label="item.name"
></el-option>
</el-select>
</span>
<el-button
type="primary"
style="position: relative;top: -2px;"
style="position: relative; top: -2px"
@click="query"
>查询</el-button
>
<span style="float: right;">
<el-button type="info" icon="el-icon-plus" style="padding: 7px 16px" @click="editTask('add')"
<span style="float: right">
<el-button
type="info"
icon="el-icon-plus"
style="padding: 7px 16px"
@click="editTask('add')"
>新建任务</el-button
>
</span>
</div>
<div style="padding: 0 23px 20px 23px;width:98%">
<div style="padding: 0 23px 20px 23px; width: 98%">
<el-table
height="59vh"
:data="tableData"
......@@ -192,7 +196,7 @@
'icon-fanxing-qidong': true,
playIcon: true,
noplayicon:
scope.row.status == 'NotInTimeOfDay' ? false : false
scope.row.status == 'NotInTimeOfDay' ? false : false,
}"
@click="setTaskStatus(scope.row, 'start')"
></span>
......@@ -228,9 +232,9 @@
</template>
</el-table-column>
</el-table>
<div style="margin-top: 28px;">
<div style="margin-top: 28px">
<el-pagination
style="float: right;"
style="float: right"
background
prev-text="上一页"
next-text="下一页"
......@@ -243,7 +247,7 @@
:total="total"
>
</el-pagination>
<div style="clear: both;"></div>
<div style="clear: both"></div>
</div>
</div>
<editset
......@@ -270,6 +274,8 @@
</div>
</template>
<script>
import { algorTypeList, algorTypeEnum } from "@/enum/index";
console.log('algorTypeEnum', algorTypeEnum);
import editset from "./editSet";
import editvideo from "./editVideo";
import editVidebigree from "./editVidebigree";
......@@ -280,12 +286,12 @@ export default {
editset,
editvideo,
editVidebigree,
subTaskInfo
subTaskInfo,
},
mixins: [mixin],
data() {
return {
isbigtree:window.config.bigtree,
isbigtree: window.config.bigtree,
task_name: "",
curtask: "",
task_algo_type: "",
......@@ -301,7 +307,8 @@ export default {
pedittype: "add",
currentRow: {},
assign_ip: "",
curscrollTop: 0
curscrollTop: 0,
algorTypeList: algorTypeList,
};
},
......@@ -310,7 +317,7 @@ export default {
if (!row.isexpand) {
//打开获取子任务
row.isexpand = true;
this.$api.task.getSubTask(row.task_id).then(res => {
this.$api.task.getSubTask(row.task_id).then((res) => {
let ary = [];
let data = res.list_data;
for (let i in data) {
......@@ -378,7 +385,7 @@ export default {
}
},
getFreelist() {
this.$api.device.getFreelist(this.dev_unid).then(res => {
this.$api.device.getFreelist(this.dev_unid).then((res) => {
this.freeList = res.list_data;
});
// /
......@@ -393,21 +400,7 @@ export default {
}
},
typeFormatter(row, column, cellValue, index) {
if (cellValue == 0) {
return "交通";
} else if (cellValue == 1) {
return "客流";
} else if (cellValue == 2) {
return "行为分析";
} else if (cellValue == 3) {
return "违停";
} else if (cellValue == 5) {
return "交通行人";
} else if (cellValue == 7) {
return "综合流量";
} else {
return "未知";
}
return algorTypeEnum[cellValue] || "未知";
},
numFormatter(row, column, cellValue, index) {
return (index + 1) * this.page;
......@@ -435,15 +428,15 @@ export default {
task_algo_type: this.task_algo_type,
source_type: "pull_video_stream",
task_type: "normal",
task_name: this.task_name
task_name: this.task_name,
})
.then(res => {
.then((res) => {
this.total = res.total_num;
if (res.list_data == null) {
this.tableData = [];
} else {
res.list_data.forEach(item => {
res.list_data.forEach((item) => {
item.subTaskData = [];
if (item.start_dt) {
//先转utc格式
......@@ -468,7 +461,7 @@ export default {
});
}
})
.catch(error => {});
.catch((error) => {});
},
editVideo(index, row) {
this.setsSrollTop();
......@@ -482,7 +475,7 @@ export default {
if (row.status == "Running") {
this.$message({
type: "info",
message: "暂停任务再尝试操作!"
message: "暂停任务再尝试操作!",
});
return;
}
......@@ -495,8 +488,8 @@ export default {
});
},
setTaskStatus(data, type) {
if(type == 'start') {
localStorage.setItem("substatus",data.task_id)
if (type == "start") {
localStorage.setItem("substatus", data.task_id);
}
this.setsSrollTop();
// if (data.status == "NotInTimeOfDay") {
......@@ -504,14 +497,18 @@ export default {
// }
this.$api.task
.setTaskStatus(data.task_id, { start_stop_status: type })
.then(res => {
.then((res) => {
this.$message({
type: res.ecode == "200" ? "success" : "error",
message: res.enote
message: res.enote,
});
if (res.ecode == "200") {
let typename = type=='start'?"启动":"暂停"
this.$logs.oplogs(res,'serv_task',`${typename}任务${data.task_name}`);
let typename = type == "start" ? "启动" : "暂停";
this.$logs.oplogs(
res,
"serv_task",
`${typename}任务${data.task_name}`
);
this.getTaskList();
}
});
......@@ -520,14 +517,14 @@ export default {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
type: "warning",
}).then(() => {
this.$api.task.deleteTask(data.task_id).then(res => {
this.$api.task.deleteTask(data.task_id).then((res) => {
this.$message({
type: res.ecode == "200" ? "success" : "error",
message: res.enote
message: res.enote,
});
this.$logs.oplogs(res,'serv_task',`删除任务${data.task_name}`);
this.$logs.oplogs(res, "serv_task", `删除任务${data.task_name}`);
if (res.ecode == "200") {
this.getTaskList();
}
......@@ -537,7 +534,6 @@ export default {
setsSrollTop() {
this.curscrollTop = this.$refs.table.$el.children[2].scrollTop;
},
},
mounted() {
this.getTaskList();
......@@ -545,7 +541,7 @@ export default {
created() {
this.curscrollTop = 0;
this.getFreelist();
}
},
};
</script>
<style lang="scss" scoped>
......
const fs = require("fs");
const path = require("path");
const resolve = dir => {
return path.join(__dirname, dir)
}
const vinfopath = "./public/js/version.json";
const BuildInfo = require("./version.js");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
......@@ -29,18 +33,19 @@ module.exports = {
]
},
chainWebpack: config => {
config.resolve.alias.set("@", resolve("src"));
// config.entry('main').add('babel-polyfill')
if (process.env.use_analyzer) {
// 分析
config
.plugin("webpack-bundle-analyzer")
.use(require("webpack-bundle-analyzer").BundleAnalyzerPlugin);
}
};
if (process.env.NODE_ENV === "production") {
var verinfo = fs.openSync(vinfopath, "w+");
var options = { encoding: "UTF-8", mode: 438 /*=0666*/, flag: "w" };
fs.writeFileSync(verinfo, JSON.stringify(BuildInfo), options);
}
};
},
pluginOptions: {
// 第三方插件配置
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!