Przeglądaj źródła

在招岗位接口

Xiao_123 1 rok temu
rodzic
commit
533475bb8e

+ 3 - 1
src/components/CtPagination/index.vue

@@ -6,6 +6,9 @@
       @update:modelValue="handleCurrentChange"
       v-bind="$attrs"
       :total-visible="props.totalVisible"
+      active-color="primary"
+      color="primary"
+      size="small"
     ></v-pagination>
     <span style="color: #666;">共{{ props.total }}条数据</span>
     <div class="search px-3">
@@ -15,7 +18,6 @@
         hide-details
         variant="outlined"
         density="compact"
-        height="35"
         label=""
         placeholder=""
         hide-spin-buttons

+ 0 - 107
src/components/CtVuetify/CtPagination/index.vue

@@ -1,107 +0,0 @@
-<template>
-  <div class="d-flex justify-center align-center pa-5">
-    <v-pagination
-      v-model="currentPage"
-      :length="pageLength"
-      @update:model-value="handleCurrentChange"
-      v-bind="$attrs"
-      :total-visible="props.totalVisible"
-      active-color="primary"
-      color="primary"
-      size="small"
-    ></v-pagination>
-    <span style="color: #666;">共{{ props.total }}条数据</span>
-    <div class="search px-3">
-      <v-text-field
-        v-model="currentJump"
-        type="number"
-        hide-details
-        variant="outlined"
-        density="compact"
-        label=""
-        placeholder=""
-        hide-spin-buttons
-      ></v-text-field>
-    </div>
-    <div>
-      <v-btn color="primary" rounded class="half-button" @click="handleCurrentJump">跳转</v-btn>
-    </div>
-  </div>
-</template>
-
-<script setup>
-defineOptions({ name: 'pagination-page' })
-import { ref, watch, computed } from 'vue'
-const emits = defineEmits(['handleChange'])
-
-const props = defineProps({
-  total: {
-    type: [String, Number],
-    default: 0
-  },
-  page: {
-    type: Number,
-    default: 1
-  },
-  limit: {
-    type: Number,
-    default: 10
-  },
-  pageSizes: {
-    type: Array,
-    default: () => [5, 10, 15, 20]
-  },
-  layout: {
-    type: String,
-    default: 'total, prev, pager, next, jumper'
-  },
-  autoScroll: {
-    type: Boolean,
-    default: true
-  },
-  hidden: {
-    type: Boolean,
-    default: false
-  },
-  totalVisible: {
-    type: Number,
-    default: 7
-  }
-})
-
-const currentPage = ref(1)
-const currentJump = ref(null)
-currentPage.value = props.page
-
-watch(() => props.page, (newVal) => {
-  currentPage.value = newVal
-}, { deep: true })
-
-
-const pageLength = computed(() => {
-  return Math.ceil(props.total / props.limit)
-})
-
-const handleCurrentChange = () => {
-  emits('handleChange', currentPage.value)
-}
-
-const handleCurrentJump = () => {
-  if (currentJump.value > pageLength.value) currentJump.value = pageLength.value
-  if (currentJump.value < 1) currentJump.value = 1
-  currentPage.value = +currentJump.value
-  emits('handleChange', currentPage.value)
-}
-</script>
-
-<style lang="scss" scoped>
-.search {
-  width: 80px;
-  height: 50px;
-  display: flex;
-  align-items: center;
-}
-// ::v-deep  .v-text-field--outlined.v-input--dense.v-text-field--outlined > .v-input__control > .v-input__slot {
-//   min-height: 35px;
-// }
-</style>

+ 50 - 50
src/components/Enterprise/components/positions.vue

@@ -7,8 +7,7 @@
           :class="['category-item', {'default-active': k.active}]" 
           v-for="k in positionCategory" 
           :key="k.id"
-          @mouseenter="k.active = true"
-          @mouseleave="k.active = false"
+          @click="handleClickCategory(k)"
         >{{ k.id === '-1' ? `${k.label}` : `${k.label} (${k.number})` }}</span>
       </div>
     </div>
@@ -37,21 +36,22 @@
       @click="handlePosition(val)"
     >
       <div>
-        <p :class="['name', {'default-active': val.active }]">{{ val.name }}</p>
+        <p :class="['name', {'default-active': val.active }]">{{ val.job.name }}</p>
         <div style="line-height: 40px;">
           <span v-for="k in desc" :key="k.mdi" class="mr-5">
             <v-icon color="#666" size="15">{{ k.mdi }}</v-icon>
-            <span class="ml-1 tag-text">{{ val[k.value] }}</span>
+            <span class="ml-1 tag-text">{{ val.job[k.value] }}</span>
           </span>
         </div>
       </div>
       <div v-if="!val.active" class="text-right">
