This commit is contained in:
MaysWind
2023-07-15 00:50:29 +08:00
parent 489bba9c4b
commit db75dea9ee
+11 -11
View File
@@ -5,8 +5,8 @@
</template> </template>
<script> <script>
import iconConstatns from '@/consts/icon.js'; import iconConstants from '@/consts/icon.js';
import colorConstatns from '@/consts/color.js'; import colorConstants from '@/consts/color.js';
import { isNumber } from '@/lib/common.js'; import { isNumber } from '@/lib/common.js';
export default { export default {
@@ -58,25 +58,25 @@ export default {
iconId = iconId.toString(); iconId = iconId.toString();
} }
if (!iconConstatns.allAccountIcons[iconId]) { if (!iconConstants.allAccountIcons[iconId]) {
return iconConstatns.defaultAccountIcon.icon; return iconConstants.defaultAccountIcon.icon;
} }
return iconConstatns.allAccountIcons[iconId].icon; return iconConstants.allAccountIcons[iconId].icon;
}, },
getCategoryIcon(iconId) { getCategoryIcon(iconId) {
if (isNumber(iconId)) { if (isNumber(iconId)) {
iconId = iconId.toString(); iconId = iconId.toString();
} }
if (!iconConstatns.allCategoryIcons[iconId]) { if (!iconConstants.allCategoryIcons[iconId]) {
return iconConstatns.defaultCategoryIcon.icon; return iconConstants.defaultCategoryIcon.icon;
} }
return iconConstatns.allCategoryIcons[iconId].icon; return iconConstants.allCategoryIcons[iconId].icon;
}, },
getAccountIconStyle(color, defaultColor, additionalColorAttr) { getAccountIconStyle(color, defaultColor, additionalColorAttr) {
if (color && color !== colorConstatns.defaultAccountColor) { if (color && color !== colorConstants.defaultAccountColor) {
color = '#' + color; color = '#' + color;
} else { } else {
color = defaultColor; color = defaultColor;
@@ -93,7 +93,7 @@ export default {
return ret; return ret;
}, },
getCategoryIconStyle(color, defaultColor, additionalColorAttr) { getCategoryIconStyle(color, defaultColor, additionalColorAttr) {
if (color && color !== colorConstatns.defaultCategoryColor) { if (color && color !== colorConstants.defaultCategoryColor) {
color = '#' + color; color = '#' + color;
} else { } else {
color = defaultColor; color = defaultColor;
@@ -110,7 +110,7 @@ export default {
return ret; return ret;
}, },
getDefaultIconStyle(color, defaultColor, additionalColorAttr) { getDefaultIconStyle(color, defaultColor, additionalColorAttr) {
if (color && color !== colorConstatns.defaultColor) { if (color && color !== colorConstants.defaultColor) {
color = '#' + color; color = '#' + color;
} else { } else {
color = defaultColor; color = defaultColor;