提交 2bddbd2a 编写于 作者: Q qq_38870145

Auto Commit

上级 f9e5df34
<template> <template>
<div> <div>
<a-button type="primary" style="margin: 10px 0;" :loading="state.exportLoading" @click="onExport"> <a-button type="primary" style="margin: 10px 0;" :loading="state.exportLoading" @click="onExport">
导出Excel </a-button> 导出 Excel </a-button>
<a-button type="primary" style="margin: 10px 10px;" @click="onPrint"> <a-button type="primary" style="margin: 10px 10px;" @click="onPrint">
打印Json </a-button> 复制 url Json </a-button>
</div> </div>
</template> </template>
<script setup> <script setup>
...@@ -50,15 +50,25 @@ watch(() => props.userId, ...@@ -50,15 +50,25 @@ watch(() => props.userId,
deep: true, deep: true,
immediate: true immediate: true
}) })
const copyContent = async (text) => {
try {
await navigator.clipboard.writeText(text);
console.log('Content copied to clipboard');
} catch (err) {
console.error('Failed to copy: ', err);
}
}
const onPrint=()=>{ const onPrint=()=>{
// const json={} const json={articleInfo:null}
console.log('state.dataSource',state.dataSource) console.log('state.dataSource',state.dataSource)
console.log('url array',state.dataSource.map(item=>{ const urlArray=state.dataSource.map(item=>{
return { return {
url:item.url url:item.url
} }
})) })
json.articleInfo=urlArray
const text=JSON.stringify(json,null,'\t')
console.log('json text',text)
copyContent(text)
} }
</script> </script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册