Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_admin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_admin
Commits
af24efd4
Commit
af24efd4
authored
Jul 20, 2023
by
yaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:去除less
parent
a7426a65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
3 deletions
+58
-3
src/views/goods/components/selectImageDialog.vue
src/views/goods/components/selectImageDialog.vue
+57
-2
src/views/goods/infoSet.vue
src/views/goods/infoSet.vue
+1
-1
No files found.
src/views/goods/components/selectImageDialog.vue
View file @
af24efd4
...
...
@@ -20,7 +20,7 @@
</el-dialog>
<LamaImageDialog
:show-lama-dialog=
"showLamaImageDialog"
@
imageBase64=
"handleGetImageBase64"
/>
@
imageBase64=
"handleGetImageBase64"
/>
</div>
</
template
>
...
...
@@ -69,6 +69,12 @@ export default {
}
debugger
if
(
this
.
selectType
===
1
)
{
// 去水印
const
result
=
this
.
copyContent
(
this
.
imageList
[
this
.
currentPosition
])
if
(
result
)
{
this
.
$message
.
info
(
'
复制链接成功,粘贴去链接去水印吧
'
)
}
else
{
this
.
$message
.
error
(
'
复制链接失败,请重试
'
)
}
this
.
showLamaImageDialog
=
true
}
else
{
this
.
$emit
(
'
selectSuccess
'
,
this
.
imageList
[
this
.
currentPosition
])
...
...
@@ -79,14 +85,62 @@ export default {
this
.
$emit
(
'
imageBase64Str
'
,
imgUrlBase64
)
this
.
showLamaImageDialog
=
false
this
.
$emit
(
'
closeDialog
'
)
},
copyContent
(
content
)
{
// 复制结果
let
copyResult
=
true
// 设置想要复制的文本内容
const
text
=
content
||
''
// 判断是否支持clipboard方式
if
(
window
.
navigator
.
clipboard
)
{
// 利用clipboard将文本写入剪贴板(这是一个异步promise)
window
.
navigator
.
clipboard
.
writeText
(
text
).
then
((
res
)
=>
{
console
.
log
(
'
复制成功
'
)
// 返回复制操作的最终结果
return
copyResult
}).
catch
((
err
)
=>
{
copyResult
=
false
console
.
log
(
'
复制失败
'
,
err
)
// 返回复制操作的最终结果
return
copyResult
})
}
else
{
// 不支持clipboard方式 则采用document.execCommand()方式
// 创建一个input元素
const
inputDom
=
document
.
createElement
(
'
textarea
'
)
// 设置为只读 防止移动端手机上弹出软键盘
inputDom
.
setAttribute
(
'
readonly
'
,
'
readonly
'
)
// 给input元素赋值
inputDom
.
value
=
text
// 将创建的input添加到body
document
.
body
.
appendChild
(
inputDom
)
// 选中input元素的内容
inputDom
.
select
()
// 执行浏览器复制命令
// 复制命令会将当前选中的内容复制到剪切板中(这里就是创建的input标签中的内容)
// Input要在正常的编辑状态下原生复制方法才会生效
const
result
=
document
.
execCommand
(
'
copy
'
)
// 判断是否复制成功
if
(
result
)
{
console
.
log
(
'
复制成功
'
)
}
else
{
console
.
log
(
'
复制失败
'
)
copyResult
=
false
}
// 复制操作后再将构造的标签 移除
document
.
body
.
removeChild
(
inputDom
)
// 返回复制操作的最终结果
return
copyResult
}
}
}
}
</
script
>
<
style
lang=
"
le
ss"
scoped
>
<
style
lang=
"
sc
ss"
scoped
>
.list
{
width
:
720px
;
.select_item
{
width
:
100px
;
height
:
100px
;
...
...
@@ -99,6 +153,7 @@ export default {
width
:
100px
;
height
:
100px
;
}
.check_img
{
position
:
absolute
;
top
:
10px
;
...
...
src/views/goods/infoSet.vue
View file @
af24efd4
...
...
@@ -468,7 +468,7 @@ export default {
}
</
script
>
<
style
lang=
"
le
ss"
scoped
>
<
style
lang=
"
sc
ss"
scoped
>
/
deep
/
.vue-picture-cut_default-menu
{
height
:
0px
;
inset
:
0px
0px
0px
!
important
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment