mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 20:42:07 +08:00
fix: 尝试修复循环依赖问题
This commit is contained in:
@@ -13,7 +13,6 @@ import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
||||
import { useEmbedded } from '@/store/modules/embedded'
|
||||
import { useLoading } from '@/hooks/web/useLoading'
|
||||
const appearanceStore = useAppearanceStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
@@ -28,6 +27,7 @@ const whiteList = ['/login', '/de-link', '/chart-view', '/admin-login', '/401']
|
||||
const embeddedWindowWhiteList = ['/dvCanvas', '/dashboard', '/preview', '/dataset-embedded-form']
|
||||
const embeddedRouteWhiteList = ['/dataset-embedded', '/dataset-form', '/dataset-embedded-form']
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
const appearanceStore = useAppearanceStoreWithOut()
|
||||
if (['/chart-view'].includes(to.path) || to.path.startsWith('/de-link/')) {
|
||||
open()
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import { useLinkStoreWithOut } from '@/store/modules/link'
|
||||
import { useLoading } from '@/hooks/web/useLoading'
|
||||
import { h } from 'vue'
|
||||
|
||||
const appearanceStore = useAppearanceStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
const userStore = useUserStoreWithOut()
|
||||
@@ -65,6 +64,7 @@ router.beforeEach(async (to, _, next) => {
|
||||
}
|
||||
start()
|
||||
loadStart()
|
||||
const appearanceStore = useAppearanceStoreWithOut()
|
||||
await appearanceStore.setAppearance()
|
||||
if (to.name === 'link') {
|
||||
next()
|
||||
|
||||
@@ -8,7 +8,6 @@ import colorTree from 'less/lib/less/tree/color.js'
|
||||
import { useEmbedded } from '@/store/modules/embedded'
|
||||
import { setTitle } from '@/utils/utils'
|
||||
|
||||
const embeddedStore = useEmbedded()
|
||||
const basePath = import.meta.env.VITE_API_BASEPATH
|
||||
const baseUrl = basePath + '/appearance/image/'
|
||||
import { isBtnShow } from '@/utils/utils'
|
||||
@@ -164,6 +163,7 @@ export const useAppearanceStore = defineStore('appearanceStore', {
|
||||
this.fontList = res || []
|
||||
},
|
||||
setCurrentFont(name) {
|
||||
const embeddedStore = useEmbedded()
|
||||
const currentFont = this.fontList.find(ele => ele.name === name)
|
||||
if (currentFont) {
|
||||
let fontStyleElement = document.querySelector(`#de-custom_font${name}`)
|
||||
@@ -203,6 +203,7 @@ export const useAppearanceStore = defineStore('appearanceStore', {
|
||||
this.loaded = data
|
||||
},
|
||||
async setAppearance(isDataEaseBi?: boolean) {
|
||||
const embeddedStore = useEmbedded()
|
||||
const desktop = wsCache.get('app.desktop')
|
||||
if (desktop) {
|
||||
this.loaded = true
|
||||
|
||||
@@ -47,7 +47,6 @@ import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { isDesktop } from '@/utils/ModelUtil'
|
||||
const { t } = useI18n()
|
||||
const appearanceStore = useAppearanceStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
|
||||
const getNewInnerPadding = (commonGap = 0) => {
|
||||
@@ -453,6 +452,7 @@ export function initCanvasDataPrepare(dvId, params, callBack) {
|
||||
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'
|
||||
? canvasStyleResult['dashboard'].gapSize
|
||||
: 0
|
||||
const appearanceStore = useAppearanceStoreWithOut()
|
||||
appearanceStore.setCurrentFont(canvasStyleResult.fontFamily)
|
||||
document.documentElement.style.setProperty(
|
||||
'--de-canvas_custom_font',
|
||||
|
||||
Reference in New Issue
Block a user