|
@@ -1,12 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<slot name="header"></slot>
|
|
<slot name="header"></slot>
|
|
<view class="content">
|
|
<view class="content">
|
|
- <view v-for="(item,index) in items" :key="item.title" class="content-box">
|
|
|
|
|
|
+ <view v-for="(item,index) in items" :key="item.label" class="content-box">
|
|
<view class="content-box-value">
|
|
<view class="content-box-value">
|
|
- {{ item.value }}
|
|
|
|
|
|
+ {{ item.count }}
|
|
</view>
|
|
</view>
|
|
<view class="content-box-title">
|
|
<view class="content-box-title">
|
|
- {{ item.title }}
|
|
|
|
|
|
+ {{ item.label }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -14,31 +14,40 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { reactive } from 'vue';
|
|
|
|
|
|
+import { ref } from 'vue';
|
|
import { getRecommendCount } from '@/api/position.js'
|
|
import { getRecommendCount } from '@/api/position.js'
|
|
-const items = reactive([
|
|
|
|
- {
|
|
|
|
- value: 0,
|
|
|
|
- title: '已推荐',
|
|
|
|
- key: '0'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: 0,
|
|
|
|
- title: '已入职',
|
|
|
|
- key: '1'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: 0,
|
|
|
|
- title: '已结算',
|
|
|
|
- key: '2'
|
|
|
|
|
|
+import { getDict } from '@/hooks/useDictionaries.js'
|
|
|
|
+const props = defineProps({
|
|
|
|
+ type: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: 'menduner_hire_job_cv_status'
|
|
}
|
|
}
|
|
-])
|
|
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const items = ref([])
|
|
|
|
+
|
|
|
|
+// 获取状态
|
|
|
|
|
|
async function recommendCount () {
|
|
async function recommendCount () {
|
|
- const { data } = await getRecommendCount()
|
|
|
|
- items.forEach(e => {
|
|
|
|
- e.value = data.find(e => e.key === e.key)?.value || 0
|
|
|
|
- })
|
|
|
|
|
|
+ try {
|
|
|
|
+ const { data: dict } = await getDict(props.type)
|
|
|
|
+ items.value = dict.data.map(e => {
|
|
|
|
+ return {
|
|
|
|
+ ...e,
|
|
|
|
+ count: 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ console.log(items)
|
|
|
|
+ const { data } = await getRecommendCount()
|
|
|
|
+ if (!data) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ items.value.forEach(e => {
|
|
|
|
+ e.count = data.find(_e => _e.key === e.value)?.value || 0
|
|
|
|
+ })
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
recommendCount()
|
|
recommendCount()
|
|
</script>
|
|
</script>
|