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
68170b9a
Commit
68170b9a
authored
Dec 04, 2023
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/pptist
parents
7013aff1
a64bb7a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
33 deletions
+37
-33
useExport.ts
src/hooks/useExport.ts
+2
-2
index.vue
src/views/Editor/EditorHeader/index.vue
+32
-28
index.vue
src/views/Editor/Thumbnails/index.vue
+1
-1
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+2
-2
No files found.
src/hooks/useExport.ts
View file @
68170b9a
...
...
@@ -42,7 +42,7 @@ export default () => {
setTimeout
(()
=>
{
const
config
:
ExportImageConfig
=
{
quality
,
width
:
160
0
,
width
:
viewportRatio
.
value
==
0.7069
?
1754
:
124
0
,
}
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
...
...
@@ -74,7 +74,7 @@ export default () => {
setTimeout
(()
=>
{
const
config
:
ExportImageConfig
=
{
quality
,
width
:
160
0
,
width
:
viewportRatio
.
value
==
0.7069
?
1754
:
124
0
,
}
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
...
...
src/views/Editor/EditorHeader/index.vue
View file @
68170b9a
...
...
@@ -104,9 +104,7 @@
<FullscreenSpin
:loading=
"exporting"
tip=
"正在导入..."
/>
<Psd-Upload
:visible=
"psdVisibleStatus"
@
closed=
"psdVisibleStatus=false"
></Psd-Upload>
</div>
<!-- ConfigId&& -->
<!-- opacity: 0;position: absolute;left: 100px;top: 0;bottom: 0;overflow: auto;z-index: -1; -->
<div
style=
"position: relative;z-index: -1;"
>
<div
v-if=
"ConfigId"
style=
"opacity: 0;position: absolute;left: 100px;top: 0;bottom: 0;overflow: auto;z-index: -1;"
>
<div
class=
"export-img-dialog"
>
<div
class=
"thumbnails-view"
>
<div
class=
"thumbnails"
v-for=
"slide in slides"
ref=
"FeatureImgRef"
>
...
...
@@ -114,7 +112,7 @@
class=
"thumbnail"
:key=
"slide.id"
:slide=
"slide"
:size=
"
160
0"
:size=
"
viewportRatio==0.7069?1754:124
0"
/>
</div>
</div>
...
...
@@ -162,7 +160,7 @@ import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
const
mainStore
=
useMainStore
()
const
slidesStore
=
useSlidesStore
()
const
layoutsStore
=
useSlidesStore
()
const
{
title
,
slides
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
const
{
title
,
slides
,
slideIndex
,
viewportRatio
}
=
storeToRefs
(
slidesStore
)
const
{
enterScreening
,
enterScreeningFromStart
}
=
useScreening
()
const
{
importSpecificFile
,
importPPTXFile
,
exporting
}
=
useImport
()
const
{
resetSlides
}
=
useSlideHandler
()
...
...
@@ -361,6 +359,7 @@ const SetTripTemplateConfig = async () => {
}
// 保存
const
setTemplate
=
async
()
=>
{
datas
.
loading
=
true
if
(
SourceLoading
.
value
)
setNewDatasList
(
datas
.
DataSource
)
await
uploadImageHandler
()
...
...
@@ -377,6 +376,7 @@ const setTemplate = async () =>{
})
if
(
CoverImg
&&
CoverImg
.
value
)
queryObj
.
value
.
CoverImg
=
CoverImg
.
value
else
{
datas
.
loading
=
false
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
return
ElMessage
({
showClose
:
true
,
...
...
@@ -388,6 +388,7 @@ const setTemplate = async () =>{
||
queryObj
.
value
.
CoverImg
==
''
||
queryObj
.
value
.
CountryName
==
''
||
queryObj
.
value
.
SeasonName
==
''
){
datas
.
loading
=
false
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
return
ElMessage
({
showClose
:
true
,
...
...
@@ -405,6 +406,7 @@ const setTemplate = async () =>{
}
for
(
let
i
=
0
;
i
<
slides
.
value
.
length
;
i
++
){
if
(
slides
.
value
[
i
].
elements
.
length
==
0
)
{
datas
.
loading
=
false
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
return
ElMessage
({
showClose
:
true
,
...
...
@@ -416,7 +418,7 @@ const setTemplate = async () =>{
// console.log(arr,'-------tttt')
queryObj
.
value
.
TempData
=
JSON
.
stringify
(
arr
)
datas
.
loading
=
true
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
await
SetTripTemplateSlide
()
}
...
...
@@ -429,7 +431,6 @@ const setTemplate = async () =>{
const
testHandler
=
async
()
=>
{
FeatureImgStore
.
setFeatureImg
([])
if
(
FeatureImgRef
.
value
&&
FeatureImgRef
.
value
.
length
>
0
){
console
.
log
(
FeatureImgRef
.
value
)
for
(
let
i
=
0
;
i
<
FeatureImgRef
.
value
.
length
;
i
++
)
{
let
result
=
await
exportFeatureImg
(
FeatureImgRef
.
value
[
i
],
'jpeg'
,
1
,
false
,
i
)
if
(
!
result
){
...
...
@@ -446,28 +447,31 @@ const testHandler = async ()=>{
const
setFeatureImgList
=
async
()
=>
{
datas
.
FeatureImgList
=
[]
FeatureImgList
.
value
=
[]
let
imgList
=
[]
await
FeatureImg
.
value
.
forEach
((
item
,
index
)
=>
{
let
name
=
new
Date
().
getTime
()
+
".jpg"
const
file
=
dataURLtoFile
(
item
.
url
,
name
)
let
url
=
AliyunUpload
.
UploadAsync
(
file
,
`Feature/
${
ConfigId
.
value
}
_
${
item
.
index
}
`
)
url
.
then
(
res
=>
{
if
(
res
)
{
let
i
=
res
.
split
(
'_'
)
FeatureImgList
.
value
.
push
({
index
:
i
[
1
],
url
:
res
})
setTimeout
(()
=>
{
let
list
=
FeatureImgList
.
value
.
sort
((
a
,
b
)
=>
{
return
a
.
index
-
b
.
index
if
(
FeatureImg
.
value
&&
FeatureImg
.
value
.
length
>
0
){
for
(
let
i
=
0
;
i
<
FeatureImg
.
value
.
length
;
i
++
)
{
let
name
=
new
Date
().
getTime
()
+
".jpg"
const
file
=
dataURLtoFile
(
FeatureImg
.
value
[
i
].
url
,
name
)
let
result
=
AliyunUpload
.
UploadAsync
(
file
,
`Feature/
${
ConfigId
.
value
}
_
${
i
}
`
)
result
.
then
(
res
=>
{
if
(
res
)
{
let
path
=
res
.
split
(
'_'
)
FeatureImgList
.
value
.
push
({
index
:
path
[
1
],
url
:
res
})
datas
.
FeatureImgList
=
list
.
map
(
x
=>
{
return
x
.
url
})
if
(
index
===
FeatureImg
.
value
.
length
-
1
)
SetTripTemplateConfig
()
},
200
)
}
})
})
if
(
i
==
FeatureImg
.
value
.
length
-
1
)
{
setTimeout
(()
=>
{
let
list
=
FeatureImgList
.
value
.
sort
((
a
,
b
)
=>
{
return
a
.
index
-
b
.
index
})
datas
.
FeatureImgList
=
list
.
map
(
x
=>
{
return
x
.
url
})
SetTripTemplateConfig
()
},
400
)
}
}
})
}
}
// try {
// let queryObj = {
// MyFile: url
...
...
src/views/Editor/Thumbnails/index.vue
View file @
68170b9a
...
...
@@ -226,7 +226,7 @@ const GetTripFiledData = async () =>{
y
.
content
=
y
.
content
.
replace
(
getHtmlPlainText
(
y
.
content
),
value
)
}
else
if
(
value
&&
Array
.
isArray
(
value
)){
//替换
if
(
y
.
type
==
'image'
){
if
(
y
.
type
==
'image'
&&
value
[
0
]
!=
''
){
console
.
log
(
'下载图片开始'
,
new
Date
().
getSeconds
())
try
{
let
tempSize
=
await
FileService
.
getImageSizeWithoutDownloading
(
value
[
0
])
...
...
src/views/Editor/Toolbar/ElementTemplateData.vue
View file @
68170b9a
...
...
@@ -137,7 +137,7 @@
class=
"thumbnail"
:key=
"slides[slideIndex].id"
:slide=
"slides[slideIndex]"
:size=
"
160
0"
:size=
"
viewportRatio==0.7069?1754:124
0"
/>
</div>
</div>
...
...
@@ -180,7 +180,7 @@
}
const
slidesStore
=
useSlidesStore
()
const
{
slides
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
const
{
slides
,
slideIndex
,
viewportRatio
}
=
storeToRefs
(
slidesStore
)
const
isCoverImgStore
=
useScreenStore
()
const
{
model
,
ConfigId
,
TemplateDataSource
,
TemplateType
,
CoverImg
,
isCoverImg
}
=
storeToRefs
(
useScreenStore
())
...
...
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