fix: 大屏管理

This commit is contained in:
zxr
2026-07-03 15:50:55 +08:00
parent 46217fc129
commit 9f2482bf66
6 changed files with 31 additions and 9 deletions

View File

@@ -17,5 +17,5 @@ export const fetchBlockList = []
// fts 接口列表(不添加 /Visual/v1 前缀) // fts 接口列表(不添加 /Visual/v1 前缀)
export const ftsList = [ export const ftsList = [
'/fts/v1/uploader' '/Assets/v1/fts/uploader'
] ]

View File

@@ -11,7 +11,7 @@ const FtsUpload = (data: any, onUploadProgress?: (progress: number) => void) =>
const baseUrl = import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : import.meta.env.VITE_DEV_PATH const baseUrl = import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : import.meta.env.VITE_DEV_PATH
return axiosInstance({ return axiosInstance({
url: `${baseUrl}/fts/v1/uploader`, url: `${baseUrl}/Assets/v1/fts/uploader`,
method: 'POST', method: 'POST',
data, data,
headers: { headers: {
@@ -26,4 +26,4 @@ const FtsUpload = (data: any, onUploadProgress?: (progress: number) => void) =>
}) })
} }
export default FtsUpload export default FtsUpload

View File

@@ -62,12 +62,25 @@ export const routerTurnByPath = (
path: string, path: string,
query?: Array<string | number>, query?: Array<string | number>,
isReplace?: boolean, isReplace?: boolean,
windowOpen?: boolean windowOpen?: boolean,
queryParams?: Record<string, string | number | undefined>
) => { ) => {
let fullPath = '' let fullPath = ''
if (query?.length) { if (query?.length) {
fullPath = `${path}/${query.join('/')}` fullPath = `${path}/${query.join('/')}`
} }
const searchParams = new URLSearchParams()
if (queryParams) {
Object.entries(queryParams).forEach(([key, value]) => {
if (value !== undefined && value !== '') {
searchParams.set(key, String(value))
}
})
}
const queryString = searchParams.toString()
if (queryString) {
fullPath = `${fullPath}${fullPath.includes('?') ? '&' : '?'}${queryString}`
}
if (windowOpen) { if (windowOpen) {
return openNewWindow(fullPath) return openNewWindow(fullPath)
} }
@@ -243,4 +256,4 @@ export const getUrlQueryParams = (): Record<string, string> => {
} }
return params return params
} }

View File

@@ -256,7 +256,8 @@ export const useSync = () => {
if (res.data) { if (res.data) {
updateStoreInfo(res.data) updateStoreInfo(res.data)
// 更新全局数据 // 更新全局数据
await updateComponent(JSONParse(res.data.content)) const storageInfo = res.data.content ? JSONParse(res.data.content) : chartEditStore.getStorageInfo()
await updateComponent(storageInfo || chartEditStore.getStorageInfo())
return return
}else { }else {
chartEditStore.setProjectInfo(ProjectInfoEnum.PROJECT_ID, fetchRouteParamsLocation()) chartEditStore.setProjectInfo(ProjectInfoEnum.PROJECT_ID, fetchRouteParamsLocation())

View File

@@ -41,10 +41,13 @@ import { PageEnum, ChartEnum } from '@/enums/pageEnum'
import { ResultEnum } from '@/enums/httpEnum' import { ResultEnum } from '@/enums/httpEnum'
import { fetchPathByName, routerTurnByPath, renderLang, getUUID } from '@/utils' import { fetchPathByName, routerTurnByPath, renderLang, getUUID } from '@/utils'
import { createProjectApi } from '@/api/path' import { createProjectApi } from '@/api/path'
import { useSystemStore } from '@/store/modules/systemStore/systemStore'
import { SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d'
const { FishIcon, CloseIcon } = icon.ionicons5 const { FishIcon, CloseIcon } = icon.ionicons5
const { StoreIcon, ObjectStorageIcon } = icon.carbon const { StoreIcon, ObjectStorageIcon } = icon.carbon
const showRef = ref(false) const showRef = ref(false)
const systemStore = useSystemStore()
const emit = defineEmits(['close']) const emit = defineEmits(['close'])
const props = defineProps({ const props = defineProps({
@@ -101,7 +104,8 @@ const btnHandle = async (key: string) => {
const { identity } = res.data const { identity } = res.data
const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href') const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href')
routerTurnByPath(path, [identity], undefined, true) const token = systemStore.getUserInfo?.[SystemStoreUserInfoEnum.USER_TOKEN]
routerTurnByPath(path, [identity], undefined, true, { token })
closeHandle() closeHandle()
} }
} catch (error) { } catch (error) {

View File

@@ -35,9 +35,12 @@ import { ChartEnum } from '@/enums/pageEnum'
import { fetchPathByName, routerTurnByPath, getUUID } from '@/utils' import { fetchPathByName, routerTurnByPath, getUUID } from '@/utils'
import { createProjectApi } from '@/api/path' import { createProjectApi } from '@/api/path'
import { ResultEnum } from '@/enums/httpEnum' import { ResultEnum } from '@/enums/httpEnum'
import { useSystemStore } from '@/store/modules/systemStore/systemStore'
import { SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d'
const { DuplicateIcon, DuplicateOutlineIcon } = icon.ionicons5 const { DuplicateIcon, DuplicateOutlineIcon } = icon.ionicons5
const designStore = useDesignStore() const designStore = useDesignStore()
const systemStore = useSystemStore()
const props = defineProps({ const props = defineProps({
collapsed: Boolean collapsed: Boolean
@@ -58,7 +61,8 @@ const clickHandle = async () => {
const { identity } = res.data || {} const { identity } = res.data || {}
console.log('identity', identity) console.log('identity', identity)
const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href') const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href')
routerTurnByPath(path, [identity], undefined, true) const token = systemStore.getUserInfo?.[SystemStoreUserInfoEnum.USER_TOKEN]
routerTurnByPath(path, [identity], undefined, true, { token })
} else { } else {
window['$message'].error(window['$t']('project.create_failure')) window['$message'].error(window['$t']('project.create_failure'))
} }