浏览代码

voluntary - mock api

abpcoder 4 天之前
父节点
当前提交
b507c11830

+ 432 - 10
src/api/modules/university.ts

@@ -1,37 +1,459 @@
 import {ApiResponse, ApiResponseList} from "@/types";
 import flyio from "../flyio";
 import {University, UniversityTier} from "@/types/university";
+import {sleep} from "@/uni_modules/uv-ui-tools/libs/function";
 
 // 院校库 01 院校列表
 export function universityList(params: Record<string, any>) {
-  return flyio.get('/front/university/list', params) as Promise<ApiResponseList<University>>
+    return flyio.get('/front/university/list', params) as Promise<ApiResponseList<University>>
 }
 
 // 院校库 - 院校梯队
 export function universityListByTier() {
-  // 返回全量,不需要分页
-  return flyio.get('/front/university/listByTier') as Promise<ApiResponse<UniversityTier[]>>
+    return new Promise(async (resolve, reject) => {
+        await sleep(300)
+        const mock = [{
+            typeName: '第一梯队',
+            typeValue: '1',
+            desc: '文化分280分以上',
+            list: [
+                {
+                    "id": 10827,
+                    "code": "10827",
+                    "name": "长沙民政职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/e6027a8c35f7426592f161c47f336fe7.jpg",
+                    "location": "湖南",
+                    "type": "理工类",
+                    "comScore": "85.63",
+                    "cityName": "长沙市",
+                    "star": "5★",
+                    "bxLevel": "双高,公办,国家级示范,现代学徒制试点学院,理工类",
+                    "features": "国家级示范,现代学徒制试点学院",
+                    "address": "湖南省长沙市雨花区香樟路22号",
+                    "hits": 4161780,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://zs.csmzxy.edu.cn/ddzs.htm",
+                    "area": 1024,
+                    "collect": 7915,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 10830,
+                    "code": "10830",
+                    "name": "湖南工业职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/83386e105f03474b91d7c1824e81fa0c.jpg",
+                    "location": "湖南",
+                    "type": "理工类",
+                    "comScore": "81.09",
+                    "cityName": "长沙市",
+                    "star": "5★-",
+                    "bxLevel": "双高,公办,国家级示范,理工类",
+                    "features": "国家级示范",
+                    "address": "湖南省长沙市岳麓区含浦科教园含浦大道139号",
+                    "hits": 2126,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://www.hunangy.com/zsjyc/",
+                    "area": 1031,
+                    "collect": 3169,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 10836,
+                    "code": "10836",
+                    "name": "株洲师范高等专科学校",
+                    "logo": "https://www.hnzzsz.com/template/blue/static/images/logo1.png",
+                    "location": "湖南",
+                    "managerType": "湖南省教育厅",
+                    "type": "师范类",
+                    "cityName": "株洲市",
+                    "bxLevel": "公办,师范类",
+                    "address": "湖南省株洲市云龙示范区智慧路89号",
+                    "hits": 9,
+                    "natureTypeCN": "公办",
+                    "area": 348,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 10865,
+                    "code": "10865",
+                    "name": "湖南信息职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/ed33a51d6ffa43ff89d93337f4a4369e.jpg",
+                    "location": "湖南",
+                    "type": "理工类",
+                    "comScore": "69.58",
+                    "cityName": "长沙市",
+                    "star": "3★",
+                    "bxLevel": "公办,理工类",
+                    "features": "",
+                    "address": "望城校区:湖南省长沙市望城区旺旺中路8号,芙蓉校区:湖南省长沙市芙蓉区职院街169号",
+                    "hits": 3268,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://zs.hniu.cn/recruit/index/index",
+                    "area": 345,
+                    "collect": 1594,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12055,
+                    "code": "12055",
+                    "name": "长沙航空职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/f8ec6944910f42e8a2a430db9b37f622.jpg",
+                    "location": "湖南",
+                    "type": "理工类",
+                    "comScore": "80.01",
+                    "cityName": "长沙市",
+                    "star": "5★-",
+                    "bxLevel": "双高,公办,现代学徒制试点学院,理工类",
+                    "features": "现代学徒制试点学院",
+                    "address": "湖南省长沙市雨花区跳马镇(跳马校区),湖南省长沙市雨花区体院路348号(圭塘校区)",
+                    "hits": 1133,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://dzw.cavtc.cn/",
+                    "area": 1000,
+                    "collect": 484,
+                    "enrollLocation": "湖南"
+                },
+
+
+            ]
+        }, {
+            typeName: '第二梯队',
+            typeValue: '2',
+            desc: '文化分270分以上',
+            list: [{
+                "id": 12300,
+                "code": "12300",
+                "name": "湖南大众传媒职业技术学院",
+                "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/2613786a1409452899cbbe1b2c413058.jpg",
+                "location": "湖南",
+                "type": "综合类",
+                "comScore": "71.73",
+                "cityName": "长沙市",
+                "star": "3★",
+                "bxLevel": "公办,国家级骨干,综合类",
+                "features": "国家级骨干",
+                "address": "湖南省长沙市星沙经济开发区特立路5号",
+                "hits": 6805,
+                "natureTypeCN": "公办",
+                "webSite": "http://www.hnmmc.cn:85/",
+                "area": 594,
+                "collect": 3048,
+                "enrollLocation": "湖南"
+            },
+                {
+                    "id": 12301,
+                    "code": "12301",
+                    "name": "永州职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/81a43cae8bb54211aa9be0849f47a708.jpg",
+                    "location": "湖南",
+                    "type": "综合类",
+                    "comScore": "73.17",
+                    "cityName": "永州市",
+                    "star": "4★",
+                    "bxLevel": "公办,国家级示范,现代学徒制试点学院,综合类",
+                    "features": "国家级示范,现代学徒制试点学院",
+                    "address": "湖南省永州市零陵区永州大道289号",
+                    "hits": 6508,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://hnyzzy.com/zsc/",
+                    "area": 3362,
+                    "collect": 2766,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12302,
+                    "code": "12302",
+                    "name": "湖南铁道职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/23b6da550a584ea6b60886c6ae97b610.jpg",
+                    "location": "湖南",
+                    "type": "综合类",
+                    "comScore": "82.96",
+                    "cityName": "株洲市",
+                    "star": "5★",
+                    "bxLevel": "双高,公办,国家级示范,现代学徒制试点学院,综合类",
+                    "features": "国家级示范,现代学徒制试点学院",
+                    "address": "湖南省株洲市石峰区田心大道18号",
+                    "hits": 3804,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://zs.hnrpc.com/zsxt-web/zzzs/hntd/index.do",
+                    "area": 377,
+                    "collect": 1277,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12304,
+                    "code": "12304",
+                    "name": "湖南科技职业学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/55654765a95d470f9ce32d6a2799cbdf.jpg",
+                    "location": "湖南",
+                    "type": "综合类",
+                    "comScore": "71.66",
+                    "cityName": "长沙市",
+                    "star": "3★",
+                    "bxLevel": "公办,国家级骨干,综合类",
+                    "features": "国家级骨干",
+                    "address": "雨花校区:湖南省长沙市井湾路784号,暮云校区:湖南省长沙市中意三路花园",
+                    "hits": 4326,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://zsb.hnkjxy.net.cn/",
+                    "area": 1000,
+                    "collect": 1683,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12343,
+                    "code": "12343",
+                    "name": "湖南生物机电职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/7a6ac5559c424458a16fead8e6c522f9.jpg",
+                    "location": "湖南",
+                    "type": "农林类",
+                    "comScore": "73.31",
+                    "cityName": "长沙市",
+                    "star": "4★",
+                    "bxLevel": "双高,公办,现代学徒制试点学院,农林类",
+                    "features": "现代学徒制试点学院",
+                    "address": "湖南省长沙市芙蓉区隆平高科技园",
+                    "hits": 4992,
+                    "natureTypeCN": "公办",
+                    "webSite": "https://zsjy.hnbemc.cn/",
+                    "area": 2470,
+                    "collect": 3353,
+                    "enrollLocation": "湖南"
+                }]
+        }, {
+            typeName: '第三梯队',
+            typeValue: '3',
+            desc: '文化分260分以上',
+            list: [{
+                "id": 12397,
+                "code": "12397",
+                "name": "湖南交通职业技术学院",
+                "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/4446a9570f03422a92472c0bc9980825.jpg",
+                "location": "湖南",
+                "type": "理工类",
+                "comScore": "78.85",
+                "cityName": "长沙市",
+                "star": "5★-",
+                "bxLevel": "双高,公办,国家级示范,理工类",
+                "features": "国家级示范",
+                "address": "湖南省长沙市黄兴镇湖南交通职业技术学院",
+                "hits": 5584,
+                "natureTypeCN": "公办",
+                "webSite": "http://zsw.hnjtzy.com.cn/",
+                "area": 728,
+                "collect": 2047,
+                "enrollLocation": "湖南"
+            },
+                {
+                    "id": 12401,
+                    "code": "12401",
+                    "name": "湖南商务职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/a0995669452c4f2e9ad4b9faa6903883.jpg",
+                    "location": "湖南",
+                    "type": "财经类",
+                    "comScore": "66.37",
+                    "cityName": "长沙市",
+                    "star": "3★",
+                    "bxLevel": "公办,财经类",
+                    "features": "",
+                    "address": "湖南省长沙市岳麓区雷锋大道335号",
+                    "hits": 3381,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://www.hnswxy.com/danzhao/",
+                    "area": 428,
+                    "collect": 1751,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12423,
+                    "code": "12423",
+                    "name": "湖南体育职业学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/ffa48630d0da4dd89f7f9855dadb8565.jpg",
+                    "location": "湖南",
+                    "type": "体育类",
+                    "comScore": "64.69",
+                    "cityName": "长沙市",
+                    "star": "",
+                    "bxLevel": "公办,体育类",
+                    "features": "",
+                    "address": "湖南省长沙市雨花区体院北路71号",
+                    "hits": 1143,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://www.hntyxy.net/zsw.jhtml",
+                    "area": 689,
+                    "collect": 199,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12425,
+                    "code": "12425",
+                    "name": "湖南工程职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/475316e2a3ef4674806730bac4499c55.jpg",
+                    "location": "湖南",
+                    "type": "理工类",
+                    "comScore": "69.67",
+                    "cityName": "长沙市",
+                    "star": "3★",
+                    "bxLevel": "公办,理工类",
+                    "features": "",
+                    "address": "湖南省长沙市万家丽北路水渡河100号",
+                    "hits": 753,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://hngczyzs.bibibi.net/recruit/index/index",
+                    "area": 600,
+                    "collect": 1790,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12596,
+                    "code": "12596",
+                    "name": "保险职业学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/9e259e8a208f4865ab37397d649ee051.jpg",
+                    "location": "湖南",
+                    "type": "财经类",
+                    "comScore": "64.26",
+                    "cityName": "长沙市",
+                    "star": "",
+                    "bxLevel": "公办,财经类",
+                    "features": "",
+                    "address": "湖南省长沙市天心区中豹塘路196号",
+                    "hits": 3985,
+                    "natureTypeCN": "公办",
+                    "webSite": "https://www.bxxy.com/html/folder/20070139-1.htm",
+                    "area": 157,
+                    "collect": 307,
+                    "enrollLocation": "湖南"
+                }]
+        }, {
+            typeName: '第四梯队',
+            typeValue: '4',
+            desc: '文化分250分以上',
+            list: [{
+                "id": 12597,
+                "code": "12597",
+                "name": "湖南外贸职业学院",
+                "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/4e039fa413b1435e8aaadff57306519c.jpg",
+                "location": "湖南",
+                "type": "财经类",
+                "comScore": "66.92",
+                "cityName": "长沙市",
+                "star": "3★",
+                "bxLevel": "公办,财经类",
+                "features": "",
+                "address": "湖南省长沙市芙蓉北路望城区丁字镇翻身垸",
+                "hits": 3086,
+                "natureTypeCN": "公办",
+                "webSite": "http://www.hnwmxy.com/hezuobangongshi/",
+                "area": 706,
+                "collect": 1945,
+                "enrollLocation": "湖南"
+            },
+                {
+                    "id": 12598,
+                    "code": "12598",
+                    "name": "湖南网络工程职业学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/6ed81c4da4ff4f44a356a1701459d2a5.jpg",
+                    "location": "湖南",
+                    "type": "综合类",
+                    "comScore": "67.38",
+                    "cityName": "长沙市",
+                    "star": "3★",
+                    "bxLevel": "公办,综合类",
+                    "features": "",
+                    "address": "湖南省长沙市青园路168号",
+                    "hits": 2689,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://www2.hnevc.com/zs/",
+                    "area": 264,
+                    "collect": 739,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12600,
+                    "code": "12600",
+                    "name": "邵阳职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/d3ea79ff7cfe4951bc4e39d118fa5adf.jpg",
+                    "location": "湖南",
+                    "type": "综合类",
+                    "comScore": "64.27",
+                    "cityName": "邵阳市",
+                    "star": "",
+                    "bxLevel": "公办,其他,综合类",
+                    "features": "其他",
+                    "address": "湖南省邵阳市大祥区城南乡学院路",
+                    "hits": 1801,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://www.syzyedu.com/bm/default.aspx?depid=25",
+                    "area": 640,
+                    "collect": 497,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12601,
+                    "code": "12601",
+                    "name": "湖南司法警官职业学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/b99a0e8c360e494ba3ddbf60cec9d21b.jpg",
+                    "location": "湖南",
+                    "type": "政法类",
+                    "comScore": "64.04",
+                    "cityName": "长沙市",
+                    "star": "",
+                    "bxLevel": "公办,政法类",
+                    "features": "",
+                    "address": "湖南省长沙市芙蓉区远大二路1069号",
+                    "hits": 3178,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://zs.hnsfjy.cn",
+                    "area": 0,
+                    "collect": 807,
+                    "enrollLocation": "湖南"
+                },
+                {
+                    "id": 12603,
+                    "code": "12603",
+                    "name": "长沙商贸旅游职业技术学院",
+                    "logo": "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/ef1bcd5af239468299787456d9307da1.jpg",
+                    "location": "湖南",
+                    "type": "财经类",
+                    "comScore": "75.46",
+                    "cityName": "长沙市",
+                    "star": "4★",
+                    "bxLevel": "双高,公办,现代学徒制试点学院,财经类",
+                    "features": "现代学徒制试点学院",
+                    "address": "湖南省长沙市雨花区圭白路16号",
+                    "hits": 2215,
+                    "natureTypeCN": "公办",
+                    "webSite": "http://jyzs.hncpu.com:8080/",
+                    "area": 712,
+                    "collect": 5127,
+                    "enrollLocation": "湖南"
+                }]
+        }]
+        resolve({code: 200, data: mock})
+    })
+    // 返回全量,不需要分页
+    return flyio.get('/front/university/listByTier') as Promise<ApiResponse<UniversityTier[]>>
 }
 
 /**
  * 获取院校列表
- * @param params 
- * @returns 
+ * @param params
+ * @returns
  */
 export function getUniversityList() {
-  return flyio.get('/front/student/university') as Promise<ApiResponse<any>>;
+    return flyio.get('/front/student/university') as Promise<ApiResponse<any>>;
 }
 
 /**
  * 获取院校专业列表
- * @param params 
- * @returns 
+ * @param params
+ * @returns
  */
 export function getUniversityMajorList(params: { universityId: string }) {
-  return flyio.get('/front/student/university/major', params) as Promise<ApiResponse<any>>;
+    return flyio.get('/front/student/university/major', params) as Promise<ApiResponse<any>>;
 }
 
 /*院校筛选条件*/
 export function getUniversityFilters() {
-  return flyio.get('/front/university/filters') as Promise<ApiResponse<Record<string, string[]>>>
+    return flyio.get('/front/university/filters') as Promise<ApiResponse<Record<string, string[]>>>
 }

