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
6ba6b3ed
Commit
6ba6b3ed
authored
Dec 05, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增 typeId 酒店 景 餐id
parent
685435b3
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
186 additions
and
19 deletions
+186
-19
useImport.ts
src/hooks/useImport.ts
+1
-0
useSlideHandler.ts
src/hooks/useSlideHandler.ts
+2
-0
layout.ts
src/mocks/layout.ts
+10
-0
slides.ts
src/mocks/slides.ts
+3
-0
main.ts
src/store/main.ts
+1
-1
slides.ts
src/store/slides.ts
+1
-0
slides.ts
src/types/slides.ts
+2
-0
toolbar.ts
src/types/toolbar.ts
+1
-0
index.ts
src/utils/Editor/index.ts
+9
-3
resolve.ts
src/utils/psdParser/resolve.ts
+1
-0
index.vue
src/views/Editor/EditorHeader/index.vue
+23
-10
index.vue
src/views/Editor/Thumbnails/index.vue
+4
-4
EditDatas.vue
src/views/Editor/Toolbar/EditDatas.vue
+120
-0
index.vue
src/views/Editor/Toolbar/index.vue
+4
-0
index.vue
src/views/Editor/index.vue
+4
-1
No files found.
src/hooks/useImport.ts
View file @
6ba6b3ed
...
@@ -118,6 +118,7 @@ export default () => {
...
@@ -118,6 +118,7 @@ export default () => {
const
slide
:
Slide
=
{
const
slide
:
Slide
=
{
id
:
nanoid
(
10
),
id
:
nanoid
(
10
),
typeId
:
0
,
elements
:
[],
elements
:
[],
background
,
background
,
pageType
:
1
pageType
:
1
...
...
src/hooks/useSlideHandler.ts
View file @
6ba6b3ed
...
@@ -30,6 +30,7 @@ export default () => {
...
@@ -30,6 +30,7 @@ export default () => {
const
resetSlides
=
()
=>
{
const
resetSlides
=
()
=>
{
const
emptySlide
:
Slide
=
{
const
emptySlide
:
Slide
=
{
id
:
nanoid
(
10
),
id
:
nanoid
(
10
),
typeId
:
0
,
elements
:
[],
elements
:
[],
background
:
{
background
:
{
type
:
'solid'
,
type
:
'solid'
,
...
@@ -80,6 +81,7 @@ export default () => {
...
@@ -80,6 +81,7 @@ export default () => {
const
createSlide
=
()
=>
{
const
createSlide
=
()
=>
{
const
emptySlide
:
Slide
=
{
const
emptySlide
:
Slide
=
{
id
:
nanoid
(
10
),
id
:
nanoid
(
10
),
typeId
:
0
,
elements
:
[],
elements
:
[],
background
:
{
background
:
{
type
:
'solid'
,
type
:
'solid'
,
...
...
src/mocks/layout.ts
View file @
6ba6b3ed
...
@@ -6,6 +6,7 @@ export const layouts: Slide[] = [
...
@@ -6,6 +6,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
@@ -82,6 +83,7 @@ export const layouts: Slide[] = [
...
@@ -82,6 +83,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
2
,
pageType
:
2
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'text'
,
type
:
'text'
,
...
@@ -142,6 +144,7 @@ export const layouts: Slide[] = [
...
@@ -142,6 +144,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
3
,
pageType
:
3
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
@@ -192,6 +195,7 @@ export const layouts: Slide[] = [
...
@@ -192,6 +195,7 @@ export const layouts: Slide[] = [
{
{
id
:
'MZVO1kkj'
,
id
:
'MZVO1kkj'
,
pageType
:
4
,
pageType
:
4
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
@@ -278,6 +282,7 @@ export const layouts: Slide[] = [
...
@@ -278,6 +282,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
4
,
pageType
:
4
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
@@ -463,6 +468,7 @@ export const layouts: Slide[] = [
...
@@ -463,6 +468,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
4
,
pageType
:
4
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
@@ -517,6 +523,7 @@ export const layouts: Slide[] = [
...
@@ -517,6 +523,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'text'
,
type
:
'text'
,
...
@@ -581,6 +588,7 @@ export const layouts: Slide[] = [
...
@@ -581,6 +588,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'text'
,
type
:
'text'
,
...
@@ -699,6 +707,7 @@ export const layouts: Slide[] = [
...
@@ -699,6 +707,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'text'
,
type
:
'text'
,
...
@@ -776,6 +785,7 @@ export const layouts: Slide[] = [
...
@@ -776,6 +785,7 @@ export const layouts: Slide[] = [
{
{
id
:
'template'
,
id
:
'template'
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
...
src/mocks/slides.ts
View file @
6ba6b3ed
...
@@ -5,6 +5,7 @@ export const slides: Slide[] = [
...
@@ -5,6 +5,7 @@ export const slides: Slide[] = [
{
{
id
:
'test-slide-1'
,
id
:
'test-slide-1'
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
@@ -80,6 +81,7 @@ export const slides: Slide[] = [
...
@@ -80,6 +81,7 @@ export const slides: Slide[] = [
{
{
id
:
'test-slide-2'
,
id
:
'test-slide-2'
,
pageType
:
2
,
pageType
:
2
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'text'
,
type
:
'text'
,
...
@@ -140,6 +142,7 @@ export const slides: Slide[] = [
...
@@ -140,6 +142,7 @@ export const slides: Slide[] = [
{
{
id
:
'test-slide-3'
,
id
:
'test-slide-3'
,
pageType
:
3
,
pageType
:
3
,
typeId
:
0
,
elements
:
[
elements
:
[
{
{
type
:
'shape'
,
type
:
'shape'
,
...
...
src/store/main.ts
View file @
6ba6b3ed
...
@@ -59,7 +59,7 @@ export const useMainStore = defineStore('main', {
...
@@ -59,7 +59,7 @@ export const useMainStore = defineStore('main', {
creatingElement
:
null
,
// 正在插入的元素信息,需要通过绘制插入的元素(文字、形状、线条)
creatingElement
:
null
,
// 正在插入的元素信息,需要通过绘制插入的元素(文字、形状、线条)
creatingCustomShape
:
false
,
// 正在绘制任意多边形
creatingCustomShape
:
false
,
// 正在绘制任意多边形
availableFonts
:
SYS_FONTS
,
// 当前环境可用字体
availableFonts
:
SYS_FONTS
,
// 当前环境可用字体
toolbarState
:
ToolbarStates
.
SLIDE_DESIGN
,
// 右侧工具栏状态 设计 模版数据EL_TEMPLATEDATA
toolbarState
:
ToolbarStates
.
EDIT_DATAS
,
// 右侧工具栏状态 设计SLIDE_DESIGN 模版数据EL_TEMPLATEDATA 编辑数据EDIT_DATAS
clipingImageElementId
:
''
,
// 当前正在裁剪的图片ID
clipingImageElementId
:
''
,
// 当前正在裁剪的图片ID
richTextAttrs
:
defaultRichTextAttrs
,
// 富文本状态
richTextAttrs
:
defaultRichTextAttrs
,
// 富文本状态
selectedTableCells
:
[],
// 选中的表格单元格
selectedTableCells
:
[],
// 选中的表格单元格
...
...
src/store/slides.ts
View file @
6ba6b3ed
...
@@ -39,6 +39,7 @@ export const useSlidesStore = defineStore('slides', {
...
@@ -39,6 +39,7 @@ export const useSlidesStore = defineStore('slides', {
slides
:
[{
slides
:
[{
id
:
'test-slide-1'
,
id
:
'test-slide-1'
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:
[],
elements
:
[],
background
:
{
background
:
{
type
:
'solid'
,
type
:
'solid'
,
...
...
src/types/slides.ts
View file @
6ba6b3ed
...
@@ -684,6 +684,7 @@ export type TurningMode = 'no' | 'fade' | 'slideX' | 'slideY' | 'random' | 'slid
...
@@ -684,6 +684,7 @@ export type TurningMode = 'no' | 'fade' | 'slideX' | 'slideY' | 'random' | 'slid
* animations?: 元素动画集合
* animations?: 元素动画集合
*
*
* turningMode?: 翻页方式
* turningMode?: 翻页方式
* typeId: 类型id 酒店 景点 餐
*/
*/
export
interface
Slide
{
export
interface
Slide
{
id
:
string
id
:
string
...
@@ -693,6 +694,7 @@ export interface Slide {
...
@@ -693,6 +694,7 @@ export interface Slide {
animations
?:
PPTAnimation
[]
animations
?:
PPTAnimation
[]
turningMode
?:
TurningMode
turningMode
?:
TurningMode
pageType
:
number
pageType
:
number
typeId
:
number
}
}
/**
/**
...
...
src/types/toolbar.ts
View file @
6ba6b3ed
export
const
enum
ToolbarStates
{
export
const
enum
ToolbarStates
{
SYMBOL
=
'symbol'
,
SYMBOL
=
'symbol'
,
EL_ANIMATION
=
'elAnimation'
,
EL_ANIMATION
=
'elAnimation'
,
EDIT_DATAS
=
'editDatas'
,
EL_TEMPLATEDATA
=
'elTemplateData'
,
EL_TEMPLATEDATA
=
'elTemplateData'
,
EL_STYLE
=
'elStyle'
,
EL_STYLE
=
'elStyle'
,
EL_POSITION
=
'elPosition'
,
EL_POSITION
=
'elPosition'
,
...
...
src/utils/Editor/index.ts
View file @
6ba6b3ed
import
{
ref
}
from
'vue'
import
{
ref
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
storeToRefs
}
from
'pinia'
import
{
useSlidesStore
,
useScreenStore
}
from
'@/store'
import
{
useSlidesStore
,
useScreenStore
}
from
'@/store'
import
{
getHtmlPlainText
}
from
'@/utils/common'
export
default
()
=>
{
export
default
()
=>
{
const
slidesStore
=
useSlidesStore
()
const
slidesStore
=
useSlidesStore
()
...
@@ -9,9 +10,11 @@ export default () => {
...
@@ -9,9 +10,11 @@ export default () => {
const
{
SourceLoading
}
=
storeToRefs
(
useScreenStore
())
const
{
SourceLoading
}
=
storeToRefs
(
useScreenStore
())
// 数据源更新
// 数据源更新
const
setNewDatasList
=
(
DataSource
:
any
)
=>
{
const
setNewDatasList
=
(
DataSource
:
any
,
typeObj
:
any
)
=>
{
console
.
log
(
typeObj
,
'----1111'
)
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
...
@@ -24,19 +27,22 @@ export default () => {
...
@@ -24,19 +27,22 @@ export default () => {
return
y
.
id
==
x
.
id
return
y
.
id
==
x
.
id
})
})
if
(
dataObj
){
if
(
dataObj
){
x
=
dataObj
x
=
dataObj
}
}
savelides
.
push
(
x
)
savelides
.
push
(
x
)
})
})
obj
.
elements
=
JSON
.
parse
(
JSON
.
stringify
(
savelides
))
obj
.
elements
=
JSON
.
parse
(
JSON
.
stringify
(
savelides
))
slidesData
.
forEach
((
x
:
any
,
index
)
=>
{
slidesData
.
forEach
((
x
:
any
,
index
)
=>
{
if
(
slideIndex
.
value
==
index
){
if
(
slideIndex
.
value
==
index
){
x
.
typeId
=
DataSource
.
typeId
x
.
pgaeType
=
DataSource
.
pgaeType
x
.
pgaeType
=
DataSource
.
pgaeType
x
.
elements
=
obj
.
elements
x
.
elements
=
obj
.
elements
}
}
newSlides
.
push
(
x
)
newSlides
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
x
))
)
})
})
slidesStore
.
setSlides
(
newSlides
)
slidesStore
.
setSlides
(
newSlides
)
}
}
}
}
...
...
src/utils/psdParser/resolve.ts
View file @
6ba6b3ed
...
@@ -69,6 +69,7 @@ const CreateDefaultSlider = (id:string):Slide =>{
...
@@ -69,6 +69,7 @@ const CreateDefaultSlider = (id:string):Slide =>{
return
{
return
{
id
,
id
,
pageType
:
1
,
pageType
:
1
,
typeId
:
0
,
elements
:[],
elements
:[],
background
:
{
background
:
{
type
:
'solid'
,
type
:
'solid'
,
...
...
src/views/Editor/EditorHeader/index.vue
View file @
6ba6b3ed
...
@@ -371,6 +371,7 @@ const setTemplate = async () =>{
...
@@ -371,6 +371,7 @@ const setTemplate = async () =>{
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
arr
.
forEach
(
x
=>
{
arr
.
forEach
(
x
=>
{
x
.
elements
.
forEach
(
y
=>
{
x
.
elements
.
forEach
(
y
=>
{
delete
y
.
FiledTypeStr
delete
y
.
TemplateList
delete
y
.
TemplateList
})
})
})
})
...
@@ -397,21 +398,31 @@ const setTemplate = async () =>{
...
@@ -397,21 +398,31 @@ const setTemplate = async () =>{
}
else
{
}
else
{
arr
.
forEach
(
x
=>
{
arr
.
forEach
(
x
=>
{
x
.
elements
.
forEach
(
y
=>
{
x
.
elements
.
forEach
(
y
=>
{
delete
y
.
FiledTypeStr
delete
y
.
TemplateList
delete
y
.
TemplateList
delete
y
.
TemplateDataSource
delete
y
.
TemplateDataSource
})
})
})
})
}
}
for
(
let
i
=
0
;
i
<
slides
.
value
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
slides
.
value
.
length
;
i
++
){
if
(
!
slides
.
value
[
i
].
typeId
&&
slides
.
value
[
i
].
pageType
!=
1
){
datas
.
loading
=
false
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_STYLE
)
return
ElMessage
({
showClose
:
true
,
message
:
`请选择 第
${
i
+
1
}
页 的绑定数据`
,
type
:
'warning'
,
})
}
if
(
slides
.
value
[
i
].
elements
.
length
==
0
)
{
if
(
slides
.
value
[
i
].
elements
.
length
==
0
)
{
datas
.
loading
=
false
datas
.
loading
=
false
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
return
ElMessage
({
return
ElMessage
({
showClose
:
true
,
showClose
:
true
,
message
:
`请设计 第
${
i
+
1
}
页 的数据`
,
message
:
`请设计 第
${
i
+
1
}
页 的数据`
,
type
:
'warning'
,
type
:
'warning'
,
})
})
}
}
}
}
// console.log(arr,'-------tttt')
// console.log(arr,'-------tttt')
...
@@ -463,8 +474,10 @@ const setFeatureImgList = async () => {
...
@@ -463,8 +474,10 @@ const setFeatureImgList = async () => {
return
a
.
index
-
b
.
index
return
a
.
index
-
b
.
index
})
})
datas
.
FeatureImgList
=
list
.
map
(
x
=>
{
return
x
.
url
})
datas
.
FeatureImgList
=
list
.
map
(
x
=>
{
return
x
.
url
})
SetTripTemplateConfig
()
setTimeout
(()
=>
{
},
400
)
SetTripTemplateConfig
()
},
600
)
},
300
)
}
}
}
}
})
})
...
...
src/views/Editor/Thumbnails/index.vue
View file @
6ba6b3ed
...
@@ -198,6 +198,8 @@ const GetTripFiledData = async () =>{
...
@@ -198,6 +198,8 @@ const GetTripFiledData = async () =>{
let
dataRes
=
await
ConfigService
.
triptemplateGetTripFiledData
(
queryMsg
);
let
dataRes
=
await
ConfigService
.
triptemplateGetTripFiledData
(
queryMsg
);
if
(
dataRes
.
data
.
resultCode
==
1
)
{
if
(
dataRes
.
data
.
resultCode
==
1
)
{
if
(
!
dataRes
.
data
.
data
)
return
if
(
!
dataRes
.
data
.
data
)
return
datas
.
DataSource
.
TravelAatas
=
dataRes
.
data
.
data
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
return
const
travel
=
dataRes
.
data
.
data
const
travel
=
dataRes
.
data
.
data
const
cursors
=
[]
as
Array
<
any
>
const
cursors
=
[]
as
Array
<
any
>
for
(
let
index
=
0
;
index
<
slidesData
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
slidesData
.
length
;
index
++
)
{
...
@@ -310,6 +312,7 @@ const GetTripTemplate = async () =>{
...
@@ -310,6 +312,7 @@ const GetTripTemplate = async () =>{
if
(
typeof
SlidesData
==
'object'
&&!
SlidesData
.
length
){
if
(
typeof
SlidesData
==
'object'
&&!
SlidesData
.
length
){
let
obj
=
{
let
obj
=
{
pageType
:
1
,
pageType
:
1
,
typeId
:
null
,
...
SlidesData
...
SlidesData
}
}
newSlides
.
push
(
obj
)
newSlides
.
push
(
obj
)
...
@@ -341,10 +344,7 @@ const GetTripTemplate = async () =>{
...
@@ -341,10 +344,7 @@ 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
){
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
await
GetTripConfig
()
await
GetTripConfig
()
return
}
if
(
ConfigId
.
value
==
0
)
return
if
(
ConfigId
.
value
==
0
)
return
await
GetTripFiledData
()
await
GetTripFiledData
()
}
}
...
...
src/views/Editor/Toolbar/EditDatas.vue
0 → 100644
View file @
6ba6b3ed
<
template
>
<div
class=
"q-mt-xs bg-white q-pa-xs rounded ElementTemplateData"
>
<div
class=
"column text-mdall"
>
<p
class=
"q-mt-md"
>
当前类型:
<span
class=
"q-ml-xs"
>
{{
getPageType
()
}}
</span>
</p>
</div>
<template
v-if=
"datas.DataSource.pageType!=1"
>
<p
class=
"q-mt-md"
><span
class=
"Required q-mr-md"
>
*
</span>
选择数据:
</p>
<div
class=
"row wrap q-mt-md"
>
<el-select
v-model=
"datas.DataSource.typeId"
class=
"m-2"
placeholder=
"请选择需要绑定的数据"
@
change=
"getPageDatas()"
>
<el-option
v-for=
"item in datas.bindDatas"
:key=
"item.Id"
:label=
"item.Name"
:value=
"item.Id"
/>
</el-select>
</div>
</
template
>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
computed
,
ref
,
reactive
,
watch
,
inject
,
nextTick
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
ElInput
}
from
'element-plus'
import
{
useMainStore
,
useSlidesStore
,
useScreenStore
}
from
'@/store'
import
LineService
from
'@/services/LineService'
import
ConfigService
from
'@/services/ConfigService'
import
{
injectKeyDataSource
}
from
'@/types/injectKey'
import
{
getHtmlPlainText
}
from
'@/utils/common'
import
useExport
from
'@/hooks/useExport'
import
ThumbnailSlide
from
'@/views/components/ThumbnailSlide/index.vue'
import
AliyunUpload
from
'@/utils/upload/aliyun'
import
useEditor
from
'@/utils/Editor/index'
const
datas
=
reactive
({
DataSource
:{},
CountryValue
:
null
,
bindDatas
:
null
})
const
dispositionObj
=
ref
({}
as
any
)
const
queryObj
=
ref
({}
as
any
)
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
queryObj
.
value
=
inject
(
injectKeyDataSource
).
queryObj
const
lines
=
ref
([]
as
Array
<
any
>
)
//线路
const
Series
=
ref
([]
as
Array
<
any
>
)
//系列
const
cursors
=
[]
as
Array
<
any
>
const
slidesStore
=
useSlidesStore
()
const
sourceLoadingStore
=
useScreenStore
()
const
{
slides
,
slideIndex
,
viewportRatio
}
=
storeToRefs
(
slidesStore
)
const
{
setNewDatasList
}
=
useEditor
()
const
{
model
,
ConfigId
,
TemplateDataSource
,
TemplateType
,
CoverImg
,
isCoverImg
,
TempId
}
=
storeToRefs
(
useScreenStore
())
watch
(()
=>
datas
.
DataSource
.
DataSourceList
,
(
n
,
o
)
=>
{
getBindDatas
()
})
const
getPageDatas
=
()
=>
{
let
typeObj
=
datas
.
bindDatas
.
find
(
x
=>
{
return
x
.
Id
==
datas
.
DataSource
.
typeId
})
console
.
log
(
datas
.
bindDatas
,
'-------'
)
if
(
typeObj
){
sourceLoadingStore
.
setSourceLoading
(
true
)
setNewDatasList
(
datas
.
DataSource
,
typeObj
)
}
}
const
getPageType
=
()
=>
{
let
obj
=
TemplateType
.
value
.
find
(
x
=>
{
return
x
.
FiledType
==
datas
.
DataSource
.
pageType
})
if
(
obj
&&
obj
.
Name
){
return
obj
.
Name
}
}
const
getBindDatas
=
()
=>
{
let
obj
=
TemplateType
.
value
.
find
(
x
=>
{
return
x
.
FiledType
==
datas
.
DataSource
.
pageType
})
if
(
obj
&&
obj
.
Name
){
let
Path
=
obj
.
Content
.
split
(
'.'
)
TemplateType
.
value
.
forEach
(
x
=>
{
let
dataPath
=
x
.
Content
.
split
(
'.'
)
let
value
=
JSON
.
parse
(
JSON
.
stringify
(
datas
.
DataSource
.
TravelAatas
));
for
(
let
i
=
0
;
i
<
dataPath
.
length
;
i
++
)
{
const
oo
=
dataPath
[
i
];
if
(
oo
==
Path
[
0
]
&&
value
&&
value
[
oo
]){
datas
.
bindDatas
=
value
[
oo
]
}
}
})
}
}
getBindDatas
()
</
script
>
<
style
lang=
"scss"
scoped
>
.origin-image
{
height
:
100px
;
background-size
:
contain
;
background-repeat
:
no-repeat
;
background-position
:
center
;
background-color
:
$lightGray
;
margin-bottom
:
10px
;
}
.ElementTemplateData
{
/* min-height: 500px; */
}
.el-select
{
width
:
100%
;
}
.Required
{
color
:
red
;
}
</
style
>
\ No newline at end of file
src/views/Editor/Toolbar/index.vue
View file @
6ba6b3ed
...
@@ -23,6 +23,7 @@ import ElementStylePanel from './ElementStylePanel/index.vue'
...
@@ -23,6 +23,7 @@ import ElementStylePanel from './ElementStylePanel/index.vue'
import
ElementPositionPanel
from
'./ElementPositionPanel.vue'
import
ElementPositionPanel
from
'./ElementPositionPanel.vue'
import
ElementAnimationPanel
from
'./ElementAnimationPanel.vue'
import
ElementAnimationPanel
from
'./ElementAnimationPanel.vue'
import
ElementTemplateData
from
'./ElementTemplateData.vue'
import
ElementTemplateData
from
'./ElementTemplateData.vue'
import
EditDatas
from
'./EditDatas.vue'
import
SlideDesignPanel
from
'./SlideDesignPanel.vue'
import
SlideDesignPanel
from
'./SlideDesignPanel.vue'
import
SlideAnimationPanel
from
'./SlideAnimationPanel.vue'
import
SlideAnimationPanel
from
'./SlideAnimationPanel.vue'
import
MultiPositionPanel
from
'./MultiPositionPanel.vue'
import
MultiPositionPanel
from
'./MultiPositionPanel.vue'
...
@@ -45,6 +46,8 @@ const elementTabs = computed<ElementTabs[]>(() => {
...
@@ -45,6 +46,8 @@ const elementTabs = computed<ElementTabs[]>(() => {
{
label
:
'符号'
,
key
:
ToolbarStates
.
SYMBOL
},
{
label
:
'符号'
,
key
:
ToolbarStates
.
SYMBOL
},
{
label
:
'位置'
,
key
:
ToolbarStates
.
EL_POSITION
},
{
label
:
'位置'
,
key
:
ToolbarStates
.
EL_POSITION
},
{
label
:
'动画'
,
key
:
ToolbarStates
.
EL_ANIMATION
},
{
label
:
'动画'
,
key
:
ToolbarStates
.
EL_ANIMATION
},
{
label
:
'编辑'
,
key
:
ToolbarStates
.
EDIT_DATAS
},
]
]
}
}
return
[
return
[
...
@@ -96,6 +99,7 @@ const currentPanelComponent = computed(() => {
...
@@ -96,6 +99,7 @@ const currentPanelComponent = computed(() => {
[
ToolbarStates
.
EL_STYLE
]:
ElementStylePanel
,
[
ToolbarStates
.
EL_STYLE
]:
ElementStylePanel
,
[
ToolbarStates
.
EL_POSITION
]:
ElementPositionPanel
,
[
ToolbarStates
.
EL_POSITION
]:
ElementPositionPanel
,
[
ToolbarStates
.
EL_ANIMATION
]:
ElementAnimationPanel
,
[
ToolbarStates
.
EL_ANIMATION
]:
ElementAnimationPanel
,
[
ToolbarStates
.
EDIT_DATAS
]:
EditDatas
,
[
ToolbarStates
.
EL_TEMPLATEDATA
]:
ElementTemplateData
,
[
ToolbarStates
.
EL_TEMPLATEDATA
]:
ElementTemplateData
,
[
ToolbarStates
.
SLIDE_DESIGN
]:
SlideDesignPanel
,
[
ToolbarStates
.
SLIDE_DESIGN
]:
SlideDesignPanel
,
[
ToolbarStates
.
SLIDE_ANIMATION
]:
SlideAnimationPanel
,
[
ToolbarStates
.
SLIDE_ANIMATION
]:
SlideAnimationPanel
,
...
...
src/views/Editor/index.vue
View file @
6ba6b3ed
...
@@ -65,9 +65,11 @@ if(searchData.value.TempId) TempIds = searchData.value.TempId
...
@@ -65,9 +65,11 @@ if(searchData.value.TempId) TempIds = searchData.value.TempId
else
if
(
TempId
.
value
)
TempIds
=
TempId
.
value
else
if
(
TempId
.
value
)
TempIds
=
TempId
.
value
const
datas
=
reactive
({
const
datas
=
reactive
({
DataSource
:{
DataSource
:{
TravelAatas
:{},
FeatureImgList
:
[],
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餐
typeId
:
null
,
//记录当前页面 酒店 景 餐的id
DataSourceOverlay
:
false
,
DataSourceOverlay
:
false
,
DataSourceList
:[],
DataSourceList
:[],
queryObj
:{
queryObj
:{
...
@@ -104,7 +106,8 @@ const GetTripFiled = async () =>{
...
@@ -104,7 +106,8 @@ const GetTripFiled = async () =>{
if
(
obj
==-
1
){
if
(
obj
==-
1
){
let
object
=
{
let
object
=
{
FiledType
:
x
.
FiledType
,
FiledType
:
x
.
FiledType
,
Name
:
x
.
FiledTypeStr
Name
:
x
.
FiledTypeStr
,
Content
:
x
.
Content
}
}
pageTypesList
.
value
.
push
(
object
)
pageTypesList
.
value
.
push
(
object
)
}
}
...
...
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