Skip to content

Commit

Permalink
修复图标透明度错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaojianli committed Jan 10, 2025
1 parent 93fd07f commit 048e92b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 41 deletions.
24 changes: 13 additions & 11 deletions webui/src/views/charts/components/banTrends.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,18 @@ const option = reactive({
range: [dayjs().startOf('day').add(-7, 'day').toDate(), new Date()]
})
const usedOption = computed(() => chartOptions.value)
const usedOption = computed(() => ({
tooltip: {
trigger: 'axis',
backgroundColor: darkStore.isDark ? '#333335' : '#ffffff',
borderColor: darkStore.isDark ? '#333335' : '#ffffff',
textStyle: {
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : undefined
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
...chartOptions.value
}))
const chartOptions = ref({
xAxis: {
Expand All @@ -109,14 +120,6 @@ const chartOptions = ref({
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
backgroundColor: darkStore.isDark ? '#333335' : '',
borderColor: darkStore.isDark ? '#333335' : '',
textStyle: {
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : ''
}
},
grid: {
left: '15%'
},
Expand All @@ -126,8 +129,7 @@ const chartOptions = ref({
type: 'line',
name: t('page.charts.line.options.field')
}
],
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined
]
})
watch(option, (v) => {
Expand Down
16 changes: 9 additions & 7 deletions webui/src/views/charts/components/fieldPie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,22 @@ const loadingOptions = computed(() => ({
}))
const err = ref<Error>()
const usedOption = computed(() => chartOption.value)
const chartOption = ref({
const usedOption = computed(() => ({
tooltip: {
trigger: 'item',
appendToBody: true,
formatter: '<p style="word-wrap:break-all"><b>{b}</b></p> {c} ({d}%)',
backgroundColor: darkStore.isDark ? '#333335' : '',
borderColor: darkStore.isDark ? '#333335' : '',
backgroundColor: darkStore.isDark ? '#333335' : '#ffffff',
borderColor: darkStore.isDark ? '#333335' : '#ffffff',
textStyle: {
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : ''
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : undefined
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
...chartOption.value
}))
const chartOption = ref({
legend: {
orient: 'vertical',
left: 'right',
Expand All @@ -126,7 +129,6 @@ const chartOption = ref({
show: true
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
series: [
{
name: t('page.charts.options.field.' + option.field),
Expand Down
16 changes: 9 additions & 7 deletions webui/src/views/charts/components/ispPie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,22 @@ const loadingOptions = computed(() => ({
maskColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.4)' : 'rgba(255, 255, 255, 0.4)'
}))
const usedOption = computed(() => chartOption.value)
const chartOption = ref({
const usedOption = computed(() => ({
tooltip: {
trigger: 'item',
appendToBody: true,
formatter: '<p style="word-wrap:break-all"><b>{b}</b></p> {c} ({d}%)',
backgroundColor: darkStore.isDark ? '#333335' : '',
borderColor: darkStore.isDark ? '#333335' : '',
backgroundColor: darkStore.isDark ? '#333335' : '#ffffff',
borderColor: darkStore.isDark ? '#333335' : '#ffffff',
textStyle: {
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : ''
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : undefined
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
...chartOption.value
}))
const chartOption = ref({
legend: {
orient: 'vertical',
left: 'right',
Expand All @@ -159,7 +162,6 @@ const chartOption = ref({
show: true
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
series: [
{
name: '',
Expand Down
14 changes: 8 additions & 6 deletions webui/src/views/charts/components/traffic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,16 @@ const loadingOptions = computed(() => ({
const { t, d } = useI18n()
const err = ref<Error>()
const usedOption = computed(() => chartOptions.value)
const chartOptions = ref({
const usedOption = computed(() => ({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
backgroundColor: darkStore.isDark ? '#333335' : '',
borderColor: darkStore.isDark ? '#333335' : '',
backgroundColor: darkStore.isDark ? '#333335' : '#ffffff',
borderColor: darkStore.isDark ? '#333335' : '#ffffff',
textStyle: {
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : ''
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : undefined
},
formatter: function (value: CallbackDataParams[]) {
return (
Expand All @@ -137,6 +135,10 @@ const chartOptions = ref({
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
...chartOptions.value
}))
const chartOptions = ref({
legend: {
data: [t('page.charts.traffic.options.download'), t('page.charts.traffic.options.upload')]
},
Expand Down
23 changes: 13 additions & 10 deletions webui/src/views/charts/components/trends.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,18 @@ const loadingOptions = computed(() => ({
textColor: darkStore.isDark ? 'rgba(255, 255, 255, 0.9)' : 'rgb(29, 33, 41)',
maskColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.4)' : 'rgba(255, 255, 255, 0.4)'
}))
const usedOption = computed(() => chartOptions.value)
const usedOption = computed(() => ({
tooltip: {
trigger: 'axis',
backgroundColor: darkStore.isDark ? '#333335' : '#ffffff',
borderColor: darkStore.isDark ? '#333335' : '#ffffff',
textStyle: {
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : ''
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
...chartOptions.value
}))
const chartOptions = ref({
xAxis: {
Expand All @@ -98,15 +109,7 @@ const chartOptions = ref({
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
backgroundColor: darkStore.isDark ? '#333335' : '',
borderColor: darkStore.isDark ? '#333335' : '',
textStyle: {
color: darkStore.isDark ? 'rgba(255, 255, 255, 0.7)' : ''
}
},
backgroundColor: darkStore.isDark ? 'rgba(0, 0, 0, 0.0)' : undefined,
series: [
{
data: [] as [Date, number][],
Expand Down

0 comments on commit 048e92b

Please sign in to comment.