Ver código fonte

优化:福利标签的推荐标签改为接口调用

lifanagju_citu 9 meses atrás
pai
commit
31dfaa281e

+ 8 - 0
src/api/enterprise.js

@@ -146,4 +146,12 @@ export const updateEnterpriseWelfare = async (data) => {
     url: '/app-admin-api/menduner/system/enterprise/welfare/update',
     data
   })
+}
+
+// 根据类型获取标签信息
+export const getTagDataApi = async (params) => {
+  return await request.get({
+    url: '/admin-api/menduner/system/tag/get/by/type',
+    params
+  })
 }

+ 1 - 0
src/locales/en.js

@@ -175,6 +175,7 @@ export default {
       enterpriseLogo: 'Enterprise LOGO',
       enterpriseAlbum: 'Enterprise Album',
       welfareLabel: 'Welfare Label',
+      enterpriseLabel: 'Enterprise Label',
       businessInformation: 'Business Information',
       enterpriseVideo: 'Enterprise Video',
       recruitmentQRCode: 'Recruitment QR Code',

+ 1 - 0
src/locales/zh-CN.js

@@ -175,6 +175,7 @@ export default {
       enterpriseLogo: '企业LOGO',
       enterpriseAlbum: '企业相册',
       welfareLabel: '福利标签',
+      enterpriseLabel: '企业标签',
       businessInformation: '工商信息',
       enterpriseVideo: '企业视频',
       recruitmentQRCode: '招聘二维码'

+ 25 - 29
src/views/recruit/enterprise/informationManagement/informationSettingsComponents/welfareLabel.vue

@@ -21,18 +21,20 @@
       </div>
     </div>
   </div>
-  <span style="font-size: 16px;">推荐标签</span>
-  <div>
-    <v-chip
-      v-for="(item, index) in chipList" :key="index"
-      class="chip mx-2 mt-4"
-      label color="primary"
-      :disabled="chosen.includes(item)"
-      @click="choseClick(item)"
-    >
-      <v-icon icon="mdi-plus" start></v-icon>
-      {{ item }}
-    </v-chip>
+  <div v-for="(val, index) in chipList" :key="'welfareLabel' + index" class="mb-8">
+    <span style="font-size: 16px;">{{ val?.nameCn || '--' }}</span>
+    <div v-if="val?.children?.length">
+      <v-chip
+        v-for="(item, index) in val.children" :key="index"
+        class="chip mx-2 mt-4"
+        label color="primary"
+        :disabled="chosen.includes(item?.nameCn )"
+        @click="choseClick(item?.nameCn )"
+      >
+        <v-icon icon="mdi-plus" start></v-icon>
+        {{ item?.nameCn || '--' }}
+      </v-chip>
+    </div>
   </div>
 </template>
 
@@ -41,7 +43,7 @@ import TextUI from '@/components/FormUI/TextInput'
 import Snackbar from '@/plugins/snackbar'
 import Confirm from '@/plugins/confirm'
 import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
-import { getEnterpriseBaseInfo, updateEnterpriseWelfare } from '@/api/enterprise'
+import { getEnterpriseBaseInfo, updateEnterpriseWelfare, getTagDataApi } from '@/api/enterprise'
 import { ref } from 'vue';
 defineOptions({name: 'informationSettingsComponents-welfareLabel'})
 const customTag = ref(false)
@@ -79,6 +81,16 @@ const handleSave = async (type) => {
     getData()
   }, 5000)
 }
+
+// 推荐标签
+const chipList = ref([])
+// 根据类型获取标签信息
+const getTagData = async () => { // type: 标签类型-> 0人员画像标签 1职位标签 2招聘职位标签 3企业福利标签 4企业标签 
+  const data = await getTagDataApi({ type: 3 })
+  chipList.value = data || []
+}
+getTagData()
+
 // 获取数据
 const getData = async () => {
   const data = await getEnterpriseBaseInfo()
@@ -96,22 +108,6 @@ const textItem = ref({
   appendInnerIcon: 'mdi-checkbox-marked-circle',
   appendInnerClick: appendInnerClick,
 })
-// 推荐标签
-const chipList = [
-  '五险一金',
-  '交通补助',
-  '节日礼物',
-  '技能培训',
-  '午餐补贴',
-  '话补补贴',
-  '带薪年假',
-  '住房补贴',
-  '岗位晋升',
-  '住房优惠',
-  '美女多',
-  '帅哥多',
-  '领导好'
-]
 </script>
 <style lang="scss" scoped>
 .chip {