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
a43ea15b
Commit
a43ea15b
authored
Dec 06, 2023
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复DOM元素比例问题
parent
1a1d9b7b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
10 deletions
+17
-10
components.d.ts
components.d.ts
+1
-0
useExport.ts
src/hooks/useExport.ts
+3
-2
domainManager.ts
src/utils/domainManager.ts
+1
-1
index.vue
src/views/Editor/EditorHeader/index.vue
+1
-1
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+3
-1
index.vue
src/views/Editor/index.vue
+3
-1
index.vue
src/views/components/ThumbnailSlide/index.vue
+5
-4
No files found.
components.d.ts
View file @
a43ea15b
...
@@ -24,6 +24,7 @@ declare module 'vue' {
...
@@ -24,6 +24,7 @@ declare module 'vue' {
ElCol
:
typeof
import
(
'element-plus/es'
)[
'ElCol'
]
ElCol
:
typeof
import
(
'element-plus/es'
)[
'ElCol'
]
ElDialog
:
typeof
import
(
'element-plus/es'
)[
'ElDialog'
]
ElDialog
:
typeof
import
(
'element-plus/es'
)[
'ElDialog'
]
ElDivider
:
typeof
import
(
'element-plus/es'
)[
'ElDivider'
]
ElDivider
:
typeof
import
(
'element-plus/es'
)[
'ElDivider'
]
ElEmpty
:
typeof
import
(
'element-plus/es'
)[
'ElEmpty'
]
ElIcon
:
typeof
import
(
'element-plus/es'
)[
'ElIcon'
]
ElIcon
:
typeof
import
(
'element-plus/es'
)[
'ElIcon'
]
ElInput
:
typeof
import
(
'element-plus/es'
)[
'ElInput'
]
ElInput
:
typeof
import
(
'element-plus/es'
)[
'ElInput'
]
ElOption
:
typeof
import
(
'element-plus/es'
)[
'ElOption'
]
ElOption
:
typeof
import
(
'element-plus/es'
)[
'ElOption'
]
...
...
src/hooks/useExport.ts
View file @
a43ea15b
...
@@ -13,6 +13,7 @@ import { type SvgPoints, toPoints } from '@/utils/svgPathParser'
...
@@ -13,6 +13,7 @@ import { type SvgPoints, toPoints } from '@/utils/svgPathParser'
import
{
encrypt
}
from
'@/utils/crypto'
import
{
encrypt
}
from
'@/utils/crypto'
import
{
svg2Base64
}
from
'@/utils/svg2Base64'
import
{
svg2Base64
}
from
'@/utils/svg2Base64'
import
message
from
'@/utils/message'
import
message
from
'@/utils/message'
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
const
INCH_PX_RATIO
=
100
const
INCH_PX_RATIO
=
100
const
PT_PX_RATIO
=
0.75
const
PT_PX_RATIO
=
0.75
...
@@ -42,7 +43,7 @@ export default () => {
...
@@ -42,7 +43,7 @@ export default () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
config
:
ExportImageConfig
=
{
const
config
:
ExportImageConfig
=
{
quality
,
quality
,
width
:
viewportRatio
.
value
==
0.7069
?
1754
:
1240
,
width
:
(
viewportRatio
.
value
<
1
?
VIEWPORT_SIZE
:
VIEWPORT_VER_SIZE
)
,
}
}
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
...
@@ -78,7 +79,7 @@ export default () => {
...
@@ -78,7 +79,7 @@ export default () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
config
:
ExportImageConfig
=
{
const
config
:
ExportImageConfig
=
{
quality
,
quality
,
width
:
viewportRatio
.
value
==
0.7069
?
1754
:
1240
,
width
:
(
viewportRatio
.
value
<
1
?
VIEWPORT_SIZE
:
VIEWPORT_VER_SIZE
)
,
}
}
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
...
...
src/utils/domainManager.ts
View file @
a43ea15b
...
@@ -2,7 +2,7 @@ export const domainManager = () => {
...
@@ -2,7 +2,7 @@ export const domainManager = () => {
const
locationName
=
window
.
location
.
hostname
const
locationName
=
window
.
location
.
hostname
console
.
log
(
window
.
location
.
hostname
,
'=====hostname'
)
console
.
log
(
window
.
location
.
hostname
,
'=====hostname'
)
const
obj
=
{
const
obj
=
{
domainUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://reborn.oytour.com/api/common/post"
:
"http://
192.168.10.214
/api/common/post"
,
domainUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://reborn.oytour.com/api/common/post"
:
"http://
reborn.oytour.com
/api/common/post"
,
//上传站点
//上传站点
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://upload.oytour.com"
:
"http://192.168.10.214:8120"
,
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://upload.oytour.com"
:
"http://192.168.10.214:8120"
,
//文件站点
//文件站点
...
...
src/views/Editor/EditorHeader/index.vue
View file @
a43ea15b
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
class="thumbnail"
class="thumbnail"
:key="slide.id"
:key="slide.id"
:slide="slide"
:slide="slide"
:size="viewportRatio==0.7069?
1754:1240
"
:size="viewportRatio==0.7069?"
/>
/>
</div>
</div>
</div>
</div>
...
...
src/views/Editor/Toolbar/ElementTemplateData.vue
View file @
a43ea15b
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
class=
"thumbnail"
class=
"thumbnail"
:key=
"slides[slideIndex].id"
:key=
"slides[slideIndex].id"
:slide=
"slides[slideIndex]"
:slide=
"slides[slideIndex]"
:size=
"viewportRatio
==0.7069?1754:1240
"
:size=
"viewportRatio
<1 ? VIEWPORT_SIZE : VIEWPORT_VER_SIZE
"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -159,6 +159,7 @@
...
@@ -159,6 +159,7 @@
import
ThumbnailSlide
from
'@/views/components/ThumbnailSlide/index.vue'
import
ThumbnailSlide
from
'@/views/components/ThumbnailSlide/index.vue'
import
AliyunUpload
from
'@/utils/upload/aliyun'
import
AliyunUpload
from
'@/utils/upload/aliyun'
import
useEditor
from
'@/utils/Editor/index'
import
useEditor
from
'@/utils/Editor/index'
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
const
datas
=
reactive
({
const
datas
=
reactive
({
DataSource
:{},
DataSource
:{},
...
@@ -286,6 +287,7 @@
...
@@ -286,6 +287,7 @@
queryObj
.
value
.
CoverImg
=
''
queryObj
.
value
.
CoverImg
=
''
mainMenuVisible
.
value
=
false
mainMenuVisible
.
value
=
false
isCoverImgStore
.
setIsCoverImg
(
true
)
isCoverImgStore
.
setIsCoverImg
(
true
)
console
.
log
(
FeatureImgRef
.
value
)
let
datas
=
await
exportFeatureImg
(
FeatureImgRef
.
value
,
'jpeg'
,
1
,
false
,
0
)
let
datas
=
await
exportFeatureImg
(
FeatureImgRef
.
value
,
'jpeg'
,
1
,
false
,
0
)
if
(
datas
){
if
(
datas
){
let
name
=
new
Date
().
getTime
()
+
".jpg"
let
name
=
new
Date
().
getTime
()
+
".jpg"
...
...
src/views/Editor/index.vue
View file @
a43ea15b
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
class=
"thumbnail"
class=
"thumbnail"
:key=
"slide.id"
:key=
"slide.id"
:slide=
"slide"
:slide=
"slide"
:size=
"
viewportRatio==0.7069?1754:1240
"
:size=
"
(viewportRatio
<1
?
VIEWPORT_SIZE
:
VIEWPORT_VER_SIZE
)
"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -68,6 +68,7 @@ import SearchPanel from './SearchPanel.vue'
...
@@ -68,6 +68,7 @@ import SearchPanel from './SearchPanel.vue'
import
Modal
from
'@/components/Modal.vue'
import
Modal
from
'@/components/Modal.vue'
import
DataaSource
from
'./DataaSource/index.vue'
import
DataaSource
from
'./DataaSource/index.vue'
import
ConfigService
from
'@/services/ConfigService'
import
ConfigService
from
'@/services/ConfigService'
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
import
ThumbnailSlide
from
'@/views/components/ThumbnailSlide/index.vue'
import
ThumbnailSlide
from
'@/views/components/ThumbnailSlide/index.vue'
...
@@ -80,6 +81,7 @@ const pageTypesList = ref([] as any)
...
@@ -80,6 +81,7 @@ const pageTypesList = ref([] as any)
const
searchData
=
ref
({}
as
any
)
const
searchData
=
ref
({}
as
any
)
searchData
.
value
=
inject
(
injectKeyTemplate
)
searchData
.
value
=
inject
(
injectKeyTemplate
)
let
TempIds
=
0
let
TempIds
=
0
if
(
searchData
.
value
.
TempId
)
TempIds
=
searchData
.
value
.
TempId
if
(
searchData
.
value
.
TempId
)
TempIds
=
searchData
.
value
.
TempId
else
if
(
TempId
.
value
)
TempIds
=
TempId
.
value
else
if
(
TempId
.
value
)
TempIds
=
TempId
.
value
...
...
src/views/components/ThumbnailSlide/index.vue
View file @
a43ea15b
...
@@ -7,9 +7,10 @@
...
@@ -7,9 +7,10 @@
>
>
<div
<div
class=
"elements"
class=
"elements"
style=
"overflow: hidden;"
:style=
"
{
:style=
"
{
width:
VIEWPORT_SIZE
+ 'px',
width:
(viewportRatio
<1
?
VIEWPORT_SIZE:VIEWPORT_VER_SIZE
)
+
'
px
',
height:
VIEWPORT_SIZE
* viewportRatio + 'px',
height:
(
viewportRatio
<1
?
VIEWPORT_SIZE:VIEWPORT_VER_SIZE
)
*
viewportRatio
+
'
px
',
transform:
`
scale
($
{scale})`,
transform:
`
scale
($
{scale})`,
}"
}"
v-if="visible"
v-if="visible"
...
@@ -32,7 +33,7 @@ import { storeToRefs } from 'pinia'
...
@@ -32,7 +33,7 @@ import { storeToRefs } from 'pinia'
import
{
useSlidesStore
}
from
'@/store'
import
{
useSlidesStore
}
from
'@/store'
import
type
{
Slide
}
from
'@/types/slides'
import
type
{
Slide
}
from
'@/types/slides'
import
{
injectKeySlideScale
}
from
'@/types/injectKey'
import
{
injectKeySlideScale
}
from
'@/types/injectKey'
import
{
VIEWPORT_SIZE
}
from
'@/configs/canvas'
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
import
useSlideBackgroundStyle
from
'@/hooks/useSlideBackgroundStyle'
import
useSlideBackgroundStyle
from
'@/hooks/useSlideBackgroundStyle'
import
ThumbnailElement
from
'./ThumbnailElement.vue'
import
ThumbnailElement
from
'./ThumbnailElement.vue'
...
@@ -50,7 +51,7 @@ const { viewportRatio } = storeToRefs(useSlidesStore())
...
@@ -50,7 +51,7 @@ const { viewportRatio } = storeToRefs(useSlidesStore())
const
background
=
computed
(()
=>
props
.
slide
.
background
)
const
background
=
computed
(()
=>
props
.
slide
.
background
)
const
{
backgroundStyle
}
=
useSlideBackgroundStyle
(
background
)
const
{
backgroundStyle
}
=
useSlideBackgroundStyle
(
background
)
const
scale
=
computed
(()
=>
props
.
size
/
VIEWPORT_SIZE
)
const
scale
=
computed
(()
=>
props
.
size
/
(
viewportRatio
.
value
<
1
?
VIEWPORT_SIZE
:
VIEWPORT_VER_SIZE
)
)
provide
(
injectKeySlideScale
,
scale
)
provide
(
injectKeySlideScale
,
scale
)
</
script
>
</
script
>
...
...
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