Commit 74b62bf0 by jinmh716

【功能完善】文件列表: 添加复制链接功能

parent 472da927
...@@ -97,6 +97,13 @@ ...@@ -97,6 +97,13 @@
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
type="primary"
@click="copyToClipboard(scope.row.url)"
>
复制链接
</el-button>
<el-button
link
type="danger" type="danger"
@click="handleDelete(scope.row.id)" @click="handleDelete(scope.row.id)"
v-hasPermi="['infra:file:delete']" v-hasPermi="['infra:file:delete']"
...@@ -172,6 +179,13 @@ const openForm = () => { ...@@ -172,6 +179,13 @@ const openForm = () => {
formRef.value.open() formRef.value.open()
} }
/** 复制到剪贴板方法 */
const copyToClipboard = (text: string) => {
navigator.clipboard.writeText(text).then(() => {
message.success('复制成功')
})
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment