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

View File

@ -107,11 +107,19 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false default: false
}, },
isAll:{
type: Boolean,
default: false
}
}); });
const actionUrl = computed(() => const actionUrl = computed(() =>{
props.isImg ? "/mosty-api/mosty-base/minio/image/upload/id" : "/mosty-api/mosty-base/minio/file/upload" 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"]); const emits = defineEmits(["update:modelValue", "handleChange"]);
@ -179,11 +187,19 @@ watch(
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
if (!props.sfUrl) { if (!props.sfUrl) {
fileList.value = arr.map((el) => { 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 { } else {
fileList.value = arr.map((el) => { 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> <template>
<div class="dialog" v-if="dialogForm"> <div class="dialog" v-if="dialogForm">
<div class="head_box"> <div class="head_box">
<span class="title">人力情报信息采集流转编辑</span> <span class="title">人力情报信息采集流转详情</span>
<div> <div>
<el-button @click="close">关闭</el-button> <el-button @click="close">关闭</el-button>
</div> </div>
@ -21,7 +21,7 @@
<template #scfj> <template #scfj>
<div style="width: 100%;padding-left: 50px;"> <div style="width: 100%;padding-left: 50px;">
<div>上传附件:<span class="f12">可附电子表格Word文档图像音视频文件</span> </div> <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> </div>
</template> </template>
</FormMessage> </FormMessage>
@ -127,7 +127,7 @@ const init = (type, row) => {
// 根据id查询详情 // 根据id查询详情
const getDataById = (id) => { const getDataById = (id) => {
qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => { qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => {
fjdz.value = res.fjdz ? res.fjdz.split(',') :[]; fjdz.value = res.ossList || [];
listQuery.value = res; listQuery.value = res;
pageForm.tableData = res.ryList || []; pageForm.tableData = res.ryList || [];
}); });

View File

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

View File

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

View File

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

View File

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

View File

@ -22,7 +22,7 @@
<template #scfj> <template #scfj>
<div style="width: 100%;padding-left: 50px;"> <div style="width: 100%;padding-left: 50px;">
<div>上传附件:<span class="f12">可附电子表格Word文档图像音视频文件</span> </div> <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> </div>
</template> </template>
</FormMessage> </FormMessage>
@ -51,7 +51,7 @@
</MyTable> </MyTable>
</div> </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> </div>
</template> </template>
@ -66,6 +66,7 @@ const emit = defineEmits(["change"]);
const props = defineProps({ const props = defineProps({
dic: Object dic: Object
}); });
const showPeo = ref(false)
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const dialogForm = ref(false); //弹窗 const dialogForm = ref(false); //弹窗
const rules = reactive({ const rules = reactive({
@ -127,7 +128,7 @@ const init = (type, row) => {
// 根据id查询详情 // 根据id查询详情
const getDataById = (id) => { const getDataById = (id) => {
qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => { qcckGet({id}, "/mosty-gsxt/qbcj/selectByid").then((res) => {
fjdz.value = res.fjdz ? res.fjdz.split(',') :[]; fjdz.value = res.ossList || [];
listQuery.value = res; listQuery.value = res;
pageForm.tableData = res.ryList || []; pageForm.tableData = res.ryList || [];
}); });
@ -135,7 +136,10 @@ const getDataById = (id) => {
// 打开弹窗 // 打开弹窗
const addEdit = (type,row,index) =>{ 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 = () => { const submit = () => {
elform.value.submit((data) => { elform.value.submit((data) => {
let params = { ...data ,ryList:pageForm.tableData,cjLx:'2'}; 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; loading.value = true;
qcckPost(params, "/mosty-gsxt/qbcj/update").then((res) => { qcckPost(params, "/mosty-gsxt/qbcj/update").then((res) => {
loading.value = false; loading.value = false;

View File

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