Browse Source

holland list - init

abpcoder 1 month ago
parent
commit
4a3289b6e0

+ 1 - 0
components.d.ts

@@ -35,6 +35,7 @@ declare module 'vue' {
     IeTabIeTab: typeof import('./src/components/ie-tab/ie-tab.vue')['default']
     IeTableIeTable: typeof import('./src/components/ie-table/ie-table.vue')['default']
     IeTabsSwiperIeTabsSwiper: typeof import('./src/components/ie-tabs-swiper/ie-tabs-swiper.vue')['default']
+    IeTagButtonIeTagButton: typeof import('./src/components/ie-tag-button/ie-tag-button.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
   }

+ 58 - 0
src/api/modules/test-center.ts

@@ -0,0 +1,58 @@
+import flyio from "../flyio";
+import {ApiResponse, ApiResponseList} from "@/types";
+import {HollandEntity, HollandRecord} from "@/types/test-center";
+
+//  职业兴趣测评 01 测试步骤
+export function hollSteps(params: any) {
+    return flyio.get('/front/syzy/holland/steps', params)
+}
+
+//  职业兴趣测评 02 步骤题目
+export function hollStepsQuestions(params: any) {
+    return flyio.get('/front/syzy/holland/questions', params)
+}
+
+//  职业兴趣测评 03 保存测试
+export function hollSaveHolland(data: any) {
+    return flyio.post('/front/syzy/holland/save', data)
+}
+
+//  职业兴趣测评 04 测评记录
+export function hollRecord(params: any) {
+    return flyio.get('/front/syzy/holland/record', params) as Promise<ApiResponseList<HollandRecord>>
+}
+
+//  职业兴趣测评 05 测评详情
+export function hollDetail(params: any) {
+    return flyio.get('/front/syzy/holland/record/detail', params) as Promise<ApiResponse<HollandEntity>>
+}
+
+//  职业性格测评 01 测试步骤
+export function mbtiSteps(params: any) {
+    return flyio.get('/front/syzy/mbti/steps', params)
+}
+
+//  职业性格测评 02 步骤题目
+export function mbtiStepsQuestions(params: any) {
+    return flyio.get('/front/syzy/mbti/questions', params)
+}
+
+//  职业性格测评 03 保存测试
+export function mbtiSave(data: any) {
+    return flyio.post('/front/syzy/mbti/save', data)
+}
+
+//  职业性格测评 04 测评记录
+export function mbtiRecord(params: any) {
+    return flyio.get('/front/syzy/mbti/record', params)
+}
+
+//  职业性格测评 05 测评详情
+export function mbtiDetail(params: any) {
+    return flyio.get('/front/syzy/mbti/record/detail', params)
+}
+
+// 推荐专业
+export function mbtiRecommendMajors(params: any) {
+    return flyio.get('/front/syzy/mbti/majors', params)
+}

+ 12 - 0
src/common/routes.ts

@@ -120,6 +120,18 @@ export const routes = {
    * 试题收藏夹
    */
   pageQuestionFavorites: '/pagesStudy/pages/question-favorites/question-favorites',
+  /**
+   * 测评记录
+   */
+  testCenterList: '/pagesOther/pages/test-center/list/list',
+  /**
+   * holland报告
+   */
+  pageHolland: '/pagesOther/pages/test-center/holland/holland',
+  /**
+   * mbti报告
+   */
+  pageMbti: '/pagesOther/pages/test-center/mbti/mbti'
 
 } as const;
 

+ 24 - 0
src/components/ie-tag-button/ie-tag-button.vue

@@ -0,0 +1,24 @@
+<template>
+    <uv-tags v-bind="props" @click="$emit('click')"/>
+</template>
+
+<script setup lang="ts">
+import {tagsProps} from "@/uni_modules/uv-tags/components/uv-tags/uv-tags.vue";
+
+const props = defineProps({
+    ...tagsProps,
+    borderColor: {
+        type: String,
+        default: 'transparent'
+    },
+    plain: {
+        type: Boolean,
+        default: true
+    }
+})
+defineEmits(['click'])
+</script>
+
+<style scoped>
+
+</style>

+ 18 - 0
src/pages.json

@@ -146,6 +146,24 @@
           "style": {
             "navigationBarTitleText": ""
           }
+        },
+        {
+          "path": "pages/test-center/list/list",
+          "style": {
+            "navigationBarTitleText": ""
+          }
+        },
+        {
+          "path": "pages/test-center/holland/holland",
+          "style": {
+            "navigationBarTitleText": ""
+          }
+        },
+        {
+          "path": "pages/test-center/mbti/mbti",
+          "style": {
+            "navigationBarTitleText": ""
+          }
         }
       ]
     },

