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
a22669e2
Commit
a22669e2
authored
Dec 27, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/pptist
parents
b285b9bd
9505d0cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
font.ts
src/store/font.ts
+15
-14
resolve.ts
src/utils/psdParser/resolve.ts
+1
-1
index.vue
src/views/Editor/EditorHeader/index.vue
+4
-1
No files found.
src/store/font.ts
View file @
a22669e2
...
@@ -62,26 +62,27 @@ export const useFontStore = defineStore('fonts',{
...
@@ -62,26 +62,27 @@ export const useFontStore = defineStore('fonts',{
if
(
loadFonts
&&
loadFonts
.
length
>
0
){
if
(
loadFonts
&&
loadFonts
.
length
>
0
){
for
(
let
i
=
0
;
i
<
loadFonts
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
loadFonts
.
length
;
i
++
)
{
const
item
=
loadFonts
[
i
];
const
item
=
loadFonts
[
i
];
const
url
=
item
.
fontUrl
.
indexOf
(
'local'
)
==-
1
?
`url('
${
item
.
fontUrl
}
')`
:
item
.
fontUrl
const
fontFace
=
new
FontFace
(
item
.
fontFamily
,
url
);
try
{
try
{
const
url
=
item
.
fontUrl
.
indexOf
(
'local'
)
==-
1
?
`url('
${
item
.
fontUrl
}
')`
:
item
.
fontUrl
const
fontFace
=
new
FontFace
(
item
.
fontFamily
,
url
);
fontFace
.
display
=
"swap"
fontFace
.
display
=
"swap"
await
fontFace
.
load
();
await
fontFace
.
load
();
document
.
fonts
.
add
(
fontFace
)
this
.
loaded
.
push
(
item
.
fontFamily
)
let
newStyle
=
document
.
createElement
(
'style'
);
const
fontFormat
=
item
.
fontUrl
.
toLowerCase
().
indexOf
(
'.ttf'
)
!=-
1
?
'truetype'
:
item
.
fontUrl
.
split
(
'.'
).
reverse
()[
0
]
newStyle
.
setAttribute
(
"type"
,
"text/css"
);
newStyle
.
appendChild
(
document
.
createTextNode
(
"
\
@font-face {
\
font-family: '"
+
item
.
fontFamily
+
"';
\
src: "
+
url
+
" format("
+
fontFormat
+
");
\
}
\
"
));
document
.
head
.
appendChild
(
newStyle
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
'加载字体报错'
,
error
)
console
.
log
(
'加载字体报错'
,
error
)
}
}
document
.
fonts
.
add
(
fontFace
)
this
.
loaded
.
push
(
item
.
fontFamily
)
let
newStyle
=
document
.
createElement
(
'style'
);
const
fontFormat
=
item
.
fontUrl
.
toLowerCase
().
indexOf
(
'.ttf'
)
!=-
1
?
'truetype'
:(
item
.
fontUrl
.
toLowerCase
().
indexOf
(
'.otf'
)
!=-
1
?
'opentype'
:
item
.
fontUrl
.
split
(
'.'
).
reverse
()[
0
])
newStyle
.
setAttribute
(
"type"
,
"text/css"
);
newStyle
.
appendChild
(
document
.
createTextNode
(
"
\
@font-face {
\
font-family: '"
+
item
.
fontFamily
+
"';
\
src: "
+
url
+
" format("
+
fontFormat
+
");
\
}
\
"
));
document
.
head
.
appendChild
(
newStyle
);
}
}
}
}
loadingInstance
.
close
()
loadingInstance
.
close
()
...
...
src/utils/psdParser/resolve.ts
View file @
a22669e2
...
@@ -54,7 +54,7 @@ export const ResolvePsdToSliderHandler = async (psd:any) => {
...
@@ -54,7 +54,7 @@ export const ResolvePsdToSliderHandler = async (psd:any) => {
}
}
}
}
if
(
slides
.
value
.
length
>
0
){
if
(
slides
.
value
.
length
>
0
&&
!
(
slides
.
value
.
length
==
1
&&
slides
.
value
[
0
].
elements
.
length
==
0
)
){
let
copySlides
=
JSON
.
parse
(
JSON
.
stringify
(
slides
.
value
))
let
copySlides
=
JSON
.
parse
(
JSON
.
stringify
(
slides
.
value
))
copySlides
.
splice
(
slides
.
value
.
length
,
0
,...
sliders
)
copySlides
.
splice
(
slides
.
value
.
length
,
0
,...
sliders
)
return
copySlides
return
copySlides
...
...
src/views/Editor/EditorHeader/index.vue
View file @
a22669e2
...
@@ -236,6 +236,7 @@ const goBack = (type:any) =>{
...
@@ -236,6 +236,7 @@ const goBack = (type:any) =>{
}
}
// 返回是否清空数据
// 返回是否清空数据
const
setNewDatas
=
(
type
,
i
)
=>
{
const
setNewDatas
=
(
type
,
i
)
=>
{
console
.
log
(
type
,
i
)
let
list
=
[
let
list
=
[
{
{
id
:
'test-slide-1'
,
id
:
'test-slide-1'
,
...
@@ -373,6 +374,7 @@ const uploadImageHandler = async ()=>{
...
@@ -373,6 +374,7 @@ const uploadImageHandler = async ()=>{
}
}
const
thumbnails
=
useSlidesStore
().
getThumbnails
const
thumbnails
=
useSlidesStore
().
getThumbnails
console
.
log
(
'console thumbnails'
,
thumbnails
)
if
(
thumbnails
&&
thumbnails
.
length
>
0
){
if
(
thumbnails
&&
thumbnails
.
length
>
0
){
loadingInstance
.
value
.
text
=
'正在上传模板缩略图'
loadingInstance
.
value
.
text
=
'正在上传模板缩略图'
queryObj
.
value
.
PageImage
=
[]
queryObj
.
value
.
PageImage
=
[]
...
@@ -443,7 +445,7 @@ const setTemplate = async (type) =>{
...
@@ -443,7 +445,7 @@ const setTemplate = async (type) =>{
if
(
SourceLoading
.
value
)
setNewDatasList
(
datas
.
DataSource
)
if
(
SourceLoading
.
value
)
setNewDatasList
(
datas
.
DataSource
)
await
uploadImageHandler
()
await
uploadImageHandler
()
console
.
log
(
JSON
.
stringify
(
queryObj
.
value
))
let
arr
=
JSON
.
parse
(
JSON
.
stringify
(
slides
.
value
))
let
arr
=
JSON
.
parse
(
JSON
.
stringify
(
slides
.
value
))
if
(
dataLoading
.
value
){
if
(
dataLoading
.
value
){
dataLoadingStore
.
setDataLoading
(
0
)
dataLoadingStore
.
setDataLoading
(
0
)
...
@@ -501,6 +503,7 @@ const setTemplate = async (type) =>{
...
@@ -501,6 +503,7 @@ const setTemplate = async (type) =>{
// console.log(arr,'-------tttt')
// console.log(arr,'-------tttt')
queryObj
.
value
.
TempData
=
JSON
.
stringify
(
arr
)
queryObj
.
value
.
TempData
=
JSON
.
stringify
(
arr
)
console
.
log
(
JSON
.
stringify
(
queryObj
.
value
))
if
(
model
.
value
==
1
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
if
(
model
.
value
==
1
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
await
SetTripTemplateSlide
()
await
SetTripTemplateSlide
()
}
else
if
(
ConfigId
.
value
&&
model
.
value
!=
2
){
}
else
if
(
ConfigId
.
value
&&
model
.
value
!=
2
){
...
...
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