code refactor

This commit is contained in:
MaysWind
2025-01-12 01:04:19 +08:00
parent b517409229
commit 9bbe4d2dcf
3 changed files with 10 additions and 10 deletions
@@ -105,7 +105,7 @@ const transactionTagsStore = useTransactionTagsStore();
const selectedItemIds = ref<string[]>(copyArrayTo(props.modelValue, []));
const newTag = ref<TransactionTag | null>(null);
const allTags = computed(() => transactionTagsStore.allTransactionTags);
const allTags = computed<TransactionTag[]>(() => transactionTagsStore.allTransactionTags);
const noAvailableTag = computed<boolean>(() => {
if (transactionTagsStore.allTransactionTags) {
+4 -4
View File
@@ -287,10 +287,10 @@ const transactionTagsStore = useTransactionTagsStore();
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
const snackbar = useTemplateRef<SnackBarType>('snackbar');
const tags = computed(() => transactionTagsStore.allTransactionTags);
const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value));
const availableTagCount = computed(() => getAvailableTagCount(tags.value, showHidden.value));
const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
const tags = computed<TransactionTag[]>(() => transactionTagsStore.allTransactionTags);
const noAvailableTag = computed<boolean>(() => isNoAvailableTag(tags.value, showHidden.value));
const availableTagCount = computed<number>(() => getAvailableTagCount(tags.value, showHidden.value));
const hasEditingTag = computed<boolean>(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
function isTagModified(tag: TransactionTag): boolean {
if (tag.id) {
+5 -5
View File
@@ -181,11 +181,11 @@ const { showToast, routeBackOnError } = useI18nUIComponents();
const transactionTagsStore = useTransactionTagsStore();
const tags = computed(() => transactionTagsStore.allTransactionTags);
const firstShowingId = computed(() => getFirstShowingId(tags.value, showHidden.value));
const lastShowingId = computed(() => getLastShowingId(tags.value, showHidden.value));
const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value));
const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
const tags = computed<TransactionTag[]>(() => transactionTagsStore.allTransactionTags);
const firstShowingId = computed<string | null>(() => getFirstShowingId(tags.value, showHidden.value));
const lastShowingId = computed<string | null>(() => getLastShowingId(tags.value, showHidden.value));
const noAvailableTag = computed<boolean>(() => isNoAvailableTag(tags.value, showHidden.value));
const hasEditingTag = computed<boolean>(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
function isTagModified(tag: TransactionTag): boolean {
if (tag.id) {