From 055c011167c01ce7e3cdd133b30dfe6017c5824c Mon Sep 17 00:00:00 2001 From: niyyzf Date: Tue, 23 Jul 2024 17:34:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BC=98=E5=8C=96=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=9B=BE=E8=A1=A8=E5=8A=9F=E8=83=BD=20=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E9=80=82=E9=85=8D=E9=BB=91=E6=9A=97=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/app.vue | 3 + web/assets/min.scss | 25 +- web/components/Cards/IChart.vue | 25 +- web/components/Charts/AreaChart.vue | 7 +- web/components/Charts/AreaChart2.vue | 14 +- web/components/Charts/BarChart.vue | 15 +- web/components/Charts/LineChart.vue | 4 +- web/components/Charts/PieChart.vue | 3 +- web/components/Grid/MainGrid.vue | 4 +- web/components/SettingCard.vue | 525 ++++++--------------------- web/components/shell/FloaterBar.vue | 3 +- web/utils.ts | 30 ++ 12 files changed, 221 insertions(+), 437 deletions(-) diff --git a/web/app.vue b/web/app.vue index b57448d..6545eb7 100755 --- a/web/app.vue +++ b/web/app.vue @@ -1,12 +1,15 @@ diff --git a/web/assets/min.scss b/web/assets/min.scss index 4d258df..e078adc 100755 --- a/web/assets/min.scss +++ b/web/assets/min.scss @@ -3,7 +3,7 @@ * { margin: 0; box-sizing: border-box; - transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s, stork .2s, fill .2s, opacity .2s; + transition: background-color .08s, border-color .2s, box-shadow .2s, stork .2s, fill .2s, opacity .2s; } body { @@ -20,3 +20,26 @@ body { a { text-decoration: none; } + +//noinspection CssInvalidPseudoSelector +::view-transition-old(root), +::view-transition-new(root) { + animation: none; + mix-blend-mode: normal; +} +//noinspection CssInvalidPseudoSelector +::view-transition-old(root) { + z-index: 1; +} +//noinspection CssInvalidPseudoSelector +::view-transition-new(root) { + z-index: 9999; +} +//noinspection CssInvalidPseudoSelector +.dark-mode::view-transition-old(root) { + z-index: 9999; +} +//noinspection CssInvalidPseudoSelector +.dark-mode::view-transition-new(root) { + z-index: 1; +} diff --git a/web/components/Cards/IChart.vue b/web/components/Cards/IChart.vue index 90c8ef1..7d51a84 100755 --- a/web/components/Cards/IChart.vue +++ b/web/components/Cards/IChart.vue @@ -3,10 +3,16 @@ import {charts} from "~/config/charts"; import type {PropType} from "vue"; import type {serverValueItem} from "~/components/SettingCard.vue"; import {useMainLayoutStore} from "~/strores/UseMainLayoutStore"; +import {THEME_KEY} from "vue-echarts"; const mainLayoutStore = useMainLayoutStore() const visible = ref(false) +const cardRef = ref(null) +const {width} = useElementBounding(cardRef) +const rangeNum = ref(6) +const targetIsVisible = useElementVisibility(cardRef) +const isSwitched = ref(false) const props = defineProps({ id: { type: String, @@ -29,12 +35,8 @@ const props = defineProps({ required: false } }) -const cardRef = ref(null) -const {width} = useElementBounding(cardRef) -const rangeNum = ref(6) -const targetIsVisible = useElementVisibility(cardRef) -const isSwitched = ref(false) -watch(() => mainLayoutStore.SelectServer.id, () => { + +watch(() => mainLayoutStore.SelectServer.value, () => { isSwitched.value = true setTimeout(() => { isSwitched.value = false @@ -50,6 +52,17 @@ watchDebounced( }, {debounce: 500, maxWait: 1000}, ) +// watchDebounced( +// ()=>useColorMode().value, +// +// {debounce: 500, maxWait: 1000} +// ) +watch(()=>useColorMode().value,()=>{ + isSwitched.value = true + setTimeout(() => { + isSwitched.value = false + }) +}) const valueIds = computed(() => props.values.map(x => x.dataType)) const valueNames = computed(() => props.values.map(x => x.dataName)) const items = [ diff --git a/web/components/Charts/AreaChart.vue b/web/components/Charts/AreaChart.vue index 24e0c6f..4299f14 100644 --- a/web/components/Charts/AreaChart.vue +++ b/web/components/Charts/AreaChart.vue @@ -32,6 +32,7 @@ const props = defineProps({ }) const option = computed(() => { return { + backgroundColor:'', tooltip: { trigger: 'axis', axisPointer: { @@ -87,9 +88,6 @@ const option = computed(() => { ], legend: { data: props.valueNames, - textStyle: { - fontSize: 16, - }, }, series: props.valueNames?.map((id) => { return { @@ -169,7 +167,7 @@ const zoom = _.throttle((e: any) => { 'Authorization': 'Bearer ' + useCookie('token').value }, params: { - ServerId: mainLayoutStore.SelectServer.id, + ServerId: mainLayoutStore.SelectServer.value, DataTypes: props.valueIds, StartIndex: endIndex, }, @@ -203,6 +201,7 @@ const zoom = _.throttle((e: any) => { diff --git a/web/components/Charts/AreaChart2.vue b/web/components/Charts/AreaChart2.vue index 38ffe78..814831b 100644 --- a/web/components/Charts/AreaChart2.vue +++ b/web/components/Charts/AreaChart2.vue @@ -10,7 +10,7 @@ const mainLayoutStore = useMainLayoutStore() const dataStore = useDataStore() const isLoading = ref(false) const chartRef = ref(null); - +const isSwitch= ref(false) const props = defineProps({ valueIds: { type: Array as PropType, @@ -67,6 +67,7 @@ const props = defineProps({ }) const option = computed(() => { return { + backgroundColor:'', grid: { left: '0', right: '0', @@ -197,7 +198,7 @@ const zoom = _.throttle((e: any) => { 'Authorization': 'Bearer ' + useCookie('token').value }, params: { - ServerId: mainLayoutStore.SelectServer.id, + ServerId: mainLayoutStore.SelectServer.value, DataTypes: props.valueIds, StartIndex: endIndex, }, @@ -225,13 +226,20 @@ const zoom = _.throttle((e: any) => { }) } }, 1000) - +watch(()=>useColorMode().value,()=>{ + isSwitch.value=true + nextTick(()=>{ + isSwitch.value=false + }) +})