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
d45ff1fc
Commit
d45ff1fc
authored
Nov 21, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e73c342c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
67 deletions
+145
-67
ConfigService.ts
src/services/ConfigService.ts
+6
-0
index.vue
src/views/Editor/DataaSource/index.vue
+90
-61
SlideDesignPanel.vue
src/views/Editor/Toolbar/SlideDesignPanel.vue
+15
-5
index.vue
src/views/Editor/index.vue
+34
-1
No files found.
src/services/ConfigService.ts
View file @
d45ff1fc
...
...
@@ -4,6 +4,12 @@ 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 @
d45ff1fc
<
template
>
<div
v-if=
"datas.DataSource.DataSourceOverlay"
>
<div
class=
"DataaSourceOverlay"
@
click=
"OffDataSource"
></div>
<div
class=
"DataaSource"
>
<el-table
:data=
"datas.DataSource.DataSourceList"
style=
"width: 100%"
>
<el-table-column
fixed
prop=
"date"
label=
"基础数据"
width=
"300"
>
<template
#
default=
"scope"
>
<div
class=
"DataaSourceL"
>
<div
v-if=
"scope.row.type=='text'"
>
{{
scope
.
row
.
FiledTypeStr
}}
</div>
<div
v-if=
"scope.row.type=='image'"
>
<el-image
style=
"width: 20px; height: 20px"
:src=
"scope.row.FiledTypeStr"
:preview-src-list=
"[scope.row.FiledTypeStr]"
>
</el-image>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
""
label=
"数据源"
>
<
template
#
default=
"scope"
>
<div
class=
"DataaSourceR"
>
<div
v-if=
"scope.row.type=='text'"
>
{{
scope
.
row
.
content
}}
</div>
<div
v-else
>
<el-image
style=
"width: 50px; height: 50px"
:src=
"scope.row.FiledTypeStr"
:preview-src-list=
"[scope.row.FiledTypeStr]"
>
</el-image>
</div>
</div>
</
template
>
</el-table-column>
</el-table>
<
template
>
<div
v-if=
"datas.DataSource.DataSourceOverlay"
>
<div
class=
"DataaSourceOverlay"
@
click=
"OffDataSource"
></div>
<div
class=
"DataaSource"
>
<div
class=
"DataaSourceList"
>
<el-table
ref=
"multipleTableRef"
:data=
"datas.DataSource.DataSourceList"
style=
"width: 100%"
border
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"40"
/>
<el-table-column
prop=
""
label=
"基础数据"
>
<template
#
default=
"scope"
>
<div
class=
"DataaSourceL"
>
<div
v-if=
"scope.row.type=='text'"
>
{{
scope
.
row
.
FiledTypeStr
}}
</div>
<div
v-if=
"scope.row.type=='image'"
>
<img
style=
"width: 20px; height: 20px"
:src=
"scope.row.FiledTypeStr"
/>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
""
label=
"绑定数据源"
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-option
v-for=
"item in scope.row.TemplateList"
:key=
"item.Id"
:label=
"item.Name"
:value=
"item.Id"
/>
</el-select>
</div>
</
template
>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
>
// import { ElTable } from 'element-plus'
import
{
computed
,
nextTick
,
ref
,
watch
,
reactive
,
inject
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
useSlidesStore
}
from
'@/store'
import
{
injectKeyDataSource
}
from
'@/types/injectKey'
const
datas
=
reactive
({
DataSource
:{}
})
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
watch
(
datas
.
DataSource
,
(
n
,
o
)
=>
{
})
const
OffDataSource
=
()
=>
{
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
}
const
datas
=
reactive
({
DataSource
:{
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
toggleSelection
=
(
rows
?:
[])
=>
{
if
(
rows
)
{
rows
.
forEach
((
row
)
=>
{
multipleTableRef
.
value
!
.
toggleRowSelection
(
row
,
undefined
)
})
}
else
{
multipleTableRef
.
value
!
.
clearSelection
()
}
}
const
handleSelectionChange
=
(
val
:
[])
=>
{
multipleSelection
.
value
=
val
}
const
OffDataSource
=
()
=>
{
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -91,9 +115,14 @@
background
:
#fff
;
overflow
:
auto
;
}
.DataaSourceList
{
border
:
1px
solid
#ebeef5
;
padding
:
20px
;
border-radius
:
5px
;
}
.DataaSourceL
{
font-weight
:
bold
;
color
:
black
;
font-size
:
1
5
px
;
font-size
:
1
4
px
;
}
</
style
>
\ No newline at end of file
src/views/Editor/Toolbar/SlideDesignPanel.vue
View file @
d45ff1fc
...
...
@@ -354,32 +354,42 @@ const getHtmlPlainText = (html_str) => {
return
''
}
}
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
.
DataSource
// 所有数据源
const
AllDataSource
=
()
=>
{
datas
.
DataSource
.
DataSourceOverlay
=
!
datas
.
DataSource
.
DataSourceOverlay
console
.
log
(
slideIndex
.
value
,
'-------'
)
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
)
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
FiledTypeStr
:
slide
.
src
,
TemplateList
:
datas
.
DataSource
.
jd
,
TemplateObj
:
{
Content
:
""
,
Name
:
""
},
}
datas
.
DataSource
.
DataSourceList
.
push
(
Obj
)
}
})
console
.
log
(
datas
.
DataSource
.
DataSourceList
,
'-------1111'
)
}
// 设置背景模式:纯色、图片、渐变色
...
...
src/views/Editor/index.vue
View file @
d45ff1fc
...
...
@@ -48,13 +48,45 @@ import SelectPanel from './SelectPanel.vue'
import
SearchPanel
from
'./SearchPanel.vue'
import
Modal
from
'@/components/Modal.vue'
import
DataaSource
from
'./DataaSource/index.vue'
import
ConfigService
from
'@/services/ConfigService'
const
datas
=
reactive
({
DataSource
:{
DataSourceOverlay
:
false
,
DataSourceList
:[]
DataSourceList
:[],
TemplateDataSource
:[],
jc
:[],
//基础
jd
:[],
//酒店
jq
:[],
//景区
cs
:[],
//餐食
},
})
// 数据源
const
GetTripFiled
=
async
()
=>
{
try
{
let
TemplateRes
=
await
ConfigService
.
TemplateGetTripFiled
();
if
(
TemplateRes
.
data
.
resultCode
==
1
)
{
datas
.
DataSource
.
TemplateDataSource
=
TemplateRes
.
data
.
data
datas
.
DataSource
.
jc
=
datas
.
DataSource
.
TemplateDataSource
.
filter
(
x
=>
{
return
x
.
FiledType
==
1
})
datas
.
DataSource
.
jd
=
datas
.
DataSource
.
TemplateDataSource
.
filter
(
x
=>
{
return
x
.
FiledType
==
2
})
datas
.
DataSource
.
jq
=
datas
.
DataSource
.
TemplateDataSource
.
filter
(
x
=>
{
return
x
.
FiledType
==
3
})
datas
.
DataSource
.
cs
=
datas
.
DataSource
.
TemplateDataSource
.
filter
(
x
=>
{
return
x
.
FiledType
==
4
})
}
}
catch
(
error
)
{
console
.
log
(
"TemplateGetTripFiled"
,
error
);
}
}
GetTripFiled
()
const
mainStore
=
useMainStore
()
const
{
dialogForExport
,
showSelectPanel
,
showSearchPanel
}
=
storeToRefs
(
mainStore
)
const
closeExportDialog
=
()
=>
mainStore
.
setDialogForExport
(
''
)
...
...
@@ -63,6 +95,7 @@ const remarkHeight = ref(40)
useGlobalHotkey
()
usePasteEvent
()
provide
(
injectKeyDataSource
,
datas
)
</
script
>
...
...
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