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
5fe29047
Commit
5fe29047
authored
Jan 05, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化导入跟新模版是 横版竖版,优化首页模版选项
parent
62edb4e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
Index.vue
src/components/PSD/Index.vue
+5
-2
resolve.ts
src/utils/psdParser/resolve.ts
+6
-3
Index.vue
src/views/Market/Index.vue
+4
-3
No files found.
src/components/PSD/Index.vue
View file @
5fe29047
...
@@ -121,11 +121,11 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
...
@@ -121,11 +121,11 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
PSD
.
fromURL
(
url
).
then
(
async
(
psd
:
any
)
=>
{
PSD
.
fromURL
(
url
).
then
(
async
(
psd
:
any
)
=>
{
thumbnails
.
value
=
await
toThumbnails
(
psd
)
thumbnails
.
value
=
await
toThumbnails
(
psd
)
sliders
.
value
=
await
toSlider
(
psd
)
sliders
.
value
=
await
toSlider
(
psd
)
let
DrawingBoardSize
=
await
getDrawingBoardSize
(
psd
)
queryObj
.
value
.
TempType
=
DrawingBoardSize
.
Width
>
DrawingBoardSize
.
Height
?
1
:
2
if
(
searchData
.
value
.
TemplateType
==
2
)
{
if
(
searchData
.
value
.
TemplateType
==
2
)
{
let
DrawingBoardSize
=
await
getDrawingBoardSize
(
psd
)
queryObj
.
value
.
Width
=
DrawingBoardSize
.
Width
queryObj
.
value
.
Width
=
DrawingBoardSize
.
Width
queryObj
.
value
.
Height
=
DrawingBoardSize
.
Height
queryObj
.
value
.
Height
=
DrawingBoardSize
.
Height
queryObj
.
value
.
TempType
=
queryObj
.
value
.
Width
>
queryObj
.
value
.
Height
?
1
:
2
VIEWPORT_SIZE
.
Value
=
queryObj
.
value
.
Height
VIEWPORT_SIZE
.
Value
=
queryObj
.
value
.
Height
VIEWPORT_VER_SIZE
.
Value
=
queryObj
.
value
.
Width
VIEWPORT_VER_SIZE
.
Value
=
queryObj
.
value
.
Width
let
viewportRatio
=
queryObj
.
value
.
Height
/
queryObj
.
value
.
Width
let
viewportRatio
=
queryObj
.
value
.
Height
/
queryObj
.
value
.
Width
...
@@ -133,6 +133,9 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
...
@@ -133,6 +133,9 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
}
else
{
}
else
{
VIEWPORT_SIZE
.
Value
=
1754
VIEWPORT_SIZE
.
Value
=
1754
VIEWPORT_VER_SIZE
.
Value
=
1240
VIEWPORT_VER_SIZE
.
Value
=
1240
let
viewportRatio
=
1.414
if
(
queryObj
.
value
.
TempType
==
1
)
viewportRatio
=
0.7069
useSlidesStore
().
setViewportRatio
(
viewportRatio
)
}
}
fonts
.
value
=
getFonts
(
psd
)
fonts
.
value
=
getFonts
(
psd
)
if
(
fonts
.
value
){
if
(
fonts
.
value
){
...
...
src/utils/psdParser/resolve.ts
View file @
5fe29047
...
@@ -65,21 +65,24 @@ export const ResolvePsdToSliderHandler = async (psd:any) => {
...
@@ -65,21 +65,24 @@ export const ResolvePsdToSliderHandler = async (psd:any) => {
export
const
ResolvePsdDrawingBoardSize
=
async
(
psd
:
any
)
=>
{
export
const
ResolvePsdDrawingBoardSize
=
async
(
psd
:
any
)
=>
{
let
items
:
Array
<
any
>
=
psd
.
tree
().
children
().
filter
((
x
:
any
)
=>
x
.
layer
.
visible
)
let
items
:
Array
<
any
>
=
psd
.
tree
().
children
().
filter
((
x
:
any
)
=>
x
.
layer
.
visible
)
let
DrawingBoardSize
=
{
Width
:
0
,
Height
:
0
}
if
(
items
&&
items
.
length
>
0
){
if
(
items
&&
items
.
length
>
0
){
for
(
let
i
=
0
;
i
<
items
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
items
.
length
;
i
++
)
{
const
x
=
items
[
i
];
const
x
=
items
[
i
];
const
{
_children
}
=
x
const
{
_children
}
=
x
if
(
_children
&&
_children
.
length
>
0
){
if
(
_children
&&
_children
.
length
>
0
){
let
DrawingBoardSize
=
{
DrawingBoardSize
=
{
Width
:
x
.
layer
.
artboard
().
export
().
coords
.
right
-
x
.
layer
.
artboard
().
export
().
coords
.
left
,
Width
:
x
.
layer
.
artboard
().
export
().
coords
.
right
-
x
.
layer
.
artboard
().
export
().
coords
.
left
,
Height
:
x
.
layer
.
artboard
().
export
().
coords
.
bottom
-
x
.
layer
.
artboard
().
export
().
coords
.
top
Height
:
x
.
layer
.
artboard
().
export
().
coords
.
bottom
-
x
.
layer
.
artboard
().
export
().
coords
.
top
}
}
return
DrawingBoardSize
}
}
}
}
}
}
return
DrawingBoardSize
}
}
export
const
ResolveSliderFonts
=
(
psd
:
any
)
=>
{
export
const
ResolveSliderFonts
=
(
psd
:
any
)
=>
{
...
...
src/views/Market/Index.vue
View file @
5fe29047
...
@@ -286,7 +286,7 @@
...
@@ -286,7 +286,7 @@
})
})
let
TemplateType
=
0
let
TemplateType
=
0
if
(
searchData
.
value
.
TemplateType
)
TemplateType
=
searchData
.
value
.
TemplateType
if
(
searchData
.
value
.
TemplateType
)
TemplateType
=
searchData
.
value
.
TemplateType
if
(
model
.
value
==
1
)
TemplateType
=
0
if
(
model
.
value
==
1
)
TemplateType
=
searchData
.
value
.
MarketTemplateType
if
(
ConfigId
.
value
>
0
)
TemplateType
=
1
if
(
ConfigId
.
value
>
0
)
TemplateType
=
1
const
queryObj
=
reactive
({
const
queryObj
=
reactive
({
pageIndex
:
1
,
pageIndex
:
1
,
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
// 删除模版
// 删除模版
const
deleteTemplate
=
(
item
:
any
)
=>
{
const
deleteTemplate
=
(
item
:
any
)
=>
{
ElMessageBox
.
confirm
(
ElMessageBox
.
confirm
(
'此操作将删除该模版,是否确定?'
,
`此操作将删除该
${
item
.
TemplateType
==
2
?
'广告'
:
'模版'
}
,是否确定?`
,
'提示'
,
'提示'
,
{
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
...
@@ -368,7 +368,7 @@
...
@@ -368,7 +368,7 @@
}
else
{
}
else
{
ElMessage
.
warning
({
ElMessage
.
warning
({
showClose
:
true
,
showClose
:
true
,
message
:
'当前模板没有预览信息,请选择其他操作'
,
message
:
`当前
${
item
.
TemplateType
==
2
?
'广告'
:
'模版'
}
没有预览信息,请选择其他操作`
,
})
})
}
}
}
}
...
@@ -429,6 +429,7 @@
...
@@ -429,6 +429,7 @@
//类型切换
//类型切换
const
onTypeChangeHandler
=
(
Type
:
string
)
=>
{
const
onTypeChangeHandler
=
(
Type
:
string
)
=>
{
searchData
.
value
.
MarketTemplateType
=
Type
queryObj
.
TemplateType
=
Type
;
queryObj
.
TemplateType
=
Type
;
queryObj
.
pageIndex
=
1
queryObj
.
pageIndex
=
1
queryTemplateBySearchHandler
();
queryTemplateBySearchHandler
();
...
...
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