Browse Source

Merge remote-tracking branch 'origin/master'

S0025136190 1 year ago
parent
commit
6b19870fd4

+ 3 - 3
Web/src/api/custom/index.ts

@@ -157,7 +157,7 @@ export type FetchProjectListApi = () => Promise<any>;
 export type FetchMediaFileListApi = (params: FetchMediaFileListApiParams) => Promise<any>;
 export type BatchDownloadMediaFileApi = (params: BatchDownloadMediaFileApiParams) => Promise<any>;
 export type FetchFileListByFolderApi = (dirId: string, params: FetchFileListByFolderApiParams) => Promise<any>;
-export type FetchFileDetailApi = (fileId: string) => Promise<any>;
+export type FetchFileDetailApi = (workspaceId: string, fileId: string) => Promise<any>;
 export type BatchDownloadFileApi = (params: BatchDownloadFileApiParams) => Promise<any>;
 export type CreateMapElementApi = (fileId: string) => Promise<any>;
 export type DeleteMapElementApi = (fileId: string) => Promise<any>;
@@ -330,8 +330,8 @@ const fetchFileListByFolderApi: FetchFileListByFolderApi = async (dirId, params)
 };
 
 // 获取文件详情
-const fetchFileDetailApi: FetchFileDetailApi = async (fileId) => {
-    const res = await request.get(`/media/api/v1/files/${getWorkspaceId()}/file/${fileId}`);
+const fetchFileDetailApi: FetchFileDetailApi = async (workspaceId, fileId) => {
+    const res = await request.get(`/media/api/v1/files/${workspaceId}/file/${fileId}`);
     return res.data;
 };
 

+ 2 - 1
Web/src/pages/page-web/projects/layer/components/PhotoDrawer.vue

@@ -45,6 +45,7 @@
 import { reactive, watch } from 'vue';
 import { ClockCircleOutlined } from '@ant-design/icons-vue';
 import Panoramic from '/@/components/panoramic/index.vue';
+import { getWorkspaceId } from '/@/utils';
 import { apis } from '/@/api/custom';
 
 interface Props {
@@ -77,7 +78,7 @@ watch(() => props.fileId, async (newValue) => {
   if (props.visible && newValue) {
     const fileId = newValue.replace(/^resource__/, '');
     try {
-      const res = await apis.fetchFileDetail(fileId);
+      const res = await apis.fetchFileDetail(getWorkspaceId(), fileId);
       state.info = res.data;
       state.imgLoading = true;
       const img = new Image();

+ 2 - 3
Web/src/pages/page-web/projects/media/detail/components/FileInfo.vue

@@ -193,7 +193,7 @@ const AmapHook = useGMapManage();
 
 const init = async () => {
   try {
-    const res = await apis.fetchFileDetail(state.currentId);
+    const res = await apis.fetchFileDetail(getWorkspaceId(), state.currentId);
     state.info = {
       ...res.data,
       longitude: res.data.longitude ? res.data.longitude.toFixed(6) : '',
@@ -239,8 +239,7 @@ onMounted(async () => {
 const onClickDownload = async () => {
   state.downloadLoading = true;
   try {
-    const workspaceId: string = getWorkspaceId();
-    const res = await downloadMediaFile(workspaceId, state.info.file_id)
+    const res = await downloadMediaFile(getWorkspaceId(), state.info.file_id)
     if (!res) {
       return
     }

+ 3 - 3
Web/src/pages/page-web/projects/mediaInfo/index.vue

@@ -146,12 +146,12 @@ const AmapHook = useGMapManage();
 
 const init = async () => {
   const { query } = router.currentRoute.value;
-  const fileId = query.fileId;
-  if (!fileId) {
+  const { workspaceId, fileId } = query;
+  if (!workspaceId && !fileId) {
     return;
   }
   try {
-    const res = await apis.fetchFileDetail(fileId as string);
+    const res = await apis.fetchFileDetail(workspaceId as string, fileId as string);
     state.info = {
       ...res.data,
       longitude: res.data.longitude ? res.data.longitude.toFixed(6) : '',