diff --git a/src/api/person.ts b/src/api/person.ts index 95fec01..27ad773 100644 --- a/src/api/person.ts +++ b/src/api/person.ts @@ -1,5 +1,14 @@ import request from '@/utils/requset' - +function f(callback: Function) { + return (...arg: any[]) => { + return new Promise((resolve, reject) => { + callback(...arg).then((res: any) => { + if (res.code >= 200 && res.code < 300) resolve(res) + else reject(res) + }).catch(reject); + }) + } +} enum api { liststu = '/abilityEvaluation/personalAbilityEvaluationCollect/liststu', // 个人能力评价列表 @@ -9,17 +18,19 @@ enum api { competitionOne = '/AnnualCompPoint/annualCompPoint/findcomppxq', // 比赛项目单个 signUp = '/annualcompetitionprojectregistration/annualCompetitionProjectRegistration/edit', // 年度比赛项目报名 POST } -export const getlEvaluateApi = (params: Record<'pageNo' | 'pageSize', number>) => request.get(api.liststu, { params }); -export const getlIntegralApi = (params: Record<'pageNo' | 'pageSize', number>) => request.get(api.integral, { params }); +export const getlEvaluateApi = f((params: Record<'pageNo' | 'pageSize', number>) => request.get(api.liststu, { params })); +export const getlIntegralApi = f((params: Record<'pageNo' | 'pageSize', number>) => request.get(api.integral, { params })); -export const getXsfxbgApi = (params = {}) => { - const par = { recreateFlag: false, annualid: '' }; - Object.assign(par, params); - return request.get(api.PAGE_XSFXBG, { params: par }); -}; +export const getXsfxbgApi = f( + (params = {}) => { + const par = { recreateFlag: false, annualid: '' }; + Object.assign(par, params); + return request.get(api.PAGE_XSFXBG, { params: par }); + } +); -export const getCompetitionApi = (id: string) => request.get(api.competition, { params: { id } }); -export const getCompetitionOneApi = (id: string) => request.get(api.competitionOne, { params: { id } }); +export const getCompetitionApi = f((id: string) => request.get(api.competition, { params: { id } })); +export const getCompetitionOneApi = f((id: string) => request.get(api.competitionOne, { params: { id } })); interface SignUpData { annualCompid: string, @@ -28,4 +39,4 @@ interface SignUpData { instructorSheetList?: any[], teamManagementList?: any[], } -export const getSignUpApi = (data: SignUpData) => request.post(api.signUp, data); \ No newline at end of file +export const getSignUpApi = f((data: SignUpData) => request.post(api.signUp, data)); \ No newline at end of file diff --git a/src/utils/asyncHint.ts b/src/utils/asyncHint.ts index 2ef0fbe..e1be234 100644 --- a/src/utils/asyncHint.ts +++ b/src/utils/asyncHint.ts @@ -54,8 +54,6 @@ export function getHint(pro: Promise, options: Options = {}) { if (opt.onRejected) opt.onRejected(err); } const onFinish = () => { - console.log(opt, opt.onFinish); - if (opt.onFinish) opt.onFinish(); } diff --git a/src/views/projectName/index.vue b/src/views/projectName/index.vue index f93d2c4..cf585aa 100644 --- a/src/views/projectName/index.vue +++ b/src/views/projectName/index.vue @@ -84,7 +84,8 @@ function handleSub() { let path; if (data.value.entryForm === 'Y') path = '/registrationGroup'; else path = '/registrationPersonage'; - router.push({ path, query: { id: route.query.id } }) + + router.push({ path, query: { id: route.query.id,objName:data.value.objName } }) } getData(); diff --git a/src/views/registrationPersonage/index.vue b/src/views/registrationPersonage/index.vue index 1754f73..b6948e1 100644 --- a/src/views/registrationPersonage/index.vue +++ b/src/views/registrationPersonage/index.vue @@ -79,7 +79,7 @@
个人信息
- +
@@ -106,6 +106,12 @@
邮箱
{{ info.email }}
+
+
队伍名称
+
+ +
+