+ 229 - 2
src/api/modules/voluntary.ts

@@ -1,20 +1,161 @@
-import {ApiResponse} from "@/types";
+import {ApiResponse, DictItem} from "@/types";
 import flyio from "../flyio";
-import {EnrollRule, VoluntaryRecord, VoluntaryResult, SelectedUniversityMajor} from "@/types/voluntary";
+import {
+    EnrollRule,
+    VoluntaryRecord,
+    VoluntaryResult,
+    SelectedUniversityMajor,
+    EnrollRuleItem,
+    EnumInputType, EnumRuleCategory, EnumPickType, VoluntaryResultHistory, VoluntaryResultSkill, VoluntaryMajorItem
+} from "@/types/voluntary";
+import {sleep} from "@/uni_modules/uv-ui-tools/libs/function";
 
 export function getRenderRules(um: SelectedUniversityMajor) {
+    return new Promise(async (resolve, reject) => {
+        await sleep(300)
+        const mock: EnrollRule[] = [{
+            category: '文化素质',
+            content: '语数物300分',
+            details: [{
+                defaultValue: 80,
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '语',
+                label: '语文',
+                options: ['100'],
+                readonly: false,
+            }, {
+                defaultValue: 80,
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '数',
+                label: '数学',
+                options: ['100'],
+                readonly: false,
+            }, {
+                defaultValue: 80,
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '物',
+                label: '物理',
+                options: ['100'],
+                readonly: false,
+            }]
+        }, {
+            category: '职业技能',
+            content: '职业技能300分',
+            details: [{
+                defaultValue: 80,
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '技',
+                label: '技能',
+                options: ['200'],
+                readonly: false,
+            }, {
+                defaultValue: 80,
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '职',
+                label: '职业适应',
+                options: ['100'],
+                readonly: false,
+            }]
+        }]
+        resolve({code: 200, data: mock})
+    })
     // 普通高中,EnrollRuleItem.readonly=true 取学考成绩
     const {universityId, majorId} = um
     return flyio.post('/voluntary/getRenderRules', {universityId, majorId}) as Promise<ApiResponse<EnrollRule[]>>
 }
 
 export function getSkillRules(um: SelectedUniversityMajor) {
+    return new Promise(async (resolve, reject) => {
+        await sleep(300)
+        const mock: EnrollRule[] = [{
+            category: '文化素质',
+            content: '语数物300分',
+            details: [{
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '语',
+                label: '语文',
+                options: ['100'],
+                readonly: false,
+            }, {
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '数',
+                label: '数学',
+                options: ['100'],
+                readonly: false,
+            }, {
+                enumInputType: 'Score',
+                enumRuleCategory: 'Enroll',
+                fieldName: '物',
+                label: '物理',
+                options: ['100'],
+                readonly: false,
+            }]
+        }, {
+            category: '职业技能',
+            content: '职业技能300分',
+            details: []
+        }]
+        resolve({code: 200, data: mock})
+    })
     // EnrollRule 需要返回文化+职业,但职业EnrollRule.details = []不需要返回字段规则
     const {universityId, majorId} = um
     return flyio.post('/voluntary/getSkillRules', {universityId, majorId}) as Promise<ApiResponse<EnrollRule[]>>
 }
 
 export function postRenderRules(target: SelectedUniversityMajor, model: Record<string, any>) {
+    return new Promise(async (resolve, reject) => {
+        await sleep(300)
+        const mock: Partial<VoluntaryResult> = {
+            ...target,
+            "enumPickType": "Danger",
+            "enrollRate": 66,
+            "enrollRateText": '风险极高',
+            "histories": [{
+                "year": '2025',
+                "score": null, // 最低分
+                "plan": 5, // 计划人数
+                "enroll": 5, // 录取人数
+                "diff": -12, // 负表示低于录取分;正数表示高于录取分
+                "ruleContent": '完整的说明', // 招录规则
+                "application": 3.3, // 报名人数比值
+                "admission": 1 // 计划人数比值
+            }, {
+                "year": '2024',
+                "score": null, // 最低分
+                "plan": 5, // 计划人数
+                "enroll": 5, // 录取人数
+                "diff": -12, // 负表示低于录取分;正数表示高于录取分
+                "ruleContent": '完整的说明', // 招录规则
+                "application": 3.3, // 报名人数比值
+                "admission": 1 // 计划人数比值
+            }, {
+                "year": '2023',
+                "score": null, // 最低分
+                "plan": 5, // 计划人数
+                "enroll": 5, // 录取人数
+                "diff": -12, // 负表示低于录取分;正数表示高于录取分
+                "ruleContent": '完整的说明', // 招录规则
+                "application": 3.3, // 报名人数比值
+                "admission": 1 // 计划人数比值
+            }],
+            "skill": {
+                year: '2025',
+                cultureScore: 233,
+                cultureRule: '语数物300分',
+                enrollScore: 496,
+                skillScore: 263, // 反向测技能分
+                diff: -44 // 负数表示低于skillScore,正数高于
+            }
+        }
+        resolve({code: 200, data: mock})
+    })
     const {universityId, majorId} = target
     return flyio.post('/voluntary/postRenderRules', {
         target: {universityId, majorId},
@@ -23,6 +164,24 @@ export function postRenderRules(target: SelectedUniversityMajor, model: Record<s
 }
 
 export function postSkillRules(target: SelectedUniversityMajor, model: Record<string, any>) {
+    return new Promise(async (resolve, reject) => {
+        await sleep(300)
+        const mock: Partial<VoluntaryResult> = {
+            ...target,
+            "enumPickType": "Danger",
+            "enrollRate": 66,
+            "enrollRateText": '风险极高',
+            "skill": {
+                year: '2025',
+                cultureScore: 233,
+                cultureRule: '语数物300分',
+                enrollScore: 496,
+                skillScore: 263, // 反向测技能分
+                diff: -44 // 负数表示低于skillScore,正数高于
+            }
+        }
+        resolve({code: 200, data: mock})
+    })
     // VoluntaryResult.histories 不需要返回
     const {universityId, majorId} = target
     return flyio.post('/voluntary/postSkillRules', {
@@ -32,6 +191,74 @@ export function postSkillRules(target: SelectedUniversityMajor, model: Record<st
 }
 
 export function getVoluntaryList() {
+    return new Promise(async (resolve, reject) => {
+        await sleep(300)
+        const mock: VoluntaryRecord[] = [{
+            id: 1,
+            universityLogo: "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/e6027a8c35f7426592f161c47f336fe7.jpg",
+            universityId: '1',
+            universityName: "长沙民政职业技术学院",
+            majors: [{
+                majorId: "1",
+                majorName: "随便起名1",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }, {
+                majorId: "2",
+                majorName: "随便起名2",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }, {
+                majorId: "3",
+                majorName: "随便起名3",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }]
+        }, {
+            id: 2,
+            universityLogo: "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/ed33a51d6ffa43ff89d93337f4a4369e.jpg",
+            universityId: '2',
+            universityName: "湖南信息职业技术学院",
+            majors: [{
+                majorId: "1",
+                majorName: "随便起名1",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }, {
+                majorId: "2",
+                majorName: "随便起名2",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }, {
+                majorId: "3",
+                majorName: "随便起名3",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }]
+        }, {
+            id: 3,
+            universityLogo: "https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/ie/universityLog/83386e105f03474b91d7c1824e81fa0c.jpg",
+            universityId: '3',
+            universityName: "湖南工业职业技术学院",
+            majors: [{
+                majorId: "1",
+                majorName: "随便起名1",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }, {
+                majorId: "2",
+                majorName: "随便起名2",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }, {
+                majorId: "3",
+                majorName: "随便起名3",
+                majorAncestors: "",
+                majorGroup: "专业组一"
+            }]
+        }]
+        resolve({code: 200, data: mock})
+    })
     // 此接口不分页,全部返回
     return flyio.get('/voluntary/getVoluntaryList') as Promise<ApiResponse<VoluntaryRecord[]>>
 }

+ 1 - 1
src/pagesOther/pages/voluntary/index/components/voluntary-form-major.vue

@@ -7,7 +7,7 @@
                 <view class="mt-8 w-fit text-20 text-primary border border-solid border-primary rounded-4 px-10 py-4">
                     {{ target.majorName }}
                 </view>
-                <view class="mt-8 w-fit text-20 text-info border border-solid border-info rounded-4 px-10 py-4">
+                <view v-if="target.majorGroup" class="mt-8 w-fit text-20 text-info border border-solid border-info rounded-4 px-10 py-4">
                     {{ target.majorGroup }}
                 </view>
             </view>

+ 7 - 14
src/pagesOther/pages/voluntary/result/components/plus/voluntary-result-progress.vue

@@ -1,29 +1,22 @@
 <template>
     <view class="w-full flex justify-between items-center gap-20">
-        <view class="text-28 text-fore-title shrink-0" :style="{width: labelWidth}">{{ label }}</view>
+        <view class="text-28 text-fore-title shrink-0" :style="{width: data.labelWidth}">{{ data.label }}</view>
         <div class="w-full h-24 rounded-full bg-gray-200 overflow-hidden">
             <div class="h-full rounded-full bg-blue-300" :style="{width: progress+'%'}" />
         </div>
-        <view class="text-30 text-fore-title text-right shrink-0" :style="{width: scoreWidth}">
-            <text>{{ score }}</text>
-            <text class="text-24 text-fore-placeholder">/{{ total }}</text>
+        <view class="text-30 text-fore-title text-right shrink-0" :style="{width: data.scoreWidth}">
+            <text>{{ data.score }}</text>
+            <text class="text-24 text-fore-placeholder">/{{ data.total }}</text>
         </view>
     </view>
 </template>
 
-<script setup lang="ts" name="VoluntaryResultProgress">
-
+<script setup lang="ts">
 import {VoluntaryScoreItem} from "@/types/voluntary";
 
-const props = withDefaults(defineProps<VoluntaryScoreItem>(), {
-    label: '',
-    score: 0,
-    total: 0,
-    labelWidth: '',
-    scoreWidth: ''
-})
+const props = defineProps<{ data: VoluntaryScoreItem }>()
 
-const progress = computed(() => props.total && props.score ? props.score * 100 / props.total : 0)
+const progress = computed(() => props.data.total && props.data.score ? props.data.score * 100 / props.data.total : 0)
 </script>
 
 <style scoped>

+ 3 - 5
src/pagesOther/pages/voluntary/result/components/voluntary-result-analysis.vue

@@ -7,19 +7,18 @@
         <voluntary-result-card tag="评估">
             <view class="flex-1 text-23 leading-38 text-fore-title">
                 根据历年数据对比分析,预估目前成绩报考该院校/专业,录取风险属于
-                <text :class="rateClass">{{result.enrollRateText}}</text>
+                <text :class="rateClass">{{ result.enrollRateText }}</text>
             </view>
         </voluntary-result-card>
     </view>
 </template>
 
-<script setup lang="ts" name="VoluntaryResultAnalysis">
+<script setup lang="ts">
 import VoluntaryResultTitle from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-title.vue";
 import IeEchart from "@/pagesOther/components/ie-echart/ie-echart.vue";
 import VoluntaryResultCard from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-card.vue";
 import {VOLUNTARY_RESULT} from "@/types/injectionSymbols";
 import {VoluntaryResult} from "@/types/voluntary";
-import {sleep} from "@/uni_modules/uv-ui-tools/libs/function";
 
 const option = ref({})
 const result = inject(VOLUNTARY_RESULT) || ref({} as VoluntaryResult)
@@ -208,8 +207,7 @@ const drawRing = (rate: number | null) => {
 
 
 onMounted(async () => {
-    await sleep(200)
-    drawRing(result.value.enrollRate)
+    setTimeout(() => drawRing(result.value.enrollRate), 200)
 })
 </script>
 

+ 1 - 1
src/pagesOther/pages/voluntary/result/components/voluntary-result-history.vue

@@ -22,11 +22,11 @@
 </template>
 
 <script setup lang="ts" name="VoluntaryResultHistory">
+import _ from "lodash";
 import VoluntaryResultTitle from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-title.vue";
 import {VOLUNTARY_RESULT} from "@/types/injectionSymbols";
 import {VoluntaryResult, VoluntaryResultHistory} from "@/types/voluntary";
 import VoluntaryResultCard from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-card.vue";
-import _ from "lodash";
 import VoluntaryResultTag from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-tag.vue";
 
 const result = inject(VOLUNTARY_RESULT) || ref({} as VoluntaryResult)

+ 2 - 2
src/pagesOther/pages/voluntary/result/components/voluntary-result-score.vue

@@ -2,7 +2,7 @@
     <view class="p-28 bg-white rounded-xl">
         <voluntary-result-title title="学生分数"/>
         <view class="p-28 gap-28 flex flex-col">
-            <voluntary-result-progress v-for="i in progressList" :key="i.label" v-bind="i"/>
+            <voluntary-result-progress v-for="i in progressList" :key="i.label" :data="i"/>
         </view>
         <voluntary-result-card tag="分析">
             <view class="flex-1 text-23 leading-38 text-fore-title">
@@ -20,7 +20,7 @@
     </view>
 </template>
 
-<script setup lang="ts" name="VoluntaryResultScore">
+<script setup lang="ts">
 import VoluntaryResultTitle from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-title.vue";
 import VoluntaryResultProgress from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-progress.vue";
 import VoluntaryResultCard from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-card.vue";

+ 11 - 5
src/pagesOther/pages/voluntary/result/result.vue

@@ -2,15 +2,16 @@
     <ie-page bg-color="#F6F8FA">
         <ie-navbar title="院校概率分析" transparent bg-color="#FFFFFF" title-color="black" keep-title-color/>
         <!-- #ifdef MP-WEIXIN -->
-        <view class="h-90" style="background: linear-gradient(to Right, rgba(100, 200, 255, 1), rgba(165, 229, 255, 0.87))"/>
+        <view class="h-90"
+              style="background: linear-gradient(to Right, rgba(100, 200, 255, 1), rgba(165, 229, 255, 0.87))"/>
         <!-- #endif -->
         <ie-image is-oss src="/volunteer/voluntary/result/banner.png" custom-class="w-full h-483"/>
         <view class="px-30 flex flex-col gap-20 -mt-180 z-1">
             <voluntary-form-major custom-class="bg-white mt-0"/>
-            <voluntary-result-analysis />
-            <voluntary-result-score />
+            <voluntary-result-analysis/>
+            <voluntary-result-score/>
             <voluntary-result-history/>
-            <voluntary-result-compare/>
+            <voluntary-result-compare v-if="showCompare"/>
             <voluntary-result-skill/>
             <voluntary-result-disclaimer/>
         </view>
@@ -34,13 +35,17 @@ import VoluntaryResultHistory from "@/pagesOther/pages/voluntary/result/componen
 import VoluntaryResultCompare from "@/pagesOther/pages/voluntary/result/components/voluntary-result-compare.vue";
 import VoluntaryResultSkill from "@/pagesOther/pages/voluntary/result/components/voluntary-result-skill.vue";
 import VoluntaryResultDisclaimer from "@/pagesOther/pages/voluntary/result/components/voluntary-result-disclaimer.vue";
+import {useUserStore} from "@/store/userStore";
 
+const userStore = useUserStore()
 const {prevData} = useTransferPage<VoluntaryDto, any>()
 const target = computed(() => prevData.value.target || {})
 const rules = computed(() => prevData.value.rules || {})
 const model = computed(() => prevData.value.model || {})
 const result = computed(() => prevData.value.result || {})
 
+const showCompare = computed(() => userStore.getLocation == '湖南')
+
 const handleSubmit = async () => {
 
 }
@@ -50,7 +55,8 @@ provide(VOLUNTARY_RULES, rules)
 provide(VOLUNTARY_MODEL, model)
 provide(VOLUNTARY_RESULT, result)
 // 为了让子组件触发页面滚动
-onPageScroll(() => { })
+onPageScroll(() => {
+})
 </script>
 
 <style lang="scss">

+ 2 - 2
src/types/voluntary.ts

@@ -37,7 +37,7 @@ export interface VoluntaryModel extends Record<string, string | number | null> {
 
 export interface VoluntaryResultHistory {
     "year": string | number;
-    "score": string | number; // 最低分
+    "score": string | number | null; // 最低分
     "plan"?: number | null; // 计划人数
     "enroll"?: number | null; // 录取人数
     "diff"?: number | null; // 负表示低于录取分;正数表示高于录取分
@@ -66,7 +66,7 @@ export interface VoluntaryResult {
     "enrollRate": number | null;
     "enrollRateText": string;
     "tips": string | null;
-    "histories": VoluntaryResultHistory[],
+    "histories"?: VoluntaryResultHistory[],
     "skill": VoluntaryResultSkill
 }