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
d884d74a
Commit
d884d74a
authored
May 30, 2024
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/pptist
parents
a292b2a3
59c6d69c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
217 additions
and
108 deletions
+217
-108
temDetails.vue
src/components/home/temDetails.vue
+8
-2
slides.ts
src/store/slides.ts
+15
-0
Editor.vue
src/views/Editor/Editor.vue
+2
-0
index.vue
src/views/Editor/EditorHeader/index.vue
+10
-31
index.vue
src/views/Editor/Thumbnails/index.vue
+57
-37
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+28
-4
Index.vue
src/views/Market/Index.vue
+6
-2
PreviewCover.vue
src/views/Preview/PreviewCover.vue
+10
-4
Workspace.vue
src/views/SellTemplate/Workspace.vue
+6
-2
Index.vue
src/views/TemplateCenter/Index.vue
+74
-25
colour.vue
src/views/TemplateCenter/colour.vue
+1
-1
No files found.
src/components/home/temDetails.vue
View file @
d884d74a
...
...
@@ -72,7 +72,7 @@ import { reactive, ref, inject, onMounted, watch} from "vue";
import
LineService
from
'@/services/LineService'
import
ConfigService
from
'@/services/ConfigService'
import
{
useUserStore
}
from
"@/store/user"
;
import
{
useSellTemplateStore
}
from
'@/store'
import
{
useSellTemplateStore
,
useSlidesStore
}
from
'@/store'
import
{
useScreenStore
}
from
"@/store/screen"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
...
...
@@ -86,6 +86,8 @@ import foote from '@/components/footer/index.vue';
import
{
noDataImg
}
from
"@/utils/common"
;
const
slidesStore
=
useSlidesStore
()
const
{
userInfo
}
=
storeToRefs
(
useUserStore
())
...
...
@@ -204,10 +206,14 @@ const getTemplate = async (item:any) => {
* 页面跳转
*/
const
goToTemplate
=
(
item
:
any
)
=>
{
if
((
searchData
.
value
.
TempId2
&&
searchData
.
value
.
TempId2
!=
item
.
TempId
)
||!
searchData
.
value
.
TempId2
)
slidesStore
.
ClearSlides
()
let
url
=
''
if
(
model
.
value
==
2
)
url
=
createSaleCreateLink
(
item
.
TempId
,
item
.
TemplateType
)
else
if
(
model
.
value
==
0
&&
router
.
currentRoute
.
value
.
params
.
configId
)
url
=
createOpEditorLink
(
parseInt
(
router
.
currentRoute
.
value
.
params
.
configId
.
toString
()),
item
.
TempId
)
else
if
(
model
.
value
==
1
)
url
=
managerTemplateLink
(
item
.
TempId
,
item
.
TemplateType
)
else
if
(
model
.
value
==
1
)
{
searchData
.
value
.
currentMenu
=
null
url
=
managerTemplateLink
(
item
.
TempId
,
item
.
TemplateType
)
}
if
(
url
!=
''
)
{
router
.
push
({
path
:
url
...
...
src/store/slides.ts
View file @
d884d74a
...
...
@@ -241,5 +241,20 @@ export const useSlidesStore = defineStore('slides', {
})
this
.
slides
[
slideIndex
].
elements
=
(
elements
as
PPTElement
[])
},
ClearSlides
(){
this
.
slides
=
[
{
id
:
'test-slide-1'
,
pageType
:
1
,
elements
:
[],
background
:
{
type
:
'solid'
,
color
:
'#ffffff'
,
},
}
]
this
.
thumbnails
=
[]
this
.
layoutSlides
=
[]
}
},
})
\ No newline at end of file
src/views/Editor/Editor.vue
View file @
d884d74a
...
...
@@ -91,6 +91,7 @@ const initOpCreate = ()=>{
const
initManagerTemplate
=
()
=>
{
searchData
.
value
.
sellId
=
0
searchData
.
value
.
sellTempId
=
0
searchData
.
value
.
isTeamManage
=
true
useScreenStore
().
setTempId
(
parseInt
(
params
.
tid
.
toString
()))
useScreenStore
().
setModel
(
1
)
useScreenStore
().
setConfigId
(
0
)
...
...
@@ -112,6 +113,7 @@ const initCreateTemplate = ()=>{
const
init
=
()
=>
{
//销售修改行程
searchData
.
value
.
isTeamManage
=
false
if
(
currentRoute
.
path
.
includes
(
'/editor/'
)
&&
params
.
id
)
initSellEditor
()
else
if
(
currentRoute
.
path
.
includes
(
'/editor/'
))
initSellCreate
()
else
if
(
currentRoute
.
path
.
includes
(
'/team_editor/'
)
&&
params
.
tid
)
initOpCreate
()
...
...
src/views/Editor/EditorHeader/index.vue
View file @
d884d74a
...
...
@@ -223,13 +223,8 @@ const psdVisibleStatus = ref(false)
const
{
market
,
model
,
ConfigId
,
CoverImg
,
dataLoading
,
TempId
,
SourceLoading
}
=
storeToRefs
(
useScreenStore
())
// 返回到首页 type 1 模版列表页 0 销售在线模版页
const
goBack
=
(
type
:
any
)
=>
{
console
.
log
(
model
.
value
,
searchData
.
value
.
currentMenu
)
mainBackVisible
.
value
=
false
// if(model.value&&model.value!=2) {
// setTimeout(()=>{
// setNewDatas(type,1)
// },200)
// return
// }
ElMessageBox
.
confirm
(
'退出此页面将清空当前数据,请谨慎操作?'
,
'提示'
,
...
...
@@ -242,17 +237,16 @@ const goBack = (type:any) =>{
setNewDatas
(
type
,
0
)
let
path
=
'/'
const
t
=
useSlidesStore
().
viewportRatio
<
0
?
1
:
2
// if(type!=0){
// if(model.value==2) path = `/market/create/${searchData.value.TemplateType==1?'trip':'ad'}`
// else if(model.value==0) path = `/market/op/${ConfigId.value}/$-{t}`
// else if(model.value==1) path = `/market`
// }
// console.log(path)
// router.push({path})
//console.log(model.value,)
if
(
model
.
value
==
0
)
{
path
=
`/market/op/
${
ConfigId
.
value
}
/
${
t
}
`
router
.
push
({
path
})
}
else
if
(
model
.
value
==
2
&&
searchData
.
value
.
currentMenu
>=
0
){
if
(
type
)
path
=
`/market/create`
else
{
path
=
`/space/
${
searchData
.
value
.
currentMenu
}
`
searchData
.
value
.
currentMenu
=
null
}
router
.
push
({
path
})
}
else
window
.
history
.
back
()
...
...
@@ -260,17 +254,6 @@ const goBack = (type:any) =>{
}
// 返回是否清空数据
const
setNewDatas
=
(
type
,
i
)
=>
{
let
list
=
[
{
id
:
'test-slide-1'
,
pageType
:
1
,
elements
:
[],
background
:
{
type
:
'solid'
,
color
:
'#ffffff'
,
},
}
]
if
(
type
)
{
marketStore
.
setMarket
(
true
)
if
(
model
.
value
==
2
)
{
...
...
@@ -281,17 +264,13 @@ const setNewDatas = (type,i) => {
searchData
.
value
.
TempId2
=
0
searchData
.
value
.
sellId
=
0
searchData
.
value
.
sellTempId
=
0
searchData
.
value
.
TemplateType
=
0
SalesBackStore
.
setSalesBack
(
0
)
SalesEditorStore
.
setSalesEditor
(
0
)
}
searchData
.
value
.
TempId
=
0
// i 1模版权限 0无模版权限
if
(
SalesBack
.
value
==
0
&&
model
.
value
!=
2
){
slidesStore
.
setSlides
(
list
)
if
(
!
i
)
slidesStore
.
setThumbnails
([])
layoutsStore
.
setLayouts
([])
CoverImgStore
.
setCoverImg
(
null
)
}
CoverImgStore
.
setCoverImg
(
null
)
}
// 导入PSD
const
UploadPsdHandler
=
()
=>
{
...
...
src/views/Editor/Thumbnails/index.vue
View file @
d884d74a
...
...
@@ -45,14 +45,14 @@
<div
class=
"page-number"
>
幻灯片 {{slideIndex + 1}} / {{slides.length}}
</div>
</div>
<
!-- <
div style="position: fixed;left: 200px;top: -100px;opacity: 0;">
<div
style=
"position: fixed;left: 200px;top: -100px;opacity: 0;"
>
<canvas
style=
"display: none"
id=
"canvas"
></canvas>
<div
id=
"extract-color-id"
class=
"extract-color"
style=
"display: flex;padding: 0 20px; justify-content:end;"
>
</div>
</div>
-->
</div>
</template>
<
script
lang=
"ts"
setup
>
...
...
@@ -75,7 +75,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
,
ElMessageBox
}
from
'element-plus'
import
{
ElLoading
,
ElMessageBox
,
ElMessage
}
from
'element-plus'
import
FileService
from
'@/services/FileService'
import
{
Slide
}
from
'@/types/slides'
import
{
uniqueId
}
from
'lodash'
...
...
@@ -396,6 +396,10 @@ const copySlidHandler = (slideIndex:number)=>{
// 获取行程模版数据
const
GetTripTemplate
=
async
()
=>
{
const
loadingObj
=
ElLoading
.
service
({
text
:
'正在渲染模版数据'
,
lock
:
true
})
// console.log(searchData.value.TempId,searchData.value.TempId2,TempId.value,searchData.value.sellTempId)
if
(
!
searchData
.
value
.
TempId
&&!
searchData
.
value
.
TempId2
&&!
TempId
.
value
&&!
searchData
.
value
.
sellTempId
&&
searchData
.
value
.
ViewSlideshow
)
{
let
list
=
[
...
...
@@ -412,6 +416,7 @@ const GetTripTemplate = async () =>{
let
Title
=
'模版名称'
if
(
searchData
.
value
.
TemplateType
==
2
)
Title
=
'广告名称'
slidesStore
.
setTitle
(
Title
)
loadingObj
.
close
()
return
slidesStore
.
setSlides
(
list
)
}
try
{
...
...
@@ -424,17 +429,17 @@ const GetTripTemplate = async () =>{
else
if
(
TempId
.
value
)
queryMsg
.
TempId
=
TempId
.
value
let
dataRes
=
await
ConfigService
.
GetTripTemplateSlide
(
queryMsg
);
if
(
dataRes
.
data
.
resultCode
==
1
)
{
//
colorList.value = []
colorList
.
value
=
[]
tempDatas
.
value
=
dataRes
.
data
.
data
//
for(let i=0;i
<
tempDatas
.
value
.
PageImageList
.
length
;
i
++
){
//
const img = new Image();
//
img.src = `${tempDatas.value.PageImageList[i]}`;
//
img.crossOrigin = 'anonymous';
//
img.onload = () => {
//
themeColor(1, img, 20, SetColor);
//
};
//
}
for
(
let
i
=
0
;
i
<
tempDatas
.
value
.
PageImageList
.
length
;
i
++
){
const
img
=
new
Image
();
img
.
src
=
`
${
tempDatas
.
value
.
PageImageList
[
i
]}
`
;
img
.
crossOrigin
=
'anonymous'
;
img
.
onload
=
()
=>
{
themeColor
(
1
,
img
,
20
,
SetColor
);
};
}
if
(
SalesBack
.
value
==
0
||
(
SalesBack
.
value
==
1
&&
searchData
.
value
.
TempId
)){
let
viewportRatios
=
0
if
(
dataRes
.
data
.
data
.
TemplateType
!=
2
)
{
...
...
@@ -506,13 +511,17 @@ const GetTripTemplate = async () =>{
VIEWPORT_SIZE
.
Value
=
1754
VIEWPORT_VER_SIZE
.
Value
=
1240
}
setTimeout
(()
=>
{
loadingObj
.
close
()
},
300
)
if
(
ConfigId
.
value
==
0
)
return
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
await
GetTripConfig
()
if
(
model
.
value
!=
3
)
await
GetTripFiledData
()
}
else
{
loadingObj
.
close
()
}
}
catch
(
error
)
{
loadingObj
.
close
()
}
}
...
...
@@ -525,28 +534,32 @@ const generateUniqueId = () => {
// 获取是否深色
const
getColorShade
=
async
(
newSlides
:
any
)
=>
{
let
dark
=
false
let
day
=
0
// 根据集团渲染logo
// if(tempDatas.value.AuthType
<=
1
){
// for(let j=0;j
<
colorList
.
value
.
length
;
j
++
){
// if (getRgbLevel(colorList.value[j].Color) > 50) dark = true
// }
// for(let i=0;i
<
newSlides
.
length
;
i
++
){
// if(i>colorList.value.length-2) dark = false
// let x = newSlides[i]
// let eles = x.elements.filter(y=>y.layerName && y.layerName.indexOf('logo')!=-1)
// let newElementsImg = await ResolveTripLogoHandler(eles,i,dark)
// let newElements = []
// x.elements.forEach(y=>{
// if(newElementsImg?.elements){
// newElementsImg?.elements.forEach(z=>{
// if(y.id==z.id) y = JSON.parse(JSON.stringify(z))
// })
// }
// newElements.push(y)
// })
// x.elements = newElements
// }
// }
if
(
tempDatas
.
value
.
GId
!=
userInfo
.
value
.
gid
&&!
searchData
.
value
.
isTeamManage
){
for
(
let
j
=
0
;
j
<
colorList
.
value
.
length
;
j
++
){
if
(
getRgbLevel
(
colorList
.
value
[
j
].
Color
)
>
50
)
dark
=
true
}
for
(
let
i
=
0
;
i
<
newSlides
.
length
;
i
++
){
if
(
i
>
colorList
.
value
.
length
-
2
)
{
dark
=
false
day
=
1
}
let
x
=
newSlides
[
i
]
let
eles
=
x
.
elements
.
filter
(
y
=>
y
.
layerName
&&
y
.
layerName
.
indexOf
(
'logo'
)
!=-
1
)
let
newElementsImg
=
await
ResolveTripLogoHandler
(
eles
,
i
,
dark
,
day
)
let
newElements
=
[]
x
.
elements
.
forEach
(
y
=>
{
if
(
newElementsImg
?.
elements
){
newElementsImg
?.
elements
.
forEach
(
z
=>
{
if
(
y
.
id
==
z
.
id
)
y
=
JSON
.
parse
(
JSON
.
stringify
(
z
))
})
}
newElements
.
push
(
y
)
})
x
.
elements
=
newElements
}
}
layoutsStore
.
setLayouts
(
JSON
.
parse
(
JSON
.
stringify
(
newSlides
)))
if
(
searchData
.
value
.
sellId
&&!
searchData
.
value
.
TempId
)
return
slidesStore
.
setSlides
(
newSlides
)
...
...
@@ -558,7 +571,7 @@ const getColorShade = async (newSlides:any) => {
}
// 替换logo
const
ResolveTripLogoHandler
=
async
(
items
:
any
,
slideIndex
:
number
,
dark
:
false
)
=>
{
const
ResolveTripLogoHandler
=
async
(
items
:
any
,
slideIndex
:
number
,
dark
:
false
,
day
:
Number
)
=>
{
let
elements
=
[]
let
tempNewSlide
:
any
=
null
let
templateObj
=
JSON
.
parse
(
JSON
.
stringify
(
items
))
...
...
@@ -572,7 +585,9 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false) =
// if(Colors[1]||scale==6) templateObj[i].filters.invert = '20%'
if
(
scale
==
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
0
]:
acquiesceLogo
.
value
[
3
]
if
(
scale
<
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
1
]:
acquiesceLogo
.
value
[
4
]
if
(
scale
>
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
6
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
3
&&!
day
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
3
&&
day
)
url
=
acquiesceLogo
.
value
[
2
]
let
newTempSize
=
await
FileService
.
getImageSizeWithoutDownloading
(
url
)
let
width
=
0
let
height
=
0
...
...
@@ -684,7 +699,11 @@ const sellGetTripTemplate = async () =>{
slidesStore
.
setSlides
(
newSlides
)
}
}
}
else
ElMessage
({
showClose
:
true
,
message
:
dataRes
.
data
.
message
,
type
:
'warning'
,
})
}
catch
(
error
)
{
}
...
...
@@ -933,6 +952,7 @@ if(!query().ViewSlideshow) GetTripTemplate()
padding
:
5px
0
;
flex
:
1
;
overflow
:
auto
;
width
:
164px
;
}
.thumbnail-item
{
display
:
flex
;
...
...
src/views/Editor/Toolbar/ElementTemplateData.vue
View file @
d884d74a
...
...
@@ -281,6 +281,11 @@
{
Type
:
2
,
Name
:
'私有'
,}
])
const
ParentObj
=
reactive
({
DictKey
:
'Trip_Template_Color'
,
Name
:
''
})
watch
(()
=>
datas
.
DataSource
.
pageType
,
(
n
,
o
)
=>
{
})
...
...
@@ -469,7 +474,7 @@
}
}
const
getColor
=
async
(
type
:
Number
)
=>
{
if
(
type
==
1
&&
!
queryColor
.
value
.
Code
)
{
if
(
type
==
1
&&
(
!
queryColor
.
value
.
Code
||
queryColor
.
value
.
Code
==
''
)
)
{
queryObj
.
value
.
ColorName
=
''
queryObj
.
value
.
ColorStr
=
''
let
Colors
=
ColorList
.
value
.
filter
(
x
=>
x
.
ID
==
queryColor
.
value
.
Code
)
...
...
@@ -479,14 +484,33 @@
if
(
response
.
data
.
resultCode
==
1
)
{
if
(
type
==
0
)
{
ColorList
.
value
=
response
.
data
.
data
let
Colors
=
ColorList
.
value
.
filter
(
x
=>
x
.
Content
==
queryColor
.
value
.
SubColor
)
if
(
Colors
&&
Colors
.
length
>
0
)
queryColor
.
value
.
Code
=
Colors
[
0
].
ID
if
(
!
queryColor
.
value
.
SubColor
){
ParentObj
.
Name
=
queryObj
.
value
.
ColorStr
await
querySearchHandler
()
}
else
{
let
Colors
=
ColorList
.
value
.
filter
(
x
=>
x
.
Content
==
queryColor
.
value
.
SubColor
)
if
(
Colors
&&
Colors
.
length
>
0
)
queryColor
.
value
.
Code
=
Colors
[
0
].
ID
}
if
(
!
queryColor
.
value
.
Code
)
datas
.
ColorList
=
response
.
data
.
data
}
else
datas
.
ColorList
=
response
.
data
.
data
;
}
}
// 根据子颜色获取父级code
const
querySearchHandler
=
async
()
=>
{
try
{
let
response
=
await
ConfigService
.
GetTemplateQueryAsync
(
ParentObj
)
if
(
response
.
data
.
resultCode
==
1
&&
response
.
data
.
data
.
ColorList
.
length
>
0
)
{
queryColor
.
value
.
Code
=
response
.
data
.
data
.
ColorList
[
0
].
ID
queryColor
.
value
.
SubColor
=
response
.
data
.
data
.
ColorList
[
0
].
ColorValue
getColor
(
1
)
}
}
catch
(
error
)
{
}
}
const
GetTemplateColors
=
async
()
=>
{
let
pageRes
=
await
LineService
.
GetTemplateConfigDataList
(
queryColors
.
value
);
let
colorArr
=
pageRes
.
data
.
data
...
...
src/views/Market/Index.vue
View file @
d884d74a
...
...
@@ -15,7 +15,7 @@
</div>
</
template
>
</el-input>
</div>
</div>
<UserCard></UserCard>
</div>
</div>
...
...
@@ -215,7 +215,7 @@ import { reactive, ref, inject, onMounted, watch} from "vue";
import
LineService
from
'@/services/LineService'
import
ConfigService
from
'@/services/ConfigService'
import
{
useUserStore
}
from
"@/store/user"
;
import
{
useSellTemplateStore
}
from
'@/store'
import
{
useSellTemplateStore
,
useSlidesStore
}
from
'@/store'
import
{
useScreenStore
}
from
"@/store/screen"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
...
...
@@ -231,6 +231,8 @@ import vipFooter from "@/components/home/vipFooter.vue";
import
{
noDataImg
}
from
"@/utils/common"
;
const
slidesStore
=
useSlidesStore
()
const
{
userInfo
}
=
storeToRefs
(
useUserStore
())
...
...
@@ -275,6 +277,7 @@ if(router.currentRoute.value.path.includes('create')) {
model
.
value
=
2
if
(
router
.
currentRoute
.
value
.
fullPath
.
indexOf
(
'/ad'
)
!=-
1
)
TemplateType
=
2
else
if
(
router
.
currentRoute
.
value
.
fullPath
.
indexOf
(
'/trip'
)
!=-
1
)
TemplateType
=
1
else
if
(
searchData
.
value
.
TemplateType
)
TemplateType
=
searchData
.
value
.
TemplateType
}
else
if
(
router
.
currentRoute
.
value
.
path
.
includes
(
'op'
))
{
model
.
value
=
0
}
...
...
@@ -375,6 +378,7 @@ const getTemplate = (item:any) => {
* 页面跳转
*/
const
goToTemplate
=
(
item
:
any
)
=>
{
if
((
searchData
.
value
.
TempId2
&&
searchData
.
value
.
TempId2
!=
item
.
TempId
)
||!
searchData
.
value
.
TempId2
)
slidesStore
.
ClearSlides
()
let
url
=
''
if
(
model
.
value
==
2
)
url
=
createSaleCreateLink
(
item
.
TempId
,
item
.
TemplateType
)
else
if
(
model
.
value
==
0
&&
router
.
currentRoute
.
value
.
params
.
configId
)
url
=
createOpEditorLink
(
parseInt
(
router
.
currentRoute
.
value
.
params
.
configId
.
toString
()),
item
.
TempId
)
...
...
src/views/Preview/PreviewCover.vue
View file @
d884d74a
...
...
@@ -127,16 +127,20 @@ const loadSliders = async ()=>{
// 获取是否深色
const
getColorShade
=
async
(
newSlides
:
any
)
=>
{
let
dark
=
false
let
day
=
0
// 根据集团渲染logo
if
(
tempDatas
.
value
.
AuthType
<=
1
){
for
(
let
j
=
0
;
j
<
colorList
.
value
.
length
;
j
++
){
if
(
getRgbLevel
(
colorList
.
value
[
j
].
Color
)
>
50
)
dark
=
true
}
for
(
let
i
=
0
;
i
<
newSlides
.
length
;
i
++
){
if
(
i
>
colorList
.
value
.
length
-
2
)
dark
=
false
if
(
i
>
colorList
.
value
.
length
-
2
)
{
dark
=
false
day
=
1
}
let
x
=
newSlides
[
i
]
let
eles
=
x
.
elements
.
filter
(
y
=>
y
.
layerName
&&
y
.
layerName
.
indexOf
(
'logo'
)
!=-
1
)
let
newElementsImg
=
await
ResolveTripLogoHandler
(
eles
,
i
,
dark
)
let
newElementsImg
=
await
ResolveTripLogoHandler
(
eles
,
i
,
dark
,
day
)
let
newElements
=
[]
x
.
elements
.
forEach
(
y
=>
{
if
(
newElementsImg
?.
elements
){
...
...
@@ -154,7 +158,7 @@ const getColorShade = async (newSlides:any) => {
}
const
ResolveTripLogoHandler
=
async
(
items
:
any
,
slideIndex
:
number
,
dark
:
false
)
=>
{
const
ResolveTripLogoHandler
=
async
(
items
:
any
,
slideIndex
:
number
,
dark
:
false
,
day
:
Number
)
=>
{
let
elements
=
[]
let
tempNewSlide
:
any
=
null
let
templateObj
=
JSON
.
parse
(
JSON
.
stringify
(
items
))
...
...
@@ -168,7 +172,9 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false) =
// if(Colors[1]||scale==6) templateObj[i].filters.invert = '20%'
if
(
scale
==
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
0
]:
acquiesceLogo
.
value
[
3
]
if
(
scale
<
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
1
]:
acquiesceLogo
.
value
[
4
]
if
(
scale
>
1
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
6
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
3
&&!
day
)
url
=
dark
==
true
?
acquiesceLogo
.
value
[
2
]:
acquiesceLogo
.
value
[
5
]
if
(
scale
==
3
&&
day
)
url
=
acquiesceLogo
.
value
[
2
]
let
newTempSize
=
await
FileService
.
getImageSizeWithoutDownloading
(
url
)
let
width
=
0
let
height
=
0
...
...
src/views/SellTemplate/Workspace.vue
View file @
d884d74a
...
...
@@ -42,7 +42,7 @@
<
script
setup
lang=
"ts"
>
import
{
useUserStore
}
from
'@/store/user'
;
import
{
storeToRefs
}
from
'pinia'
;
import
{
ref
,
watch
}
from
'vue'
;
import
{
ref
,
watch
,
inject
}
from
'vue'
;
import
BrowsingHistory
from
'./BrowsingHistory.vue'
import
StarTarget
from
'./StarTarget.vue'
import
ShareList
from
'./Share.vue'
;
...
...
@@ -52,6 +52,7 @@ import { Plus,ArrowDown,Clock,Star,Share,Picture,Management,Delete,Setting } fro
import
{
useRouter
}
from
'vue-router'
;
import
{
openNewBlank
}
from
'@/utils/common'
;
import
{
useSellTemplateStore
}
from
'@/store'
;
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
const
router
=
useRouter
();
const
sellStore
=
useSellTemplateStore
()
...
...
@@ -61,7 +62,8 @@ const {SaleSearchPosition} = storeToRefs(sellStore)
const
currentMenu
=
ref
<
number
>
(
0
)
const
position
=
ref
<
{
FileId
:
number
,
FileType
:
1
|
2
,
Position
:{
FileId
:
number
,
FileName
:
string
}[]}
|
null
>
(
null
)
const
searchData
=
ref
({}
as
any
)
searchData
.
value
=
inject
(
injectKeyTemplate
)
const
openMarketHandler
=
(
type
:
string
=
''
)
=>
{
openNewBlank
(
`/market/create
${
type
}
`
)
...
...
@@ -69,6 +71,7 @@ const openMarketHandler = (type:string='') =>{
const
setCurrentMenuHandler
=
(
i
:
number
)
=>
{
currentMenu
.
value
=
i
searchData
.
value
.
currentMenu
=
i
}
const
initPageHandler
=
()
=>
{
...
...
@@ -82,6 +85,7 @@ const initPageHandler = ()=>{
currentMenu
.
value
=
parseInt
(
router
.
currentRoute
.
value
.
params
.
current
.
toString
())
}
currentMenu
.
value
=
currentMenu
.
value
>
4
||
currentMenu
.
value
<-
1
?
0
:
currentMenu
.
value
searchData
.
value
.
currentMenu
=
currentMenu
.
value
}
watch
(()
=>
router
.
currentRoute
.
value
.
path
,
(
toPath
)
=>
{
...
...
src/views/TemplateCenter/Index.vue
View file @
d884d74a
...
...
@@ -13,7 +13,7 @@
<span
class=
"fz14 q-pr-md shrink"
>
模版:
</span>
<el-select
v-model=
"queryObj.TemplateType"
class=
"ml-1 shrink TemSel"
placeholder=
"模版类型"
clearable
>
placeholder=
"模版类型"
clearable
@
change=
"search"
>
<el-option
v-for=
"item in typeArr"
:key=
"item.type"
...
...
@@ -26,7 +26,7 @@
<span
class=
"fz14 q-pr-md shrink"
>
版型:
</span>
<el-select
v-model=
"queryObj.TempType"
class=
"ml-1 shrink TemSel"
placeholder=
"版型"
clearable
>
placeholder=
"版型"
clearable
@
change=
"search"
>
<el-option
v-for=
"item in layouts"
:key=
"item.Id"
...
...
@@ -39,7 +39,7 @@
<span
class=
"fz14 q-pr-md shrink"
>
国家:
</span>
<el-select
v-model=
"queryObj.CountryList"
multiple
class=
"ml-1 shrink TemSel"
placeholder=
"国家"
clearable
filterable
>
placeholder=
"国家"
clearable
filterable
@
change=
"search(1)"
>
<el-option
key=
""
label=
"不限"
value=
""
/>
<el-option
v-for=
"item in countries"
...
...
@@ -53,7 +53,7 @@
<span
class=
"fz14 q-pr-md shrink"
>
季节:
</span>
<el-select
v-model=
"queryObj.SeasonList"
multiple
class=
"ml-1 shrink TemSel"
placeholder=
"季节"
clearable
>
placeholder=
"季节"
clearable
@
change=
"search(2)"
>
<el-option
key=
""
label=
"四季"
value=
""
/>
<el-option
v-for=
"item in seasonArr"
...
...
@@ -67,7 +67,7 @@
<span
class=
"fz14 q-pr-md shrink"
>
排序:
</span>
<el-select
v-model=
"queryObj.OrderByType"
class=
"ml-1 shrink TemSel"
placeholder=
"排序方式"
>
placeholder=
"排序方式"
@
change=
"search"
>
<el-option
v-for=
"item in sortArr"
:key=
"item.type"
...
...
@@ -80,7 +80,7 @@
<span
class=
"fz14 q-pr-md shrink"
>
颜色:
</span>
<el-select
v-model=
"queryObj.ColorList"
multiple
class=
"ml-1 shrink TemSel"
placeholder=
"颜色"
clearable
filterable
>
placeholder=
"颜色"
clearable
filterable
@
change=
"search(3)"
>
<el-option
key=
""
label=
"不限"
value=
""
/>
<el-option
v-for=
"item in ColorList"
...
...
@@ -91,11 +91,38 @@
</el-select>
</div>
</div>
<el-button
class=
"q-ml-lg q-mb-lg"
type=
"primary"
size=
"default"
style=
"color: #ffff;"
@
click=
"search"
>
<el-icon
size=
"18px"
>
<Search/>
</el-icon>
</el-button>
<div
class=
"row nowrap"
style=
"flex-shrink: 0;width: 201px;"
>
<div>
<el-button
class=
"q-ml-lg q-mb-lg"
type=
"primary"
size=
"default"
style=
"color: #ffff;"
@
click=
"search"
>
<el-icon
size=
"18px"
>
<Search/>
</el-icon>
</el-button>
</div>
<div>
<el-dropdown
class=
"q-pl-lg"
split-button
size=
"default"
type=
"primary"
@
click=
"addTemplate(1)"
>
<span
style=
"font-size: 23px;margin-right: 10px;"
>
+
</span>
<span>
创建
</span>
<template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-item
class=
"none-border"
>
<el-button
type=
"primary"
size=
"small"
@
click
.
stop=
"addTemplate(1)"
style=
"color: #ffff;"
>
创建模版
</el-button>
</el-dropdown-item>
<el-dropdown-item
class=
"none-border"
>
<el-button
type=
"primary"
size=
"small"
@
click
.
stop=
"addTemplate(2)"
style=
"color: #ffff;"
>
创建广告
</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</
template
>
</el-dropdown>
</div>
</div>
</div>
<!-- <el-input style="width:100px" v-model="queryObj.Title" placeholder="请输入关键字" class="q-pr-33">
<template #append>
...
...
@@ -177,7 +204,7 @@ import { reactive, ref, inject, onMounted, watch} from "vue";
import
LineService
from
'@/services/LineService'
import
ConfigService
from
'@/services/ConfigService'
import
{
useUserStore
}
from
"@/store/user"
;
import
{
useSellTemplateStore
}
from
'@/store'
import
{
useSellTemplateStore
,
useSlidesStore
}
from
'@/store'
import
{
useScreenStore
}
from
"@/store/screen"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
...
...
@@ -191,6 +218,8 @@ import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
import
{
noDataImg
}
from
"@/utils/common"
;
const
slidesStore
=
useSlidesStore
()
const
{
userInfo
}
=
storeToRefs
(
useUserStore
())
...
...
@@ -384,6 +413,7 @@ const addTemplate = (type:number) =>{
// searchData.value.TemplateType = type
// marketStore.setMarket(!market)
// searchData.value.TempId = 0
slidesStore
.
ClearSlides
()
router
.
push
({
path
:
`/create_template/
${
type
}
`
})
...
...
@@ -454,21 +484,40 @@ const getTemplate = async (item:any) => {
* 页面跳转
*/
const
goToTemplate
=
(
item
:
any
)
=>
{
let
url
=
''
// if(model.value==2) url = createSaleCreateLink(item.TempId,item.TemplateType)
// else if(model.value==0 && router.currentRoute.value.params.configId) url = createOpEditorLink(parseInt(router.currentRoute.value.params.configId.toString()),item.TempId)
// else if(model.value==1) url = managerTemplateLink(item.TempId,item.TemplateType)
url
=
managerTemplateLink
(
item
.
TempId
,
item
.
TemplateType
)
if
(
url
!=
''
)
{
router
.
push
({
path
:
url
})
}
searchData
.
value
.
currentMenu
=
null
if
((
searchData
.
value
.
TempId2
&&
searchData
.
value
.
TempId2
!=
item
.
TempId
)
||!
searchData
.
value
.
TempId2
)
slidesStore
.
ClearSlides
()
let
url
=
''
url
=
managerTemplateLink
(
item
.
TempId
,
item
.
TemplateType
)
if
(
url
!=
''
)
{
router
.
push
({
path
:
url
})
}
}
const
search
=
()
=>
{
queryObj
.
pageIndex
=
1
queryTemplateBySearchHandler
()
const
search
=
(
type
:
any
)
=>
{
let
lastItem
if
(
type
==
1
){
if
(
queryObj
.
CountryList
.
length
>
1
){
lastItem
=
queryObj
.
CountryList
.
length
-
1
if
(
queryObj
.
CountryList
[
lastItem
]
==
''
)
queryObj
.
CountryList
=
[
''
]
else
if
(
queryObj
.
CountryList
[
lastItem
]
!=
''
&&
queryObj
.
CountryList
.
indexOf
(
''
)
!=-
1
)
queryObj
.
CountryList
.
splice
(
0
,
1
)
}
}
else
if
(
type
==
2
){
if
(
queryObj
.
SeasonList
.
length
>
1
){
lastItem
=
queryObj
.
SeasonList
.
length
-
1
if
(
queryObj
.
SeasonList
[
lastItem
]
==
''
)
queryObj
.
SeasonList
=
[
''
]
else
if
(
queryObj
.
SeasonList
[
lastItem
]
!=
''
&&
queryObj
.
SeasonList
.
indexOf
(
''
)
!=-
1
)
queryObj
.
SeasonList
.
splice
(
0
,
1
)
}
}
else
if
(
type
==
3
){
if
(
queryObj
.
ColorList
.
length
>
1
){
lastItem
=
queryObj
.
ColorList
.
length
-
1
if
(
queryObj
.
ColorList
[
lastItem
]
==
''
)
queryObj
.
ColorList
=
[
''
]
else
if
(
queryObj
.
ColorList
[
lastItem
]
!=
''
&&
queryObj
.
ColorList
.
indexOf
(
''
)
!=-
1
)
queryObj
.
ColorList
.
splice
(
0
,
1
)
}
}
queryObj
.
pageIndex
=
1
queryTemplateBySearchHandler
()
}
/***
* 获取模板市场分页列表
...
...
src/views/TemplateCenter/colour.vue
View file @
d884d74a
...
...
@@ -68,7 +68,7 @@
effect=
"dark"
class=
"q-mr-md"
>
</el-tag>
<
div
v-html=
"queryObj.Name!=''&&scope.row.ColorValue?(scope.row.ColorValue.replaceAll(queryObj.Name,`
<span
class=
'text-waring'
>
${queryObj.Name}
</span>
`)):scope.row.ColorValue">
</div
>
<
span
v-html=
"queryObj.Name!=''&&scope.row.ColorValue?(scope.row.ColorValue.replaceAll(queryObj.Name,`
<span
class=
'text-waring'
>
${queryObj.Name}
</span>
`)):scope.row.ColorValue">
</span
>
<!--
{{
scope
.
row
.
ColorValue
}}
-->
</
template
>
</el-table-column>
...
...
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