Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
R
recruit-sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李文光
recruit-sys
Commits
2ccdf0e5
Commit
2ccdf0e5
authored
Sep 09, 2026
by
李文光
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(offer): 抽取 copyToClipboard 兼容助手,支持非 https/localhost 剪贴板回退 (execCommand)
parent
55cc26ed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
11 deletions
+32
-11
OfferFlow.vue
vue-app/src/components/offer/OfferFlow.vue
+32
-11
No files found.
vue-app/src/components/offer/OfferFlow.vue
View file @
2ccdf0e5
...
...
@@ -195,25 +195,46 @@ const reopenOffer = () => {
}
}
const
copyMaterials
=
async
()
=>
{
const
text
=
materials
.
value
?.
items
.
map
((
item
)
=>
`
${
item
.
label
}
:
${
item
.
value
}
`
).
join
(
'
\
n'
)
||
''
// 剪贴板写入需兼容非 https/localhost 等不支持 Clipboard API 的环境
const
copyToClipboard
=
async
(
text
=
''
)
=>
{
if
(
!
text
)
return
false
if
(
navigator
.
clipboard
?.
writeText
)
{
try
{
await
navigator
.
clipboard
.
writeText
(
text
)
showToast
(
'审批材料已复制'
)
return
true
}
catch
{
showToast
(
'复制失败'
,
'error'
)
// 权限不足或调用失败,回退到 execCommand
}
}
try
{
const
textarea
=
document
.
createElement
(
'textarea'
)
textarea
.
value
=
text
textarea
.
style
.
position
=
'fixed'
textarea
.
style
.
opacity
=
'0'
document
.
body
.
appendChild
(
textarea
)
textarea
.
focus
()
textarea
.
select
()
const
ok
=
document
.
execCommand
(
'copy'
)
document
.
body
.
removeChild
(
textarea
)
return
ok
}
catch
{
return
false
}
}
const
copyMaterials
=
async
()
=>
{
const
text
=
materials
.
value
?.
items
.
map
((
item
)
=>
`
${
item
.
label
}
:
${
item
.
value
}
`
).
join
(
'
\
n'
)
||
''
const
ok
=
await
copyToClipboard
(
text
)
if
(
ok
)
showToast
(
'审批材料已复制'
)
else
showToast
(
'复制失败'
,
'error'
)
}
const
copyMail
=
async
()
=>
{
const
text
=
offer
.
value
?.
mailDraft
||
''
if
(
!
text
)
return
try
{
await
navigator
.
clipboard
.
writeText
(
text
)
showToast
(
'邮件草稿已复制'
)
}
catch
{
showToast
(
'复制失败'
,
'error'
)
}
const
ok
=
await
copyToClipboard
(
text
)
if
(
ok
)
showToast
(
'邮件草稿已复制'
)
else
showToast
(
'复制失败'
,
'error'
)
}
// 当前唯一的「下一步」主操作:放进工作流面板,让页面只有一处突出主 CTA,
...
...
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