diff --git a/.env b/.env index 53551f771cfc6767f8b509a0199758559cc7071f..424b38e01d4b0fa753689fcbf7b26153853cc250 100644 --- a/.env +++ b/.env @@ -13,3 +13,6 @@ VITE_APP_TENANT_ENABLE=true # 验证码的开关 VITE_APP_CAPTCHA_ENABLE=true + +#默认路由开关 +VITE_ROUTER_DEFAULT=true \ No newline at end of file diff --git a/src/components/Pages/MonacoEditor/EditorWorker.vue b/src/components/Pages/MonacoEditor/EditorWorker.vue index a1689e6895b6954d146b93594fa6bdd8ba88ef94..6286102be5a4bfabee94a4abbd21ef9f2730d9d0 100644 --- a/src/components/Pages/MonacoEditor/EditorWorker.vue +++ b/src/components/Pages/MonacoEditor/EditorWorker.vue @@ -6,6 +6,7 @@ import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker' import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker' import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker' import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker' +import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker' self.MonacoEnvironment = { getWorker(workerId, label) { @@ -18,6 +19,9 @@ self.MonacoEnvironment = { if (label === 'html') { return new htmlWorker() } + if (label === 'css') { + return new cssWorker() + } return new editorWorker() } } diff --git a/src/packages/components/Informations/Texts/TextCard/index.vue b/src/packages/components/Informations/Texts/TextCard/index.vue index 81eed18364efecc066ef34768cee3037031523a9..7b33b9a18f45dbfb4df328ec615c1cd4809b55a7 100644 --- a/src/packages/components/Informations/Texts/TextCard/index.vue +++ b/src/packages/components/Informations/Texts/TextCard/index.vue @@ -131,7 +131,7 @@ console.log('22222222222222222222223') // 滚动处理 const startScrollAnimation = () => { - const totalHeight = itemHeight.value * dataList.value.length; + const totalHeight = itemHeight.value * props.chartConfig.option.dataset.lenght; timer = setInterval(() => { console.log('滚动测试...') scrollY.value -= itemHeight.value; diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index 888149cbb1b539bffd2b6a2bc42aecf13acf71f5..b7a8adecd63aca146de14c1d43032bcbf7157a3a 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -100,7 +100,9 @@ export enum FilterEnum { //动画时长 CIRCULATE_PLAY_TIME = 'circulatePlayTime', //动画延迟时长 - CIRCULATE_DELAY_TIME = 'circulateDelayTime' + CIRCULATE_DELAY_TIME = 'circulateDelayTime', + //样式增强 + STYLE_ENHANCE= 'styleEnhance', } @@ -163,6 +165,9 @@ export interface PublicConfigType { // 动画延迟时长/秒 [FilterEnum.CIRCULATE_DELAY_TIME]: number, + + // 样式自定义增强 + [FilterEnum.STYLE_ENHANCE]: string, } preview?: { // 预览超出隐藏 diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index f2885cad78d2a07e7b94442565895912d0ed6d07..d7afec856c26ac2c77c4384ae01f5ff17ab06734 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -89,6 +89,9 @@ export class PublicConfigClass implements PublicConfigType { circulatePlayTime:1, // 动画延迟时长/秒 circulateDelayTime:0, + //自定义样式增强 + styleEnhance:"", + } // 预览 diff --git a/src/router/index.ts b/src/router/index.ts index b58a14e0c2d27ee8b30715ae1fed7fba1d87c636..c8977ddaa8d5cae778c42b5eab4a408b56509e13 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -28,7 +28,7 @@ const RootRoute: Array = [ ] -export const constantRouter: any[] = [LoginRoute, ...RootRoute, RedirectRoute, ReloadRoute]; +export const constantRouter: any[] = [LoginRoute, ...RootRoute, ReloadRoute]; const router = createRouter({ history: createWebHashHistory(''), diff --git a/src/router/router-guards.ts b/src/router/router-guards.ts index 70153352c87ae66d701e4e2136a1d3fd2755e839..853a1940775359c18905613f82774a9469f91a2a 100644 --- a/src/router/router-guards.ts +++ b/src/router/router-guards.ts @@ -1,7 +1,7 @@ import { Router } from 'vue-router'; import { PageEnum, PreviewEnum } from '@/enums/pageEnum' import {loginCheck, setSessionStorage} from '@/utils' - +const viteRouter = import.meta.env.VITE_ROUTER_DEFAULT // 路由白名单 const routerAllowList = [ // 登录 @@ -32,17 +32,20 @@ export function createRouterGuards(router: Router) { // @ts-ignore console.log(!routerAllowList.includes(to.name), !loginCheck()) // @ts-ignore - if (!routerAllowList.includes(to.name) && !loginCheck()) { - console.log(to.fullPath,'存储临时跳回路径与查询ID') - if(PreviewEnum.CHART_PREVIEW_NAME === to.name){ - setSessionStorage('setRedirectPath','/chart/preview') - setSessionStorage('setRedirectPathId',to.params.id[0]) - } - console.log('test...login....') - next({ name: PageEnum.BASE_LOGIN_NAME }) - return + console.log('路由开关:',viteRouter==='false') + console.log('路由开关2:',viteRouter,!viteRouter,!!viteRouter) + console.log(!routerAllowList.includes(to.name),!loginCheck()) + if (!routerAllowList.includes(to.name)&&!loginCheck()) { + if(PreviewEnum.CHART_PREVIEW_NAME === to.name&& viteRouter==='false'){ + console.log(to.fullPath,'存储临时跳回路径与查询ID') + setSessionStorage('setRedirectPath','/chart/preview') + setSessionStorage('setRedirectPathId',to.params.id[0]) + } + console.log('test...login....') + next({ name: PageEnum.BASE_LOGIN_NAME }) } console.log('test。。。next。。。') + console.log("现地址",to.path,"重定向前地址",to.redirectedFrom?.path) next() }) diff --git a/src/utils/router.ts b/src/utils/router.ts index e0f2fe44e17c9abc448269e021d2c54f5e770cf8..2603b8d2b9dc13e2f14765032b45898765db11be 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -73,9 +73,11 @@ export const routerTurnByPath = ( if (query?.length) { fullPath = `${path}/${query.join('/')}` } + if (windowOpen) { return openNewWindow(fullPath) } + if (isReplace) { router.replace({ path: fullPath, diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/css-validator.d.ts b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/css-validator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dda114b1fb429b49bb99443ecc26b990af1d7c0a --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/css-validator.d.ts @@ -0,0 +1,4 @@ +declare module 'css-validator' { + export function validateCSS(css: string, callback?: (isValid: boolean) => void): void; + export function validateCSSAsync(css: string): Promise; +} \ No newline at end of file diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/index.ts b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..d856fcb5ee8b4d6c5d5a4ce85623c21a523ac485 --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/index.ts @@ -0,0 +1,3 @@ +import ChartStyleEnhance from './index.vue' + +export { ChartStyleEnhance } diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..493e50d49b77c4bd1a0d3d975ec0ea49c337d99d --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartStyleEnhance/index.vue @@ -0,0 +1,233 @@ + + + + diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue index 6e632cc5ba911abe8778d2660246b35e4cd8ddcd..4dc482903bd90b88955e4e5811882ebe1b04ea14 100644 --- a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue @@ -8,6 +8,7 @@ + @@ -16,6 +17,7 @@ import { ref } from 'vue' import { ChartEventInteraction } from './components/ChartEventInteraction' import { ChartEventAdvancedHandle } from './components/ChartEventAdvancedHandle' import { ChartEventBaseHandle } from './components/ChartEventBaseHandle' +import { ChartStyleEnhance } from './components/ChartStyleEnhance' import { useTargetData } from '../hooks/useTargetData.hook' const { targetData } = useTargetData() diff --git a/src/views/login/index.vue b/src/views/login/index.vue index f661414e21ccab2343485522d0fae9ae449dc19a..11c53ef21a862b86bb1f5f8e7ba292315d4edca2 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -171,7 +171,7 @@ const autoLogin = ref(true) const show = ref(false) const showBg = ref(false) const systemStore = useSystemStore() - +const viteRouter = import.meta.env.VITE_ROUTER_DEFAULT const t = window['$t'] const formInline = reactive({ @@ -302,23 +302,18 @@ const handleSubmit = async (params: any) => { window['$message'].success(t('login.login_success')) - const redirectPath = getSessionStorage('setRedirectPath') + const redirectPath:string = getSessionStorage('setRedirectPath') as string const redirectPathId = getSessionStorage('setRedirectPathId') console.log(redirectPath) console.log(redirectPathId) - if(redirectPath){ + if(redirectPath && viteRouter==='false'){ + console.log("重定向缓存页面",redirectPath,viteRouter,!viteRouter,!!viteRouter) routerTurnByPath(redirectPath,[redirectPathId],true,false) }else{ - if(getSessionStorage('setRedirectPath')) { - console.log("重定向到登录页") - routerTurnByPath(getSessionStorage('setRedirectPath')); - }else{ console.log("重定向到首页》》》") routerTurnByName(PageEnum.BASE_HOME_NAME, true); - } - } - + // routerTurnByName(PageEnum.BASE_HOME_NAME, true) } loading.value = false } else { diff --git a/src/views/preview/components/PreviewRenderList/index.vue b/src/views/preview/components/PreviewRenderList/index.vue index b2f54e46fe172c0478e6df0668f3f7b57d463756..36bac9a9c553ba3286a69a372bf846fe7d0f74b8 100644 --- a/src/views/preview/components/PreviewRenderList/index.vue +++ b/src/views/preview/components/PreviewRenderList/index.vue @@ -1,6 +1,7 @@