-        <p class="salary">{{ val.payFrom }}-{{ val.payTo }}k/{{ val.payName }}</p>
-        <div class="update-time">{{ timesTampChange(val.updateTime) }} 刷新</div>
+        <p class="salary">{{ val.job.payFrom }}-{{ val.job.payTo }}/{{ val.job.payName }}</p>
+        <!-- <div class="update-time">{{ timesTampChange(val.updateTime) }} 刷新</div> -->
+        <div class="update-time">2024-05-21 18:09:31 刷新</div>
       </div>
       <div v-else class="account-info">
-        <v-avatar image="https://cdn.vuetifyjs.com/images/john.jpg"></v-avatar>
-        <span class="account-label">陈北方 · 人事经理</span>
+        <v-avatar :image="val.contact.avatar"></v-avatar>
+        <span class="account-label">{{ val.contact.name }} · {{ val.contact.postNameCn }}</span>
         <span>
           <v-btn class="half-button" color="primary" size="small">立即沟通</v-btn>
         </span>
@@ -69,10 +69,11 @@
 <script setup>
 defineOptions({ name: 'recruitment-positions'})
 import { ref } from 'vue'
-import { timesTampChange } from '@/utils/date'
+// import { timesTampChange } from '@/utils/date'
 import { getDict } from '@/hooks/web/useDictionaries'
-import { getJobAdvertisedPositionCount, getJobAreaByEnterpriseId } from '@/api/position'
-import MPagination from '@/components/CtVuetify/CtPagination'
+import { dealDictData } from '@/views/recruit/position/components/dict'
+import { getJobAdvertisedPositionCount, getJobAreaByEnterpriseId, getJobAdvertisedSearch } from '@/api/position'
+import MPagination from '@/components/CtPagination'
 import expType from '@/views/recruit/position/components/conditionFilter/expType.vue'
 import educationType from '@/views/recruit/position/components/conditionFilter/educationType.vue'
 import payScope from '@/views/recruit/position/components/conditionFilter/payScope.vue'
@@ -85,9 +86,9 @@ const props = defineProps({
   }
 })
 
-const total = ref(12)
+const total = ref(0)
 const pageInfo = ref({
-  size: 3,
+  size: 1,
   current: 1
 })
 
@@ -121,44 +122,40 @@ const getData = async () => {
 }
 getData()
 
-const list = ref([
-  {
-    name: '产品经理',
-    payFrom: 6,
-    payTo: 11,
-    payName: '月',
-    updateTime: 1716175909224,
-    areaName: '广州',
-    eduName: '本科',
-    expName: '1-3年',
-    active: false,
-    positionId: 4
-  },
-  {
-    name: '产品经理',
-    payFrom: 6,
-    payTo: 11,
-    payName: '月',
-    updateTime: 1716175909224,
-    areaName: '广州',
-    eduName: '本科',
-    expName: '1-3年',
-    active: false,
-    positionId: 4
-  },
-  {
-    name: '产品经理',
-    payFrom: 6,
-    payTo: 11,
-    payName: '月',
-    updateTime: 1716175909224,
-    areaName: '广州',
-    eduName: '本科',
-    expName: '1-3年',
-    active: false,
-    positionId: 4
+// 职位类别选中
+const handleClickCategory = (k) => {
+  positionCategory.value.map(e => e.active = false)
+  k.active = !k.active
+}
+
+// 职位列表
+const list = ref([])
+const getPositionList = async () => {
+  const pageReqVO = {
+    ...pageInfo,
+    // content: '',
+    // areaIds: [],
+    // expType: 0,
+    // eduType: 0,
+    // payType: 0,
+    // jobType: 0,
+    // positionId: 0,
+    // enterpriseType: 0,
+    // industryIds: [],
+    // scale: 0,
+    // financingStatus: 0,
+    enterpriseId: props.info.enterprise.id
   }
-])
+  const { list: arr, total: number } = await getJobAdvertisedSearch({ pageReqVO })
+  total.value = number
+  list.value = arr.map(e => {
+    e.job = { ...e.job, ...dealDictData({}, e.job) }
+    return e
+  })
+}
+getPositionList()
+
+// 城市、学历、工作经验
 const desc = [
   { mdi: 'mdi-map-marker-outline', value: 'areaName' },
   { mdi: 'mdi-school-outline', value: 'eduName' },
@@ -218,6 +215,9 @@ const desc = [
   color: #888;
   font-weight: 600;
   cursor: pointer;
+  &:hover {
+    color: var(--v-primary-base);
+  }
 }
 :deep(.v-field__input) {
   height: 28px;