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
c75224fe
Commit
c75224fe
authored
Dec 06, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整 baseInfo 的 TemplateDataSource index
parent
f6ed4d57
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
5 additions
and
158 deletions
+5
-158
useImport.ts
src/hooks/useImport.ts
+0
-1
useSlideHandler.ts
src/hooks/useSlideHandler.ts
+0
-2
layout.ts
src/mocks/layout.ts
+0
-10
slides.ts
src/mocks/slides.ts
+0
-3
slides.ts
src/store/slides.ts
+0
-1
slides.ts
src/types/slides.ts
+0
-2
index.ts
src/utils/Editor/index.ts
+1
-3
resolve.ts
src/utils/psdParser/resolve.ts
+0
-1
index.vue
src/views/Editor/EditorHeader/index.vue
+0
-9
index.vue
src/views/Editor/Thumbnails/index.vue
+0
-1
EditDatas.vue
src/views/Editor/Toolbar/EditDatas.vue
+0
-120
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+4
-1
index.vue
src/views/Editor/Toolbar/index.vue
+0
-3
index.vue
src/views/Editor/index.vue
+0
-1
No files found.
src/hooks/useImport.ts
View file @
c75224fe
...
...
@@ -118,7 +118,6 @@ export default () => {
const
slide
:
Slide
=
{
id
:
nanoid
(
10
),
typeId
:
0
,
elements
:
[],
background
,
pageType
:
1
...
...
src/hooks/useSlideHandler.ts
View file @
c75224fe
...
...
@@ -30,7 +30,6 @@ export default () => {
const
resetSlides
=
()
=>
{
const
emptySlide
:
Slide
=
{
id
:
nanoid
(
10
),
typeId
:
0
,
elements
:
[],
background
:
{
type
:
'solid'
,
...
...
@@ -81,7 +80,6 @@ export default () => {
const
createSlide
=
()
=>
{
const
emptySlide
:
Slide
=
{
id
:
nanoid
(
10
),
typeId
:
0
,
elements
:
[],
background
:
{
type
:
'solid'
,
...
...
src/mocks/layout.ts
View file @
c75224fe
...
...
@@ -6,7 +6,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
@@ -83,7 +82,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
2
,
typeId
:
0
,
elements
:
[
{
type
:
'text'
,
...
...
@@ -144,7 +142,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
3
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
@@ -195,7 +192,6 @@ export const layouts: Slide[] = [
{
id
:
'MZVO1kkj'
,
pageType
:
4
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
@@ -282,7 +278,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
4
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
@@ -468,7 +463,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
4
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
@@ -523,7 +517,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
{
type
:
'text'
,
...
...
@@ -588,7 +581,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
{
type
:
'text'
,
...
...
@@ -707,7 +699,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
{
type
:
'text'
,
...
...
@@ -785,7 +776,6 @@ export const layouts: Slide[] = [
{
id
:
'template'
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
src/mocks/slides.ts
View file @
c75224fe
...
...
@@ -5,7 +5,6 @@ export const slides: Slide[] = [
{
id
:
'test-slide-1'
,
pageType
:
1
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
@@ -81,7 +80,6 @@ export const slides: Slide[] = [
{
id
:
'test-slide-2'
,
pageType
:
2
,
typeId
:
0
,
elements
:
[
{
type
:
'text'
,
...
...
@@ -142,7 +140,6 @@ export const slides: Slide[] = [
{
id
:
'test-slide-3'
,
pageType
:
3
,
typeId
:
0
,
elements
:
[
{
type
:
'shape'
,
...
...
src/store/slides.ts
View file @
c75224fe
...
...
@@ -39,7 +39,6 @@ export const useSlidesStore = defineStore('slides', {
slides
:
[{
id
:
'test-slide-1'
,
pageType
:
1
,
typeId
:
0
,
elements
:
[],
background
:
{
type
:
'solid'
,
...
...
src/types/slides.ts
View file @
c75224fe
...
...
@@ -691,7 +691,6 @@ export type TurningMode = 'no' | 'fade' | 'slideX' | 'slideY' | 'random' | 'slid
* animations?: 元素动画集合
*
* turningMode?: 翻页方式
* typeId: 类型id 酒店 景点 餐
*/
export
interface
Slide
{
id
:
string
...
...
@@ -701,7 +700,6 @@ export interface Slide {
animations
?:
PPTAnimation
[]
turningMode
?:
TurningMode
pageType
:
number
typeId
:
number
}
/**
...
...
src/utils/Editor/index.ts
View file @
c75224fe
...
...
@@ -10,8 +10,7 @@ export default () => {
const
{
SourceLoading
}
=
storeToRefs
(
useScreenStore
())
// 数据源更新
const
setNewDatasList
=
(
DataSource
:
any
,
typeObj
:
any
)
=>
{
console
.
log
(
typeObj
,
'----1111'
)
const
setNewDatasList
=
(
DataSource
:
any
)
=>
{
sourceLoadingStore
.
setSourceLoading
(
false
)
const
slidesData
=
slides
.
value
const
cursors
=
[]
as
Array
<
any
>
...
...
@@ -35,7 +34,6 @@ export default () => {
obj
.
elements
=
JSON
.
parse
(
JSON
.
stringify
(
savelides
))
slidesData
.
forEach
((
x
:
any
,
index
)
=>
{
if
(
slideIndex
.
value
==
index
){
x
.
typeId
=
DataSource
.
typeId
x
.
pgaeType
=
DataSource
.
pgaeType
x
.
elements
=
obj
.
elements
}
...
...
src/utils/psdParser/resolve.ts
View file @
c75224fe
...
...
@@ -69,7 +69,6 @@ const CreateDefaultSlider = (id:string):Slide =>{
return
{
id
,
pageType
:
1
,
typeId
:
0
,
elements
:[],
background
:
{
type
:
'solid'
,
...
...
src/views/Editor/EditorHeader/index.vue
View file @
c75224fe
...
...
@@ -406,15 +406,6 @@ const setTemplate = async () =>{
})
}
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
)
{
datas
.
loading
=
false
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
...
...
src/views/Editor/Thumbnails/index.vue
View file @
c75224fe
...
...
@@ -324,7 +324,6 @@ const GetTripTemplate = async () =>{
if
(
typeof
SlidesData
==
'object'
&&!
SlidesData
.
length
){
let
obj
=
{
pageType
:
1
,
typeId
:
null
,
...
SlidesData
}
newSlides
.
push
(
obj
)
...
...
src/views/Editor/Toolbar/EditDatas.vue
deleted
100644 → 0
View file @
f6ed4d57
<
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/ElementTemplateData.vue
View file @
c75224fe
...
...
@@ -234,9 +234,12 @@
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
(
slide
.
pageType
!=
1
){
let
index
=
item
.
TemplateDataSource
&&
item
.
TemplateDataSource
.
index
>=
0
?
item
.
TemplateDataSource
.
index
:
null
as
Number
Reflect
.
set
(
Obj
.
TemplateDataSource
,
'index'
,
index
)
}
if
(
Obj
)
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
})
...
...
src/views/Editor/Toolbar/index.vue
View file @
c75224fe
...
...
@@ -23,7 +23,6 @@ import ElementStylePanel from './ElementStylePanel/index.vue'
import
ElementPositionPanel
from
'./ElementPositionPanel.vue'
import
ElementAnimationPanel
from
'./ElementAnimationPanel.vue'
import
ElementTemplateData
from
'./ElementTemplateData.vue'
// import EditDatas from './EditDatas.vue'
import
SlideDesignPanel
from
'./SlideDesignPanel.vue'
import
SlideAnimationPanel
from
'./SlideAnimationPanel.vue'
import
MultiPositionPanel
from
'./MultiPositionPanel.vue'
...
...
@@ -43,7 +42,6 @@ const elementTabs = computed<ElementTabs[]>(() => {
if
(
handleElement
.
value
?.
type
===
'text'
)
{
return
[
{
label
:
'样式'
,
key
:
ToolbarStates
.
EL_STYLE
},
// { label: '数据', key: ToolbarStates.EDIT_DATAS },
{
label
:
'符号'
,
key
:
ToolbarStates
.
SYMBOL
},
{
label
:
'位置'
,
key
:
ToolbarStates
.
EL_POSITION
},
{
label
:
'动画'
,
key
:
ToolbarStates
.
EL_ANIMATION
}
...
...
@@ -98,7 +96,6 @@ const currentPanelComponent = computed(() => {
[
ToolbarStates
.
EL_STYLE
]:
ElementStylePanel
,
[
ToolbarStates
.
EL_POSITION
]:
ElementPositionPanel
,
[
ToolbarStates
.
EL_ANIMATION
]:
ElementAnimationPanel
,
// [ToolbarStates.EDIT_DATAS]: EditDatas,
[
ToolbarStates
.
EL_TEMPLATEDATA
]:
ElementTemplateData
,
[
ToolbarStates
.
SLIDE_DESIGN
]:
SlideDesignPanel
,
[
ToolbarStates
.
SLIDE_ANIMATION
]:
SlideAnimationPanel
,
...
...
src/views/Editor/index.vue
View file @
c75224fe
...
...
@@ -89,7 +89,6 @@ const datas = reactive({
FeatureImgList
:
[],
ConfigId
:
ConfigId
.
value
?
ConfigId
.
value
:
0
,
pageType
:
1
,
//1基础 2酒店 3景 4餐
typeId
:
null
,
//记录当前页面 酒店 景 餐的id
DataSourceOverlay
:
false
,
DataSourceList
:[],
queryObj
:{
...
...
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