From 6cfd2a9a13df1b4cb4963e0be25d3724a0836470 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 13 Jan 2022 16:22:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E5=AF=B9=E5=8E=9F=E6=9C=89=E5=9B=BE=E7=89=87=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9B=B4=E6=8E=A5=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/EditBar.vue | 20 ++++++++++++ frontend/src/lang/en.js | 1 + frontend/src/lang/tw.js | 1 + frontend/src/lang/zh.js | 1 + frontend/src/styles/deicon/demo_index.html | 29 ++++++++++++++++-- frontend/src/styles/deicon/iconfont.css | 10 ++++-- frontend/src/styles/deicon/iconfont.js | 2 +- frontend/src/styles/deicon/iconfont.json | 7 +++++ frontend/src/styles/deicon/iconfont.ttf | Bin 21332 -> 21600 bytes frontend/src/styles/deicon/iconfont.woff | Bin 13204 -> 13372 bytes frontend/src/styles/deicon/iconfont.woff2 | Bin 11268 -> 11360 bytes 11 files changed, 64 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/EditBar.vue b/frontend/src/components/canvas/components/Editor/EditBar.vue index 86938d1bf5..d1d34c4f3f 100644 --- a/frontend/src/components/canvas/components/Editor/EditBar.vue +++ b/frontend/src/components/canvas/components/Editor/EditBar.vue @@ -1,5 +1,6 @@ @@ -34,6 +38,7 @@ import { mapState } from 'vuex' import bus from '@/utils/bus' import SettingMenu from '@/components/canvas/components/Editor/SettingMenu' import LinkageField from '@/components/canvas/components/Editor/LinkageField' +import toast from '@/components/canvas/utils/toast' export default { components: { SettingMenu, LinkageField }, @@ -210,6 +215,21 @@ export default { }, goFile() { this.$refs.files.click() + }, + handleFileChange(e) { + const file = e.target.files[0] + if (!file.type.includes('image')) { + toast('只能插入图片') + return + } + const reader = new FileReader() + reader.onload = (res) => { + const fileResult = res.target.result + this.curComponent.propValue = fileResult + this.$store.commit('recordSnapshot', 'handleFileChange') + } + + reader.readAsDataURL(file) } } } diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 48b8e448d2..8a579bc219 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1436,6 +1436,7 @@ export default { linkage: 'linkage', jump: 'Jump', cancel_linkage: 'Cancel Linkage', + switch_picture: 'Switch Picture', remove_all_linkage: 'Remove All Linkage', exit_un_march_linkage_field: 'Exit Un March Linkage Field', details: 'Details', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 26f97cffc9..a366eefb46 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1438,6 +1438,7 @@ export default { linkage: '聯動', jump: '跳轉', cancel_linkage: '取消聯動', + switch_picture: '更换图片', remove_all_linkage: '清除所有聯動', exit_un_march_linkage_field: '存在未匹配聯動關繫的字段', details: '詳情', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 818867e519..afb261a586 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1447,6 +1447,7 @@ export default { linkage: '联动', jump: '跳转', cancel_linkage: '取消联动', + switch_picture: '更换图片', remove_all_linkage: '清除所有联动', exit_un_march_linkage_field: '存在未匹配联动关系的字段', details: '详情', diff --git a/frontend/src/styles/deicon/demo_index.html b/frontend/src/styles/deicon/demo_index.html index a4c59c1610..7b9d1d8a9e 100644 --- a/frontend/src/styles/deicon/demo_index.html +++ b/frontend/src/styles/deicon/demo_index.html @@ -54,6 +54,12 @@