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
f788d9f5
Commit
f788d9f5
authored
Dec 07, 2023
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/pptist
# Conflicts: # src/views/Editor/EditorHeader/index.vue
parents
22406f07
3b0e0911
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
22 additions
and
203 deletions
+22
-203
App.vue
src/App.vue
+1
-5
useExport.ts
src/hooks/useExport.ts
+1
-13
screen.ts
src/store/screen.ts
+0
-10
injectKey.ts
src/types/injectKey.ts
+0
-1
index.ts
src/utils/Editor/index.ts
+0
-1
index.vue
src/views/Editor/Canvas/index.vue
+1
-10
index.vue
src/views/Editor/EditorHeader/index.vue
+1
-88
ExportImage.vue
src/views/Editor/ExportDialog/ExportImage.vue
+4
-5
index.vue
src/views/Editor/ExportDialog/index.vue
+4
-10
index.vue
src/views/Editor/Thumbnails/index.vue
+4
-4
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+6
-55
index.vue
src/views/Editor/index.vue
+0
-1
No files found.
src/App.vue
View file @
f788d9f5
...
@@ -40,7 +40,6 @@ const ConfigIdStore = useScreenStore()
...
@@ -40,7 +40,6 @@ const ConfigIdStore = useScreenStore()
const
marketStore
=
useScreenStore
()
const
marketStore
=
useScreenStore
()
const
isModelStore
=
useScreenStore
()
const
isModelStore
=
useScreenStore
()
const
TempIdStore
=
useScreenStore
()
const
TempIdStore
=
useScreenStore
()
const
pageIndexStore
=
useScreenStore
()
const
{
databaseId
}
=
storeToRefs
(
mainStore
)
const
{
databaseId
}
=
storeToRefs
(
mainStore
)
const
{
screening
,
market
,
model
,
ConfigId
}
=
storeToRefs
(
useScreenStore
())
const
{
screening
,
market
,
model
,
ConfigId
}
=
storeToRefs
(
useScreenStore
())
const
{
userInfo
}
=
storeToRefs
(
userStore
())
const
{
userInfo
}
=
storeToRefs
(
userStore
())
...
@@ -54,15 +53,12 @@ const userLoginHandler = async ()=>{
...
@@ -54,15 +53,12 @@ const userLoginHandler = async ()=>{
let
ConfigId
=
0
// 9117
let
ConfigId
=
0
// 9117
let
model
=
0
let
model
=
0
let
TempId
=
1
let
TempId
=
1
let
pageIndex
=
0
if
(
param
.
uid
)
userId
=
parseInt
(
param
.
uid
)
if
(
param
.
uid
)
userId
=
parseInt
(
param
.
uid
)
if
(
param
.
ConfigId
)
ConfigId
=
parseInt
(
param
.
ConfigId
)
if
(
param
.
ConfigId
)
ConfigId
=
parseInt
(
param
.
ConfigId
)
if
(
param
.
model
)
model
=
parseInt
(
param
.
model
)
if
(
param
.
model
)
model
=
parseInt
(
param
.
model
)
if
(
param
.
TempId
)
{
if
(
param
.
TempId
)
{
TempId
=
parseInt
(
param
.
TempId
)
TempId
=
parseInt
(
param
.
TempId
)
pageIndex
=
parseInt
(
param
.
pageIndex
)
TempIdStore
.
setTempId
(
TempId
)
TempIdStore
.
setTempId
(
TempId
)
pageIndexStore
.
setPageIndex
(
pageIndex
)
marketStore
.
setMarket
(
!
market
)
marketStore
.
setMarket
(
!
market
)
}
}
ConfigIdStore
.
setConfigId
(
ConfigId
)
ConfigIdStore
.
setConfigId
(
ConfigId
)
...
...
src/hooks/useExport.ts
View file @
f788d9f5
...
@@ -26,11 +26,8 @@ interface ExportImageConfig {
...
@@ -26,11 +26,8 @@ interface ExportImageConfig {
export
default
()
=>
{
export
default
()
=>
{
const
slidesStore
=
useSlidesStore
()
const
slidesStore
=
useSlidesStore
()
const
coverImgStore
=
useScreenStore
()
const
isCoverImgStore
=
useScreenStore
()
const
FeatureImgStore
=
useScreenStore
()
const
{
slides
,
theme
,
viewportRatio
,
title
}
=
storeToRefs
(
slidesStore
)
const
{
slides
,
theme
,
viewportRatio
,
title
}
=
storeToRefs
(
slidesStore
)
const
{
isCoverImg
,
FeatureImg
}
=
storeToRefs
(
useScreenStore
())
const
{
isCoverImg
}
=
storeToRefs
(
useScreenStore
())
const
exporting
=
ref
(
false
)
const
exporting
=
ref
(
false
)
...
@@ -49,16 +46,7 @@ export default () => {
...
@@ -49,16 +46,7 @@ export default () => {
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
if
(
ignoreWebfont
)
config
.
fontEmbedCSS
=
''
toImage
(
domRef
,
config
).
then
(
dataUrl
=>
{
toImage
(
domRef
,
config
).
then
(
dataUrl
=>
{
if
(
isCoverImg
.
value
)
{
if
(
isCoverImg
.
value
)
{
// coverImgStore.setCoverImg('')
resolve
(
dataUrl
)
resolve
(
dataUrl
)
}
else
{
const
obj
=
{
index
:
i
,
url
:
dataUrl
}
FeatureImg
.
value
.
push
(
obj
)
FeatureImgStore
.
setFeatureImg
(
JSON
.
parse
(
JSON
.
stringify
(
FeatureImg
.
value
)))
resolve
(
true
)
}
}
}).
catch
(()
=>
{
}).
catch
(()
=>
{
// message.error('导出图片失败')
// message.error('导出图片失败')
...
...
src/store/screen.ts
View file @
f788d9f5
...
@@ -13,9 +13,7 @@ export interface ScreenState {
...
@@ -13,9 +13,7 @@ export interface ScreenState {
CoverImg
:
any
,
CoverImg
:
any
,
isCoverImg
:
boolean
,
isCoverImg
:
boolean
,
dataLoading
:
number
,
dataLoading
:
number
,
FeatureImg
:
any
,
SourceLoading
:
boolean
,
SourceLoading
:
boolean
,
pageIndex
:
number
,
imgPoolVisible
:
boolean
,
imgPoolVisible
:
boolean
,
imgReplaceVisible
:
boolean
,
imgReplaceVisible
:
boolean
,
}
}
...
@@ -33,9 +31,7 @@ export const useScreenStore = defineStore('screen', {
...
@@ -33,9 +31,7 @@ export const useScreenStore = defineStore('screen', {
CoverImg
:
null
,
// 封面图
CoverImg
:
null
,
// 封面图
isCoverImg
:
false
,
// 封面
isCoverImg
:
false
,
// 封面
dataLoading
:
0
,
// 记录保存是否成功
dataLoading
:
0
,
// 记录保存是否成功
FeatureImg
:
[],
// 行程特色图
SourceLoading
:
false
,
// 记录数据源是否更改
SourceLoading
:
false
,
// 记录数据源是否更改
pageIndex
:
0
,
//需要生成图的行程特色
imgPoolVisible
:
false
,
//新增上传图片弹窗
imgPoolVisible
:
false
,
//新增上传图片弹窗
imgReplaceVisible
:
false
,
//替换图片弹窗
imgReplaceVisible
:
false
,
//替换图片弹窗
}),
}),
...
@@ -77,15 +73,9 @@ export const useScreenStore = defineStore('screen', {
...
@@ -77,15 +73,9 @@ export const useScreenStore = defineStore('screen', {
setDataLoading
(
dataLoading
:
number
)
{
setDataLoading
(
dataLoading
:
number
)
{
this
.
dataLoading
=
dataLoading
this
.
dataLoading
=
dataLoading
},
},
setFeatureImg
(
FeatureImg
:
any
)
{
this
.
FeatureImg
=
FeatureImg
},
setSourceLoading
(
SourceLoading
:
boolean
)
{
setSourceLoading
(
SourceLoading
:
boolean
)
{
this
.
SourceLoading
=
SourceLoading
this
.
SourceLoading
=
SourceLoading
},
},
setPageIndex
(
pageIndex
:
number
){
this
.
pageIndex
=
pageIndex
},
setImgPoolVisible
(
imgPoolVisible
:
boolean
)
{
setImgPoolVisible
(
imgPoolVisible
:
boolean
)
{
this
.
imgPoolVisible
=
imgPoolVisible
this
.
imgPoolVisible
=
imgPoolVisible
},
},
...
...
src/types/injectKey.ts
View file @
f788d9f5
...
@@ -23,7 +23,6 @@ export type SlideDataSource = Ref<{
...
@@ -23,7 +23,6 @@ export type SlideDataSource = Ref<{
ConfigId
:
number
,
ConfigId
:
number
,
DataSourceList
?:
Array
<
any
>
,
DataSourceList
?:
Array
<
any
>
,
DataSourceOverlay
?:
boolean
,
DataSourceOverlay
?:
boolean
,
FeatureImgList
?:
any
[],
TravelAatas
?:
TravelAatas
,
TravelAatas
?:
TravelAatas
,
[
key
:
string
]:
any
;
[
key
:
string
]:
any
;
}
>
}
>
...
...
src/utils/Editor/index.ts
View file @
f788d9f5
...
@@ -13,7 +13,6 @@ export default () => {
...
@@ -13,7 +13,6 @@ export default () => {
const
setNewDatasList
=
(
DataSource
:
any
)
=>
{
const
setNewDatasList
=
(
DataSource
:
any
)
=>
{
sourceLoadingStore
.
setSourceLoading
(
false
)
sourceLoadingStore
.
setSourceLoading
(
false
)
const
slidesData
=
slides
.
value
const
slidesData
=
slides
.
value
const
cursors
=
[]
as
Array
<
any
>
// 更新Slides数据
// 更新Slides数据
let
savelides
=
[]
as
any
let
savelides
=
[]
as
any
let
newSlides
=
[]
as
any
let
newSlides
=
[]
as
any
...
...
src/views/Editor/Canvas/index.vue
View file @
f788d9f5
...
@@ -162,12 +162,9 @@ const viewportRef = ref<HTMLElement>()
...
@@ -162,12 +162,9 @@ const viewportRef = ref<HTMLElement>()
const
alignmentLines
=
ref
<
AlignmentLineProps
[]
>
([])
const
alignmentLines
=
ref
<
AlignmentLineProps
[]
>
([])
const
datas
=
reactive
({
const
datas
=
reactive
({
FeatureImgList
:
[],
loading
:
false
loading
:
false
})
})
datas
.
FeatureImgList
=
inject
(
injectKeyDataSource
).
FeatureImgList
const
{
market
,
model
,
ConfigId
,
CoverImg
,
dataLoading
}
=
storeToRefs
(
useScreenStore
())
const
FeatureImgStore
=
useScreenStore
()
const
{
market
,
model
,
ConfigId
,
CoverImg
,
dataLoading
,
FeatureImg
}
=
storeToRefs
(
useScreenStore
())
const
renderSlides
=
computed
(()
=>
{
const
renderSlides
=
computed
(()
=>
{
return
slides
.
value
return
slides
.
value
})
})
...
@@ -177,12 +174,6 @@ watch(() => slides.value, (n,o) =>{
...
@@ -177,12 +174,6 @@ watch(() => slides.value, (n,o) =>{
})
})
watch
(()
=>
FeatureImg
.
value
,
(
n
,
o
)
=>
{
FeatureImg
.
value
.
sort
((
a
,
b
)
=>
{
return
a
.
index
-
b
.
index
})
})
const
linkDialogVisible
=
ref
(
false
)
const
linkDialogVisible
=
ref
(
false
)
const
openLinkDialog
=
()
=>
linkDialogVisible
.
value
=
true
const
openLinkDialog
=
()
=>
linkDialogVisible
.
value
=
true
...
...
src/views/Editor/EditorHeader/index.vue
View file @
f788d9f5
<
template
>
<
template
>
<!--
<div
@
click=
"testHandler"
>
测试
</div>
-->
<!--
<div>
<template
v-for=
"(x,i) in FeatureImg"
>
<img
:src=
"x.url"
alt=
""
style=
"width: 80px;"
>
</
template
>
</div>
-->
<!-- <div>
<img :src="item" v-for="item in datas.FeatureImgList" style="width: 80px;" />
</div> -->
<div
class=
"editor-header"
>
<div
class=
"editor-header"
>
<div
class=
"left"
>
<div
class=
"left"
>
<div
class=
"menu-item"
v-tooltip=
"'去首页'"
@
click=
"goBack()"
>
首页
</div>
<div
class=
"menu-item"
v-tooltip=
"'去首页'"
@
click=
"goBack()"
>
首页
</div>
...
@@ -104,21 +95,6 @@
...
@@ -104,21 +95,6 @@
<FullscreenSpin
:loading=
"exporting"
tip=
"正在导入..."
/>
<FullscreenSpin
:loading=
"exporting"
tip=
"正在导入..."
/>
<Psd-Upload
:visible=
"psdVisibleStatus"
@
closed=
"psdVisibleStatus=false"
></Psd-Upload>
<Psd-Upload
:visible=
"psdVisibleStatus"
@
closed=
"psdVisibleStatus=false"
></Psd-Upload>
</div>
</div>
<!--
<div v-if="!model&&ConfigId" style="opacity: 0;position: absolute;left: 100px;top: 0;bottom: 0;overflow: auto;z-index: -1;">
<div class="export-img-dialog">
<div class="thumbnails-view">
<div class="thumbnails" v-for="slide in slides" ref="FeatureImgRef">
<ThumbnailSlide
class="thumbnail"
:key="slide.id"
:slide="slide"
:size="viewportRatio==0.7069?"
/>
</div>
</div>
</div>
</div> -->
</template>
</template>
...
@@ -142,7 +118,6 @@ import UploadService from '@/services/UploadService'
...
@@ -142,7 +118,6 @@ import UploadService from '@/services/UploadService'
import
{
domainManager
}
from
'@/utils/domainManager'
import
{
domainManager
}
from
'@/utils/domainManager'
import
{
ToolbarStates
}
from
'@/types/toolbar'
import
{
ToolbarStates
}
from
'@/types/toolbar'
import
useEditor
from
'@/utils/Editor/index'
import
useEditor
from
'@/utils/Editor/index'
import
useExport
from
'@/hooks/useExport'
import
HotkeyDoc
from
'./HotkeyDoc.vue'
import
HotkeyDoc
from
'./HotkeyDoc.vue'
...
@@ -178,11 +153,9 @@ const { setNewDatasList } = useEditor()
...
@@ -178,11 +153,9 @@ const { setNewDatasList } = useEditor()
const
{
userInfo
}
=
storeToRefs
(
userStore
())
const
{
userInfo
}
=
storeToRefs
(
userStore
())
const
datas
=
reactive
({
const
datas
=
reactive
({
FeatureImgList
:[],
DataSource
:{},
DataSource
:{},
loading
:
false
loading
:
false
})
})
datas
.
FeatureImgList
=
inject
(
injectKeyDataSource
).
FeatureImgList
const
queryObj
=
ref
({}
as
any
)
const
queryObj
=
ref
({}
as
any
)
const
searchData
=
ref
({}
as
any
)
const
searchData
=
ref
({}
as
any
)
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
...
@@ -192,17 +165,12 @@ const marketStore = useScreenStore()
...
@@ -192,17 +165,12 @@ const marketStore = useScreenStore()
const
CoverImgStore
=
useScreenStore
()
const
CoverImgStore
=
useScreenStore
()
const
dataLoadingStore
=
useScreenStore
()
const
dataLoadingStore
=
useScreenStore
()
const
TempIdStore
=
useScreenStore
()
const
TempIdStore
=
useScreenStore
()
const
FeatureImgStore
=
useScreenStore
()
const
ConfigIdStore
=
useScreenStore
()
const
ConfigIdStore
=
useScreenStore
()
const
FeatureImgRef
=
ref
(
null
)
const
FeatureImgList
=
ref
(
null
)
const
loadingInstance
=
ref
<
any
>
(
null
)
const
loadingInstance
=
ref
<
any
>
(
null
)
const
thumbnails
=
ref
<
string
[]
>
()
const
thumbnails
=
ref
<
string
[]
>
()
const
{
exportFeatureImg
}
=
useExport
()
const
psdVisibleStatus
=
ref
(
false
)
const
psdVisibleStatus
=
ref
(
false
)
const
{
market
,
model
,
ConfigId
,
CoverImg
,
dataLoading
,
TempId
,
FeatureImg
,
SourceLoading
}
=
storeToRefs
(
useScreenStore
())
const
{
market
,
model
,
ConfigId
,
CoverImg
,
dataLoading
,
TempId
,
SourceLoading
}
=
storeToRefs
(
useScreenStore
())
// 返回到首页
// 返回到首页
const
goBack
=
()
=>
{
const
goBack
=
()
=>
{
...
@@ -351,7 +319,6 @@ const SetTripTemplateConfig = async () => {
...
@@ -351,7 +319,6 @@ const SetTripTemplateConfig = async () => {
ConfigId
:
ConfigId
.
value
,
ConfigId
:
ConfigId
.
value
,
TempId
:
queryObj
.
value
.
TempId
,
TempId
:
queryObj
.
value
.
TempId
,
TempData
:
queryObj
.
value
.
TempData
,
TempData
:
queryObj
.
value
.
TempData
,
// FeatureImg: datas.FeatureImgList
}
}
let
TemplateRes
=
await
ConfigService
.
SetSetTripConfig
(
queryMsg
);
let
TemplateRes
=
await
ConfigService
.
SetSetTripConfig
(
queryMsg
);
if
(
TemplateRes
.
data
.
resultCode
==
1
)
{
if
(
TemplateRes
.
data
.
resultCode
==
1
)
{
...
@@ -373,7 +340,6 @@ const SetTripTemplateConfig = async () => {
...
@@ -373,7 +340,6 @@ const SetTripTemplateConfig = async () => {
})
})
}
}
}
catch
(
error
)
{}
}
catch
(
error
)
{}
FeatureImgStore
.
setFeatureImg
([])
datas
.
loading
=
false
datas
.
loading
=
false
}
}
...
@@ -451,59 +417,6 @@ const setTemplate = async () =>{
...
@@ -451,59 +417,6 @@ const setTemplate = async () =>{
}
}
// 行程图上传
const
setFeatureImgList
=
async
()
=>
{
datas
.
FeatureImgList
=
[]
FeatureImgList
.
value
=
[]
if
(
FeatureImg
.
value
&&
FeatureImg
.
value
.
length
>
0
){
for
(
let
i
=
0
;
i
<
FeatureImg
.
value
.
length
;
i
++
)
{
let
name
=
new
Date
().
getTime
()
+
".jpg"
const
file
=
dataURLtoFile
(
FeatureImg
.
value
[
i
].
url
,
name
)
let
result
=
AliyunUpload
.
UploadAsync
(
file
,
`Feature/
${
ConfigId
.
value
}
_
${
i
}
`
)
result
.
then
(
res
=>
{
if
(
res
)
{
let
path
=
res
.
split
(
'_'
)
FeatureImgList
.
value
.
push
({
index
:
path
[
1
],
url
:
res
})
if
(
i
==
FeatureImg
.
value
.
length
-
1
)
{
setTimeout
(()
=>
{
let
list
=
FeatureImgList
.
value
.
sort
((
a
,
b
)
=>
{
return
a
.
index
-
b
.
index
})
datas
.
FeatureImgList
=
list
.
map
(
x
=>
{
return
x
.
url
})
setTimeout
(()
=>
{
SetTripTemplateConfig
()
},
600
)
},
300
)
}
}
})
}
}
// try {
// let queryObj = {
// MyFile: url
// }
// let path = `?fileType=1&fileLimit=5&&filePath=Feature/${ConfigId.value}_`
// let Res = await UploadService.UploadBase64Two(path,queryObj);
// if (Res.data&&Res.data.FilePath) {
// datas.FeatureImgList.push(`${domainManager().ViittoFileUrl}/${Res.data.FilePath}`)
// if(datas.FeatureImgList.length==slides.value.length){
// await SetTripTemplateConfig()
// }
// }
// } catch (error) {
// datas.loading = false
// ElMessage({
// showClose: true,
// message: '上传行程文件出错',
// type: 'warning',
// })
// }
}
const
startEditTitle
=
()
=>
{
const
startEditTitle
=
()
=>
{
titleValue
.
value
=
title
.
value
titleValue
.
value
=
title
.
value
editingTitle
.
value
=
true
editingTitle
.
value
=
true
...
...
src/views/Editor/ExportDialog/ExportImage.vue
View file @
f788d9f5
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
</div>
</div>
<div
class=
"configs"
>
<div
class=
"configs"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"title"
>
{{
isCoverImg
?
'生成格式:'
:
'导出格式:'
}}
</div>
<div
class=
"title"
>
导出格式:
</div>
<RadioGroup
<RadioGroup
class=
"config-item"
class=
"config-item"
v-model:value=
"format"
v-model:value=
"format"
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</RadioGroup>
</RadioGroup>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"title"
>
{{
isCoverImg
?
'生成范围:'
:
'导出范围:'
}}
</div>
<div
class=
"title"
>
导出范围:
</div>
<RadioGroup
<RadioGroup
class=
"config-item"
class=
"config-item"
v-model:value=
"rangeType"
v-model:value=
"rangeType"
...
@@ -66,11 +66,11 @@
...
@@ -66,11 +66,11 @@
<div
class=
"btns"
>
<div
class=
"btns"
>
<Button
class=
"btn export"
type=
"primary"
@
click=
"expImage()"
>
<Button
class=
"btn export"
type=
"primary"
@
click=
"expImage()"
>
{{
isCoverImg
?
'生成封面'
:
'导出图片'
}}
</Button>
导出图片
</Button>
<Button
class=
"btn close"
@
click=
"emit('close')"
>
关闭
</Button>
<Button
class=
"btn close"
@
click=
"emit('close')"
>
关闭
</Button>
</div>
</div>
<FullscreenSpin
:loading=
"exporting"
:tip=
"isCoverImg?'正在生成...':'正在导出...'
"
/>
<FullscreenSpin
:loading=
"exporting"
tip=
"正在导出...
"
/>
</div>
</div>
</
template
>
</
template
>
...
@@ -93,7 +93,6 @@ const emit = defineEmits<{
...
@@ -93,7 +93,6 @@ const emit = defineEmits<{
}
>
()
}
>
()
const
{
slides
,
currentSlide
}
=
storeToRefs
(
useSlidesStore
())
const
{
slides
,
currentSlide
}
=
storeToRefs
(
useSlidesStore
())
const
{
isCoverImg
}
=
storeToRefs
(
useScreenStore
())
const
imageThumbnailsRef
=
ref
<
HTMLElement
>
()
const
imageThumbnailsRef
=
ref
<
HTMLElement
>
()
...
...
src/views/Editor/ExportDialog/index.vue
View file @
f788d9f5
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
@
update:value=
"key => setDialogForExport(key as DialogForExportTypes)"
@
update:value=
"key => setDialogForExport(key as DialogForExportTypes)"
/>
/>
<div
class=
"content"
>
<div
class=
"content"
>
<component
:is=
"currentDialogComponent"
@
close=
"setDialogForExport('')
,setDialogIsCoverImg()
"
></component>
<component
:is=
"currentDialogComponent"
@
close=
"setDialogForExport('')"
></component>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
computed
}
from
'vue'
import
{
computed
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
storeToRefs
}
from
'pinia'
import
{
useMainStore
,
useScreenStore
}
from
'@/store'
import
{
useMainStore
}
from
'@/store'
import
type
{
DialogForExportTypes
}
from
'@/types/export'
import
type
{
DialogForExportTypes
}
from
'@/types/export'
import
ExportImage
from
'./ExportImage.vue'
import
ExportImage
from
'./ExportImage.vue'
...
@@ -30,17 +30,11 @@ interface TabItem {
...
@@ -30,17 +30,11 @@ interface TabItem {
label
:
string
label
:
string
}
}
const
isCoverImgStore
=
useScreenStore
()
const
mainStore
=
useMainStore
()
const
mainStore
=
useMainStore
()
const
{
dialogForExport
}
=
storeToRefs
(
mainStore
)
const
{
dialogForExport
}
=
storeToRefs
(
mainStore
)
const
{
isCoverImg
}
=
storeToRefs
(
isCoverImgStore
)
const
setDialogForExport
=
mainStore
.
setDialogForExport
const
setDialogForExport
=
mainStore
.
setDialogForExport
const
setDialogIsCoverImg
=
()
=>
{
isCoverImgStore
.
setIsCoverImg
(
false
)
}
const
tabs
:
TabItem
[]
=
[
const
tabs
:
TabItem
[]
=
[
{
key
:
'pptist'
,
label
:
'导出 pptist 文件'
},
{
key
:
'pptist'
,
label
:
'导出 pptist 文件'
},
{
key
:
'pptx'
,
label
:
'导出 PPTX'
},
{
key
:
'pptx'
,
label
:
'导出 PPTX'
},
...
@@ -57,8 +51,8 @@ const currentDialogComponent = computed<unknown>(() => {
...
@@ -57,8 +51,8 @@ const currentDialogComponent = computed<unknown>(() => {
'pptx'
:
ExportPPTX
,
'pptx'
:
ExportPPTX
,
'pptist'
:
ExportSpecificFile
,
'pptist'
:
ExportSpecificFile
,
}
}
if
(
dialogForExport
.
value
)
return
dialogMap
[
dialogForExport
.
value
]
||
isCoverImgStore
.
setIsCoverImg
(
false
)
if
(
dialogForExport
.
value
)
return
dialogMap
[
dialogForExport
.
value
]
||
null
return
isCoverImgStore
.
setIsCoverImg
(
false
)
return
null
})
})
</
script
>
</
script
>
...
...
src/views/Editor/Thumbnails/index.vue
View file @
f788d9f5
...
@@ -131,7 +131,7 @@ watch(() => dataLoading.value, (n,o) =>{
...
@@ -131,7 +131,7 @@ watch(() => dataLoading.value, (n,o) =>{
if
(
dataLoading
.
value
==
1
){
if
(
dataLoading
.
value
==
1
){
GetTripTemplate
()
GetTripTemplate
()
}
else
if
(
dataLoading
.
value
==
2
){
}
else
if
(
dataLoading
.
value
==
2
){
GetTripConfig
()
if
(
ConfigId
.
value
)
GetTripConfig
()
}
}
})
})
...
@@ -229,7 +229,7 @@ const GetTripFiledData = async () =>{
...
@@ -229,7 +229,7 @@ const GetTripFiledData = async () =>{
cursors
.
push
(
temp
)
cursors
.
push
(
temp
)
}
}
if
(
y
.
TemplateDataSource
.
index
!=
null
&&
y
.
TemplateDataSource
.
index
>=
0
){
if
(
y
.
TemplateDataSource
.
index
!=
null
&&
y
.
TemplateDataSource
.
index
>=
0
){
if
(
value
[
oo
].
length
>
temp
.
index
)
value
=
value
[
oo
][
y
.
TemplateDataSource
.
index
]
value
=
value
[
oo
][
y
.
TemplateDataSource
.
index
]
}
else
{
}
else
{
if
(
value
[
oo
].
length
>
temp
.
index
)
value
=
value
[
oo
][
temp
.
index
]
if
(
value
[
oo
].
length
>
temp
.
index
)
value
=
value
[
oo
][
temp
.
index
]
else
value
=
value
[
oo
]
else
value
=
value
[
oo
]
...
@@ -296,7 +296,6 @@ const GetTripFiledData = async () =>{
...
@@ -296,7 +296,6 @@ const GetTripFiledData = async () =>{
// 获取行程模版数据
// 获取行程模版数据
const
GetTripTemplate
=
async
()
=>
{
const
GetTripTemplate
=
async
()
=>
{
console
.
log
(
'模版数据------'
)
if
(
!
searchData
.
value
.
TempId
&&!
TempId
.
value
)
{
if
(
!
searchData
.
value
.
TempId
&&!
TempId
.
value
)
{
let
list
=
[
let
list
=
[
{
{
...
@@ -341,6 +340,7 @@ const GetTripTemplate = async () =>{
...
@@ -341,6 +340,7 @@ const GetTripTemplate = async () =>{
}
}
})
})
})
})
console
.
log
(
newSlides
,
'=======模版数据newSlides'
)
slidesStore
.
setSlides
(
newSlides
)
slidesStore
.
setSlides
(
newSlides
)
layoutsStore
.
setLayouts
(
JSON
.
parse
(
JSON
.
stringify
(
newSlides
)))
layoutsStore
.
setLayouts
(
JSON
.
parse
(
JSON
.
stringify
(
newSlides
)))
CoverImgStore
.
setCoverImg
(
dataRes
.
data
.
data
.
CoverImg
)
CoverImgStore
.
setCoverImg
(
dataRes
.
data
.
data
.
CoverImg
)
...
@@ -359,8 +359,8 @@ const GetTripTemplate = async () =>{
...
@@ -359,8 +359,8 @@ const GetTripTemplate = async () =>{
queryObj
.
value
.
TempType
=
dataRes
.
data
.
data
.
TempType
queryObj
.
value
.
TempType
=
dataRes
.
data
.
data
.
TempType
slidesStore
.
updateSlideIndex
(
0
)
slidesStore
.
updateSlideIndex
(
0
)
datas
.
DataSource
.
pageType
=
newSlides
[
0
].
pageType
datas
.
DataSource
.
pageType
=
newSlides
[
0
].
pageType
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
await
GetTripConfig
()
if
(
ConfigId
.
value
==
0
)
return
if
(
ConfigId
.
value
==
0
)
return
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
await
GetTripConfig
()
await
GetTripFiledData
()
await
GetTripFiledData
()
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
src/views/Editor/Toolbar/ElementTemplateData.vue
View file @
f788d9f5
...
@@ -129,11 +129,10 @@
...
@@ -129,11 +129,10 @@
<!-- 生成封面图 -->
<!-- 生成封面图 -->
<div
style=
"opacity: 0;position: fixed;left: 100px;top: 0;overflow: auto;z-index: -1;"
<div
style=
"opacity: 0;position: fixed;left: 100px;top: 0;overflow: auto;z-index: -1;"
v-if=
"model&&model==1&&slides.length>0&&slideIndex>=0"
>
v-if=
"
toolbarState=='elTemplateData'&&
model&&model==1&&slides.length>0&&slideIndex>=0"
>
<div
class=
"export-img-dialog"
>
<div
class=
"export-img-dialog"
>
<div
class=
"thumbnails-view"
>
<div
class=
"thumbnails-view"
>
<div
class=
"thumbnails FeatureImgRef"
ref=
"FeatureImgRef"
>
<div
class=
"thumbnails FeatureImgRef"
ref=
"FeatureImgRef"
>
<ThumbnailSlide
<ThumbnailSlide
class=
"thumbnail"
class=
"thumbnail"
:key=
"slides[slideIndex].id"
:key=
"slides[slideIndex].id"
...
@@ -215,9 +214,10 @@
...
@@ -215,9 +214,10 @@
if
(
item
.
type
==
"text"
||
item
.
type
==
"image"
)
{
if
(
item
.
type
==
"text"
||
item
.
type
==
"image"
)
{
item
.
TemplateList
=
JSON
.
parse
(
JSON
.
stringify
(
TemplateList
))
item
.
TemplateList
=
JSON
.
parse
(
JSON
.
stringify
(
TemplateList
))
item
.
TemplateDataSource
=
{
item
.
TemplateDataSource
=
{
Content
:
item
.
TemplateDataSource
.
Content
,
Content
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
Content
?
item
.
TemplateDataSource
.
Content
:
''
,
Name
:
item
.
TemplateDataSource
.
Name
,
Name
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
Name
?
item
.
TemplateDataSource
.
Name
:
''
,
Id
:
item
.
TemplateDataSource
.
Id
,
Id
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
Id
?
item
.
TemplateDataSource
.
Id
:
null
as
Number
,
index
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
index
>=
0
?
item
.
TemplateDataSource
.
index
:
null
as
Number
,
}
}
if
(
datas
.
DataSource
.
pageType
!=
1
){
if
(
datas
.
DataSource
.
pageType
!=
1
){
let
index
=
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
index
>=
0
?
item
.
TemplateDataSource
.
index
:
null
as
Number
let
index
=
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
index
>=
0
?
item
.
TemplateDataSource
.
index
:
null
as
Number
...
@@ -232,12 +232,6 @@
...
@@ -232,12 +232,6 @@
...
item
,
...
item
,
contentStr
:
contentStr
,
contentStr
:
contentStr
,
TemplateList
:
TemplateList
,
TemplateList
:
TemplateList
,
TemplateDataSource
:
{
Content
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
Content
?
item
.
TemplateDataSource
.
Content
:
''
,
Name
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
Name
?
item
.
TemplateDataSource
.
Name
:
''
,
Id
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
Id
?
item
.
TemplateDataSource
.
Id
:
null
as
Number
,
index
:
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
index
>=
0
?
item
.
TemplateDataSource
.
index
:
null
as
Number
,
}
}
}
if
(
Obj
)
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
if
(
Obj
)
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
}
...
@@ -287,7 +281,6 @@
...
@@ -287,7 +281,6 @@
queryObj
.
value
.
CoverImg
=
''
queryObj
.
value
.
CoverImg
=
''
mainMenuVisible
.
value
=
false
mainMenuVisible
.
value
=
false
isCoverImgStore
.
setIsCoverImg
(
true
)
isCoverImgStore
.
setIsCoverImg
(
true
)
console
.
log
(
FeatureImgRef
.
value
)
let
datas
=
await
exportFeatureImg
(
FeatureImgRef
.
value
,
'jpeg'
,
1
,
false
,
0
)
let
datas
=
await
exportFeatureImg
(
FeatureImgRef
.
value
,
'jpeg'
,
1
,
false
,
0
)
if
(
datas
){
if
(
datas
){
let
name
=
new
Date
().
getTime
()
+
".jpg"
let
name
=
new
Date
().
getTime
()
+
".jpg"
...
@@ -319,50 +312,8 @@
...
@@ -319,50 +312,8 @@
// 所有数据源
// 所有数据源
const
AllDataSource
=
()
=>
{
const
AllDataSource
=
()
=>
{
if
(
SourceLoading
.
value
)
setNewDatasList
(
datas
.
DataSource
)
if
(
SourceLoading
.
value
)
setNewDatasList
(
datas
.
DataSource
)
// getPageType()
getPageType
()
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
return
if
(
slides
.
value
.
elements
&&
slides
.
value
.
elements
.
length
==
0
){
return
ElMessage
({
showClose
:
true
,
message
:
'请完善PDF内容填充'
,
type
:
'warning'
,
})
}
// 绑定数据源
const
newElements
=
slides
.
value
.
find
((
slide
,
indexs
)
=>
{
return
slideIndex
.
value
==
indexs
})
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
let
TemplateList
=
TemplateDataSource
.
value
.
filter
(
x
=>
{
return
x
.
FiledType
==
newElements
.
pageType
})
datas
.
DataSource
.
DataSourceList
=
[]
newElements
.
elements
.
forEach
(
slide
=>
{
if
(
slide
.
type
==
"text"
||
slide
.
type
==
"image"
)
{
let
contentStr
if
(
slide
.
type
==
"text"
)
contentStr
=
getHtmlPlainText
(
slide
.
content
)
if
(
slide
.
type
==
"image"
)
contentStr
=
slide
.
src
let
Obj
=
{}
Obj
=
{
...
slide
,
contentStr
:
contentStr
,
TemplateList
:
TemplateList
,
TemplateDataSource
:
{
Content
:
slide
.
TemplateDataSource
&&
slide
.
TemplateDataSource
.
Content
?
slide
.
TemplateDataSource
.
Content
:
''
,
Name
:
slide
.
TemplateDataSource
&&
slide
.
TemplateDataSource
.
Name
?
slide
.
TemplateDataSource
.
Name
:
''
,
Id
:
slide
.
TemplateDataSource
&&
slide
.
TemplateDataSource
.
Id
?
slide
.
TemplateDataSource
.
Id
:
null
as
Number
,
},
}
if
(
newElements
.
pageType
!=
1
){
let
index
=
slide
.
TemplateDataSource
&&
slide
.
TemplateDataSource
.
index
>=
0
?
slide
.
TemplateDataSource
.
index
:
null
as
Number
Reflect
.
set
(
Obj
.
TemplateDataSource
,
'index'
,
index
)
}
if
(
Obj
){
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
}
})
}
}
...
...
src/views/Editor/index.vue
View file @
f788d9f5
...
@@ -87,7 +87,6 @@ else if(TempId.value) TempIds = TempId.value
...
@@ -87,7 +87,6 @@ else if(TempId.value) TempIds = TempId.value
const
datas
=
reactive
({
const
datas
=
reactive
({
DataSource
:{
DataSource
:{
TravelAatas
:{},
TravelAatas
:{},
FeatureImgList
:
[],
ConfigId
:
ConfigId
.
value
?
ConfigId
.
value
:
0
,
ConfigId
:
ConfigId
.
value
?
ConfigId
.
value
:
0
,
pageType
:
1
,
//1基础 2酒店 3景 4餐
pageType
:
1
,
//1基础 2酒店 3景 4餐
DataSourceOverlay
:
false
,
DataSourceOverlay
:
false
,
...
...
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