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
b0b2e3cc
Commit
b0b2e3cc
authored
Nov 21, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
027d6589
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
27 deletions
+132
-27
ConfigService.ts
src/services/ConfigService.ts
+1
-1
index.vue
src/views/Editor/DataaSource/index.vue
+37
-3
index.vue
src/views/Editor/Thumbnails/index.vue
+33
-20
SlideDesignPanel.vue
src/views/Editor/Toolbar/SlideDesignPanel.vue
+57
-1
index.vue
src/views/Editor/index.vue
+4
-2
No files found.
src/services/ConfigService.ts
View file @
b0b2e3cc
...
...
@@ -5,7 +5,7 @@ import Api,{ HttpResponse, Result } from './../utils/request';
*/
class
ConfigService
{
/**
* 获取
模板
数据源列表
* 获取
绑定
数据源列表
*/
static
async
TemplateGetTripFiled
(
params
:
any
):
Promise
<
HttpResponse
>
{
return
Api
.
Post
(
"triptemplate_GetTripFiled"
,
params
)
...
...
src/views/Editor/DataaSource/index.vue
View file @
b0b2e3cc
...
...
@@ -63,20 +63,54 @@
// TemplateDataSource:[]
},
})
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
.
DataSource
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
const
multipleTableRef
=
ref
<
InstanceType
<
typeof
any
>>
()
const
multipleSelection
=
ref
<
[]
>
([])
const
slidesStore
=
useSlidesStore
()
const
{
slides
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
const
slidesData
=
slides
.
value
watch
(
datas
.
DataSource
,
(
n
,
o
)
=>
{
const
savelides
=
[]
const
newSlides
=
[]
let
obj
=
slidesData
.
find
((
x
,
index
)
=>
{
return
slideIndex
.
value
==
index
})
obj
&&
obj
.
elements
&&
obj
.
elements
.
forEach
(
x
=>
{
let
dataObj
=
datas
.
DataSource
.
DataSourceList
.
find
(
y
=>
{
return
y
.
id
==
x
.
id
})
if
(
dataObj
){
x
=
dataObj
}
savelides
.
push
(
x
)
})
obj
.
elements
=
savelides
slidesData
.
forEach
((
x
,
index
)
=>
{
if
(
slideIndex
.
value
==
index
){
x
.
elements
=
obj
.
elements
}
newSlides
.
push
(
x
)
})
if
(
obj
.
TemplateDataSource
&&
obj
.
TemplateDataSource
.
Id
){
slidesStore
.
setSlides
(
newSlides
)
}
})
watch
(
datas
.
DataSource
,
(
n
,
o
)
=>
{
})
// 数据源关键数据赋值
const
setTemplateDataSource
=
(
Id
,
index
)
=>
{
datas
.
DataSource
.
DataSourceList
.
forEach
((
x
,
indexs
)
=>
{
if
(
index
==
indexs
){
x
.
let
obj
=
x
.
TemplateList
.
find
(
y
=>
{
return
y
.
Id
==
x
.
TemplateDataSource
.
Id
})
x
.
TemplateDataSource
.
Content
=
obj
.
Content
x
.
TemplateDataSource
.
Name
=
obj
.
Name
}
})
}
...
...
src/views/Editor/Thumbnails/index.vue
View file @
b0b2e3cc
...
...
@@ -91,7 +91,7 @@ const {
const
datas
=
reactive
({
DataSource
:{}
})
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
.
DataSource
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
// 页面被切换时
const
thumbnailsRef
=
ref
<
InstanceType
<
typeof
Draggable
>>
()
...
...
@@ -128,35 +128,48 @@ const getHtmlPlainText = (html_str) => {
// 切换页面
const
changeSlideIndex
=
(
index
:
number
)
=>
{
mainStore
.
setActiveElementIdList
([])
// 数据源
//
绑定
数据源
const
newElements
=
slides
.
value
.
find
((
slide
,
indexs
)
=>
{
return
index
==
indexs
})
datas
.
DataSource
.
DataSourceList
=
[]
newElements
.
elements
.
forEach
(
slide
=>
{
let
Obj
=
{}
if
(
slide
.
type
==
"text"
){
let
Obj
=
{
...
slide
,
FiledTypeStr
:
getHtmlPlainText
(
slide
.
content
),
TemplateList
:
datas
.
DataSource
.
jc
,
TemplateDataSource
:
{
Content
:
""
,
Name
:
""
,
Id
:
null
as
Number
},
if
(
slide
.
FiledTypeStr
){
Obj
=
{
...
slide
,
}
}
else
{
Obj
=
{
...
slide
,
FiledTypeStr
:
getHtmlPlainText
(
slide
.
content
),
TemplateList
:
datas
.
DataSource
.
jc
,
TemplateDataSource
:
{
Content
:
''
,
Name
:
''
,
Id
:
null
as
Number
},
}
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
if
(
slide
.
type
==
"image"
){
let
Obj
=
{
...
slide
,
FiledTypeStr
:
slide
.
src
,
TemplateList
:
datas
.
DataSource
.
jd
,
TemplateDataSource
:
{
Content
:
""
,
Name
:
""
,
Id
:
null
as
Number
},
if
(
slide
.
FiledTypeStr
){
Obj
=
{
...
slide
,
}
}
else
{
Obj
=
{
...
slide
,
FiledTypeStr
:
getHtmlPlainText
(
slide
.
content
),
TemplateList
:
datas
.
DataSource
.
jd
,
TemplateDataSource
:
{
Content
:
''
,
Name
:
''
,
Id
:
null
as
Number
},
}
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
...
...
src/views/Editor/Toolbar/SlideDesignPanel.vue
View file @
b0b2e3cc
...
...
@@ -345,10 +345,66 @@ const {
}
=
useSlideTheme
()
datas
.
DataSource
=
inject
(
injectKeyDataSource
).
DataSource
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
//提取字符串中的文字
const
getHtmlPlainText
=
(
html_str
)
=>
{
let
re
=
new
RegExp
(
'<[^<>]+>'
,
'g'
)
if
(
html_str
)
{
let
text
=
html_str
.
replace
(
re
,
''
)
return
text
}
else
{
return
''
}
}
// 所有数据源
const
AllDataSource
=
()
=>
{
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
// 绑定数据源
const
newElements
=
slides
.
value
.
find
((
slide
,
indexs
)
=>
{
return
slideIndex
.
value
==
indexs
})
datas
.
DataSource
.
DataSourceList
=
[]
newElements
.
elements
.
forEach
(
slide
=>
{
let
Obj
=
{}
if
(
slide
.
type
==
"text"
){
if
(
slide
.
FiledTypeStr
){
Obj
=
{
...
slide
,
}
}
else
{
Obj
=
{
...
slide
,
FiledTypeStr
:
getHtmlPlainText
(
slide
.
content
),
TemplateList
:
datas
.
DataSource
.
jc
,
TemplateDataSource
:
{
Content
:
''
,
Name
:
''
,
Id
:
null
as
Number
},
}
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
if
(
slide
.
type
==
"image"
){
if
(
slide
.
FiledTypeStr
){
Obj
=
{
...
slide
,
}
}
else
{
Obj
=
{
...
slide
,
FiledTypeStr
:
getHtmlPlainText
(
slide
.
content
),
TemplateList
:
datas
.
DataSource
.
jd
,
TemplateDataSource
:
{
Content
:
''
,
Name
:
''
,
Id
:
null
as
Number
},
}
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
})
}
// 设置背景模式:纯色、图片、渐变色
...
...
src/views/Editor/index.vue
View file @
b0b2e3cc
...
...
@@ -30,12 +30,13 @@
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
provide
}
from
'vue'
import
{
ref
,
reactive
,
provide
,
watch
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
useMainStore
}
from
'@/store'
import
useGlobalHotkey
from
'@/hooks/useGlobalHotkey'
import
usePasteEvent
from
'@/hooks/usePasteEvent'
import
{
injectKeyDataSource
}
from
'@/types/injectKey'
import
{
useSlidesStore
}
from
'@/store'
import
EditorHeader
from
'./EditorHeader/index.vue'
import
Canvas
from
'./Canvas/index.vue'
...
...
@@ -93,10 +94,11 @@ const closeExportDialog = () => mainStore.setDialogForExport('')
const
remarkHeight
=
ref
(
40
)
useGlobalHotkey
()
usePasteEvent
()
provide
(
injectKeyDataSource
,
datas
)
provide
(
injectKeyDataSource
,
datas
.
DataSource
)
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
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