fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 3m13s
Docker Build & Deploy / Deploy to Production (push) Successful in 8s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 3m13s
Docker Build & Deploy / Deploy to Production (push) Successful in 8s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
@@ -445,7 +445,7 @@ const getIconByClassify = (classify) => {
|
||||
if (categoryIconMap.value[classify]) {
|
||||
return categoryIconMap.value[classify]
|
||||
}
|
||||
|
||||
|
||||
// 降级:使用本地映射(向后兼容)
|
||||
const iconMap = {
|
||||
餐饮: 'food-o',
|
||||
@@ -648,7 +648,7 @@ const loadCategories = async () => {
|
||||
const response = await getCategoryList()
|
||||
if (response && response.success) {
|
||||
categories.value = response.data || []
|
||||
|
||||
|
||||
// 构建分类名称 -> 图标的映射
|
||||
const iconMap = {}
|
||||
categories.value.forEach(category => {
|
||||
@@ -668,7 +668,7 @@ const loadCategories = async () => {
|
||||
onMounted(() => {
|
||||
// 加载分类列表(用于图标映射)
|
||||
loadCategories()
|
||||
|
||||
|
||||
if (props.dataSource === 'api') {
|
||||
fetchTransactions()
|
||||
}
|
||||
|
||||
@@ -105,7 +105,28 @@ const isEmpty = computed(() => {
|
||||
|
||||
// 合并配置项
|
||||
const mergedOptions = computed(() => {
|
||||
return getChartOptions(props.options)
|
||||
const isCircularChart = props.type === 'pie' || props.type === 'doughnut'
|
||||
|
||||
// 先调用主题合并
|
||||
const merged = getChartOptions(props.options)
|
||||
|
||||
// pie/doughnut 不需要 x/y 坐标轴;强制隐藏 scales 避免网格线
|
||||
if (isCircularChart) {
|
||||
// 如果用户没有显式传 scales,或者传入的 scales 没有明确 display 设置
|
||||
// 则强制禁用坐标轴(圆形图表不应该显示笛卡尔坐标系)
|
||||
if (!props.options?.scales) {
|
||||
// 用户完全没传 scales,直接删除
|
||||
delete merged.scales
|
||||
} else {
|
||||
// 用户传了 scales,确保 display 设置为 false
|
||||
if (merged.scales) {
|
||||
if (merged.scales.x) {merged.scales.x.display = false}
|
||||
if (merged.scales.y) {merged.scales.y.display = false}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return merged
|
||||
})
|
||||
|
||||
// 图表插件(包含用户传入的插件)
|
||||
|
||||
Reference in New Issue
Block a user