mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-12 04:59:24 +08:00
feat: 操作日志新增复制功能
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { isExternal } from "@/utils/validate";
|
||||
import { browse, mapTree } from "xe-utils";
|
||||
import _ from "lodash";
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
|
||||
export function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
|
||||
return obj[key]
|
||||
@@ -242,3 +243,12 @@ export const formatFileSize = (fileSize: number) => {
|
||||
const size = srcSize / 1024 ** index
|
||||
return `${size.toFixed(2)} ${unitArr[index]}`
|
||||
}
|
||||
export const copyText =(text:any) =>{
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = text;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(textarea);
|
||||
Message.success('复制成功')
|
||||
}
|
Reference in New Issue
Block a user