This commit is contained in:
2025-07-19 18:37:07 +08:00
parent fbd2431f63
commit f4bd352162
9 changed files with 90 additions and 57 deletions

View File

@ -37,7 +37,7 @@
<p>上传文件提取文本内容支持 .png, .jpg </p>
<div class="container flex" style="height: 248px;">
<div class="mr10">
<el-upload :headers="headers" accept=".png,.jpg,jpeg" action="/mosty-api/mosty-base/minio/file/upload" :show-file-list="false" :on-success="handlerSuccess" :on-change="onHandleChange" >
<el-upload :headers="headers" accept=".png,.jpg,jpeg" action="/mosty-api/mosty-base/minio/image/upload/id" :show-file-list="false" :on-success="handlerSuccess" :on-change="onHandleChange" >
<el-button size="medium" type="primary">上传图片</el-button>
</el-upload>
<p id="file-info">{{ files.name || '未选择文件' }} </p>
@ -105,6 +105,7 @@ const headers = ref({
Authorization: store.getters.token
});
const fjdz = ref('') //附件地址
const fjmc = ref('') //附件地址
const initDemo = () =>{
loading.value = imgIsLoad ? false : true;
@ -119,6 +120,7 @@ const initDemo = () =>{
selectedFile = e.target.files[0];
fileText.value = `已选择: ${selectedFile.name} (${( selectedFile.size / 1024 ).toFixed(2)} KB)`;
extractBtn.disabled = false;
fjmc.value = selectedFile.name;
uploadFile(selectedFile); //上传附件
} else {
selectedFile = null;
@ -215,15 +217,11 @@ async function extractTextFromDocx(file) {
reader.onload = function (event) {
const arrayBuffer = event.target.result;
mammoth
.extractRawText({ arrayBuffer: arrayBuffer })
.then(function (result) {
resolve(result.value);
})
.catch(function (error) {
reject(error);
});
mammoth.extractRawText({ arrayBuffer: arrayBuffer }).then(function (result) {
resolve(result.value);
}).catch(function (error) {
reject(error);
});
};
reader.onerror = reject;
@ -237,6 +235,7 @@ const handlerSuccess = (file) =>{
/**@Descripttion:图片上传事件*/
const onHandleChange = (file) => {
fjmc.value = file.name;
files.value = file;
image.value = URL.createObjectURL(file.raw);
linadingImg.value = true;
@ -263,10 +262,11 @@ const getRecognize = async () => {
const changeRadio = (val) =>{
content.value = "请先上传文件...";
fileText.value = "选择文件";
files.value = {}
files.value = {};
alertText.value = '请先上传文件...';
texts.value = []
image.value = ''
texts.value = [];
image.value = '';
fjmc.value = '';
if(val == '图片解析'){
if(!imgIsLoad) proxy.$message({ type: "error", message: "加载失败,请刷新页面" });
}
@ -276,10 +276,10 @@ const changeRadio = (val) =>{
const onComfirm = () => {
if(active.value == '文件解析'){
if(content.value == '请先上传文件...') return proxy.$message({ type: "warning", message: "请解析文件" });
emits("change", { text: content.value,fjdz:fjdz.value });
emits("change", { text: content.value,fjdz:fjdz.value,fjmc:fjmc.value });
}else{
if(texts.value.length == 0) return proxy.$message({ type: "warning", message: "请解析文件" });
emits("change", {text:texts.value.join(',\n'),fjdz:fjdz.value});
emits("change", {text:texts.value.join(',\n'),fjdz:fjdz.value,fjmc:fjmc.value});
}
handleClose()
};
@ -303,7 +303,7 @@ const uploadFile = (file) =>{
let token = localStorage.getItem('token');
axios({
method: 'post',
url: '/mosty-api/mosty-base/minio/file/upload',
url: '/mosty-api/mosty-base/minio/image/upload/id',
data:formData,
headers: { "Content-type": "multipart/form-data",'Authorization': token }
}).then( (res) => {

View File

@ -107,11 +107,19 @@ const props = defineProps({
type: Boolean,
default: false
},
isAll:{
type: Boolean,
default: false
}
});
const actionUrl = computed(() =>
props.isImg ? "/mosty-api/mosty-base/minio/image/upload/id" : "/mosty-api/mosty-base/minio/file/upload"
);
const actionUrl = computed(() =>{
if(props.isAll){
return "/mosty-api/mosty-base/minio/image/upload/id"
}else{
return props.isImg ? "/mosty-api/mosty-base/minio/image/upload/id" : "/mosty-api/mosty-base/minio/file/upload"
}
});
const emits = defineEmits(["update:modelValue", "handleChange"]);
@ -179,11 +187,19 @@ watch(
if (arr && arr.length > 0) {
if (!props.sfUrl) {
fileList.value = arr.map((el) => {
return { url: `/mosty-api/mosty-base/minio/image/download/` + el,name:'生活时尚' };
if(Object.prototype.toString.call(el) === '[object Object]'){
return { url: `/mosty-api/mosty-base/minio/image/download/` + el,name:el.name };
}else{
return { url: `/mosty-api/mosty-base/minio/image/download/` + el };
}
});
} else {
fileList.value = arr.map((el) => {
return { url: el ,name:'生活时尚'};
if(Object.prototype.toString.call(el) === '[object Object]'){
return { url: el,name:el.name };
}else{
return { url: el };
}
});
}
}

View File

@ -1,7 +1,7 @@
<template>
<div class="dialog" v-if="dialogForm">
<div class="head_box">
<span class="title">人力情报信息采集流转编辑</span>
<span class="title">人力情报信息采集流转详情</span>
<div>
<el-button @click="close">关闭</el-button>
</div>
@ -21,7 +21,7 @@
<template #scfj>
<div style="width: 100%;padding-left: 50px;">
<div>上传附件:<span class="f12">可附电子表格Word文档图像音视频文件</span> </div>
<div><MOSTY.Upload :showBtn="true" :isImg="true" disabled :limit="10" v-model="fjdz" /> </div>
<div><MOSTY.Upload :showBtn="true" :isAll="true" :isImg="true" disabled :limit="10" v-model="fjdz" /> </div>
</div>
</template>
</FormMessage>
@ -127,7 +127,7 @@ const init = (type, row) => {
// 根据id查询详情
const getDataById = (id) => {
qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => {
fjdz.value = res.fjdz ? res.fjdz.split(',') :[];
fjdz.value = res.ossList || [];
listQuery.value = res;
pageForm.tableData = res.ryList || [];
});

View File

@ -2,7 +2,7 @@
<div>
<div class="titleBox">
<PageTitle title="人力情报信息采集流转">
<el-button type="primary" @click="addEdit('add', '')">
<el-button type="primary">
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
<span style="vertical-align: middle">导出</span>
</el-button>

View File

@ -22,7 +22,7 @@
<template #scfj>
<div style="width: 100%;padding-left: 50px;">
<div>上传附件:<span class="f12">可附电子表格Word文档图像音视频文件</span> </div>
<div><MOSTY.Upload :showBtn="true" :isImg="true" :limit="10" v-model="fjdz" /> </div>
<MOSTY.Upload :showBtn="true" :isAll="true" :isImg="false" :limit="10" v-model="fjdz" />
</div>
</template>
</FormMessage>
@ -127,7 +127,7 @@ const init = (type, row) => {
// 根据id查询详情
const getDataById = (id) => {
qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => {
fjdz.value = res.fjdz ? res.fjdz.split(',') :[];
fjdz.value = res.ossList || [];
listQuery.value = res;
pageForm.tableData = res.ryList || [];
});
@ -156,7 +156,15 @@ const submit = () => {
elform.value.submit((data) => {
let url = title.value == "新增" ? "/mosty-gsxt/qbcj/add" : "/mosty-gsxt/qbcj/update";
let params = { ...data ,ryList:pageForm.tableData,cjLx:'0'};
params.fjdz = fjdz.value.length > 0 ? fjdz.value.join(','):'';
let fjids = [];
fjdz.value.forEach(item=>{
if(Object.prototype.toString.call(item) === '[object Object]'){
fjids.push(item.id)
}else{
fjids.push(item)
}
})
params.fjdz = fjids.length > 0 ? fjids.join(','):'';
loading.value = true;
qcckPost(params, url).then((res) => {
loading.value = false;

View File

@ -21,7 +21,7 @@
<template #scfj>
<div style="width: 100%;padding-left: 50px;">
<div>上传附件:<span class="f12">可附电子表格Word文档图像音视频文件</span> </div>
<div><MOSTY.Upload :showBtn="true" :isImg="true" disabled :limit="10" v-model="fjdz" /> </div>
<MOSTY.Upload :showBtn="true" :isAll="true" :isImg="false" :limit="10" v-model="fjdz" />
</div>
</template>
</FormMessage>
@ -122,7 +122,7 @@ const init = (type, row) => {
// 根据id查询详情
const getDataById = (id) => {
qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => {
fjdz.value = res.fjdz ? res.fjdz.split(',') :[];
fjdz.value = res.ossList || [];
listQuery.value = res;
pageForm.tableData = res.ryList || [];
});

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-model="showDialog" :destroy-on-close="true" :title="title+'人员'" @close="close" :close-on-click-modal="false">
<el-dialog v-model="modelValue" :destroy-on-close="true" :title="title+'人员'" @close="close" :close-on-click-modal="false">
<FormMessage v-model="listQuery" :formList="formData" labelWidth="120px" ref="elform" :rules="rules">
<template #bqList>
<div class="marks pointer" @click="chooseMarksVisible = true">
@ -29,19 +29,22 @@ const props = defineProps({
type:Object,
default:{}
},
modelValue:{
type:Boolean,
default:false
}
})
const chooseMarksVisible = ref(false)
const roleIds = ref([])
const elform = ref()
const showDialog = ref(false)
const emit = defineEmits(['change'])
const emit = defineEmits(['change','update:modelValue'])
const listQuery = ref({})
const formData = ref([
{ label: "姓名", prop: "xm", type: "input" ,width:'48%'},
{ label: "性别", prop: "xb", type: "select",options:props.dic.D_BZ_XB ,width:'48%'},
{ label: "身份证号", prop: "sfzh", type: "input" ,width:'48%'},
{ label: "户籍地", prop: "hjdz", type: "input",width:'48%' },
{ label: "户籍地派出所", prop: "hjdpcsdm", type: "department" ,width:'48%'},
{ label: "户籍地派出所", prop: "hjdpcsdm",depMc:'hjdpcs', type: "department" ,width:'48%'},
{ label: "标签", prop: "bqList", type: "slot",width:'100%' },
{ label: "是否挑头人", prop: "sfttr", type: "select",options:props.dic.D_BZ_SF ,width:'48%'},
{ label: "是否响应人", prop: "sfxyr", type: "select" ,options:props.dic.D_BZ_SF,width:'48%' },
@ -60,8 +63,7 @@ const order = ref(null)
const init = (type,row,index) =>{
title.value = type == 'add' ? '新增' :'编辑';
order.value = index;
showDialog.value = true;
if(row) listQuery.value = {...row};
if(type == 'edit') listQuery.value = JSON.parse(JSON.stringify(row))
}
// 选择标签
@ -80,10 +82,9 @@ const closeTag = (idx) =>{
const submitForm = () =>{
elform.value.submit((val)=>{
let obj = JSON.parse(JSON.stringify({ data:val,type:title.value ,index:order.value}))
emit('change',obj)
showDialog.value = false;
elform.value.reset()
let obj = { data:val,type:title.value ,index:order.value}
emit('change',obj);
emit('update:modelValue',false);
})
}

View File

@ -22,7 +22,7 @@
<template #scfj>
<div style="width: 100%;padding-left: 50px;">
<div>上传附件:<span class="f12">可附电子表格Word文档图像音视频文件</span> </div>
<MOSTY.Upload :showBtn="true" :isImg="true" :limit="10" v-model="fjdz" />
<MOSTY.Upload :showBtn="true" :isAll="true" :isImg="false" :limit="10" v-model="fjdz" />
</div>
</template>
</FormMessage>
@ -51,7 +51,7 @@
</MyTable>
</div>
<!-- 人员 -->
<AddPeo ref="showAdd" :dic="props.dic" @change="getPeo"></AddPeo>
<AddPeo ref="showAdd" v-model="showPeo" v-if="showPeo" :dic="props.dic" @change="getPeo"></AddPeo>
</div>
</template>
@ -66,6 +66,7 @@ const emit = defineEmits(["change"]);
const props = defineProps({
dic: Object
});
const showPeo = ref(false)
const { proxy } = getCurrentInstance();
const dialogForm = ref(false); //弹窗
const rules = reactive({
@ -127,7 +128,7 @@ const init = (type, row) => {
// 根据id查询详情
const getDataById = (id) => {
qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => {
fjdz.value = res.fjdz ? res.fjdz.split(',') :[];
fjdz.value = res.ossList || [];
listQuery.value = res;
pageForm.tableData = res.ryList || [];
});
@ -135,7 +136,10 @@ const getDataById = (id) => {
// 打开弹窗
const addEdit = (type,row,index) =>{
showAdd.value.init(type,row,index)
showPeo.value = true;
nextTick(()=>{
showAdd.value.init(type,row,index)
})
}
// 新增人员
@ -155,7 +159,15 @@ const deleteRow = (index) =>{
const submit = () => {
elform.value.submit((data) => {
let params = { ...data ,ryList:pageForm.tableData,cjLx:'2'};
params.fjdz = fjdz.value.length > 0 ? fjdz.value.join(','):'';
let fjids = [];
fjdz.value.forEach(item=>{
if(Object.prototype.toString.call(item) === '[object Object]'){
fjids.push(item.id)
}else{
fjids.push(item)
}
})
params.fjdz = fjids.length > 0 ? fjids.join(','):'';
loading.value = true;
qcckPost(params, "/mosty-gsxt/qbcj/update").then((res) => {
loading.value = false;

View File

@ -26,7 +26,7 @@
</template>
</MyTable>
<div class="txetBox">
{{ container }}
{{ container.text }}
</div>
<div class="footBnt">
<el-button type="primary" @click="showText = true">导入</el-button>
@ -139,10 +139,9 @@ const searchConfigerR = ref([
]);
const queryFrom = ref({});
const queryFromR = ref({});
const container = ref('')
const container = ref({})
const btnLoading = ref(false)
const prsentText = ref(null)
const qbid = ref('') //情报id
const pageData = reactive({
tableData: [], //表格数据
tableDataR: [], //表格数据
@ -266,8 +265,8 @@ const changeSize = (val) => {
// 提取数据
const getText = (val) =>{
prsentText.value = null; //先清空
container.value = val.text;
let obj = {
container.value = val;
let obj = {
"model": "deepseek-reasoner",
"messages": [
{
@ -287,14 +286,9 @@ const getText = (val) =>{
let qbLy = '情报来源是一个字典,字典内容包括:' + (D_GS_XS_LY.value.map(item=>item.dm+':'+item.zdmc).join(','))+'\n'
let sszt = '所属专题是一个字典,字典内容包括:' + (D_BZ_SSZT.value.map(item=>item.dm+':'+item.zdmc).join(','))+'\n'
let time = '时间必须按照 YYYY-MM-DD HH:mm:ss 的格式 \n'
obj.messages[0].content = obj.messages[0].content + xslx + qbLy + sszt + time;
// *********************
obj.messages[1].content = obj.messages[1].content + val.text;
obj.messages[1].content = obj.messages[1].content + val.text
prsentText.value = obj;
qcckPost({fjdz:val.fjdz,tjnr:val.text},'/mosty-gsxt/qbcjjl/add').then((res)=>{
qbid.value = res || '';
})
}
const handleFx = () => {
@ -313,12 +307,14 @@ const handleFx = () => {
}
if(!message) return proxy.$message({ type: "danger", message: "解析异常,请重新上传解析" });
let params = {
qbid:qbid.value,
...message.jbxx[0],
ryList:message.ryList,
cjLx:2,
xsNr:container.value.text,
fjdz:container.value.fjdz
}
qcckPost(params,'/mosty-gsxt/qbcj/add').then((res)=>{
container.value = {};
getjxListR()
})
})