+ 1 - 1
src/pagesMain/pages/me/components/me-menu.vue

@@ -67,7 +67,7 @@ const menus = [
   {
     name: '测评报告',
     icon: '/static/personal/test_report.png',
-    pagePath: '/pagesOther/pages/test-center/list/list',
+    pagePath: routes.testCenterList,
   },
   {
     name: '我的收藏',

+ 17 - 0
src/pagesOther/pages/test-center/holland/holland.vue

@@ -0,0 +1,17 @@
+<template>
+    <view>
+
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {};
+    }
+}
+</script>
+
+<style lang="scss">
+
+</style>

+ 81 - 0
src/pagesOther/pages/test-center/list/components/holland-list-item.vue

@@ -0,0 +1,81 @@
+<template>
+    <view class="bg-white mx-card rounded-lg overflow-hidden">
+        <view class="p-24 flex justify-between items-center">
+            <view class="text-fore-title flex items-center gap-8">
+                <text>{{ typeName }}</text>
+                <text>-</text>
+                <text class="text-orange-400">{{ item.ruleCode }}</text>
+            </view>
+            <uv-text type="tips" prefix-icon="clock" :text="reportDate" class="!justify-end"/>
+        </view>
+        <view class="mx-20 grid grid-cols-3 text-sm ie-grid-border">
+            <view class="flex justify-center items-center gap-5 py-20">
+                <view class="text-fore-content">现实型(R)</view>
+                <view class="text-fore-title">{{ item.scorer }}</view>
+            </view>
+            <view class="flex justify-center items-center gap-5 py-20">
+                <view class="text-fore-content">艺术型(A)</view>
+                <view class="text-fore-title">{{ item.scorea }}</view>
+            </view>
+            <view class="flex justify-center items-center gap-5 py-20">
+                <view class="text-fore-content">研究型(I)</view>
+                <view class="text-fore-title">{{ item.scorei }}</view>
+            </view>
+            <view class="flex justify-center items-center gap-5 py-20">
+                <view class="text-fore-content">社会型(S)</view>
+                <view class="text-fore-title">{{ item.scores }}</view>
+            </view>
+            <view class="flex justify-center items-center gap-5 py-20">
+                <view class="text-fore-content">企业型(E)</view>
+                <view class="text-fore-title">{{ item.scoree }}</view>
+            </view>
+            <view class="flex justify-center items-center gap-5 py-20">
+                <view class="text-fore-content">传统型(C)</view>
+                <view class="text-fore-title">{{ item.scorec }}</view>
+            </view>
+        </view>
+        <view class="py-20 flex justify-center">
+            <ie-tag-button text="查看报告" icon="arrow-right" reverse @click="handleReport"/>
+        </view>
+    </view>
+</template>
+
+<script setup lang="ts">
+import {useTransferPage} from "@/hooks/useTransferPage";
+import {HollandRecord} from "@/types/test-center";
+import {routes} from "@/common/routes";
+
+const props = withDefaults(defineProps<{
+    item: HollandRecord
+}>(), {
+    item: () => ({} as HollandRecord)
+})
+
+const {transferTo} = useTransferPage()
+
+const map: Record<string, string> = {
+    R: '现实型',
+    A: '艺术型',
+    I: '研究型',
+    S: '社会型',
+    E: '企业型',
+    C: '传统型'
+}
+
+const typeName = computed(() => map[props.item.ruleCode ? props.item.ruleCode[0] : ''])
+const reportDate = computed(() => getDateStr(props.item.createTime))
+
+const getDateStr = (str: string) => {
+    return str.substring(0, 10)
+}
+
+const handleReport = () => {
+    transferTo(routes.pageHolland, {
+        data: {code: props.item.code}
+    })
+}
+</script>
+
+<style scoped>
+
+</style>

+ 26 - 0
src/pagesOther/pages/test-center/list/components/holland-list.vue

