diff --git a/src/assets/base.svg b/src/assets/base.svg new file mode 100644 index 0000000..128494f --- /dev/null +++ b/src/assets/base.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/views/ScreenshotGenerator/index.vue b/src/views/ScreenshotGenerator/index.vue index 39ee12f..d9aab33 100644 --- a/src/views/ScreenshotGenerator/index.vue +++ b/src/views/ScreenshotGenerator/index.vue @@ -25,7 +25,7 @@ import { useStore } from '@/hooks/useStore' import { base64ToBlob } from '@/utils/files' import type { FieldValueHandlers } from '@/utils/field' import { CurrencyFieldFormat, NumberFieldFormat, RatingFieldIcon, TextFieldToStr, fieldIcon } from '@/utils/field' -import logoSvg from '@/assets/logo.svg' +import baseSvg from '@/assets/base.svg' const { copy } = useClipboardItems() const { @@ -201,7 +201,7 @@ const conv: ExtractFieldHandlers = { return h(NSpace, { size: 'small' }, vals.map(val => h(NTag, { color: { borderColor: fieldMode[fid][val.id].bgColor, color: fieldMode[fid][val.id].bgColor, textColor: fieldMode[fid][val.id].textColor }, round: true, size: 'small' }, fieldMode[fid][val.id].name))) }, [FieldType.NotSupport]() { - return h(NButton, { round: true, size: 'small', type: 'primary' }, '按钮') + return h(NButton, { round: true, size: 'small', type: 'primary' }, 'click') }, [FieldType.Number]({ fid, vals }) { if (fieldMode[fid]) @@ -294,29 +294,31 @@ async function main() { } async function start(_copy = false) { - if (_copy) { - message.error(t('iframe被阻止,无法复制图片')) - return - } scale.value = 1 const mime = 'image/jpeg' const data = await domToJpeg(box.value, { scale: 2, }) if (_copy) { - await copy([ - new ClipboardItem({ - [mime]: base64ToBlob(data), - }), - ]) - message.success(t('已复制到剪切板')) + try { + await copy([ + new ClipboardItem({ + [mime]: base64ToBlob(data), + }), + ]) + message.success(t('copied to clipboard')) + } + catch (e) { + console.log(e) + message.error(t('iframe blocked, unable to copy image')) + } } else { const a = document.createElement('a') a.download = 'ScreenshotGenerator.jpeg' a.href = data a.dispatchEvent(new MouseEvent('click')) - message.success(t('开始下载')) + message.success(t('start download')) } } @@ -357,7 +359,7 @@ onMounted(async () => { :class="`backgroundColor-${storeData.color}`" >
- 飞书云文档 + {{ t('Lark Base') }}
{ :dots-options="{ color: '#133c9a', type: 'rounded' }" :corners-square-options="{ color: '#3370ff', type: 'rounded' }" :corners-dot-options="{ color: '#00d6b9', type: 'rounded' }" - :image="logoSvg" + :image="baseSvg" /> - + - + - + - + - + - + - + - + - - + + - + - - + + - + - + - + - + - - + + - + - +
{ @@ -481,7 +482,38 @@ onMounted(async () => { -{} +{ + "iframe blocked, unable to copy image": "iframe 被阻止,无法复制图片", + "copied to clipboard": "已复制到剪切板", + "start download": "开始下载", + "configuration": "配置", + "select fields to hide": "选择不显示的字段", + "maximum rows:": "最大行数:", + "watermark:": "水印:", + "view QR code:": "视图二维码:", + "record QR code:": "记录二维码:", + "QR code size:": "二维码大小:", + "appearance": "外观", + "dark mode:": "深色模式:", + "margin:": "边距:", + "vertical margin:": "上下边距:", + "horizontal margin:": "左右边距:", + "table:": "表格:", + "stripes:": "条纹:", + "row separators:": "行分割线:", + "column separators:": "列分割线:", + "title padding:": "标题填充:", + "content padding:": "内容填充:", + "card:": "卡片:", + "opacity:": "透明度:", + "border radius:": "圆角:", + "background:": "背景:", + "select records to share": "选择分享记录", + "copy": "复制", + "download": "下载", + "reset configuration": "重置配置", + "Lark Base": "飞书多维表格" +}