提交 0c0437cc authored 作者: kxjia's avatar kxjia

修改下载文件方法

上级 c9d664bf
......@@ -21,6 +21,7 @@
import { list, deleteOne, batchDelete, downLoadTaskXml, saveOrUpdate } from './BaosongTaskReview.api';
import BaosongApproveModal from './components/BaosongApproveModal.vue';
import { useRoute,useRouter } from 'vue-router';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils.js';
const route = useRoute();
const router = useRouter();
......@@ -148,11 +149,10 @@
}
const handleDownloadFile = (filePath) => {
const globOnlineViewUrl: string = import.meta.env.VITE_GLOB_ONLINE_VIEW_URL;
const url = globOnlineViewUrl + filePath;
if (url) {
window.open(url);
}
const res = getFileAccessHttpUrl(item.filePath);
if (res) {
window.open(res);
}
};
const gotoPage = async (item) => {
......
......@@ -120,12 +120,10 @@
import { getChildList } from './DocFilesDir.api';
import FileList from './components/FileList.vue';
import FileHistory from './components/FileHistory.vue';
import FileItem from './components/FileItem.vue';
import FileIcon from './components/FileIcon.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils.js';
import { FolderFilled, FileTextTwoTone, MenuOutlined, AppstoreOutlined, FileWordTwoTone, FilePdfTwoTone } from '@ant-design/icons-vue';
import { Base64 } from 'js-base64';
// 状态定义
const fileName = ref('');
......@@ -360,12 +358,11 @@
isShowFolder.value = !isShowFolder.value;
};
const handleDownloadFile = (item: Recordable) => {
const globOnlineViewUrl: string = import.meta.env.VITE_GLOB_ONLINE_VIEW_URL;
const url = globOnlineViewUrl + item.filePath;
if (url) {
window.open(url);
}
const handleDownloadFile = async (item: Recordable) => {
const res = getFileAccessHttpUrl(item.filePath);
if (res) {
window.open(res);
}
};
const showFileContent = (item: Recordable) => {
......
......@@ -125,6 +125,9 @@
import AuditProblemModal from '../modal/AuditProblemModal.vue';
import AuditBestPracticeModal from '../modal/AuditBestPracticeModal.vue';
import AuditRiskEventModal from '../modal/AuditRiskEventModal.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils.js';
const $attrs = useAttrs();
const fileName = ref('');
const labelNames = ref('');
......@@ -308,13 +311,6 @@
}
}
function handleGoFile(item) {
let globOnlineViewUrl: string = import.meta.env.VITE_GLOB_ONLINE_VIEW_URL;
let globOnlineViewServerUrl: string = import.meta.env.VITE_GLOB_ONLINE_VIEW_SERVER_URL;
let urlpath = globOnlineViewUrl + item.filePath;
urlpath = encodeURIComponent(Base64.encode(urlpath));
window.open(globOnlineViewServerUrl + '?url=' + urlpath);
}
const draggingNode = ref();
......@@ -372,12 +368,17 @@
}
function handleDownloadFile(item) {
let globOnlineViewUrl: string = import.meta.env.VITE_GLOB_ONLINE_VIEW_URL;
let url = globOnlineViewUrl + item.filePath;
getFileAccessHttpUrl(item.filePath).then((res) => {
if (res) {
window.open(res);
}
});
// let globOnlineViewUrl: string = import.meta.env.VITE_GLOB_ONLINE_VIEW_URL;
// let url = globOnlineViewUrl + item.filePath;
if (url) {
window.open(url);
}
// if (url) {
// window.open(url);
// }
}
function showFileContent(item) {
if (item.filePath) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论