@@ -0,0 +1,26 @@
+<template>
+    <z-paging ref="paging" v-model="list" bg-color="#F6F8FA" @query="handleQuery">
+        <view class="p-30 fx-col gap-30">
+            <holland-list-item v-for="item in list" :item="item"/>
+        </view>
+    </z-paging>
+</template>
+
+<script setup lang="ts">
+import {hollRecord} from "@/api/modules/test-center";
+import {HollandRecord} from "@/types/test-center";
+import HollandListItem from "@/pagesOther/pages/test-center/list/components/holland-list-item.vue";
+
+const list = ref<HollandRecord[]>([])
+const paging = ref<ZPagingInstance>()
+
+const handleQuery = (pageNum: number, pageSize: number) => {
+    hollRecord({pageNum, pageSize})
+        .then(res => paging.value?.completeByTotal(res.rows, res.total))
+        .catch(e => paging.value?.complete(false))
+}
+</script>
+
+<style scoped>
+
+</style>

+ 84 - 0
src/pagesOther/pages/test-center/list/components/mbti-list-item.vue

@@ -0,0 +1,84 @@
+<template>
+    <view class="bg-white mx-card rounded-lg overflow-hidden">
+        <view class="p-30 fx-row fx-bet-cen">
+            <view class="text-main fx-row gap-8">
+                <text class="text-orange-400">{{ item.ruleCode }}</text>
+            </view>
+            <uv-text type="tips" prefix-icon="clock" :text="reportDate" class="!justify-end"/>
+        </view>
+        <view class="mx-20 grid grid-cols-4 text-sm mx-grid-border">
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">外向(E)</view>
+                <view class="text-main">{{ item.scoreE }}</view>
+            </view>
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">内向(I)</view>
+                <view class="text-main">{{ item.scoreI }}</view>
+            </view>
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">实感(S)</view>
+                <view class="text-main">{{ item.scoreS }}</view>
+            </view>
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">直觉(N)</view>
+                <view class="text-main">{{ item.scoreN }}</view>
+            </view>
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">思考(T)</view>
+                <view class="text-main">{{ item.scoreT }}</view>
+            </view>
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">情感(F)</view>
+                <view class="text-main">{{ item.scoreF }}</view>
+            </view>
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">判断(J)</view>
+                <view class="text-main">{{ item.scoreJ }}</view>
+            </view>
+            <view class="fx-row fx-cen-cen py-20">
+                <view class="text-content">认知(P)</view>
+                <view class="text-main">{{ item.scoreP }}</view>
+            </view>
+        </view>
+        <view class="py-20 fx-row justify-center">
+            <mx-tag-button text="查看报告" icon="arrow-right" reverse @click="handleReport"/>
+        </view>
+    </view>
+</template>
+
+<script setup>
+import _ from 'lodash'
+import {computed} from 'vue'
+import {createPropDefine} from "@/utils";
+import {useTransfer} from "@/hooks/useTransfer";
+
+const props = defineProps({
+    item: createPropDefine({}, Object)
+})
+
+const {transferTo} = useTransfer()
+
+const map = {
+    R: '现实型',
+    A: '艺术型',
+    I: '研究型',
+    S: '社会型',
+    E: '企业型',
+    C: '传统型'
+}
+
+const typeName = computed(() => map[_.first(props.item.ruleCode)] || '')
+const reportDate = computed(() => getDateStr(props.item.createTime))
+
+const getDateStr = (str) => {
+    return str.substring(0, 10)
+}
+
+const handleReport = () => {
+    transferTo('/pagesOther/pages/test-center/mbti/mbti', {code: props.item.code})
+}
+</script>
+
+<style scoped>
+
+</style>

+ 26 - 0
src/pagesOther/pages/test-center/list/components/mbti-list.vue

@@ -0,0 +1,26 @@
+<template>
+    <z-paging ref="paging" v-model="list" @query="handleQuery">
+        <view class="p-30 fx-col gap-30">
+            <mbti-list-item v-for="item in list" :item="item"/>
+        </view>
+    </z-paging>
+</template>
+
+<script setup>
+import {ref} from 'vue'
+import {mbtiRecord} from "@/api/webApi/career-course";
+import MbtiListItem from "@/pagesOther/pages/test-center/list/components/mbti-list-item.vue";
+
+const list = ref([])
+const paging = ref(null)
+
+const handleQuery = (pageNum, pageSize) => {
+    mbtiRecord({pageNum, pageSize})
+        .then(res => paging.value.completeByTotal(res.rows, res.total))
+        .catch(e => paging.value.complete(false))
+}
+</script>
+
+<style scoped>
+
+</style>

