소스 검색

Merge branch 'jobFair' of https://git.citupro.com/zhengnaiwen_citu/menduner into jobFair

lifanagju_citu 1 개월 전
부모
커밋
1a39530977

+ 6 - 1
src/components/CtFilter/index.vue

@@ -21,6 +21,7 @@
 					<div class="pa-3">
 						<v-btn color="primary" class="elevation-5 half-button" @click="search">查 询</v-btn>
             <v-btn color="primary" variant="outlined" v-if="showResetBtn" class="elevation-5 half-button ml-3" @click="reset">重 置</v-btn>
+            <v-btn color="#008BB7" v-if="showRefreshBtn" prepend-icon="mdi-refresh" class="elevation-5 half-button ml-3" @click="emit('refresh')">刷 新</v-btn>
             <slot name="appendBtn"></slot>
           </div>
 				</template>
@@ -37,7 +38,7 @@ import { ref } from 'vue'
 import textUI from './../FormUI/TextInput'
 import autocompleteUI from './../FormUI/autocomplete'
 
-const emit = defineEmits(['search', 'reset'])
+const emit = defineEmits(['search', 'reset', 'refresh'])
 const props = defineProps({
   items: {
     type: Object,
@@ -50,6 +51,10 @@ const props = defineProps({
   showResetBtn: {
     type: Boolean,
     default: true
+  },
+  showRefreshBtn: {
+    type: Boolean,
+    default: false
   }
 })
 

+ 8 - 16
src/router/modules/components/recruit/enterprise.js

@@ -436,22 +436,6 @@ const enterprise = [
         },
         component: () => import('@/views/recruit/enterprise/newTalentMap/search/index.vue')
       },
-      // {
-      //   path: '/recruit/enterprise/talentMap/talentMatching',
-      //   meta: {
-      //     title:'骐骥之才',
-      //     enName: 'Talent matching'
-      //   },
-      //   component: () => import('@/views/recruit/enterprise/newTalentMap/talentMatching/index.vue')
-      // },
-      {
-        path: '/recruit/enterprise/talentMap/tagManagement',
-        meta: {
-          title: '标签管理',
-          enName: 'Tag Management '
-        },
-        component: () => import('@/views/recruit/enterprise/newTalentMap/tag/index.vue')
-      },
       {
         path: '/recruit/enterprise/talentMap/labeling',
         meta: {
@@ -459,6 +443,14 @@ const enterprise = [
           enName: 'Talent labeling '
         },
         component: () => import('@/views/recruit/enterprise/newTalentMap/labeling/index.vue')
+      },
+      {
+        path: '/recruit/enterprise/talentMap/tagManagement',
+        meta: {
+          title: '标签管理',
+          enName: 'Tag Management '
+        },
+        component: () => import('@/views/recruit/enterprise/newTalentMap/tag/index.vue')
       }
     ]
   },

+ 20 - 27
src/views/recruit/enterprise/newTalentMap/labeling/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<CtFilter :items="filterItems" @reset="handleReset" @search="handleSearch" />
+		<CtFilter :items="filterItems" :showRefreshBtn="true" @reset="handleReset" @search="handleSearch" @refresh="getList" />
 
 		<v-card elevation="5" class="mt-3">
 			<CtTable
@@ -12,7 +12,7 @@
 				:elevation="0"
 				:isTools="false"
 				:items-per-page="-1"
-				height="calc(100vh - 150px)"
+				height="calc(100vh - 233px)"
 				:showFixedLastItem="true"
 				itemKey="id"
 			>
@@ -20,10 +20,9 @@
 					<v-chip size="small" variant="elevated" :color="item.status === 'active' ? 'primary' : 'error'">{{ item.status === 'active' ? '已启用' : '已禁用' }}</v-chip>
 				</template>
 				<template #actions="{ item }">
-					<v-btn variant="text" color="primary" @click.stop="handleAnnotation(item)">标注</v-btn>
-					<v-btn v-if="item.status === 'active'" variant="text" color="warning" @click.stop="handleAction(item.id, 'inactive')">禁用</v-btn>
-					<v-btn v-if="item.status === 'inactive'" variant="text" color="#007cd6" @click.stop="handleAction(item.id, 'active')">启用</v-btn>
-					<!-- <v-btn variant="text" color="error" @click.stop="handleDelete(item)">删除</v-btn> -->
+					<v-btn variant="text" color="#007cd6" @click.stop="handleAnnotation(item)">标注</v-btn>
+					<v-btn v-if="item.status === 'active'" variant="text" color="error" @click.stop="handleAction(item.id, 'inactive')">禁用</v-btn>
+					<v-btn v-if="item.status === 'inactive'" variant="text" color="primary" @click.stop="handleAction(item.id, 'active')">启用</v-btn>
 				</template>
 			</CtTable>
 		</v-card>
@@ -33,11 +32,11 @@
 			<v-row>
 				<v-col cols="4">
 					<v-card elevation="3" class="pa-3" style="height: 100%">
-						<p :class="{'active': previewUrl}" @click="handlePreview">
+						<p :class="{'active': previewUrl}" @click="showPreview = true">
 							名片
 							<v-icon v-if="previewUrl">mdi-magnify-expand</v-icon>
 						</p>
-						<img v-if="previewUrl" width="100%" :src="previewUrl" />
+						<img v-if="previewUrl" width="100%" class="cursor-pointer" :src="previewUrl" @click="showPreview = true" />
 						<p class="mb-3" :class="{'mt-3': !previewUrl}">门墩儿新任命</p>
 						<p>门墩儿用户简历</p>
 					</v-card>
@@ -88,7 +87,7 @@
 						<v-divider></v-divider>
 						<div class="d-flex justify-space-evenly my-5">
 							<v-btn width="120" color="warning" elevation="5" @click="handleClose">取 消</v-btn>
-							<v-btn width="120" color="primary" elevation="5" @click="handleUpdate">更 新</v-btn>
+							<v-btn width="120" color="primary" elevation="5" :loading="updateLoading" @click="handleUpdate">更 新</v-btn>
 						</div>
 					</v-card>
 				</v-col>
@@ -169,12 +168,14 @@ getList()
 
 // 搜索
 const handleSearch = async (obj) => {
+	Snackbar.warning('建设中...')
 	console.log(obj, '搜索')
 	// query.value = obj
 	// getList()
 }
 // 重置
 const handleReset = (obj) => {
+	Snackbar.warning('建设中...')
 	console.log(obj, '重置')
 	// query.value = obj
 	// getList()
@@ -200,18 +201,14 @@ const getTagList = async () => {
 	}
 }
 
-// 名片预览
-const showPreview = ref(false)
-const handlePreview = () => {
-	showPreview.value = true
-}
-
 // 标注
 const talentSelectedTags = ref([])
 const previewUrl = ref(null)
+const showPreview = ref(false)
 const annotationLoading = ref(false)
 const handleAnnotation = async (item) => {
 	if (!item || !item.id) return
+	talentSelectedTags.value = []
 	
 	talentItem.value = item
 	// 获取所有标签列表
@@ -252,16 +249,6 @@ const handleAction = (id, status) => {
   })
 }
 
-// 删除
-// const handleDelete = (item) => {
-// 	console.log(item, '删除')
-// 	Confirm(t('common.confirmTitle'), '是否确定删除?').then(async () => {
-//     // await deleteInvoiceTitle(id)
-//     Snackbar.success(t('common.delMsg'))
-//     // getList()
-//   })
-// }
-
 // 更新人才标签
 const handleClose = () => {
 	showDialog.value = false
@@ -270,9 +257,13 @@ const handleClose = () => {
 	previewUrl.value = ''
 }
 
+const updateLoading = ref(false)
 const handleUpdate = async () => {
+	if (!talentSelectedTags.value || !talentSelectedTags.value.length) return Snackbar.warning('请选择要更新的人才标签')
+
+	updateLoading.value = true
 	const tags = talentSelectedTags.value.map(e => {
-		return { talent: e.id, tag: e.name }
+		return { talent: talentItem.value.id, tag: e.name }
 	})
 
 	try {
@@ -280,7 +271,9 @@ const handleUpdate = async () => {
 		Snackbar.success('人才标签更新成功')
 		handleClose()
 		getList()
-	} catch {}
+	} finally {
+		updateLoading.value = false
+	}
 }
 </script>