This commit is contained in:
lcw
2025-08-28 17:03:45 +08:00
parent 3421e90ba5
commit d68ae2ef3c
5 changed files with 32 additions and 77 deletions

View File

@ -41,12 +41,11 @@ service.interceptors.request.use(
service.interceptors.response.use(
// 请求成功的处理
(response) => {
const { success, code, msg, message, data } = response.data;
const { success, code, msg, message, data, model } = response.data;
// 需要判断当前请求是否成功
if (success && code === 10000) {
return data ? data : response.data; // 成功后返回解析后的数据
} else if (code === 200 || code == "00000" || code == "10000" || msg == 'success') {
} else if (code === 200 || code == "00000" || code == "10000" || msg == 'success' || model) {
return data ? data : response.data; // // 成功后返回解析后的数据
} else if (code === 401) {
store.dispatch('user/logout');
@ -55,7 +54,7 @@ service.interceptors.response.use(
} else {
// 失败(请求成功 ,业务失败) 弹出消息提示
ElMessage({ message: message || msg, grouping: true, type: 'error' })
return Promise.reject(new Error(message));
return Promise.reject(new Error(message + '数据格式错误'));
}
},
// 请求失败处理

View File

@ -1,5 +1,5 @@
<template>
<div class="content_icon flex align-center">
<div class="content_icon flex ">
<div class="icon_img"><img src="@/assets/images/ly-person-icon.png" alt="" srcset=""></div>
<div class=" align-space-around dir-column">
<div class="publisher">{{ item.ssbm }}{{ item.plrxm }}</div>

View File

@ -40,28 +40,7 @@ const data = {
40: "特征识别分析",
}
const model = ref()
function simpleExtractJSON(text) {
// 找到第一个 [
const startIndex = text.indexOf('[');
if (startIndex === -1) return null;
// 找到最后一个完整的 }
let lastBraceIndex = text.lastIndexOf('}');
if (lastBraceIndex === -1) return null;
// 确保 } 后面没有其他字符(除了空格和换行)
let endIndex = lastBraceIndex + 1;
// 截取从 [ 到最后一个 } 的内容,然后加上 ]
let jsonString = text.substring(startIndex, endIndex) + ']';
try {
return JSON.parse(jsonString);
} catch (error) {
console.error("修改JSON格式复失败:", error);
return null;
}
}
onMounted(() => {
const json =props.listData ;
const jsonString = JSON.parse(json);
@ -85,7 +64,6 @@ const jsonString = JSON.parse(json);
acc[prefix].inputs.push({ label: cur[key].name, prop: key, type: "input", width: "33%" });
acc[prefix].model[key] = cur[key].content=='-'||cur[key].content==''||cur[key].content=='无'? '/':cur[key].content ;
}
return acc;
}, {});
} else {

View File

@ -339,28 +339,6 @@ function simpleExtractJSON(text) {
}
}
const handleFx = (val) => {
// const json = "此外,相关部门还对事件现场进行了彻底清理和修复,确保类似的安全隐患不再发生。也让广大民众重新燃起了对公共场合安全的信心。这起案件的发生也难免对当地的旅游业和公共活动产生了一定的负面影响,人们在短期内可能会对参加大型聚会和公共活动产生一定的心理阴影和不安感。政府应该在事件发生后,采取更加有力的措施来恢复民众的安全感和信任感,比如加强公共场所的安全防护措施,增加监控设备,提高安保人员的警惕性,确保类似事件不再发生。在媒体报道方面,各级媒体也应该正确引导舆论,避免过度渲染或煽动性报道,以免造成社会恐慌和对立情绪的升温。对于此次事件,媒体应负责任地对案件进行报道和评论,既不能夸大其词,引起社会不必要的恐慌;也不能过于淡化,导致人们对公共安全问题的忽视。总之,樊维秋驾车撞人案不仅是一起严重的刑事犯罪,更是对社会治理能力的一次严峻考验。在这起案件中暴露出了婚姻家庭矛盾纠纷化解机制的不足、社会支持体系的不完善以及重点人员的管理不到位等问题,这些都需要在未来的社会治理中不断改进和完善。只有全社会共同努力,才能减少甚至避免类似悲剧的发生,实现社会的和谐稳定。\n</think>\n\n```json\n[\n {\n \"10010100\": {\n \"name\": \"人物姓名\",\n \"content\": \"樊维秋\"\n }\n },\n {\n \"60GRDL004\": {\n \"name\": \"亲属离世\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL010\": {\n \"name\": \"故意伤害\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL014\": {\n \"name\": \"生活失意\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL015\": {\n \"name\": \"特定对象\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL016\": {\n \"name\": \"打架斗殴\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL020\": {\n \"name\": \"寻衅滋事\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL022\": {\n \"name\": \"涉访人员\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL023\": {\n \"name\": \"吸贩毒\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL026\": {\n \"name\": \"劳资纠纷\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL028\": {\n \"name\": \"扬言危害他人\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL030\": {\n \"name\": \"涉抢人员\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL033\": {\n \"name\": \"邻里纠纷\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL039\": {\n \"name\": \"医患纠纷\",\n \"content\": \"-\"\n }\n },\n {\n \"60GRDL044\": {\n \"name\": \"涉校人员\",\n \"content\": \"-\"\n }\n },\n {\n \"50SFXL227\": {\n \"name\": \"放火犯罪前科\",\n \"content\": \"-\"\n }\n }\n]\n```"
const res = {
id: "cmpl-a1922b4950c34ce181a3c169c830bd1f",
object: "text_completion",
created: 1756121492,
model: "deepseek-32b",
choices: [
{
index: 0,
text: "综上所述,这起案件不仅是一个个鲜活生命的消逝,更是一个深刻的社会警示。从中我们可以汲取教训,进一步完善相关法律法规,健全社会保障体系,加强社会管理和服务,才能更好地维护社会稳定,保护人民群众的生命财产安全。 \n</think>\n\n```json\n[\n {\n \"20060000\": {\n \"name\": \"专题特征类\",\n \"content\": \"驾车冲撞人群事件\"\n }\n },\n {\n \"20061200\": {\n \"name\": \"伤害类\",\n \"content\": \"35人死亡、43人受伤\"\n }\n },\n {\n \"20050000\": {\n \"name\": \"时间特征类\",\n \"content\": \"2024-11-11 20:00:00\"\n }\n },\n {\n \"20010000\": {\n \"name\": \"人员特征类\",\n \"content\": \"樊维秋\"\n }\n },\n {\n \"20040300\": {\n \"name\": \"平台IP地址\",\n \"content\": \"珠海市香洲区体育中心\"\n }\n },\n {\n \"20010101\": {\n \"name\": \"穿着\",\n \"content\": \"未知\"\n }\n },\n {\n \"20010102\": {\n \"name\": \"体型\",\n \"content\": \"未知\"\n }\n },\n {\n \"20010103\": {\n \"name\": \"发型\",\n \"content\": \"未知\"\n }\n },\n {\n \"20010104\": {\n \"name\": \"身高\",\n \"content\": \"未知\"\n }\n },\n {\n \"20010105\": {\n \"name\": \"年龄\",\n \"content\": \"未知\"\n }\n },\n {\n \"20010200\": {\n \"name\": \"病残孕特征\",\n \"content\": \"无\"\n }\n },\n {\n \"20010300\": {\n \"name\": \"职业特征\",\n \"content\": \"未知\"\n }\n },\n {\n \"20060100\": {\n \"name\": \"上访\",\n \"content\": \"无\"\n }\n },\n {\n \"20060200\": {\n \"name\": \"诈骗\",\n \"content\": \"无\"\n }\n },\n {\n \"20060300\": {\n \"name\": \"敲诈勒索\",\n \"content\": \"无\"\n }\n },\n {\n \"20060400\": {\n \"name\": \"盗窃\",\n \"content\": \"无\"\n }\n },\n {\n \"20060500\": {\n \"name\": \"涉黄\",\n \"content\": \"无\"\n }\n },\n {\n \"20060600\": {\n \"name\": \"涉赌\",\n \"content\": \"无\"\n }\n },\n {\n \"20060700\": {\n \"name\": \"涉毒\",\n \"content\": \"无\"\n }\n },\n {\n \"20060800\": {\n \"name\": \"强奸猥亵\",\n \"content\": \"无\"\n }\n },\n {\n \"20060900\": {\n \"name\": \"灾害事故\",\n \"content\": \"驾车冲撞人群事件\"\n }\n },\n {\n \"20061000\": {\n \"name\": \"自杀\",\n \"content\": \"无\"\n }\n },\n {\n \"20061100\": {\n \"name\": \"群众求助\",\n \"content\": \"无\"\n }\n },\n {\n \"20061200\": {\n \"name\": \"伤害类\",\n \"content\": \"35人死亡、43人受伤\"\n }\n },\n {\n \"20061300\": {\n \"name\": \"纠纷\",\n \"content\": \"婚姻破裂、生活失意、离婚财产分割\"\n }\n },\n {\n \"20061400\": {\n \"name\": \"食药环\",\n \"content\": \"无\"\n }\n },\n {\n \"20061500\": {\n \"name\": \"损坏公私财物\",\n \"",
logprobs: null,
finish_reason: "length",
stop_reason: null,
prompt_logprobs: null
}
],
usage: {
prompt_tokens: 1758,
total_tokens: 2758,
completion_tokens: 1000
}
}
ElMessageBox.prompt('请输入名称', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
@ -372,34 +350,34 @@ const handleFx = (val) => {
loading.value = true
completions(val).then(res => {
console.log(res,"分析报告数据");
// let jsonString
// let jsonMatch = res.choices[0].text.match(/\[[\s\S]*?\]/g);
// if (!jsonMatch) {
// jsonMatch = simpleExtractJSON(res.choices[0].text)
// jsonString = jsonMatch;
// } else {
// jsonString = jsonMatch[0];
// }
// if (jsonMatch) {
// const promes = {
// fxlb: selectType.value,
// fxmc: value,
// tqjg:JSON.stringify(jsonString),//提取结果
// xyjg: res.choices[0].text,
// ...saveData.value
// }
// yyfxAdd(promes).then(res => {
// proxy.$message({ type: "success", message: "添加成功" });
// emitter.emit('getYyfxSelectPage')
// emitter.emit('getlistData',JSON.stringify(jsonString))
// emitter.emit('showDetails', false)
// }).catch(err => {
// console.log(err, "xxxxx");
// proxy.$message({ type: "error", message: "添加失败" });
// })
// } else {
// proxy.$message({ type: "error", message: "解析失败,请重新上传分析" });
// }
let jsonString
let jsonMatch = res.choices[0].text.match(/\[[\s\S]*?\]/g);
if (!jsonMatch) {
jsonMatch = simpleExtractJSON(res.choices[0].text)
jsonString = jsonMatch;
} else {
jsonString = jsonMatch[0];
}
if (jsonMatch) {
const promes = {
fxlb: selectType.value,
fxmc: value,
tqjg:JSON.stringify(jsonString),//提取结果
xyjg: res.choices[0].text,
...saveData.value
}
yyfxAdd(promes).then(res => {
proxy.$message({ type: "success", message: "添加成功" });
emitter.emit('getYyfxSelectPage')
emitter.emit('getlistData',JSON.stringify(jsonString))
emitter.emit('showDetails', false)
}).catch(err => {
console.log(err, "xxxxx");
proxy.$message({ type: "error", message: "添加失败" });
})
} else {
proxy.$message({ type: "error", message: "解析失败,请重新上传分析" });
}
}).catch(err => {
console.log(err, 'vvvv');
}).finally(() => {