Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
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
viitto
pptist
Commits
3a9620d6
Commit
3a9620d6
authored
Jan 02, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
双击空白处 禁止插入文本
parent
33a1c95e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
axios.ts
src/configs/axios.ts
+1
-1
index.vue
src/views/Editor/Canvas/index.vue
+11
-9
ExportPDF.vue
src/views/Editor/ExportDialog/ExportPDF.vue
+12
-1
No files found.
src/configs/axios.ts
View file @
3a9620d6
...
...
@@ -68,7 +68,7 @@ const getErrorCode2text = (response: AxiosResponse): string => {
const
service
=
Axios
.
create
({
// process.env.VUE_APP_API_URL
//'http://reborn.oytour.com/api/common/post'
baseURL
:
'http://reborn.oytour.com/api/common/post'
,
baseURL
:
process
.
env
.
VUE_APP_API_URL
,
timeout
:
20000
,
headers
:
{
'User-Type'
:
'bus'
,
...
...
src/views/Editor/Canvas/index.vue
View file @
3a9620d6
...
...
@@ -111,6 +111,7 @@ import { injectKeySlideScale } from '@/types/injectKey'
import
{
removeAllRanges
}
from
'@/utils/selection'
import
{
KEYS
}
from
'@/configs/hotkey'
import
{
injectKeyDataSource
}
from
'@/types/injectKey'
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
import
useViewportSize
from
'./hooks/useViewportSize'
import
useMouseSelection
from
'./hooks/useMouseSelection'
...
...
@@ -157,7 +158,7 @@ const {
canvasScale
,
textFormatPainter
,
}
=
storeToRefs
(
mainStore
)
const
{
currentSlide
,
slides
}
=
storeToRefs
(
useSlidesStore
())
const
{
currentSlide
,
slides
,
viewportRatio
}
=
storeToRefs
(
useSlidesStore
())
const
{
ctrlKeyState
,
spaceKeyState
}
=
storeToRefs
(
useKeyboardStore
())
const
viewportRef
=
ref
<
HTMLElement
>
()
...
...
@@ -220,7 +221,6 @@ onMounted(() => {
// 点击画布的空白区域:清空焦点元素、设置画布焦点、清除文字选区、清空格式刷状态
const
handleClickBlankArea
=
(
e
:
MouseEvent
)
=>
{
console
.
log
(
e
,
slides
.
value
[
6
])
if
(
activeElementIdList
.
value
.
length
)
mainStore
.
setActiveElementIdList
([])
if
(
!
spaceKeyState
.
value
&&
e
.
button
==
0
)
updateMouseSelection
(
e
)
else
if
(
e
.
button
==
1
)
dragViewport
(
e
)
...
...
@@ -243,13 +243,15 @@ const handleDblClick = (e: MouseEvent) => {
const
viewportRect
=
viewportRef
.
value
.
getBoundingClientRect
()
const
left
=
(
e
.
pageX
-
viewportRect
.
x
)
/
canvasScale
.
value
const
top
=
(
e
.
pageY
-
viewportRect
.
y
)
/
canvasScale
.
value
createTextElement
({
left
,
top
,
width
:
200
/
canvasScale
.
value
,
// 除以 canvasScale 是为了与点击选区创建的形式保持相同的宽度
height
:
0
,
})
const
width
=
viewportRatio
.
value
<
1
?
VIEWPORT_SIZE
:
VIEWPORT_VER_SIZE
if
(
left
<
width
&&
left
>=
0
){
createTextElement
({
left
,
top
,
width
:
200
/
canvasScale
.
value
,
// 除以 canvasScale 是为了与点击选区创建的形式保持相同的宽度
height
:
0
,
})
}
}
// 画布注销时清空格式刷状态
...
...
src/views/Editor/ExportDialog/ExportPDF.vue
View file @
3a9620d6
...
...
@@ -12,7 +12,7 @@
<ThumbnailSlide
class=
"thumbnail"
:class=
"
{ 'break-page': (index + 1) % count === 0 }"
v-for="(slide, index) in
s
lides"
v-for="(slide, index) in
newS
lides"
:key="slide.id"
:slide="slide"
:size="viewportRatio
<1
?
VIEWPORT_SIZE
:
VIEWPORT_VER_SIZE
"
...
...
@@ -80,6 +80,7 @@ const emit = defineEmits<{
}
>
()
const
{
slides
,
currentSlide
,
viewportRatio
}
=
storeToRefs
(
useSlidesStore
())
const
newSlides
=
ref
<
Array
<
any
>>
([])
const
pdfThumbnailsRef
=
ref
<
HTMLElement
>
()
const
rangeType
=
ref
<
'all'
|
'current'
>
(
'all'
)
...
...
@@ -96,6 +97,16 @@ const expPDF = () => {
}
print
(
pdfThumbnailsRef
.
value
,
pageSize
)
}
const
formatSliders
=
()
=>
{
const
width
=
viewportRatio
.
value
<
1
?
VIEWPORT_SIZE
:
VIEWPORT_VER_SIZE
slides
.
value
.
forEach
((
x
)
=>
{
let
item
=
JSON
.
parse
(
JSON
.
stringify
(
x
))
item
.
elements
=
item
.
elements
.
filter
(
y
=>
y
.
left
<
width
&&
(
y
.
left
+
y
.
width
)
>=
0
)
newSlides
.
value
.
push
(
item
)
})
}
formatSliders
()
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
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