Commit 343145f3 by 潘建波

【BUG】参数多次保存出现值为空的情况

1 parent c06b62d1
......@@ -4,7 +4,7 @@ window.config = {
"logintitle":"AI视频分析平台",//展示标题
"https": false,
"isvideo":0,
"bigtree":false,//大数据展示树
"bigtree":true,//大数据展示树
"host":"http://10.1.200.100:20080",
"ddurl":"http://aaa.zzgx.gov.cn",
"ddloginurl":"http://10.1.200.97:29090",
......@@ -13,7 +13,7 @@ window.config = {
"isdd":false, //是否开启钉钉登录
"version":"2.1.0",
"encrypt":false,//是否加密true采用sha1加密,false不加密
"nvsUrl":'',
"nvsRegex":'',
"nvsUrl":'http://47.94.37.10:8888',
"nvsRegex":'rtsp://47.94.37.10/lskjapp/',
"isNvs3000":true,//是否开启nvs3000拉取功能
}
{"commit":"6ad19ddfe788a0e2a7d6aabcd3fc71e4755f27d9","commitDate":"2021-7-20 19:36","buildDate":"2021-8-9 19:25","version":"2.1.0","info":"【BUG】修改28181无法下发任务问题"}
\ No newline at end of file
{"commit":"c06b62d1ed010a40df2e0aa8ef5895ab14020d03","commitDate":"2021-8-10 15:20","buildDate":"2021-9-6 13:47","version":"2.1.0","info":"【NEW】添加nvs3000拉取功能"}
\ No newline at end of file
......@@ -17,7 +17,7 @@ export default {
let url = "";
switch (devname) {
case "外部设备":
url = "/devconf_fx/device_catalogs";
url = "/device_catalogs";
break;
case "内部设备":
url = "/vchan_struct?vchan_type=camera";
......@@ -27,11 +27,13 @@ export default {
break;
}
if(window.config.bigtree && devname == "外部设备") {
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}` //ztree版本
return `${baseUrl}/api/v1/devconf_fx${url}` //ztree版本
} else if(devname == "外部设备"){
return api.get(`${baseUrl}/api/v1/${url}`, params);
} else {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`, params);
return api.get(`${baseUrl}/api/v1/devconf_fx/${url}`, params);
} else if(window.config.bigtree){
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`
}else {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`)
}
},
......@@ -90,6 +92,6 @@ export default {
return api.post(`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params)
},
getNvs3000:(params)=>{
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/nvs3000`,params)
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/nvs3000`,params)
},
};
......@@ -134,9 +134,9 @@ export default {
params
);
},
getcatalogs(){
getcatalogs(params){
return api.get(
`${baseUrl}/api/v1/devconf_fx/device_catalogs`
`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params
);
},
refreshcatlog(){
......
......@@ -25,11 +25,10 @@
this.videoDialogVisible = true;
this.domTimer = setTimeout(() => {
this.player = document.getElementById('playerVideo');
console.log(this.player)
this.player.loop = true;
if(window.config.https) {
let loc = location.host
this.player.src = `https://${loc}/${play_url.split(":20070")[1]}`
this.player.src = `https://${loc}/${play_url.split(":20080")[1]}`
} else {
this.player.src = play_url;
}
......@@ -37,6 +36,8 @@
}, 100);
},
closeVideoDialog: function () {
let _this = this;
window.clearTimeout(_this.domTimer)
this.domTimer = null;
this.player.src = '';
this.player = '';
......
......@@ -150,7 +150,7 @@ export default {
logout() {
localStorage.removeItem("menu");
localStorage.removeItem("curmenu");
let uid = sessionStorage.getItem("user_unid");
let uid = localStorage.getItem("user_unid");
this.$api.login.logout(uid).then((res) => {
this.$store.commit(types.ATOKEN, "");
this.$logs.oplogs("", "serv_login", `登出了平台`);
......
......@@ -149,7 +149,7 @@ export default {
this.loginMount(res, "user");
} else {
if (res.ecode == "1000") {
sessionStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("atoken", res.atoken);
this.$router.push("/resetpass")
} else {
......@@ -171,7 +171,7 @@ export default {
loginMount(res, logintype) {
this.$store.commit(types.ATOKEN, res.atoken);
// localStorage.setItem('rtoken',m.data.rtoken)
sessionStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("user_unid", res.user_unid);
//本系统可以直接用本地缓存做
localStorage.setItem("atoken", res.atoken);
localStorage.setItem("uname", res.user_name);
......
......@@ -97,7 +97,7 @@ export default {
this.$refs[formName].validate(valid => {
if (valid) {
let user_unid = sessionStorage.getItem("user_unid");
let user_unid = localStorage.getItem("user_unid");
this.$api.ops.resetPwd(data, user_unid).then(res => {
if(res.ecode == 200){
this.$logs.oplogs(res, "serv_login", `修改密码`);
......
......@@ -54,7 +54,7 @@ export default {
loginMount(res, logintype) {
this.$store.commit(types.ATOKEN, res.atoken);
// localStorage.setItem('rtoken',m.data.rtoken)
sessionStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("user_unid", res.user_unid);
//本系统可以直接用本地缓存做
localStorage.setItem("atoken", res.atoken);
localStorage.setItem("uname", res.user_name);
......
#!/usr/bin/evn python
# coding=utf-8
from flask import Blueprint,request,redirect,url_for
import flask
#from werkzeug import secure_filename
import requests,json,re,time,io
import sys
import os
import uuid
from commons.util import *
import gbvar.ws_serv_global as sv_global
import gbvar.database_global as database
import gbvar.dict_properties as dict_p
from threading import Thread
#配置文件路径
pro_path = "/root/UserApp/apps"
con_path = '/'.join((pro_path, 'special.properties'))
print con_path
dictProperties=Properties(con_path).getProperties()
import commons.editXml as editXml
import commons.event_to_local as etl
import dao.firebird_dao as dbmanipulation
import commons.data_process as proc
import gbvar.ws_global as global_ws_list
import gbvar.ws_list as wsdic
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
tx1_box = Blueprint('tx1_box', __name__)
#数据接收接口
@tx1_box.route('/events', methods=["POST"])
def dataRecv():
data = request.get_data()
dataDic = json.loads(data)
if type(dataDic) is dict:
subtask_id = None
if dataDic.has_key ( 'subtask_id' ):
subtask_id = dataDic['subtask_id']
# recvThird(dataDic)
t = Thread(target=recvThird, args=(dataDic,))
t.start()
print "subtask=%s" % subtask_id
try:
res = etl.eventToLocal.saveEventToLocal ( dataDic )
print res
#print type(res)
outPicsPath = res[2]
print outPicsPath
pics = dataDic['pics']
index = 0
for pic in pics:
del pic['pic_base64']
pic_src = outPicsPath[index]
#pic_src = pic_src[pic_src.find ( 'data' ) + 4:len ( pic_src )]
print pic_src
# pic['src_url'] = dict_p.get_value()['pic_url'] % pic_src
pic['src_url'] = "http://%s:20070/%s" % (wsdic.get_host_ip(), pic_src)
index = index + 1
#pic_src = outPicsPath[0]
#print "pics=%s" % pic_src
#pic_src = pic_src[pic_src.find('data')+4:len(pic_src)]
#print pic_src
#del dataDic['pics'][0]['pic_base64']
#dataDic['pics'][0]['src_url'] = dict_p.get_value()['pic_url'] % pic_src
send_by_ws ( json.dumps(dataDic), subtask_id )
print(res)
except Exception, a:
print a
pass
#存入本地数据库
# save_alarm_data(data,res)
else:
print('error: data to dict failed, data:{}'.format(data))
return json.dumps({"ecode":200,"enote":'ok'})
@tx1_box.route('/events/list', methods=["GET"])
def getEventList():
save_alarm_data('','')
return ''
# arguments = request.args()
# for item in arguments:
# print(item)
# sql = 'select * from TB_TRAFFIC_EVENT ROWS 1 TO 19'
#
# eventResult = dbmanipulation.selectDb(sql)
# print 'test'
# # print database.get_value()
# res = flask.make_response(json.dumps(eventResult, encoding="UTF-8", ensure_ascii=False, sort_keys=False, indent=4).encode('utf-8'))
# res.headers['Access-Control-Allow-Origin'] = '*'
# res.headers['Access-Control-Allow-Methods'] = 'POST,GET,OPTIONS'
# res.headers['Access-Control-Allow-Headers'] = 'x-requested-with,content-type'
# return res
def send_by_ws(data,subtask_id):
for unid, ws in wsdic.getAllWs().iteritems ():
old_task_id = wsdic.get_task_by_unid ( unid )
print "old_task_id=%s" % old_task_id
if ws and old_task_id == subtask_id:
ws.send(data)
# 给所有用户发送信息
def send_all_data(sv, data):
if sv.users is not None and len ( sv.users ) > 0:
for addr in sv.users:
print ('addr=%s' % addr)
sv.send_data (data, addr )
#系统初始化:读取配置文件获取初始化任务列表
def get_task_info():
dictProperties = dict_p.get_value()
result_list = []
if dictProperties:
for i in range(4):
result_data = {}
task_id = 'task_%s' % i
ds = dictProperties[task_id]
if ds.find ( "@" ) != -1:
task_inf = re.split ( '[@]', ds )
result_data.setdefault ( "task_id",i+1 )
result_data.setdefault ( "task_name", task_inf[1] )
result_data.setdefault ( "task_info", readerXml(task_inf[0]) )
result_list.append ( result_data )
else:
continue
return json.dumps ( result_list, ensure_ascii=False )
# 初始化报警数据
def save_alarm_data(adata, src):
setting = ''
with open("text", 'r') as f:
setting = json.loads(f.read())
data = setting
dataType = data['event_type']
proc.dataProcess.initData(data)
trffic_data = proc.dataProcess.trffic_data()
dbmanipulation.save_trrfic_Db(trffic_data)
if (dataType == 'vehicle' or dataType == 'xcycle' or dataType == 'pedestrian'):
if (data.has_key('driver')):
if(data['driver'].has_key('face')):
face_data = proc.dataProcess.face_data()
dbmanipulation.save_face_Db(face_data)
else:
return '人脸不存在'
elif (dataType == 'pflow' or dataType == 'tflow' or dataType == 'pdensity'):
flow_data = proc.dataProcess.flow_data()
dbmanipulation.save_flow_data_Db(flow_data)
flow_event = proc.dataProcess.flow_event()
dbmanipulation.save_flow_event_Db(flow_event)
#初始化任务详情信息:包含algo_args信息、calibration标定参数信息以及roi信息的组合
def creat_mtasks():
'''任务配置参数'''
mtasks = []
'''场景'''
scenes = []
'''标定信息'''
callibration = {}
'''rois信息'''
rois = []
'''最新设置的算法配置参数'''
config = {}
'''basicConfig系统默认算法参数'''
basicConfig = {}
'''play_urls待分析的原始视频源的输入地址'''
play_urls = {}
return mtasks
#读取任务信息参数
def readerXml(file_path):
return editXml.readerXml ( file_path )
@tx1_box.route('/pic_cut', methods=["POST"])
def post_test():
data_1 = request.get_data ()
print data_1
data = {}
data.setdefault('pic_base64','123123123123123123123123')
return json.dumps ( data, ensure_ascii=False )
headers = {
"Content-Type":"application/json"
}
def recvThird(rdata):
url = dictProperties["third_party_url"]
if url:
try:
# r = requests.post(url,rdata, timeout=20)
r = requests.post(url=url,data=json.dumps(rdata),headers=headers)
print r
except Exception as e:
print "发送失败: err: " + str(e)
......@@ -188,7 +188,6 @@
this.getData();
},
showlogtype(data){
debugger
let sname = '';
this.srevarr.map(ele => {
if(ele.serv_type == data){
......
......@@ -167,7 +167,7 @@
editVisible:false,
roleList:[],
uname:"",
userId:sessionStorage.getItem('user_unid'),
userId:localStorage.getItem('user_unid'),
rules: {
role_name: [
{ validator: checkRole, trigger: 'change' }
......
......@@ -340,7 +340,7 @@ export default {
});
} else {
let exportFileUrl = res.file_path;
this.$logs.oplogs(res,'serv_system',`备份导出`);
window.location.href = exportFileUrl;
}
});
......@@ -361,7 +361,8 @@ export default {
} else {
let exportFileUrl = res.enote;
this.$logs.oplogs(res,'serv_system',`备份导出`);
window.location.href = exportFileUrl;
let url = window.config.https?exportFileUrl.replace('http','https').replace('20080','20070'):exportFileUrl;
window.location.href = url;
}
});
},
......
......@@ -360,7 +360,7 @@ export default {
logoutuser(index,row){
localStorage.removeItem("menu");
localStorage.removeItem("curmenu");
let uid = sessionStorage.getItem("user_unid");
let uid = localStorage.getItem("user_unid");
this.$api.login.logout(row.user_unid).then((res) => {
if(res.ecode == "200") {
this.$message({
......
......@@ -26,8 +26,6 @@ export default {
props: ["playurl", "type"],
methods: {
videoPlay: function() {
debugger
this.urlFlag = false;
console.log(this.playurl);
if (!this.playurl.sip_serv_ip) {
......@@ -53,13 +51,14 @@ export default {
console.log(error);
}
} else {
debugger
let OcxResponse = document
.getElementById("VionVideo")
.StartPlaySip(
this.playurl.sip_serv_id,
this.playurl.sip_serv_ip,
this.playurl.sip_serv_port,
this.playurl.sip_unid,
this.playurl.sip_dev_id,
this.playurl.sip_password,
this.playurl.devId,
0
......
......@@ -63,7 +63,7 @@ export default {
sip_username: [{ validator: validateUser, trigger: "change" }],
sip_password: [{ validator: validatePass, trigger: "change" }]
},
user_unid: sessionStorage.getItem("user_unid"),
user_unid: localStorage.getItem("user_unid"),
dev_unid: localStorage.getItem("dev_unid"),
isGetted: false,
sipSetting: {
......
......@@ -314,19 +314,19 @@ export default {
this.$refs.catree.remove(data.vchan_refid)
},
getNvs(node, data){
this.$confirm("拉取NVS300到该地点?", "提示", {
this.$confirm("拉取NVS3000到该地点?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
let params = {
"devUnid": this.dev_unid,
"addressUnid": data.event_code,
"addressUnid": data.unid,
"nvsUrl": window.config.nvsUrl,
"nvsRegex": window.config.nvsRegex
}
this.$api.device.getNvs3000(params).then(res => {
this.orgServ();
this.$emit("getTree");
})
})
},
......
......@@ -318,14 +318,14 @@ export default {
let newData = [];
for (var i = 0; i < data.length; i++) {
let obj = {};
obj["id"] = data[i].DeviceID;
obj["label"] = data[i].Name === "" ? "未命名" : data[i].Name;
obj["id"] = data[i].deviceid;
obj["label"] = data[i].name === "" ? "未命名" : data[i].name;
obj["is_leaf"] = data[i].is_leaf;
obj["ParentID"] = data[i].ParentID;
obj["ip"] = data[i].IPAddress;
obj["port"] = data[i].Port;
obj["latitude"] = data[i].Latitude;
obj["longitude"] = data[i].Longitude;
obj["ParentID"] = data[i].parentid;
obj["ip"] = data[i].ipaddress;
obj["port"] = data[i].port;
obj["latitude"] = data[i].latitude;
obj["longitude"] = data[i].longitude;
if (data[i].childs) {
obj["children"] = this.syncBuildTree(data[i].childs);
} else {
......
......@@ -492,7 +492,7 @@ export default {
}
},
created() {
this.user_unid = window.sessionStorage.getItem("user_unid");
this.user_unid = window.localStorage.getItem("user_unid");
},
watch: {
......
......@@ -80,7 +80,10 @@ export default {
//ifram 传递回来的饿xml
this.XMLStr = this.$refs.iframe.contentWindow.xmlStr;
this.handleClose();
this.$parent.submit(this.XMLStr, "config");
if(this.XMLStr) {
this.$parent.submit(this.XMLStr, "config");
}
},
handleClose(done) {
this.dialogVisible = false;
......
......@@ -47,7 +47,7 @@ export default {
this.playulr.sip_serv_id,
this.playulr.sip_serv_ip,
this.playulr.sip_serv_port,
this.playulr.sip_unid,
this.playulr.sip_dev_id,
this.playulr.sip_password,
this.playulr.devId,
0
......
......@@ -348,7 +348,7 @@ export default {
let vchans = childNodes.vchan_struct || childNodes.list_data;
treenode = vchans
} else {
treenode = childNodes.vchan_struct;
treenode = childNodes.result.childs;
}
return treenode;
},
......@@ -586,11 +586,12 @@ export default {
var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, zNodes);
return
}
this.$api.device.getDevtreeLike(this.dev_unid,'外部设备',{vchan_name_like:this.searchText }).then(res => {
this.$api.resource.getcatalogs({vchan_name_like:this.searchText }).then(res => {
this.$api.device.getDevtreeLike(this.dev_unid,'内部设备',{vchan_name_like:this.searchText }).then(camerares => {
this.$api.device.getDevtreeLike(this.dev_unid,'短视频',{vchan_name_like:this.searchText }).then(vchanres => {
setTimeout(() => {
this.zNodes[0].childs = res.vchan_struct
debugger
this.zNodes[0].childs = res.result.childs
this.zNodes[1].childs = camerares.vchan_struct
this.zNodes[2].childs = vchanres.list_data
var ztree = $.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes);
......@@ -665,7 +666,7 @@ export default {
alert("播放地址不存在!");
}
} else {
this.getSipSetting(node.refid);
this.getSipSetting(node.vchan_refid);
}
// } else {
// this.getSendingCount = 1;
......@@ -678,6 +679,7 @@ export default {
if (this.dev_unid) {
this.$api.device.sipSet(this.dev_unid, this.user_unid).then((res) => {
if (!res.ecode) {
debugger
console.log("获取sip配置返回:", JSON.stringify(res));
this.play_url = res;
this.play_url.devId = refid;
......@@ -738,7 +740,7 @@ export default {
},
},
created() {
this.user_unid = window.sessionStorage.getItem("user_unid");
this.user_unid = window.localStorage.getItem("user_unid");
// this.getData();
},
};
......
......@@ -596,7 +596,7 @@ export default {
}
},
created() {
this.user_unid = window.sessionStorage.getItem("user_unid");
this.user_unid = window.localStorage.getItem("user_unid");
}
};
</script>
......
......@@ -417,8 +417,7 @@ export default {
for (let i in vchans) {
const vchan = vchans[i];
vchan.leaf = vchan.is_leaf ||
vchan.vchan_type == "camera" ||
Boolean(vchan.vchan_refid);
vchan.vchan_type == "camera"
vchan.disabled = !vchan.leaf;
vchan.name =
vchan.name || vchan.org_name || vchan.vchan_name || vchan.Name ||"未命名";
......@@ -522,7 +521,7 @@ export default {
alert("播放地址不存在!");
}
} else {
this.getSipSetting(node.DeviceID);
this.getSipSetting(node.deviceid);
}
// } else {
// this.getSendingCount = 1;
......@@ -599,7 +598,7 @@ export default {
}
},
created() {
this.user_unid = window.sessionStorage.getItem("user_unid");
this.user_unid = window.localStorage.getItem("user_unid");
}
};
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!