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
52027cf3
Commit
52027cf3
authored
Mar 07, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成文件缓存
parent
b836ecad
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
54 deletions
+68
-54
.env.production
.env.production
+2
-2
loadMore.ts
src/plugins/directive/loadMore.ts
+1
-4
font.ts
src/store/font.ts
+33
-34
index.vue
src/views/Editor/Thumbnails/index.vue
+0
-2
index.vue
src/views/components/ThumbnailSlide/index.vue
+0
-1
vue.config.js
vue.config.js
+32
-11
No files found.
.env.production
View file @
52027cf3
VUE_APP_API_URL = 'http://reborn.oytour.com/api/common/post'
VUE_APP_API_URL = 'http
s
://reborn.oytour.com/api/common/post'
VUE_APP_UPLOADURLAPI_URL = 'http://upload.oytour.com'
VUE_APP_UPLOADURLAPI_URL = 'http
s
://upload.oytour.com'
VUE_APP_SHARE_URL = 'http://vitto.com'
VUE_APP_SHARE_URL = 'http://vitto.com'
\ No newline at end of file
src/plugins/directive/loadMore.ts
View file @
52027cf3
...
@@ -20,12 +20,9 @@ const LoadMoreDirective: Directive = {
...
@@ -20,12 +20,9 @@ const LoadMoreDirective: Directive = {
mounted
(
el
:
CustomHTMLElement
,
binding
)
{
mounted
(
el
:
CustomHTMLElement
,
binding
)
{
let
obj
=
el
.
querySelector
(
'.el-scrollbar__wrap'
)
let
obj
=
el
.
querySelector
(
'.el-scrollbar__wrap'
)
if
(
obj
){
if
(
obj
){
console
.
log
(
'找到元素'
)
el
[
CTX_SCROLL_LOADMORE_HANDLER
]
=
(
event
:
Event
)
=>
callbackEvent
(
event
,
binding
)
el
[
CTX_SCROLL_LOADMORE_HANDLER
]
=
(
event
:
Event
)
=>
callbackEvent
(
event
,
binding
)
obj
.
addEventListener
(
'scroll'
,
el
[
CTX_SCROLL_LOADMORE_HANDLER
])
obj
.
addEventListener
(
'scroll'
,
el
[
CTX_SCROLL_LOADMORE_HANDLER
])
}
else
{
}
else
{
}
console
.
log
(
'没有找到元素'
)
}
},
},
unmounted
(
el
:
CustomHTMLElement
)
{
unmounted
(
el
:
CustomHTMLElement
)
{
...
...
src/store/font.ts
View file @
52027cf3
...
@@ -2,20 +2,20 @@ import { ApiResult } from './../configs/axios';
...
@@ -2,20 +2,20 @@ import { ApiResult } from './../configs/axios';
import
{
defineStore
}
from
'pinia'
import
{
defineStore
}
from
'pinia'
import
FontService
from
'@/services/FontService'
import
FontService
from
'@/services/FontService'
import
{
ElLoading
}
from
'element-plus'
import
{
ElLoading
}
from
'element-plus'
import
type
{
StorageLike
}
from
'pinia-plugin-persistedstate'
;
//
import type { StorageLike } from 'pinia-plugin-persistedstate';
import
SecureLS
from
'secure-ls'
;
//
import SecureLS from 'secure-ls';
const
ls
=
new
SecureLS
({
//
const ls = new SecureLS({
isCompression
:
false
,
//
isCompression: false,
encryptionSecret
:
'38c31684-d00d-30dc-82e0-fad9eec46d1d'
,
//
encryptionSecret: '38c31684-d00d-30dc-82e0-fad9eec46d1d',
});
//
});
const
st
:
StorageLike
=
{
//
const st: StorageLike = {
setItem
(
key
:
string
,
value
:
string
)
{
//
setItem(key: string, value: string) {
ls
.
set
(
key
,
value
);
//
ls.set(key, value);
},
//
},
getItem
(
key
:
string
):
string
|
null
{
//
getItem(key: string): string | null {
return
ls
.
get
(
key
);
//
return ls.get(key);
},
//
},
};
//
};
export
interface
CustomerFonts
{
export
interface
CustomerFonts
{
fontUrl
:
string
fontUrl
:
string
fontFamily
:
string
fontFamily
:
string
...
@@ -104,17 +104,16 @@ export const useFontStore = defineStore('fonts',{
...
@@ -104,17 +104,16 @@ export const useFontStore = defineStore('fonts',{
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
url
=
item
.
fontUrl
.
indexOf
(
'local'
)
==-
1
?
`url('
${
item
.
fontUrl
}
')`
:
item
.
fontUrl
if
(
this
.
restoreLoaded
.
indexOf
(
item
.
fontFamily
)
==-
1
)
{
const
fontFace
=
new
FontFace
(
item
.
fontFamily
,
url
);
const
fontFace
=
new
FontFace
(
item
.
fontFamily
,
url
);
try
{
try
{
fontFace
.
display
=
"swap"
fontFace
.
display
=
"swap"
await
fontFace
.
load
();
await
fontFace
.
load
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
'加载字体报错'
,
error
)
console
.
log
(
'加载字体报错'
,
error
)
}
document
.
fonts
.
add
(
fontFace
)
}
}
document
.
fonts
.
add
(
fontFace
)
this
.
loaded
.
push
(
item
.
fontFamily
)
this
.
loaded
.
push
(
item
.
fontFamily
)
let
newStyle
=
document
.
createElement
(
'style'
);
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
]}
'`
)
const
fontFormat
=
item
.
fontUrl
.
toLowerCase
().
indexOf
(
'.ttf'
)
!=-
1
?
'truetype'
:(
item
.
fontUrl
.
toLowerCase
().
indexOf
(
'.otf'
)
!=-
1
?
'opentype'
:
`'
${
item
.
fontUrl
.
split
(
'.'
).
reverse
()[
0
]}
'`
)
...
@@ -151,14 +150,14 @@ export const useFontStore = defineStore('fonts',{
...
@@ -151,14 +150,14 @@ export const useFontStore = defineStore('fonts',{
return
false
return
false
}
}
},
},
persist
:
{
//
persist: {
storage
:
st
,
//
storage: st,
paths
:[
'loaded'
],
//
paths:['loaded'],
afterRestore
(
context
)
{
//
afterRestore(context) {
console
.
log
(
'还原了....'
,
context
.
store
.
loaded
)
//
console.log('还原了....',context.store.loaded)
context
.
store
.
restoreLoaded
=
JSON
.
parse
(
JSON
.
stringify
(
context
.
store
.
loaded
))
//
context.store.restoreLoaded = JSON.parse(JSON.stringify(context.store.loaded))
context
.
store
.
loaded
=
[]
//
context.store.loaded = []
console
.
log
(
'修改了....'
,
context
.
store
.
loaded
)
//
console.log('修改了....',context.store.loaded)
},
//
},
}
//
}
})
})
\ No newline at end of file
src/views/Editor/Thumbnails/index.vue
View file @
52027cf3
...
@@ -439,7 +439,6 @@ const GetTripTemplate = async () =>{
...
@@ -439,7 +439,6 @@ const GetTripTemplate = async () =>{
let
id
=
generateUniqueId
()
let
id
=
generateUniqueId
()
x
.
id
=
`
${
ids
[
0
]}
-
${
ids
[
1
]}${
id
}
`
x
.
id
=
`
${
ids
[
0
]}
-
${
ids
[
1
]}${
id
}
`
}
}
console
.
log
(
existId
,
'-----'
,
x
.
id
,
'----newSlides ID'
)
x
.
elements
.
forEach
(
y
=>
{
x
.
elements
.
forEach
(
y
=>
{
if
(
x
.
pageType
!=
1
&&
y
.
TemplateDataSource
&&
y
.
TemplateDataSource
.
index
==
null
){
if
(
x
.
pageType
!=
1
&&
y
.
TemplateDataSource
&&
y
.
TemplateDataSource
.
index
==
null
){
Reflect
.
set
(
y
.
TemplateDataSource
,
'index'
,
null
)
Reflect
.
set
(
y
.
TemplateDataSource
,
'index'
,
null
)
...
@@ -539,7 +538,6 @@ const sellGetTripTemplate = async () =>{
...
@@ -539,7 +538,6 @@ const sellGetTripTemplate = async () =>{
}
}
if
(
SalesBack
.
value
==
0
)
slidesStore
.
setTitle
(
dataRes
.
data
.
data
.
Title
)
if
(
SalesBack
.
value
==
0
)
slidesStore
.
setTitle
(
dataRes
.
data
.
data
.
Title
)
if
(
SalesBack
.
value
==
0
&&
searchData
.
value
.
sellId
){
if
(
SalesBack
.
value
==
0
&&
searchData
.
value
.
sellId
){
console
.
log
(
JSON
.
parse
(
dataObj
.
TempData
))
let
SlidesData
=
JSON
.
parse
(
dataObj
.
TempData
)
let
SlidesData
=
JSON
.
parse
(
dataObj
.
TempData
)
let
newSlides
=
[]
let
newSlides
=
[]
await
SlidesData
.
forEach
((
x
,
i
)
=>
{
await
SlidesData
.
forEach
((
x
,
i
)
=>
{
...
...
src/views/components/ThumbnailSlide/index.vue
View file @
52027cf3
...
@@ -46,7 +46,6 @@ const props = withDefaults(defineProps<{
...
@@ -46,7 +46,6 @@ const props = withDefaults(defineProps<{
visible
:
true
,
visible
:
true
,
})
})
console
.
log
(
props
.
size
)
const
{
viewportRatio
}
=
storeToRefs
(
useSlidesStore
())
const
{
viewportRatio
}
=
storeToRefs
(
useSlidesStore
())
const
background
=
computed
(()
=>
props
.
slide
.
background
)
const
background
=
computed
(()
=>
props
.
slide
.
background
)
...
...
vue.config.js
View file @
52027cf3
...
@@ -31,9 +31,12 @@ module.exports = {
...
@@ -31,9 +31,12 @@ module.exports = {
}),
}),
Components
({
Components
({
resolvers
:
[
ElementPlusResolver
()],
resolvers
:
[
ElementPlusResolver
()],
})
,
})
],
],
},
},
devServer
:{
https
:
true
},
pwa
:
{
pwa
:
{
name
:
'PPTist'
,
name
:
'PPTist'
,
themeColor
:
'#d14424'
,
themeColor
:
'#d14424'
,
...
@@ -74,21 +77,39 @@ module.exports = {
...
@@ -74,21 +77,39 @@ module.exports = {
},
},
workboxOptions
:
{
workboxOptions
:
{
runtimeCaching
:
[{
runtimeCaching
:
[{
urlPattern
:
/.*/
,
urlPattern
:
/
\.(
woff|ttf|otf
)
$/
,
handler
:
'NetworkFirst'
,
handler
:
'CacheFirst'
,
options
:
{
cacheName
:
'fonts-cache'
,
expiration
:
{
maxEntries
:
10
,
maxAgeSeconds
:
60
*
60
*
24
*
30
,
// 30 days
},
},
},{
urlPattern
:
/^https:
\/\/
im
\.
oytour
\.
com
\/
tripfont
\/
.*$/
,
handler
:
'CacheFirst'
,
options
:
{
cacheName
:
'fonts-cache'
,
expiration
:
{
maxEntries
:
10
,
maxAgeSeconds
:
60
*
60
*
24
*
365
,
// 30 days
},
},
},{
urlPattern
:
/^https:
\/\/
im
\.
oytour
\.
com
\/
pptist
\/
desgin
\/
.*$/
,
handler
:
'CacheFirst'
,
options
:
{
options
:
{
cacheName
:
'
PPTist
'
,
cacheName
:
'
images-cache
'
,
expiration
:
{
expiration
:
{
maxAgeSeconds
:
60
*
60
*
10
,
maxEntries
:
10
,
maxAgeSeconds
:
60
*
60
*
24
*
365
,
// 30 days
},
},
cacheableResponse
:
{
statuses
:
[
0
,
200
]
}
}
}
}],
}],
include
:
[
//
include: [
/
\.
ttf$/
,
//
/\.ttf$/,
],
//
],
skipWaiting
:
true
,
skipWaiting
:
true
,
}
}
},
},
...
...
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