修改bug

This commit is contained in:
yangjun 2024-07-24 08:47:02 +08:00
parent 6445315d53
commit 2da73b404e
4 changed files with 34 additions and 2 deletions

View File

@ -315,14 +315,18 @@ export function useFileList() {
* @param text
*/
async function viewImage(file) {
console.log('viewImage', file)
if(isImage(file)){
console.log('viewImage1111', file)
let text = getImageSrc(file)
if (text) {
let imgList = [text];
createImgPreview({ imageList: imgList });
}
}else{
console.log('viewImage2222', file.url)
if(file.url){
console.log('viewImage3333', file.url)
//数据库中地址
let url = getFileAccessHttpUrl(file.url);
await initViewDomain();
@ -330,6 +334,15 @@ export function useFileList() {
//url = url.replace('localhost', '192.168.1.100')
//如果集成的KkFileview-v3.3.0+ 需要对url再做一层base64编码 encodeURIComponent(encryptByBase64(url))
window.open(onlinePreviewDomain+'?officePreviewType=pdf&url='+encodeURIComponent(url));
}else{
//数据库中地址
let url = getFileAccessHttpUrl(encodeURIComponent(file));
console.log(`🚀 ~ viewImage ~ url:`, url)
await initViewDomain();
//本地测试需要将文件地址的localhost/127.0.0.1替换成IP, 或是直接修改全局domain
//url = url.replace('localhost', '192.168.1.100')
//如果集成的KkFileview-v3.3.0+ 需要对url再做一层base64编码 encodeURIComponent(encryptByBase64(url))
window.open(onlinePreviewDomain+'?url='+url);
}
}
}

View File

@ -229,6 +229,15 @@
class="addBtn"
><Icon icon="ant-design:video-camera-add-outlined"
/></a-button>
<a-button
type="primary"
size="small"
title="查看"
v-if="three.type == 'document'"
@click="viewImage(three.filePath)"
class="addBtn"
><Icon icon="ant-design:file-pdf-outlined"
/></a-button>
<a-button
type="primary"
size="small"
@ -365,6 +374,7 @@ import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { useRouter } from 'vue-router';
import { randomString, simpleDebounce, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { useFileList } from '/@/components/jeecg/comment/useComment';
import draggable from 'vuedraggable';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
@ -380,6 +390,7 @@ const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh, xqxn, type, teano } = query; //
const { selectFileList, beforeUpload, handleRemove, getBackground, isImage, getImageAsBackground, viewImage } = useFileList();
const { createConfirm, createMessage } = useMessage();
const queryParam = ref<any>({});
const dataSource = ref<any>([]);

View File

@ -11,6 +11,7 @@ enum Api {
save='/zyInfoStudent/zyInfoStudent/add',
edit='/zyInfoStudent/zyInfoStudent/edit',
zyscStu='/zyInfoStudent/zyInfoStudent/zyscStu',
stuWpKsjc='/zyInfoStudent/zyInfoStudent/stuWpKsjc',
editCdlx='/zyInfoStudent/zyInfoStudent/editCdlx',
deleteOne = '/zyInfoStudent/zyInfoStudent/delete',
deleteBatch = '/zyInfoStudent/zyInfoStudent/deleteBatch',
@ -102,6 +103,11 @@ export const zyscStu = (params, isUpdate) => {
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
export const stuWpKsjc = (params, isUpdate) => {
let url = Api.stuWpKsjc;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
export const editCdlx = (params, isUpdate) => {
let url = Api.editCdlx;

View File

@ -36,7 +36,7 @@
import { useMessage } from '/@/hooks/web/useMessage';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate,zyscStu } from '../ZyInfoStudent.api';
import { saveOrUpdate,zyscStu,stuWpKsjc } from '../ZyInfoStudent.api';
import { Form } from 'ant-design-vue';
import {getFileAccessHttpUrl} from "/@/utils/common/compUtils";
import {useGlobSetting} from "/@/hooks/setting";
@ -163,8 +163,10 @@
.then((res) => {
console.log(`🚀 ~ .then ~ res:`, res)
if (res.success) {
createMessage.success(res.message);
createMessage.success("操作成功");
emit('ok');
//
stuWpKsjc(model, isUpdate.value).then((res) => {})
} else {
createMessage.warning(res.message);
}