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
bd6b6235
Commit
bd6b6235
authored
Dec 04, 2023
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增是否裁剪内容的提示
parent
68170b9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
index.vue
src/views/Editor/Thumbnails/index.vue
+24
-4
No files found.
src/views/Editor/Thumbnails/index.vue
View file @
bd6b6235
...
...
@@ -65,7 +65,7 @@ import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import
LayoutPool
from
'./LayoutPool.vue'
import
Popover
from
'@/components/Popover.vue'
import
Draggable
from
'vuedraggable'
import
{
ElLoading
}
from
'element-plus'
import
{
ElLoading
,
ElMessageBox
}
from
'element-plus'
import
FileService
from
'@/services/FileService'
import
{
VIEWPORT_SIZE
,
VIEWPORT_VER_SIZE
}
from
'@/configs/canvas'
...
...
@@ -175,6 +175,16 @@ const GetTripFiledData = async () =>{
text
:
'正在渲染团队数据'
,
lock
:
true
})
let
isHideOverflowText
=
false
try
{
await
ElMessageBox
.
confirm
(
'行程数据可能会超出模板预设宽度或高度,是否自动裁剪'
,
'提示'
,{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
closeOnClickModal
:
false
})
isHideOverflowText
=
true
}
catch
(
error
)
{}
let
maxWidth
=
VIEWPORT_SIZE
,
maxHeight
=
VIEWPORT_VER_SIZE
,
viewportRatio
=
slidesStore
.
viewportRatio
if
(
viewportRatio
<
1
){
maxWidth
=
VIEWPORT_VER_SIZE
...
...
@@ -223,11 +233,18 @@ const GetTripFiledData = async () =>{
}
if
(
value
&&
typeof
(
value
)
==
'string'
){
//替换
y
.
content
=
y
.
content
.
replace
(
getHtmlPlainText
(
y
.
content
),
value
)
if
(
isHideOverflowText
){
const
maxLength
=
getHtmlPlainText
(
y
.
content
).
length
const
newValue
=
maxLength
<
value
.
length
?
value
.
substring
(
0
,
maxLength
):
value
console
.
log
(
newValue
,
value
,
maxLength
)
y
.
content
=
y
.
content
.
replace
(
getHtmlPlainText
(
y
.
content
),
newValue
)
}
else
{
y
.
content
=
y
.
content
.
replace
(
getHtmlPlainText
(
y
.
content
),
value
)
}
}
else
if
(
value
&&
Array
.
isArray
(
value
)){
//替换
if
(
y
.
type
==
'image'
&&
value
[
0
]
!=
''
){
console
.
log
(
'下载图片开始'
,
new
Date
().
getSeconds
())
try
{
let
tempSize
=
await
FileService
.
getImageSizeWithoutDownloading
(
value
[
0
])
if
(
tempSize
.
width
>
maxWidth
){
...
...
@@ -324,7 +341,10 @@ const GetTripTemplate = async () =>{
queryObj
.
value
.
TempType
=
dataRes
.
data
.
data
.
TempType
slidesStore
.
updateSlideIndex
(
0
)
datas
.
DataSource
.
pageType
=
newSlides
[
0
].
pageType
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
await
GetTripConfig
()
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
){
await
GetTripConfig
()
return
}
if
(
ConfigId
.
value
==
0
)
return
await
GetTripFiledData
()
}
...
...
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