mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
code refactor
This commit is contained in:
@@ -105,7 +105,7 @@ const transactionTagsStore = useTransactionTagsStore();
|
|||||||
const selectedItemIds = ref<string[]>(copyArrayTo(props.modelValue, []));
|
const selectedItemIds = ref<string[]>(copyArrayTo(props.modelValue, []));
|
||||||
const newTag = ref<TransactionTag | null>(null);
|
const newTag = ref<TransactionTag | null>(null);
|
||||||
|
|
||||||
const allTags = computed(() => transactionTagsStore.allTransactionTags);
|
const allTags = computed<TransactionTag[]>(() => transactionTagsStore.allTransactionTags);
|
||||||
|
|
||||||
const noAvailableTag = computed<boolean>(() => {
|
const noAvailableTag = computed<boolean>(() => {
|
||||||
if (transactionTagsStore.allTransactionTags) {
|
if (transactionTagsStore.allTransactionTags) {
|
||||||
|
|||||||
@@ -287,10 +287,10 @@ const transactionTagsStore = useTransactionTagsStore();
|
|||||||
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
|
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
|
||||||
const snackbar = useTemplateRef<SnackBarType>('snackbar');
|
const snackbar = useTemplateRef<SnackBarType>('snackbar');
|
||||||
|
|
||||||
const tags = computed(() => transactionTagsStore.allTransactionTags);
|
const tags = computed<TransactionTag[]>(() => transactionTagsStore.allTransactionTags);
|
||||||
const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value));
|
const noAvailableTag = computed<boolean>(() => isNoAvailableTag(tags.value, showHidden.value));
|
||||||
const availableTagCount = computed(() => getAvailableTagCount(tags.value, showHidden.value));
|
const availableTagCount = computed<number>(() => getAvailableTagCount(tags.value, showHidden.value));
|
||||||
const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
|
const hasEditingTag = computed<boolean>(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
|
||||||
|
|
||||||
function isTagModified(tag: TransactionTag): boolean {
|
function isTagModified(tag: TransactionTag): boolean {
|
||||||
if (tag.id) {
|
if (tag.id) {
|
||||||
|
|||||||
@@ -181,11 +181,11 @@ const { showToast, routeBackOnError } = useI18nUIComponents();
|
|||||||
|
|
||||||
const transactionTagsStore = useTransactionTagsStore();
|
const transactionTagsStore = useTransactionTagsStore();
|
||||||
|
|
||||||
const tags = computed(() => transactionTagsStore.allTransactionTags);
|
const tags = computed<TransactionTag[]>(() => transactionTagsStore.allTransactionTags);
|
||||||
const firstShowingId = computed(() => getFirstShowingId(tags.value, showHidden.value));
|
const firstShowingId = computed<string | null>(() => getFirstShowingId(tags.value, showHidden.value));
|
||||||
const lastShowingId = computed(() => getLastShowingId(tags.value, showHidden.value));
|
const lastShowingId = computed<string | null>(() => getLastShowingId(tags.value, showHidden.value));
|
||||||
const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value));
|
const noAvailableTag = computed<boolean>(() => isNoAvailableTag(tags.value, showHidden.value));
|
||||||
const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
|
const hasEditingTag = computed<boolean>(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== '')));
|
||||||
|
|
||||||
function isTagModified(tag: TransactionTag): boolean {
|
function isTagModified(tag: TransactionTag): boolean {
|
||||||
if (tag.id) {
|
if (tag.id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user