This commit is contained in:
2025-12-11 18:12:59 +08:00
6 changed files with 158 additions and 71 deletions

View File

@ -196,7 +196,14 @@ export const publicRoutes = [
title: "布控预警",
icon: "article"
}
}, {
},
{
path: "/fouColorWarning",
name: "fouColorWarning",
meta: { title: "四色预警", icon: "article" },
component: () => import("@/views/backOfficeSystem/fourColorManage/warningControl/fouColorWarning/index"),
},
{
path: "/behaviorWarnings",
name: "behaviorWarnings",
meta: { title: "行为预警", icon: "article" },
@ -681,23 +688,43 @@ export const publicRoutes = [
}
},
{
path: "/tacticalResearch",
name: "tacticalResearch",
component: () => import("@/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue"),
path: "/ResearchHome",
name: "ResearchHome",
component: () => import("@/views/backOfficeSystem/JudgmentHome/ResearchHome/index"),
meta: {
title: "战术研判",
icon: "article"
}
},
{
path: "/strategicResearch",
name: "strategicResearch",
component: () => import("@/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue"),
path: "/situationHome",
name: "situationHome",
component: () => import("@/views/backOfficeSystem/JudgmentHome/situationHome/index"),
meta: {
title: "战略研判",
icon: "article"
}
},
// 后面写的研判
// {
// path: "/tacticalResearch",
// name: "tacticalResearch",
// component: () => import("@/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue"),
// meta: {
// title: "战术研判",
// icon: "article"
// }
// },
// {
// path: "/strategicResearch",
// name: "strategicResearch",
// component: () => import("@/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue"),
// meta: {
// title: "战略研判",
// icon: "article"
// }
// },
{
path: "/judgmentCommand",
name: "judgmentCommand",
@ -854,36 +881,19 @@ export const publicRoutes = [
icon: "article"
},
children: [
// {
// path: "/fouColorWarning",
// name: "fouColorWarning",
// meta: { title: "四色预警", icon: "article" },
// component: () => import("@/views/backOfficeSystem/fourColorManage/warningControl/fouColorWarning/index"),
// },
{
path: "/fouColorWarning",
name: "fouColorWarning",
meta: { title: "四色预警", icon: "article" },
component: () => import("@/views/backOfficeSystem/fourColorManage/warningControl/fouColorWarning/index"),
}, {
path: "/CollectCrculate",
name: "CollectCrculate",
component: () => import("@/views/backOfficeSystem/HumanIntelligence/CollectCrculate/index"),
meta: { title: "信息采集", icon: "article" },
},
{
path: "/ResearchHome",
name: "ResearchHome",
component: () => import("@/views/backOfficeSystem/JudgmentHome/ResearchHome/index"),
meta: {
title: "战术研判",
icon: "article"
}
},
{
path: "/situationHome",
name: "situationHome",
component: () => import("@/views/backOfficeSystem/JudgmentHome/situationHome/index"),
meta: {
title: "战略研判",
icon: "article"
}
},
]
},
]

View File

@ -161,6 +161,25 @@ const initChart = () => {
}
}, 100);
};
// 暴露方法给父组件,用于获取图表图片数据
defineExpose({
getChartImage: () => {
if (myChart.value) {
return myChart.value.getDataURL({
type: 'png',
pixelRatio: 2,
backgroundColor: '#fff'
});
}
return null;
},
resizeChart: () => {
if (myChart.value) {
myChart.value.resize();
}
}
});
</script>
<style scoped>

View File

