Merge branch 'dev'

This commit is contained in:
bunny 2025-07-02 23:23:59 +08:00
commit 83c61e9c42
2 changed files with 20 additions and 29 deletions

View File

@ -94,40 +94,31 @@ const AppGeneratorPage = defineComponent({
* 点击复制图表
* 几秒后恢复原状
*/
onCopyToClipboard(code) {
const textarea = document.createElement('textarea');
textarea.value = code;
// 避免滚动到页面底部
textarea.style.position = 'fixed';
document.body.appendChild(textarea);
textarea.select();
async onCopyToClipboard(code) {
try {
const successful = document.execCommand('copy');
if (successful) {
this.copied = true;
await navigator.clipboard.writeText(code);
antd.notification.open({
type: 'success',
message: '复制成功',
description: '已将内容复制至剪切板',
duration: 3,
});
// 几秒后恢复原状
setTimeout(() => {
this.copied = false;
}, 2000);
}
} catch (err) {
antd.notification.open({
type: 'success',
type: 'error',
message: '复制失败',
description: err.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);
}
},
/* 下载全部文件 */

View File

@ -180,7 +180,7 @@
handler(val) {
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));
}
},
},