Add task moving
This commit is contained in:
@ -21,6 +21,8 @@ export enum Actions {
|
||||
SaveVillageSettings = 'save_village_settings',
|
||||
ToggleVillageReceiveMode = 'toggle_village_receive_mode',
|
||||
RemoveVillageTask = 'remove_village_task',
|
||||
UpVillageTask = 'up_village_task',
|
||||
DownVillageTask = 'down_village_task',
|
||||
}
|
||||
|
||||
export function createStore(villageFactory: VillageFactory) {
|
||||
@ -108,6 +110,14 @@ export function createStore(villageFactory: VillageFactory) {
|
||||
const controller = villageFactory.createController(villageId);
|
||||
controller.removeTask(taskId);
|
||||
},
|
||||
[Actions.UpVillageTask]({}, { villageId, taskId }) {
|
||||
const controller = villageFactory.createController(villageId);
|
||||
controller.upTask(taskId);
|
||||
},
|
||||
[Actions.DownVillageTask]({}, { villageId, taskId }) {
|
||||
const controller = villageFactory.createController(villageId);
|
||||
controller.downTask(taskId);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -26,8 +26,12 @@ export default {
|
||||
props: ['villageId', 'tasks'],
|
||||
computed: {},
|
||||
methods: {
|
||||
upTask(taskId) {},
|
||||
downTask(taskId) {},
|
||||
upTask(taskId) {
|
||||
this.$store.dispatch(Actions.UpVillageTask, { villageId: this.villageId, taskId });
|
||||
},
|
||||
downTask(taskId) {
|
||||
this.$store.dispatch(Actions.DownVillageTask, { villageId: this.villageId, taskId });
|
||||
},
|
||||
removeTask(taskId) {
|
||||
this.$store.dispatch(Actions.RemoveVillageTask, { villageId: this.villageId, taskId });
|
||||
},
|
||||
|
Reference in New Issue
Block a user