|
@@ -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>
|
|
|
|