@ -190,6 +190,25 @@ watch([
], () => {
initChart();
});
// 暴露方法给父组件,用于获取图表图片数据
defineExpose({
getChartImage: () => {
if (chartInstance.value) {
return chartInstance.value.getDataURL({
type: 'png',
pixelRatio: 2,
backgroundColor: '#fff'
});
}
return null;
},
resizeChart: () => {
if (chartInstance.value) {
chartInstance.value.resize();
}
}
});
</script>
<style scoped>
:deep(div) {

View File

@ -111,7 +111,10 @@
<h2>2.总结分析</h2>
<p style="min-height: 100px;" v-loading="loading">{{ textContent }} </p>
</div>
<el-button style="position: fixed;bottom: 0;left: 45%;" type="primary" size="default"
@click="downloadWithStyles">下载</el-button>
</div>
<AddForm ref="addForm" :dict="{ D_GS_XS_LX }" />
@ -125,6 +128,8 @@ import { getItem, setItem } from '@/utils/storage'
import { fxbgDywdtj, getDictItem, fxbgJqlxtj, fxbgJqlytj, fxbgYdfx, fxbgXsfx, fxgbCljgf, fxgbCzlfx, fxbgTj } from '@/api/semanticAnalysis'
import { completions } from '@/api/semanticAnalysis'
import { reactive, ref, onMounted, getCurrentInstance, nextTick, computed, watch } from "vue";
import { downloadDocWithStyle } from '@/utils/export.js';
const props = defineProps({
// 数据
search: {
@ -158,10 +163,15 @@ const tabHeight = ref(0)
// 表格高度计算
const tabHeightFn = () => {
tabHeight.value = window.innerHeight - 300
window.onresize = function () {
window.onresize = function() {
tabHeightFn();
};
};
const downloadDocWithStyle = () => {
if (!tableBox.value?.innerHTML) return;
downloadDocWithStyle(tableBox.value?.innerHTML)
}
const pageData = reactive({
parameter: {},
total: 0,

View File

@ -13,8 +13,7 @@
<!-- 表格 -->
<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" />
</template>
@ -31,13 +30,13 @@
</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";
@ -45,7 +44,7 @@ import Search from "@/components/aboutTable/Search.vue";
import { timeValidate } from '@/utils/tools'
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,17 +58,40 @@ 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 = () => {
}
/** 获取原始报备内容
* @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`,
@ -79,17 +101,19 @@ const opneModel = (row) => {
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 += `根据以上警情信息,总结出一个解决方案`
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()
}) + fbtool(`同类事件发生${res.length}次以上预警`)
res.forEach((item,index) => {
res.forEach((item, index) => {
const lx = props.dict.D_BZ_JQLY.find((items) => {
return items.value == item.yjlx
}).zdmc
@ -97,7 +121,7 @@ const opneModel = (row) => {
// 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 +151,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 +165,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 +182,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 +204,7 @@ const retenHome = () => {
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
window.onresize = function () {
window.onresize = function() {
tabHeightFn();
};
};
@ -188,7 +212,7 @@ const tabHeightFn = () => {
const yzSsyjpzMxgzxl = (params) => {
// getYjgzpzMxgzxl({id:'26aefb9f4c7c41b3a4bfb5b68449328b'}).then((res) => {
// })
getSsyjpzMxgzxl({id:'88c166e670da48e59324906648794b05'}).then((res) => {
getSsyjpzMxgzxl({ id: '88c166e670da48e59324906648794b05' }).then((res) => {
})
}
const warningDetails = (row) => {

View File

@ -45,6 +45,7 @@ const initCharts = (data) => {
},
];
data.forEach(item => {
item.count = isNaN(Number(item?.count) || 0) ? 0 : item.count;
if (item.yj_jb == '10') countData[0].value = item.count;
if (item.yj_jb == '20') countData[1].value = item.count;
if (item.yj_jb == '30') countData[2].value = item.count;
@ -95,11 +96,15 @@ const createChartOption = (data, colors) => {
}
},
formatter: (name) => {
const item = data.find(d => d.name === name);
let percentage = ((item.value / total) * 100).toFixed(2);
return `${name} ${item.value} {${item.colorType}|(${percentage}%)}`
const item = data.find(d => d.name === name);
// 确保value是有效数字total不为0
const value = Number(item.value) || 0;
const totalValue = Number(total) || 0;
let percentage = (totalValue > 0 && value > 0) ? ((value / totalValue) * 100).toFixed(2) : '0.00';
// let percentage = ((item.value / total) * 100).toFixed(2);
return `${name} ${item.value} {${item.colorType}|(${percentage}%)}`
}
}
},
series: [
{