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
ee767eee
Commit
ee767eee
authored
Dec 01, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成封面调整、数据源非必选调整,数据源可清空
parent
eafb1e8b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
32 deletions
+68
-32
index.vue
src/views/Editor/Canvas/index.vue
+8
-6
index.vue
src/views/Editor/DataaSource/index.vue
+20
-6
index.vue
src/views/Editor/EditorHeader/index.vue
+2
-2
index.vue
src/views/Editor/Thumbnails/index.vue
+2
-6
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+27
-4
Index.vue
src/views/Market/Index.vue
+9
-8
No files found.
src/views/Editor/Canvas/index.vue
View file @
ee767eee
...
...
@@ -94,7 +94,7 @@
<LinkDialog
@
close=
"linkDialogVisible = false"
/>
</Modal>
</div>
<div
style=
"position: relative;z-index: -1;"
>
<div
style=
"position: relative;z-index: -1;"
v-if=
"!model&&ConfigId&&slides.length>0"
>
<div
class=
"export-img-dialog"
>
<div
class=
"thumbnails-view"
>
<div
class=
"thumbnails"
v-for=
"slide in slides"
ref=
"FeatureImgRef"
>
...
...
@@ -193,11 +193,13 @@ const FeatureImgRef = ref(null)
// 将界面生成形成图
watch
(()
=>
slides
.
value
,
(
n
,
o
)
=>
{
FeatureImgStore
.
setFeatureImg
([])
if
(
FeatureImgRef
.
value
&&
FeatureImgRef
.
value
.
length
>
0
){
setTimeout
(()
=>
{
for
(
let
i
=
0
;
i
<
FeatureImgRef
.
value
.
length
;
i
++
){
exportFeatureImg
(
FeatureImgRef
.
value
[
i
],
'jpeg'
,
1
,
true
,
i
+
1
)
}
},
500
)
}
})
// 监听请求保存成功 重新请求数据
watch
(()
=>
FeatureImgRef
.
value
,
(
n
,
o
)
=>
{
...
...
src/views/Editor/DataaSource/index.vue
View file @
ee767eee
...
...
@@ -29,7 +29,8 @@
width=
"170"
>
<
template
#
default=
"scope"
>
<div
class=
"DataaSourceR"
v-if=
"scope.row.TemplateList"
>
<el-select
v-model=
"scope.row.TemplateDataSource.Id"
class=
"m-2"
<el-select
v-model=
"scope.row.TemplateDataSource.Id"
clearable
class=
"m-2"
placeholder=
"请绑定数据源"
@
change=
"setTemplateDataSource(scope.row.TemplateDataSource.Id,scope.$index)"
>
<!-- :disabled="scope.row.type=='image'&&item.Name.indexOf('图')==-1" -->
...
...
@@ -57,12 +58,20 @@
const
datas
=
reactive
({
DataSource
:{},
loading
:
false
,
//是否更新数据源
})
datas
.
DataSource
=
inject
(
injectKeyDataSource
)
const
slidesStore
=
useSlidesStore
()
const
{
slides
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
watch
(()
=>
datas
.
DataSource
.
DataSourceOverlay
,
(
n
,
o
)
=>
{
if
(
n
){
datas
.
loading
=
false
}
if
(
!
n
&&
datas
.
loading
){
setNewDatas
()
}
})
const
setType
=
(
x
)
=>
{
if
(
x
.
type
==
"image"
){
return
x
.
TemplateList
.
filter
(
item
=>
{
return
item
.
Name
.
indexOf
(
'图'
)
!=-
1
})
...
...
@@ -101,21 +110,26 @@
}
// 数据源关键数据赋值
const
setTemplateDataSource
=
(
Id
,
index
)
=>
{
datas
.
loading
=
true
datas
.
DataSource
.
DataSourceList
.
forEach
((
x
,
indexs
)
=>
{
if
(
index
==
indexs
){
let
obj
=
x
.
TemplateList
.
find
(
y
=>
{
return
y
.
Id
==
x
.
TemplateDataSource
.
Id
})
if
(
obj
){
x
.
TemplateDataSource
.
Content
=
obj
.
Content
x
.
TemplateDataSource
.
Name
=
obj
.
Name
}
else
{
x
.
TemplateDataSource
.
Content
=
''
x
.
TemplateDataSource
.
Name
=
''
}
// if(x.type=="text"){
// x.FiledTypeStr = obj.Name
// x.content = x.content.replace(getHtmlPlainText(x.content),obj.Name)
// }
}
})
setNewDatas
()
}
const
OffDataSource
=
()
=>
{
...
...
src/views/Editor/EditorHeader/index.vue
View file @
ee767eee
...
...
@@ -350,10 +350,10 @@ const setTemplate = async () =>{
type
:
'warning'
,
})
}
if
(
queryObj
.
value
.
Title
==
''
||!
queryObj
.
value
.
LineId
||
!
queryObj
.
value
.
LtId
if
(
queryObj
.
value
.
Title
==
''
||!
queryObj
.
value
.
LineId
||
queryObj
.
value
.
LineName
==
''
||
queryObj
.
value
.
CoverImg
==
''
||
queryObj
.
value
.
CountryName
==
''
||
queryObj
.
value
.
SeasonName
==
''
||
queryObj
.
value
.
ColorName
==
''
||
queryObj
.
value
.
ColorStr
==
''
||
queryObj
.
value
.
LineName
==
''
){
){
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
return
ElMessage
({
showClose
:
true
,
...
...
src/views/Editor/Thumbnails/index.vue
View file @
ee767eee
...
...
@@ -175,7 +175,6 @@ const GetTripFiledData = async () =>{
let
dataPath
=
y
.
TemplateDataSource
.
Content
.
split
(
'.'
)
let
value
=
JSON
.
parse
(
JSON
.
stringify
(
travel
));
dataPath
.
forEach
((
oo
,
i
)
=>
{
if
(
value
&&
value
[
oo
]){
if
(
i
==
0
&&
Array
.
isArray
(
value
[
oo
])){
let
temp
=
cursors
.
find
(
item
=>
item
.
key
==
oo
)
...
...
@@ -270,11 +269,8 @@ const GetTripTemplate = async () =>{
queryObj
.
value
.
ColorStr
=
dataRes
.
data
.
data
.
ColorStr
queryObj
.
value
.
TempType
=
dataRes
.
data
.
data
.
TempType
slidesStore
.
updateSlideIndex
(
0
)
if
(
ConfigId
.
value
==
0
||
TempId
.
value
)
{
if
(
TempId
.
value
)
await
GetTripConfig
()
return
}
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
await
GetTripConfig
()
if
(
ConfigId
.
value
==
0
)
return
await
GetTripFiledData
()
}
}
catch
(
error
)
{
...
...
src/views/Editor/Toolbar/ElementTemplateData.vue
View file @
ee767eee
<
template
>
<div
class=
"q-mt-xs bg-white q-pa-xs rounded ElementTemplateData"
>
<div
class=
"column text-mdall"
>
<div
class=
"column"
>
...
...
@@ -64,7 +65,7 @@
</el-select>
</div>
<
template
v-if=
"Series.length>0"
>
<p
class=
"q-mt-md"
><span
class=
"Required q-mr-md"
>
*
</span>
选择系列:
</p>
<p
class=
"q-mt-md"
><span
class=
"Required q-mr-md"
></span>
选择系列:
</p>
<div
class=
"row wrap q-mt-md"
>
<el-select
v-model=
"queryObj.LtId"
class=
"m-2"
filterable
placeholder=
"请选择系列"
>
...
...
@@ -101,7 +102,7 @@
+ 添加标签
</el-button>
</div>
<p
class=
"q-mt-md"
><span
class=
"Required q-mr-md"
>
*
</span>
选择颜色:
</p>
<p
class=
"q-mt-md"
><span
class=
"Required q-mr-md"
></span>
选择颜色:
</p>
<div
class=
"row wrap q-mt-md"
>
<el-select
v-model=
"queryObj.ColorStr"
class=
"m-2"
placeholder=
"请选择颜色"
@
change=
"setCountryValue"
>
...
...
@@ -126,6 +127,22 @@
</div>
</div>
</div>
<!-- 生成封面图 -->
<div
style=
"opacity: 0;position: absolute;left: 100px;"
v-if=
"model&&slides"
>
<div
class=
"export-img-dialog"
>
<div
class=
"thumbnails-view"
>
<div
class=
"thumbnails"
ref=
"FeatureImgRef"
>
<ThumbnailSlide
class=
"thumbnail"
:key=
"slides[slideIndex].id"
:slide=
"slides[slideIndex]"
:size=
"1600"
/>
</div>
</div>
</div>
</div>
</template>
<
script
lang=
"ts"
setup
>
...
...
@@ -138,6 +155,8 @@
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'
const
datas
=
reactive
({
DataSource
:{},
...
...
@@ -164,11 +183,14 @@
const
{
slides
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
const
isCoverImgStore
=
useScreenStore
()
const
{
TemplateDataSource
,
TemplateType
,
CoverImg
,
isCoverImg
}
=
storeToRefs
(
useScreenStore
())
const
{
model
,
ConfigId
,
TemplateDataSource
,
TemplateType
,
CoverImg
,
isCoverImg
}
=
storeToRefs
(
useScreenStore
())
const
mainStore
=
useMainStore
()
const
mainMenuVisible
=
ref
(
false
)
const
FeatureImgRef
=
ref
(
null
)
const
{
exportImage
}
=
useExport
()
watch
(()
=>
datas
.
DataSource
.
pageType
,
()
=>
{
const
newSlides
=
slides
.
value
newSlides
.
forEach
((
slide
,
indexs
)
=>
{
...
...
@@ -201,9 +223,10 @@
}
const
setDialogForExport
=
(
type
:
DialogForExportTypes
)
=>
{
mainStore
.
setDialogForExport
(
type
)
//
mainStore.setDialogForExport(type)
mainMenuVisible
.
value
=
false
isCoverImgStore
.
setIsCoverImg
(
true
)
exportImage
(
FeatureImgRef
.
value
,
'png'
,
1
,
true
)
}
const
setCountryValue
=
()
=>
{
...
...
src/views/Market/Index.vue
View file @
ee767eee
...
...
@@ -71,15 +71,15 @@
<div
class=
"MarketIndexListBox"
>
<div
class=
"MarketIndexList bg-white rounded"
>
<div
class=
"MarketIndexList-Hover"
>
<div
class=
"q-mr-lg"
>
<el-button
type=
"primary"
v-tooltip=
"'详情'"
icon=
"Tickets"
circle
style=
"color: #ffff;"
@
click=
"getTemplate(item)"
></el-button>
<div>
<el-button
type=
"primary"
style=
"color: #ffff;"
@
click=
"getTemplate(item)"
>
详情
</el-button>
</div>
<div
class=
"q-m
l
-lg"
>
<el-button
type=
"primary"
v-tooltip=
"'选择该模版'"
icon=
"Pointer"
circle
style=
"color: #ffff;"
@
click=
"goToTemplate(item)"
></el-button>
<div
class=
"q-m
t
-lg"
>
<el-button
type=
"primary"
style=
"color: #ffff;"
@
click=
"goToTemplate(item)"
>
选择该模版
</el-button>
</div>
</div>
<div
class=
"MarketIndexList-img"
>
...
...
@@ -383,6 +383,7 @@
-ms-transition
:
opacity
2s
ease
;
-o-transition
:
opacity
2s
ease
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
color
:
$themeHoverColor
;
...
...
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