abpcoder 5 päivää sitten
vanhempi
commit
fbe5a5904d
1 muutettua tiedostoa jossa 5 lisäystä ja 6 poistoa
  1. 5 6
      src/pagesOther/pages/voluntary/index/index.vue

+ 5 - 6
src/pagesOther/pages/voluntary/index/index.vue

@@ -28,8 +28,7 @@
 
 import config from "@/config";
 import VoluntaryForm from "@/pagesOther/pages/voluntary/index/components/voluntary-form.vue";
-import {SelectedUniversityMajor} from "@/types/study";
-import {EnrollRule, VoluntaryDto, VoluntaryModel, VoluntaryResult} from "@/types/voluntary";
+import {EnrollRule, VoluntaryDto, VoluntaryModel, SelectedUniversityMajor} from "@/types/voluntary";
 import {VOLUNTARY_MODEL, VOLUNTARY_RULES, VOLUNTARY_TARGET} from "@/types/injectionSymbols";
 import {useTransferPage} from "@/hooks/useTransferPage";
 import {routes} from "@/common/routes";
@@ -39,10 +38,10 @@ import {getRenderRules, postRenderRules} from "@/api/modules/voluntary";
 const emptyImg = computed(() => config.ossUrl + '/volunteer/voluntary/index/empty_data.png')
 
 const form = ref<InstanceType<typeof VoluntaryForm>>()
-const target = ref<SelectedUniversityMajor>()
+const target = ref<SelectedUniversityMajor>({} as SelectedUniversityMajor)
 const rules = ref<EnrollRule[]>([])
 const model = ref<VoluntaryModel>({})
-const {transferTo} = useTransferPage<any, VoluntaryDto>()
+const {transferTo} = useTransferPage()
 
 const handleSelect = async () => {
     const option: UniversityPickerPageOptions = {
@@ -53,7 +52,7 @@ const handleSelect = async () => {
     }
     const picked = await transferTo(routes.targetPicker, {data: option})
     if (!picked) return
-    target.value = picked
+    target.value = picked as SelectedUniversityMajor
     uni.$ie.showLoading()
     try {
         // reset
@@ -73,7 +72,7 @@ const handleSelect = async () => {
         })
     } catch (e) {
         console.log('getRenderRules ex', e, target.value)
-        target.value = null // clear for re-pick
+        target.value = {} as SelectedUniversityMajor // clear for re-pick
     } finally {
         uni.$ie.hideLoading()
     }