| | |
| | | |
| | | <script> |
| | | import { mapStores } from 'pinia'; |
| | | import missionApi from '@/api/missionApi'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | import { useMissionStore } from '@/stores/mission'; |
| | | |
| | |
| | | }, |
| | | methods: { |
| | | fetchMission() { |
| | | // this.fetchData((page, pageSize) => { |
| | | // return missionApi |
| | | // .fethchMission({ type: this.type, page, pageSize }) |
| | | // .then((res) => { |
| | | // this.missionList = res.data; |
| | | // this.missionStore.missionList = res.data; |
| | | // // if (this.missionList.length > 0) { |
| | | // // this.handleChange(0); |
| | | // // } |
| | | // return res.head; |
| | | // }); |
| | | // }); |
| | | this.missionStore.fetchMission(this.type); |
| | | this.missionStore.fetchMission(this.type).then((res) => { |
| | | if (res.success && res.data.length > 0) { |
| | | this.index = 0; |
| | | this.handleChange(0); |
| | | } |
| | | }); |
| | | }, |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', this.missionStore.missionList[value]); |
| | | // this.$emit('change', this.missionList[value]); |
| | | } |
| | | }, |
| | | mounted() { |