Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
6cbac4b7
提交
6cbac4b7
authored
7月 03, 2021
作者:
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(avatar-cropper): add action tooltip
为头像剪裁组件的操作按钮添加工具提示
上级
81cf4413
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
84 行增加
和
47 行删除
+84
-47
CopperModal.vue
src/components/Cropper/src/CopperModal.vue
+70
-47
component.ts
src/locales/lang/en/component.ts
+7
-0
component.ts
src/locales/lang/zh_CN/component.ts
+7
-0
没有找到文件。
src/components/Cropper/src/CopperModal.vue
浏览文件 @
6cbac4b7
...
@@ -23,57 +23,80 @@
...
@@ -23,57 +23,80 @@
<div
:class=
"`$
{prefixCls}-toolbar`">
<div
:class=
"`$
{prefixCls}-toolbar`">
<Upload
:fileList=
"[]"
accept=
"image/*"
:beforeUpload=
"handleBeforeUpload"
>
<Upload
:fileList=
"[]"
accept=
"image/*"
:beforeUpload=
"handleBeforeUpload"
>
<a-button
size=
"small"
preIcon=
"ant-design:upload-outlined"
type=
"primary"
/>
<Tooltip
:title=
"t('component.cropper.selectImage')"
placement=
"bottom"
>
<a-button
size=
"small"
preIcon=
"ant-design:upload-outlined"
type=
"primary"
/>
</Tooltip>
</Upload>
</Upload>
<Space>
<Space>
<a-button
<Tooltip
:title=
"t('component.cropper.btn_reset')"
placement=
"bottom"
>
type=
"primary"
<a-button
preIcon=
"ant-design:reload-outlined"
type=
"primary"
size=
"small"
preIcon=
"ant-design:reload-outlined"
@
click=
"handlerToolbar('reset')"
size=
"small"
/>
:disabled=
"!src"
<a-button
@
click=
"handlerToolbar('reset')"
type=
"primary"
/>
preIcon=
"ant-design:rotate-left-outlined"
</Tooltip>
size=
"small"
<Tooltip
:title=
"t('component.cropper.btn_rotate_left')"
placement=
"bottom"
>
@
click=
"handlerToolbar('rotate', -45)"
<a-button
/>
type=
"primary"
<a-button
preIcon=
"ant-design:rotate-left-outlined"
type=
"primary"
size=
"small"
preIcon=
"ant-design:rotate-right-outlined"
:disabled=
"!src"
size=
"small"
@
click=
"handlerToolbar('rotate', -45)"
@
click=
"handlerToolbar('rotate', 45)"
/>
/>
</Tooltip>
<a-button
<Tooltip
:title=
"t('component.cropper.btn_rotate_right')"
placement=
"bottom"
>
type=
"primary"
<a-button
preIcon=
"vaadin:arrows-long-h"
type=
"primary"
size=
"small"
preIcon=
"ant-design:rotate-right-outlined"
@
click=
"handlerToolbar('scaleX')"
size=
"small"
/>
:disabled=
"!src"
<a-button
@
click=
"handlerToolbar('rotate', 45)"
type=
"primary"
/>
preIcon=
"vaadin:arrows-long-v"
</Tooltip>
size=
"small"
<Tooltip
:title=
"t('component.cropper.btn_scale_x')"
placement=
"bottom"
>
@
click=
"handlerToolbar('scaleY')"
<a-button
/>
type=
"primary"
<a-button
preIcon=
"vaadin:arrows-long-h"
type=
"primary"
size=
"small"
preIcon=
"ant-design:zoom-in-outlined"
:disabled=
"!src"
size=
"small"
@
click=
"handlerToolbar('scaleX')"
@
click=
"handlerToolbar('zoom', 0.1)"
/>
/>
</Tooltip>
<a-button
<Tooltip
:title=
"t('component.cropper.btn_scale_y')"
placement=
"bottom"
>
type=
"primary"
<a-button
preIcon=
"ant-design:zoom-out-outlined"
type=
"primary"
size=
"small"
preIcon=
"vaadin:arrows-long-v"
@
click=
"handlerToolbar('zoom', -0.1)"
size=
"small"
/>
:disabled=
"!src"
@
click=
"handlerToolbar('scaleY')"
/>
</Tooltip>
<Tooltip
:title=
"t('component.cropper.btn_zoom_in')"
placement=
"bottom"
>
<a-button
type=
"primary"
preIcon=
"ant-design:zoom-in-outlined"
size=
"small"
:disabled=
"!src"
@
click=
"handlerToolbar('zoom', 0.1)"
/>
</Tooltip>
<Tooltip
:title=
"t('component.cropper.btn_zoom_out')"
placement=
"bottom"
>
<a-button
type=
"primary"
preIcon=
"ant-design:zoom-out-outlined"
size=
"small"
:disabled=
"!src"
@
click=
"handlerToolbar('zoom', -0.1)"
/>
</Tooltip>
</Space>
</Space>
</div>
</div>
</div>
</div>
<div
:class=
"`$
{prefixCls}-right`">
<div
:class=
"`$
{prefixCls}-right`">
<div
:class=
"`$
{prefixCls}-preview`">
<div
:class=
"`$
{prefixCls}-preview`">
<img
:src=
"previewSource"
v-if=
"previewSource"
/>
<img
:src=
"previewSource"
v-if=
"previewSource"
:alt=
"t('component.cropper.preview')"
/>
</div>
</div>
<template
v-if=
"previewSource"
>
<template
v-if=
"previewSource"
>
<div
:class=
"`$
{prefixCls}-group`">
<div
:class=
"`$
{prefixCls}-group`">
...
@@ -92,7 +115,7 @@
...
@@ -92,7 +115,7 @@
import
{
defineComponent
,
ref
}
from
'vue'
;
import
{
defineComponent
,
ref
}
from
'vue'
;
import
CropperImage
from
'./Cropper.vue'
;
import
CropperImage
from
'./Cropper.vue'
;
import
{
Space
,
Upload
,
Avatar
}
from
'ant-design-vue'
;
import
{
Space
,
Upload
,
Avatar
,
Tooltip
}
from
'ant-design-vue'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
import
{
BasicModal
,
useModalInner
}
from
'/@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'/@/components/Modal'
;
import
{
dataURLtoBlob
}
from
'/@/utils/file/base64Conver'
;
import
{
dataURLtoBlob
}
from
'/@/utils/file/base64Conver'
;
...
@@ -102,13 +125,13 @@
...
@@ -102,13 +125,13 @@
const
props
=
{
const
props
=
{
circled
:
{
type
:
Boolean
,
default
:
true
},
circled
:
{
type
:
Boolean
,
default
:
true
},
uploadApi
:
{
uploadApi
:
{
type
:
Function
as
PropType
<
({
file
:
Blob
,
name
:
st
ir
ng
,
filename
:
string
})
=>
Promise
<
any
>>
,
type
:
Function
as
PropType
<
({
file
:
Blob
,
name
:
st
ri
ng
,
filename
:
string
})
=>
Promise
<
any
>>
,
},
},
};
};
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'CropperAvatar'
,
name
:
'CropperAvatar'
,
components
:
{
BasicModal
,
Space
,
CropperImage
,
Upload
,
Avatar
},
components
:
{
BasicModal
,
Space
,
CropperImage
,
Upload
,
Avatar
,
Tooltip
},
props
,
props
,
emits
:
[
'uploadSuccess'
,
'register'
],
emits
:
[
'uploadSuccess'
,
'register'
],
setup
(
props
,
{
emit
})
{
setup
(
props
,
{
emit
})
{
...
...
src/locales/lang/en/component.ts
浏览文件 @
6cbac4b7
...
@@ -13,6 +13,13 @@ export default {
...
@@ -13,6 +13,13 @@ export default {
uploadSuccess
:
'Uploaded success!'
,
uploadSuccess
:
'Uploaded success!'
,
modalTitle
:
'Avatar upload'
,
modalTitle
:
'Avatar upload'
,
okText
:
'Confirm and upload'
,
okText
:
'Confirm and upload'
,
btn_reset
:
'Reset'
,
btn_rotate_left
:
'Counterclockwise rotation'
,
btn_rotate_right
:
'Clockwise rotation'
,
btn_scale_x
:
'Flip horizontal'
,
btn_scale_y
:
'Flip vertical'
,
btn_zoom_in
:
'Zoom in'
,
btn_zoom_out
:
'Zoom out'
,
},
},
drawer
:
{
drawer
:
{
loadingText
:
'Loading...'
,
loadingText
:
'Loading...'
,
...
...
src/locales/lang/zh_CN/component.ts
浏览文件 @
6cbac4b7
...
@@ -13,6 +13,13 @@ export default {
...
@@ -13,6 +13,13 @@ export default {
uploadSuccess
:
'上传成功'
,
uploadSuccess
:
'上传成功'
,
modalTitle
:
'头像上传'
,
modalTitle
:
'头像上传'
,
okText
:
'确认并上传'
,
okText
:
'确认并上传'
,
btn_reset
:
'重置'
,
btn_rotate_left
:
'逆时针旋转'
,
btn_rotate_right
:
'顺时针旋转'
,
btn_scale_x
:
'水平翻转'
,
btn_scale_y
:
'垂直翻转'
,
btn_zoom_in
:
'放大'
,
btn_zoom_out
:
'缩小'
,
},
},
drawer
:
{
drawer
:
{
loadingText
:
'加载中...'
,
loadingText
:
'加载中...'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论