|
@@ -1,7 +1,54 @@
|
|
|
<template>
|
|
|
<div style="width: 100%;">
|
|
|
- <CtForm ref="formPageRef" :items="items" style="width: 600px;"></CtForm>
|
|
|
+ <CtForm ref="formPageRef" :items="items" style="width: 600px;">
|
|
|
+ <template #tagList>
|
|
|
+ <div>
|
|
|
+ <span style="color: #797474;">职位关键字:</span>
|
|
|
+ <v-chip class="cursor-pointer mr-2 mb-3" color="primary" variant="outlined" @click="show = true; select = tag">
|
|
|
+ <v-icon>mdi-plus</v-icon>
|
|
|
+ </v-chip>
|
|
|
+ <v-chip v-for="(val, index) in tag" :key="index" class="mr-2 mb-3" color="primary">
|
|
|
+ {{ val }}
|
|
|
+ </v-chip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </CtForm>
|
|
|
</div>
|
|
|
+
|
|
|
+ <CtDialog :visible="show" :widthType="3" titleClass="text-h6" title="职位关键字选择" :footer="true" @close="show = false" @submit="handleSubmit">
|
|
|
+ <div>已选中关键字:</div>
|
|
|
+ <div v-if="select.length">
|
|
|
+ <v-chip
|
|
|
+ v-for="(item, index) in select" :key="index"
|
|
|
+ class="chip mr-2 mt-4"
|
|
|
+ label color="#ea8d03"
|
|
|
+ >
|
|
|
+ {{ item }}
|
|
|
+ <v-icon size="18" color="#ea8d03" style="margin-left: 6px;" @click="handleCancelSelect(item)">mdi-close-circle</v-icon>
|
|
|
+ </v-chip>
|
|
|
+ </div>
|
|
|
+ <v-divider class="my-5"></v-divider>
|
|
|
+ <div v-for="val in tagList" :key="val.id" class="mb-8">
|
|
|
+ <span style="font-size: 16px;">{{ val?.nameCn || '--' }}</span>
|
|
|
+ <div v-if="val?.children?.length">
|
|
|
+ <v-chip
|
|
|
+ v-for="k in val.children"
|
|
|
+ :key="k.id"
|
|
|
+ class="mx-2 mt-4 cursor-pointer"
|
|
|
+ :text="k.nameCn"
|
|
|
+ variant="outlined"
|
|
|
+ color="primary"
|
|
|
+ :value="k.id"
|
|
|
+ label
|
|
|
+ :disabled="select.includes(k.nameCn)"
|
|
|
+ @click="handleSelect(k.nameCn)"
|
|
|
+ >
|
|
|
+ <v-icon icon="mdi-plus" start></v-icon>
|
|
|
+ {{ k?.nameCn || '--' }}
|
|
|
+ </v-chip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </CtDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -10,6 +57,7 @@ import CtForm from '@/components/CtForm'
|
|
|
import { reactive, ref, watch } from 'vue'
|
|
|
import { getDict } from '@/hooks/web/useDictionaries'
|
|
|
import { cityToProvince } from '@/utils/areaDeal'
|
|
|
+import { getTagTreeDataApi } from '@/api/enterprise'
|
|
|
|
|
|
const props = defineProps({
|
|
|
itemData: Object
|
|
@@ -141,10 +189,21 @@ const items = ref({
|
|
|
label: '详情地址 *',
|
|
|
rules: [v => !!v || '请填写详细地址'],
|
|
|
},
|
|
|
+ {
|
|
|
+ slotName: 'tagList',
|
|
|
+ key: 'tagList',
|
|
|
+ value: []
|
|
|
+ }
|
|
|
]
|
|
|
})
|
|
|
|
|
|
-// items.value.options.forEach(e => e.rules = []) // 测试使用
|
|
|
+// 招聘职位标签
|
|
|
+const tagList = ref([])
|
|
|
+const getTagList = async () => {
|
|
|
+ const data = await getTagTreeDataApi({ type: 2 })
|
|
|
+ tagList.value = data
|
|
|
+}
|
|
|
+getTagList()
|
|
|
|
|
|
// 获取字典内容
|
|
|
const getDictData = async () => {
|
|
@@ -183,7 +242,10 @@ const getQuery = async () => {
|
|
|
const obj = {}
|
|
|
items.value.options.forEach(e => {
|
|
|
if (e.noParam) return
|
|
|
- obj[e.key] = e.value
|
|
|
+ if (e.key === 'tagList') {
|
|
|
+ obj[e.key] = tag.value.length ? tag.value : []
|
|
|
+ }
|
|
|
+ else obj[e.key] = e.value
|
|
|
})
|
|
|
query = Object.assign(query, obj)
|
|
|
return query
|
|
@@ -206,6 +268,9 @@ watch(
|
|
|
if (e.noParam) return
|
|
|
e.value = val[e.key]
|
|
|
if (e.key === 'areaId' && val[e.key]) workAreaId = val[e.key]
|
|
|
+ if (e.key === 'tagList' && val[e.key] && val[e.key].length) {
|
|
|
+ tag.value = val[e.key] && val[e.key].length ? val[e.key] : []
|
|
|
+ }
|
|
|
})
|
|
|
if (workAreaId) { // 省份回显
|
|
|
const province = items.value.options.find(pv => pv.key === 'workAreaProvinceId')
|
|
@@ -221,6 +286,29 @@ watch(
|
|
|
{ deep: true }
|
|
|
)
|
|
|
|
|
|
+
|
|
|
+// 标签选择
|
|
|
+const show = ref(false)
|
|
|
+const select = ref([])
|
|
|
+const tag = ref([])
|
|
|
+
|
|
|
+// 选择
|
|
|
+const handleSelect = (nameCn) => {
|
|
|
+ const result = select.value.includes(nameCn)
|
|
|
+ if (!result) return select.value.push(nameCn)
|
|
|
+ else select.value = select.value.filter(e => e !== nameCn)
|
|
|
+}
|
|
|
+
|
|
|
+const handleSubmit = () => {
|
|
|
+ tag.value = select.value
|
|
|
+ show.value = false
|
|
|
+}
|
|
|
+
|
|
|
+// 取消选中
|
|
|
+const handleCancelSelect = (nameCn) => {
|
|
|
+ select.value = select.value.filter(e => e !== nameCn)
|
|
|
+}
|
|
|
+
|
|
|
defineExpose({
|
|
|
formPageRef,
|
|
|
getQuery
|