提交 93ff8a1f 编写于 作者: peng.zhao's avatar peng.zhao

Merge branch 'feature/zp' into 'release'

add copy

See merge request com.pica.cloud.foundation.frontend/pica-sensitive-admin!13
......@@ -80,11 +80,21 @@
v-for="item in tableDataList.columnList"
>
<el-table-column
:prop="item.key"
align="center"
:width="item.key === 'column1' ? '150px' : 'auto'"
:label="item.value"
align="center"
show-overflow-tooltip
></el-table-column>
>
<template slot-scope="scope">
<div @click="copyTitle(scope.row[item.key])" v-if="item.key === 'column1'">
<span>{{ scope.row[item.key] }}</span>
<img class="user-logo" src="../../../static/img/copy.png" style="width: 15px; height: 15px;">
</div>
<div v-else>
<span>{{ scope.row[item.key] }}</span>
</div>
</template>
</el-table-column>
</template>
<el-table-column
v-if="tableDataList && tableDataList.columnList"
......@@ -410,6 +420,15 @@ export default {
vm.handleForbid(); // 禁止默认事件
},
methods: {
copyTitle(value) {
this.copyText(value);
},
copyText(text) {
if (navigator.clipboard) {
navigator.clipboard.writeText(text);
}
this.$message.success("复制成功");
},
handleForbid() {
document.oncontextmenu = function () {
return false;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册