From 10fa8aedfe1fb0318af12ad413c65914edd51786 Mon Sep 17 00:00:00 2001 From: TianyangZhang Date: Wed, 25 Mar 2026 17:09:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E8=81=8C=E4=BD=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=92=8C=E5=88=86=E4=BA=AB=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加发布时间列显示职位创建日期 - 添加分享按钮,点击复制职位详情页链接到剪贴板 - 支持 Clipboard API 和降级方案 --- .../src/views/admin/JobManageView.vue | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/offer_frontend/src/views/admin/JobManageView.vue b/offer_frontend/src/views/admin/JobManageView.vue index da7e394..403e79f 100644 --- a/offer_frontend/src/views/admin/JobManageView.vue +++ b/offer_frontend/src/views/admin/JobManageView.vue @@ -9,6 +9,11 @@ + + + - + @@ -155,6 +161,25 @@ async function handleSave() { } } +function shareJob(row) { + // 生成职位详情页链接 + const jobUrl = `${window.location.origin}/#/jobs/${row.id}` + + // 复制到剪贴板 + navigator.clipboard.writeText(jobUrl).then(() => { + ElMessage.success(`已复制链接:${jobUrl}`) + }).catch(() => { + // 降级方案:使用传统方法 + const textArea = document.createElement('textarea') + textArea.value = jobUrl + document.body.appendChild(textArea) + textArea.select() + document.execCommand('copy') + document.body.removeChild(textArea) + ElMessage.success(`已复制链接:${jobUrl}`) + }) +} + async function handleDelete(id) { await ElMessageBox.confirm('确认删除该职位?', '提示', { type: 'warning' }) await deleteJob(id)