Skip to content

Commit

Permalink
add transaction edit dialog basis code
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed Aug 13, 2023
1 parent d77b9ef commit 86e9a3e
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ export default {
'No Location': 'No Location',
'Getting Location...': 'Getting Location...',
'Show on the map': 'Show on the map',
'Location on Map': 'Location on Map',
'Update Geographic Location': 'Update Geographic Location',
'Clear Geographic Location': 'Clear Geographic Location',
'Unable to get current position': 'Unable to get current position',
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh_Hans.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ export default {
'No Location': '没有位置',
'Getting Location...': '正在获取位置...',
'Show on the map': '在地图上显示',
'Location on Map': '地图上的位置',
'Update Geographic Location': '更新地理位置',
'Clear Geographic Location': '清除地理位置',
'Unable to get current position': '无法获取当前地理位置',
Expand Down
41 changes: 34 additions & 7 deletions src/views/desktop/transactions/ListPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,15 @@
:max-time="query.maxTime"
v-model:show="showCustomDateRangeDialog"
@dateRange:change="changeCustomDateFilter" />
<edit-dialog ref="editDialog" :persistent="true" />

<confirm-dialog ref="confirmDialog"/>
<snack-bar ref="snackbar" />
</template>

<script>
import EditDialog from './list/dialogs/EditDialog.vue';
import { useDisplay } from 'vuetify';
import { mapStores } from 'pinia';
Expand Down Expand Up @@ -374,6 +377,9 @@ import {
} from '@mdi/js';
export default {
components: {
EditDialog
},
props: [
'initDateType',
'initMaxTime',
Expand Down Expand Up @@ -825,16 +831,37 @@ export default {
this.reload(false);
},
add() {
const self = this;
self.$refs.editDialog.open({
type: self.query.type,
categoryId: self.query.categoryId,
accountId: self.query.accountId
}).then(result => {
if (result && result.message) {
self.$refs.snackbar.showMessage(result.message);
}
}).catch(error => {
if (error) {
self.$refs.snackbar.showError(error);
}
});
},
duplicate() {
},
show() {
},
edit() {
show(transaction) {
const self = this;
self.$refs.editDialog.open({
id: transaction.id,
currentTransaction: transaction
}).then(result => {
if (result && result.message) {
self.$refs.snackbar.showMessage(result.message);
}
}).catch(error => {
if (error) {
self.$refs.snackbar.showError(error);
}
});
},
remove(transaction) {
const self = this;
Expand Down

0 comments on commit 86e9a3e

Please sign in to comment.