|
@@ -6,7 +6,13 @@
|
|
:width="800"
|
|
:width="800"
|
|
@visible-change="handleVisibleChange"
|
|
@visible-change="handleVisibleChange"
|
|
>
|
|
>
|
|
- <BasicTable @register="registerSubtable"></BasicTable>
|
|
|
|
|
|
+ <BasicTable @register="registerSubtable">
|
|
|
|
+ <template #copy="{ text }">
|
|
|
|
+ <a @click="handleCopy(text)">
|
|
|
|
+ {{ text }}
|
|
|
|
+ </a>
|
|
|
|
+ </template>
|
|
|
|
+ </BasicTable>
|
|
</BasicModal>
|
|
</BasicModal>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
@@ -59,6 +65,7 @@
|
|
{
|
|
{
|
|
title: '更换Key',
|
|
title: '更换Key',
|
|
dataIndex: 'updateAuthorizeKey',
|
|
dataIndex: 'updateAuthorizeKey',
|
|
|
|
+ slots: { customRender: 'copy' },
|
|
width: 150,
|
|
width: 150,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -112,6 +119,15 @@
|
|
closeModal();
|
|
closeModal();
|
|
emit('update');
|
|
emit('update');
|
|
};
|
|
};
|
|
|
|
+ function handleCopy(str: string) {
|
|
|
|
+ let save = function (e) {
|
|
|
|
+ e.clipboardData.setData('text/plain', str);
|
|
|
|
+ e.preventDefault(); //阻止默认行为
|
|
|
|
+ };
|
|
|
|
+ document.addEventListener('copy', save); //添加一个copy事件
|
|
|
|
+ document.execCommand('copy'); //执行copy方法
|
|
|
|
+ createMessage.success('复制成功');
|
|
|
|
+ }
|
|
function handleVisibleChange(v) {
|
|
function handleVisibleChange(v) {
|
|
v && props.userData && nextTick(() => onDataReceive(props.userData));
|
|
v && props.userData && nextTick(() => onDataReceive(props.userData));
|
|
}
|
|
}
|
|
@@ -121,6 +137,7 @@
|
|
fileFlow,
|
|
fileFlow,
|
|
handleVisibleChange,
|
|
handleVisibleChange,
|
|
handleSubmit,
|
|
handleSubmit,
|
|
|
|
+ handleCopy,
|
|
addListFunc,
|
|
addListFunc,
|
|
registerSubtable,
|
|
registerSubtable,
|
|
reload,
|
|
reload,
|