mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 09:14:27 +08:00
optimize ui
This commit is contained in:
@@ -442,4 +442,5 @@ export default {
|
|||||||
'Build Time': 'Build Time',
|
'Build Time': 'Build Time',
|
||||||
'Official Website': 'Official Website',
|
'Official Website': 'Official Website',
|
||||||
'License': 'License',
|
'License': 'License',
|
||||||
|
'An error has occurred': 'An error has occurred',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -442,4 +442,5 @@ export default {
|
|||||||
'Build Time': '编译时间',
|
'Build Time': '编译时间',
|
||||||
'Official Website': '官方网站',
|
'Official Website': '官方网站',
|
||||||
'License': '许可协议',
|
'License': '许可协议',
|
||||||
|
'An error has occurred': '发生错误',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -125,6 +125,7 @@
|
|||||||
</f7-list>
|
</f7-list>
|
||||||
</f7-card-content>
|
</f7-card-content>
|
||||||
</f7-card>
|
</f7-card>
|
||||||
|
|
||||||
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
||||||
<f7-actions-group>
|
<f7-actions-group>
|
||||||
<f7-actions-button @click="setSortable()">{{ $t('Sort') }}</f7-actions-button>
|
<f7-actions-button @click="setSortable()">{{ $t('Sort') }}</f7-actions-button>
|
||||||
@@ -134,6 +135,15 @@
|
|||||||
</f7-actions-group>
|
</f7-actions-group>
|
||||||
</f7-actions>
|
</f7-actions>
|
||||||
|
|
||||||
|
<f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false">
|
||||||
|
<f7-actions-group>
|
||||||
|
<f7-actions-label>{{ $t('Are you sure you want to delete this account?') }}</f7-actions-label>
|
||||||
|
<f7-actions-button color="red" @click="remove(accountToDelete)">{{ $t('Delete') }}</f7-actions-button>
|
||||||
|
</f7-actions-group>
|
||||||
|
<f7-actions-group>
|
||||||
|
<f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button>
|
||||||
|
</f7-actions-group>
|
||||||
|
</f7-actions>
|
||||||
</f7-page>
|
</f7-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -145,8 +155,10 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
showHidden: false,
|
showHidden: false,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
|
accountToDelete: null,
|
||||||
showAccountBalance: this.$settings.isShowAccountBalance(),
|
showAccountBalance: this.$settings.isShowAccountBalance(),
|
||||||
showMoreActionSheet: false,
|
showMoreActionSheet: false,
|
||||||
|
showDeleteActionSheet: false,
|
||||||
displayOrderModified: false,
|
displayOrderModified: false,
|
||||||
displayOrderSaving: false
|
displayOrderSaving: false
|
||||||
};
|
};
|
||||||
@@ -540,39 +552,50 @@ export default {
|
|||||||
const app = self.$f7;
|
const app = self.$f7;
|
||||||
const $$ = app.$;
|
const $$ = app.$;
|
||||||
|
|
||||||
self.$confirm('Are you sure you want to delete this account?', () => {
|
if (!account) {
|
||||||
self.$showLoading();
|
self.$alert('An error has occurred');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
self.$services.deleteAccount({
|
if (!self.showDeleteActionSheet) {
|
||||||
id: account.id
|
self.accountToDelete = account;
|
||||||
}).then(response => {
|
self.showDeleteActionSheet = true;
|
||||||
self.$hideLoading();
|
return;
|
||||||
const data = response.data;
|
}
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
self.showDeleteActionSheet = false;
|
||||||
self.$alert('Unable to delete this account');
|
self.accountToDelete = null;
|
||||||
return;
|
self.$showLoading();
|
||||||
}
|
|
||||||
|
|
||||||
app.swipeout.delete($$(`#${self.$options.filters.accountDomId(account)}`), () => {
|
self.$services.deleteAccount({
|
||||||
const accountList = self.accounts[account.category];
|
id: account.id
|
||||||
for (let i = 0; i < accountList.length; i++) {
|
}).then(response => {
|
||||||
if (accountList[i].id === account.id) {
|
self.$hideLoading();
|
||||||
accountList.splice(i, 1);
|
const data = response.data;
|
||||||
}
|
|
||||||
|
if (!data || !data.success || !data.result) {
|
||||||
|
self.$alert('Unable to delete this account');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
app.swipeout.delete($$(`#${self.$options.filters.accountDomId(account)}`), () => {
|
||||||
|
const accountList = self.accounts[account.category];
|
||||||
|
for (let i = 0; i < accountList.length; i++) {
|
||||||
|
if (accountList[i].id === account.id) {
|
||||||
|
accountList.splice(i, 1);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}).catch(error => {
|
|
||||||
self.$logger.error('failed to delete account', error);
|
|
||||||
|
|
||||||
self.$hideLoading();
|
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
|
||||||
self.$alert({ error: error.response.data });
|
|
||||||
} else if (!error.processed) {
|
|
||||||
self.$alert('Unable to delete this account');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}).catch(error => {
|
||||||
|
self.$logger.error('failed to delete account', error);
|
||||||
|
|
||||||
|
self.$hideLoading();
|
||||||
|
|
||||||
|
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||||
|
self.$alert({ error: error.response.data });
|
||||||
|
} else if (!error.processed) {
|
||||||
|
self.$alert('Unable to delete this account');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user