+ 45 - 0
src/pagesOther/pages/test-center/list/list.vue

@@ -0,0 +1,45 @@
+<template>
+    <ie-page fix-height :safe-area-inset-bottom="false">
+        <ie-navbar title="生涯测评结果"/>
+        <ie-auto-resizer>
+            <ie-tabs-swiper v-model="current" :list="tabs" :scrollable="false">
+                <template #holland>
+                    <holland-list />
+                </template>
+                <template #mbti>
+<!--                    <mbti-list/>-->
+                </template>
+            </ie-tabs-swiper>
+        </ie-auto-resizer>
+    </ie-page>
+</template>
+
+<script setup lang="ts">
+import _ from "lodash";
+import {SwiperTabItem} from "@/types";
+import {useTransferPage} from "@/hooks/useTransferPage";
+import HollandList from "@/pagesOther/pages/test-center/list/components/holland-list.vue";
+// import MbtiList from "@/pagesOther/pages/test-center/list/components/mbti-list.vue";
+
+const {prevData} = useTransferPage()
+const current = ref(0);
+const tabs = ref<SwiperTabItem[]>([
+    {
+        name: '专业兴趣(HOLLAND)',
+        slot: 'holland'
+    },
+    {
+        name: '职业性格(MBTI)',
+        slot: 'mbti'
+    }
+]);
+
+onMounted(() => {
+    const matchIdx = _.findIndex(tabs.value, t => t.slot == prevData.value.type)
+    current.value = matchIdx > -1 ? matchIdx : 0
+})
+</script>
+
+<style lang="scss">
+
+</style>

+ 17 - 0
src/pagesOther/pages/test-center/mbti/mbti.vue

@@ -0,0 +1,17 @@
+<template>
+    <view>
+
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {};
+    }
+}
+</script>
+
+<style lang="scss">
+
+</style>

+ 9 - 1
src/static/style/tailwind.scss

@@ -55,4 +55,12 @@
   }
 }
 
-@layer base {}
+@layer base {}
+
+.ie-grid-border {
+  @apply border-0 border-t border-l border-solid border-border;
+}
+
+.ie-grid-border > * {
+  @apply border-0 border-b border-r border-solid border-border;
+}

+ 3 - 2
src/types/index.ts

@@ -9,10 +9,11 @@ import * as Tree from "./tree";
 import * as Voluntary from "./voluntary";
 import * as Dropdown from "./dropdown";
 import * as University from "./university";
+import * as TestCenter from "./test-center";
 import { VipCardInfo } from "./user";
 import { EnumExamMode, EnumExamType, EnumReviewMode } from "@/common/enum";
 
-export { Study, User, News, Transfer, System, Major, Career, Tree, Voluntary, Dropdown, University };
+export { Study, User, News, Transfer, System, Major, Career, Tree, Voluntary, Dropdown, University, TestCenter };
 
 /// 接口响应
 export interface ApiResponse<T> {
@@ -142,7 +143,7 @@ export interface Entity {
   name: string;
   remark: string | null;
   createBy: string | null;
-  craeteTime: string | null;
+  createTime: string | null;
   updateBy: string | null;
   updateTime: string | null;
 }

+ 34 - 0
src/types/test-center.ts

@@ -0,0 +1,34 @@
+export interface HollandRecord {
+    "createBy": string | null;
+    "createTime": string;
+    "updateBy": string | null;
+    "updateTime": string | null;
+    "remark": string | null;
+    "id": number;
+    "customerCode": string;
+    "code": string;
+    "wants1": string | null;
+    "wants2": string | null;
+    "wants3": string | null;
+    "ruleCode": string;
+    "scorer": number;
+    "scorei": number;
+    "scorea": number;
+    "scores": number;
+    "scoree": number;
+    "scorec": number;
+    "status": number;
+}
+
+export interface HollandRule {
+
+}
+
+export interface HollandDetail {
+
+}
+
+export interface HollandEntity extends HollandRecord {
+    rule: HollandRule;
+    details: HollandDetail[];
+}