更新页面
This commit is contained in:
22
src/App.vue
22
src/App.vue
@ -6,10 +6,12 @@
|
|||||||
</router-view>
|
</router-view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, nextTick, provide, onMounted } from "vue";
|
import * as ocr from "@paddlejs-models/ocr";
|
||||||
|
import { ref, nextTick, provide, onMounted,getCurrentInstance } from "vue";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { getItem } from "@/utils/storage";
|
import { getItem } from "@/utils/storage";
|
||||||
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
|
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
generateNewStyle(store.getters.mainColor).then((newStyle) => {
|
generateNewStyle(store.getters.mainColor).then((newStyle) => {
|
||||||
writeNewStyle(newStyle);
|
writeNewStyle(newStyle);
|
||||||
@ -23,9 +25,25 @@ const reload = () => {
|
|||||||
};
|
};
|
||||||
provide("reload", reload);
|
provide("reload", reload);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let dept = getItem("deptId");
|
|
||||||
document.title = "林芝";
|
document.title = "林芝";
|
||||||
|
initPage()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@Descripttion:图片页面初始化
|
||||||
|
*@Author: PengShuai
|
||||||
|
*/
|
||||||
|
const initPage = async () => {
|
||||||
|
try {
|
||||||
|
await ocr.init();// 模型初始化
|
||||||
|
imgIsLoad = true;
|
||||||
|
proxy.$message({ type: "success", message: "加载成功" });
|
||||||
|
} catch (err) {
|
||||||
|
proxy.$message({ type: "error", message: "加载失败,请刷新页面" });
|
||||||
|
imgIsLoad = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./styles/index.scss";
|
@import "./styles/index.scss";
|
||||||
|
@ -1,22 +1,17 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const api = "/mosty-api";
|
const api = "/mosty-api";
|
||||||
const egisSpace = "/egis-space";
|
|
||||||
|
|
||||||
// 选择站口名称
|
// 解析数据
|
||||||
export function egisSpaceGet(fun,coords){
|
export function ParsingText(data,fun){
|
||||||
let params = {
|
axios({
|
||||||
pageNum: 1,
|
method: 'post',
|
||||||
pageSize: 1000,
|
url: '/chat/completions',
|
||||||
keyword: "",
|
data:data,
|
||||||
geometry: `{"type":"Polygon","coordinates":${JSON.stringify(coords)}}`,
|
headers: { 'Authorization': 'Bearer sk-064b5c53131c4046883b718f2b31c050' }
|
||||||
};
|
}).then( (res) => {
|
||||||
params.geometry = encodeURIComponent(params.geometry)
|
fun(res)
|
||||||
|
})
|
||||||
let url = egisSpace + '/space/search/custom/ms-dy-intersections'
|
|
||||||
axios.get(url,{params}).then((res) => {
|
|
||||||
fun(res.data)
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<input type="file" id="file-input" accept=".txt,.pdf,.docx,'.mp4','.mp3','.wav'"/>
|
<input type="file" id="file-input" accept=".txt,.pdf,.docx,'.mp4','.mp3','.wav'"/>
|
||||||
<button @click="chooseFile">选择文件</button>
|
<button @click="chooseFile">选择文件</button>
|
||||||
<p id="file-info">未选择文件</p>
|
<p id="file-info">{{ fileText }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button id="extract-btn" disabled>提取文本</button>
|
<button id="extract-btn" disabled>提取文本</button>
|
||||||
|
|
||||||
<h3>提取结果:</h3>
|
<h3>提取结果:</h3>
|
||||||
<div id="result">请先上传文件...</div>
|
<div id="result">{{ content }}</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 图片解析 -->
|
<!-- 图片解析 -->
|
||||||
<div v-show="active == '图片解析'" v-loading="loading" element-loading-text="模型加载中......">
|
<div v-show="active == '图片解析'" v-loading="loading" element-loading-text="模型加载中......">
|
||||||
@ -30,8 +30,8 @@
|
|||||||
<h1>文件文本提取工具</h1>
|
<h1>文件文本提取工具</h1>
|
||||||
<span title="刷新" class="pointer" >
|
<span title="刷新" class="pointer" >
|
||||||
<el-icon color="#0072ff" size="30px" @click="frashJs"><RefreshRight /></el-icon>
|
<el-icon color="#0072ff" size="30px" @click="frashJs"><RefreshRight /></el-icon>
|
||||||
<el-icon color="#23c044" size="14px" v-if="hasLoadingJS"><CircleCheckFilled /></el-icon>
|
<el-icon color="#23c044" size="14px" v-if="hasLoad"><CircleCheckFilled /></el-icon>
|
||||||
<el-icon color="#e60e0e" size="14px" v-if="!hasLoadingJS"><CircleCloseFilled /></el-icon>
|
<el-icon color="#e60e0e" size="14px" v-if="!hasLoad"><CircleCloseFilled /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p>上传文件提取文本内容(支持 .png, .jpg )</p>
|
<p>上传文件提取文本内容(支持 .png, .jpg )</p>
|
||||||
@ -78,10 +78,13 @@ const props = defineProps({
|
|||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const content = ref('请先上传文件...')
|
||||||
|
const fileText = ref('未选择文件')
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const emits = defineEmits(["update:modelValue", "change"]);
|
const emits = defineEmits(["update:modelValue", "change"]);
|
||||||
const active = ref('文件解析')
|
const active = ref('文件解析')
|
||||||
|
const hasLoad = ref(false)
|
||||||
const files = ref({})
|
const files = ref({})
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const linadingImg = ref(false)
|
const linadingImg = ref(false)
|
||||||
@ -94,32 +97,26 @@ const textStyle = reactive({
|
|||||||
width: "",
|
width: "",
|
||||||
height: ""
|
height: ""
|
||||||
})
|
})
|
||||||
const hasLoadingJS = ref(null) //加载的状态 1 :成功,2:失败
|
|
||||||
|
|
||||||
watch(()=>props.modelValue,val=>{
|
|
||||||
if(val) initDemo();
|
|
||||||
},{immediate:true,deep:true})
|
|
||||||
|
|
||||||
|
|
||||||
const initDemo = () =>{
|
const initDemo = () =>{
|
||||||
if(hasLoadingJS.value == null) initPage();
|
loading.value = imgIsLoad ? false : true;
|
||||||
|
hasLoad.value = imgIsLoad ? true : false;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const fileInput = document.getElementById("file-input");
|
const fileInput = document.getElementById("file-input");
|
||||||
const fileInfo = document.getElementById("file-info");
|
|
||||||
const extractBtn = document.getElementById("extract-btn");
|
const extractBtn = document.getElementById("extract-btn");
|
||||||
const resultDiv = document.getElementById("result");
|
|
||||||
let selectedFile = null;
|
let selectedFile = null;
|
||||||
// 监听文件选择
|
// 监听文件选择
|
||||||
fileInput.addEventListener("change", function (e) {
|
fileInput.addEventListener("change", function (e) {
|
||||||
if (e.target.files.length > 0) {
|
if (e.target.files.length > 0) {
|
||||||
selectedFile = e.target.files[0];
|
selectedFile = e.target.files[0];
|
||||||
fileInfo.textContent = `已选择: ${selectedFile.name} (${(
|
fileText.value = `已选择: ${selectedFile.name} (${(
|
||||||
selectedFile.size / 1024
|
selectedFile.size / 1024
|
||||||
).toFixed(2)} KB)`;
|
).toFixed(2)} KB)`;
|
||||||
extractBtn.disabled = false;
|
extractBtn.disabled = false;
|
||||||
} else {
|
} else {
|
||||||
selectedFile = null;
|
selectedFile = null;
|
||||||
fileInfo.textContent = "未选择文件";
|
fileText.value = "未选择文件";
|
||||||
extractBtn.disabled = true;
|
extractBtn.disabled = true;
|
||||||
}
|
}
|
||||||
if (selectedFile.type == "video/mp4") {
|
if (selectedFile.type == "video/mp4") {
|
||||||
@ -128,13 +125,11 @@ const initDemo = () =>{
|
|||||||
});
|
});
|
||||||
// 提取文本按钮点击事件
|
// 提取文本按钮点击事件
|
||||||
extractBtn.addEventListener("click", async function () {
|
extractBtn.addEventListener("click", async function () {
|
||||||
if (!selectedFile) return (resultDiv.textContent = "请先选择文件");
|
if (!selectedFile) return (content.value = "请先选择文件");
|
||||||
resultDiv.textContent = "正在处理文件...";
|
content.value = "正在处理文件...";
|
||||||
try {
|
try {
|
||||||
let text = "";
|
let text = "";
|
||||||
const fileType = selectedFile.name.split(".").pop().toLowerCase();
|
const fileType = selectedFile.name.split(".").pop().toLowerCase();
|
||||||
console.log(selectedFile);
|
|
||||||
console.log(fileType,'===fileType');
|
|
||||||
if (fileType === "txt") {
|
if (fileType === "txt") {
|
||||||
// 处理文本文件
|
// 处理文本文件
|
||||||
text = await readTextFile(selectedFile);
|
text = await readTextFile(selectedFile);
|
||||||
@ -144,26 +139,30 @@ const initDemo = () =>{
|
|||||||
} else if (fileType === "docx") {
|
} else if (fileType === "docx") {
|
||||||
// 处理Word文件
|
// 处理Word文件
|
||||||
text = await extractTextFromDocx(selectedFile);
|
text = await extractTextFromDocx(selectedFile);
|
||||||
console.log(text, "===word");
|
|
||||||
} else if (["mp4", "mp3", "wav"].includes(fileType)) {
|
} else if (["mp4", "mp3", "wav"].includes(fileType)) {
|
||||||
// 处理mp4,mp3,wav文件
|
// 处理mp4,mp3,wav文件
|
||||||
await start();
|
await start();
|
||||||
text = "数据加载有点慢,请稍等。。。。";
|
text = "数据加载有点慢,请稍等。。。。";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
resultDiv.textContent = videoText;
|
content.value = videoText;
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}else {
|
}else {
|
||||||
throw new Error("不支持的文件类型");
|
throw new Error("不支持的文件类型");
|
||||||
}
|
}
|
||||||
resultDiv.textContent = text || "未提取到文本内容";
|
content.value = text || "未提取到文本内容";
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
resultDiv.textContent = `处理失败: ${error.message}`;
|
content.value = `处理失败: ${error.message}`;
|
||||||
console.error(error);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(()=>props.modelValue,val=>{
|
||||||
|
if(val) initDemo();
|
||||||
|
},{immediate:true,deep:true})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 读取文本文件
|
// 读取文本文件
|
||||||
function readTextFile(file) {
|
function readTextFile(file) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -226,26 +225,18 @@ async function extractTextFromDocx(file) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*@Descripttion:图片页面初始化
|
const frashJs = async () =>{
|
||||||
*@Author: PengShuai
|
if(!imgIsLoad){
|
||||||
*/
|
try {
|
||||||
const initPage = async () => {
|
await ocr.init();// 模型初始化
|
||||||
loading.value = true;
|
imgIsLoad = true;
|
||||||
try {
|
proxy.$message({ type: "success", message: "加载成功" });
|
||||||
await ocr.init();// 模型初始化
|
} catch (err) {
|
||||||
proxy.$message({ type: "success", message: "加载成功" });
|
proxy.$message({ type: "error", message: "加载失败,请刷新页面" });
|
||||||
loading.value = false;
|
imgIsLoad = false;
|
||||||
hasLoadingJS.value = 1;
|
}
|
||||||
} catch (err) {
|
|
||||||
proxy.$message({ type: "error", message: "加载失败,请刷新页面" });
|
|
||||||
loading.value = false;
|
|
||||||
hasLoadingJS.value = 2;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
const frashJs = () =>{
|
|
||||||
if(hasLoadingJS.value == 1) return;
|
|
||||||
initPage()
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*@Descripttion:图片上传事件
|
*@Descripttion:图片上传事件
|
||||||
@ -276,35 +267,30 @@ const getRecognize = async () => {
|
|||||||
|
|
||||||
// 切换标签
|
// 切换标签
|
||||||
const changeRadio = (val) =>{
|
const changeRadio = (val) =>{
|
||||||
if(val == '图片解析') if(hasLoadingJS.value == 2) initPage();
|
content.value = "请先上传文件...";
|
||||||
const resultDiv = document.getElementById("result");
|
fileText.value = "选择文件";
|
||||||
resultDiv.textContent = "请先上传文件...";
|
|
||||||
const fileInfo = document.getElementById("file-info");
|
|
||||||
fileInfo.textContent = "选择文件";
|
|
||||||
files.value = {}
|
files.value = {}
|
||||||
alertText.value = '请先上传文件...';
|
alertText.value = '请先上传文件...';
|
||||||
texts.value = []
|
texts.value = []
|
||||||
image.value = ''
|
image.value = ''
|
||||||
|
if(val == '图片解析'){
|
||||||
|
if(!imgIsLoad) proxy.$message({ type: "error", message: "加载失败,请刷新页面" });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const onComfirm = () => {
|
const onComfirm = () => {
|
||||||
if(active == '文件解析'){
|
if(active.value == '文件解析'){
|
||||||
const resultDiv = document.getElementById("result");
|
let obj = { text: content.value };
|
||||||
let obj = {
|
|
||||||
text: resultDiv.textContent
|
|
||||||
};
|
|
||||||
emits("change", obj);
|
emits("change", obj);
|
||||||
}else{
|
}else{
|
||||||
emits("change", {text:texts.value});
|
emits("change", {text:texts.value.join(',\n')});
|
||||||
}
|
}
|
||||||
|
handleClose()
|
||||||
};
|
};
|
||||||
|
|
||||||
// 关闭
|
// 关闭
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
const resultDiv = document.getElementById("result");
|
content.value = "请先上传文件";
|
||||||
resultDiv.textContent = "请先上传文件";
|
fileText.value = "未选择文件";
|
||||||
const fileInfo = document.getElementById("file-info");
|
|
||||||
fileInfo.textContent = "未选择文件";
|
|
||||||
fileInfo.textContent = "选择文件";
|
|
||||||
files.value = {}
|
files.value = {}
|
||||||
alertText.value = '请先上传文件...';
|
alertText.value = '请先上传文件...';
|
||||||
texts.value = []
|
texts.value = []
|
||||||
|
@ -85,10 +85,6 @@ const formData = ref([
|
|||||||
{ prop: "gapline", type: "slot",width:'100%' },
|
{ prop: "gapline", type: "slot",width:'100%' },
|
||||||
{ prop: "scfj", type: "slot",width:'100%'},
|
{ prop: "scfj", type: "slot",width:'100%'},
|
||||||
{ label: "线索内容", prop: "xsNr", type: "textarea",width:'100%'},
|
{ label: "线索内容", prop: "xsNr", type: "textarea",width:'100%'},
|
||||||
{ label: "群体类型", prop: "qtlx", type: "select",options:props.dic.D_GS_XS_QTLX },
|
|
||||||
{ label: "群体名称", prop: "qtmc", type: "input"},
|
|
||||||
{ label: "涉及人数", prop: "sjrs", type: "inputNumber"},
|
|
||||||
{ label: "线索报送单位", prop: "ssbmdm", isAll:true, type: "department"},
|
|
||||||
]);
|
]);
|
||||||
const fjdz = ref()
|
const fjdz = ref()
|
||||||
const listQuery = ref({}); //表单
|
const listQuery = ref({}); //表单
|
||||||
|
@ -0,0 +1,173 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dialog" v-if="dialogForm">
|
||||||
|
<div class="head_box">
|
||||||
|
<span class="title">详情</span>
|
||||||
|
<div>
|
||||||
|
<el-button @click="close">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form_cnt">
|
||||||
|
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
|
||||||
|
<template #gapdive>
|
||||||
|
<div style="width: 100%;height: 10px;" class="mb20">
|
||||||
|
<el-divider content-position="left">基础信息</el-divider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #gapline>
|
||||||
|
<div style="width: 100%;height: 10px;" class="mb20">
|
||||||
|
<el-divider content-position="left">线索内容</el-divider>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #scfj>
|
||||||
|
<div style="width: 100%;padding-left: 50px;">
|
||||||
|
<div>上传附件:<span class="f12">(可附电子表格、Word文档、图像、音视频文件)</span> </div>
|
||||||
|
<div><MOSTY.Upload :showBtn="true" disabled :limit="10" v-model="fjdz" /> </div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</FormMessage>
|
||||||
|
<el-divider content-position="left"><span class="mr20">相关人员</span> </el-divider>
|
||||||
|
<MyTable
|
||||||
|
:tableData="pageForm.tableData"
|
||||||
|
:tableColumn="pageForm.tableColumn"
|
||||||
|
:tableHeight="pageForm.tableHeight"
|
||||||
|
:key="pageForm.keyCount"
|
||||||
|
:tableConfiger="pageForm.tableConfiger"
|
||||||
|
:controlsWidth="pageForm.controlsWidth"
|
||||||
|
>
|
||||||
|
<template #xb="{row}">
|
||||||
|
<DictTag :value="row.xb" :tag="false" :options="props.dic.D_BZ_XB" />
|
||||||
|
</template>
|
||||||
|
<template #bqList="{row}">
|
||||||
|
<div v-if="row.bqList">
|
||||||
|
<el-tag type="success" v-for="(it,idx) in row.bqList" :key="idx">{{ it.bqMc }}</el-tag >
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</MyTable>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import * as MOSTY from "@/components/MyComponents/index";
|
||||||
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||||
|
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||||
|
import { qcckGet, qcckPost, qcckPut } from "@/api/qcckApi.js";
|
||||||
|
import { ref, defineExpose, reactive, onMounted, defineEmits, getCurrentInstance, nextTick } from "vue";
|
||||||
|
const emit = defineEmits(["change"]);
|
||||||
|
const props = defineProps({
|
||||||
|
dic: Object
|
||||||
|
});
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const dialogForm = ref(false); //弹窗
|
||||||
|
const rules = reactive({
|
||||||
|
xsMc: [{ required: true, message: "请输入线索名称", trigger: "blur" }],
|
||||||
|
xlLx: [{ required: true, message: "请选择线索类型", trigger: "change" }],
|
||||||
|
qbLy: [{ required: true, message: "请选择情报来源", trigger: "change" }],
|
||||||
|
});
|
||||||
|
const formData = ref([
|
||||||
|
{ prop: "gapdive", type: "slot",width:'100%' },
|
||||||
|
{ label: "线索名称", prop: "xsMc", type: "input" },
|
||||||
|
{ label: "线索类型", prop: "xlLx", type: "select", options:props.dic.D_GS_XS_LX },
|
||||||
|
{ label: "情报来源", prop: "qbLy", type: "select", options:props.dic.D_GS_XS_LY},
|
||||||
|
{ label: "指向开始时间", prop: "zxkssj", type: "datetime"},
|
||||||
|
{ label: "指向结束时间", prop: "zxjssj", type: "datetime"},
|
||||||
|
{ label: "指向地点", prop: "zxdz", type: "input"},
|
||||||
|
{ label: "所属专题", prop: "sszt", type: "select",options:props.dic.D_BZ_SSZT},
|
||||||
|
{ prop: "gapline", type: "slot",width:'100%' },
|
||||||
|
{ prop: "scfj", type: "slot",width:'100%'},
|
||||||
|
{ label: "线索内容", prop: "xsNr", type: "textarea",width:'100%'},
|
||||||
|
]);
|
||||||
|
const fjdz = ref()
|
||||||
|
const listQuery = ref({}); //表单
|
||||||
|
const loading = ref(false);
|
||||||
|
const elform = ref();
|
||||||
|
const title = ref("");
|
||||||
|
const pageForm = reactive({
|
||||||
|
tableData: [],
|
||||||
|
keyCount: 0,
|
||||||
|
tableConfiger: {
|
||||||
|
rowHieght: 61,
|
||||||
|
showSelectType: "checkBox",
|
||||||
|
loading: false,
|
||||||
|
haveControls: false,
|
||||||
|
},
|
||||||
|
controlsWidth: 220,
|
||||||
|
tableColumn: [
|
||||||
|
{ label: "姓名", prop: "xm" },
|
||||||
|
{ label: "性别", prop: "xb",showSolt:true },
|
||||||
|
{ label: "身份证号", prop: "sfzh" },
|
||||||
|
{ label: "户籍地", prop: "hjdz" },
|
||||||
|
{ label: "户籍地派出所", prop: "hjdpcs" },
|
||||||
|
{ label: "标签", prop: "bqList",showSolt:true }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
onMounted(()=>{
|
||||||
|
tabHeightFn()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 初始化数据
|
||||||
|
const init = (type, row) => {
|
||||||
|
fjdz.value = []
|
||||||
|
tabHeightFn()
|
||||||
|
dialogForm.value = true;
|
||||||
|
title.value = type == "add" ? "新增" : type == "info" ? "详情" : "编辑";
|
||||||
|
// 初始化表单数据,并根据详情页设置禁用状态
|
||||||
|
// if (row) getDataById(row.id);
|
||||||
|
};
|
||||||
|
// 根据id查询详情
|
||||||
|
const getDataById = (id) => {
|
||||||
|
// qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => {
|
||||||
|
// listQuery.value = res;
|
||||||
|
// pageForm.tableData = res.ryList || [];
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭
|
||||||
|
const close = () => {
|
||||||
|
fjdz.value = []
|
||||||
|
listQuery.value = {};
|
||||||
|
dialogForm.value = false;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 表格高度计算
|
||||||
|
const tabHeightFn = () => {
|
||||||
|
pageForm.tableHeight = window.innerHeight - 720;
|
||||||
|
window.onresize = function () {
|
||||||
|
tabHeightFn();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({ init });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "~@/assets/css/layout.scss";
|
||||||
|
@import "~@/assets/css/element-plus.scss";
|
||||||
|
::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
|
||||||
|
color: #0072ff;
|
||||||
|
background: rgba(0, 114, 255, 0.3);
|
||||||
|
}
|
||||||
|
.boxlist {
|
||||||
|
width: 99%;
|
||||||
|
height: 225px;
|
||||||
|
margin-top: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .avatar-uploader{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-upload-list{
|
||||||
|
margin-left: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
::v-deep .el-upload-list__item-name .el-icon{
|
||||||
|
top: 3px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -19,17 +19,21 @@
|
|||||||
:key="pageData.keyCount"
|
:key="pageData.keyCount"
|
||||||
:tableConfiger="pageData.tableConfiger"
|
:tableConfiger="pageData.tableConfiger"
|
||||||
:controlsWidth="pageData.controlsWidth"
|
:controlsWidth="pageData.controlsWidth"
|
||||||
@chooseData="chooseData"
|
|
||||||
>
|
>
|
||||||
<template #controls="{ row }">
|
<template #controls="{ row }">
|
||||||
<el-link type="primary" @click="addForm('edit', row.id)">编辑</el-link>
|
<el-link type="primary" @click="addForm('edit', row.id)">编辑</el-link>
|
||||||
<el-link type="danger" @click="delDictItem(row.id)">删除</el-link>
|
<el-link type="danger" @click="delDictItem(row.id)">删除</el-link>
|
||||||
</template>
|
</template>
|
||||||
</MyTable>
|
</MyTable>
|
||||||
<div class="txetBox"></div>
|
<div class="txetBox">
|
||||||
|
{{ container }}
|
||||||
|
</div>
|
||||||
<div class="footBnt">
|
<div class="footBnt">
|
||||||
<el-button type="primary" @click="showText = true">导入</el-button>
|
<el-button type="primary" @click="showText = true">导入</el-button>
|
||||||
<el-button type="primary">语义分析</el-button>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -46,11 +50,11 @@
|
|||||||
:tableHeight="pageData.tableHeight"
|
:tableHeight="pageData.tableHeight"
|
||||||
:key="pageData.keyCount"
|
:key="pageData.keyCount"
|
||||||
:tableConfiger="pageData.tableConfigerR"
|
:tableConfiger="pageData.tableConfigerR"
|
||||||
:controlsWidth="pageData.controlsWidth"
|
:controlsWidth="pageData.controlsWidthR"
|
||||||
@chooseData="chooseData"
|
|
||||||
>
|
>
|
||||||
<template #controls="{ row }">
|
<template #controls="{ row }">
|
||||||
<el-link type="primary" @click="addEdit('edit', row)">编辑</el-link>
|
<el-link type="primary" @click="lookdetail('edit', row)">编辑</el-link>
|
||||||
|
<el-link type="primary" @click="lookdetail('row', row)">详情</el-link>
|
||||||
<el-link type="danger" @click="delDictItemRight(row.id)">删除</el-link>
|
<el-link type="danger" @click="delDictItemRight(row.id)">删除</el-link>
|
||||||
</template>
|
</template>
|
||||||
</MyTable>
|
</MyTable>
|
||||||
@ -65,6 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 编辑详情 -->
|
<!-- 编辑详情 -->
|
||||||
<EditAddForm ref="detailDiloag" @updateDate="getList" />
|
<EditAddForm ref="detailDiloag" @updateDate="getList" />
|
||||||
|
<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}" />
|
||||||
<!-- 文字解析 -->
|
<!-- 文字解析 -->
|
||||||
<ExtractionText v-model="showText" @change="getText"></ExtractionText>
|
<ExtractionText v-model="showText" @change="getText"></ExtractionText>
|
||||||
</div>
|
</div>
|
||||||
@ -77,12 +82,16 @@ import MyTable from "@/components/aboutTable/MyTable.vue";
|
|||||||
import Pages from "@/components/aboutTable/Pages.vue";
|
import Pages from "@/components/aboutTable/Pages.vue";
|
||||||
import Search from "@/components/aboutTable/Search.vue";
|
import Search from "@/components/aboutTable/Search.vue";
|
||||||
import EditAddForm from "./components/editAddForm.vue";
|
import EditAddForm from "./components/editAddForm.vue";
|
||||||
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
import Detail from "./components/detail.vue";
|
||||||
|
import { qcckGet, qcckPost, ParsingText } from "@/api/qcckApi.js";
|
||||||
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
|
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
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"); //获取字典数据
|
||||||
const detailDiloag = ref();
|
const detailDiloag = ref();
|
||||||
|
const detailForm = ref();
|
||||||
const searchBox = ref(); //搜索框
|
const searchBox = ref(); //搜索框
|
||||||
const showText = ref(false);
|
const showText = ref(false);
|
||||||
|
const isShow = ref(false);
|
||||||
const searchConfiger = ref([
|
const searchConfiger = ref([
|
||||||
{
|
{
|
||||||
label: "语义名称",
|
label: "语义名称",
|
||||||
@ -104,6 +113,9 @@ const searchConfiger = ref([
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const queryFrom = ref({});
|
const queryFrom = ref({});
|
||||||
|
const container = ref('')
|
||||||
|
const btnLoading = ref(false)
|
||||||
|
const prsentText = ref(null)
|
||||||
const pageData = reactive({
|
const pageData = reactive({
|
||||||
tableData: [], //表格数据
|
tableData: [], //表格数据
|
||||||
keyCount: 0,
|
keyCount: 0,
|
||||||
@ -124,6 +136,7 @@ const pageData = reactive({
|
|||||||
pageCurrent: 1
|
pageCurrent: 1
|
||||||
}, //分页
|
}, //分页
|
||||||
controlsWidth: 120, //操作栏宽度
|
controlsWidth: 120, //操作栏宽度
|
||||||
|
controlsWidthR: 140, //操作栏宽度
|
||||||
tableColumn: [
|
tableColumn: [
|
||||||
{ label: "语义名称", prop: "yymc",showOverflowTooltip:true },
|
{ label: "语义名称", prop: "yymc",showOverflowTooltip:true },
|
||||||
{ label: "要素类型", prop: "yslx",showOverflowTooltip:true },
|
{ label: "要素类型", prop: "yslx",showOverflowTooltip:true },
|
||||||
@ -133,7 +146,6 @@ const pageData = reactive({
|
|||||||
tableColumn1: [
|
tableColumn1: [
|
||||||
{ label: "线索名称", prop: "yymc",showOverflowTooltip:true },
|
{ label: "线索名称", prop: "yymc",showOverflowTooltip:true },
|
||||||
{ label: "线索类型", prop: "yslx",showOverflowTooltip:true },
|
{ label: "线索类型", prop: "yslx",showOverflowTooltip:true },
|
||||||
{ label: "指向时间", prop: "ysmc",showOverflowTooltip:true },
|
|
||||||
{ label: "指向地点", prop: "ysms",showOverflowTooltip:true },
|
{ label: "指向地点", prop: "ysms",showOverflowTooltip:true },
|
||||||
{ label: "线索内容", prop: "ysms",showOverflowTooltip:true },
|
{ label: "线索内容", prop: "ysms",showOverflowTooltip:true },
|
||||||
],
|
],
|
||||||
@ -187,6 +199,13 @@ const delDictItemRight = (id) => {
|
|||||||
const addForm = (type, id) =>{
|
const addForm = (type, id) =>{
|
||||||
detailDiloag.value.init(type, id);
|
detailDiloag.value.init(type, id);
|
||||||
}
|
}
|
||||||
|
// 新增数据 -- 左边
|
||||||
|
const lookdetail = (type, row) =>{
|
||||||
|
isShow.value = true;
|
||||||
|
setTimeout(()=>{
|
||||||
|
detailForm.value.init(type, row);
|
||||||
|
},500)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const changeNo = (val) => {
|
const changeNo = (val) => {
|
||||||
@ -205,6 +224,46 @@ const addEdit = (type, row) => {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 提取数据
|
||||||
|
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,'=================将结果');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 表格高度计算
|
// 表格高度计算
|
||||||
const tabHeightFn = () => {
|
const tabHeightFn = () => {
|
||||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 280;
|
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 280;
|
||||||
@ -226,10 +285,12 @@ const tabHeightFn = () => {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 50px;
|
bottom: 50px;
|
||||||
height: 210px;
|
height: 210px;
|
||||||
width: 100%;
|
width: calc(100% - 20px);
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: #ccc;
|
border: 2px dashed #ccc;
|
||||||
|
margin: 0 10px;
|
||||||
|
color: #333;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user