|
@@ -9,11 +9,11 @@
|
|
|
<view class="flex justify-between items-center">
|
|
<view class="flex justify-between items-center">
|
|
|
<view class="text-lg text-fore-title">报考院校专业</view>
|
|
<view class="text-lg text-fore-title">报考院校专业</view>
|
|
|
<view class="text-base text-fore-placeholder flex items-center" @click="handleSelect">
|
|
<view class="text-base text-fore-placeholder flex items-center" @click="handleSelect">
|
|
|
- <text>更多</text>
|
|
|
|
|
|
|
+ <text>请选择</text>
|
|
|
<uv-icon name="arrow-right" color="info"/>
|
|
<uv-icon name="arrow-right" color="info"/>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <ie-empty v-if="!data.rules?.length" :image="emptyImg" text="请选择你的报考院校专业~"/>
|
|
|
|
|
|
|
+ <ie-empty v-if="!rules.length" :image="emptyImg" text="请选择你的报考院校专业~"/>
|
|
|
<voluntary-form v-else ref="form"/>
|
|
<voluntary-form v-else ref="form"/>
|
|
|
</view>
|
|
</view>
|
|
|
<ie-safe-toolbar :height="84" :shadow="false">
|
|
<ie-safe-toolbar :height="84" :shadow="false">
|
|
@@ -28,154 +28,72 @@
|
|
|
|
|
|
|
|
import config from "@/config";
|
|
import config from "@/config";
|
|
|
import VoluntaryForm from "@/pagesOther/pages/voluntary/index/components/voluntary-form.vue";
|
|
import VoluntaryForm from "@/pagesOther/pages/voluntary/index/components/voluntary-form.vue";
|
|
|
-import {SelectedCollegeMajorWithRules, VoluntaryDto, VoluntaryModel, VoluntaryResult} from "@/types/voluntary";
|
|
|
|
|
-import {VOLUNTARY_FORM, VOLUNTARY_MODEL} from "@/types/injectionSymbols";
|
|
|
|
|
|
|
+import {SelectedUniversityMajor} from "@/types/study";
|
|
|
|
|
+import {EnrollRule, VoluntaryDto, VoluntaryModel, VoluntaryResult} from "@/types/voluntary";
|
|
|
|
|
+import {VOLUNTARY_MODEL, VOLUNTARY_RULES, VOLUNTARY_TARGET} from "@/types/injectionSymbols";
|
|
|
import {useTransferPage} from "@/hooks/useTransferPage";
|
|
import {useTransferPage} from "@/hooks/useTransferPage";
|
|
|
import {routes} from "@/common/routes";
|
|
import {routes} from "@/common/routes";
|
|
|
|
|
+import {UniversityPickerPageOptions} from "@/types/transfer";
|
|
|
|
|
+import {getRenderRules, postRenderRules} from "@/api/modules/voluntary";
|
|
|
|
|
|
|
|
const emptyImg = computed(() => config.ossUrl + '/volunteer/voluntary/index/empty_data.png')
|
|
const emptyImg = computed(() => config.ossUrl + '/volunteer/voluntary/index/empty_data.png')
|
|
|
|
|
|
|
|
-const form = ref<InstanceType<typeof VoluntaryForm> | null>(null)
|
|
|
|
|
-const data = ref<SelectedCollegeMajorWithRules>({} as SelectedCollegeMajorWithRules)
|
|
|
|
|
|
|
+const form = ref<InstanceType<typeof VoluntaryForm>>()
|
|
|
|
|
+const target = ref<SelectedUniversityMajor>()
|
|
|
|
|
+const rules = ref<EnrollRule[]>([])
|
|
|
const model = ref<VoluntaryModel>({})
|
|
const model = ref<VoluntaryModel>({})
|
|
|
const {transferTo} = useTransferPage<any, VoluntaryDto>()
|
|
const {transferTo} = useTransferPage<any, VoluntaryDto>()
|
|
|
|
|
|
|
|
const handleSelect = async () => {
|
|
const handleSelect = async () => {
|
|
|
- transferTo()
|
|
|
|
|
|
|
+ const option: UniversityPickerPageOptions = {
|
|
|
|
|
+ title: '选择你的报考院校专业',
|
|
|
|
|
+ fromVoluntary: true,
|
|
|
|
|
+ selectedUniversityId: target.value?.universityId,
|
|
|
|
|
+ selectedMajorId: target.value?.majorId
|
|
|
|
|
+ }
|
|
|
|
|
+ const picked = await transferTo(routes.targetPicker, {data: option})
|
|
|
|
|
+ if (!picked) return
|
|
|
|
|
+ target.value = picked
|
|
|
|
|
+ uni.$ie.showLoading()
|
|
|
|
|
+ try {
|
|
|
|
|
+ // reset
|
|
|
|
|
+ model.value = {}
|
|
|
|
|
+ rules.value = []
|
|
|
|
|
+ // request render rules
|
|
|
|
|
+ const res = await getRenderRules(target.value)
|
|
|
|
|
+ rules.value = res.data
|
|
|
|
|
+ // init model
|
|
|
|
|
+ rules.value.forEach((r) => {
|
|
|
|
|
+ r.details.forEach((d) => {
|
|
|
|
|
+ if (d.options?.length) {
|
|
|
|
|
+ model.value[d.fieldName] = d.defaultValue ? d.defaultValue : ''
|
|
|
|
|
+ model.value[d.fieldName + 'Total'] = d.options ? d.options[0] : null
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.log('getRenderRules ex', e, target.value)
|
|
|
|
|
+ target.value = null // clear for re-pick
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ uni.$ie.hideLoading()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleSubmit = async () => {
|
|
const handleSubmit = async () => {
|
|
|
await form.value?.validate()
|
|
await form.value?.validate()
|
|
|
// make request
|
|
// make request
|
|
|
- await nextTick()
|
|
|
|
|
- const result: VoluntaryResult = {
|
|
|
|
|
- "universityCode": "12302",
|
|
|
|
|
- "majorCode": "690390",
|
|
|
|
|
- "majorEnrollCode": "68508",
|
|
|
|
|
- "majorGroup": "专业B组",
|
|
|
|
|
- "majorName": "集成电路技术",
|
|
|
|
|
- "majorDirection": "",
|
|
|
|
|
- "enumPickType": "Danger",
|
|
|
|
|
- "enrollRate": 53,
|
|
|
|
|
- "enrollRateText": "风险极高",
|
|
|
|
|
- "tips": null,
|
|
|
|
|
- "histories": [
|
|
|
|
|
- {
|
|
|
|
|
- "year": 2025,
|
|
|
|
|
- "score": "489.0",
|
|
|
|
|
- "plan": 15,
|
|
|
|
|
- "enroll": 15,
|
|
|
|
|
- "diff": -12,
|
|
|
|
|
- "ruleContent": '语数外180(语100*0.6+数100*0.6+外100*0.6)+职业技能420(技能展示300*1.4)',
|
|
|
|
|
- "application": 3.1,
|
|
|
|
|
- "admission": 1
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "year": 2024,
|
|
|
|
|
- "score": "",
|
|
|
|
|
- "plan": null,
|
|
|
|
|
- "enroll": 20
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "year": 2023,
|
|
|
|
|
- "score": "504.0",
|
|
|
|
|
- "plan": null,
|
|
|
|
|
- "enroll": 32
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "skill": {
|
|
|
|
|
- year: 2025,
|
|
|
|
|
- cultureScore: 230,
|
|
|
|
|
- cultureRule: "语数外",
|
|
|
|
|
- enrollScore: 489,
|
|
|
|
|
- skillScore: 259, // 反向测技能分
|
|
|
|
|
- diff: 0 // 负数表示低于skillScore,正数高于
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- const bigData: VoluntaryDto = {data: data.value, model: model.value, result}
|
|
|
|
|
|
|
+ const {data: result} = await postRenderRules(target.value, model.value)
|
|
|
|
|
+ const bigData: VoluntaryDto = {target: target.value, rules: rules.value, model: model.value, result}
|
|
|
transferTo(routes.voluntaryResult, {bigData})
|
|
transferTo(routes.voluntaryResult, {bigData})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-onMounted(async () => {
|
|
|
|
|
- // api get rules
|
|
|
|
|
- await nextTick()
|
|
|
|
|
- data.value = {
|
|
|
|
|
- // code: "20949",
|
|
|
|
|
- majorAncestors: "交通运输大类>铁道运输类",
|
|
|
|
|
- majorId: "68526",
|
|
|
|
|
- majorName: "铁道交通运营管理",
|
|
|
|
|
- majorGroup: '专业组一',
|
|
|
|
|
- // notice: "",
|
|
|
|
|
- universityId: "20949",
|
|
|
|
|
- universityLogo: "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/23b6da550a584ea6b60886c6ae97b610.jpg",
|
|
|
|
|
- universityName: "湖南铁道职业技术学院",
|
|
|
|
|
- rules: [{
|
|
|
|
|
- category: '文化素质',
|
|
|
|
|
- content: '语(100分)+数(100分)+外(100分)',
|
|
|
|
|
- details: [{
|
|
|
|
|
- enumRuleCategory: 'Enroll',
|
|
|
|
|
- enumInputType: 'Score',
|
|
|
|
|
- label: '语文',
|
|
|
|
|
- options: ["100"],
|
|
|
|
|
- fieldName: '语文',
|
|
|
|
|
- required: true,
|
|
|
|
|
- readonly: true,
|
|
|
|
|
- defaultValue: 80
|
|
|
|
|
- }, {
|
|
|
|
|
- enumRuleCategory: 'Enroll',
|
|
|
|
|
- enumInputType: 'Score',
|
|
|
|
|
- label: '数学',
|
|
|
|
|
- options: ["100"],
|
|
|
|
|
- fieldName: '数学',
|
|
|
|
|
- required: true,
|
|
|
|
|
- defaultValue: 84
|
|
|
|
|
- }, {
|
|
|
|
|
- enumRuleCategory: 'Enroll',
|
|
|
|
|
- enumInputType: 'Score',
|
|
|
|
|
- label: '外语',
|
|
|
|
|
- options: ["100"],
|
|
|
|
|
- fieldName: '外语',
|
|
|
|
|
- required: true,
|
|
|
|
|
- defaultValue: 88
|
|
|
|
|
- }]
|
|
|
|
|
- }, {
|
|
|
|
|
- category: '职业技能',
|
|
|
|
|
- content: '机试(200分)+ 技能展示(100分)',
|
|
|
|
|
- details: [{
|
|
|
|
|
- enumRuleCategory: 'Enroll',
|
|
|
|
|
- enumInputType: 'Score',
|
|
|
|
|
- label: '笔试/机试',
|
|
|
|
|
- options: ["200"],
|
|
|
|
|
- fieldName: '笔试/机试',
|
|
|
|
|
- required: true,
|
|
|
|
|
- defaultValue: 180
|
|
|
|
|
- }, {
|
|
|
|
|
- enumRuleCategory: 'Enroll',
|
|
|
|
|
- enumInputType: 'Score',
|
|
|
|
|
- label: '技能展示',
|
|
|
|
|
- options: ["100"],
|
|
|
|
|
- fieldName: '技能展示',
|
|
|
|
|
- required: true,
|
|
|
|
|
- defaultValue: 81
|
|
|
|
|
- }]
|
|
|
|
|
- }]
|
|
|
|
|
- }
|
|
|
|
|
- // init model
|
|
|
|
|
- data.value.rules.forEach((r) => {
|
|
|
|
|
- r.details.forEach((d) => {
|
|
|
|
|
- if (d.options?.length) {
|
|
|
|
|
- model.value[d.fieldName] = d.defaultValue ? d.defaultValue : ''
|
|
|
|
|
- model.value[d.fieldName + 'Total'] = d.options ? d.options[0] : null
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-provide(VOLUNTARY_FORM, data)
|
|
|
|
|
|
|
+provide(VOLUNTARY_TARGET, target)
|
|
|
|
|
+provide(VOLUNTARY_RULES, rules)
|
|
|
provide(VOLUNTARY_MODEL, model)
|
|
provide(VOLUNTARY_MODEL, model)
|
|
|
|
|
|
|
|
// 为了让子组件触发页面滚动
|
|
// 为了让子组件触发页面滚动
|
|
|
-onPageScroll(() => { })
|
|
|
|
|
|
|
+onPageScroll(() => {
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|