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

Auto Commit

上级 f9e5df34
<template>
<div>
<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">
打印Json </a-button>
复制 url Json </a-button>
</div>
</template>
<script setup>
......@@ -50,15 +50,25 @@ watch(() => props.userId,
deep: 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 json={}
const json={articleInfo:null}
console.log('state.dataSource',state.dataSource)
console.log('url array',state.dataSource.map(item=>{
const urlArray=state.dataSource.map(item=>{
return {
url:item.url
}
}))
})
json.articleInfo=urlArray
const text=JSON.stringify(json,null,'\t')
console.log('json text',text)
copyContent(text)
}
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册