feat: Ai加载前,先渲染一次,Ai出来后再次渲染
This commit is contained in:
@ -63,12 +63,35 @@ const showModel = ref(false)
|
||||
const textContent = ref('')//报告数据
|
||||
const SaveReport = () => {
|
||||
}
|
||||
/** 获取原始报备内容
|
||||
* @param {Array} resArr 预警信息
|
||||
* @param {Array} dictArr 预警类型
|
||||
* @returns {String} 原始报备内容
|
||||
*/
|
||||
const getOriginStr = (resArr, dictArr) => {
|
||||
/** 标题前文 */
|
||||
const preStr = BigTitle("林芝市公安局情指中心") + BigTitle("研判专刊(初稿)") + newTotitle({
|
||||
org: "市公安局情指中心编",
|
||||
time: timeValidate()
|
||||
}) + fbtool(`同类事件发生${resArr.length}次以上预警`)
|
||||
/** 警情内容 */
|
||||
let contentStr = resArr.map((item, index) => {
|
||||
const lx = dictArr.find(items => {
|
||||
return items.value == item.yjlx
|
||||
}).zdmc
|
||||
return Subheading(`${index + 1}.警情内容`) +
|
||||
textStyle(`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`)
|
||||
}).join('')
|
||||
const endStr = Subheading(`解决方案`) + textStyle('加载中。。。')
|
||||
return preStr + contentStr + endStr
|
||||
}
|
||||
const opneModel = (row) => {
|
||||
showModel.value = true
|
||||
textContent.value = ''
|
||||
mxglJqxqGetPageList({
|
||||
yjid: row.id,
|
||||
}).then((res) => {
|
||||
res = Array.isArray(res) ? res : []
|
||||
let str = {
|
||||
model: "deepseek-32b",
|
||||
prompt: `# 角色定位\n你是一名资深警务人员,尤其擅长对警情、案件、线索等非结构化文本数据进行阅读理解,并从中提取各种对象特征信息进行结构化,并总结各种对象之间的关联关系。\n`,
|
||||
@ -81,9 +104,11 @@ const opneModel = (row) => {
|
||||
str.prompt += `警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`
|
||||
})
|
||||
str.prompt += `根据以上警情信息,总结出一个解决方案`
|
||||
textContent.value = getOriginStr(res, props.dict.D_BZ_JQLY)
|
||||
let jsonMatch
|
||||
completions(str).then(reslve => {
|
||||
jsonMatch = reslve.choices[0].text
|
||||
textContent.value = '' // 重置为空
|
||||
textContent.value += BigTitle("林芝市公安局情指中心") + BigTitle("研判专刊(初稿)") + newTotitle({
|
||||
org: "市公安局情指中心编",
|
||||
time: timeValidate()
|
||||
|
||||
Reference in New Issue
Block a user