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
027d6589
Commit
027d6589
authored
Nov 21, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
d45ff1fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
50 deletions
+68
-50
index.vue
src/views/Editor/DataaSource/index.vue
+14
-6
index.vue
src/views/Editor/Thumbnails/index.vue
+53
-2
SlideDesignPanel.vue
src/views/Editor/Toolbar/SlideDesignPanel.vue
+1
-42
No files found.
src/views/Editor/DataaSource/index.vue
View file @
027d6589
...
...
@@ -31,7 +31,8 @@
width=
"200"
>
<
template
#
default=
"scope"
>
<div
class=
"DataaSourceR"
v-if=
"scope.row.TemplateList"
>
<el-select
v-model=
"scope.row.TemplateObj.Name"
class=
"m-2"
placeholder=
"Select"
>
<el-select
v-model=
"scope.row.TemplateDataSource.Id"
class=
"m-2"
placeholder=
"Select"
@
change=
"setTemplateDataSource(scope.row.TemplateDataSource.Id,scope.$index)"
>
<el-option
v-for=
"item in scope.row.TemplateList"
:key=
"item.Id"
...
...
@@ -57,22 +58,29 @@
const
datas
=
reactive
({
DataSource
:{
DataSourceOverlay
:
false
,
DataSourceList
:[],
TemplateDataSource
:[]
//
DataSourceOverlay: false,
//
DataSourceList:[],
//
TemplateDataSource:[]
},
})
datas
.
DataSource
=
inject
(
injectKeyDataSource
).
DataSource
const
multipleTableRef
=
ref
<
InstanceType
<
typeof
any
>>
()
const
multipleSelection
=
ref
<
[]
>
([])
console
.
log
(
datas
.
DataSource
)
watch
(
datas
.
DataSource
,
(
n
,
o
)
=>
{
})
const
setTemplateDataSource
=
(
Id
,
index
)
=>
{
datas
.
DataSource
.
DataSourceList
.
forEach
((
x
,
indexs
)
=>
{
if
(
index
==
indexs
){
x
.
}
})
}
const
toggleSelection
=
(
rows
?:
[])
=>
{
if
(
rows
)
{
rows
.
forEach
((
row
)
=>
{
...
...
src/views/Editor/Thumbnails/index.vue
View file @
027d6589
...
...
@@ -47,7 +47,7 @@
</template>
<
script
lang=
"ts"
setup
>
import
{
computed
,
nextTick
,
ref
,
watch
}
from
'vue'
import
{
computed
,
nextTick
,
ref
,
reactive
,
watch
,
inject
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
useMainStore
,
useSlidesStore
,
useKeyboardStore
}
from
'@/store'
import
{
fillDigit
}
from
'@/utils/common'
...
...
@@ -56,6 +56,7 @@ import type { ContextmenuItem } from '@/components/Contextmenu/types'
import
useSlideHandler
from
'@/hooks/useSlideHandler'
import
useScreening
from
'@/hooks/useScreening'
import
useLoadSlides
from
'@/hooks/useLoadSlides'
import
{
injectKeyDataSource
}
from
'@/types/injectKey'
import
ThumbnailSlide
from
'@/views/components/ThumbnailSlide/index.vue'
import
LayoutPool
from
'./LayoutPool.vue'
...
...
@@ -87,6 +88,11 @@ const {
sortSlides
,
}
=
useSlideHandler
()
const
datas
=
reactive
({
DataSource
:{}
})
datas
.
DataSource
=
inject
(
injectKeyDataSource
).
DataSource
// 页面被切换时
const
thumbnailsRef
=
ref
<
InstanceType
<
typeof
Draggable
>>
()
watch
(()
=>
slideIndex
.
value
,
()
=>
{
...
...
@@ -107,10 +113,54 @@ watch(() => slideIndex.value, () => {
})
})
//提取字符串中的文字
const
getHtmlPlainText
=
(
html_str
)
=>
{
let
re
=
new
RegExp
(
'<[^<>]+>'
,
'g'
)
if
(
html_str
)
{
let
text
=
html_str
.
replace
(
re
,
''
)
return
text
}
else
{
return
''
}
}
// 切换页面
const
changeSlideIndex
=
(
index
:
number
)
=>
{
mainStore
.
setActiveElementIdList
([])
// 数据源
const
newElements
=
slides
.
value
.
find
((
slide
,
indexs
)
=>
{
return
index
==
indexs
})
datas
.
DataSource
.
DataSourceList
=
[]
newElements
.
elements
.
forEach
(
slide
=>
{
if
(
slide
.
type
==
"text"
){
let
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
},
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
})
if
(
slideIndex
.
value
===
index
)
return
slidesStore
.
updateSlideIndex
(
index
)
}
...
...
@@ -125,6 +175,7 @@ const handleClickSlideThumbnail = (e: MouseEvent, index: number) => {
// 如果被取消选中的页面刚好是当前激活页面,则需要从其他被选中的页面中选择第一个作为当前激活页面
if
(
ctrlKeyState
.
value
)
{
if
(
slideIndex
.
value
===
index
)
{
if
(
!
isMultiSelected
)
return
const
newSelectedSlidesIndex
=
selectedSlidesIndex
.
value
.
filter
(
item
=>
item
!==
index
)
...
...
src/views/Editor/Toolbar/SlideDesignPanel.vue
View file @
027d6589
...
...
@@ -344,52 +344,11 @@ const {
applyThemeToAllSlides
,
}
=
useSlideTheme
()
//提取字符串中的文字
const
getHtmlPlainText
=
(
html_str
)
=>
{
let
re
=
new
RegExp
(
'<[^<>]+>'
,
'g'
)
if
(
html_str
)
{
let
text
=
html_str
.
replace
(
re
,
''
)
return
text
}
else
{
return
''
}
}
datas
.
DataSource
=
inject
(
injectKeyDataSource
).
DataSource
// 所有数据源
const
AllDataSource
=
()
=>
{
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
const
newElements
=
slides
.
value
.
find
((
slide
,
index
)
=>
{
return
slideIndex
.
value
==
index
})
datas
.
DataSource
.
DataSourceList
=
[]
newElements
.
elements
.
forEach
(
slide
=>
{
if
(
slide
.
type
==
"text"
){
let
Obj
=
{
...
slide
,
FiledTypeStr
:
getHtmlPlainText
(
slide
.
content
),
TemplateList
:
datas
.
DataSource
.
jc
,
TemplateObj
:
{
Content
:
""
,
Name
:
""
},
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
if
(
slide
.
type
==
"image"
){
let
Obj
=
{
...
slide
,
FiledTypeStr
:
slide
.
src
,
TemplateList
:
datas
.
DataSource
.
jd
,
TemplateObj
:
{
Content
:
""
,
Name
:
""
},
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
})
}
// 设置背景模式:纯色、图片、渐变色
...
...
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