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
03e0570a
Commit
03e0570a
authored
May 29, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化替换logo
parent
1d2d7a34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
35 deletions
+39
-35
index.vue
src/views/Editor/Thumbnails/index.vue
+37
-34
PreviewCover.vue
src/views/Preview/PreviewCover.vue
+2
-1
No files found.
src/views/Editor/Thumbnails/index.vue
View file @
03e0570a
...
...
@@ -45,14 +45,14 @@
<div
class=
"page-number"
>
幻灯片 {{slideIndex + 1}} / {{slides.length}}
</div>
</div>
<
!-- <
div style="position: fixed;left: 200px;top: -100px;opacity: 0;">
<div
style=
"position: fixed;left: 200px;top: -100px;opacity: 0;"
>
<canvas
style=
"display: none"
id=
"canvas"
></canvas>
<div
id=
"extract-color-id"
class=
"extract-color"
style=
"display: flex;padding: 0 20px; justify-content:end;"
>
</div>
</div>
-->
</div>
</template>
<
script
lang=
"ts"
setup
>
...
...
@@ -424,17 +424,17 @@ const GetTripTemplate = async () =>{
else
if
(
TempId
.
value
)
queryMsg
.
TempId
=
TempId
.
value
let
dataRes
=
await
ConfigService
.
GetTripTemplateSlide
(
queryMsg
);
if
(
dataRes
.
data
.
resultCode
==
1
)
{
//
colorList.value = []
colorList
.
value
=
[]
tempDatas
.
value
=
dataRes
.
data
.
data
//
for(let i=0;i
<
tempDatas
.
value
.
PageImageList
.
length
;
i
++
){
//
const img = new Image();
//
img.src = `${tempDatas.value.PageImageList[i]}`;
//
img.crossOrigin = 'anonymous';
//
img.onload = () => {
//
themeColor(1, img, 20, SetColor);
//
};
//
}
for
(
let
i
=
0
;
i
<
tempDatas
.
value
.
PageImageList
.
length
;
i
++
){
const
img
=
new
Image
();
img
.
src
=
`
${
tempDatas
.
value
.
PageImageList
[
i
]}
`
;
img
.
crossOrigin
=
'anonymous'
;
img
.
onload
=
()
=>
{
themeColor
(
1
,
img
,
20
,
SetColor
);
};
}
if
(
SalesBack
.
value
==
0
||
(
SalesBack
.
value
==
1
&&
searchData
.
value
.
TempId
)){
let
viewportRatios
=
0
if
(
dataRes
.
data
.
data
.
TemplateType
!=
2
)
{
...
...
@@ -481,7 +481,9 @@ const GetTripTemplate = async () =>{
newSlides
=
newSlides
.
filter
((
x
:
Slide
)
=>!
x
.
isTripItems
)
}
getColorShade
(
newSlides
)
setTimeout
(()
=>
{
getColorShade
(
newSlides
)
},
500
)
}
queryObj
.
value
.
TempId
=
dataRes
.
data
.
data
.
TempId
...
...
@@ -526,27 +528,27 @@ const generateUniqueId = () => {
const
getColorShade
=
async
(
newSlides
:
any
)
=>
{
let
dark
=
false
// 根据集团渲染logo
// if(tempDatas.value.AuthType
<=
1
){
//
for(let j=0;j
<
colorList
.
value
.
length
;
j
++
){
//
if (getRgbLevel(colorList.value[j].Color) > 50) dark = true
//
}
//
for(let i=0;i
<
newSlides
.
length
;
i
++
){
//
if(i>colorList.value.length-2) dark = false
//
let x = newSlides[i]
//
let eles = x.elements.filter(y=>y.layerName && y.layerName.indexOf('logo')!=-1)
//
let newElementsImg = await ResolveTripLogoHandler(eles,i,dark)
//
let newElements = []
//
x.elements.forEach(y=>{
//
if(newElementsImg?.elements){
//
newElementsImg?.elements.forEach(z=>{
//
if(y.id==z.id) y = JSON.parse(JSON.stringify(z))
//
})
//
}
//
newElements.push(y)
//
})
//
x.elements = newElements
//
}
//
}
if
(
tempDatas
.
value
.
GId
!=
userInfo
.
value
.
gid
&&!
searchData
.
value
.
isTeamManage
){
for
(
let
j
=
0
;
j
<
colorList
.
value
.
length
;
j
++
){
if
(
getRgbLevel
(
colorList
.
value
[
j
].
Color
)
>
50
)
dark
=
true
}
for
(
let
i
=
0
;
i
<
newSlides
.
length
;
i
++
){
if
(
i
>
colorList
.
value
.
length
-
2
)
dark
=
false
let
x
=
newSlides
[
i
]
let
eles
=
x
.
elements
.
filter
(
y
=>
y
.
layerName
&&
y
.
layerName
.
indexOf
(
'logo'
)
!=-
1
)
let
newElementsImg
=
await
ResolveTripLogoHandler
(
eles
,
i
,
dark
)
let
newElements
=
[]
x
.
elements
.
forEach
(
y
=>
{
if
(
newElementsImg
?.
elements
){
newElementsImg
?.
elements
.
forEach
(
z
=>
{
if
(
y
.
id
==
z
.
id
)
y
=
JSON
.
parse
(
JSON
.
stringify
(
z
))
})
}
newElements
.
push
(
y
)
})
x
.
elements
=
newElements
}
}
layoutsStore
.
setLayouts
(
JSON
.
parse
(
JSON
.
stringify
(
newSlides
)))
if
(
searchData
.
value
.
sellId
&&!
searchData
.
value
.
TempId
)
return
slidesStore
.
setSlides
(
newSlides
)
...
...
@@ -572,7 +574,8 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false) =
// if(Colors[1]||scale==6) templateObj[i].filters.invert = '20%'
if
(
scale
==
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
0
]:
acquiesceLogo
.
value
[
3
]
if
(
scale
<
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
1
]:
acquiesceLogo
.
value
[
4
]
if
(
scale
>
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
6
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
3
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
5
]:
acquiesceLogo
.
value
[
2
]
let
newTempSize
=
await
FileService
.
getImageSizeWithoutDownloading
(
url
)
let
width
=
0
let
height
=
0
...
...
src/views/Preview/PreviewCover.vue
View file @
03e0570a
...
...
@@ -168,7 +168,8 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false) =
// if(Colors[1]||scale==6) templateObj[i].filters.invert = '20%'
if
(
scale
==
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
0
]:
acquiesceLogo
.
value
[
3
]
if
(
scale
<
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
1
]:
acquiesceLogo
.
value
[
4
]
if
(
scale
>
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
6
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
3
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
5
]:
acquiesceLogo
.
value
[
2
]
let
newTempSize
=
await
FileService
.
getImageSizeWithoutDownloading
(
url
)
let
width
=
0
let
height
=
0
...
...
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