Merge branch 'dev'
This commit is contained in:
commit
83c61e9c42
|
@ -94,40 +94,31 @@ const AppGeneratorPage = defineComponent({
|
||||||
* 点击复制图表
|
* 点击复制图表
|
||||||
* 几秒后恢复原状
|
* 几秒后恢复原状
|
||||||
*/
|
*/
|
||||||
onCopyToClipboard(code) {
|
async onCopyToClipboard(code) {
|
||||||
const textarea = document.createElement('textarea');
|
|
||||||
textarea.value = code;
|
|
||||||
// 避免滚动到页面底部
|
|
||||||
textarea.style.position = 'fixed';
|
|
||||||
document.body.appendChild(textarea);
|
|
||||||
textarea.select();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const successful = document.execCommand('copy');
|
await navigator.clipboard.writeText(code);
|
||||||
if (successful) {
|
|
||||||
this.copied = true;
|
|
||||||
antd.notification.open({
|
|
||||||
type: 'success',
|
|
||||||
message: '复制成功',
|
|
||||||
description: '已将内容复制至剪切板',
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 几秒后恢复原状
|
|
||||||
setTimeout(() => {
|
|
||||||
this.copied = false;
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
antd.notification.open({
|
antd.notification.open({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '复制失败',
|
message: '复制成功',
|
||||||
description: err.message,
|
description: '已将内容复制至剪切板',
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
|
} catch (err) {
|
||||||
|
antd.notification.open({
|
||||||
|
type: 'error',
|
||||||
|
message: '复制失败',
|
||||||
|
description: err.message``,
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
|
console.error('复制失败:', err);
|
||||||
|
// 回退到传统方法
|
||||||
|
const textarea = document.createElement('textarea');
|
||||||
|
textarea.value = code;
|
||||||
|
document.body.appendChild(textarea);
|
||||||
|
textarea.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(textarea);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.removeChild(textarea);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 下载全部文件 */
|
/* 下载全部文件 */
|
||||||
|
|
|
@ -180,7 +180,7 @@
|
||||||
handler(val) {
|
handler(val) {
|
||||||
this.tableList = this.rawTableList;
|
this.tableList = this.rawTableList;
|
||||||
// 根据表名进行过滤筛选或者根据注释内容进行筛选
|
// 根据表名进行过滤筛选或者根据注释内容进行筛选
|
||||||
this.tableList = this.tableList.filter(table => table.tableName.includes(val) || table.tablePrefixes.includes(val));
|
this.tableList = this.tableList.filter(table => table.tableName.includes(val) || table.comment.includes(val));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue