|
@@ -1,12 +1,11 @@
|
|
|
-import {computed} from 'vue';
|
|
|
|
|
-import {createEventHook, injectLocal, provideLocal, toValue} from "@vueuse/core";
|
|
|
|
|
-import {sleep, toast} from "@/uni_modules/uv-ui-tools/libs/function";
|
|
|
|
|
-import MxConst from "@/common/mxConst";
|
|
|
|
|
|
|
+import {createEventHook, injectLocal, provideLocal} from "@vueuse/core";
|
|
|
|
|
+import {sleep} from "@/uni_modules/uv-ui-tools/libs/function";
|
|
|
import {empty} from "@/uni_modules/uv-ui-tools/libs/function/test";
|
|
import {empty} from "@/uni_modules/uv-ui-tools/libs/function/test";
|
|
|
-import {saveZhiyuan} from "@/api/webApi/volunteer";
|
|
|
|
|
|
|
+import {recommendMajorSortFn} from "@/utils/common";
|
|
|
|
|
+import {saveZhiyuan} from "@/api/modules/vhs";
|
|
|
|
|
|
|
|
const key = Symbol('VOLUNTARY_ASSISTANT')
|
|
const key = Symbol('VOLUNTARY_ASSISTANT')
|
|
|
-export const useProvideVoluntaryAssistant = function (stepSvc, dataSvc, formSvc, cartSvc, highlightSvc, scrollHeight) {
|
|
|
|
|
|
|
+export const useProvideVoluntaryAssistant = function (stepSvc, dataSvc, formSvc, cartSvc, highlightSvc) {
|
|
|
|
|
|
|
|
const {title, currentStep} = stepSvc
|
|
const {title, currentStep} = stepSvc
|
|
|
const {id, name, locking, selectedList, resetCart} = cartSvc
|
|
const {id, name, locking, selectedList, resetCart} = cartSvc
|
|
@@ -71,7 +70,7 @@ export const useProvideVoluntaryAssistant = function (stepSvc, dataSvc, formSvc,
|
|
|
|
|
|
|
|
const save = async (isMockHeader) => {
|
|
const save = async (isMockHeader) => {
|
|
|
if (toValue(id) && !toValue(name)) {
|
|
if (toValue(id) && !toValue(name)) {
|
|
|
- toast('请设置志愿表名称')
|
|
|
|
|
|
|
+ uni.$ie.showError('请设置志愿表名称')
|
|
|
return Promise.reject(false)
|
|
return Promise.reject(false)
|
|
|
}
|
|
}
|
|
|
const wishes = selectedList.value.map(item => ({
|
|
const wishes = selectedList.value.map(item => ({
|
|
@@ -89,7 +88,7 @@ export const useProvideVoluntaryAssistant = function (stepSvc, dataSvc, formSvc,
|
|
|
seat: item.history?.seat,
|
|
seat: item.history?.seat,
|
|
|
marjors: item.majors
|
|
marjors: item.majors
|
|
|
.filter(major => major.selected)
|
|
.filter(major => major.selected)
|
|
|
- .sort(MxConst.recommendMajorSortFn)
|
|
|
|
|
|
|
+ .sort(recommendMajorSortFn)
|
|
|
.map(major => ({
|
|
.map(major => ({
|
|
|
id: major.id,
|
|
id: major.id,
|
|
|
code: major.marjorBelongs,
|
|
code: major.marjorBelongs,
|
|
@@ -103,11 +102,11 @@ export const useProvideVoluntaryAssistant = function (stepSvc, dataSvc, formSvc,
|
|
|
}))
|
|
}))
|
|
|
if (wishes.length < 1) {
|
|
if (wishes.length < 1) {
|
|
|
// NOTE: 职高对口院校较少,降低填报限制
|
|
// NOTE: 职高对口院校较少,降低填报限制
|
|
|
- toast('至少选择1个志愿组')
|
|
|
|
|
|
|
+ uni.$ie.showError('至少选择1个志愿组')
|
|
|
return Promise.reject(false)
|
|
return Promise.reject(false)
|
|
|
}
|
|
}
|
|
|
locking.value = true
|
|
locking.value = true
|
|
|
- uni.showLoading()
|
|
|
|
|
|
|
+ uni.$ie.showLoading()
|
|
|
const vBatch = toValue(batch)
|
|
const vBatch = toValue(batch)
|
|
|
const vModel = toValue(model)
|
|
const vModel = toValue(model)
|
|
|
const vMode = toValue(mode)
|
|
const vMode = toValue(mode)
|
|
@@ -139,11 +138,11 @@ export const useProvideVoluntaryAssistant = function (stepSvc, dataSvc, formSvc,
|
|
|
let res = null
|
|
let res = null
|
|
|
try {
|
|
try {
|
|
|
res = await saveZhiyuan(data)
|
|
res = await saveZhiyuan(data)
|
|
|
- toast('保存成功,即将跳转3')
|
|
|
|
|
|
|
+ uni.$ie.showToast('保存成功,即将跳转3')
|
|
|
await sleep(1000)
|
|
await sleep(1000)
|
|
|
- toast('保存成功,即将跳转2')
|
|
|
|
|
|
|
+ uni.$ie.showToast('保存成功,即将跳转2')
|
|
|
await sleep(1000)
|
|
await sleep(1000)
|
|
|
- toast('保存成功,即将跳转1')
|
|
|
|
|
|
|
+ uni.$ie.showToast('保存成功,即将跳转1')
|
|
|
await sleep(500)
|
|
await sleep(500)
|
|
|
await complete.trigger(res.data)
|
|
await complete.trigger(res.data)
|
|
|
} finally {
|
|
} finally {
|
|
@@ -164,7 +163,6 @@ export const useProvideVoluntaryAssistant = function (stepSvc, dataSvc, formSvc,
|
|
|
voluntaryDataCalculate,
|
|
voluntaryDataCalculate,
|
|
|
save,
|
|
save,
|
|
|
resetAll,
|
|
resetAll,
|
|
|
- scrollHeight,
|
|
|
|
|
onBeforeBack: beforeBack.on,
|
|
onBeforeBack: beforeBack.on,
|
|
|
onAfterBack: afterBack.on,
|
|
onAfterBack: afterBack.on,
|
|
|
onBeforeForward: beforeForward.on,
|
|
onBeforeForward: beforeForward.on,
|