feat: 仅格式化
This commit is contained in:
@ -13,10 +13,9 @@
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox">
|
||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
||||
>
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
|
||||
<template #yjlx="{ row }">
|
||||
<DictTag :tag="false" :value="row.yjlx" :options="dict.D_BZ_TPYJLX" />
|
||||
<DictTag :tag="false" :value="row.yjlx" :options="dict.D_BZ_TPYJLX" />
|
||||
</template>
|
||||
<template #controls="{ row }">
|
||||
<el-link type="primary" size="small" @click="opneModel(row)">打开研判报告</el-link>
|
||||
@ -31,21 +30,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<YpModel v-model="showModel" @SaveReport="SaveReport" :heightNumber="436" v-model:textContent="textContent"></YpModel>
|
||||
<Yjdict ref="yjdict" :dict="dict"/>
|
||||
<Yjdict ref="yjdict" :dict="dict" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import YpModel from '@/components/ypModel/index.vue'
|
||||
import emitter from "@/utils/eventBus.js";
|
||||
import { getYjxxPageList,getSsyjpzMxgzxl,mxglJqxqGetPageList } from "@/api/model";
|
||||
import { getYjxxPageList, getSsyjpzMxgzxl, mxglJqxqGetPageList } from "@/api/model";
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import Pages from "@/components/aboutTable/Pages.vue";
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
import { timeValidate } from '@/utils/tools'
|
||||
import { completions } from '@/api/semanticAnalysis'
|
||||
import { completions } from '@/api/semanticAnalysis'
|
||||
import { reactive, ref, onMounted, getCurrentInstance, watch } from "vue";
|
||||
import { textStyle, Firstlevelheading, Subheading, BiheadlinegTitle, newTotitle,BigTitle,fbtool, headTitle, report, signature } from '../content.js'
|
||||
import { textStyle, Firstlevelheading, Subheading, BiheadlinegTitle, newTotitle, BigTitle, fbtool, headTitle, report, signature } from '../content.js'
|
||||
import Yjdict from './yjdict.vue'
|
||||
const props = defineProps({
|
||||
item: {
|
||||
@ -59,9 +58,9 @@ const props = defineProps({
|
||||
const queryFrom = ref({})
|
||||
const searchBox = ref(); //搜索框
|
||||
const yjdict = ref(null)//详情弹窗
|
||||
const ItemData=ref()//模型数据
|
||||
const ItemData = ref()//模型数据
|
||||
const showModel = ref(false)
|
||||
const textContent=ref('')//报告数据
|
||||
const textContent = ref('')//报告数据
|
||||
const SaveReport = () => {
|
||||
}
|
||||
const opneModel = (row) => {
|
||||
@ -71,33 +70,33 @@ const opneModel = (row) => {
|
||||
yjid: row.id,
|
||||
}).then((res) => {
|
||||
let str = {
|
||||
model: "deepseek-32b",
|
||||
prompt: `# 角色定位\n你是一名资深警务人员,尤其擅长对警情、案件、线索等非结构化文本数据进行阅读理解,并从中提取各种对象特征信息进行结构化,并总结各种对象之间的关联关系。\n`,
|
||||
max_tokens: 1000,
|
||||
}
|
||||
model: "deepseek-32b",
|
||||
prompt: `# 角色定位\n你是一名资深警务人员,尤其擅长对警情、案件、线索等非结构化文本数据进行阅读理解,并从中提取各种对象特征信息进行结构化,并总结各种对象之间的关联关系。\n`,
|
||||
max_tokens: 1000,
|
||||
}
|
||||
res.forEach(item => {
|
||||
const lx = props.dict.D_BZ_JQLY.find(items => {
|
||||
return items.value == item.yjlx
|
||||
}).zdmc
|
||||
str.prompt+=`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`
|
||||
str.prompt += `警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`
|
||||
})
|
||||
str.prompt += `根据以上警情信息,总结出一个解决方案`
|
||||
let jsonMatch
|
||||
completions(str).then(reslve => {
|
||||
jsonMatch = reslve.choices[0].text
|
||||
textContent.value += BigTitle("林芝市公安局情指中心") + BigTitle("研判专刊(初稿)") + newTotitle({
|
||||
org: "市公安局情指中心编",
|
||||
time: timeValidate()
|
||||
}) + fbtool(`同类事件发生${res.length}次以上预警`)
|
||||
res.forEach((item,index) => {
|
||||
const lx = props.dict.D_BZ_JQLY.find((items) => {
|
||||
return items.value == item.yjlx
|
||||
}).zdmc
|
||||
textContent.value += Subheading(`${index + 1}.警情内容`) +
|
||||
// textStyle(`预警名称:${item.yjBt},预警人员姓名:${item.yjRyxm},身份证号:${item.yjRysfzh},车牌号:${item.yjClcph},预警地址:${item.yjDz},预警类型:${lx},预警内容:${item.yjnr},预警时间:${item.yjsj}\n`)
|
||||
textStyle(`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`)
|
||||
org: "市公安局情指中心编",
|
||||
time: timeValidate()
|
||||
}) + fbtool(`同类事件发生${res.length}次以上预警`)
|
||||
res.forEach((item, index) => {
|
||||
const lx = props.dict.D_BZ_JQLY.find((items) => {
|
||||
return items.value == item.yjlx
|
||||
}).zdmc
|
||||
textContent.value += Subheading(`${index + 1}.警情内容`) +
|
||||
// textStyle(`预警名称:${item.yjBt},预警人员姓名:${item.yjRyxm},身份证号:${item.yjRysfzh},车牌号:${item.yjClcph},预警地址:${item.yjDz},预警类型:${lx},预警内容:${item.yjnr},预警时间:${item.yjsj}\n`)
|
||||
textStyle(`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`)
|
||||
})
|
||||
textContent.value+=Subheading(`解决方案`)+textStyle(jsonMatch?jsonMatch:'暂无解决方案')
|
||||
textContent.value += Subheading(`解决方案`) + textStyle(jsonMatch ? jsonMatch : '暂无解决方案')
|
||||
})
|
||||
|
||||
})
|
||||
@ -127,8 +126,8 @@ const pageData = reactive({
|
||||
controlsWidth: 300,
|
||||
tableColumn: [
|
||||
{ label: "预警时间", prop: "yjsj", showOverflowTooltip: true },
|
||||
{ label: "类型", prop: "yjlx" ,showSolt:true },
|
||||
{ label: "内容", prop: "yjnr", showOverflowTooltip: true},
|
||||
{ label: "类型", prop: "yjlx", showSolt: true },
|
||||
{ label: "内容", prop: "yjnr", showOverflowTooltip: true },
|
||||
// ypbg
|
||||
]
|
||||
});
|
||||
@ -141,15 +140,15 @@ const openYjdict = (val) => {
|
||||
yjdict.value.init(val)
|
||||
}
|
||||
watch(() => props.item, (val) => {
|
||||
ItemData.value=val
|
||||
},{deep:true})
|
||||
ItemData.value = val
|
||||
}, { deep: true })
|
||||
|
||||
// 获取列表
|
||||
const getList = () => {
|
||||
const promes = {
|
||||
...pageData.pageConfiger,
|
||||
...queryFrom.value,
|
||||
mxid:props.item.id,
|
||||
mxid: props.item.id,
|
||||
}
|
||||
getYjxxPageList(promes).then((res) => {
|
||||
pageData.tableData = res.records
|
||||
@ -158,8 +157,8 @@ const getList = () => {
|
||||
};
|
||||
// 搜索
|
||||
const onSearch = (val) => {
|
||||
queryFrom.value.startTime = val.startTime&&val.startTime.length > 0 ? val.startTime[0] : '';
|
||||
queryFrom.value.endTime = val.startTime&&val.startTime.length > 0 ? val.startTime[1] : '';
|
||||
queryFrom.value.startTime = val.startTime && val.startTime.length > 0 ? val.startTime[0] : '';
|
||||
queryFrom.value.endTime = val.startTime && val.startTime.length > 0 ? val.startTime[1] : '';
|
||||
pageData.pageConfiger.pageCurrent = 1;
|
||||
getList();
|
||||
};
|
||||
@ -180,7 +179,7 @@ const retenHome = () => {
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
|
||||
window.onresize = function () {
|
||||
window.onresize = function() {
|
||||
tabHeightFn();
|
||||
};
|
||||
};
|
||||
@ -188,7 +187,7 @@ const tabHeightFn = () => {
|
||||
const yzSsyjpzMxgzxl = (params) => {
|
||||
// getYjgzpzMxgzxl({id:'26aefb9f4c7c41b3a4bfb5b68449328b'}).then((res) => {
|
||||
// })
|
||||
getSsyjpzMxgzxl({id:'88c166e670da48e59324906648794b05'}).then((res) => {
|
||||
getSsyjpzMxgzxl({ id: '88c166e670da48e59324906648794b05' }).then((res) => {
|
||||
})
|
||||
}
|
||||
const warningDetails = (row) => {
|
||||
|
||||
Reference in New Issue
Block a user