|
@@ -1,16 +1,16 @@
|
|
|
<template>
|
|
|
- <div class="d-flex" :style="{ 'z-index': isFloat ? 9999: '' }" :class="isFloat ? 'floatCard' : 'labelCard'" @mouseleave="handleMouseLeave">
|
|
|
+ <div class="d-flex" :style="{ 'z-index': isPage ? '' : 999 }" :class="isPage ? 'hasPageCard' : 'floatCard'" @mouseleave="handleMouseLeave">
|
|
|
<v-card class="card">
|
|
|
<div class="leftCard">
|
|
|
<div
|
|
|
- class="leftCardItem" :class="{'leftIndexAct': index === leftIndex, 'elevation-5': (index === leftIndex && !isFloat)}"
|
|
|
+ class="leftCardItem" :class="{'leftIndexAct': index === leftIndex, 'elevation-5': (index === leftIndex && isPage)}"
|
|
|
v-for="(item, index) in items" :key="item.id"
|
|
|
@mouseover="handleMouseOver(item, index)"
|
|
|
>
|
|
|
<div class="rowItem d-flex">
|
|
|
<span class="categoryName">{{ item.nameCn }}</span>
|
|
|
<div class="jobItemsBox">
|
|
|
- <div class="outerCovering" v-if="!isFloat && item.children?.length && item.children[0].children.length">
|
|
|
+ <div class="outerCovering" v-if="isPage && item.children?.length && item.children[0].children.length">
|
|
|
<div class="jobItems" v-for="val in item.children[0].children" :key="val.id" @click="handleJobClick(val)">{{ val.nameCn }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -19,7 +19,7 @@
|
|
|
</div>
|
|
|
<!-- <v-divider vertical></v-divider> -->
|
|
|
<!-- 分页 -->
|
|
|
- <div v-if="!float" class="mt-2" @mouseover.stop="handleMouseLeave" style="border-top: 1px dashed #e6e6e6; position: absolute; bottom: 4px; width: 100%;">
|
|
|
+ <div v-if="isPage" class="mt-2" @mouseover.stop="handleMouseLeave" style="border-top: 1px dashed #e6e6e6; position: absolute; bottom: 4px; width: 100%;">
|
|
|
<div class="d-flex justify-space-between align-center mx-4" style="height: 40px">
|
|
|
<div style="color: var(--v-primary-base); font-size: 14px;">
|
|
|
{{ pageInfo.current }} / {{ pageCount }}
|
|
@@ -47,7 +47,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</v-card>
|
|
|
- <v-card height="392px" v-if="!isFloat && !rightObj.show" class="card rightCardBox ml-1">
|
|
|
+ <v-card height="392px" v-if="isPage && !rightObj.show" class="card rightCardBox ml-1">
|
|
|
<v-carousel show-arrows="hover" cycle>
|
|
|
<v-carousel-item v-for="(item, i) in carouselList" :key="i">
|
|
|
<div style="height: 392px; overflow: hidden;">
|
|
@@ -61,17 +61,19 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { getPositionTreeClick } from '@/api/common/index'
|
|
|
-import { reactive, ref, inject } from 'vue';
|
|
|
+import { getDict } from '@/hooks/web/useDictionaries'
|
|
|
|
|
|
-defineOptions({ name:'personal-jobTypeCard'})
|
|
|
+import { reactive, ref } from 'vue';
|
|
|
+
|
|
|
+defineOptions({ name:'common-components-jobTypeCard'})
|
|
|
|
|
|
const props = defineProps({
|
|
|
- float: { // 搜索浮动
|
|
|
+ page: { // 是否分页
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
})
|
|
|
-const isFloat = props.float
|
|
|
+const isPage = props.page
|
|
|
|
|
|
// 翻页数据
|
|
|
const pageInfo = reactive({ current: 1, size: 8 })
|
|
@@ -85,16 +87,21 @@ const getPageItems = () => {
|
|
|
const endIndex = Math.min(startIndex + pageInfo.size, defaultItems.value.length)
|
|
|
items.value = defaultItems.value.slice(startIndex, endIndex)
|
|
|
}
|
|
|
+getDict('positionTreeData', null, 'positionTreeData').then(({ data }) => {
|
|
|
+ data = data?.length && data || []
|
|
|
+ if (isPage) {
|
|
|
+ // 翻页数据
|
|
|
+ defaultItems.value = data
|
|
|
+ if (defaultItems.value?.length) {
|
|
|
+ pageCount.value = Math.ceil(defaultItems.value.length / pageInfo.size)
|
|
|
+ getPageItems()
|
|
|
+ } else pageInfo.current = 0
|
|
|
+ } else {
|
|
|
+ items.value = data
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
|
|
|
-if (isFloat) items.value = JSON.parse(inject('industryTreeData').value)
|
|
|
-else {
|
|
|
- // 翻页数据
|
|
|
- defaultItems.value = JSON.parse(inject('industryTreeData').value)
|
|
|
- if (defaultItems.value?.length) {
|
|
|
- pageCount.value = Math.ceil(defaultItems.value.length / pageInfo.size)
|
|
|
- getPageItems()
|
|
|
- } else pageInfo.current = 0
|
|
|
-}
|
|
|
// 翻页数据
|
|
|
const previous = () => { if (pageInfo.current > 1) pageInfo.current--; getPageItems() }
|
|
|
const nextPage = () => { if (pageInfo.current < pageCount.value) pageInfo.current++; getPageItems() }
|
|
@@ -114,8 +121,8 @@ const handleMouseLeave = () => { // 鼠标移出
|
|
|
}
|
|
|
// 轮播图片
|
|
|
const carouselList = ref([
|
|
|
- { src: 'https://img0.baidu.com/it/u=3769341087,3426515789&fm=253&fmt=auto&app=138&f=JPEG?w=1180&h=472', },
|
|
|
{ src: 'https://img.kinpan.com/Files/design/detailimages/20161228/6361853956839262507798973.jpg', },
|
|
|
+ { src: 'https://img0.baidu.com/it/u=3769341087,3426515789&fm=253&fmt=auto&app=138&f=JPEG?w=1180&h=472', },
|
|
|
])
|
|
|
|
|
|
// 职位点击事件
|
|
@@ -177,7 +184,7 @@ const handleJobClick = async (val) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.labelCard {
|
|
|
+.hasPageCard {
|
|
|
width: 100%;
|
|
|
.card { border-radius: 12px; }
|
|
|
.leftIndexAct {
|