var data_obj = {};
var kw_response = {
"code": 200,
"message": "请求成功",
"data": [{
'违法事实': [{
'text': '没有任何食品经营许可证',
'start': 42,
'end': 53,
'probability': 0.940447445304958
},
{
'text': '无证经营',
'start': 4,
'end': 8,
'probability': 0.9998807941266818
}],
'线索地点': [{
'text': '海淀区中关村和坊路8号天创科技大厦',
'start': 14,
'end': 31,
'probability': 0.8992785399005641
}],
'涉事对象': [{
'text': '阳光上东幼儿园',
'start': 34,
'end': 41,
'probability': 0.9998384765830508
}]
}]
};
if(kw_response["code"] == 200){
var illegalActivities_uie = []; // 违法行为
var damageConsequence_uie = []; // 损害后果
var damage_uie = []; //损害对象
var duration_uie = []; //持续时间
var address_uie = []; //线索地点
var objectInvolved_uie = []; //涉事对象
try{
var response = kw_response["data"][0];
console.log(response['违法事实'])
if (kw_response["code"] == 200){
if (response['违法事实']){
for(var i=0;i<response['违法事实'].length;i++){
illegalActivities_uie.push(response['违法事实'][i]['text'])
}
}
if (response['损害后果']){
for(var i=0;i<response['损害后果'].length;i++){
damageConsequence_uie.push(response['损害后果'][i]['text'])
}
}
if (response['损害对象']){
for(var i=0;i<response['损害对象'].length;i++){
damage_uie.push(response['损害对象'][i]['text'])
}
}
if (response['持续时间']){
for(var i=0;i<response['持续时间'].length;i++){
duration_uie.push(response['持续时间'][i]['text'])
}
}
if (response['线索地点']){
for(var i=0;i<response['线索地点'].length;i++){
address_uie.push(response['线索地点'][i]['text'])
}
}
if (response['涉事对象']){
for(var i=0;i<response['涉事对象'].length;i++){
objectInvolved_uie.push(response['涉事对象'][i]['text'])
}
}
data_obj['illegalActivities_uie'] = illegalActivities_uie;
data_obj['damageConsequence_uie'] = damageConsequence_uie;
data_obj['damage_uie'] = damage_uie;
data_obj['duration_uie'] = duration_uie;
data_obj['address_uie'] = address_uie;
data_obj['ObjectInvolved_uie'] = objectInvolved_uie;
}else{
data_obj['illegalActivities_uie'] = illegalActivities_uie;
data_obj['damageConsequence_uie'] = damageConsequence_uie;
data_obj['damage_uie'] = damage_uie;
data_obj['duration_uie'] = duration_uie;
data_obj['address_uie'] = address_uie;
data_obj['ObjectInvolved_uie'] = objectInvolved_uie;
}
}
catch(e){
data_obj['illegalActivities_uie'] = illegalActivities_uie;
data_obj['damageConsequence_uie'] = damageConsequence_uie;
data_obj['damage_uie'] = damage_uie;
data_obj['duration_uie'] = duration_uie;
data_obj['address_uie'] = address_uie;
data_obj['ObjectInvolved_uie'] = objectInvolved_uie;
}
}
console.log(data_obj)
console