Files
sgxt_web/src/views/backOfficeSystem/ResearchJudgment/MoralAnalysis/index.vue

302 lines
10 KiB
Vue
Raw Normal View History

2025-04-16 23:06:01 +08:00
<template>
<div>
<div class="titleBox">
2025-07-04 11:19:35 +08:00
<PageTitle title="情报语义分析"></PageTitle>
2025-04-16 23:06:01 +08:00
</div>
2025-07-04 11:19:35 +08:00
<div class="flex just-between">
<!-- 左边 -->
2025-07-06 15:07:33 +08:00
<div class="ww49" style="min-width: 647px;">
2025-07-04 11:19:35 +08:00
<div ref="searchBox">
2025-07-06 15:07:33 +08:00
<Search :searchArr="searchConfiger" @submit="onSearch">
<el-button type="primary" @click="addForm('add',null)">新增</el-button>
</Search>
2025-07-04 11:19:35 +08:00
</div>
<div class="tabBox">
<MyTable
:tableData="pageData.tableData"
:tableColumn="pageData.tableColumn"
2025-07-06 15:07:33 +08:00
:tableHeight="pageData.tableHeight1"
2025-07-04 11:19:35 +08:00
:key="pageData.keyCount"
:tableConfiger="pageData.tableConfiger"
:controlsWidth="pageData.controlsWidth"
>
<template #controls="{ row }">
2025-07-06 15:07:33 +08:00
<el-link type="primary" @click="addForm('edit', row.id)">编辑</el-link>
<el-link type="danger" @click="delDictItem(row.id)">删除</el-link>
2025-07-04 11:19:35 +08:00
</template>
</MyTable>
2025-07-18 15:41:15 +08:00
<div class="txetBox">
{{ container }}
</div>
2025-07-04 11:19:35 +08:00
<div class="footBnt">
2025-07-18 10:54:07 +08:00
<el-button type="primary" @click="showText = true">导入</el-button>
2025-07-18 15:41:15 +08:00
<span class="relative ml10">
<el-button type="primary" v-loading="btnLoading" @click="handleFx">语义分析</el-button>
<span v-if="btnLoading" class="f12 absolute nowrap" style="color: #333333; left: 92px;bottom: 5px;">数据解析中......</span>
</span>
2025-07-04 11:19:35 +08:00
</div>
</div>
</div>
<!-- 右边表格 -->
<div class="ww49">
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch" />
</div>
<div class="tabBox">
<MyTable
:tableData="pageData.tableData"
2025-07-16 11:03:44 +08:00
:tableColumn="pageData.tableColumn1"
2025-07-04 11:19:35 +08:00
:tableHeight="pageData.tableHeight"
:key="pageData.keyCount"
:tableConfiger="pageData.tableConfigerR"
2025-07-18 15:41:15 +08:00
:controlsWidth="pageData.controlsWidthR"
2025-07-04 11:19:35 +08:00
>
<template #controls="{ row }">
2025-07-18 15:41:15 +08:00
<el-link type="primary" @click="lookdetail('edit', row)">编辑</el-link>
<el-link type="primary" @click="lookdetail('row', row)">详情</el-link>
2025-07-06 15:07:33 +08:00
<el-link type="danger" @click="delDictItemRight(row.id)">删除</el-link>
2025-07-04 11:19:35 +08:00
</template>
</MyTable>
<Pages
@changeNo="changeNo"
@changeSize="changeSize"
:tableHeight="pageData.tableHeight"
:pageConfiger="{ ...pageData.pageConfiger, total: pageData.total }"
/>
</div>
</div>
2025-04-16 23:06:01 +08:00
</div>
<!-- 编辑详情 -->
<EditAddForm ref="detailDiloag" @updateDate="getList" />
2025-07-18 15:41:15 +08:00
<Detail ref="detailForm" v-if="isShow" :dic="{D_BZ_SF,D_BZ_XB,D_GS_XS_LY,D_BZ_SSZT,D_GS_XS_LX ,D_GS_XS_QTLX}" />
2025-07-18 10:54:07 +08:00
<!-- 文字解析 -->
<ExtractionText v-model="showText" @change="getText"></ExtractionText>
2025-04-16 23:06:01 +08:00
</div>
</template>
<script setup>
2025-07-18 10:54:07 +08:00
import ExtractionText from "@/components/ExtractionText/index.vue";
2025-04-16 23:06:01 +08:00
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 EditAddForm from "./components/editAddForm.vue";
2025-07-18 15:41:15 +08:00
import Detail from "./components/detail.vue";
import { qcckGet, qcckPost, ParsingText } from "@/api/qcckApi.js";
2025-04-16 23:06:01 +08:00
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
2025-07-18 15:41:15 +08:00
const {D_GS_ZDQT_FXDJ,D_GS_XS_ZLLX,D_GS_XS_CZZT,D_GS_XS_LY, D_BZ_SSZT,D_BZ_SF,D_GS_XS_LX ,D_GS_XS_QTLX,D_BZ_XB,D_BZ_XSSHZT} = proxy.$dict("D_GS_ZDQT_FXDJ","D_GS_XS_ZLLX","D_GS_XS_CZZT","D_GS_XS_LY","D_BZ_SSZT","D_BZ_SF","D_GS_XS_LX","D_GS_XS_QTLX","D_BZ_XB","D_BZ_XSSHZT"); //获取字典数据
2025-04-16 23:06:01 +08:00
const detailDiloag = ref();
2025-07-18 15:41:15 +08:00
const detailForm = ref();
2025-04-16 23:06:01 +08:00
const searchBox = ref(); //搜索框
2025-07-18 10:54:07 +08:00
const showText = ref(false);
2025-07-18 15:41:15 +08:00
const isShow = ref(false);
2025-04-16 23:06:01 +08:00
const searchConfiger = ref([
2025-07-04 11:19:35 +08:00
{
label: "语义名称",
prop: "yymc",
placeholder: "请输入语义名称",
showType: "input"
},
{
label: "要素类型",
prop: "yslx",
placeholder: "请选择要素类型",
showType: "select"
},
{
label: "要素名称",
prop: "ysmc",
placeholder: "请输入要素名称",
showType: "input"
}
2025-04-16 23:06:01 +08:00
]);
const queryFrom = ref({});
2025-07-18 15:41:15 +08:00
const container = ref('')
const btnLoading = ref(false)
const prsentText = ref(null)
2025-04-16 23:06:01 +08:00
const pageData = reactive({
2025-07-06 15:07:33 +08:00
tableData: [], //表格数据
2025-04-16 23:06:01 +08:00
keyCount: 0,
tableConfiger: {
rowHieght: 61,
2025-07-06 15:07:33 +08:00
showSelectType: "null",
2025-04-16 23:06:01 +08:00
loading: false
},
2025-07-06 15:07:33 +08:00
tableHeight1:300,
2025-07-04 11:19:35 +08:00
tableConfigerR: {
rowHieght: 61,
showSelectType: null,
loading: false
},
2025-04-16 23:06:01 +08:00
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
}, //分页
2025-07-16 11:03:44 +08:00
controlsWidth: 120, //操作栏宽度
2025-07-18 15:41:15 +08:00
controlsWidthR: 140, //操作栏宽度
2025-04-16 23:06:01 +08:00
tableColumn: [
2025-07-06 15:07:33 +08:00
{ label: "语义名称", prop: "yymc",showOverflowTooltip:true },
{ label: "要素类型", prop: "yslx",showOverflowTooltip:true },
{ label: "要素名称", prop: "ysmc",showOverflowTooltip:true },
{ label: "要素描述", prop: "ysms",showOverflowTooltip:true },
2025-07-16 11:03:44 +08:00
],
tableColumn1: [
{ label: "线索名称", prop: "yymc",showOverflowTooltip:true },
{ label: "线索类型", prop: "yslx",showOverflowTooltip:true },
{ label: "指向地点", prop: "ysms",showOverflowTooltip:true },
{ label: "线索内容", prop: "ysms",showOverflowTooltip:true },
],
2025-04-16 23:06:01 +08:00
});
onMounted(() => {
tabHeightFn();
2025-07-06 15:07:33 +08:00
getList();
2025-04-16 23:06:01 +08:00
});
2025-07-06 15:07:33 +08:00
2025-04-16 23:06:01 +08:00
// 搜索
2025-07-04 11:19:35 +08:00
const onSearch = (val) => {
queryFrom.value = { ...val };
2025-04-16 23:06:01 +08:00
pageData.pageConfiger.pageCurrent = 1;
2025-07-04 11:19:35 +08:00
getList();
};
2025-04-16 23:06:01 +08:00
2025-07-06 15:07:33 +08:00
2025-04-16 23:06:01 +08:00
2025-07-04 11:19:35 +08:00
const getList = () => {
2025-07-06 15:07:33 +08:00
pageData.tableConfiger.loading = true;
qcckGet(queryFrom.value,'/mosty-gsxt/qbyy/selectList').then((res)=>{
pageData.tableData = res || [];
pageData.tableConfiger.loading = false;
})
2025-07-04 11:19:35 +08:00
};
2025-04-16 23:06:01 +08:00
// 删除
2025-07-06 15:07:33 +08:00
const delDictItem = (id) => {
proxy.$confirm("确定要删除", "警告", {type: "warning"}).then(() => {
qcckPost({id},'/mosty-gsxt/qbyy/delete').then(()=>{
proxy.$message({ type: "success", message: "删除成功" });
getList();
})
}).catch(() => {});
};
// 删除右边
const delDictItemRight = (id) => {
2025-04-16 23:06:01 +08:00
// proxy.$confirm("确定要删除", "警告", {type: "warning"}).then(() => {
2025-07-06 15:07:33 +08:00
// qcckPost({id},'/mosty-gsxt/qbyy/delete').then(()=>{
2025-04-16 23:06:01 +08:00
// proxy.$message({ type: "success", message: "删除成功" });
// getList();
// })
// }).catch(() => {});
2025-07-04 11:19:35 +08:00
};
2025-04-16 23:06:01 +08:00
2025-07-06 15:07:33 +08:00
// 新增数据 -- 左边
const addForm = (type, id) =>{
detailDiloag.value.init(type, id);
}
2025-07-18 15:41:15 +08:00
// 新增数据 -- 左边
const lookdetail = (type, row) =>{
isShow.value = true;
setTimeout(()=>{
detailForm.value.init(type, row);
},500)
}
2025-07-06 15:07:33 +08:00
const changeNo = (val) => {
2025-07-15 16:56:26 +08:00
// pageData.pageConfiger.pageCurrent = val;
2025-07-06 15:07:33 +08:00
// getListR();
};
const changeSize = (val) => {
// pageData.pageConfiger.pageSize = val;
// getListR();
};
2025-04-16 23:06:01 +08:00
// 新增
const addEdit = (type, row) => {
2025-07-06 15:07:33 +08:00
2025-04-16 23:06:01 +08:00
};
2025-07-18 15:41:15 +08:00
// 提取数据
const getText = (val) =>{
prsentText.value = null; //先清空
container.value = val.text;
let obj = {
"model": "deepseek-reasoner",
"messages": [
{
"role": "system",
"content": "# 角色定位\n你是一名资深警务人员尤其擅长对警情、案件、线索等非结构化文本数据进行阅读理解并从中提取各种对象特征信息进行结构化并总结各种对象之间的关联关系。\n##  - person:人物    - id:唯一值   - name:姓名   - enName:英文姓名   - nickName:绰号   - aliasName:别名   - screenName:网名   - idcard:身份证号码   - phoneNo:手机号码   - bankCard:银行卡号   - passporNumber:护照号码   - permanentResidenceAddress:户籍地址   - residenceAddress:现住地址 - jbxx:基本信息     - id:唯一值     - xsmc:线索名称     - xslx:线索类型     - qbly:情报来源     - kssj:开始时间     - jssj:结束时间     - qtlx:群体类型     - qtmc:群体名称     - sjrs:设计人数     - sbdw:送报单位## 注意点\n- 地址信息能够根据上下文信息按照省、市、县、街道/乡镇、路名分段补全并标准化。例如:四川省 成都市 高新区 桂溪街道 交子大道11号\n- 对象之间的关联关系由对象类型、对象id、关系类型、目标对象类型、目标对象id 5个属性组成。\n"
},
{
"role": "user",
"content": "# 任务\n根据警情信息识别对象信息以及对象之间的关联关系。最后以json形式输出不要做任何解释。直接给出完整的json\n## 注意\n- 各种不同类型的对象分别用对象数组存储;\n- 对象之间的关系存储在relation数组中\n\n# 警情信息\n  - "
}
],
"max_tokens": 4096,
"stream": false
}
obj.messages[1].content = obj.messages[1].content + val.text;
prsentText.value = obj;
}
const handleFx = () => {
if(!prsentText.value) return proxy.$message({ type: "warning", message: "请先上传要解析的文件" });;
btnLoading.value = true;
ParsingText( prsentText.value,(res)=>{
btnLoading.value = false;
let content = res.data.choices[0].message.content;
let message = null;
try{
message = content ? JSON.parse(content):''
}catch(err){
proxy.$message({ type: "danger", message: "解析异常,请重新上传解析" });;
}
if(!message) return;
console.log(message,'=================将结果');
})
}
2025-04-16 23:06:01 +08:00
// 表格高度计算
const tabHeightFn = () => {
2025-07-04 11:19:35 +08:00
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 280;
2025-04-16 23:06:01 +08:00
window.onresize = function () {
tabHeightFn();
};
};
</script>
2025-07-04 11:19:35 +08:00
<style lang="scss" scoped>
.footBnt{
width: 100%;
position: absolute;
bottom: 10px;
display: flex;
justify-content: center;
}
2025-07-06 15:07:33 +08:00
.txetBox{
position: absolute;
bottom: 50px;
height: 210px;
2025-07-18 15:41:15 +08:00
width: calc(100% - 20px);
2025-07-06 15:07:33 +08:00
padding: 0 10px;
box-sizing: border-box;
2025-07-18 15:41:15 +08:00
border: 2px dashed #ccc;
margin: 0 10px;
color: #333;
2025-07-06 15:07:33 +08:00
}
2025-07-04 11:19:35 +08:00
</style>
2025-04-16 23:06:01 +08:00
<style>
.el-loading-mask {
background: rgba(0, 0, 0, 0.5) !important;
}
</style>