Commit 0e503840 by 罗鑫霖

高新区-软测修改

1 parent 5c64452e
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 \ No newline at end of file
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
<script src="<%= BASE_URL %>js/keymaster.js"></script> <script src="<%= BASE_URL %>js/keymaster.js"></script>
<script src="<%= BASE_URL %>js/config.js"></script> <script src="<%= BASE_URL %>js/config.js"></script>
<script src="<%= BASE_URL %>js/flv.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> --> <!-- <script src="<%= BASE_URL %>js/NodePlayer-full.min.js"></script> -->
</head> </head>
<body id="theme-name"> <body id="theme-name">
......
...@@ -19,9 +19,10 @@ window.config = { ...@@ -19,9 +19,10 @@ window.config = {
"huasanDD": 'http://aaa.zzgx.gov.cn/oauth/authorize?response_type=code&scope=read&client_id=KLjmdAH0', "huasanDD": 'http://aaa.zzgx.gov.cn/oauth/authorize?response_type=code&scope=read&client_id=KLjmdAH0',
"ddwsurl":"123.6.38.39:29090", "ddwsurl":"123.6.38.39:29090",
"isdd":false, //是否开启钉钉登录 "isdd":false, //是否开启钉钉登录
"version":"2.1.0", "version":"2.1.1",
"encrypt":false,//是否加密true采用sha1加密,false不加密 "encrypt":false,//是否加密true采用sha1加密,false不加密
"nvsUrl":'http://47.94.37.10:8888', "nvsUrl":'http://47.94.37.10:8888',
"nvsRegex":'rtsp://47.94.37.10/lskjapp/', "nvsRegex":'rtsp://47.94.37.10/lskjapp/',
"isNvs3000":true,//是否开启nvs3000拉取功能 "isNvs3000":true,//是否开启nvs3000拉取功能
"isGaoXinQu": true, //是否是郑州高新区
} }
{"commit":"6f6a48e2b677829ac314a8a72547c506f9546278","commitDate":"2021-11-11 16:27","buildDate":"2021-11-12 18:36","version":"2.1.0","info":"合并冲突"}
\ No newline at end of file \ No newline at end of file
{"commit":"5c64452e5cdc120d37edf748a605495f5e61efee","commitDate":"2021-11-23 14:48","buildDate":"2022-4-17 16:18","version":"2.1.0","info":"lxl"}
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,7 @@ let wsIP = ""; ...@@ -21,7 +21,7 @@ let wsIP = "";
let flvIP = ""; let flvIP = "";
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": 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"; flvIP = window.config.https?"192.168.9.233":"192.168.9.233";
break; break;
case "pre": case "pre":
......
...@@ -12,9 +12,9 @@ import axios from "axios"; ...@@ -12,9 +12,9 @@ import axios from "axios";
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 = window.config.https ? "https://192.168.9.245:20070" : "http://192.168.9.233: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.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; baseUrl = "http://123.6.38.39:20080";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
break; break;
case "pre": case "pre":
......
...@@ -25,15 +25,26 @@ export default { ...@@ -25,15 +25,26 @@ export default {
case "短视频": case "短视频":
url = "/vchans?vchan_type=vfile"; url = "/vchans?vchan_type=vfile";
break; break;
case "视频云设备":
url = "/video_cloud?vchan_type=cloud";
break;
} }
if(window.config.bigtree && devname == "外部设备") { if (window.config.bigtree) {
return `${baseUrl}/api/v1/devconf_fx${url}` //ztree版本 if(devname == "外部设备") {
} else if(devname == "外部设备"){ return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
return api.get(`${baseUrl}/api/v1/devconf_fx/${url}`, params); } else if (devname == "视频云设备") {
} else if(window.config.bigtree){ return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}` } else {
}else { return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`;
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`) }
} else {
if(devname == "外部设备") {
return api.get(`${baseUrl}/api/v1/devconf_fx/${url}`, params);
} 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 { ...@@ -99,5 +110,11 @@ export default {
}, },
saveConfig:(id,params) => { saveConfig:(id,params) => {
return api.post(`${baseUrl}/api/v1/devconf_fx/content/${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 { ...@@ -136,7 +136,7 @@ export default {
}, },
getcatalogs(params){ getcatalogs(params){
return api.get( return api.get(
`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params `${baseUrl}/api/v1/devconf_fx/device_catalogs`, params
); );
}, },
refreshcatlog(){ refreshcatlog(){
......
...@@ -8,6 +8,9 @@ export default { ...@@ -8,6 +8,9 @@ export default {
detailImg(params, id) { detailImg(params, id) {
return api.get(urls.detailImg + id, params); return api.get(urls.detailImg + id, params);
}, },
detailImgBatch(params) {
return api.post(urls.detailImgBatch, params);
},
detailVideo(params, id) { detailVideo(params, id) {
return api.get(urls.detailvideo + id, params); return api.get(urls.detailvideo + id, params);
}, },
......
import baseUrl from '../baseUrl' import baseUrl from '../baseUrl'
export default { export default {
// 交通方面表格 // 交通方面表格
tableList: baseUrl + '/api/v1/traffic/events', tableList: baseUrl + '/api/v1/traffic/events',
// 事件查询表格 // 事件查询表格
eventTableList: baseUrl + '/api/v1/behavior/events', eventTableList: baseUrl + '/api/v1/behavior/events',
// 获取详情图片 // 获取详情图片
detailImg: baseUrl + '/api/v1/web/pics/', detailImg: baseUrl + '/api/v1/web/pics/',
//批量获取照片
detailImgBatch: baseUrl + '/api/v1/web/pics/batch_get',
// 删除 // 删除
delVehicle: baseUrl + '/api/v1/traffic/events/', delVehicle: baseUrl + '/api/v1/traffic/events/',
// 批量删除 // 批量删除
......
...@@ -56,9 +56,8 @@ class Codes { ...@@ -56,9 +56,8 @@ class Codes {
publicCode() { publicCode() {
try { try {
// eslint-disable-next-line camelcase // 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_date = shoot_dt[0];
this.result.shoot_time = shoot_dt[1]; this.result.shoot_time = shoot_dt[1];
} catch (error) { } catch (error) {
...@@ -144,17 +143,17 @@ class Codes { ...@@ -144,17 +143,17 @@ class Codes {
try { try {
this.result.illegalTypestate = parseInt(this.allData.event_data.illegal.state); this.result.illegalTypestate = parseInt(this.allData.event_data.illegal.state);
this.result.illegalType = this.result.illegalType =
parseInt(this.allData.event_data.illegal.state) === 1 parseInt(this.allData.event_data.illegal.state) === 1 ?
? this.getCode("违法类型", this.allData.event_data.illegal.code) this.getCode("违法类型", this.allData.event_data.illegal.code) :
: "正常"; "正常";
} catch (err) { } catch (err) {
this.result.illegalType = "未识别"; this.result.illegalType = "未识别";
} }
try { try {
this.result.location_name = 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) { } catch (e) {
this.result.location_name = "未识别"; this.result.location_name = "未识别";
} }
...@@ -182,14 +181,14 @@ class Codes { ...@@ -182,14 +181,14 @@ class Codes {
} catch (err) { } catch (err) {
this.result.plate_type_text = "未识别"; this.result.plate_type_text = "未识别";
} }
try { try {
this.result.plate_color_text = this.getCode( this.result.plate_color_text = this.getCode(
"号牌颜色", "号牌颜色",
this.allData.event_data.vehicle.plate.color_code this.allData.event_data.vehicle.plate.color_code
); );
} catch (err) { } catch (err) {
this.result.plate_color_text = "未识别"; this.result.plate_color_text = "未识别";
} }
try { try {
this.result.vehicle_body_color_text = this.getCode( this.result.vehicle_body_color_text = this.getCode(
"车身颜色", "车身颜色",
...@@ -227,7 +226,7 @@ class Codes { ...@@ -227,7 +226,7 @@ class Codes {
} catch (e) { } catch (e) {
// console.log("遮阳板无"); // console.log("遮阳板无");
} }
if (ary.length) { if (ary.length) {
this.result.RefinedFeature_text = ary.join(""); this.result.RefinedFeature_text = ary.join("");
} else { } else {
...@@ -290,9 +289,9 @@ class Codes { ...@@ -290,9 +289,9 @@ class Codes {
// 违法类型 // 违法类型
try { try {
this.result.illegalType = this.result.illegalType =
parseInt(this.allData.event_data.illegal.state) === 1 parseInt(this.allData.event_data.illegal.state) === 1 ?
? this.getCode("违法类型", this.allData.event_data.illegal.code) this.getCode("违法类型", this.allData.event_data.illegal.code) :
: "正常"; "正常";
} catch (err) { } catch (err) {
this.result.illegalType = "未识别"; this.result.illegalType = "未识别";
} }
...@@ -334,9 +333,9 @@ class Codes { ...@@ -334,9 +333,9 @@ class Codes {
// 地点名称 // 地点名称
try { try {
this.result.location_name = 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) { } catch (e) {
this.result.location_name = "未识别"; this.result.location_name = "未识别";
} }
...@@ -347,7 +346,7 @@ class Codes { ...@@ -347,7 +346,7 @@ class Codes {
} catch (error) { } catch (error) {
this.result.xcycle_plate_text = "未识别"; this.result.xcycle_plate_text = "未识别";
} }
// 骑车类型 // 骑车类型
// console.log(this.allData.event_data.xcycle_type) // console.log(this.allData.event_data.xcycle_type)
if (!this.allData.event_data.xcycle_type) { if (!this.allData.event_data.xcycle_type) {
...@@ -371,27 +370,37 @@ class Codes { ...@@ -371,27 +370,37 @@ class Codes {
this.result.xcycle_type_text = "未识别"; this.result.xcycle_type_text = "未识别";
} }
} }
console.log('company',this.allData.event_data.xcycle.company.code)
try { try {
if (this.result.xcycle_type_text === "自行车") { if (this.event_type === 'xcycle') {
this.result.company = this.allData.event_data.xcycle.company.name; this.result.company = this.getCode(
} else if (this.result.xcycle_type_text === "摩托车") { "运营公司",
this.result.company = this.getCode( this.allData.event_data.xcycle.company.code
"外卖公司", );
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 { } else {
this.result.company = ""; this.result.company = "未识别";
} }
} catch (error) { } catch (error) {
this.result.company = "未识别"; 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() {} pflow() {}
...@@ -403,7 +412,7 @@ class Codes { ...@@ -403,7 +412,7 @@ class Codes {
} }
getCode(codeName, code) { getCode(codeName, code) {
var name = window.localStorage.getItem(codeName + "-" + code); var name = window.localStorage.getItem(codeName + "-" + code);
name = name || ""; name = name || "未识别";
return name; return name;
} }
/** /**
...@@ -451,13 +460,13 @@ class Codes { ...@@ -451,13 +460,13 @@ class Codes {
bjTime = new Date(time); bjTime = new Date(time);
} }
var standardTime = [ var standardTime = [
[bjTime.getFullYear(), bjTime.getMonth() + 1, bjTime.getDate()].join("-"), [bjTime.getFullYear(), bjTime.getMonth() + 1, bjTime.getDate()].join("-"),
[bjTime.getHours(), bjTime.getMinutes(), bjTime.getSeconds()].join(":") [bjTime.getHours(), bjTime.getMinutes(), bjTime.getSeconds()].join(":")
] ]
.join(" ") .join(" ")
.replace(/(?=\b\d\b)/g, "0"); .replace(/(?=\b\d\b)/g, "0");
return standardTime; return standardTime;
} }
} }
export let buildCode = new Codes(); export let buildCode = new Codes();
\ No newline at end of file \ No newline at end of file
import Vue from "vue"; import Vue from "vue";
import { buildImgurl } from "@/libs/utils";
Vue.prototype.dev_unid = "2cb6e39adc5176b81879f6c22f1d9e1c"; Vue.prototype.dev_unid = "2cb6e39adc5176b81879f6c22f1d9e1c";
/** /**
* @param {unid} 设备id * @param {unid} 设备id
*/ */
Vue.prototype.setDevunid = function(devuid) { Vue.prototype.setDevunid = function (devuid) {
Vue.prototype.dev_unid = devuid; Vue.prototype.dev_unid = devuid;
}; };
/** /**
* tar文件上传设置 * tar文件上传设置
*/ */
Vue.prototype.uploadFile = function(file, type, size) { Vue.prototype.uploadFile = function (file, type, size) {
const isType = file.raw.type === type; const isType = file.raw.type === type;
let isSize = true; let isSize = true;
if (size) { if (size) {
...@@ -27,7 +28,7 @@ Vue.prototype.uploadFile = function(file, type, size) { ...@@ -27,7 +28,7 @@ Vue.prototype.uploadFile = function(file, type, size) {
}; };
Vue.prototype.globalWs = null; Vue.prototype.globalWs = null;
Vue.prototype.getCode = function(codeName, code) { Vue.prototype.getCode = function (codeName, code) {
var name = window.localStorage.getItem(codeName + "-" + code); var name = window.localStorage.getItem(codeName + "-" + code);
name = name ? name : ""; name = name ? name : "";
return name; return name;
...@@ -36,10 +37,10 @@ Vue.prototype.getCode = function(codeName, code) { ...@@ -36,10 +37,10 @@ Vue.prototype.getCode = function(codeName, code) {
* @param {src} 图片路径 * @param {src} 图片路径
* 图片放大 * 图片放大
*/ */
Vue.prototype.zoomImg = function(data) { Vue.prototype.zoomImg = function (data) {
store.commit("setImgsrc", data); store.commit("setImgsrc", data);
}; };
Vue.filter("sexfn", function(value) { Vue.filter("sexfn", function (value) {
if (!value) return; if (!value) return;
var str = ""; var str = "";
if (value == 1) str = "男"; if (value == 1) str = "男";
...@@ -47,7 +48,7 @@ Vue.filter("sexfn", function(value) { ...@@ -47,7 +48,7 @@ Vue.filter("sexfn", function(value) {
return str; return str;
}); });
Vue.filter("dbnamefn", function(value) { Vue.filter("dbnamefn", function (value) {
let dbData = store.state.initinfo.facedbdata, let dbData = store.state.initinfo.facedbdata,
dbname = ""; dbname = "";
dbData.forEach(ele => { dbData.forEach(ele => {
...@@ -58,7 +59,7 @@ Vue.filter("dbnamefn", function(value) { ...@@ -58,7 +59,7 @@ Vue.filter("dbnamefn", function(value) {
return dbname; return dbname;
}); });
Vue.filter("filterDeployType", function(value) { Vue.filter("filterDeployType", function (value) {
let dbData = store.state.alarmtype, let dbData = store.state.alarmtype,
dbname = ""; dbname = "";
dbData.forEach(ele => { dbData.forEach(ele => {
...@@ -73,7 +74,7 @@ Vue.filter("filterDeployType", function(value) { ...@@ -73,7 +74,7 @@ Vue.filter("filterDeployType", function(value) {
* @param {provenceid} 省份id * @param {provenceid} 省份id
* @param {cityid} 城市id * @param {cityid} 城市id
*/ */
Vue.prototype.showCity = function(provenceid, cityid) { Vue.prototype.showCity = function (provenceid, cityid) {
this.cData = this.$store.state.initinfo.province; this.cData = this.$store.state.initinfo.province;
var province = provenceid; var province = provenceid;
var provinceNmae = ""; var provinceNmae = "";
...@@ -81,7 +82,7 @@ Vue.prototype.showCity = function(provenceid, cityid) { ...@@ -81,7 +82,7 @@ Vue.prototype.showCity = function(provenceid, cityid) {
var curProvince = ""; var curProvince = "";
var city = cityid; var city = cityid;
if (province) { if (province) {
this.cData.forEach(function(ele) { this.cData.forEach(function (ele) {
if (ele.code == province) { if (ele.code == province) {
if (ele.cities) curProvince = ele.cities; if (ele.cities) curProvince = ele.cities;
provinceNmae = ele.name; provinceNmae = ele.name;
...@@ -89,7 +90,7 @@ Vue.prototype.showCity = function(provenceid, cityid) { ...@@ -89,7 +90,7 @@ Vue.prototype.showCity = function(provenceid, cityid) {
}, this); }, this);
if (city) { if (city) {
if (curProvince) if (curProvince)
curProvince.list_data.forEach(function(ele) { curProvince.list_data.forEach(function (ele) {
if (ele.code == city) { if (ele.code == city) {
cityName = ele.name; cityName = ele.name;
} }
...@@ -105,7 +106,7 @@ Vue.prototype.showCity = function(provenceid, cityid) { ...@@ -105,7 +106,7 @@ Vue.prototype.showCity = function(provenceid, cityid) {
* @param {obj} * @param {obj}
* 格式化时间 * 格式化时间
*/ */
Vue.prototype.timeForm = function(obj) { Vue.prototype.timeForm = function (obj) {
var nowY = obj.getFullYear(); var nowY = obj.getFullYear();
var nowM = var nowM =
obj.getMonth() + 1 < 10 ? "0" + (obj.getMonth() + 1) : obj.getMonth() + 1; obj.getMonth() + 1 < 10 ? "0" + (obj.getMonth() + 1) : obj.getMonth() + 1;
...@@ -117,12 +118,12 @@ Vue.prototype.timeForm = function(obj) { ...@@ -117,12 +118,12 @@ Vue.prototype.timeForm = function(obj) {
nowY + "-" + nowM + "-" + nowD + " " + nowH + ":" + nowMi + ":" + nowS; nowY + "-" + nowM + "-" + nowD + " " + nowH + ":" + nowMi + ":" + nowS;
return timeNow; return timeNow;
}; };
Vue.prototype.yesterDay = function() { Vue.prototype.yesterDay = function () {
var data = new Date().getTime() - 24 * 60 * 60 * 1000; var data = new Date().getTime() - 24 * 60 * 60 * 1000;
var curdate = this.timeForm(new Date(data)); var curdate = this.timeForm(new Date(data));
return curdate.split(" ")[0] + " " + "00:00:00"; return curdate.split(" ")[0] + " " + "00:00:00";
}; };
Vue.prototype.nowDay = function(){ Vue.prototype.nowDay = function () {
var data = new Date(); var data = new Date();
return this.timeForm(data); return this.timeForm(data);
}; };
...@@ -130,7 +131,7 @@ Vue.prototype.nowDay = function(){ ...@@ -130,7 +131,7 @@ Vue.prototype.nowDay = function(){
* @param {obj} * @param {obj}
* UTC时间处理 * UTC时间处理
*/ */
Vue.prototype.setUtcTime = function(obj) { Vue.prototype.setUtcTime = function (obj) {
if (obj && obj != "") { if (obj && obj != "") {
let num = new Date(obj).getTime(); let num = new Date(obj).getTime();
let offset = Math.abs(new Date().getTimezoneOffset()); let offset = Math.abs(new Date().getTimezoneOffset());
...@@ -168,7 +169,7 @@ function checkIE() { ...@@ -168,7 +169,7 @@ function checkIE() {
} }
} }
let sha1 = require('js-sha1') let sha1 = require('js-sha1')
Vue.prototype.baseencode = function(str){ Vue.prototype.baseencode = function (str) {
// return str // return str
// let base = ""; // let base = "";
// let version = window.config.version // let version = window.config.version
...@@ -178,7 +179,7 @@ Vue.prototype.baseencode = function(str){ ...@@ -178,7 +179,7 @@ Vue.prototype.baseencode = function(str){
// if(vs > 210) { // if(vs > 210) {
// base = str; // base = str;
// } else { // } else {
// } // }
// } else { // } else {
// base = sha1(str); // base = sha1(str);
...@@ -190,7 +191,7 @@ Vue.prototype.baseencode = function(str){ ...@@ -190,7 +191,7 @@ Vue.prototype.baseencode = function(str){
return base return base
// return sha1(str); // return sha1(str);
} }
Vue.prototype.showLocalTime = function(obj) { Vue.prototype.showLocalTime = function (obj) {
if (obj == undefined) return; if (obj == undefined) return;
let dt = "", let dt = "",
ndt = ""; ndt = "";
...@@ -223,11 +224,11 @@ Vue.prototype.showLocalTime = function(obj) { ...@@ -223,11 +224,11 @@ Vue.prototype.showLocalTime = function(obj) {
* @param {*} key * @param {*} key
* @param {*} val * @param {*} val
*/ */
Vue.prototype.uuid = function() { Vue.prototype.uuid = function () {
var s = []; var s = [];
var hexDigits = "0123456789abcdef"; var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) { for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
} }
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
...@@ -239,7 +240,7 @@ Vue.prototype.uuid = function() { ...@@ -239,7 +240,7 @@ Vue.prototype.uuid = function() {
/** /**
* 本地存储相机信息 * 本地存储相机信息
*/ */
Vue.prototype.setCameralocalStor = function(key, val) { Vue.prototype.setCameralocalStor = function (key, val) {
if (window.localStorage) { if (window.localStorage) {
localStorage[key] = val; localStorage[key] = val;
} else { } else {
...@@ -251,7 +252,7 @@ Vue.prototype.setCameralocalStor = function(key, val) { ...@@ -251,7 +252,7 @@ Vue.prototype.setCameralocalStor = function(key, val) {
* @param {key} * @param {key}
* 获取本地存储相机信息 * 获取本地存储相机信息
*/ */
Vue.prototype.getCameralocalStor = function(key) { Vue.prototype.getCameralocalStor = function (key) {
var val = ""; var val = "";
if (window.localStorage) { if (window.localStorage) {
val = localStorage[key]; val = localStorage[key];
...@@ -264,7 +265,7 @@ Vue.prototype.getCameralocalStor = function(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 isJPG = file.type === "image/jpeg";
const isLt2M = file.size / 1024 / 1024 < 2; const isLt2M = file.size / 1024 / 1024 < 2;
...@@ -280,7 +281,7 @@ Vue.prototype.uploadImgCondition = function(file) { ...@@ -280,7 +281,7 @@ Vue.prototype.uploadImgCondition = function(file) {
/** /**
* base64图片 * base64图片
*/ */
Vue.prototype.base64Img = function(file) { Vue.prototype.base64Img = function (file) {
// eslint-disable-next-line no-redeclare // eslint-disable-next-line no-redeclare
var file = file.file; var file = file.file;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -289,7 +290,7 @@ Vue.prototype.base64Img = function(file) { ...@@ -289,7 +290,7 @@ Vue.prototype.base64Img = function(file) {
if (file) { if (file) {
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }
reader.onloadend = function(evt) { reader.onloadend = function (evt) {
srcs = reader.result.split(",")[1]; srcs = reader.result.split(",")[1];
let data = { let data = {
pic_base64: srcs, pic_base64: srcs,
...@@ -305,18 +306,14 @@ Vue.prototype.base64Img = function(file) { ...@@ -305,18 +306,14 @@ Vue.prototype.base64Img = function(file) {
/** /**
* 判断是否是chrome浏览器 * 判断是否是chrome浏览器
*/ */
Vue.prototype.checkchrome = function() { Vue.prototype.checkchrome = function () {
var isWebKit = navigator.userAgent.indexOf('WebKit') > -1 // var isWebKit = navigator.userAgent.indexOf('WebKit') > -1 //
return isWebKit return isWebKit
}; };
/** /**
* https路径处理 * https路径处理
*/ */
Vue.prototype.buildImgurl = function(url){ Vue.prototype.buildImgurl = buildImgurl;
let uri = window.config.https? url.replace('http','https'):url;
let result = window.config.https? uri.replace('20080','20070'):uri;
return result
}
/** /**
* code操作 * code操作
...@@ -337,4 +334,4 @@ Vue.prototype.getCode = (codeName, code) => { ...@@ -337,4 +334,4 @@ Vue.prototype.getCode = (codeName, code) => {
var name = localStorage.getItem(codeName + "-" + code); var name = localStorage.getItem(codeName + "-" + code);
name = name ? name : ""; name = name ? name : "";
return name; return name;
}; };
\ No newline at end of file \ No newline at end of file
...@@ -267,6 +267,9 @@ display: table-cell!important; ...@@ -267,6 +267,9 @@ display: table-cell!important;
.el-dialog .el-select--small{ .el-dialog .el-select--small{
width: 100%; 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{ /* .el-dialog .el-form-item--small .el-form-item__content,.el-dialog .el-form-item--small .el-form-item__label{
line-height: 26px; line-height: 26px;
} */ } */
...@@ -285,7 +288,7 @@ display: table-cell!important; ...@@ -285,7 +288,7 @@ display: table-cell!important;
margin-left: -10px; margin-left: -10px;
} }
.el-form-item--mini.el-form-item, .el-form-item--small.el-form-item { .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
margin-bottom: 4px; margin-bottom: 15px;
line-height: 32px; line-height: 32px;
} }
/* 切换 */ /* 切换 */
......
...@@ -566,6 +566,9 @@ a:active{ ...@@ -566,6 +566,9 @@ a:active{
transform:none; transform:none;
left: 0; left: 0;
} }
.el-image-viewer__wrapper {
z-index: 3600 !important;
}
.detailDialog .el-icon-circle-close{ .detailDialog .el-icon-circle-close{
color: #fff; color: #fff;
} }
...@@ -649,7 +652,7 @@ a:active{ ...@@ -649,7 +652,7 @@ a:active{
} }
.listboxitem .el-form-item--small .el-form-item__content, .el-form-item--small .el-form-item__label { .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; padding-left: 5px;
} }
.displaybtn-box { .displaybtn-box {
......
<template> <template>
<div style="width: 100%;height: 100%;position: relative;"> <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> <p
<object v-show="videoShow" id="nvrTotalOcx" name="nvrTotalOcx" style="
classid="CLSID:96DFBBAF-4220-4978-9681-4ABA534A7718" position: absolute;
codebase="./static/OcxInstall/VionNvrVideoInstall.exe#version=1,0,24" top: 113px;
style="width: 100%; height:100%;"> z-index: 99;
<param name="BorderStyle" value="1" /> text-align: center;
<param name="MousePointer" value="0" /> width: 100%;
<param name="Enabled" value="1" /> "
<param name="Min" value="0" /> v-if="noIE"
<param name="Max" value="10" /> >
<embed wmode="opaque"/> 请选择IE9以上版本查看视频!
<param name="wmode" value="transparent"/> </p>
</object> <object
<!--安装弹框--> v-show="videoShow"
<el-dialog title="提示" :visible.sync="stepDialogVisible" width='252px' :close-on-click-modal='false' @close="stepClose"> id="nvrTotalOcx"
<span>本网站需要安装视频插件才可正常使用,请安装完成后请手动重启浏览器</span> name="nvrTotalOcx"
<div slot="footer" class="dialog-footer"> classid="CLSID:96DFBBAF-4220-4978-9681-4ABA534A7718"
<el-button @click="stepDialogVisible = false">关闭</el-button> codebase="./static/OcxInstall/VionNvrVideoInstall.exe#version=1,0,24"
</div> style="width: 100%; height: 100%"
</el-dialog> >
<!--更新弹框--> <param name="BorderStyle" value="1" />
<el-dialog title="提示" :visible.sync="updateDialogVisible" width='252px' :close-on-click-modal='false' @close="stepClose"> <param name="MousePointer" value="0" />
<span>该网站当前视频插件版本为{{currentVersion}},可能导致部分功能不完善,请更新到最新版本1.0.33</span> <param name="Enabled" value="1" />
<div slot="footer" class="dialog-footer"> <param name="Min" value="0" />
<el-button @click="updateDialogVisible = false">关闭</el-button> <param name="Max" value="10" />
</div> <embed wmode="opaque" />
</el-dialog> <param name="wmode" value="transparent" />
</div> </object>
<!--安装弹框-->
<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
>
<div slot="footer" class="dialog-footer">
<el-button @click="updateDialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
export default{ export default {
data(){ data() {
return{ return {
videoShow:true, videoShow: true,
noIE:false, noIE: false,
currentVersion:0, currentVersion: 0,
updateDialogVisible:false, updateDialogVisible: false,
stepDialogVisible:false stepDialogVisible: false,
} };
}, },
mounted(){ mounted() {
setTimeout(()=>{ setTimeout(() => {
this.initVideo(); this.initVideo();
},300) }, 300);
}, },
methods:{ methods: {
stepClose(){ stepClose() {
this.videoShow=true; this.videoShow = true;
}, },
initVideo(){ initVideo() {
var ieVer=this.IEVersion(); var ieVer = this.IEVersion();
if(ieVer==7||ieVer==8||ieVer==6||ieVer=='-1'){ if (ieVer == 7 || ieVer == 8 || ieVer == 6 || ieVer == "-1") {
this.noIE=true this.noIE = true;
}else{ } else {
this.noIE=false this.noIE = false;
try{ try {
this.currentVersion=document.getElementById('nvrTotalOcx').GetOcxVersion(); this.currentVersion = document
var versionArr=this.currentVersion.split('.'); .getElementById("nvrTotalOcx")
var versionNum=0; .GetOcxVersion();
versionArr.forEach((item,index,arr)=>{ var versionArr = this.currentVersion.split(".");
versionNum=versionNum+Number(item); var versionNum = 0;
}) versionArr.forEach((item, index, arr) => {
if(versionNum<34){ versionNum = versionNum + Number(item);
this.videoShow=false; });
this.updateDialogVisible=true; if (versionNum < 34) {
window.open('./OcxInstall/NvrVideoInstall_1.0.33.exe') this.videoShow = false;
} this.updateDialogVisible = true;
}catch(e){ window.open("./OcxInstall/NvrVideoInstall_1.0.33.exe");
this.videoShow=false; }
this.stepDialogVisible=true; } catch (e) {
window.open('./OcxInstall/NvrVideoInstall_1.0.33.exe') this.videoShow = false;
return false this.stepDialogVisible = true;
} window.open("./OcxInstall/NvrVideoInstall_1.0.33.exe");
} return false;
if(typeof nvrTotalOcx != 'undefined'){ }
var testStr = 'Null'; }
nvrTotalOcx.Init(0, testStr, 1); if (typeof nvrTotalOcx != "undefined") {
nvrTotalOcx.SetSingleWindow(true); var testStr = "Null";
nvrTotalOcx.SetParam("VideoSize", 0); nvrTotalOcx.Init(0, testStr, 1);
var medianame = '视频0'; nvrTotalOcx.SetSingleWindow(true);
// var hostname = window.location.hostname; nvrTotalOcx.SetParam("VideoSize", 0);
var hostname = '192.168.9.120'; var medianame = "视频0";
var port=8554; // var hostname = window.location.hostname;
var url = "rtsp://"+hostname+":"+port+"/ch0"; var hostname = "192.168.9.120";
nvrTotalOcx.PlayRealVideo(url,1,'video',hostname,0); var port = 8554;
window.onbeforeunload=function(){ var url = "rtsp://" + hostname + ":" + port + "/ch0";
nvrTotalOcx.CloseVideoByChannelnum(1) nvrTotalOcx.PlayRealVideo(url, 1, "video", hostname, 0);
} window.onbeforeunload = function () {
nvrTotalOcx.CloseVideoByChannelnum(1);
} };
}, }
IEVersion() { },
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 IEVersion() {
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 var isIE =
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
if(isIE) { var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); var isIE11 =
reIE.test(userAgent); userAgent.indexOf("Trident") > -1 && userAgent.indexOf("rv:11.0") > -1;
var fIEVersion = parseFloat(RegExp["$1"]); if (isIE) {
if(fIEVersion == 7) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
return 7; reIE.test(userAgent);
} else if(fIEVersion == 8) { var fIEVersion = parseFloat(RegExp["$1"]);
return 8; if (fIEVersion == 7) {
} else if(fIEVersion == 9) { return 7;
return 9; } else if (fIEVersion == 8) {
} else if(fIEVersion == 10) { return 8;
return 10; } else if (fIEVersion == 9) {
} else { return 9;
return 6;//IE版本<=7 } else if (fIEVersion == 10) {
} return 10;
} else if(isEdge) { } else {
return 'edge';//edge return 6; //IE版本<=7
} else if(isIE11) { }
return 11; //IE11 } else if (isEdge) {
}else{ return "edge"; //edge
return -1;//不是ie浏览器 } else if (isIE11) {
} return 11; //IE11
}, } else {
hideHanlde(){ return -1; //不是ie浏览器
this.videoShow=false; }
}, },
showHanlde(){ hideHanlde() {
this.videoShow=true; this.videoShow = false;
} },
} showHanlde() {
} this.videoShow = true;
},
},
};
</script> </script>
<style> <style>
......
<template> <template>
<div class="video-box"> <div class="video-box">
<el-dialog title="录像" :visible.sync="videoDialogVisible"> <el-dialog title="录像" :visible.sync="videoDialogVisible">
<video id="playerVideo" class="dom-video" controls muted></video> <video id="playerVideo" class="dom-video" controls muted></video>
<div slot="footer" class="player-footer"> <div slot="footer" class="player-footer">
<button @click="closeVideoDialog">关闭</button> <button @click="closeVideoDialog">关闭</button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
// import {config} from '../../public/js/config' // import {config} from '../../public/js/config'
export default { export default {
data () { data() {
return { return {
videoDialogVisible: false, videoDialogVisible: false,
domTimer: null, domTimer: null,
player: '' player: "",
} };
}, },
methods: { methods: {
playvideos: function (play_url) { playvideos: function (play_url) {
let _this = this; let _this = this;
this.videoDialogVisible = true; this.videoDialogVisible = true;
this.domTimer = setTimeout(() => { this.domTimer = setTimeout(() => {
this.player = document.getElementById('playerVideo'); this.player = document.getElementById("playerVideo");
this.player.loop = true; this.player.loop = true;
if(window.config.https) { if (window.config.https) {
let loc = location.host let loc = location.host;
this.player.src = `https://${loc}/${play_url.split(":20080")[1]}` this.player.src = `https://${loc}/${play_url.split(":20080")[1]}`;
} else { } else {
this.player.src = play_url; this.player.src = play_url;
}
this.player.play();
}, 100);
},
closeVideoDialog: function () {
let _this = this;
window.clearTimeout(_this.domTimer)
this.domTimer = null;
this.player.src = '';
this.player = '';
this.videoDialogVisible = false;
}
} }
} this.player.play();
}, 100);
},
closeVideoDialog: function () {
let _this = this;
window.clearTimeout(_this.domTimer);
this.domTimer = null;
this.player.src = "";
this.player = "";
this.videoDialogVisible = false;
},
},
};
</script> </script>
<style scoped> <style scoped>
.dom-video { .dom-video {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 5px; border-radius: 5px;
} }
.player-footer button { .player-footer button {
padding: 0 2%; padding: 0 2%;
} }
</style> </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 \ 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 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 \ No newline at end of file
<template> <template>
<div> <div></div>
</div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {};
},
} created() {},
}, };
created(){
}
}
</script> </script>
<style> <style>
</style>> </style>>
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,16 @@ ...@@ -12,6 +12,16 @@
}" }"
@click="openmenu" @click="openmenu"
></span> ></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"> <div class="headRight">
<span class="timerbox">{{ curdate }}</span> <span class="timerbox">{{ curdate }}</span>
<el-dropdown class="zt-box" @command="handleCommand"> <el-dropdown class="zt-box" @command="handleCommand">
...@@ -70,9 +80,17 @@ export default { ...@@ -70,9 +80,17 @@ export default {
headertitle: "", headertitle: "",
topbarArr: [], topbarArr: [],
uname: "", uname: "",
jumpSanList: []
}; };
}, },
methods: { methods: {
jumpHandler(item) {
if(item.ddPath && location.href.includes('code')) {
window.open(item.ddPath);
} else {
window.open(item.path);
}
},
setTopBar(data) { setTopBar(data) {
if (this.topbarArr.length < 1) { if (this.topbarArr.length < 1) {
this.topbarArr.push(data); this.topbarArr.push(data);
...@@ -177,6 +195,20 @@ export default { ...@@ -177,6 +195,20 @@ export default {
}, },
}, },
created() { 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.headertitle = window.config.hadertitle;
this.uname = localStorage.getItem("uname"); this.uname = localStorage.getItem("uname");
this.$api.device.getDev().then((m) => { this.$api.device.getDev().then((m) => {
...@@ -308,7 +340,7 @@ export default { ...@@ -308,7 +340,7 @@ export default {
color: #fff; color: #fff;
font-size: 25px; font-size: 25px;
margin-left: 25px; margin-left: 25px;
margin-top: 20px; vertical-align: -4px;
} }
.headRight img { .headRight img {
...@@ -352,4 +384,21 @@ export default { ...@@ -352,4 +384,21 @@ export default {
.uname-box { .uname-box {
padding-right: 10px; 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> </style>
...@@ -71,8 +71,14 @@ ...@@ -71,8 +71,14 @@
</template> </template>
<script> <script>
import moment from "moment";
let particlesConfig = require("../assets/js/particles.json"); 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"); let sha1 = require("js-sha1");
import types from "../store/types.js"; import types from "../store/types.js";
export default { export default {
...@@ -143,15 +149,15 @@ export default { ...@@ -143,15 +149,15 @@ export default {
}) })
.then((res) => { .then((res) => {
if (!res.ecode) { if (!res.ecode) {
if(res.user_name !== this.ruleForm.username){ if (res.user_name !== this.ruleForm.username) {
return false; return false;
} }
this.loginMount(res, "user"); this.loginMount(res, "user");
} else { } else {
if (res.ecode == "1000") { if (res.ecode == "1000") {
localStorage.setItem("user_unid", res.user_unid); localStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("atoken", res.atoken); localStorage.setItem("atoken", res.atoken);
this.$router.push("/resetpass") this.$router.push("/resetpass");
} else { } else {
this.$logs.oplogs(res, "serv_login", res.enote); this.$logs.oplogs(res, "serv_login", res.enote);
this.$message({ this.$message({
...@@ -341,9 +347,9 @@ export default { ...@@ -341,9 +347,9 @@ export default {
particlesJS("login", particlesConfig); particlesJS("login", particlesConfig);
document.body.style.overflow = "hidden"; document.body.style.overflow = "hidden";
let { href } = window.location, let { href } = window.location,
code = ""; code = "";
if (href.includes("code")) { if (href.includes("code")) {
this.$router.push('/ddlogin') this.$router.push("/ddlogin");
} }
}, },
created() { created() {
......
<template> <template>
<div class="passform-box"> <div class="passform-container">
<div class="re-header">重置密码</div> <div class="passform-box">
<el-form <div class="re-header">重置密码</div>
:model="ruleForm" <el-form
:rules="rules" :model="ruleForm"
ref="ruleForm" :rules="rules"
label-width="100px" ref="ruleForm"
class="passform" label-width="100px"
> class="passform"
<div class="passformitem"> >
<el-form-item label="旧密码" prop="oldpassword"> <div class="passformitem">
<el-input v-model="ruleForm.oldpassword" type="password"></el-input> <el-form-item label="旧密码" prop="oldpassword">
<el-input v-model="ruleForm.oldpassword" type="password"></el-input>
</el-form-item>
</div>
<div class="passformitem">
<el-form-item label="新密码" prop="newpassword">
<el-input v-model="ruleForm.newpassword" type="password"></el-input>
</el-form-item>
</div>
<div class="passformitem">
<el-form-item label="密码确认" prop="checknewpassword">
<el-input
v-model="ruleForm.checknewpassword"
type="password"
></el-input>
</el-form-item>
</div>
<el-form-item>
<el-button @click="back('ruleForm')">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')"
>提交</el-button
>
</el-form-item> </el-form-item>
</div> </el-form>
<div class="passformitem"> </div>
<el-form-item label="新密码" prop="newpassword">
<el-input v-model="ruleForm.newpassword" type="password"></el-input>
</el-form-item>
</div>
<div class="passformitem">
<el-form-item label="密码确认" prop="checknewpassword">
<el-input
v-model="ruleForm.checknewpassword"
type="password"
></el-input>
</el-form-item>
</div>
<el-form-item>
<el-button @click="back('ruleForm')">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')"
>提交</el-button
>
</el-form-item>
</el-form>
</div> </div>
</template> </template>
<script> <script>
let sha1 = require('js-sha1') let sha1 = require("js-sha1");
export default { export default {
data() { data() {
var validatePass = (rule, value, callback) => { var validatePass = (rule, value, callback) => {
if (value === "") { if (value === "") {
callback(new Error("请输入密码")); callback(new Error("请输入密码"));
} else { } else {
if(value == this.ruleForm.oldpassword) { if (value == this.ruleForm.oldpassword) {
callback(new Error("新旧密码不能重复!")); 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)) { if (!pwdRegex.test(value)) {
callback(new Error("您的密码复杂度太低(密码中必须包含大写和小写字母、数字、特殊字符长度大于8位),请及时修改密码!")) callback(
new Error(
"您的密码复杂度太低(密码中必须包含大写和小写字母、数字、特殊字符长度大于8位),请及时修改密码!"
)
);
} }
if (this.ruleForm.checkPass !== "") { if (this.ruleForm.checkPass !== "") {
this.$refs.ruleForm.validateField("checkPass"); this.$refs.ruleForm.validateField("checkPass");
...@@ -71,57 +79,63 @@ export default { ...@@ -71,57 +79,63 @@ export default {
ruleForm: { ruleForm: {
oldpassword: "", oldpassword: "",
newpassword: "", newpassword: "",
checknewpassword: "" checknewpassword: "",
}, },
rules: { rules: {
oldpassword: [ oldpassword: [
{ required: true, message: "请输入旧密码", trigger: "blur" } { required: true, message: "请输入旧密码", trigger: "blur" },
], ],
newpassword: [ newpassword: [
{ validator: validatePass, trigger: "blur" }, { validator: validatePass, trigger: "blur" },
{ required: true, message: "", trigger: "blur" } { required: true, message: "", trigger: "blur" },
], ],
checknewpassword: [ checknewpassword: [
{ validator: validatePass2, trigger: "blur" }, { validator: validatePass2, trigger: "blur" },
{ required: true, message: "", trigger: "blur" } { required: true, message: "", trigger: "blur" },
] ],
} },
}; };
}, },
methods: { methods: {
submitForm(formName) { submitForm(formName) {
let data = { let data = {
old_pwd: window.config.encrypt?sha1(this.ruleForm.oldpassword):this.baseencode(this.ruleForm.oldpassword), old_pwd: window.config.encrypt
new_pwd: window.config.encrypt?sha1(this.ruleForm.newpassword):this.baseencode(this.ruleForm.newpassword), ? 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) { if (valid) {
let user_unid = localStorage.getItem("user_unid"); let user_unid = localStorage.getItem("user_unid");
this.$api.ops.resetPwd(data, user_unid).then(res => { this.$api.ops
if(res.ecode == 200){ .resetPwd(data, user_unid)
this.$logs.oplogs(res, "serv_login", `修改密码`); .then((res) => {
this.$router.push("/login"); if (res.ecode == 200) {
this.$message({ this.$logs.oplogs(res, "serv_login", `修改密码`);
type: "success", this.$router.push("/login");
message: res.enote this.$message({
}); type: "success",
} else { message: res.enote,
this.$logs.oplogs(res, "serv_login", `修改密码${res.enote}`); });
this.$message({ } else {
type: "error", this.$logs.oplogs(res, "serv_login", `修改密码${res.enote}`);
message: res.enote this.$message({
}); type: "error",
} message: res.enote,
});
}).catch(err => { }
if (err.response) { })
this.$message({ .catch((err) => {
type: "error", if (err.response) {
message: err.response.data.enote this.$message({
}); type: "error",
} message: err.response.data.enote,
}); });
}
});
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
...@@ -133,12 +147,18 @@ export default { ...@@ -133,12 +147,18 @@ export default {
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
} },
} },
}; };
</script> </script>
<style> <style>
.passform-container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
.passform { .passform {
margin: 20px; margin: 20px;
width: 400px; width: 400px;
...@@ -146,10 +166,11 @@ export default { ...@@ -146,10 +166,11 @@ export default {
.passformitem { .passformitem {
margin-bottom: 20px; margin-bottom: 20px;
} }
.passform-box{ .passform-box {
width: 400px; width: 400px;
margin-top: 10%;
} }
.re-header{ .re-header {
margin-left: 60px; margin-left: 60px;
margin-top: 20px; margin-top: 20px;
} }
......
<template> <template>
<div class="contentBox"> <div class="contentBox">
<div class="content"> <div class="content">
<div style="padding:8px 20px;"> <div style="padding: 8px 20px">
<span style="float: right;"> <span style="float: right">
<el-button type="info" v-if="uname=='admin'" @click="addUser">添加新用户</el-button> <el-button type="info" v-if="uname == 'admin'" @click="addUser"
>添加新用户</el-button
>
</span> </span>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
<div style="padding: 0 15px 20px 23px;"> <div style="padding: 0 15px 20px 23px">
<el-table <el-table
:height="tableHeight" :height="tableHeight"
:data="tableData" :data="tableData"
...@@ -32,18 +34,23 @@ ...@@ -32,18 +34,23 @@
width="300" width="300"
label="创建时间" label="创建时间"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
{{$moment(scope.row.create_dt).local().add(8,'h').format("YYYY-MM-DD HH:mm:ss")}} {{
</div> $moment(scope.row.create_dt)
</template> .local()
.add(8, "h")
.format("YYYY-MM-DD HH:mm:ss")
}}
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
width="300" width="300"
prop="operation" prop="operation"
label="操作" label="操作"
v-if="uname=='admin'" v-if="uname == 'admin'"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip <el-tooltip
...@@ -57,11 +64,19 @@ ...@@ -57,11 +64,19 @@
@click="editUser(scope.$index, scope.row)" @click="editUser(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip content="重置密码" placement="bottom" effect="light" :visible-arrow=false > <el-tooltip
<span class="el-icon-refresh-right reseticon" @click="reset(scope.$index, scope.row)"></span> content="重置密码"
</el-tooltip> placement="bottom"
<span class="tableSpanBorder"></span> effect="light"
:visible-arrow="false"
>
<span
class="el-icon-refresh-right reseticon"
@click="reset(scope.$index, scope.row)"
></span>
</el-tooltip>
<span class="tableSpanBorder"></span>
<el-tooltip <el-tooltip
content="删除" content="删除"
placement="bottom" placement="bottom"
...@@ -69,19 +84,22 @@ ...@@ -69,19 +84,22 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="el-icon-delete delIcon" class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)" @click="delFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip <el-tooltip
:content="scope.row.lock==null||scope.row.lock?'解锁':'锁定'" :content="scope.row.lock ? '解锁' : '锁定'"
placement="bottom" placement="bottom"
effect="light" effect="light"
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
:class="{'el-icon-lock delIcon':scope.row.lock,'el-icon-unlock editIcon':scope.row.lock==null||scope.row.lock==false}" :class="{
'el-icon-lock delIcon': !scope.row.lock,
'el-icon-unlock editIcon': scope.row.lock,
}"
@click="clockuser(scope.$index, scope.row)" @click="clockuser(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -100,9 +118,9 @@ ...@@ -100,9 +118,9 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="margin-top: 28px;"> <div style="margin-top: 28px">
<el-pagination <el-pagination
style="float: right;" style="float: right"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
...@@ -114,7 +132,7 @@ ...@@ -114,7 +132,7 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -203,7 +221,7 @@ ...@@ -203,7 +221,7 @@
</div> </div>
</template> </template>
<script> <script>
let sha1 = require('js-sha1') let sha1 = require("js-sha1");
export default { export default {
data() { data() {
var checkRole = (rule, value, callback) => { var checkRole = (rule, value, callback) => {
...@@ -214,7 +232,7 @@ export default { ...@@ -214,7 +232,7 @@ export default {
} }
}; };
var checkUser = (rule, value, callback) => { var checkUser = (rule, value, callback) => {
var userReg = /^[a-zA-Z0-9]{5,32}/ var userReg = /^[a-zA-Z0-9]{5,32}/;
if (!userReg.test(value)) { if (!userReg.test(value)) {
callback(new Error("用户名长度为5到32个字符数字字母组合")); callback(new Error("用户名长度为5到32个字符数字字母组合"));
} else { } else {
...@@ -222,13 +240,19 @@ export default { ...@@ -222,13 +240,19 @@ export default {
} }
}; };
var validatePass = (rule, value, callback) => { var validatePass = (rule, value, callback) => {
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)) { if (!pwdRegex.test(value)) {
callback(new Error("您的密码复杂度太低(密码中必须包含大写和小写字母、数字、特殊字符长度大于8位),请及时修改密码!")) callback(
} else { new Error(
"您的密码复杂度太低(密码中必须包含大写和小写字母、数字、特殊字符长度大于8位),请及时修改密码!"
)
);
} else {
callback(); callback();
} }
callback(); callback();
}; };
var validatePass2 = (rule, value, callback) => { var validatePass2 = (rule, value, callback) => {
if (value === "") { if (value === "") {
...@@ -243,18 +267,18 @@ export default { ...@@ -243,18 +267,18 @@ export default {
total: 0, total: 0,
page: 1, page: 1,
pageSize: 30, pageSize: 30,
uname:'', uname: "",
addForm: { addForm: {
norm_type: "login", norm_type: "login",
role_unid: "", role_unid: "",
username: "", username: "",
password: "", password: "",
checkPass: "" checkPass: "",
}, },
editForm: { editForm: {
role_unid: "" role_unid: "",
}, },
isadmin:true, isadmin: true,
editRoleUnid: "", editRoleUnid: "",
editUnid: "", editUnid: "",
tableData: [], tableData: [],
...@@ -265,17 +289,17 @@ export default { ...@@ -265,17 +289,17 @@ export default {
role_unid: [{ validator: checkRole, trigger: "change" }], role_unid: [{ validator: checkRole, trigger: "change" }],
username: [{ validator: checkUser, trigger: "change" }], username: [{ validator: checkUser, trigger: "change" }],
password: [{ validator: validatePass, trigger: "change" }], password: [{ validator: validatePass, trigger: "change" }],
checkPass: [{ validator: validatePass2, trigger: "change" }] checkPass: [{ validator: validatePass2, trigger: "change" }],
}, },
tableHeight: window.opsTableHeight, tableHeight: window.opsTableHeight,
currow: "" currow: "",
}; };
}, },
components: {}, components: {},
mounted() { mounted() {
this.getTableList(); this.getTableList();
this.getRoleList(); this.getRoleList();
this.uname = localStorage.getItem('uname') this.uname = localStorage.getItem("uname");
}, },
methods: { methods: {
numFormatter(row, column, cellValue, index) { numFormatter(row, column, cellValue, index) {
...@@ -296,9 +320,9 @@ export default { ...@@ -296,9 +320,9 @@ export default {
this.$api.ops this.$api.ops
.getUserList({ .getUserList({
limit: this.pageSize, limit: this.pageSize,
offset: offset offset: offset,
}) })
.then(res => { .then((res) => {
this.total = res.total_num; this.total = res.total_num;
if (res.list_data == null) { if (res.list_data == null) {
...@@ -307,7 +331,7 @@ export default { ...@@ -307,7 +331,7 @@ export default {
this.tableData = res.list_data; this.tableData = res.list_data;
} }
}) })
.catch(error => {}); .catch((error) => {});
}, },
getRoleList() { getRoleList() {
this.roleList = []; this.roleList = [];
...@@ -315,36 +339,36 @@ export default { ...@@ -315,36 +339,36 @@ export default {
.getRoleList({ .getRoleList({
limit: 9999, limit: 9999,
offset: 0, offset: 0,
is_active: true is_active: true,
}) })
.then(res => { .then((res) => {
if (res.list_data == null) { if (res.list_data == null) {
this.roleList = []; this.roleList = [];
} else { } else {
this.roleList = res.list_data; this.roleList = res.list_data;
} }
}) })
.catch(error => {}); .catch((error) => {});
}, },
delFun(index, row) { delFun(index, row) {
this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", { this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(() => { .then(() => {
this.$api.ops.delUser({}, row.user_unid).then(res => { this.$api.ops.delUser({}, row.user_unid).then((res) => {
if (!res.ecode) { if (!res.ecode) {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.getTableList(); this.getTableList();
this.$logs.oplogs(res,'serv_auth',`删除用户${row.username}`); this.$logs.oplogs(res, "serv_auth", `删除用户${row.username}`);
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
message: "删除失败!" message: "删除失败!",
}); });
} }
}); });
...@@ -352,56 +376,68 @@ export default { ...@@ -352,56 +376,68 @@ export default {
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消删除" message: "已取消删除",
}); });
}); });
}, },
//注销用户 //注销用户
logoutuser(index,row){ logoutuser(index, row) {
localStorage.removeItem("menu"); localStorage.removeItem("menu");
localStorage.removeItem("curmenu"); localStorage.removeItem("curmenu");
let uid = localStorage.getItem("user_unid"); let uid = localStorage.getItem("user_unid");
this.$api.login.logout(row.user_unid).then((res) => { this.$api.login.logout(row.user_unid).then((res) => {
if(res.ecode == "200") { if (res.ecode == "200") {
this.$message({ this.$message({
type: "success", type: "success",
message: "注销成功!" message: "注销成功!",
}); });
this.$logs.oplogs("", "serv_auth", `注销用户${row.username}`); this.$logs.oplogs("", "serv_auth", `注销用户${row.username}`);
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
message: "注销失败!" message: "注销失败!",
}); });
this.$logs.oplogs("", "serv_auth", `注销用户${row.username}失败`); this.$logs.oplogs("", "serv_auth", `注销用户${row.username}失败`);
} }
// localStorage.removeItem("atoken"); // localStorage.removeItem("atoken");
}); });
}, },
clockuser(index, row){ clockuser(index, row) {
let text = row.lock?"此操作将解锁该用户":"此操作将锁定该用户" const { user_type } = row;
if (user_type === "user_1") {
this.$message({
type: "error",
message: "不支持锁定新用户!",
});
return;
}
let text = row.lock ? "此操作将解锁该用户" : "此操作将锁定该用户";
this.$confirm(text + ", 是否继续?", "提示", { this.$confirm(text + ", 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(() => { .then(() => {
let params = { let params = {
lock:row.lock==null?true:!row.lock, lock: row.lock == null ? true : !row.lock,
user_type:'user' user_type: "user",
} };
this.$api.ops.lockUser(row.user_unid, params).then(res => { this.$api.ops.lockUser(row.user_unid, params).then((res) => {
if (res.ecode == "200") { if (res.ecode == "200") {
this.$message({ this.$message({
type: "success", type: "success",
message: params.lock?"锁定成功!":"解锁成功!" message: params.lock ? "锁定成功!" : "解锁成功!",
}); });
this.getTableList(); this.getTableList();
this.$logs.oplogs(res,'serv_auth',`${params.lock?"锁定成功!":"解锁成功!"}${row.username}`); this.$logs.oplogs(
res,
"serv_auth",
`${params.lock ? "锁定成功!" : "解锁成功!"}${row.username}`
);
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
message: params.lock?"锁定失败!":"解锁失败!" message: params.lock ? "锁定失败!" : "解锁失败!",
}); });
} }
}); });
...@@ -409,7 +445,7 @@ export default { ...@@ -409,7 +445,7 @@ export default {
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消删除" message: "已取消删除",
}); });
}); });
}, },
...@@ -417,33 +453,32 @@ export default { ...@@ -417,33 +453,32 @@ export default {
this.$confirm("此操作将重置密码, 是否继续?", "提示", { this.$confirm("此操作将重置密码, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(() => { .then(() => {
this.$api.ops.adminresetPwd({}, row.user_unid).then((res) => {
this.$api.ops if (res.ecode == "200") {
.adminresetPwd({}, this.$message({
row.user_unid type: "success",
) message: "重置密码成功!",
.then(res => { });
if (res.ecode == '200') { this.$logs.oplogs(
this.$message({ res,
type: "success", "serv_auth",
message: "重置密码成功!" `重置用户${row.username}的密码`
}); );
this.$logs.oplogs(res,'serv_auth',`重置用户${row.username}的密码`); } else {
} else { this.$message({
this.$message({ type: "error",
type: "error", message: res.enote,
message: res.enote });
}); }
} });
});
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消" message: "已取消",
}); });
}); });
}, },
...@@ -454,7 +489,7 @@ export default { ...@@ -454,7 +489,7 @@ export default {
this.editVisible = true; this.editVisible = true;
}, },
openAddDialog() { openAddDialog() {
if(this.$refs["addForm"]){ if (this.$refs["addForm"]) {
this.$refs["addForm"].resetFields(); this.$refs["addForm"].resetFields();
} }
}, },
...@@ -462,81 +497,88 @@ export default { ...@@ -462,81 +497,88 @@ export default {
this.addVisible = true; this.addVisible = true;
}, },
addFun(formName) { addFun(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.$api.ops this.$api.ops
.addUser({ .addUser({
norm_type: this.addForm.norm_type, norm_type: this.addForm.norm_type,
username: this.addForm.username, username: this.addForm.username,
password: window.config.encrypt?sha1(this.addForm.password):this.baseencode(this.addForm.password), password: window.config.encrypt
? sha1(this.addForm.password)
: this.baseencode(this.addForm.password),
}) })
.then(res => { .then((res) => {
if (res.ecode == "200" || !res.ecode) { if (res.ecode == "200" || !res.ecode) {
this.$api.ops this.$api.ops
.bindRole( .bindRole(
{ {
role_unid: this.addForm.role_unid role_unid: this.addForm.role_unid,
}, },
res.enote.user_unid res.enote.user_unid
) )
.then(data => { .then((data) => {
if (!data.ecode) { if (!data.ecode) {
this.$message({ this.$message({
type: "success", type: "success",
message: "添加成功!" message: "添加成功!",
}); });
this.$logs.oplogs(res,'serv_auth',`添加了用户${this.addForm.username}`); this.$logs.oplogs(
res,
"serv_auth",
`添加了用户${this.addForm.username}`
);
this.addVisible = false; this.addVisible = false;
this.getTableList(); this.getTableList();
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
message: "添加失败!" message: "添加失败!",
}); });
} }
}); });
} else { } else {
debugger debugger;
this.$message({ this.$message({
type: "error", type: "error",
message: res.enote message: res.enote,
}); });
} }
}); });
} else { } else {
return false; return false;
} }
}); });
}, },
editFun(formName) { editFun(formName) {
this.$refs[formName].validate((valid) => {
this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
this.$api.ops this.$api.ops
.unbindRole({}, this.editUnid, this.editRoleUnid) .unbindRole({}, this.editUnid, this.editRoleUnid)
.then(res => { .then((res) => {
this.$api.ops this.$api.ops
.bindRole( .bindRole(
{ {
role_unid: this.editForm.role_unid role_unid: this.editForm.role_unid,
}, },
this.editUnid this.editUnid
) )
.then(res => { .then((res) => {
if (!res.ecode) { if (!res.ecode) {
this.$message({ this.$message({
type: "success", type: "success",
message: "修改成功!" message: "修改成功!",
}); });
this.editVisible = false; this.editVisible = false;
this.getTableList(); this.getTableList();
this.$logs.oplogs(res,'serv_auth',`修改了用户${this.editForm.username}`); this.$logs.oplogs(
res,
"serv_auth",
`修改了用户${this.editForm.username}`
);
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
message: "修改失败!" message: "修改失败!",
}); });
} }
}); });
...@@ -545,8 +587,8 @@ export default { ...@@ -545,8 +587,8 @@ export default {
return false; return false;
} }
}); });
} },
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -678,6 +720,6 @@ export default { ...@@ -678,6 +720,6 @@ export default {
font-size: 16px; font-size: 16px;
} }
.reseticon { .reseticon {
cursor: pointer; cursor: pointer;
} }
</style> </style>
<template> <template>
<div class="info-dialog" v-if="infoDialogShow"> <div class="info-dialog" v-if="infoDialogShow">
<iframe :src="iframeSrc" ref="infoIframe" frameborder="0" class="info-iframe"></iframe> <iframe
</div> :src="iframeSrc"
ref="infoIframe"
frameborder="0"
class="info-iframe"
></iframe>
</div>
</template> </template>
<script> <script>
import Vue from 'vue' import Vue from "vue";
export default { export default {
data () { data() {
return { return {
infoDialogShow: false, infoDialogShow: false,
iframeSrc: '', iframeSrc: "",
visiableTimer: null visiableTimer: null,
} };
}, },
methods: { methods: {
showInfo(info, isVisible, type) { showInfo(info, isVisible, type) {
this.infoDialogShow = true; this.infoDialogShow = true;
window.infoDialogVm = this; window.infoDialogVm = this;
if(arguments.length > 1) { if (arguments.length > 1) {
this.infoDialogShow = isVisible; this.infoDialogShow = isVisible;
switch (type) { switch (type) {
case 'info': case "info":
this.iframeSrc = 'static/infoDialog.html'; this.iframeSrc = "static/infoDialog.html";
break; break;
case 'picDetail': case "picDetail":
this.iframeSrc = 'static/picDetailDialog.html'; this.iframeSrc = "static/picDetailDialog.html";
break; break;
case 'paramSetting': case "paramSetting":
this.iframeSrc = 'static/paramSettingDialog.html'; this.iframeSrc = "static/paramSettingDialog.html";
break; break;
default: default:
break; break;
} }
} else if(arguments.length == 1) { } else if (arguments.length == 1) {
this.iframeSrc = 'static/infoDialog.html'; this.iframeSrc = "static/infoDialog.html";
} else { } else {
return; return;
}
if (this.infoDialogShow) {
let self = this;
if (self && !self._isDestroyed) {
self.visiableTimer = setTimeout(() => {
try {
this.$refs.infoIframe.contentWindow.globalVm = this;
} catch (error) {}
if (type == undefined) {
try {
if (this.$refs.infoIframe.contentWindow) {
this.$refs.infoIframe.contentWindow.changeText(info, this);
} }
if(this.infoDialogShow) { } catch (err) {
let self = this; this.infoDialogShow = false;
if(self && !self._isDestroyed) { eval("console.log('自定义弹窗changeText异常:', err.message)");
self.visiableTimer = setTimeout(() => { }
try { } else {
this.$refs.infoIframe.contentWindow.globalVm = this; try {
} catch (error) { } if (this.$refs.infoIframe.contentWindow) {
if(type == undefined) { this.$refs.infoIframe.contentWindow.filterType(info);
try {
if(this.$refs.infoIframe.contentWindow) {
this.$refs.infoIframe.contentWindow.changeText(info, this);
}
} catch (err) {
this.infoDialogShow = false;
eval("console.log('自定义弹窗changeText异常:', err.message)")
}
} else {
try {
if(this.$refs.infoIframe.contentWindow) {
this.$refs.infoIframe.contentWindow.filterType(info);
}
} catch (err) {
this.infoDialogShow = false;
eval("console.log('自定义弹窗filterType异常:', err.message)");
}
}
}, 500);
}
} }
}, } catch (err) {
hide() {
this.infoDialogShow = false; this.infoDialogShow = false;
window.clearTimeout(this.visiableTimer); eval("console.log('自定义弹窗filterType异常:', err.message)");
}
} }
}, 500);
} }
} }
},
hide() {
this.infoDialogShow = false;
window.clearTimeout(this.visiableTimer);
},
},
};
</script> </script>
<style scoped> <style scoped>
.info-dialog { .info-dialog {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
z-index: 99990; z-index: 99990;
} }
.info-iframe { .info-iframe {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
/* z-index: 99990; */ /* z-index: 99990; */
} }
</style> </style>
...@@ -9,115 +9,125 @@ ...@@ -9,115 +9,125 @@
<template> <template>
<div class="config-box"> <div class="config-box">
<div class="switch-box"> <div class="switch-box">
<el-radio v-model="radio" label="defaultConfig">正常配置</el-radio> <el-radio v-model="radio" label="defaultConfigTemplate"
<el-radio v-model="radio" label="illegalStopDefaultConfig">违停配置</el-radio> >正常配置</el-radio
>
<el-radio v-model="radio" label="illegalStopDefaultConfigTemplate"
>违停配置</el-radio
>
</div> </div>
<el-row> <el-row>
<el-col :span="3" class="search-box"> <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 <el-button
slot="append" slot="append"
icon="el-icon-search" icon="el-icon-search"
@click="$refs.iframeconfig.contentWindow.clickButton(paramsval)" @click="$refs.iframeconfig.contentWindow.clickButton(paramsval)"
></el-button> ></el-button>
</el-input> </el-input>
</el-col>
</el-row>
<el-row>
<el-col :span="20" class="content-box">
<iframe
id="iframeconfig"
ref="iframeconfig"
src="./dynamicParameters.html"
frameborder="0"
width="100%"
height="600"
scrolling="no"
></iframe>
</el-col>
<el-col :span="1" :offset="19">
<el-button type="primary" @click="saveConfig" class="save-btn">保存</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="20" class="content-box">
<iframe
id="iframeconfig"
ref="iframeconfig"
src="./dynamicParameters.html"
frameborder="0"
width="100%"
height="600"
scrolling="no"
></iframe>
</el-col>
<el-col :span="1" :offset="19">
<el-button type="primary" @click="saveConfig" class="save-btn"
>保存</el-button
>
</el-col>
</el-row>
</div> </div>
</template> </template>
<script> <script>
import xml from './baseConfig.js' import xml from "./baseConfig.js";
export default { export default {
data() { data() {
return { return {
paramsval:'', paramsval: "",
radio: 'defaultConfig', radio: "defaultConfigTemplate",
config:'', config: "",
configid:'' configid: "",
} };
}, },
watch:{ watch: {
radio(val){ radio(val) {
this.getbaseConf(val) this.getbaseConf(val);
} },
}, },
methods:{ methods: {
xmlInit: function(obj) { xmlInit: function (obj) {
this.$refs.iframeconfig.contentWindow.loadParameterTree( this.$refs.iframeconfig.contentWindow.loadParameterTree(
obj.content, obj.content,
'<?xml version="1.0" encoding="GBK"?><root></root>' '<?xml version="1.0" encoding="GBK"?><root></root>'
); );
}, },
getbaseConf(type){ getbaseConf(type) {
this.$api.device.getConfig(type).then(res => { this.$api.device.getConfig(type).then((res) => {
this.config = res.data.content this.config = res.data.content;
this.configid = res.data.id this.configid = res.data.id;
this.xmlInit(res.data) this.xmlInit(res.data);
}) });
}, },
saveConfig(){ saveConfig() {
this.$refs.iframeconfig.contentWindow.submit(); this.$refs.iframeconfig.contentWindow.submit();
//ifram 传递回来的饿xml //ifram 传递回来的饿xml
let XMLStr = this.$refs.iframeconfig.contentWindow.xmlStr; let XMLStr = this.$refs.iframeconfig.contentWindow.xmlStr;
if(!XMLStr) { if (!XMLStr) {
XMLStr = this.config XMLStr = this.config;
} }
this.$api.device.saveConfig(this.configid,{content:XMLStr}).then(res => { this.$api.device
if(res.ecode == 200) { .saveConfig(this.configid, { content: XMLStr })
this.$message({ .then((res) => {
type: "success", if (res.ecode == 200) {
message: '保存成功!' this.$message({
}); type: "success",
} else { message: "保存成功!",
this.$message({ });
type: "error", } else {
message: '保存失败!' this.$message({
}); type: "error",
} message: "保存失败!",
}) });
}
});
}, },
}, },
mounted(){ mounted() {
setTimeout(() => { setTimeout(() => {
this.getbaseConf('defaultConfig') this.getbaseConf("defaultConfig");
}, 2000); }, 2000);
} },
} };
</script> </script>
<style> <style>
.config-box{ .config-box {
margin:10px; margin: 10px;
background: #fff; background: #fff;
overflow: hidden; overflow: hidden;
} }
.switch-box{ .switch-box {
margin:10px 0 0 10px margin: 10px 0 0 10px;
} }
.search-box,.content-box{ .search-box,
margin:10px; .content-box {
margin: 10px;
} }
.save-btn{ .save-btn {
float: right; float: right;
margin-bottom: 20px; margin-bottom: 20px;
} }
......
<template> <template>
<div class="contentBox"> <div class="contentBox">
<div class="content"> <div class="content">
<div style="padding:8px 20px;"> <div style="padding: 8px 20px">
<span class="inputBox"> <span class="inputBox">
<el-input <el-input
v-model="storename" v-model="storename"
...@@ -10,17 +10,17 @@ ...@@ -10,17 +10,17 @@
</span> </span>
<el-button <el-button
type="primary" type="primary"
style="position: relative;top: -2px;" style="position: relative; top: -2px"
@click="query" @click="query"
>查询</el-button >查询</el-button
> >
<span style="float: right;"> <span style="float: right">
<el-button type="info" icon="el-icon-search" @click="add" <el-button type="info" icon="el-icon-search" @click="add"
>添加</el-button >添加</el-button
> >
</span> </span>
</div> </div>
<div style="padding: 0 15px 20px 23px;"> <div style="padding: 0 15px 20px 23px">
<el-table <el-table
:height="tableHeight" :height="tableHeight"
:data="tableData" :data="tableData"
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
> >
<el-table-column align="center" prop="name" label="名称"> <el-table-column align="center" prop="name" label="名称">
</el-table-column> </el-table-column>
<el-table-column align="center" label="上传时间"> <el-table-column align="center" label="上传时间">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
{{showLocalTime(scope.row.create_dt,'local')}} {{ showLocalTime(scope.row.create_dt, "local") }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -75,11 +75,11 @@ ...@@ -75,11 +75,11 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="el-icon-delete delIcon" class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)" @click="delFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip <el-tooltip
content="导出" content="导出"
placement="bottom" placement="bottom"
...@@ -87,16 +87,16 @@ ...@@ -87,16 +87,16 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="el-icon-upload editIcon" class="el-icon-upload editIcon"
@click="exportFun(scope.$index, scope.row)" @click="exportFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="margin-top: 28px;"> <div style="margin-top: 28px">
<el-pagination <el-pagination
style="float: right;" style="float: right"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -125,15 +125,17 @@ ...@@ -125,15 +125,17 @@
action="uploadUrl" action="uploadUrl"
:http-request="httpRequest" :http-request="httpRequest"
:on-success="uploadsuccess" :on-success="uploadsuccess"
:before-upload="beforeUpload"
multiple multiple
name="file" name="file"
:auto-upload="false" :auto-upload="true"
> >
<el-button slot="trigger" size="small" type="primary" <el-button slot="trigger" size="small" type="primary"
>选取文件</el-button >选取文件</el-button
> >
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> --> <!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> -->
</el-upload> </el-upload>
<div>提示:上传文件仅支持xml格式!</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -162,7 +164,7 @@ export default { ...@@ -162,7 +164,7 @@ export default {
props: { props: {
label: "name", label: "name",
children: "child", children: "child",
isLeaf: "leaf" isLeaf: "leaf",
}, },
detailData: [], detailData: [],
dev_unid: localStorage.getItem("dev_unid"), dev_unid: localStorage.getItem("dev_unid"),
...@@ -170,7 +172,7 @@ export default { ...@@ -170,7 +172,7 @@ export default {
picture_busy: 0, picture_busy: 0,
picture_free: 0, picture_free: 0,
video_busy: 0, video_busy: 0,
video_free: 0 video_free: 0,
}, },
total: 0, total: 0,
page: 1, page: 1,
...@@ -181,7 +183,7 @@ export default { ...@@ -181,7 +183,7 @@ export default {
detailVisible: false, detailVisible: false,
storename: "", storename: "",
curentSubList: [], curentSubList: [],
tableHeight: window.opsTableHeight tableHeight: window.opsTableHeight,
}; };
}, },
components: {}, components: {},
...@@ -189,6 +191,13 @@ export default { ...@@ -189,6 +191,13 @@ export default {
this.query(); this.query();
}, },
methods: { methods: {
beforeUpload(file) {
let isXML = file.type == "text/xml";
if (!isXML) {
this.$message.error("上传文件只能是 XML 格式!");
}
return isXML;
},
// 自定义的上传函数 // 自定义的上传函数
httpRequest(param) { httpRequest(param) {
this.file = []; this.file = [];
...@@ -196,27 +205,27 @@ export default { ...@@ -196,27 +205,27 @@ export default {
this.file.push(param.file); this.file.push(param.file);
}, },
save() { save() {
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件 // this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
// 最重要的就是这段代码 // 最重要的就是这段代码
var upData = new FormData(); // 首先创建FormData对象 var upData = new FormData(); // 首先创建FormData对象
this.file.forEach(file => { this.file.forEach((file) => {
upData.append("file", file); // 因为要上传多个文件,所以需要遍历一下才行 upData.append("file", file); // 因为要上传多个文件,所以需要遍历一下才行
upData.append("name", this.names); upData.append("name", this.names);
upData.append("is_temp", 0); upData.append("is_temp", 0);
}); });
this.$api.resource.uploadStore(upData).then(res => { this.$api.resource.uploadStore(upData).then((res) => {
if (res.unid) { if (res.unid) {
this.addVisible = false; this.addVisible = false;
this.query(); this.query();
this.$logs.oplogs(res,'serv_store',`上传配置:${ this.names}`); this.$logs.oplogs(res, "serv_store", `上传配置:${this.names}`);
this.$message({ this.$message({
type: "success", type: "success",
message: "上传成功!" message: "上传成功!",
}); });
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
message: res.enote message: res.enote,
}); });
} }
}); });
...@@ -230,11 +239,11 @@ export default { ...@@ -230,11 +239,11 @@ export default {
} }
if (node.level > 1) return resolve([]); 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) { if (res.list_data == null) {
res.list_data = []; res.list_data = [];
} }
res.list_data.forEach(item => { res.list_data.forEach((item) => {
item.name = item.subtask_name; item.name = item.subtask_name;
item["leaf"] = true; item["leaf"] = true;
}); });
...@@ -249,20 +258,20 @@ export default { ...@@ -249,20 +258,20 @@ export default {
{ {
limit: this.pageSize, limit: this.pageSize,
offset: offset, offset: offset,
name__like: this.storename name__like: this.storename,
}, },
this.dev_unid this.dev_unid
) )
.then(res => { .then((res) => {
this.total = res.total_num; this.total = res.total_num;
if (res.list_data == null) { if (res.list_data == null) {
this.tableData = []; this.tableData = [];
} else { } else {
this.tableData = res.list_data; this.tableData = res.list_data;
} }
this.tableData.forEach(list => { this.tableData.forEach((list) => {
let ellipsisText = ""; let ellipsisText = "";
list.task_list.forEach(item => { list.task_list.forEach((item) => {
ellipsisText += item.name + ","; ellipsisText += item.name + ",";
}); });
ellipsisText = ellipsisText.substring(0, ellipsisText.length - 1); ellipsisText = ellipsisText.substring(0, ellipsisText.length - 1);
...@@ -272,14 +281,14 @@ export default { ...@@ -272,14 +281,14 @@ export default {
}); });
console.log(this.tableData); console.log(this.tableData);
}) })
.catch(error => {}); .catch((error) => {});
}, },
add() { add() {
this.addVisible = true; this.addVisible = true;
}, },
taskFormatter(row, column, cellValue, index) { taskFormatter(row, column, cellValue, index) {
let columnText = ""; let columnText = "";
row.task_list.forEach(item => { row.task_list.forEach((item) => {
columnText += item.name + ","; columnText += item.name + ",";
}); });
columnText = columnText.substring(0, columnText.length - 1); columnText = columnText.substring(0, columnText.length - 1);
...@@ -302,16 +311,16 @@ export default { ...@@ -302,16 +311,16 @@ export default {
this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", { this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(() => { .then(() => {
this.$api.resource.delStore({}, row.unid).then(res => { this.$api.resource.delStore({}, row.unid).then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_store',`删除配置:${ row.name}`); this.$logs.oplogs(res, "serv_store", `删除配置:${row.name}`);
this.query(); this.query();
} }
}); });
...@@ -319,15 +328,15 @@ export default { ...@@ -319,15 +328,15 @@ export default {
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消删除" message: "已取消删除",
}); });
}); });
}, },
exportFun(index, row){ exportFun(index, row) {
let url = location.origin; 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -11,13 +11,20 @@ ...@@ -11,13 +11,20 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
> >
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span> <span>
<span class="tree-label">{{ <span class="tree-label">{{ data.label }}</span>
data.label
}}</span>
</span> </span>
<span class="tree-btn" v-if="node.label=='平台同步资源'"> <span class="tree-btn" v-if="node.label == '平台同步资源'">
<i :class="{'el-icon-refresh':true,'animterefresh':refreshload}" @click.stop="nodeRefreshClick(node, data)"></i> <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>
</span> </span>
</el-tree> </el-tree>
...@@ -30,31 +37,39 @@ export default { ...@@ -30,31 +37,39 @@ export default {
data() { data() {
return { return {
isLoadingTree: false, isLoadingTree: false,
refreshload:false, refreshload: false,
cloudRefreshload: false,
syncTreeData: [ syncTreeData: [
{ {
id: "0", id: "0",
unid: "0", unid: "0",
label: "平台同步资源", label: "平台同步资源",
root: "平台同步资源", root: "平台同步资源",
children: [] children: [],
} },
{
id: "-1",
unid: "-1",
label: "视频云平台同步资源",
root: "视频云平台同步资源",
children: [],
},
], ],
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "label" label: "label",
} },
}; };
}, },
props: { props: {
filterText: { filterText: {
type: String, type: String,
default: "" default: "",
}, },
treeDatas: { treeDatas: {
type: Array, type: Array,
defalut: [] defalut: [],
} },
}, },
components: {}, components: {},
watch: { watch: {
...@@ -66,7 +81,7 @@ export default { ...@@ -66,7 +81,7 @@ export default {
}, },
treeDatas(val) { treeDatas(val) {
this.treeData[0].childs = val; this.treeData[0].childs = val;
} },
}, },
methods: { methods: {
initTree(data) { initTree(data) {
...@@ -74,15 +89,20 @@ export default { ...@@ -74,15 +89,20 @@ export default {
this.refreshload = false; this.refreshload = false;
this.isLoadingTree = true; this.isLoadingTree = true;
}, },
initCloudTree(data) {
this.syncTreeData[1].children = data;
this.cloudRefreshload = false;
this.isLoadingTree = true;
},
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
handleNodeClick(data) { handleNodeClick(data) {
debugger debugger;
if (data.label !== "平台同步资源" && data.is_leaf) { if (data.label !== "平台同步资源" && data.is_leaf) {
this.$emit("syncTable", data); this.$emit("syncTable", data);
}; }
}, },
handleRefresh(s, d, n) { handleRefresh(s, d, n) {
// console.log(s, d, n) // console.log(s, d, n)
...@@ -92,16 +112,26 @@ export default { ...@@ -92,16 +112,26 @@ export default {
id: "1", id: "1",
label: "平台同步资源", label: "平台同步资源",
root: "平台同步资源", root: "平台同步资源",
children: [] children: [],
} },
{
id: "2",
label: "视频云平台同步资源",
root: "视频云平台同步资源",
children: [],
},
]; ];
this.$parent.getSyncTree(); this.$parent.getSyncTree();
}, },
nodeRefreshClick(){ nodeRefreshClick() {
this.refreshload = true; this.refreshload = true;
this.$emit('refreshData') this.$emit("refreshData");
} },
} cloudNodeRefreshClick() {
this.cloudRefreshload = true;
this.$emit("cloudRefreshData");
},
},
}; };
</script> </script>
...@@ -110,14 +140,30 @@ export default { ...@@ -110,14 +140,30 @@ export default {
/* max-height: 216px; */ /* max-height: 216px; */
/* overflow: hidden; */ /* 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{ </style>
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 \ No newline at end of file
...@@ -9,7 +9,14 @@ ...@@ -9,7 +9,14 @@
v-model="searchText" v-model="searchText"
> >
</el-input> </el-input>
<SyncTree ref="syncRef" :filterText="searchText" :treeDatas="syncTree" @syncTable="syncTable" @refreshData="refreshData"> <SyncTree
ref="syncRef"
:filterText="searchText"
:treeDatas="syncTree"
@syncTable="syncTable"
@refreshData="refreshData"
@cloudRefreshData="cloudRefreshData"
>
</SyncTree> </SyncTree>
<cameraTree <cameraTree
:filterText="searchText" :filterText="searchText"
...@@ -61,7 +68,7 @@ ...@@ -61,7 +68,7 @@
> >
<span <span
class="el-icon-delete delIcon" class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row,formattterData)" @click="delFun(scope.$index, scope.row, formattterData)"
></span> ></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
...@@ -166,7 +173,7 @@ ...@@ -166,7 +173,7 @@
<el-form-item <el-form-item
label="名称" label="名称"
:rules="[ :rules="[
{ required: true, message: '请输入名称', trigger: 'change' } { required: true, message: '请输入名称', trigger: 'change' },
]" ]"
> >
<el-input v-model="videoEditParam.vchan_name"></el-input> <el-input v-model="videoEditParam.vchan_name"></el-input>
...@@ -219,11 +226,11 @@ export default { ...@@ -219,11 +226,11 @@ export default {
vchan_name: "", vchan_name: "",
video_url: "", video_url: "",
longitude: "", longitude: "",
latitude: "" latitude: "",
}, },
videoEditVisible: false, videoEditVisible: false,
vchan_duid: "", vchan_duid: "",
tableHeight: window.videoEquitTableHeight tableHeight: window.videoEquitTableHeight,
}; };
}, },
watch: {}, watch: {},
...@@ -232,19 +239,20 @@ export default { ...@@ -232,19 +239,20 @@ export default {
cameraDialog, cameraDialog,
videoTree, videoTree,
SyncTree, SyncTree,
syncDialog syncDialog,
}, },
mounted() { mounted() {
this.getCameraTree(); this.getCameraTree();
this.getVideoTree(); this.getVideoTree();
this.getSyncTree(); this.getSyncTree();
this.getCloudSyncTree();
}, },
methods: { methods: {
syncdetail(index, data) { syncdetail(index, data) {
this.$refs.syncdetail.initDialog(data); this.$refs.syncdetail.initDialog(data);
}, },
setCamerInfo(){ setCamerInfo() {
debugger debugger;
this.getCameraTree(); this.getCameraTree();
}, },
getCameraTree() { getCameraTree() {
...@@ -252,11 +260,11 @@ export default { ...@@ -252,11 +260,11 @@ export default {
this.$api.resource this.$api.resource
.treeList( .treeList(
{ {
vchan_type: "camera" vchan_type: "camera",
}, },
this.dev_unid this.dev_unid
) )
.then(res => { .then((res) => {
this.cameraArr = []; this.cameraArr = [];
if (res.vchan_struct.length) { if (res.vchan_struct.length) {
this.cameraTreeData = this.cameraBuildTree(res.vchan_struct); this.cameraTreeData = this.cameraBuildTree(res.vchan_struct);
...@@ -268,19 +276,20 @@ export default { ...@@ -268,19 +276,20 @@ export default {
this.$api.resource this.$api.resource
.getVideoList( .getVideoList(
{ {
vchan_type: "vfile" vchan_type: "vfile",
}, },
this.dev_unid this.dev_unid
) )
.then(res => { .then((res) => {
this.videoTree = res.list_data; this.videoTree = res.list_data;
// this.getTable(this.videoTree, "video"); // this.getTable(this.videoTree, "video");
}); });
}, },
getSyncTree() { getSyncTree() {
this.tableType = "sync"; this.tableType = "sync";
this.$api.device.getcatadev() this.$api.device
.then(m => { .getcatadev()
.then((m) => {
if (m.ecode == 200) { if (m.ecode == 200) {
var sync_data = this.syncBuildTree(m.result.childs); var sync_data = this.syncBuildTree(m.result.childs);
this.$refs.syncRef.initTree(sync_data); this.$refs.syncRef.initTree(sync_data);
...@@ -289,7 +298,7 @@ export default { ...@@ -289,7 +298,7 @@ export default {
this.$refs.syncRef.initTree(emptyChild); this.$refs.syncRef.initTree(emptyChild);
} }
}) })
.catch(err => { .catch((err) => {
console.log(err.message); console.log(err.message);
let emptyData = []; let emptyData = [];
// this.$message({ // this.$message({
...@@ -298,16 +307,38 @@ export default { ...@@ -298,16 +307,38 @@ export default {
// }) // })
}); });
}, },
getCloudSyncTree() {
this.tableType = "sync";
this.$api.device.getCloudDev().then((res) => {
if(res.ecode === 200) {
this.dealCloudTree(res.data);
this.$refs.syncRef.initCloudTree(res.data);
}else {
this.$refs.syncRef.initCloudTree([]);
}
});
},
dealCloudTree(list) {
list.forEach(d => {
d.label = d.orgName || d.name;
d.id = d.addressUnid || d.vchan_duid;
d.vchan_type = "cloud";
if (d.child && d.child.length > 0) {
d.children = d.child;
this.dealCloudTree(d.child);
}
});
},
submitLaterGet(data) { submitLaterGet(data) {
this.tableType = "camera"; this.tableType = "camera";
this.$api.resource this.$api.resource
.treeList( .treeList(
{ {
vchan_type: "camera" vchan_type: "camera",
}, },
this.dev_unid this.dev_unid
) )
.then(res => { .then((res) => {
this.cameraTree = res.vchan_struct; this.cameraTree = res.vchan_struct;
this.cameraArr = []; this.cameraArr = [];
this.cameraTreeData = this.cameraBuildTree(res.vchan_struct); this.cameraTreeData = this.cameraBuildTree(res.vchan_struct);
...@@ -335,26 +366,27 @@ export default { ...@@ -335,26 +366,27 @@ export default {
} }
return newData; return newData;
}, },
//重新拉取28181树形结构 //重新拉取28181树形结构
refreshData(){ refreshData() {
this.$api.device.postcatadev() this.$api.device
.then(m => { .postcatadev()
.then((m) => {
if (m.ecode == 200) { if (m.ecode == 200) {
this.$message({ this.$message({
type: 'success', type: "success",
message: m.enote message: m.enote,
}) });
this.getSyncTree() this.getSyncTree();
} else { } else {
let emptyChild = []; let emptyChild = [];
this.$refs.syncRef.initTree(emptyChild); this.$refs.syncRef.initTree(emptyChild);
this.$message({ this.$message({
type: 'error', type: "error",
message: data message: data,
}) });
} }
}) })
.catch(err => { .catch((err) => {
console.log(err.message); console.log(err.message);
let emptyData = []; let emptyData = [];
// this.$message({ // this.$message({
...@@ -363,6 +395,18 @@ export default { ...@@ -363,6 +395,18 @@ export default {
// }) // })
}); });
}, },
//拉取视频云平台设备
cloudRefreshData() {
this.$api.device.refreshCloudDev().then(res => {
if (res.ecode === 200) {
this.getCloudSyncTree();
this.$message({
type: "success",
message: res.enote
});
}
});
},
//处理树状图数据 //处理树状图数据
cameraBuildTree(data, orgObject, addrObject) { cameraBuildTree(data, orgObject, addrObject) {
// 获取相机资源 // 获取相机资源
...@@ -425,44 +469,48 @@ export default { ...@@ -425,44 +469,48 @@ export default {
editFun(index, row) { editFun(index, row) {
this.$refs.editCamera.initDialog(row, "edit", this.dev_unid); this.$refs.editCamera.initDialog(row, "edit", this.dev_unid);
}, },
delFun(index, row,rows) { delFun(index, row, rows) {
this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", { this.$confirm("此操作将永久删除该选项, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(() => { .then(() => {
this.$api.resource.delCamera({}, this.dev_unid, row.id).then(res => { this.$api.resource
.delCamera({}, this.dev_unid, row.id)
.then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
debugger
rows.splice(index, 1); rows.splice(index, 1);
let data = { let data = {
org_type: "address", org_type: "address",
unid: row.addrNode.unid unid: row.addrNode.unid,
}; };
console.log(row) console.log(row);
if(row.addrNode && row.addrNode.childs) { if (row.addrNode && row.addrNode.childs) {
let childrenarr = row.addrNode.childs; let childrenarr = row.addrNode.childs;
childrenarr.map(ele => { childrenarr.map((ele) => {
if(ele.vchan_refid == row.id) { if (ele.vchan_refid == row.id) {
this.$refs.cameratree.delTreenode(ele) this.$refs.cameratree.delTreenode(ele);
} }
}) });
} }
// this.submitLaterGet(data); // this.submitLaterGet(data);
this.$logs.oplogs(res,'serv_vchan',`删除实时视频,视频名称:${row.label}`); this.$logs.oplogs(
res,
"serv_vchan",
`删除实时视频,视频名称:${row.label}`
);
} }
}); });
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消删除" message: "已取消删除",
}); });
}); });
}, },
...@@ -472,16 +520,16 @@ export default { ...@@ -472,16 +520,16 @@ export default {
getTable(data, type) { getTable(data, type) {
if (data.org_type != "root") { if (data.org_type != "root") {
this.tableType = type; this.tableType = type;
debugger debugger;
if (this.tableType == "camera") { if (this.tableType == "camera") {
if (data.type || data.org_type) { if (data.type || data.org_type) {
this.tableType = type; this.tableType = type;
this.formattterData = []; this.formattterData = [];
let filterData = []; let filterData = [];
debugger debugger;
let search_params = { let search_params = {
vchan_type: "camera", vchan_type: "camera",
org_unid: data.unid org_unid: data.unid,
}; };
if (data.vtype) { if (data.vtype) {
this.formattterData.push(data); this.formattterData.push(data);
...@@ -489,10 +537,10 @@ export default { ...@@ -489,10 +537,10 @@ export default {
} }
this.$api.resource this.$api.resource
.getCameraTable(search_params, this.dev_unid) .getCameraTable(search_params, this.dev_unid)
.then(res => { .then((res) => {
if (res.list_data.length > 0) { if (res.list_data.length > 0) {
for (var i = 0; i < res.list_data.length; i++) { for (var i = 0; i < res.list_data.length; i++) {
filterData = this.cameraArr.filter(list => { filterData = this.cameraArr.filter((list) => {
return list.id === res.list_data[i].vchan_refid; return list.id === res.list_data[i].vchan_refid;
}); });
if (filterData.length > 0) { if (filterData.length > 0) {
...@@ -501,21 +549,21 @@ export default { ...@@ -501,21 +549,21 @@ export default {
} }
} }
}) })
.catch(err => {}); .catch((err) => {});
} else { } else {
this.formattterData = []; this.formattterData = [];
let filterData = []; let filterData = [];
this.$api.resource this.$api.resource
.getCameraTable({}, this.dev_unid, data.vchan_refid) .getCameraTable({}, this.dev_unid, data.vchan_refid)
.then(res => { .then((res) => {
filterData = this.cameraArr.filter(list => { filterData = this.cameraArr.filter((list) => {
return list.id === res.refid; return list.id === res.refid;
}); });
if (filterData.length > 0) { if (filterData.length > 0) {
this.formattterData.push(filterData[0]); this.formattterData.push(filterData[0]);
} }
}) })
.catch(err => {}); .catch((err) => {});
} }
} else if (this.tableType == "video") { } else if (this.tableType == "video") {
if (data.org_type == "video") { if (data.org_type == "video") {
...@@ -541,7 +589,7 @@ export default { ...@@ -541,7 +589,7 @@ export default {
} }
}, },
editVideo(index, row) { editVideo(index, row) {
console.log("视频信息",row) console.log("视频信息", row);
this.vchan_duid = row.vchan_duid; this.vchan_duid = row.vchan_duid;
this.videoEditParam.vchan_name = row.vchan_name; this.videoEditParam.vchan_name = row.vchan_name;
this.videoEditParam.video_url = row.video_url; this.videoEditParam.video_url = row.video_url;
...@@ -555,25 +603,29 @@ export default { ...@@ -555,25 +603,29 @@ export default {
{ {
name: this.videoEditParam.vchan_name, name: this.videoEditParam.vchan_name,
longitude: this.videoEditParam.longitude, longitude: this.videoEditParam.longitude,
latitude: this.videoEditParam.latitude latitude: this.videoEditParam.latitude,
}, },
this.dev_unid, this.dev_unid,
this.vchan_duid this.vchan_duid
) )
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.$message({ this.$message({
type: "success", type: "success",
message: res.enote message: res.enote,
}); });
this.getVideoTree(); this.getVideoTree();
this.formattterData.forEach(item => { this.formattterData.forEach((item) => {
if (item.vchan_duid == this.vchan_duid) { if (item.vchan_duid == this.vchan_duid) {
item.vchan_name = this.videoEditParam.vchan_name; item.vchan_name = this.videoEditParam.vchan_name;
} }
}); });
this.$logs.oplogs(res,'serv_vchan',`修改离线视频,视频名称:${ this.videoEditParam.vchan_name}`); this.$logs.oplogs(
res,
"serv_vchan",
`修改离线视频,视频名称:${this.videoEditParam.vchan_name}`
);
} else { } else {
this.$message.error(res.enote); this.$message.error(res.enote);
} }
...@@ -584,16 +636,16 @@ export default { ...@@ -584,16 +636,16 @@ export default {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", { this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(() => { .then(() => {
this.$api.resource this.$api.resource
.delVideo({}, this.dev_unid, row.vchan_duid) .delVideo({}, this.dev_unid, row.vchan_duid)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.$message({ this.$message({
type: "success", type: "success",
message: res.enote message: res.enote,
}); });
this.getVideoTree(); this.getVideoTree();
...@@ -603,7 +655,11 @@ export default { ...@@ -603,7 +655,11 @@ export default {
// item.vchan_name=this.videoEditParam.vchan_name // item.vchan_name=this.videoEditParam.vchan_name
// } // }
// }) // })
this.$logs.oplogs(res,'serv_vchan',`删除离线视频,视频名称${ row.vchan_name}`); this.$logs.oplogs(
res,
"serv_vchan",
`删除离线视频,视频名称${row.vchan_name}`
);
} else { } else {
this.$message.error(res.enote); this.$message.error(res.enote);
} }
...@@ -612,11 +668,11 @@ export default { ...@@ -612,11 +668,11 @@ export default {
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: "info",
message: "已取消删除" message: "已取消删除",
}); });
}); });
} },
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -624,4 +680,4 @@ export default { ...@@ -624,4 +680,4 @@ export default {
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
padding: 12px; padding: 12px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<el-col :span="24"> <el-col :span="24">
<div class="pic-wrap"> <div class="pic-wrap">
<el-image <el-image
style="width: 100%;" style="width: 100%"
:src="curPicData.bigpic" :src="curPicData.bigpic"
:preview-src-list="srcList" :preview-src-list="srcList"
> >
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<img <img
:src="curPicData.bigpic" :src="curPicData.bigpic"
alt="" alt=""
style="width: 30%;display: block;margin: 0 auto;" style="width: 30%; display: block; margin: 0 auto"
/> />
</div> </div>
</el-image> </el-image>
...@@ -52,32 +52,26 @@ ...@@ -52,32 +52,26 @@
:span="24" :span="24"
v-if=" v-if="
curPicData.event_type === 'vehicle' || curPicData.event_type === 'vehicle' ||
curPicData.event_type === 'xcycle' || curPicData.event_type === 'xcycle' ||
curPicData.event_type === 'pedestrian' curPicData.event_type === 'pedestrian'
" "
> >
<ul class="pic-info"> <ul class="pic-info">
<li <div v-if="curPicData.event_type === 'vehicle'">
v-if="curPicData.event_type === 'vehicle'" <li :title="curPicData.vehicle_body_type_text">
:title="curPicData.vehicle_body_type_text" <span>车辆类型:</span>
> <span>{{ curPicData.vehicle_body_type_text }}</span>
<span>车辆类型:</span> </li>
<span>{{ curPicData.vehicle_body_type_text }}</span> <li :title="curPicData.vehicle_plate_text">
</li> <span>车牌号码:</span>
<li <span>{{ curPicData.vehicle_plate_text }}</span>
v-if="curPicData.event_type === 'vehicle'" </li>
:title="curPicData.vehicle_plate_text" <li :title="curPicData.plate_type_text">
> <span>车牌类型:</span>
<span>车牌号码:</span> <span>{{ curPicData.plate_type_text }}</span>
<span>{{ curPicData.vehicle_plate_text }}</span> </li>
</li> </div>
<li
v-if="curPicData.event_type === 'vehicle'"
:title="curPicData.plate_type_text"
>
<span>车牌类型:</span>
<span>{{ curPicData.plate_type_text }}</span>
</li>
<li :title="curPicData.shoot_date"> <li :title="curPicData.shoot_date">
<span>经过日期:</span> <span>经过日期:</span>
<span>{{ curPicData.shoot_date }}</span> <span>{{ curPicData.shoot_date }}</span>
...@@ -90,138 +84,92 @@ ...@@ -90,138 +84,92 @@
<span>经过地点:</span> <span>经过地点:</span>
<span>{{ curPicData.location_name }}</span> <span>{{ curPicData.location_name }}</span>
</li> </li>
<li
v-if="curPicData.event_type === 'vehicle'" <div v-if="curPicData.event_type === 'vehicle'">
:title="curPicData.vehicle_body_logo_text" <li :title="curPicData.vehicle_body_logo_text">
> <span>车辆品牌:</span>
<span>车辆品牌:</span> <span>{{ curPicData.vehicle_body_logo_text }}</span>
<span>{{ curPicData.vehicle_body_logo_text }}</span> </li>
</li> <!-- 机动车 -->
<!-- <li :title="curPicData.vehicle_body_type_text"> <li :title="curPicData.plate_color_text">
<span>车辆类型:</span> <span>车牌颜色:</span>
<span>{{ curPicData.vehicle_body_type_text }}</span> <span>{{ curPicData.plate_color_text }}</span>
</li> --> </li>
<!-- 机动车 --> <li :title="curPicData.vehicle_body_color_text">
<li <span>车身颜色:</span>
v-if="curPicData.event_type === 'vehicle'" <span>{{ curPicData.vehicle_body_color_text }}</span>
:title="curPicData.plate_color_text" </li>
> <li hidden :title="curPicData.RefinedFeature_text">
<span>车牌颜色:</span> <span>标志物:</span>
<span>{{ curPicData.plate_color_text }}</span> <span>{{ curPicData.RefinedFeature_text }}</span>
</li> </li>
<li </div>
v-if="curPicData.event_type === 'vehicle'"
: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"
>
<span>标志物:</span>
<span>{{ curPicData.RefinedFeature_text }}</span>
</li>
<!-- 非机动车 --> <!-- 非机动车 -->
<li <div v-if="curPicData.event_type === 'xcycle'">
v-if="curPicData.event_type === 'xcycle'" <li :title="curPicData.xcycle_type_text">
:title="curPicData.xcycle_type_text" <span>骑车类型:</span>
> <span>{{ curPicData.xcycle_type_text }}</span>
<span>骑车类型:</span> </li>
<span>{{ curPicData.xcycle_type_text }}</span> <li :title="curPicData.xcycle_color_type">
</li> <span>车辆颜色:</span>
<li <span>{{ curPicData.xcycle_color_type }}</span>
v-if="curPicData.event_type === 'xcycle'" </li>
:title="curPicData.xcycle_color_type" <li :title="curPicData.driver_face_sex">
> <span>性别:</span>
<span>车辆颜色:</span> <span>{{ curPicData.driver_face_sex }}</span>
<span>{{ curPicData.xcycle_color_type }}</span> </li>
</li> <li :title="curPicData.company">
<li <span>运营公司:</span>
:title="curPicData.driver_face_sex" <span>{{ curPicData.company }}</span>
v-if="curPicData.event_type === 'xcycle'" </li>
> <li :title="curPicData.driver_face_upbody_text">
<span>性别:</span> <span>上身颜色:</span>
<span>{{ curPicData.driver_face_sex }}</span> <span>{{ curPicData.driver_face_upbody_text }}</span>
</li> </li>
<li <li :title="curPicData.driver_face_lobody_text">
v-if="curPicData.event_type === 'xcycle'" <span>速度:</span>
:title="curPicData.company" <span>{{ curPicData.location_speed }}</span>
> </li>
<span>运营公司:</span> <li :title="curPicData.driver_face_lobody_text">
<span>{{ curPicData.company }}</span> <span>戴帽子:</span>
</li> <span>{{ curPicData.driver_face_with_hats }}</span>
<li </li>
v-if="curPicData.event_type === 'xcycle'" </div>
: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'"
>
<span>速度:</span>
<span>{{ curPicData.location_speed }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'xcycle'"
>
<span>戴帽子:</span>
<span>{{ curPicData.driver_face_with_hats }}</span>
</li>
<!-- 行人 --> <!-- 行人 -->
<li <div v-if="curPicData.event_type === 'pedestrian'">
:title="curPicData.driver_face_sex" <li :title="curPicData.driver_face_sex">
v-if="curPicData.event_type === 'pedestrian'" <span>性别:</span>
> <span>{{ curPicData.driver_face_sex }}</span>
<span>性别:</span> </li>
<span>{{ curPicData.driver_face_sex }}</span> <li :title="curPicData.driver_face_upbody_text">
</li> <span>上身颜色:</span>
<li <span>{{ curPicData.driver_face_upbody_text }}</span>
:title="curPicData.driver_face_upbody_text" </li>
v-if="curPicData.event_type === 'pedestrian'" <li :title="curPicData.driver_face_lobody_text">
> <span>下身颜色:</span>
<span>上身颜色:</span> <span>{{ curPicData.driver_face_lobody_text }}</span>
<span>{{ curPicData.driver_face_upbody_text }}</span> </li>
</li> <li :title="curPicData.pedestrian_height">
<li <span>身高:</span>
:title="curPicData.driver_face_lobody_text" <span>{{ curPicData.pedestrian_height }}</span>
v-if="curPicData.event_type === 'pedestrian'" </li>
> <li :title="curPicData.driver_face_lobody_text">
<span>下身颜色:</span> <span>速度:</span>
<span>{{ curPicData.driver_face_lobody_text }}</span> <span>{{ curPicData.location_speed }}</span>
</li> </li>
<li <li :title="curPicData.driver_face_lobody_text">
:title="curPicData.pedestrian_height" <span>戴帽子:</span>
v-if="curPicData.event_type === 'pedestrian'" <span>{{ curPicData.driver_face_with_hats }}</span>
> </li>
<span>身高:</span> </div>
<span>{{ curPicData.pedestrian_height }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'pedestrian'"
>
<span>速度:</span>
<span>{{ curPicData.location_speed }}</span>
</li>
<li
:title="curPicData.driver_face_lobody_text"
v-if="curPicData.event_type === 'pedestrian'"
>
<span>戴帽子:</span>
<span>{{ curPicData.driver_face_with_hats }}</span>
</li>
<li v-if="curPicData.illegalType" :title="curPicData.illegalType"> <li v-if="curPicData.illegalType" :title="curPicData.illegalType">
<span>违法类型:</span> <span>违法类型:</span>
<span>{{ curPicData.illegalType }}</span> <span>{{ curPicData.illegalType }}</span>
</li> </li>
<li v-if="curPicData.illegalType" :title="curPicData.illegalType"> <li v-if="curPicData.illegalType" :title="curPicData.illegalType">
<span>特殊车辆:</span> <span>特殊车辆:</span>
<span>{{ curPicData.special_text }}</span> <span>{{ curPicData.special_text }}</span>
</li> </li>
...@@ -239,9 +187,7 @@ ...@@ -239,9 +187,7 @@
</li> </li>
<li :title="getCode('安防事件', curPicData.event_type)"> <li :title="getCode('安防事件', curPicData.event_type)">
<span>事件类型:</span> <span>事件类型:</span>
<span>{{ <span>{{ curPicData.event_type }}</span>
curPicData.event_type
}}</span>
</li> </li>
<li <li
:title="curPicData.shoot_time" :title="curPicData.shoot_time"
...@@ -272,14 +218,15 @@ export default { ...@@ -272,14 +218,15 @@ export default {
carImg: "", carImg: "",
isShow: false, isShow: false,
curPicData: {}, curPicData: {},
srcList: [] srcList: [],
}; };
}, },
methods: { methods: {
detailInfo: function(data) { detailInfo: function (data) {
this.curPicData = {}; this.curPicData = {};
this.curPicData = data; this.curPicData = data;
this.srcList = []; this.srcList = [];
console.log('curPicData', this.curPicData);
setTimeout(() => { setTimeout(() => {
if (data.bigpic) { if (data.bigpic) {
this.srcList.push(data.bigpic); this.srcList.push(data.bigpic);
...@@ -288,11 +235,11 @@ export default { ...@@ -288,11 +235,11 @@ export default {
this.isShow = true; this.isShow = true;
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
}, },
beforeHideModal: function() { beforeHideModal: function () {
this.isShow = false; this.isShow = false;
this.$emit("closeDetailModal"); this.$emit("closeDetailModal");
}, },
picMove: function(e) { picMove: function (e) {
var e = e || window.event; var e = e || window.event;
if (e.target.getAttribute("class").indexOf("small") > -1) { if (e.target.getAttribute("class").indexOf("small") > -1) {
let imgWidth = e.target.width; let imgWidth = e.target.width;
...@@ -304,8 +251,8 @@ export default { ...@@ -304,8 +251,8 @@ export default {
} else { } else {
return; return;
} }
} },
} },
}; };
</script> </script>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
:class="{ :class="{
'task-lsit': true, 'task-lsit': true,
runningtask: item.status == 'Running', runningtask: item.status == 'Running',
stoptask: item.status != 'Running' stoptask: item.status != 'Running',
}" }"
> >
<!-- <i <!-- <i
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
v-show="subTask.enableStatus != 1" v-show="subTask.enableStatus != 1"
:class="[ :class="[
{ subtaskActive: subTask.subtask_id == currentSubtaskId }, { subtaskActive: subTask.subtask_id == currentSubtaskId },
{ disabledColor: subTask.enableStatus == 5 } { disabledColor: subTask.enableStatus == 5 },
]" ]"
:data-subtask="subTask.subtask_id" :data-subtask="subTask.subtask_id"
:id="subTask.vchan.vdev_unid + ',' + subTask.vchan.vchan_refid" :id="subTask.vchan.vdev_unid + ',' + subTask.vchan.vchan_refid"
...@@ -63,8 +63,12 @@ ...@@ -63,8 +63,12 @@
<el-col :span="15" class="ht100"> <el-col :span="15" class="ht100">
<div class="video-box"> <div class="video-box">
<div class="play-box"> <div class="play-box">
<videoplay ref="videoplay" :playurl="playurl" v-if="!ischrome"></videoplay> <videoplay
<flvvideo ref="flvideo" v-if="ischrome"></flvvideo> ref="videoplay"
:playurl="playurl"
v-if="!ischrome"
></videoplay>
<flvvideo ref="flvideo" v-if="ischrome"></flvvideo>
</div> </div>
<div class> <div class>
<setting <setting
...@@ -90,7 +94,7 @@ ...@@ -90,7 +94,7 @@
</template> </template>
<script> <script>
import videoplay from "../public/videoPlay"; import videoplay from "../public/videoPlay";
import flvvideo from "../public/flvvideo" import flvvideo from "../public/flvvideo";
import InfoDialog from "../public/infodialog"; import InfoDialog from "../public/infodialog";
import setting from "./setting"; import setting from "./setting";
import eventtab from "./eventTab"; import eventtab from "./eventTab";
...@@ -100,7 +104,7 @@ export default { ...@@ -100,7 +104,7 @@ export default {
InfoDialog, InfoDialog,
setting, setting,
flvvideo, flvvideo,
eventtab eventtab,
}, },
data() { data() {
return { return {
...@@ -112,21 +116,21 @@ export default { ...@@ -112,21 +116,21 @@ export default {
subindex: -1, subindex: -1,
playurl: "", playurl: "",
taskID: "", taskID: "",
streamclock:null, streamclock: null,
currentSubtaskId: "", currentSubtaskId: "",
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "label" label: "label",
}, },
timer: null, timer: null,
searchstate: null searchstate: null,
}; };
}, },
methods: { methods: {
selecttask(data, index) { selecttask(data, index) {
this.subTasks = []; this.subTasks = [];
this.subindex = index; 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.subTasks = res.list_data;
this.taskID = data.task_id; this.taskID = data.task_id;
}); });
...@@ -143,120 +147,119 @@ export default { ...@@ -143,120 +147,119 @@ export default {
if (vdata.running_status != "Running") { if (vdata.running_status != "Running") {
this.$message({ this.$message({
message: "该任务没有运行,无法获取分析视频和抓拍信息", message: "该任务没有运行,无法获取分析视频和抓拍信息",
type: "error" type: "error",
}); });
return; return;
} }
this.pushSteam(vdata); this.pushSteam(vdata);
this.$refs.event.dataInit(this.currentSubtaskId, vdata.task_type); this.$refs.event.dataInit(this.currentSubtaskId, vdata.task_type);
}, },
getTask(data) { getTask(data) {
let that = this; let that = this;
this.$api.task this.$api.task
.getTask({ .getTask({
task_name: this.searchInfo task_name: this.searchInfo,
}) })
.then(res => { .then((res) => {
that.taskdata = res.list_data; that.taskdata = res.list_data;
console.log(res); console.log(res);
}); });
}, },
//发送推流请求 //发送推流请求
pushSteam(vdata) { pushSteam(vdata) {
this.steam(vdata).then(m => { this.steam(vdata).then((m) => {
if (m.ecode) { if (m.ecode) {
this.$message({ this.$message({
message: "发送推流请求失败:" + m.enote, message: "发送推流请求失败:" + m.enote,
type: "error" type: "error",
}); });
} else { } else {
this.vchandata = vdata.vchan; this.vchandata = vdata.vchan;
clearInterval(this.streamclock) clearInterval(this.streamclock);
this.streamclock = null; this.streamclock = null;
this.getPlayUrl(); this.getPlayUrl();
} }
}) });
}, },
steam(vdata){ steam(vdata) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
let data = { let data = {
send_stream: true, send_stream: true,
task_id: this.currentSubtaskId, task_id: this.currentSubtaskId,
is_analyse: true is_analyse: true,
}; };
this.$api.task this.$api.task
.getStream(this.dev_unid, vdata.vchan.vchan_refid, data) .getStream(this.dev_unid, vdata.vchan.vchan_refid, data)
.then(m => { .then((m) => {
resolve(m); resolve(m);
}); });
}) });
}, },
getPlayUrl: function() { getPlayUrl: function () {
if(this.ischrome) { if (this.ischrome) {
let ip = this.$api.flvIP; let ip = this.$api.flvIP;
let url = `${window.config.https?'https':'http'}://${ip}:${window.config.https?'20070':'8080'}/live/${this.currentSubtaskId}.flv` let url = `${window.config.https ? "https" : "http"}://${ip}:${
console.log("FLV播放地址:", url) window.config.https ? "20070" : "20080"
debugger }/live/${this.currentSubtaskId}.flv`;
console.log("FLV播放地址:", url);
debugger;
this.$refs.flvideo.startFunc(url); this.$refs.flvideo.startFunc(url);
this.streamclock = setInterval(()=> { this.streamclock = setInterval(() => {
this.steam(this.subtaskdata) this.steam(this.subtaskdata);
},9000) }, 9000);
} }
if(this.subtaskdata.task_algo_type == '12') { if (this.subtaskdata.task_algo_type == "12") {
console.log(this.subtaskdata) console.log(this.subtaskdata);
this.playurl = {rtsp_url:this.subtaskdata.vchan.url}; this.playurl = { rtsp_url: this.subtaskdata.vchan.url };
console.log("bkurl",this.playurl) console.log("bkurl", this.playurl);
setTimeout(() => { setTimeout(() => {
this.$refs.videoplay.videoPlay(); this.$refs.videoplay.videoPlay();
}, 2000); }, 2000);
return false; return false;
} }
this.$api.task.getPlayUrl(this.currentSubtaskId).then(res => { this.$api.task.getPlayUrl(this.currentSubtaskId).then((res) => {
this.playurl = res; this.playurl = res;
if (this.playurl.rtsp_url) { if (this.playurl.rtsp_url) {
this.$message({ this.$message({
message: "获取播放地址成功,请耐心等待视频加载", message: "获取播放地址成功,请耐心等待视频加载",
type: "success" type: "success",
}); });
setTimeout(() => { setTimeout(() => {
!this.ischrome?this.$refs.videoplay.videoPlay():null; !this.ischrome ? this.$refs.videoplay.videoPlay() : null;
}, 2000); }, 2000);
console.info("视频播放地址:", this.playurl.rtsp_url); console.info("视频播放地址:", this.playurl.rtsp_url);
} else { } else {
this.$message({ this.$message({
message: "获取rtsp播放地址失败!请重试!", message: "获取rtsp播放地址失败!请重试!",
type: "error" type: "error",
}); });
} }
}); });
}, },
getVchansIsSending() { getVchansIsSending() {
this.axios.get(this.API.task.getstream()).then(res => {}); this.axios.get(this.API.task.getstream()).then((res) => {});
}, },
debounce(fn, wait) { debounce(fn, wait) {
clearTimeout(this.timer); clearTimeout(this.timer);
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
fn; fn;
}, wait); }, wait);
} },
}, },
watch: { watch: {
searchInfo(val) { searchInfo(val) {
this.debounce(this.getTask(), 800); this.debounce(this.getTask(), 800);
} },
}, },
created() { created() {
this.getTask(); this.getTask();
this.ischrome = this.checkchrome(); this.ischrome = this.checkchrome();
}, },
mounted() { mounted() {},
beforeDestroy() {
},
beforeDestroy(){
clearInterval(this.streamclock); clearInterval(this.streamclock);
this.streamclock = null; this.streamclock = null;
} },
}; };
</script> </script>
...@@ -352,7 +355,6 @@ export default { ...@@ -352,7 +355,6 @@ export default {
.runningtask { .runningtask {
// color rgba(1, 206, 184, 0.56); // color rgba(1, 206, 184, 0.56);
@include font-colr(runtask_color); @include font-colr(runtask_color);
} }
.stoptask { .stoptask {
...@@ -405,7 +407,7 @@ export default { ...@@ -405,7 +407,7 @@ export default {
.subtaskActive { .subtaskActive {
position: relative; position: relative;
color: #333; color: #333;
padding-right:10px; padding-right: 10px;
} }
.subtaskActive::before { .subtaskActive::before {
......
...@@ -75,14 +75,19 @@ ...@@ -75,14 +75,19 @@
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="组织名称"> <el-form-item label="导出设置">
<el-checkbox v-model="checked" true-label="1" false-label="0">
<span> 带视频导出</span></el-checkbox
>
</el-form-item>
<!-- <el-form-item label="组织名称">
<span class="inputBox"> <span class="inputBox">
<el-input <el-input
placeholder="请输入组织名称" placeholder="请输入组织名称"
v-model="conditions.location_code" v-model="conditions.location_code"
></el-input> ></el-input>
</span> </span>
</el-form-item> </el-form-item> -->
<el-form-item label="起始时间"> <el-form-item label="起始时间">
<span class="dateBox"> <span class="dateBox">
<el-date-picker <el-date-picker
...@@ -100,7 +105,7 @@ ...@@ -100,7 +105,7 @@
</el-form> </el-form>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px; padding-top: 3px">
<el-button type="primary" style="" @click="query" class="block" <el-button type="primary" style="" @click="query" class="block"
>查询</el-button >查询</el-button
> >
...@@ -110,113 +115,117 @@ ...@@ -110,113 +115,117 @@
</div> </div>
</el-col> </el-col>
<div style=""> <div style="">
<div class="desplay-icon"> <div class="desplay-icon">
<i class="el-icon-s-grid" @click="dataDisplay('list')"></i> <i class="el-icon-s-grid" @click="dataDisplay('list')"></i>
<i class="el-icon-tickets" @click="dataDisplay('table')"></i> <i class="el-icon-tickets" @click="dataDisplay('table')"></i>
</div> </div>
<div v-if="displaystatus == 'table'"> <div v-if="displaystatus == 'table'">
<el-table <el-table
:data="formatterData" :data="formatterData"
:height="tableHeight" :height="tableHeight"
stripe stripe
v-loading="loading" v-loading="loading"
border border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
>
<el-table-column
prop="index"
align="center"
label="#"
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="event_cate"
align="center"
:formatter="cateFormatter"
label="事件分类"
>
</el-table-column>
<el-table-column prop="event_type" align="center" label="事件类型">
</el-table-column>
<el-table-column
prop="event_data.location.code"
align="center"
label="组织名称"
> >
</el-table-column> <el-table-column
<el-table-column align="center" label="抓拍地点"> prop="index"
<template slot-scope="scope"> align="center"
<div> label="#"
<span v-if="scope.row.event_data && scope.row.event_data">{{ type="index"
scope.row.event_data.location width="50"
? scope.row.event_data.location.name >
: "" </el-table-column>
<el-table-column
prop="event_cate"
align="center"
:formatter="cateFormatter"
label="事件分类"
>
</el-table-column>
<el-table-column prop="event_type" align="center" label="事件类型">
</el-table-column>
<!-- <el-table-column
prop="event_data.location.code"
align="center"
label="组织名称"
>
</el-table-column> -->
<el-table-column align="center" label="抓拍地点">
<template slot-scope="scope">
<div>
<span v-if="scope.row.event_data && scope.row.event_data">{{
scope.row.event_data.location
? scope.row.event_data.location.name
: ""
}}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="shoot_date" align="center" label="抓拍时间">
<template slot-scope="scope">
<span v-if="scope.row.event_data">{{
showLocalTime(scope.row.event_dt)
}}</span> }}</span>
</div> </template>
</template> </el-table-column>
</el-table-column> <el-table-column align="center" label="操作">
<el-table-column prop="shoot_date" align="center" label="抓拍时间"> <template slot-scope="scope">
<template slot-scope="scope"> <el-tooltip
<span v-if="scope.row.event_data" content="播放"
placement="bottom"
>{{showLocalTime(scope.row.event_dt)}}</span effect="light"
> :visible-arrow="false"
</template> >
</el-table-column> <span
<el-table-column align="center" label="操作"> :class="{
<template slot-scope="scope"> 'iconfont icon-fanxing-qidong playIcon': true,
<el-tooltip 'no-btn':
content="播放" scope.row.video && scope.row.video[0].src_url != ''
placement="bottom" ? false
effect="light" : true,
:visible-arrow="false" }"
> @click="playFun(scope.$index, scope.row)"
<span ></span>
:class="{ </el-tooltip>
'iconfont icon-fanxing-qidong playIcon': true, <span class="tableSpanBorder"></span>
'no-btn': <el-tooltip
scope.row.video && scope.row.video[0].src_url != '' content="详情"
? false placement="bottom"
: true effect="light"
}" :visible-arrow="false"
@click="playFun(scope.$index, scope.row)" >
></span> <span
</el-tooltip> class="el-icon-info editIcon"
<span class="tableSpanBorder"></span> @click="detailFun(scope.$index, scope.row)"
<el-tooltip ></span>
content="详情" </el-tooltip>
placement="bottom" <span class="tableSpanBorder"></span>
effect="light" <el-tooltip
:visible-arrow="false" content="删除"
> placement="bottom"
<span effect="light"
class="el-icon-info editIcon" :visible-arrow="false"
@click="detailFun(scope.$index, scope.row)" >
></span> <span
</el-tooltip> class="el-icon-delete delIcon"
<span class="tableSpanBorder"></span> @click="delFun(scope.$index, scope.row)"
<el-tooltip ></span>
content="删除" </el-tooltip>
placement="bottom" </template>
effect="light" </el-table-column>
:visible-arrow="false" </el-table>
>
<span
class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div> </div>
<div v-if="displaystatus == 'list'"> <div v-if="displaystatus == 'list'">
<div class="listbox" :style="{'height':tableHeight}"> <div class="listbox" :style="{ height: tableHeight }">
<div v-for="(item, index) in formatterData" :key="index" class="listboxitem" @click="detailFun(index,item)"> <div
v-for="(item, index) in formatterData"
:key="index"
class="listboxitem"
@click="detailFun(index, item)"
>
<div class="imgbox"> <div class="imgbox">
<img :src="item.pics[0].src_url" alt=""> <img :src="item.pics[0].src_url" alt="" />
</div> </div>
<div class="displayinfo"> <div class="displayinfo">
<el-form label-width="80px" inline> <el-form label-width="80px" inline>
...@@ -224,11 +233,10 @@ ...@@ -224,11 +233,10 @@
<span>{{ item.event_type }}</span> <span>{{ item.event_type }}</span>
</el-form-item> </el-form-item>
<el-form-item label="经过日期:"> <el-form-item label="经过日期:">
<span>{{ <span
item.shoot_date ? item.shoot_date : "" >{{ item.shoot_date ? item.shoot_date : "" }}
}} {{ {{ item.shoot_time ? item.shoot_time : "" }}</span
item.shoot_time ? item.shoot_time : "" >
}}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -237,23 +245,21 @@ ...@@ -237,23 +245,21 @@
:class="{ :class="{
'iconfont icon-fanxing-qidong playIcon': true, 'iconfont icon-fanxing-qidong playIcon': true,
'no-btn': 'no-btn':
item.video && item.video[0].src_url != '' item.video && item.video[0].src_url != '' ? false : true,
? false
: true
}" }"
@click.stop="playFun(index, item)" @click.stop="playFun(index, item)"
></span> ></span>
<span <span
class="el-icon-delete delIcon" class="el-icon-delete delIcon"
@click.stop="delFun(index, item)" @click.stop="delFun(index, item)"
></span> ></span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="margin-top: 28px;"> <div style="margin-top: 28px">
<el-pagination <el-pagination
style="float: right;" style="float: right"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
...@@ -265,7 +271,7 @@ ...@@ -265,7 +271,7 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
...@@ -275,15 +281,15 @@ ...@@ -275,15 +281,15 @@
class="detailDialog" class="detailDialog"
width="800px" width="800px"
> >
<div style="position: relative;padding: 10px 20px;"> <div style="position: relative; padding: 10px 20px">
<!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> --> <!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> -->
<div class="detaiCon"> <div class="detaiCon">
<el-image style="width: 100%;" :src="this.detailImg"> <el-image style="width: 100%" :src="this.detailImg">
<div slot="error" class="image-slot"> <div slot="error" class="image-slot">
<img <img
:src="carImg" :src="carImg"
alt="" alt=""
style="width: 40%;display: block;margin: 0 auto;" style="width: 40%; display: block; margin: 0 auto"
/> />
</div> </div>
</el-image> </el-image>
...@@ -317,7 +323,9 @@ ...@@ -317,7 +323,9 @@
:class="{ :class="{
playButton: true, playButton: true,
'no-video-btn': 'no-video-btn':
detailObj.video && detailObj.video[0].src_url != '' ? false : true detailObj.video && detailObj.video[0].src_url != ''
? false
: true,
}" }"
>播 放</el-button >播 放</el-button
> >
...@@ -331,6 +339,7 @@ ...@@ -331,6 +339,7 @@
</template> </template>
<script> <script>
import videoDialog from "@/components/video"; import videoDialog from "@/components/video";
import { getDataList } from "@/libs/utils";
export default { export default {
data() { data() {
let start_dt = this.yesterDay(); let start_dt = this.yesterDay();
...@@ -348,14 +357,14 @@ export default { ...@@ -348,14 +357,14 @@ export default {
task_id: "", task_id: "",
subtask_id: "", subtask_id: "",
location_code: "", location_code: "",
event_cate: "安防事件" event_cate: "安防事件",
}, },
formatterData: [], formatterData: [],
loading: false, loading: false,
formatterData: [], checked: "0",
total: 0, total: 0,
page: 1, page: 1,
displaystatus:'table', displaystatus: "table",
pageSize: 30, pageSize: 30,
selectcheck: [], selectcheck: [],
currentIndex: 0, currentIndex: 0,
...@@ -364,17 +373,17 @@ export default { ...@@ -364,17 +373,17 @@ export default {
playurl: "", playurl: "",
taskList: [], taskList: [],
subTaskList: [], subTaskList: [],
tableHeight: window.twoSearchTableHeight tableHeight: window.twoSearchTableHeight,
}; };
}, },
watch: { watch: {
dates(val) { dates(val) {
this.conditions.start_dt = val[0]; this.conditions.start_dt = val[0];
this.conditions.end_dt = val[1]; this.conditions.end_dt = val[1];
} },
}, },
components: { components: {
videoDialog videoDialog,
}, },
mounted() { mounted() {
this.getTaskList(); this.getTaskList();
...@@ -384,12 +393,12 @@ export default { ...@@ -384,12 +393,12 @@ export default {
indexFormatter(row, column, cellValue, index) { indexFormatter(row, column, cellValue, index) {
return index + (this.page - 1) * this.pageSize + 1; return index + (this.page - 1) * this.pageSize + 1;
}, },
dataDisplay(data){ dataDisplay(data) {
this.displaystatus = data this.displaystatus = data;
}, },
cateFormatter(row, column, cellValue, index) { cateFormatter(row, column, cellValue, index) {
let name = ""; let name = "";
this.cateList.forEach(item => { this.cateList.forEach((item) => {
if (item.code == cellValue) { if (item.code == cellValue) {
name = item.name; name = item.name;
} }
...@@ -400,14 +409,14 @@ export default { ...@@ -400,14 +409,14 @@ export default {
this.$api.task this.$api.task
.getTask({ .getTask({
source_type: "pull_video_stream", source_type: "pull_video_stream",
task_type: "normal" task_type: "normal",
}) })
.then(res => { .then((res) => {
this.taskList = res.list_data; this.taskList = res.list_data;
}); });
}, },
getSubTask() { getSubTask() {
this.$api.task.getSubTask(this.conditions.task_id).then(res => { this.$api.task.getSubTask(this.conditions.task_id).then((res) => {
if (res.list_data == null) { if (res.list_data == null) {
this.subTaskList = []; this.subTaskList = [];
} else { } else {
...@@ -415,7 +424,7 @@ export default { ...@@ -415,7 +424,7 @@ export default {
} }
this.subTaskList.unshift({ this.subTaskList.unshift({
subtask_id: "", subtask_id: "",
subtask_name: "全部" subtask_name: "全部",
}); });
this.conditions.subtask_id = ""; this.conditions.subtask_id = "";
}); });
...@@ -429,24 +438,24 @@ export default { ...@@ -429,24 +438,24 @@ export default {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delEvents({}, row.event_unid) .delEvents({}, row.event_unid)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.formatterData.splice(index); this.formatterData.splice(index);
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.getData(); this.getData();
this.$logs.oplogs(res,'serv_serarch',`事件数据删除`); this.$logs.oplogs(res, "serv_serarch", `事件数据删除`);
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
...@@ -472,15 +481,17 @@ export default { ...@@ -472,15 +481,17 @@ export default {
this.conditions.location_code this.conditions.location_code
? this.conditions.location_code.replace(/\s\s*/g, "") ? this.conditions.location_code.replace(/\s\s*/g, "")
: this.conditions.location_code : this.conditions.location_code
}&event_cate=${cate}&event_type=${this.conditions.type}`; }&event_cate=${cate}&event_type=${this.conditions.type}&isHasVideo=${
this.$logs.oplogs({},'serv_serarch',`事件数据导出`); this.checked
}`;
this.$logs.oplogs({}, "serv_serarch", `事件数据导出`);
window.open(encodeURI(url)); window.open(encodeURI(url));
}, },
leftFun() { leftFun() {
if (this.currentIndex - 1 < 0) { if (this.currentIndex - 1 < 0) {
this.$message({ this.$message({
message: "目前为第一条", message: "目前为第一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -492,7 +503,7 @@ export default { ...@@ -492,7 +503,7 @@ export default {
if (this.currentIndex == this.formatterData.length - 1) { if (this.currentIndex == this.formatterData.length - 1) {
this.$message({ this.$message({
message: "目前为最后一条", message: "目前为最后一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -502,7 +513,7 @@ export default { ...@@ -502,7 +513,7 @@ export default {
}, },
handleSelectionChange(obj) { handleSelectionChange(obj) {
this.selectcheck = []; this.selectcheck = [];
obj.forEach(item => { obj.forEach((item) => {
this.selectcheck.push(item.id); this.selectcheck.push(item.id);
}); });
}, },
...@@ -536,32 +547,31 @@ export default { ...@@ -536,32 +547,31 @@ export default {
.format("YYYY-MM-DD HH:mm:ss"), .format("YYYY-MM-DD HH:mm:ss"),
event_dt__lt: this.$moment(this.conditions.end_dt) event_dt__lt: this.$moment(this.conditions.end_dt)
.utc() .utc()
.format("YYYY-MM-DD HH:mm:ss") .format("YYYY-MM-DD HH:mm:ss"),
}; };
if (this.conditions.event_cate == "安防事件") { if (this.conditions.event_cate == "安防事件") {
search_params.event_cate = ""; search_params.event_cate = "";
} else { } else {
search_params.event_cate = this.conditions.event_cate; search_params.event_cate = this.conditions.event_cate;
} }
this.$api.search getDataList(search_params, "event")
.eventTableList(search_params) .then((res) => {
.then(res => {
this.total = res.total_num; this.total = res.total_num;
res.list_data.forEach((item, index) => { this.formatterData = res.formatterData;
this.formatterData.push(this.$buildCode.init(item));
});
this.loading = false; this.loading = false;
this.$logs.oplogs(res,'serv_serarch',`事件检索`); this.$logs.oplogs(res, "serv_serarch", `事件检索`);
}) })
.catch(err => {}); .catch((err) => {});
}, },
getImg(unid) { getImg(unid) {
this.detailImg = "";
if (!unid) return;
this.$api.search this.$api.search
.detailImg({}, unid) .detailImg({}, unid)
.then(res => { .then((res) => {
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg; this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
}) })
.catch(e => {}); .catch((e) => {});
}, },
playFun(index, row) { playFun(index, row) {
if (!row.video) { if (!row.video) {
...@@ -575,21 +585,20 @@ export default { ...@@ -575,21 +585,20 @@ export default {
}, },
detailFun(index, row) { detailFun(index, row) {
this.currentIndex = index; this.currentIndex = index;
if (row.pics.length > 0) { this.detailObj = Object.assign({}, row);
this.detailObj = Object.assign({}, row); const pic_unid = row.pics.length > 0 ? row.pics[0].pic_unid : "";
this.getImg(row.pics[0].pic_unid); this.getImg(pic_unid);
}
this.detailVisible = true; this.detailVisible = true;
}, },
detailDel() { detailDel() {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delEvents({}, this.detailObj.event_unid) .delEvents({}, this.detailObj.event_unid)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.formatterData.splice(this.currentIndex, 1); this.formatterData.splice(this.currentIndex, 1);
this.detailObj = Object.assign( this.detailObj = Object.assign(
...@@ -601,19 +610,19 @@ export default { ...@@ -601,19 +610,19 @@ export default {
); );
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`数据删除`); this.$logs.oplogs(res, "serv_serarch", `数据删除`);
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
} },
} },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
...@@ -132,14 +132,15 @@ ...@@ -132,14 +132,15 @@
</el-date-picker> </el-date-picker>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="导出设置"> <el-form-item label="导出设置">
<el-checkbox v-model="checked" true-label="1" false-label="0"> <el-checkbox v-model="checked" true-label="1" false-label="0">
<span> 带视频导出</span></el-checkbox> <span> 带视频导出</span></el-checkbox
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px; padding-top: 3px">
<el-button type="primary" style="" @click="query" class="block" <el-button type="primary" style="" @click="query" class="block"
>查询</el-button >查询</el-button
> >
...@@ -159,126 +160,131 @@ ...@@ -159,126 +160,131 @@
<i class="el-icon-tickets" @click="dataDisplay('table')"></i> <i class="el-icon-tickets" @click="dataDisplay('table')"></i>
</div> </div>
<div v-if="displaystatus == 'table'"> <div v-if="displaystatus == 'table'">
<el-table <el-table
:data="formatterData" :data="formatterData"
:height="tableHeight" :height="tableHeight"
v-loading="loading" v-loading="loading"
ref="eventTable" ref="eventTable"
stripe stripe
border border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
>
<el-table-column type="selection" align="center" width="55">
</el-table-column>
<el-table-column
prop="index"
align="center"
label="#"
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="vehicle_plate_text"
align="center"
label="车牌号码"
>
</el-table-column>
<el-table-column
prop="vehicle_body_type_text"
align="center"
label="车辆类型"
>
</el-table-column>
<el-table-column
prop="vehicle_body_logo_text"
align="center"
label="车辆品牌"
> >
</el-table-column> <el-table-column type="selection" align="center" width="55">
<el-table-column </el-table-column>
prop="vehicle_body_color_text" <el-table-column
align="center" prop="index"
label="车身颜色" align="center"
> label="#"
</el-table-column> type="index"
<el-table-column width="50"
prop="plate_color_text" >
align="center" </el-table-column>
label="车牌颜色" <el-table-column
> prop="vehicle_plate_text"
</el-table-column> align="center"
<el-table-column prop="illegalType" align="center" label="违法类型"> label="车牌号码"
</el-table-column> >
<el-table-column prop="shoot_date" align="center" label="违法日期"> </el-table-column>
<template slot-scope="scope"> <el-table-column
<span>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span> prop="vehicle_body_type_text"
</template> align="center"
</el-table-column> label="车辆类型"
<el-table-column prop="location_name" align="center" label="抓拍地点"> >
</el-table-column> </el-table-column>
<el-table-column align="center" width="150" label="操作"> <el-table-column
<template slot-scope="scope"> prop="vehicle_body_logo_text"
<el-tooltip align="center"
content="播放" label="车辆品牌"
placement="bottom" >
effect="light" </el-table-column>
:visible-arrow="false" <el-table-column
> prop="vehicle_body_color_text"
<span align="center"
:class="{ label="车身颜色"
'iconfont icon-fanxing-qidong playIcon': true, >
'no-btn': </el-table-column>
scope.row.video && scope.row.video[0].src_url != '' <el-table-column
? false prop="plate_color_text"
: true align="center"
}" label="车牌颜色"
@click="playFun(scope.$index, scope.row)" >
></span> </el-table-column>
</el-tooltip> <el-table-column prop="illegalType" align="center" label="违法类型">
<span class="tableSpanBorder"></span> </el-table-column>
<el-tooltip <el-table-column prop="shoot_date" align="center" label="违法日期">
content="详情" <template slot-scope="scope">
placement="bottom" <span>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span>
effect="light" </template>
:visible-arrow="false" </el-table-column>
> <el-table-column prop="location_name" align="center" label="抓拍地点">
<span </el-table-column>
class="el-icon-info editIcon" <el-table-column align="center" width="150" label="操作">
@click="detailFun(scope.$index, scope.row)" <template slot-scope="scope">
></span> <el-tooltip
</el-tooltip> content="播放"
<span class="tableSpanBorder"></span> placement="bottom"
<el-tooltip effect="light"
content="删除" :visible-arrow="false"
placement="bottom" >
effect="light" <span
:visible-arrow="false" :class="{
> 'iconfont icon-fanxing-qidong playIcon': true,
<span 'no-btn':
class="el-icon-delete delIcon" scope.row.video && scope.row.video[0].src_url != ''
@click="delFun(scope.$index, scope.row)" ? false
></span> : true,
</el-tooltip> }"
</template> @click="playFun(scope.$index, scope.row)"
</el-table-column> ></span>
</el-table> </el-tooltip>
</div> <span class="tableSpanBorder"></span>
<el-tooltip
content="详情"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="el-icon-info editIcon"
@click="detailFun(scope.$index, scope.row)"
></span>
</el-tooltip>
<span class="tableSpanBorder"></span>
<el-tooltip
content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<div v-if="displaystatus == 'list'"> <div v-if="displaystatus == 'list'">
<div class="listbox" :style="{'height':tableHeight}"> <div class="listbox" :style="{ height: tableHeight }">
<div v-for="(item, index) in formatterData" :key="index" class="listboxitem" @click="detailFun(index,item)"> <div
v-for="(item, index) in formatterData"
:key="index"
class="listboxitem"
@click="detailFun(index, item)"
>
<div class="imgbox"> <div class="imgbox">
<img :src="item.pics[0].src_url" alt=""> <img :src="item.pics[0].src_url" alt="" />
</div> </div>
<div class="displayinfo"> <div class="displayinfo">
<el-form label-width="80px" inline> <el-form label-width="80px" inline>
<el-form-item label="车牌号码:"> <el-form-item label="车牌号码:">
<span>{{ item.vehicle_plate_text }}</span> <span>{{ item.vehicle_plate_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="车辆类型:"> <el-form-item label="车辆类型:">
<span>{{ item.vehicle_body_type_text }}</span> <span>{{ item.vehicle_body_type_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="车辆品牌:"> <el-form-item label="车辆品牌:">
<span>{{ item.vehicle_body_logo_text }}</span> <span>{{ item.vehicle_body_logo_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="车身颜色:"> <el-form-item label="车身颜色:">
...@@ -287,22 +293,14 @@ ...@@ -287,22 +293,14 @@
<el-form-item label="车牌颜色:"> <el-form-item label="车牌颜色:">
<span>{{ item.plate_color_text }}</span> <span>{{ item.plate_color_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="违法日期:">
<span>{{
item.shoot_date ? item.shoot_date : ""
}}{{
item.shoot_time ? item.shoot_time : ""
}}</span>
</el-form-item>
<el-form-item label="违法类型:"> <el-form-item label="违法类型:">
<span>{{ item.illegalType }}</span> <span>{{ item.illegalType }}</span>
</el-form-item> </el-form-item>
<el-form-item label="违法日期:"> <el-form-item label="违法日期:">
<span>{{ <span
item.shoot_date ? item.shoot_date : "" >{{ item.shoot_date ? item.shoot_date : ""
}}{{ }}{{ item.shoot_time ? " " + item.shoot_time : "" }}</span
item.shoot_time ? item.shoot_time : "" >
}}</span>
</el-form-item> </el-form-item>
<el-form-item label="经过地点:"> <el-form-item label="经过地点:">
<span>{{ item.location_name }}</span> <span>{{ item.location_name }}</span>
...@@ -314,23 +312,21 @@ ...@@ -314,23 +312,21 @@
:class="{ :class="{
'iconfont icon-fanxing-qidong playIcon': true, 'iconfont icon-fanxing-qidong playIcon': true,
'no-btn': 'no-btn':
item.video && item.video[0].src_url != '' item.video && item.video[0].src_url != '' ? false : true,
? false
: true
}" }"
@click.stop="playFun(index, item)" @click.stop="playFun(index, item)"
></span> ></span>
<span <span
class="el-icon-delete delIcon" class="el-icon-delete delIcon"
@click.stop="delFun(index, item)" @click.stop="delFun(index, item)"
></span> ></span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="margin-top: 28px;"> <div style="margin-top: 28px">
<el-pagination <el-pagination
style="float: right;" style="float: right"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
...@@ -342,7 +338,7 @@ ...@@ -342,7 +338,7 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
...@@ -352,22 +348,33 @@ ...@@ -352,22 +348,33 @@
class="detailDialog" class="detailDialog"
width="1000px" width="1000px"
> >
<div style="position: relative;padding: 10px 20px;"> <div style="position: relative; padding: 10px 20px">
<!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> --> <!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> -->
<div class="detaiCon"> <div class="detaiCon">
<el-image <div class="img-box">
style="width: 60%;display: block;margin: 0 auto;" <div class="img-placeholder-box">
:src="this.detailImg" <div v-for="itemSrc in srcList" :key="itemSrc">
:preview-src-list="srcList" <el-image :src="itemSrc" @click.native="swtichImg(itemSrc)">
> <div slot="error" class="image-slot">
<div slot="error" class="image-slot"> <img :src="carImg" alt="" />
<img </div>
:src="carImg" </el-image>
alt="" </div>
style="width: 40%;display: block;margin: 0 auto;"
/>
</div> </div>
</el-image> <el-image
style="width: 60%; display: block; margin: 0 auto"
:src="this.detailImg"
:preview-src-list="srcList"
>
<div slot="error" class="image-slot">
<img
:src="carImg"
alt=""
style="width: 40%; display: block; margin: 0 auto"
/>
</div>
</el-image>
</div>
<el-form label-width="90px" inline> <el-form label-width="90px" inline>
<el-form-item label="车牌号码:"> <el-form-item label="车牌号码:">
<span>{{ detailObj.vehicle_plate_text }}</span> <span>{{ detailObj.vehicle_plate_text }}</span>
...@@ -419,7 +426,9 @@ ...@@ -419,7 +426,9 @@
:class="{ :class="{
playButton: true, playButton: true,
'no-video-btn': 'no-video-btn':
detailObj.video && detailObj.video[0].src_url != '' ? false : true detailObj.video && detailObj.video[0].src_url != ''
? false
: true,
}" }"
>播 放</el-button >播 放</el-button
> >
...@@ -433,6 +442,7 @@ ...@@ -433,6 +442,7 @@
</template> </template>
<script> <script>
import videoDialog from "@/components/video"; import videoDialog from "@/components/video";
import { getDataList } from "@/libs/utils";
export default { export default {
data() { data() {
let start_dt = this.yesterDay(); let start_dt = this.yesterDay();
...@@ -440,11 +450,15 @@ export default { ...@@ -440,11 +450,15 @@ export default {
return { return {
loading: false, loading: false,
playurl: "", playurl: "",
checked:"0", checked: "0",
detailObj: {}, detailObj: {},
carImg: require("@/assets/img/home/defaultImg.png"), carImg: require("@/assets/img/home/defaultImg.png"),
detailImg: "", detailImg: "",
srcList: [], srcList: [
"https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg",
"2",
"https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg",
],
detailVisible: false, detailVisible: false,
dates: [start_dt, end_dt], dates: [start_dt, end_dt],
conditions: { conditions: {
...@@ -458,7 +472,7 @@ export default { ...@@ -458,7 +472,7 @@ export default {
car_color: "", car_color: "",
illegal: "all", illegal: "all",
source_type: "pull_video_stream", source_type: "pull_video_stream",
is_key_vehicle: false is_key_vehicle: false,
}, },
brandList: this.$buildCode.getCodeList("车辆品牌"), brandList: this.$buildCode.getCodeList("车辆品牌"),
vehicleTypeList: this.$buildCode.getCodeList("车辆类型"), vehicleTypeList: this.$buildCode.getCodeList("车辆类型"),
...@@ -471,19 +485,20 @@ export default { ...@@ -471,19 +485,20 @@ export default {
page: 1, page: 1,
pageSize: 30, pageSize: 30,
selectcheck: [], selectcheck: [],
exportevent:[], exportevent: [],
currentIndex: 0, currentIndex: 0,
taskList: [], taskList: [],
displaystatus:'table', displaystatus: "table",
subTaskList: [], subTaskList: [],
tableHeight: window.twoSearchTableHeight tableHeight: window.twoSearchTableHeight,
imgUnidEnum: {},
}; };
}, },
watch: { watch: {
dates(val) { dates(val) {
this.conditions.start_dt = val[0]; this.conditions.start_dt = val[0];
this.conditions.end_dt = val[1]; this.conditions.end_dt = val[1];
} },
}, },
components: { videoDialog }, components: { videoDialog },
mounted() { mounted() {
...@@ -494,25 +509,25 @@ export default { ...@@ -494,25 +509,25 @@ export default {
indexFormatter(row, column, cellValue, index) { indexFormatter(row, column, cellValue, index) {
return index + (this.page - 1) * this.pageSize + 1; return index + (this.page - 1) * this.pageSize + 1;
}, },
dataDisplay(data){ dataDisplay(data) {
this.displaystatus = data this.displaystatus = data;
}, },
getTaskList() { getTaskList() {
this.$api.task this.$api.task
.getTask({ .getTask({
source_type: "pull_video_stream", source_type: "pull_video_stream",
task_type: "normal" task_type: "normal",
}) })
.then(res => { .then((res) => {
this.taskList = res.list_data; this.taskList = res.list_data;
this.taskList.unshift({ this.taskList.unshift({
task_id: "", task_id: "",
task_name: "全部" task_name: "全部",
}); });
}); });
}, },
getSubTask() { getSubTask() {
this.$api.task.getSubTask(this.conditions.task_id).then(res => { this.$api.task.getSubTask(this.conditions.task_id).then((res) => {
if (res.list_data == null) { if (res.list_data == null) {
this.subTaskList = []; this.subTaskList = [];
} else { } else {
...@@ -520,7 +535,7 @@ export default { ...@@ -520,7 +535,7 @@ export default {
} }
this.subTaskList.unshift({ this.subTaskList.unshift({
subtask_id: "", subtask_id: "",
subtask_name: "全部" subtask_name: "全部",
}); });
this.conditions.subtask_id = ""; this.conditions.subtask_id = "";
}); });
...@@ -531,11 +546,11 @@ export default { ...@@ -531,11 +546,11 @@ export default {
} }
var play_url = ""; var play_url = "";
if (row.video) { if (row.video) {
this.getVideo(row.video[0].unid) this.getVideo(row.video[0].unid);
} }
}, },
exportFun() { exportFun() {
this.$logs.oplogs({},'serv_serarch',`违法事件导出`); this.$logs.oplogs({}, "serv_serarch", `违法事件导出`);
window.open( window.open(
encodeURI( encodeURI(
process.env.VUE_APP_URL + process.env.VUE_APP_URL +
...@@ -578,7 +593,7 @@ export default { ...@@ -578,7 +593,7 @@ export default {
if (this.selectcheck.length == 0) { if (this.selectcheck.length == 0) {
this.$message({ this.$message({
message: "请选择至少一条记录", message: "请选择至少一条记录",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -586,19 +601,23 @@ export default { ...@@ -586,19 +601,23 @@ export default {
this.$confirm("此操作将永久删除选中记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除选中记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.patchdel({ .patchdel({
event_unids: this.selectcheck event_unids: this.selectcheck,
}) })
.then(res => { .then((res) => {
if (res.ecode == "200") { if (res.ecode == "200") {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`违法批量删除了${this.selectcheck.length}条`); this.$logs.oplogs(
res,
"serv_serarch",
`违法批量删除了${this.selectcheck.length}条`
);
this.getData(); this.getData();
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
...@@ -610,30 +629,30 @@ export default { ...@@ -610,30 +629,30 @@ export default {
if (this.currentIndex - 1 < 0) { if (this.currentIndex - 1 < 0) {
this.$message({ this.$message({
message: "目前为第一条", message: "目前为第一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
this.detailObj = this.formatterData[this.currentIndex - 1]; this.detailObj = this.formatterData[this.currentIndex - 1];
this.currentIndex -= 1; this.currentIndex -= 1;
this.getImg(this.detailObj.pics[0].pic_unid); this.getImg(this.detailObj.pics);
}, },
rightFun() { rightFun() {
if (this.currentIndex == this.formatterData.length - 1) { if (this.currentIndex == this.formatterData.length - 1) {
this.$message({ this.$message({
message: "目前为最后一条", message: "目前为最后一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
this.detailObj = this.formatterData[this.currentIndex + 1]; this.detailObj = this.formatterData[this.currentIndex + 1];
this.currentIndex += 1; this.currentIndex += 1;
this.getImg(this.detailObj.pics[0].pic_unid); this.getImg(this.detailObj.pics);
}, },
handleSelectionChange(obj) { handleSelectionChange(obj) {
this.selectcheck = []; this.selectcheck = [];
this.exportevent = []; this.exportevent = [];
obj.forEach(item => { obj.forEach((item) => {
this.selectcheck.push(item.id); this.selectcheck.push(item.id);
this.exportevent.push(item.unid); this.exportevent.push(item.unid);
}); });
...@@ -672,49 +691,65 @@ export default { ...@@ -672,49 +691,65 @@ export default {
illegal_code: this.conditions.illegal, illegal_code: this.conditions.illegal,
source_type: this.conditions.source_type, source_type: this.conditions.source_type,
is_key_vehicle: this.conditions.is_key_vehicle, is_key_vehicle: this.conditions.is_key_vehicle,
event_type: "" event_type: "",
}; };
this.$api.search getDataList(search_params)
.tableList(search_params) .then((res) => {
.then(res => {
this.total = res.total_num; this.total = res.total_num;
res.list_data.forEach((item, index) => { this.formatterData = res.formatterData;
this.formatterData.push(this.$buildCode.init(item));
});
this.loading = false; this.loading = false;
this.$logs.oplogs(res,'serv_serarch',`违法事件查询`); this.$logs.oplogs(res, "serv_serarch", `违法事件查询`);
}) })
.catch(err => {}); .catch((err) => {});
}, },
getImg(unid) { getImg(pics) {
this.srcList = []; this.srcList = [];
// this.$api.search
// .detailImg({}, unid)
// .then((res) => {
// this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
// this.srcList.push(this.detailImg);
// })
// .catch((e) => {});
const picUnidArr = [];
pics.forEach((p) => {
picUnidArr.push(p.pic_unid);
});
this.$api.search this.$api.search
.detailImg({}, unid) .detailImgBatch({
.then(res => { pic_unids: picUnidArr,
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
this.srcList.push(this.detailImg);
}) })
.catch(e => {}); .then((res) => {
if (res.length > 0) {
const firstSrc = res[0].pic_url;
this.detailImg = firstSrc ? this.buildImgurl(firstSrc) : carImg;
res.forEach((item) => {
this.srcList.push(this.buildImgurl(item.pic_url));
});
}
});
},
swtichImg(src) {
this.detailImg = src;
}, },
getVideo(unid) { getVideo(unid) {
this.$api.search this.$api.search
.detailVideo({}, unid) .detailVideo({}, unid)
.then(res => { .then((res) => {
let play_url = res.mp4_url let play_url = res.mp4_url;
console.log("录像路径",play_url); console.log("录像路径", play_url);
setTimeout(() => { setTimeout(() => {
this.$refs.visableDialog.playvideos(play_url); this.$refs.visableDialog.playvideos(play_url);
console.log('videourl',url) console.log("videourl", url);
}, 0); }, 0);
}) })
.catch(e => {}); .catch((e) => {});
}, },
detailFun(index, row) { detailFun(index, row) {
this.currentIndex = index; this.currentIndex = index;
if (row.pics.length > 0) { if (row.pics.length > 0) {
this.detailObj = Object.assign({}, row); this.detailObj = Object.assign({}, row);
this.getImg(row.pics[0].pic_unid); this.getImg(row.pics);
} }
this.detailVisible = true; this.detailVisible = true;
}, },
...@@ -722,24 +757,24 @@ export default { ...@@ -722,24 +757,24 @@ export default {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delVehicle({}, row.id) .delVehicle({}, row.id)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.formatterData.splice(index); this.formatterData.splice(index);
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`违法事件删除`); this.$logs.oplogs(res, "serv_serarch", `违法事件删除`);
this.getData(); this.getData();
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
...@@ -748,35 +783,57 @@ export default { ...@@ -748,35 +783,57 @@ export default {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delVehicle({}, this.detailObj.id) .delVehicle({}, this.detailObj.id)
.then(res => { .then((res) => {
if (res.ecode == 200) {19 if (res.ecode == 200) {
19;
this.formatterData.splice(this.currentIndex, 1); this.formatterData.splice(this.currentIndex, 1);
this.detailObj = Object.assign( this.detailObj = Object.assign(
{}, {},
this.formatterData[this.currentIndex] this.formatterData[this.currentIndex]
); );
this.getImg( this.getImg(this.formatterData[this.currentIndex].pics);
this.formatterData[this.currentIndex].pics[0].pic_unid
);
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`违法事件删除`); this.$logs.oplogs(res, "serv_serarch", `违法事件删除`);
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
} },
} },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.img-box {
position: relative;
min-height: 200px;
}
.img-placeholder-box {
position: absolute;
top: 0;
left: 0;
width: 15%;
img {
width: 100px;
height: 100px;
cursor: pointer;
}
/deep/.el-image {
cursor: pointer;
img {
width: 100px;
height: 100px;
}
}
}
</style>
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
</el-form> </el-form>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px; padding-top: 3px">
<el-button type="primary" style="" @click="query" class="block" <el-button type="primary" style="" @click="query" class="block"
>查询</el-button >查询</el-button
> >
...@@ -182,135 +182,139 @@ ...@@ -182,135 +182,139 @@
<i class="el-icon-tickets" @click="dataDisplay('table')"></i> <i class="el-icon-tickets" @click="dataDisplay('table')"></i>
</div> </div>
<div v-if="displaystatus == 'table'"> <div v-if="displaystatus == 'table'">
<el-table <el-table
:data="formatterData" :data="formatterData"
:height="tableHeight" :height="tableHeight"
stripe stripe
border border
v-loading="loading" v-loading="loading"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
>
<el-table-column type="selection" align="center" width="55">
</el-table-column>
<el-table-column
prop="index"
align="center"
label="#"
type="index"
width="50"
> >
</el-table-column> <el-table-column type="selection" align="center" width="55">
<el-table-column </el-table-column>
prop="vehicle_plate_text" <el-table-column
align="center" prop="index"
label="车牌号码" align="center"
> label="#"
</el-table-column> type="index"
<el-table-column width="50"
prop="plate_color_text" >
align="center" </el-table-column>
label="车牌颜色" <el-table-column
> prop="vehicle_plate_text"
</el-table-column> align="center"
<el-table-column label="车牌号码"
prop="vehicle_body_type_text" >
align="center" </el-table-column>
label="车辆类型" <el-table-column
> prop="plate_color_text"
</el-table-column> align="center"
<!-- <el-table-column label="车牌颜色"
>
</el-table-column>
<el-table-column
prop="vehicle_body_type_text"
align="center"
label="车辆类型"
>
</el-table-column>
<!-- <el-table-column
prop="vehicle_body_logo_text" prop="vehicle_body_logo_text"
align="center" align="center"
label="车辆品牌"> label="车辆品牌">
</el-table-column> --> </el-table-column> -->
<el-table-column <el-table-column
prop="vehicle_body_color_text" prop="vehicle_body_color_text"
align="center" align="center"
label="车辆颜色" label="车辆颜色"
> >
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
prop="RefinedFeature_text" prop="RefinedFeature_text"
align="center" align="center"
label="标识物"> label="标识物">
</el-table-column> --> </el-table-column> -->
<el-table-column prop="special_text" align="center" label="特殊车辆"> <el-table-column prop="special_text" align="center" label="特殊车辆">
</el-table-column> </el-table-column>
<el-table-column prop="shoot_date" align="center" label="抓拍时间"> <el-table-column prop="shoot_date" align="center" label="抓拍时间">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span> <span>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="location_name" align="center" label="抓拍地点"> <el-table-column prop="location_name" align="center" label="抓拍地点">
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip <el-tooltip
content="详情" content="详情"
placement="bottom" placement="bottom"
effect="light" effect="light"
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="el-icon-info editIcon" class="el-icon-info editIcon"
@click="detailFun(scope.$index, scope.row)" @click="detailFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span class="tableSpanBorder"></span>
<el-tooltip <el-tooltip
content="删除" content="删除"
placement="bottom" placement="bottom"
effect="light" effect="light"
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="el-icon-delete delIcon" class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)" @click="delFun(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div v-if="displaystatus == 'list'"> <div v-if="displaystatus == 'list'">
<div class="listbox" :style="{'height':tableHeight}"> <div class="listbox" :style="{ height: tableHeight }">
<div v-for="(item, index) in formatterData" :key="index" class="listboxitem" @click="detailFun(index,item)"> <div
v-for="(item, index) in formatterData"
:key="index"
class="listboxitem"
@click="detailFun(index, item)"
>
<div class="imgbox"> <div class="imgbox">
<img :src="item.pics[0].src_url" alt=""> <img :src="item.pics[0].src_url" alt="" />
</div> </div>
<div class="displayinfo"> <div class="displayinfo">
<el-form> <el-form>
<el-form-item label="车牌号码:"> <el-form-item label="车牌号码:">
<span>{{ item.vehicle_plate_text }}</span> <span>{{ item.vehicle_plate_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="车牌颜色:"> <el-form-item label="车牌颜色:">
<span>{{ item.plate_color_text }}</span> <span>{{ item.plate_color_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="车辆类型:"> <el-form-item label="车辆类型:">
<span>{{ item.vehicle_body_type_text }}</span> <span>{{ item.vehicle_body_type_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="车辆颜色:"> <el-form-item label="车辆颜色:">
<span>{{ item.vehicle_body_color_text }}</span> <span>{{ item.vehicle_body_color_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="特殊车辆:"> <el-form-item label="特殊车辆:">
<span>{{ item.special_text }}</span> <span>{{ item.special_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="抓拍时间:"> <el-form-item label="抓拍时间:">
<span>{{ <span
item.shoot_date ? item.shoot_date : "" >{{ item.shoot_date ? item.shoot_date : "" }}
}} {{ {{ item.shoot_time ? item.shoot_time : "" }}</span
item.shoot_time ? item.shoot_time : "" >
}}</span> </el-form-item>
</el-form-item> </el-form>
</el-form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="margin-top: 28px;"> <div style="margin-top: 28px">
<el-pagination <el-pagination
style="float: right;" style="float: right"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
...@@ -322,7 +326,7 @@ ...@@ -322,7 +326,7 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
...@@ -332,11 +336,11 @@ ...@@ -332,11 +336,11 @@
class="detailDialog" class="detailDialog"
width="1000px" width="1000px"
> >
<div style="position: relative;padding: 10px 20px;"> <div style="position: relative; padding: 10px 20px">
<!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> --> <!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> -->
<div class="detaiCon"> <div class="detaiCon">
<el-image <el-image
style="width: 100%;" style="width: 100%"
z-index="100" z-index="100"
:src="this.detailImg" :src="this.detailImg"
:preview-src-list="srcList" :preview-src-list="srcList"
...@@ -345,7 +349,7 @@ ...@@ -345,7 +349,7 @@
<img <img
:src="carImg" :src="carImg"
alt="" alt=""
style="width: 30%;display: block;margin: 0 auto;" style="width: 30%; display: block; margin: 0 auto"
/> />
</div> </div>
</el-image> </el-image>
...@@ -381,13 +385,15 @@ ...@@ -381,13 +385,15 @@
<el-form-item label="车身颜色:"> <el-form-item label="车身颜色:">
<span>{{ detailObj.vehicle_body_color_text }}</span> <span>{{ detailObj.vehicle_body_color_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="车辆速度:"> <el-form-item label="车辆速度:">
<span v-if="detailObj.event_data">{{ detailObj.event_data.speed?detailObj.event_data.speed:"0" }}</span> <span v-if="detailObj.event_data">{{
detailObj.event_data.speed ? detailObj.event_data.speed : "0"
}}</span>
</el-form-item> </el-form-item>
<el-form-item label="特殊车辆:"> <el-form-item label="特殊车辆:">
<span>{{ detailObj.special_text }}</span> <span>{{ detailObj.special_text }}</span>
</el-form-item> </el-form-item>
<!-- <el-form-item label="标志物:"> <!-- <el-form-item label="标志物:">
<span>{{ detailObj.RefinedFeature_text }}</span> <span>{{ detailObj.RefinedFeature_text }}</span>
</el-form-item> --> </el-form-item> -->
...@@ -407,6 +413,7 @@ ...@@ -407,6 +413,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getDataList } from "@/libs/utils";
export default { export default {
data() { data() {
let start_dt = this.yesterDay(); let start_dt = this.yesterDay();
...@@ -431,7 +438,7 @@ export default { ...@@ -431,7 +438,7 @@ export default {
task_id: "", task_id: "",
curdelid: "", curdelid: "",
special_type: "", special_type: "",
subtask_id: "" subtask_id: "",
}, },
loading: false, loading: false,
brandList: this.$buildCode.getCodeList("车辆品牌") || [], brandList: this.$buildCode.getCodeList("车辆品牌") || [],
...@@ -448,15 +455,16 @@ export default { ...@@ -448,15 +455,16 @@ export default {
currentIndex: 0, currentIndex: 0,
taskList: [], taskList: [],
subTaskList: [], subTaskList: [],
displaystatus:"table", displaystatus: "table",
tableHeight: window.twoSearchTableHeight tableHeight: window.twoSearchTableHeight,
imgUnidEnum: {},
}; };
}, },
watch: { watch: {
dates(val) { dates(val) {
this.conditions.start_dt = val[0]; this.conditions.start_dt = val[0];
this.conditions.end_dt = val[1]; this.conditions.end_dt = val[1];
} },
}, },
components: {}, components: {},
mounted() { mounted() {
...@@ -467,25 +475,25 @@ export default { ...@@ -467,25 +475,25 @@ export default {
indexFormatter(row, column, cellValue, index) { indexFormatter(row, column, cellValue, index) {
return index + (this.page - 1) * this.pageSize + 1; return index + (this.page - 1) * this.pageSize + 1;
}, },
dataDisplay(data){ dataDisplay(data) {
this.displaystatus = data this.displaystatus = data;
}, },
getTaskList() { getTaskList() {
this.$api.task this.$api.task
.getTask({ .getTask({
source_type: "pull_video_stream", source_type: "pull_video_stream",
task_type: "normal" task_type: "normal",
}) })
.then(res => { .then((res) => {
this.taskList = res.list_data; this.taskList = res.list_data;
this.taskList.unshift({ this.taskList.unshift({
task_id: "", task_id: "",
task_name: "全部" task_name: "全部",
}); });
}); });
}, },
getSubTask() { getSubTask() {
this.$api.task.getSubTask(this.conditions.task_id).then(res => { this.$api.task.getSubTask(this.conditions.task_id).then((res) => {
if (res.list_data == null) { if (res.list_data == null) {
this.subTaskList = []; this.subTaskList = [];
} else { } else {
...@@ -493,13 +501,13 @@ export default { ...@@ -493,13 +501,13 @@ export default {
} }
this.subTaskList.unshift({ this.subTaskList.unshift({
subtask_id: "", subtask_id: "",
subtask_name: "全部" subtask_name: "全部",
}); });
this.conditions.subtask_id = ""; this.conditions.subtask_id = "";
}); });
}, },
exportFun() { exportFun() {
this.$logs.oplogs({},'serv_serarch',`过车事件导出`); this.$logs.oplogs({}, "serv_serarch", `过车事件导出`);
window.open( window.open(
encodeURI( encodeURI(
process.env.VUE_APP_URL + process.env.VUE_APP_URL +
...@@ -536,7 +544,7 @@ export default { ...@@ -536,7 +544,7 @@ export default {
if (this.selectcheck.length == 0) { if (this.selectcheck.length == 0) {
this.$message({ this.$message({
message: "请选择至少一条记录", message: "请选择至少一条记录",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -544,19 +552,23 @@ export default { ...@@ -544,19 +552,23 @@ export default {
this.$confirm("此操作将永久删除选中记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除选中记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.patchdel({ .patchdel({
event_unids: this.selectcheck event_unids: this.selectcheck,
}) })
.then(res => { .then((res) => {
if (res.ecode == "200") { if (res.ecode == "200") {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`过车事件批量删除了${this.selectcheck.length}条`); this.$logs.oplogs(
res,
"serv_serarch",
`过车事件批量删除了${this.selectcheck.length}条`
);
this.getData(); this.getData();
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
...@@ -568,12 +580,12 @@ export default { ...@@ -568,12 +580,12 @@ export default {
if (this.currentIndex - 1 < 0) { if (this.currentIndex - 1 < 0) {
this.$message({ this.$message({
message: "目前为第一条", message: "目前为第一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
this.detailObj = this.formatterData[this.currentIndex - 1]; this.detailObj = this.formatterData[this.currentIndex - 1];
console.log( this.detailObj ); console.log(this.detailObj);
this.currentIndex -= 1; this.currentIndex -= 1;
this.getImg(this.detailObj.pics[0].pic_unid); this.getImg(this.detailObj.pics[0].pic_unid);
}, },
...@@ -581,7 +593,7 @@ export default { ...@@ -581,7 +593,7 @@ export default {
if (this.currentIndex == this.formatterData.length - 1) { if (this.currentIndex == this.formatterData.length - 1) {
this.$message({ this.$message({
message: "目前为最后一条", message: "目前为最后一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -591,7 +603,7 @@ export default { ...@@ -591,7 +603,7 @@ export default {
}, },
handleSelectionChange(obj) { handleSelectionChange(obj) {
this.selectcheck = []; this.selectcheck = [];
obj.forEach(item => { obj.forEach((item) => {
this.selectcheck.push(item.id); this.selectcheck.push(item.id);
}); });
}, },
...@@ -630,31 +642,28 @@ export default { ...@@ -630,31 +642,28 @@ export default {
event_type: "", event_type: "",
special_type: this.conditions.special_type, special_type: this.conditions.special_type,
task_id: this.conditions.task_id, task_id: this.conditions.task_id,
subtask_id: this.conditions.subtask_id subtask_id: this.conditions.subtask_id,
}; };
this.$api.search getDataList(search_params)
.tableList(search_params) .then((res) => {
.then(res => {
this.total = res.total_num; this.total = res.total_num;
res.list_data.forEach((item, index) => { this.formatterData = res.formatterData;
this.formatterData.push(this.$buildCode.init(item));
});
this.loading = false; this.loading = false;
this.$logs.oplogs(res,'serv_serarch',`过车事件查询`); this.$logs.oplogs(res, "serv_serarch", `过车事件查询`);
}) })
.catch(err => {}); .catch((err) => {});
}, },
getImg(unid) { getImg(unid) {
this.srcList = []; this.srcList = [];
this.$api.search this.$api.search
.detailImg({}, unid) .detailImg({}, unid)
.then(res => { .then((res) => {
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg; this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
this.srcList.push(this.detailImg); this.srcList.push(this.detailImg);
}) })
.catch(e => {}); .catch((e) => {});
}, },
detailFun(index, row) { detailFun(index, row) {
this.currentIndex = index; this.currentIndex = index;
if (row.pics.length > 0) { if (row.pics.length > 0) {
...@@ -667,24 +676,24 @@ export default { ...@@ -667,24 +676,24 @@ export default {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delVehicle({}, row.id) .delVehicle({}, row.id)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.formatterData.splice(index); this.formatterData.splice(index);
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.getData(); this.getData();
this.$logs.oplogs(res,'serv_serarch',`过车事件删除`); this.$logs.oplogs(res, "serv_serarch", `过车事件删除`);
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
...@@ -693,11 +702,11 @@ export default { ...@@ -693,11 +702,11 @@ export default {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delVehicle({}, this.detailObj.id) .delVehicle({}, this.detailObj.id)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.formatterData.splice(this.currentIndex, 1); this.formatterData.splice(this.currentIndex, 1);
this.detailObj = Object.assign( this.detailObj = Object.assign(
...@@ -709,28 +718,28 @@ export default { ...@@ -709,28 +718,28 @@ export default {
); );
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`过车事件删除`); this.$logs.oplogs(res, "serv_serarch", `过车事件删除`);
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
} },
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.imgaddbtn{ .imgaddbtn {
position: absolute; position: absolute;
z-index: 2000; z-index: 2000;
height: 200px; height: 200px;
width: 200px; width: 200px;
top:0; top: 0;
left: 0; left: 0;
background: red; background: red;
} }
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
v-show="conditions.event_type == 'xcycle'" v-show="conditions.event_type == 'xcycle'"
> >
<span class="inputBox"> <span class="inputBox">
<el-select <el-select
filterable filterable
placeholder="请选择" placeholder="请选择"
:popper-append-to-body="false" :popper-append-to-body="false"
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</el-form> </el-form>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px; padding-top: 3px">
<el-button type="primary" style="" @click="query" class="block" <el-button type="primary" style="" @click="query" class="block"
>查询</el-button >查询</el-button
> >
...@@ -268,151 +268,161 @@ ...@@ -268,151 +268,161 @@
<i class="el-icon-tickets" @click="dataDisplay('table')"></i> <i class="el-icon-tickets" @click="dataDisplay('table')"></i>
</div> </div>
<div v-if="displaystatus == 'table'"> <div v-if="displaystatus == 'table'">
<el-table <el-table
:data="formatterData" :data="formatterData"
v-loading="loading" v-loading="loading"
:height="tableHeight" :height="tableHeight"
stripe stripe
border border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
>
<el-table-column type="selection" align="center" width="55">
</el-table-column>
<el-table-column
prop="index"
align="center"
label="#"
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="xcycle_type_text"
align="center"
label="检测类型"
>
</el-table-column>
<el-table-column prop="driver_face_sex" align="center" label="性别">
</el-table-column>
<el-table-column
v-if="conditions.event_type == 'xcycle'"
prop="driver_face_with_hats"
align="center"
label="是否带盔"
>
</el-table-column>
<el-table-column
v-if="conditions.event_type == 'pedestrian'"
prop="driver_face_with_hats"
align="center"
label="是否带帽"
>
</el-table-column>
<el-table-column
v-if="conditions.event_type == 'pedestrian'"
prop="driver_face_upbody_text"
align="center"
label="上身颜色"
>
</el-table-column>
<el-table-column
v-if="conditions.event_type == 'pedestrian'"
prop="driver_face_lobody_text"
align="center"
label="下身颜色"
>
</el-table-column>
<el-table-column
v-if="conditions.event_type == 'xcycle'"
prop="xcycle_plate_text"
align="center"
label="车牌号码"
> >
</el-table-column> <el-table-column type="selection" align="center" width="55">
<el-table-column </el-table-column>
v-if="conditions.event_type == 'xcycle'" <el-table-column
prop="company" prop="index"
align="center" align="center"
label="运营公司" label="#"
> type="index"
</el-table-column> width="50"
<el-table-column prop="shoot_date" align="center" label="抓拍时间"> >
<template slot-scope="scope"> </el-table-column>
<span>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span> <el-table-column
</template> prop="xcycle_type_text"
</el-table-column> align="center"
<el-table-column prop="location_name" align="center" label="抓拍地点"> label="检测类型"
</el-table-column> >
<el-table-column align="center" label="操作"> </el-table-column>
<template slot-scope="scope"> <el-table-column prop="driver_face_sex" align="center" label="性别">
<el-tooltip </el-table-column>
content="详情" <el-table-column
placement="bottom" v-if="conditions.event_type == 'xcycle'"
effect="light" prop="driver_face_with_hats"
:visible-arrow="false" align="center"
> label="是否带盔"
<span >
class="el-icon-info editIcon" </el-table-column>
@click="detailFun(scope.$index, scope.row)" <el-table-column
></span> v-if="conditions.event_type == 'pedestrian'"
</el-tooltip> prop="driver_face_with_hats"
<span class="tableSpanBorder"></span> align="center"
<el-tooltip label="是否带帽"
content="删除" >
placement="bottom" </el-table-column>
effect="light" <el-table-column
:visible-arrow="false" v-if="conditions.event_type == 'pedestrian'"
> prop="driver_face_upbody_text"
<span align="center"
class="el-icon-delete delIcon" label="上身颜色"
@click="delFun(scope.$index, scope.row)" >
></span> </el-table-column>
</el-tooltip> <el-table-column
</template> v-if="conditions.event_type == 'pedestrian'"
</el-table-column> prop="driver_face_lobody_text"
</el-table> align="center"
</div> label="下身颜色"
<div v-if="displaystatus == 'list'"> >
<div class="listbox" :style="{'height':tableHeight}"> </el-table-column>
<div v-for="(item, index) in formatterData" :key="index" class="listboxitem" @click="detailFun(index,item)"> <el-table-column
v-if="conditions.event_type == 'xcycle'"
prop="xcycle_plate_text"
align="center"
label="车牌号码"
>
</el-table-column>
<el-table-column
v-if="conditions.event_type == 'xcycle'"
prop="company"
align="center"
label="运营公司"
>
</el-table-column>
<el-table-column prop="shoot_date" align="center" label="抓拍时间">
<template slot-scope="scope">
<span>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span>
</template>
</el-table-column>
<el-table-column prop="location_name" align="center" label="抓拍地点">
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-tooltip
content="详情"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="el-icon-info editIcon"
@click="detailFun(scope.$index, scope.row)"
></span>
</el-tooltip>
<span class="tableSpanBorder"></span>
<el-tooltip
content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="el-icon-delete delIcon"
@click="delFun(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<div v-if="displaystatus == 'list'">
<div class="listbox" :style="{ height: tableHeight }">
<div
v-for="(item, index) in formatterData"
:key="index"
class="listboxitem"
@click="detailFun(index, item)"
>
<div class="imgbox"> <div class="imgbox">
<img :src="item.pics[0].src_url" alt=""> <img :src="item.pics[0].src_url" alt="" />
</div> </div>
<div class="displayinfo"> <div class="displayinfo">
<el-form> <el-form>
<el-form-item label="检测类型:"> <el-form-item label="检测类型:">
<span>{{ item.xcycle_type_text }}</span> <span>{{ item.xcycle_type_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="性别:"> <el-form-item label="性别:">
<span>{{ item.driver_face_sex }}</span> <span>{{ item.driver_face_sex }}</span>
</el-form-item> </el-form-item>
<el-form-item label="是否带头盔:" v-if="item.event_type == 'xcycle'"> <el-form-item
label="是否带头盔:"
v-if="item.event_type == 'xcycle'"
>
<span>{{ item.driver_face_with_hats }}</span> <span>{{ item.driver_face_with_hats }}</span>
</el-form-item> </el-form-item>
<el-form-item label="是否带头盔:" v-if="item.event_type == 'pedestrian'"> <el-form-item
label="是否带头盔:"
v-if="item.event_type == 'pedestrian'"
>
<span>{{ item.driver_face_with_hats }}</span> <span>{{ item.driver_face_with_hats }}</span>
</el-form-item> </el-form-item>
<el-form-item label="运营公司:"> <el-form-item label="运营公司:">
<span>{{ item.company }}</span> <span>{{ item.company }}</span>
</el-form-item> </el-form-item>
<el-form-item label="经过日期:"> <el-form-item label="经过日期:">
<span>{{ <span
item.shoot_date ? item.shoot_date : "" >{{ item.shoot_date ? item.shoot_date : "" }}
}} {{ {{ item.shoot_time ? item.shoot_time : "" }}</span
item.shoot_time ? item.shoot_time : "" >
}}</span>
</el-form-item> </el-form-item>
<el-form-item label="经过地点:"> <el-form-item label="经过地点:">
<span>{{ item.location_name }}</span> <span>{{ item.location_name }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="margin-top: 28px;"> <div style="margin-top: 28px">
<el-pagination <el-pagination
style="float: right;" style="float: right"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
...@@ -424,7 +434,7 @@ ...@@ -424,7 +434,7 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
...@@ -434,15 +444,15 @@ ...@@ -434,15 +444,15 @@
class="detailDialog" class="detailDialog"
width="1000px" width="1000px"
> >
<div style="position: relative;padding: 10px 20px;"> <div style="position: relative; padding: 10px 20px">
<!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> --> <!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> -->
<div class="detaiCon"> <div class="detaiCon">
<el-image style="width: 100%;" :src="this.detailImg"> <el-image style="width: 100%" :src="this.detailImg">
<div slot="error" class="image-slot"> <div slot="error" class="image-slot">
<img <img
:src="carImg" :src="carImg"
alt="" alt=""
style="width: 36%;display: block;margin: 0 auto;" style="width: 36%; display: block; margin: 0 auto"
/> />
</div> </div>
</el-image> </el-image>
...@@ -504,6 +514,7 @@ ...@@ -504,6 +514,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getDataList } from "@/libs/utils";
export default { export default {
data() { data() {
let start_dt = this.yesterDay(); let start_dt = this.yesterDay();
...@@ -512,7 +523,7 @@ export default { ...@@ -512,7 +523,7 @@ export default {
detailObj: {}, detailObj: {},
carImg: require("@/assets/img/home/defaultImg.png"), carImg: require("@/assets/img/home/defaultImg.png"),
bodyColorList: this.$buildCode.getCodeList("车身颜色"), bodyColorList: this.$buildCode.getCodeList("车身颜色"),
companyList: this.$buildCode.getCodeList("外卖公司"), companyList: this.$buildCode.getCodeList("运营公司"),
detailImg: "", detailImg: "",
detailVisible: false, detailVisible: false,
loading: false, loading: false,
...@@ -529,7 +540,7 @@ export default { ...@@ -529,7 +540,7 @@ export default {
with_hats: "", with_hats: "",
plate: "", plate: "",
upbodyColor: "", upbodyColor: "",
lobodyColor: "" lobodyColor: "",
}, },
brandList: this.$buildCode.getCodeList("车辆品牌"), brandList: this.$buildCode.getCodeList("车辆品牌"),
vehicleTypeList: this.$buildCode.getCodeList("车辆类型"), vehicleTypeList: this.$buildCode.getCodeList("车辆类型"),
...@@ -542,16 +553,16 @@ export default { ...@@ -542,16 +553,16 @@ export default {
selectcheck: [], selectcheck: [],
currentIndex: 0, currentIndex: 0,
taskList: [], taskList: [],
displaystatus:'table', displaystatus: "table",
subTaskList: [], subTaskList: [],
tableHeight: window.twoSearchTableHeight tableHeight: window.twoSearchTableHeight,
}; };
}, },
watch: { watch: {
dates(val) { dates(val) {
this.conditions.start_dt = val[0]; this.conditions.start_dt = val[0];
this.conditions.end_dt = val[1]; this.conditions.end_dt = val[1];
} },
}, },
components: {}, components: {},
mounted() { mounted() {
...@@ -562,25 +573,25 @@ export default { ...@@ -562,25 +573,25 @@ export default {
indexFormatter(row, column, cellValue, index) { indexFormatter(row, column, cellValue, index) {
return index + (this.page - 1) * this.pageSize + 1; return index + (this.page - 1) * this.pageSize + 1;
}, },
dataDisplay(data){ dataDisplay(data) {
this.displaystatus = data this.displaystatus = data;
}, },
getTaskList() { getTaskList() {
this.$api.task this.$api.task
.getTask({ .getTask({
source_type: "pull_video_stream", source_type: "pull_video_stream",
task_type: "normal" task_type: "normal",
}) })
.then(res => { .then((res) => {
this.taskList = res.list_data; this.taskList = res.list_data;
this.taskList.unshift({ this.taskList.unshift({
task_id: "", task_id: "",
task_name: "全部" task_name: "全部",
}); });
}); });
}, },
getSubTask() { getSubTask() {
this.$api.task.getSubTask(this.conditions.task_id).then(res => { this.$api.task.getSubTask(this.conditions.task_id).then((res) => {
if (res.list_data == null) { if (res.list_data == null) {
this.subTaskList = []; this.subTaskList = [];
} else { } else {
...@@ -588,7 +599,7 @@ export default { ...@@ -588,7 +599,7 @@ export default {
} }
this.subTaskList.unshift({ this.subTaskList.unshift({
subtask_id: "", subtask_id: "",
subtask_name: "全部" subtask_name: "全部",
}); });
this.conditions.subtask_id = ""; this.conditions.subtask_id = "";
}); });
...@@ -655,14 +666,14 @@ export default { ...@@ -655,14 +666,14 @@ export default {
"&lobodyColor=" + "&lobodyColor=" +
this.conditions.lobodyColor; this.conditions.lobodyColor;
} }
this.$logs.oplogs({},'serv_serarch',`行人非机动车导出`); this.$logs.oplogs({}, "serv_serarch", `行人非机动车导出`);
window.open(encodeURI(url)); window.open(encodeURI(url));
}, },
batchdel() { batchdel() {
if (this.selectcheck.length == 0) { if (this.selectcheck.length == 0) {
this.$message({ this.$message({
message: "请选择至少一条记录", message: "请选择至少一条记录",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -670,19 +681,23 @@ export default { ...@@ -670,19 +681,23 @@ export default {
this.$confirm("此操作将永久删除选中记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除选中记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.patchdel({ .patchdel({
event_unids: this.selectcheck event_unids: this.selectcheck,
}) })
.then(res => { .then((res) => {
if (res.ecode == "200") { if (res.ecode == "200") {
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`行人非机动车批量删除了${this.selectcheck.length}条`); this.$logs.oplogs(
res,
"serv_serarch",
`行人非机动车批量删除了${this.selectcheck.length}条`
);
this.getData(); this.getData();
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
...@@ -694,7 +709,7 @@ export default { ...@@ -694,7 +709,7 @@ export default {
if (this.currentIndex - 1 < 0) { if (this.currentIndex - 1 < 0) {
this.$message({ this.$message({
message: "目前为第一条", message: "目前为第一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -706,7 +721,7 @@ export default { ...@@ -706,7 +721,7 @@ export default {
if (this.currentIndex == this.formatterData.length - 1) { if (this.currentIndex == this.formatterData.length - 1) {
this.$message({ this.$message({
message: "目前为最后一条", message: "目前为最后一条",
type: "warning" type: "warning",
}); });
return false; return false;
} }
...@@ -716,7 +731,7 @@ export default { ...@@ -716,7 +731,7 @@ export default {
}, },
handleSelectionChange(obj) { handleSelectionChange(obj) {
this.selectcheck = []; this.selectcheck = [];
obj.forEach(item => { obj.forEach((item) => {
this.selectcheck.push(item.id); this.selectcheck.push(item.id);
}); });
}, },
...@@ -749,7 +764,7 @@ export default { ...@@ -749,7 +764,7 @@ export default {
subtask_id: this.conditions.subtask_id, subtask_id: this.conditions.subtask_id,
event_type: this.conditions.event_type, event_type: this.conditions.event_type,
sex: this.conditions.sex, sex: this.conditions.sex,
with_hats: this.conditions.with_hats with_hats: this.conditions.with_hats,
}; };
if (this.conditions.event_type == "xcycle") { if (this.conditions.event_type == "xcycle") {
search_params.xcycle_type = this.conditions.xcycle_type; search_params.xcycle_type = this.conditions.xcycle_type;
...@@ -759,25 +774,22 @@ export default { ...@@ -759,25 +774,22 @@ export default {
search_params.upbodyColor = this.conditions.upbodyColor; search_params.upbodyColor = this.conditions.upbodyColor;
search_params.lobodyColor = this.conditions.lobodyColor; search_params.lobodyColor = this.conditions.lobodyColor;
} }
this.$api.search getDataList(search_params)
.tableList(search_params) .then((res) => {
.then(res => {
this.total = res.total_num; this.total = res.total_num;
res.list_data.forEach((item, index) => { this.formatterData = res.formatterData;
this.formatterData.push(this.$buildCode.init(item));
});
this.loading = false; this.loading = false;
this.$logs.oplogs(res,'serv_serarch',`行人非机动车查询`); this.$logs.oplogs(res, "serv_serarch", `行人非机动车查询`);
}) })
.catch(err => {}); .catch((err) => {});
}, },
getImg(unid) { getImg(unid) {
this.$api.search this.$api.search
.detailImg({}, unid) .detailImg({}, unid)
.then(res => { .then((res) => {
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg; this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
}) })
.catch(e => {}); .catch((e) => {});
}, },
detailFun(index, row) { detailFun(index, row) {
this.currentIndex = index; this.currentIndex = index;
...@@ -791,24 +803,24 @@ export default { ...@@ -791,24 +803,24 @@ export default {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delVehicle({}, row.id) .delVehicle({}, row.id)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.formatterData.splice(index); this.formatterData.splice(index);
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.getData(); this.getData();
this.$logs.oplogs(res,'serv_serarch',`行人非机动车删除`); this.$logs.oplogs(res, "serv_serarch", `行人非机动车删除`);
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
...@@ -817,11 +829,11 @@ export default { ...@@ -817,11 +829,11 @@ export default {
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.search this.$api.search
.delVehicle({}, this.detailObj.id) .delVehicle({}, this.detailObj.id)
.then(res => { .then((res) => {
if (res.ecode == 200) { if (res.ecode == 200) {
this.formatterData.splice(this.currentIndex, 1); this.formatterData.splice(this.currentIndex, 1);
this.detailObj = Object.assign( this.detailObj = Object.assign(
...@@ -833,19 +845,19 @@ export default { ...@@ -833,19 +845,19 @@ export default {
); );
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!",
}); });
this.$logs.oplogs(res,'serv_serarch',`行人非机动车删除`); this.$logs.oplogs(res, "serv_serarch", `行人非机动车删除`);
} else { } else {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
} }
}) })
.catch(e => { .catch((e) => {
this.$message.error("删除失败!"); this.$message.error("删除失败!");
}); });
}); });
} },
} },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
prop="task_name" prop="task_name"
class="form-item" class="form-item"
:rules="[ :rules="[
{ required: true, message: '请输入任务名称', trigger: 'blur' } { required: true, message: '请输入任务名称', trigger: 'blur' },
]" ]"
> >
<el-input <el-input
...@@ -38,14 +38,12 @@ ...@@ -38,14 +38,12 @@
:popper-append-to-body="false" :popper-append-to-body="false"
:disabled="pedittype == 'edit'" :disabled="pedittype == 'edit'"
> >
<el-option value="" label="--"></el-option> <el-option
<el-option value="0" label="交通"></el-option> v-for="(item, index) in algorTypeList"
<el-option value="1" label="客流"></el-option> :key="index"
<el-option value="2" label="安防"></el-option> :value="item.value"
<el-option value="2" label="行为分析"></el-option> :label="item.name"
<el-option value="12" label="行为分析_BG"></el-option> ></el-option>
<el-option value="3" label="违停"></el-option>
<el-option value="5" label="交通行人"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="场景占用" class="form-item" prop="resource_use"> <el-form-item label="场景占用" class="form-item" prop="resource_use">
...@@ -82,7 +80,7 @@ ...@@ -82,7 +80,7 @@
></el-date-picker> --> ></el-date-picker> -->
<el-time-picker <el-time-picker
is-range is-range
style="width:100%" style="width: 100%"
value-format="HH:mm:ss" value-format="HH:mm:ss"
v-model="timer" v-model="timer"
range-separator="至" range-separator="至"
...@@ -144,6 +142,7 @@ ...@@ -144,6 +142,7 @@
</template> </template>
<script> <script>
import { algorTypeList } from "@/enum/index";
export default { export default {
data() { data() {
var checkStore = (rule, value, callback) => { var checkStore = (rule, value, callback) => {
...@@ -157,44 +156,45 @@ export default { ...@@ -157,44 +156,45 @@ export default {
setvisible: false, setvisible: false,
timer: ["00:00:00", "23:59:59"], timer: ["00:00:00", "23:59:59"],
backpdata: "", backpdata: "",
headertitle:"添加任务", headertitle: "添加任务",
formData: { formData: {
task_name: "", task_name: "",
task_algo_type: 0, task_algo_type: 0,
is_send: 0, is_send: 0,
store_conf: { store_conf: {
unid: "" unid: "",
}, },
priority: "normal", priority: "normal",
period: true period: true,
}, },
pedittype:"add", pedittype: "add",
vchanAry: [], vchanAry: [],
platT: [], platT: [],
sessionData: {}, sessionData: {},
store_confs: [], store_confs: [],
algorTypeList: algorTypeList,
rules: { rules: {
task_algo_type: [ task_algo_type: [
{ required: true, message: "请选择算法类型", trigger: "change" } { required: true, message: "请选择算法类型", trigger: "change" },
], ],
stores: [ stores: [
{ required: true, message: "存储配置不能为空!", trigger: "change" } { required: true, message: "存储配置不能为空!", trigger: "change" },
], ],
resource_use: [ resource_use: [
{ required: true, message: "场景占用不能为空!", trigger: "change" } { required: true, message: "场景占用不能为空!", trigger: "change" },
], ],
store_conf_unid: [ store_conf_unid: [
{ required: true, validator: checkStore, trigger: "change" } { required: true, validator: checkStore, trigger: "change" },
] ],
} },
}; };
}, },
props: { props: {
freeList: { freeList: {
type: Array, type: Array,
// eslint-disable-next-line vue/require-valid-default-prop // eslint-disable-next-line vue/require-valid-default-prop
default: [] default: [],
} },
}, },
watch: {}, watch: {},
mounted() {}, mounted() {},
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
if (this.freeList && this.freeList.length > 0) { if (this.freeList && this.freeList.length > 0) {
var freeArr = []; var freeArr = [];
let that = this; let that = this;
this.freeList.forEach(ele => { this.freeList.forEach((ele) => {
if (ele.license_info && ele.license_info.platType) { if (ele.license_info && ele.license_info.platType) {
if (that.platT.length == 0) { if (that.platT.length == 0) {
that.platT.push(ele.license_info.platType); that.platT.push(ele.license_info.platType);
...@@ -228,23 +228,23 @@ export default { ...@@ -228,23 +228,23 @@ export default {
this.platT = []; this.platT = [];
this.setvisible = true; this.setvisible = true;
if (type == "add") { if (type == "add") {
this.headertitle = "新建任务" this.headertitle = "新建任务";
//timer单独拿到form外层是因为element一个bug放到内层后不能修改时间 //timer单独拿到form外层是因为element一个bug放到内层后不能修改时间
this.timer = ["00:00:00", "23:59:59"]; this.timer = ["00:00:00", "23:59:59"];
this.formData = { this.formData = {
task_name: "", task_name: "",
task_algo_type: "0", task_algo_type: "0",
store_conf: { store_conf: {
unid: "" unid: "",
}, },
priority: "normal", priority: "normal",
plate_type: "", plate_type: "",
plate_time: "", plate_time: "",
period: true period: true,
}; };
} }
if (type == "edit") { if (type == "edit") {
this.headertitle = "修改任务" this.headertitle = "修改任务";
this.pedittype = type; this.pedittype = type;
if (pdata.start_time) { if (pdata.start_time) {
let startT = pdata.start_time; let startT = pdata.start_time;
...@@ -255,7 +255,7 @@ export default { ...@@ -255,7 +255,7 @@ export default {
} }
this.formData = JSON.parse(JSON.stringify(pdata)); this.formData = JSON.parse(JSON.stringify(pdata));
this.backpdata = 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 ary = [];
let data = res.list_data; let data = res.list_data;
for (let i in data) { for (let i in data) {
...@@ -266,7 +266,7 @@ export default { ...@@ -266,7 +266,7 @@ export default {
data.vchan = { data.vchan = {
subtask_id: data[i].subtask_id, subtask_id: data[i].subtask_id,
refid: "", refid: "",
vchan_name: data[i].subtask_name vchan_name: data[i].subtask_name,
}; };
} }
ary.push(data[i].vchan); ary.push(data[i].vchan);
...@@ -305,7 +305,7 @@ export default { ...@@ -305,7 +305,7 @@ export default {
plate_type: this.formData.plate_type, plate_type: this.formData.plate_type,
resource_use: this.formData.resource_use, resource_use: this.formData.resource_use,
task_type: "normal", task_type: "normal",
enable_status: true enable_status: true,
// algo_comb_unid: this.formData.store_conf, // algo_comb_unid: this.formData.store_conf,
}; };
...@@ -321,24 +321,28 @@ export default { ...@@ -321,24 +321,28 @@ export default {
} }
}, },
addTask(data) { addTask(data) {
this.$refs["taskForm"].validate(valid => { this.$refs["taskForm"].validate((valid) => {
if (valid) { if (valid) {
this.$api.task this.$api.task
.addTask(data, { .addTask(data, {
"content-type": "multipart/form-data" "content-type": "multipart/form-data",
}) })
.then(res => { .then((res) => {
if (res.ecode && res.ecode != 500) { if (res.ecode && res.ecode != 500) {
this.setvisible = false; this.setvisible = false;
this.$emit("refresh"); this.$emit("refresh");
} else { } else {
this.$message({ this.$message({
message: res.enote, message: res.enote,
type: "error" type: "error",
}); });
} }
debugger debugger;
this.$logs.oplogs(res,'serv_task',`添加任务${this.formData.task_name}`); this.$logs.oplogs(
res,
"serv_task",
`添加任务${this.formData.task_name}`
);
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
...@@ -347,21 +351,21 @@ export default { ...@@ -347,21 +351,21 @@ export default {
}, },
editTask(data) { editTask(data) {
data.is_send = this.sendstatus(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") { if (res.ecode == "200") {
this.setvisible = false; this.setvisible = false;
this.$emit("refresh"); this.$emit("refresh");
this.$message({ this.$message({
message: res.enote, message: res.enote,
type: "success" type: "success",
}); });
} else { } else {
this.$message({ this.$message({
message: res.enote, 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) { sendstatus(data) {
...@@ -382,22 +386,21 @@ export default { ...@@ -382,22 +386,21 @@ export default {
getStore() { getStore() {
let params = { let params = {
offset: 0, offset: 0,
limit: "" limit: "",
}; };
this.$api.device.getStore(params).then(res => { this.$api.device.getStore(params).then((res) => {
this.store_confs = res.list_data; this.store_confs = res.list_data;
}); });
}, },
}, },
created() { created() {
this.getStore(); this.getStore();
},
}
}; };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
.form-item { .form-item {
margin-bottom 13px margin-bottom: 13px;
} }
</style> </style>
...@@ -156,6 +156,14 @@ export default { ...@@ -156,6 +156,14 @@ export default {
tableData: [], tableData: [],
zNodes: [ zNodes: [
{ {
name: "视频云设备",
id: "-1",
count: 500,
times: 1,
isParent: true,
dev_unid: this.dev_unid,
},
{
name: "外部设备", name: "外部设备",
id: "0", id: "0",
count: 500, count: 500,
...@@ -347,11 +355,26 @@ export default { ...@@ -347,11 +355,26 @@ export default {
} else if (parentNode.name === "内部设备") { } else if (parentNode.name === "内部设备") {
let vchans = childNodes.vchan_struct || childNodes.list_data; let vchans = childNodes.vchan_struct || childNodes.list_data;
treenode = vchans treenode = vchans
} else { } else if (parentNode.name === "外部设备") {
treenode = childNodes.result.childs; treenode = childNodes.result.childs;
} else if (parentNode.name === "视频云设备") {
this.dealCloudTree(childNodes.data);
treenode = childNodes.data;
console.log('childNodes', childNodes);
} }
return treenode; 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) { showModal(val) {
this.taskData = val; this.taskData = val;
this.tableData = []; this.tableData = [];
...@@ -426,6 +449,7 @@ export default { ...@@ -426,6 +449,7 @@ export default {
let status = true; let status = true;
let subData = []; let subData = [];
this.tableData.map((e) => { this.tableData.map((e) => {
console.log(e);
let vchan = e; let vchan = e;
let data = { let data = {
is_dome: false, is_dome: false,
...@@ -435,10 +459,11 @@ export default { ...@@ -435,10 +459,11 @@ export default {
vchan_duid: vchan.duid || vchan.vchan_duid, vchan_duid: vchan.duid || vchan.vchan_duid,
vdev_unid: this.dev_unid, vdev_unid: this.dev_unid,
vchan_name: vchan.name, vchan_name: vchan.name,
vchan_type: vchan.vchan_type || ""
}, },
assign_to: { assign_to: {
id: this.taskData.plate_type, id: this.taskData.plate_type,
flag: 1, flag: 1
}, },
}; };
subData.push(data); subData.push(data);
...@@ -555,10 +580,18 @@ export default { ...@@ -555,10 +580,18 @@ export default {
} }
}); });
}, },
serchVchan(){ async serchVchan(){
if(this.searchText == '') { if(this.searchText == '') {
var zNodes = [ var zNodes = [
{ {
name: "视频云设备",
id: "-1",
count: 500,
times: 1,
isParent: true,
dev_unid: this.dev_unid,
},
{
name: "外部设备", name: "外部设备",
id: "0", id: "0",
count: 500, count: 500,
...@@ -584,24 +617,25 @@ export default { ...@@ -584,24 +617,25 @@ export default {
}, },
] ]
var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, zNodes); var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, zNodes);
return return;
} }
this.$api.resource.getcatalogs({vchan_name_like:this.searchText }).then(res => { var params = {
this.$api.device.getDevtreeLike(this.dev_unid,'内部设备',{vchan_name_like:this.searchText }).then(camerares => { vchan_name_like: this.searchText
this.$api.device.getDevtreeLike(this.dev_unid,'短视频',{vchan_name_like:this.searchText }).then(vchanres => { };
setTimeout(() => { const res = await this.$api.resource.getcatalogs(params);
this.zNodes[0].childs = res.result?res.result.childs:[] const camerares = await this.$api.device.getDevtreeLike(this.dev_unid,'内部设备', params);
this.zNodes[1].childs = camerares.vchan_struct const vchanres = await this.$api.device.getDevtreeLike(this.dev_unid,'短视频', params);
this.zNodes[2].childs = vchanres.list_data const cloudres = await this.$api.device.getCloudDev(params);
var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes); this.dealCloudTree(cloudres.data);
ztree.expandAll(true) setTimeout(() => {
this.checkvckan() this.zNodes[0].childs = cloudres?cloudres.data:[];
}, 10); 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();
}, 10);
}, },
rowclick(row) { rowclick(row) {
//播放视频 //播放视频
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<div style="padding: 20px 15px 20px 23px;"> <div style="padding: 20px 15px 20px 23px">
<span class="inputBox"> <span class="inputBox">
<el-input v-model="task_name" placeholder="请输入任务名称"></el-input> <el-input v-model="task_name" placeholder="请输入任务名称"></el-input>
</span> </span>
...@@ -53,27 +53,31 @@ ...@@ -53,27 +53,31 @@
placeholder="请选择" placeholder="请选择"
:popper-append-to-body="false" :popper-append-to-body="false"
> >
<el-option value="" label="全部"></el-option> <el-option
<el-option value="0" label="交通"></el-option> v-for="(item, index) in algorTypeList"
<el-option value="1" label="客流"></el-option> :key="index"
<el-option value="12" label="行为分析"></el-option> :value="item.value"
<el-option value="7" label="综合流量"></el-option> :label="item.name"
<!-- <el-option value="4" label='人脸'></el-option> --> ></el-option>
</el-select> </el-select>
</span> </span>
<el-button <el-button
type="primary" type="primary"
style="position: relative;top: -2px;" style="position: relative; top: -2px"
@click="query" @click="query"
>查询</el-button >查询</el-button
> >
<span style="float: right;"> <span style="float: right">
<el-button type="info" icon="el-icon-plus" style="padding: 7px 16px" @click="editTask('add')" <el-button
type="info"
icon="el-icon-plus"
style="padding: 7px 16px"
@click="editTask('add')"
>新建任务</el-button >新建任务</el-button
> >
</span> </span>
</div> </div>
<div style="padding: 0 23px 20px 23px;width:98%"> <div style="padding: 0 23px 20px 23px; width: 98%">
<el-table <el-table
height="59vh" height="59vh"
:data="tableData" :data="tableData"
...@@ -192,7 +196,7 @@ ...@@ -192,7 +196,7 @@
'icon-fanxing-qidong': true, 'icon-fanxing-qidong': true,
playIcon: true, playIcon: true,
noplayicon: noplayicon:
scope.row.status == 'NotInTimeOfDay' ? false : false scope.row.status == 'NotInTimeOfDay' ? false : false,
}" }"
@click="setTaskStatus(scope.row, 'start')" @click="setTaskStatus(scope.row, 'start')"
></span> ></span>
...@@ -209,7 +213,7 @@ ...@@ -209,7 +213,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="icon-fanxing-zanting pauseIcon" class="icon-fanxing-zanting pauseIcon"
@click="setTaskStatus(scope.row, 'stop')" @click="setTaskStatus(scope.row, 'stop')"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -228,9 +232,9 @@ ...@@ -228,9 +232,9 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="margin-top: 28px;"> <div style="margin-top: 28px">
<el-pagination <el-pagination
style="float: right;" style="float: right"
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
...@@ -243,7 +247,7 @@ ...@@ -243,7 +247,7 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<div style="clear: both;"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
<editset <editset
...@@ -253,7 +257,7 @@ ...@@ -253,7 +257,7 @@
@refresh="getTaskList" @refresh="getTaskList"
></editset> ></editset>
<editvideo <editvideo
v-if="!isbigtree" v-if="!isbigtree"
ref="editvideo" ref="editvideo"
:parentData="curtask" :parentData="curtask"
:pedittype="pedittype" :pedittype="pedittype"
...@@ -270,22 +274,24 @@ ...@@ -270,22 +274,24 @@
</div> </div>
</template> </template>
<script> <script>
import { algorTypeList, algorTypeEnum } from "@/enum/index";
console.log('algorTypeEnum', algorTypeEnum);
import editset from "./editSet"; import editset from "./editSet";
import editvideo from "./editVideo"; import editvideo from "./editVideo";
import editVidebigree from "./editVidebigree"; import editVidebigree from "./editVidebigree";
import subTaskInfo from "./subtask.vue"; import subTaskInfo from "./subtask.vue";
import mixin from "../../assets/js/mixin"; import mixin from "../../assets/js/mixin";
export default { export default {
components: { components: {
editset, editset,
editvideo, editvideo,
editVidebigree, editVidebigree,
subTaskInfo subTaskInfo,
}, },
mixins: [mixin], mixins: [mixin],
data() { data() {
return { return {
isbigtree:window.config.bigtree, isbigtree: window.config.bigtree,
task_name: "", task_name: "",
curtask: "", curtask: "",
task_algo_type: "", task_algo_type: "",
...@@ -301,7 +307,8 @@ export default { ...@@ -301,7 +307,8 @@ export default {
pedittype: "add", pedittype: "add",
currentRow: {}, currentRow: {},
assign_ip: "", assign_ip: "",
curscrollTop: 0 curscrollTop: 0,
algorTypeList: algorTypeList,
}; };
}, },
...@@ -310,7 +317,7 @@ export default { ...@@ -310,7 +317,7 @@ export default {
if (!row.isexpand) { if (!row.isexpand) {
//打开获取子任务 //打开获取子任务
row.isexpand = true; row.isexpand = true;
this.$api.task.getSubTask(row.task_id).then(res => { this.$api.task.getSubTask(row.task_id).then((res) => {
let ary = []; let ary = [];
let data = res.list_data; let data = res.list_data;
for (let i in data) { for (let i in data) {
...@@ -378,7 +385,7 @@ export default { ...@@ -378,7 +385,7 @@ export default {
} }
}, },
getFreelist() { getFreelist() {
this.$api.device.getFreelist(this.dev_unid).then(res => { this.$api.device.getFreelist(this.dev_unid).then((res) => {
this.freeList = res.list_data; this.freeList = res.list_data;
}); });
// / // /
...@@ -393,21 +400,7 @@ export default { ...@@ -393,21 +400,7 @@ export default {
} }
}, },
typeFormatter(row, column, cellValue, index) { typeFormatter(row, column, cellValue, index) {
if (cellValue == 0) { return algorTypeEnum[cellValue] || "未知";
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 "未知";
}
}, },
numFormatter(row, column, cellValue, index) { numFormatter(row, column, cellValue, index) {
return (index + 1) * this.page; return (index + 1) * this.page;
...@@ -435,15 +428,15 @@ export default { ...@@ -435,15 +428,15 @@ export default {
task_algo_type: this.task_algo_type, task_algo_type: this.task_algo_type,
source_type: "pull_video_stream", source_type: "pull_video_stream",
task_type: "normal", task_type: "normal",
task_name: this.task_name task_name: this.task_name,
}) })
.then(res => { .then((res) => {
this.total = res.total_num; this.total = res.total_num;
if (res.list_data == null) { if (res.list_data == null) {
this.tableData = []; this.tableData = [];
} else { } else {
res.list_data.forEach(item => { res.list_data.forEach((item) => {
item.subTaskData = []; item.subTaskData = [];
if (item.start_dt) { if (item.start_dt) {
//先转utc格式 //先转utc格式
...@@ -468,7 +461,7 @@ export default { ...@@ -468,7 +461,7 @@ export default {
}); });
} }
}) })
.catch(error => {}); .catch((error) => {});
}, },
editVideo(index, row) { editVideo(index, row) {
this.setsSrollTop(); this.setsSrollTop();
...@@ -482,7 +475,7 @@ export default { ...@@ -482,7 +475,7 @@ export default {
if (row.status == "Running") { if (row.status == "Running") {
this.$message({ this.$message({
type: "info", type: "info",
message: "暂停任务再尝试操作!" message: "暂停任务再尝试操作!",
}); });
return; return;
} }
...@@ -495,8 +488,8 @@ export default { ...@@ -495,8 +488,8 @@ export default {
}); });
}, },
setTaskStatus(data, type) { setTaskStatus(data, type) {
if(type == 'start') { if (type == "start") {
localStorage.setItem("substatus",data.task_id) localStorage.setItem("substatus", data.task_id);
} }
this.setsSrollTop(); this.setsSrollTop();
// if (data.status == "NotInTimeOfDay") { // if (data.status == "NotInTimeOfDay") {
...@@ -504,14 +497,18 @@ export default { ...@@ -504,14 +497,18 @@ export default {
// } // }
this.$api.task this.$api.task
.setTaskStatus(data.task_id, { start_stop_status: type }) .setTaskStatus(data.task_id, { start_stop_status: type })
.then(res => { .then((res) => {
this.$message({ this.$message({
type: res.ecode == "200" ? "success" : "error", type: res.ecode == "200" ? "success" : "error",
message: res.enote message: res.enote,
}); });
if (res.ecode == "200") { if (res.ecode == "200") {
let typename = type=='start'?"启动":"暂停" let typename = type == "start" ? "启动" : "暂停";
this.$logs.oplogs(res,'serv_task',`${typename}任务${data.task_name}`); this.$logs.oplogs(
res,
"serv_task",
`${typename}任务${data.task_name}`
);
this.getTaskList(); this.getTaskList();
} }
}); });
...@@ -520,14 +517,14 @@ export default { ...@@ -520,14 +517,14 @@ export default {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", { this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { }).then(() => {
this.$api.task.deleteTask(data.task_id).then(res => { this.$api.task.deleteTask(data.task_id).then((res) => {
this.$message({ this.$message({
type: res.ecode == "200" ? "success" : "error", 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") { if (res.ecode == "200") {
this.getTaskList(); this.getTaskList();
} }
...@@ -537,7 +534,6 @@ export default { ...@@ -537,7 +534,6 @@ export default {
setsSrollTop() { setsSrollTop() {
this.curscrollTop = this.$refs.table.$el.children[2].scrollTop; this.curscrollTop = this.$refs.table.$el.children[2].scrollTop;
}, },
}, },
mounted() { mounted() {
this.getTaskList(); this.getTaskList();
...@@ -545,7 +541,7 @@ export default { ...@@ -545,7 +541,7 @@ export default {
created() { created() {
this.curscrollTop = 0; this.curscrollTop = 0;
this.getFreelist(); this.getFreelist();
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -656,7 +652,7 @@ export default { ...@@ -656,7 +652,7 @@ export default {
} }
} }
.content { .content {
@include background_color(treeboxbg); @include background_color(treeboxbg);
} }
.inputBox { .inputBox {
margin-right: 20px; margin-right: 20px;
......
const fs = require("fs"); const fs = require("fs");
const path = require("path");
const resolve = dir => {
return path.join(__dirname, dir)
}
const vinfopath = "./public/js/version.json"; const vinfopath = "./public/js/version.json";
const BuildInfo = require("./version.js"); const BuildInfo = require("./version.js");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer") const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
...@@ -29,18 +33,19 @@ module.exports = { ...@@ -29,18 +33,19 @@ module.exports = {
] ]
}, },
chainWebpack: config => { chainWebpack: config => {
config.resolve.alias.set("@", resolve("src"));
// config.entry('main').add('babel-polyfill') // config.entry('main').add('babel-polyfill')
if (process.env.use_analyzer) { if (process.env.use_analyzer) {
// 分析 // 分析
config config
.plugin("webpack-bundle-analyzer") .plugin("webpack-bundle-analyzer")
.use(require("webpack-bundle-analyzer").BundleAnalyzerPlugin); .use(require("webpack-bundle-analyzer").BundleAnalyzerPlugin);
} };
if (process.env.NODE_ENV === "production") { if (process.env.NODE_ENV === "production") {
var verinfo = fs.openSync(vinfopath, "w+"); var verinfo = fs.openSync(vinfopath, "w+");
var options = { encoding: "UTF-8", mode: 438 /*=0666*/, flag: "w" }; var options = { encoding: "UTF-8", mode: 438 /*=0666*/, flag: "w" };
fs.writeFileSync(verinfo, JSON.stringify(BuildInfo), options); fs.writeFileSync(verinfo, JSON.stringify(BuildInfo), options);
} };
}, },
pluginOptions: { pluginOptions: {
// 第三方插件配置 // 第三方插件配置
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!