员工入职填写优化
This commit is contained in:
@@ -542,6 +542,7 @@ import {
|
||||
import type { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
import { copyToClipboard } from "@/utils";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingContractManageAll");
|
||||
|
||||
@@ -997,9 +998,13 @@ function formatPlaceholder(code: string) {
|
||||
return `{{${code}}}`;
|
||||
}
|
||||
|
||||
function copyPlaceholder(code: string) {
|
||||
navigator.clipboard.writeText(`{{${code}}}`);
|
||||
ElMessage.success(`占位符 {{${code}}} 已复制到剪贴板`);
|
||||
async function copyPlaceholder(code: string) {
|
||||
const ok = await copyToClipboard(`{{${code}}}`);
|
||||
if (ok) {
|
||||
ElMessage.success(`占位符 {{${code}}} 已复制到剪贴板`);
|
||||
} else {
|
||||
ElMessage.warning(`自动复制失败,请手动复制 {{${code}}}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function openVariables(row: OnboardingContractVersion) {
|
||||
|
||||
@@ -1509,6 +1509,7 @@ import {
|
||||
import type { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { getMessageBoxPromptResult, isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
import { copyToClipboard } from "@/utils";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingTaskManageAll");
|
||||
|
||||
@@ -2514,10 +2515,14 @@ async function createTask() {
|
||||
}
|
||||
}
|
||||
|
||||
function copyText(text?: string, successMsg = "复制成功") {
|
||||
async function copyText(text?: string, successMsg = "复制成功") {
|
||||
if (!text) return;
|
||||
navigator.clipboard.writeText(text);
|
||||
ElMessage.success(successMsg);
|
||||
const ok = await copyToClipboard(text);
|
||||
if (ok) {
|
||||
ElMessage.success(successMsg);
|
||||
} else {
|
||||
ElMessage.warning("自动复制失败,请在弹窗中长按或手动复制");
|
||||
}
|
||||
}
|
||||
|
||||
function copyInviteMessage() {
|
||||
@@ -2543,7 +2548,7 @@ async function copyOrShareTaskLink(row: OnboardingTask) {
|
||||
row.linkExpireAt = data.expiresAt;
|
||||
proTable.value?.refresh();
|
||||
|
||||
copyText(linkUrl, "专属入职链接已复制到剪贴板!");
|
||||
await copyText(linkUrl, "专属入职链接已复制到剪贴板!");
|
||||
shareVisible.value = true;
|
||||
} catch (err: any) {
|
||||
ElMessage.error(err?.message || "获取专属链接失败");
|
||||
|
||||
Reference in New Issue
Block a user