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
5e5d4f2a
Commit
5e5d4f2a
authored
Jan 04, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
广告 功能
parent
a3602cc7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
180 additions
and
104 deletions
+180
-104
Index.vue
src/components/PSD/Index.vue
+3
-0
index.vue
src/views/Editor/EditorHeader/index.vue
+15
-13
index.vue
src/views/Editor/Thumbnails/index.vue
+22
-11
SlideDesignPanel.vue
src/views/Editor/Toolbar/SlideDesignPanel.vue
+30
-26
index.vue
src/views/Editor/index.vue
+6
-2
Index.vue
src/views/Market/Index.vue
+57
-35
SellTemplate.vue
src/views/SellTemplate/SellTemplate.vue
+43
-13
index.vue
src/views/components/sellNavs/index.vue
+4
-4
No files found.
src/components/PSD/Index.vue
View file @
5e5d4f2a
...
...
@@ -124,6 +124,9 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
let
DrawingBoardSize
=
await
getDrawingBoardSize
(
psd
)
queryObj
.
value
.
Width
=
DrawingBoardSize
.
Width
queryObj
.
value
.
Height
=
DrawingBoardSize
.
Height
queryObj
.
value
.
TempType
=
queryObj
.
value
.
Width
>
queryObj
.
value
.
Height
?
1
:
2
let
viewportRatio
=
queryObj
.
value
.
Height
/
queryObj
.
value
.
Width
useSlidesStore
().
setViewportRatio
(
viewportRatio
)
}
fonts
.
value
=
getFonts
(
psd
)
if
(
fonts
.
value
){
...
...
src/views/Editor/EditorHeader/index.vue
View file @
5e5d4f2a
...
...
@@ -78,7 +78,7 @@
size=
"small"
:loading=
"datas.loading"
@
click=
"setTemplate"
style=
"color: #ffff;margin-left: 10px;"
>
<
template
v-if=
"userInfo.IsEditTripTemplate==1&&model==1"
>
{{
searchData
.
TemplateType
!=
2
?
'保存模板'
:
'保存
广告'
}}
保存
{{
searchData
.
TemplateType
!=
2
?
'模板'
:
'
广告'
}}
</
template
>
<
template
v-if=
"ConfigId>0&&model!=2"
>
保存行程
...
...
@@ -95,7 +95,7 @@
size=
"small"
:loading=
"datas.loading"
style=
"color: #ffff;"
@
click=
"setTemplate(0)"
>
保存
模板
保存
{{
searchData
.
TemplateType
!=
2
?
'模板'
:
'广告'
}}
</el-button>
</el-dropdown-item>
<el-dropdown-item>
...
...
@@ -103,7 +103,7 @@
size=
"small"
:loading=
"datas.loading"
style=
"color: #ffff;"
@
click=
"setTemplate(1)"
>
另存
模板
另存
{{
searchData
.
TemplateType
!=
2
?
'模板'
:
'广告'
}}
</el-button>
</el-dropdown-item>
</el-dropdown-menu>
...
...
@@ -113,7 +113,7 @@
size=
"small"
:loading=
"datas.loading"
style=
"color: #ffff;margin-left: 10px;"
@
click=
"setTemplate(0)"
>
保存
模板
保存
{{searchData.TemplateType!=2?'模板':'广告'}}
</el-button>
</template>
...
...
@@ -282,7 +282,7 @@ const SetSellTemplate = async (type) => {
if
(
!
TempId
){
return
ElMessage
({
showClose
:
true
,
message
:
'模版不存在, 请重选'
,
message
:
`
${
queryObj
.
value
.
TemplateType
==
2
?
'广告'
:
'模版'
}
不存在, 请重选`
,
type
:
'warning'
,
})
}
...
...
@@ -293,7 +293,13 @@ const SetSellTemplate = async (type) => {
Id
:
Id
,
TempId
:
TempId
,
TempData
:
queryObj
.
value
.
TempData
,
Title
:
queryObj
.
value
.
Title
Title
:
queryObj
.
value
.
Title
,
OWidth
:
0
,
OHeight
:
0
,
}
if
(
queryObj
.
value
.
TemplateType
==
2
){
queryMsg
.
OWidth
=
queryObj
.
value
.
Width
queryMsg
.
OHeight
=
queryObj
.
value
.
Height
}
let
TemplateRes
=
await
ConfigService
.
sellSetTemplate
(
queryMsg
);
if
(
TemplateRes
.
data
.
resultCode
==
1
)
{
...
...
@@ -320,8 +326,6 @@ const SetSellTemplate = async (type) => {
// 新增修改模版
const
SetTripTemplateSlide
=
async
()
=>
{
try
{
console
.
log
(
queryObj
.
value
,
'======'
)
return
let
TemplateRes
=
await
ConfigService
.
SetTripTemplateSlide
(
queryObj
.
value
);
if
(
TemplateRes
.
data
.
resultCode
==
1
)
{
if
(
!
queryObj
.
value
.
TempId
){
...
...
@@ -450,7 +454,6 @@ const SetTripTemplateConfig = async () => {
}
// 保存
const
setTemplate
=
async
(
type
)
=>
{
if
(
searchData
.
value
.
TemplateType
)
queryObj
.
value
.
TemplateType
=
searchData
.
value
.
TemplateType
queryObj
.
value
.
Title
=
title
.
value
datas
.
loading
=
true
if
(
SourceLoading
.
value
)
setNewDatasList
(
datas
.
DataSource
)
...
...
@@ -474,7 +477,7 @@ const setTemplate = async (type) =>{
message
:
'请生成封面图'
,
type
:
'warning'
,
})
}
else
if
(
queryObj
.
value
.
CoverImg
==
''
&&
CoverImg
.
value
.
startsWith
(
"data:image"
)){
}
else
if
(
queryObj
.
value
.
CoverImg
==
''
&&
CoverImg
.
value
&&
CoverImg
.
value
.
startsWith
(
"data:image"
)){
let
name
=
new
Date
().
getTime
()
+
".jpg"
const
file
=
dataURLtoFile
(
CoverImg
.
value
,
name
)
let
url
=
await
AliyunUpload
.
UploadAsync
(
file
,
`Feature/CoverImg_
${
name
}
`
)
...
...
@@ -511,15 +514,14 @@ const setTemplate = async (type) =>{
})
}
}
// console.log(arr,'-------tttt')
queryObj
.
value
.
TempData
=
JSON
.
stringify
(
arr
)
// console.log(JSON.stringify(queryObj.value))
if
(
model
.
value
==
1
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
await
SetTripTemplateSlide
()
}
else
if
(
ConfigId
.
value
&&
model
.
value
!=
2
){
await
SetTripTemplateConfig
()
}
else
if
(
model
.
value
==
2
&&
SalesEditor
.
value
>
0
&&
(
SalesEditor
.
value
==
1
||
SalesEditor
.
value
==
2
)
){
}
else
if
(
model
.
value
==
2
&&
SalesEditor
.
value
>
0
){
await
SetSellTemplate
(
type
)
}
}
...
...
src/views/Editor/Thumbnails/index.vue
View file @
5e5d4f2a
...
...
@@ -6,14 +6,14 @@
v-click-outside=
"() => setThumbnailsFocus(false)"
v-contextmenu=
"contextmenusThumbnails"
>
<div
class=
"add-slide"
>
<div
class=
"btn"
@
click=
"createSlide()"
><IconPlus
class=
"icon"
/>
添加幻灯片
</div>
<Popover
trigger=
"click"
placement=
"bottom-start"
v-model:value=
"presetLayoutPopoverVisible"
center
>
<template
#
content
>
<LayoutPool
@
select=
"slide =>
{ createSlideByTemplate(slide); presetLayoutPopoverVisible = false }" />
</
template
>
<div
class=
"select-btn"
v-if=
"layoutSlides.length>0"
><IconDown
/></div>
</Popover>
<div
class=
"add-slide"
v-if=
"queryObj.TemplateType!=2"
>
<div
class=
"btn"
@
click=
"createSlide()"
><IconPlus
class=
"icon"
/>
添加幻灯片
</div>
<Popover
trigger=
"click"
placement=
"bottom-start"
v-model:value=
"presetLayoutPopoverVisible"
center
>
<template
#
content
>
<LayoutPool
@
select=
"slide =>
{ createSlideByTemplate(slide); presetLayoutPopoverVisible = false }" />
</
template
>
<div
class=
"select-btn"
v-if=
"layoutSlides.length>0"
><IconDown
/></div>
</Popover>
</div>
<Draggable
...
...
@@ -147,7 +147,6 @@ queryObj.value = inject(injectKeyDataSource).queryObj
* 行程保存成功获取行程详情
*/
const
GetTripConfig
=
async
()
=>
{
console
.
log
(
'行程详情--------'
)
try
{
let
queryMsg
=
{
ConfigId
:
ConfigId
.
value
...
...
@@ -390,7 +389,11 @@ const GetTripTemplate = async () =>{
if
(
SalesBack
.
value
==
0
||
(
SalesBack
.
value
==
1
&&
searchData
.
value
.
TempId
)){
let
viewportRatio
=
1.414
if
(
dataRes
.
data
.
data
.
TempType
==
1
)
viewportRatio
=
0.7069
if
(
dataRes
.
data
.
data
.
Width
&&
dataRes
.
data
.
data
.
Height
)
viewportRatio
=
dataRes
.
data
.
data
.
Height
/
dataRes
.
data
.
data
.
Width
if
(
dataRes
.
data
.
data
.
TemplateType
==
2
&&
dataRes
.
data
.
data
.
Width
&&
dataRes
.
data
.
data
.
Height
)
{
viewportRatio
=
dataRes
.
data
.
data
.
Height
/
dataRes
.
data
.
data
.
Width
queryObj
.
value
.
Width
=
dataRes
.
data
.
data
.
Width
queryObj
.
value
.
Height
=
dataRes
.
data
.
data
.
Height
}
slidesStore
.
setViewportRatio
(
viewportRatio
)
let
SlidesData
=
JSON
.
parse
(
dataRes
.
data
.
data
.
TempData
)
...
...
@@ -434,6 +437,7 @@ const GetTripTemplate = async () =>{
queryObj
.
value
.
ColorName
=
dataRes
.
data
.
data
.
ColorName
queryObj
.
value
.
ColorStr
=
dataRes
.
data
.
data
.
ColorStr
queryObj
.
value
.
TempType
=
dataRes
.
data
.
data
.
TempType
queryObj
.
value
.
TemplateType
=
dataRes
.
data
.
data
.
TemplateType
...
...
@@ -466,8 +470,12 @@ const sellGetTripTemplate = async () =>{
let
dataObj
=
dataRes
.
data
.
data
let
viewportRatio
=
1.414
if
(
dataRes
.
data
.
data
.
TempType
==
1
)
viewportRatio
=
0.7069
if
(
dataRes
.
data
.
data
.
Width
&&
dataRes
.
data
.
data
.
Height
)
viewportRatio
=
dataRes
.
data
.
data
.
Height
/
dataRes
.
data
.
data
.
Width
if
(
dataRes
.
data
.
data
.
TemplateType
==
2
&&
dataRes
.
data
.
data
.
Width
&&
dataRes
.
data
.
data
.
Height
)
{
viewportRatio
=
dataRes
.
data
.
data
.
Height
/
dataRes
.
data
.
data
.
Width
}
queryObj
.
value
.
TemplateType
=
dataRes
.
data
.
data
.
TemplateType
slidesStore
.
setViewportRatio
(
viewportRatio
)
if
(
SalesBack
.
value
==
0
)
slidesStore
.
setTitle
(
dataRes
.
data
.
data
.
Title
)
if
(
SalesBack
.
value
==
0
&&
searchData
.
value
.
sellId
){
console
.
log
(
JSON
.
parse
(
dataObj
.
TempData
))
...
...
@@ -721,6 +729,9 @@ else GetTripTemplate()
font-size
:
14px
;
}
}
.add-slide.borderBottom0
{
border-bottom
:
0
;
}
.thumbnail-list
{
padding
:
5px
0
;
flex
:
1
;
...
...
src/views/Editor/Toolbar/SlideDesignPanel.vue
View file @
5e5d4f2a
...
...
@@ -99,32 +99,34 @@
<div
class=
"row"
>
<Button
style=
"flex: 1;"
@
click=
"applyBackgroundAllSlide()"
>
应用背景到全部
</Button>
</div>
<Divider
/>
<
template
v-if=
"queryObj.TemplateType!=2"
>
<Divider
/>
<div
class=
"row"
>
<div
style=
"width: 40%;"
>
画布尺寸:
</div>
<!-- <Select
style="width: 60%;"
:value="viewportRatio"
@update:value="value => updateViewportRatio(value as number)"
:options="[
{ label: '宽屏 16 : 9', value: 0.5625 },
{ label: '宽屏 16 : 10', value: 0.625 },
{ label: '标准 4 : 3', value: 0.75 },
{ label: '纸张 A3 / A4', value: 0.70710678 },
]"
/> -->
<Select
style=
"width: 60%;"
:value=
"viewportRatio"
@
update:value=
"value => updateViewportRatio(value as number)"
:options=
"[
{ label: '横屏', value: 0.7069 },
{ label: '竖屏', value: 1.414 },
]"
/>
</div>
<div
class=
"row"
>
<div
style=
"width: 40%;"
>
画布尺寸:
</div>
<!--
<Select
style=
"width: 60%;"
:value=
"viewportRatio"
@
update:value=
"value => updateViewportRatio(value as number)"
:options=
"[
{ label: '宽屏 16 : 9', value: 0.5625 },
{ label: '宽屏 16 : 10', value: 0.625 },
{ label: '标准 4 : 3', value: 0.75 },
{ label: '纸张 A3 / A4', value: 0.70710678 },
]"
/> -->
<Select
style=
"width: 60%;"
:value=
"viewportRatio"
@
update:value=
"value => updateViewportRatio(value as number)"
:options=
"[
{ label: '横屏', value: 0.7069 },
{ label: '竖屏', value: 1.414 },
]"
/>
</div>
</
template
>
<Divider
/>
...
...
@@ -309,7 +311,7 @@ import { WEB_FONTS } from '@/configs/font'
import
useHistorySnapshot
from
'@/hooks/useHistorySnapshot'
import
useSlideTheme
from
'@/hooks/useSlideTheme'
import
{
getImageDataURL
}
from
'@/utils/image'
import
{
injectKeyDataSource
}
from
'@/types/injectKey'
import
{
injectKeyDataSource
,
injectKeyTemplate
}
from
'@/types/injectKey'
import
ColorButton
from
'./common/ColorButton.vue'
import
FileInput
from
'@/components/FileInput.vue'
...
...
@@ -329,6 +331,8 @@ const datas = reactive({
const
queryObj
=
ref
({}
as
any
)
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
queryObj
.
value
=
inject
(
injectKeyDataSource
).
queryObj
const
searchData
=
ref
({}
as
any
)
searchData
.
value
=
inject
(
injectKeyTemplate
)
const
slidesStore
=
useSlidesStore
()
const
{
availableFonts
}
=
storeToRefs
(
useMainStore
())
const
{
slides
,
currentSlide
,
viewportRatio
,
theme
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
...
...
src/views/Editor/index.vue
View file @
5e5d4f2a
...
...
@@ -87,8 +87,11 @@ searchData.value = inject(injectKeyTemplate)
let
TempIds
=
0
let
TemplatesType
=
0
if
(
searchData
.
value
.
TempId
)
TempIds
=
searchData
.
value
.
TempId
else
if
(
TempId
.
value
)
TempIds
=
TempId
.
value
if
(
searchData
.
value
.
TemplateType
)
TemplatesType
=
searchData
.
value
.
TemplateType
if
(
searchData
.
value
.
TemplateType
!=
2
&&!
searchData
.
value
.
TempId
)
useSlidesStore
().
setViewportRatio
(
1.414
)
const
refThumbnails
=
ref
(
null
)
const
param
=
ref
(
""
)
param
.
value
=
query
()
...
...
@@ -113,7 +116,7 @@ const datas = reactive({
ColorStr
:
null
,
//颜色值 是 [string]
TempType
:
1
,
// 版面类型(1-横版,2-竖版)
TagJsonStr
:
''
,
// 标签
TemplateType
:
0
,
TemplateType
:
TemplatesType
,
// 1行程模版 2广告模版
Width
:
0
,
Height
:
0
,
}
...
...
@@ -162,7 +165,8 @@ const GetTripFiled = async () =>{
console
.
log
(
"TemplateGetTripFiled"
,
error
);
}
}
GetTripFiled
()
if
(
searchData
.
value
.
TemplateType
!=
2
)
GetTripFiled
()
const
mainStore
=
useMainStore
()
const
{
dialogForExport
,
showSelectPanel
,
showSearchPanel
}
=
storeToRefs
(
mainStore
)
...
...
src/views/Market/Index.vue
View file @
5e5d4f2a
This diff is collapsed.
Click to expand it.
src/views/SellTemplate/SellTemplate.vue
View file @
5e5d4f2a
...
...
@@ -2,19 +2,24 @@
<div
ref=
"SellTemplateRef"
>
<el-row
justify=
"space-between"
class=
"items-center"
>
<el-col
:span=
"6"
class=
"row items-center"
>
<!--
<el-button-group
class=
"ml-4"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"querySearchHandler"
>
模版
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"querySearchHandler"
>
广告
</el-button>
</el-button-group>
-->
<el-button-group
class=
"ml-4"
>
<template
v-for=
"item in TemplateTypeList"
>
<el-button
type=
"primary"
:plain=
"queryObj.TemplateType==item.Id?false:true"
size=
"small"
@
click=
"queryObj.TemplateType=item.Id,querySearchHandler()"
>
{{
item
.
Name
}}
</el-button>
</
template
>
</el-button-group>
</el-col>
<el-col
:span=
"
8
"
>
<el-col
:span=
"
6
"
>
<el-input
v-model=
"queryObj.Title"
placeholder=
"输入关键字快速查找"
class=
"input-with-select"
>
<
template
#
append
>
<el-button
type=
"primary"
@
click=
"querySearchHandler"
>
搜索
</el-button>
</
template
>
</el-input>
</el-col>
<el-col
:span=
"
4
"
class=
"row flex-end"
>
<el-col
:span=
"
6
"
class=
"row flex-end"
>
<sellNavs
/>
</el-col>
</el-row>
...
...
@@ -28,7 +33,10 @@
</div>
<div
class=
"row flex-between nowrap sellList pointer"
v-for=
"(item,index) in dataList"
>
<div>
<span
class=
"iconfont icon-pdf sellPdf"
></span>
<el-tag
class=
"mx-1 q-mr-md"
effect=
"dark"
v-if=
"item.TemplateType==2"
size=
"small"
>
广告
</el-tag>
<span
v-else
class=
"iconfont icon-pdf sellPdf"
></span>
<span>
{{item.Title}}
</span>
</div>
<div>
...
...
@@ -92,7 +100,7 @@
import
{
ElLoading
,
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
import
{
useSellTemplateStore
,
useScreenStore
}
from
'@/store'
import
{
useSellTemplateStore
,
useScreenStore
,
useSlidesStore
}
from
'@/store'
import
ConfigService
from
'@/services/ConfigService'
import
{
query
}
from
'@/utils/common'
...
...
@@ -112,9 +120,15 @@
pageIndex
:
1
,
pageSize
:
20
,
pageCount
:
0
,
//总页数
TemplateType
:
0
,
})
searchData
.
value
.
sellId
=
0
const
dataList
=
ref
([]
as
Array
<
any
>
);
const
TemplateTypeList
=
ref
([
{
Name
:
'不限'
,
Id
:
0
},
{
Name
:
'模版'
,
Id
:
1
},
{
Name
:
'广告'
,
Id
:
2
},
]);
const
loading
=
ref
(
false
as
any
)
const
SellTemplateRef
=
ref
<
any
>
()
const
datas
=
reactive
({
...
...
@@ -122,7 +136,7 @@
activeId
:
1
,
}
})
const
DeleteTemplate
=
async
(
Id
:
Number
)
=>
{
const
DeleteTemplate
=
async
(
item
:
any
)
=>
{
ElMessageBox
.
confirm
(
'此操作将删除该模版,是否确定?'
,
'提示'
,
...
...
@@ -134,7 +148,7 @@
).
then
(
async
()
=>
{
try
{
let
queryMsg
=
{
Id
:
Id
Id
:
item
.
Id
}
deleteLoading
.
value
=
ElLoading
.
service
({
lock
:
true
,
...
...
@@ -145,14 +159,14 @@
queryObj
.
pageIndex
=
1
ElMessage
({
showClose
:
true
,
message
:
'删除模版成功'
,
message
:
`删除
${
item
.
TemplateType
==
2
?
'广告'
:
'模版'
}
成功`
,
type
:
'success'
,
})
querySearchHandler
()
}
else
{
ElMessage
({
showClose
:
true
,
message
:
'删除模版失败'
,
message
:
`删除
${
item
.
TemplateType
==
2
?
'广告'
:
'模版'
}
失败`
,
type
:
'warning'
,
})
}
...
...
@@ -164,10 +178,23 @@
}
const
editDelete
=
async
(
row
:
any
,
type
:
Number
)
=>
{
if
(
type
==
1
){
DeleteTemplate
(
row
.
Id
)
DeleteTemplate
(
row
)
}
else
{
let
list
=
[
{
id
:
'test-slide-1'
,
pageType
:
0
,
elements
:
[],
background
:
{
type
:
'solid'
,
color
:
'#ffffff'
,
},
}
]
useSlidesStore
().
setSlides
(
list
)
searchData
.
value
.
sellId
=
row
.
Id
searchData
.
value
.
sellTempId
=
row
.
TempId
searchData
.
value
.
TemplateType
=
row
.
TemplateType
SalesEditorStore
.
setSalesEditor
(
2
)
marketStore
.
setMarket
(
false
)
}
...
...
@@ -226,6 +253,9 @@
margin-right
:
15px
;
color
:
$themeHoverColor
;
}
.sellPdf.sellAd
{
color
:
$textColor
;
}
.sellHeader
{
font-size
:
14px
;
padding
:
10px
8px
10px
8px
;
...
...
src/views/components/sellNavs/index.vue
View file @
5e5d4f2a
...
...
@@ -9,18 +9,18 @@
<el-button
type=
"primary"
size=
"small"
:loading=
"datas.loading"
style=
"color: #ffff;"
@
click=
"sellAdd(1)"
>
@
click=
"se
archData.TemplateType=1,se
llAdd(1)"
>
新建模版
</el-button>
</el-dropdown-item>
<
!--
<el-dropdown-item
>
<
el-dropdown-item
v-if=
"true"
>
<el-button
type=
"primary"
size=
"small"
:loading=
"datas.loading"
style=
"color: #ffff;"
@
click=
"se
tTemplate
(3)"
>
@
click=
"se
archData.TemplateType=2,sellAdd
(3)"
>
新建广告
</el-button>
</el-dropdown-item>
-->
</el-dropdown-item>
</el-dropdown-menu>
</
template
>
</el-dropdown>
...
...
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