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
8ce7b529
Commit
8ce7b529
authored
Dec 19, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化 销售 返回上一页
parent
88d6c117
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
58 deletions
+102
-58
sellTemplate.ts
src/store/sellTemplate.ts
+6
-2
index.vue
src/views/Editor/EditorHeader/index.vue
+40
-17
index.vue
src/views/Editor/Thumbnails/index.vue
+37
-31
ElementTemplateData.vue
src/views/Editor/Toolbar/ElementTemplateData.vue
+10
-3
Index.vue
src/views/Market/Index.vue
+9
-5
No files found.
src/store/sellTemplate.ts
View file @
8ce7b529
import
{
fa
}
from
'element-plus/es/locale'
import
{
defineStore
}
from
'pinia'
export
interface
SalesState
{
SalesEditor
:
number
,
SalesBack
:
number
,
}
export
const
useSellTemplate
=
defineStore
(
'sales'
,
{
state
:
():
SalesState
=>
({
SalesEditor
:
0
,
// 1 新增 2编辑
SalesEditor
:
0
,
// 1 新增 2编辑
SalesBack
:
0
,
// 0
}),
actions
:
{
setSalesEditor
(
SalesEditor
:
number
)
{
this
.
SalesEditor
=
SalesEditor
},
setSalesBack
(
SalesBack
:
number
)
{
this
.
SalesBack
=
SalesBack
},
},
})
\ No newline at end of file
src/views/Editor/EditorHeader/index.vue
View file @
8ce7b529
...
...
@@ -39,16 +39,16 @@
<Input
class=
"title-input"
ref=
"titleInputRef"
v-model:value=
"
queryObj.Titl
e"
v-model:value=
"
titleValu
e"
@
blur=
"handleUpdateTitle()"
v-if=
"editingTitle"
></Input>
<div
class=
"title-text"
@
click=
"startEditTitle()"
:title=
"
queryObj.T
itle"
:title=
"
t
itle"
v-else
>
{{
queryObj.T
itle }}
</div>
>
{{
t
itle }}
</div>
</div>
</div>
...
...
@@ -139,8 +139,9 @@ const mainStore = useMainStore()
const
slidesStore
=
useSlidesStore
()
const
layoutsStore
=
useSlidesStore
()
const
{
title
,
slides
,
slideIndex
,
viewportRatio
}
=
storeToRefs
(
slidesStore
)
const
{
SalesEditor
}
=
storeToRefs
(
useSellTemplate
())
const
{
SalesEditor
,
SalesBack
}
=
storeToRefs
(
useSellTemplate
())
const
SalesEditorStore
=
useSellTemplate
()
const
SalesBackStore
=
useSellTemplate
()
const
{
enterScreening
,
enterScreeningFromStart
}
=
useScreening
()
const
{
importSpecificFile
,
importPPTXFile
,
exporting
}
=
useImport
()
const
{
resetSlides
}
=
useSlideHandler
()
...
...
@@ -190,14 +191,24 @@ const goBack = (type:any) =>{
},
}
]
if
(
(
model
.
value
&&
model
.
value
!=
2
)
||!
typ
e
)
{
if
(
model
.
valu
e
)
{
setTimeout
(()
=>
{
searchData
.
value
.
TempId
=
0
if
(
type
)
marketStore
.
setMarket
(
true
)
if
(
!
type
)
SalesEditorStore
.
setSalesEditor
(
0
)
slidesStore
.
setSlides
(
list
)
layoutsStore
.
setLayouts
([])
CoverImgStore
.
setCoverImg
(
null
)
if
(
type
)
{
searchData
.
value
.
TempId2
=
searchData
.
value
.
TempId
searchData
.
value
.
TempId
=
0
marketStore
.
setMarket
(
true
)
SalesBackStore
.
setSalesBack
(
1
)
}
else
{
searchData
.
value
.
TempId
=
0
SalesBackStore
.
setSalesBack
(
0
)
SalesEditorStore
.
setSalesEditor
(
0
)
}
if
(
SalesBack
.
value
==
0
){
slidesStore
.
setSlides
(
list
)
layoutsStore
.
setLayouts
([])
CoverImgStore
.
setCoverImg
(
null
)
}
},
200
)
return
}
...
...
@@ -211,12 +222,22 @@ const goBack = (type:any) =>{
}
).
then
(()
=>
{
searchData
.
value
.
TempId
=
0
if
(
type
)
marketStore
.
setMarket
(
true
)
if
(
!
type
)
SalesEditorStore
.
setSalesEditor
(
0
)
slidesStore
.
setSlides
(
list
)
slidesStore
.
setThumbnails
([])
layoutsStore
.
setLayouts
([])
CoverImgStore
.
setCoverImg
(
null
)
if
(
type
)
{
searchData
.
value
.
TempId2
=
searchData
.
value
.
TempId
searchData
.
value
.
TempId
=
0
marketStore
.
setMarket
(
true
)
SalesBackStore
.
setSalesBack
(
1
)
}
else
{
searchData
.
value
.
TempId
=
0
SalesBackStore
.
setSalesBack
(
0
)
SalesEditorStore
.
setSalesEditor
(
0
)
}
if
(
SalesBack
.
value
==
0
){
slidesStore
.
setSlides
(
list
)
slidesStore
.
setThumbnails
([])
layoutsStore
.
setLayouts
([])
CoverImgStore
.
setCoverImg
(
null
)
}
}).
catch
(()
=>
{})
}
...
...
@@ -383,6 +404,7 @@ const SetTripTemplateConfig = async () => {
}
// 保存
const
setTemplate
=
async
()
=>
{
queryObj
.
value
.
Title
=
title
.
value
datas
.
loading
=
true
if
(
SourceLoading
.
value
)
setNewDatasList
(
datas
.
DataSource
)
...
...
@@ -464,6 +486,7 @@ const startEditTitle = () => {
const
handleUpdateTitle
=
()
=>
{
slidesStore
.
setTitle
(
titleValue
.
value
)
editingTitle
.
value
=
false
queryObj
.
value
.
Title
=
titleValue
.
value
}
const
goLink
=
(
url
:
string
)
=>
{
...
...
src/views/Editor/Thumbnails/index.vue
View file @
8ce7b529
...
...
@@ -51,7 +51,7 @@
<
script
lang=
"ts"
setup
>
import
{
computed
,
nextTick
,
ref
,
reactive
,
watch
,
inject
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
useMainStore
,
useSlidesStore
,
useKeyboardStore
,
useScreenStore
}
from
'@/store'
import
{
useMainStore
,
useSlidesStore
,
useKeyboardStore
,
useScreenStore
,
useSellTemplate
}
from
'@/store'
import
{
fillDigit
}
from
'@/utils/common'
import
{
isElementInViewport
}
from
'@/utils/element'
import
type
{
ContextmenuItem
}
from
'@/components/Contextmenu/types'
...
...
@@ -78,6 +78,7 @@ const keyboardStore = useKeyboardStore()
const
{
selectedSlidesIndex
:
_selectedSlidesIndex
,
thumbnailsFocus
}
=
storeToRefs
(
mainStore
)
const
{
slides
,
currentSlide
,
slideIndex
,
layoutSlides
}
=
storeToRefs
(
slidesStore
)
const
{
ctrlKeyState
,
shiftKeyState
}
=
storeToRefs
(
keyboardStore
)
const
{
SalesEditor
,
SalesBack
}
=
storeToRefs
(
useSellTemplate
())
const
{
slidesLoadLimit
}
=
useLoadSlides
()
const
TemplateTypeStore
=
useScreenStore
()
...
...
@@ -336,7 +337,7 @@ const ResolveTripDaysHandler = (items)=>{
// 获取行程模版数据
const
GetTripTemplate
=
async
()
=>
{
if
(
!
searchData
.
value
.
TempId
&&!
TempId
.
value
&&!
searchData
.
value
.
sellTempId
)
{
if
(
!
searchData
.
value
.
TempId
&&!
searchData
.
value
.
TempId2
&&!
TempId
.
value
&&!
searchData
.
value
.
sellTempId
)
{
let
list
=
[
{
id
:
'test-slide-1'
,
...
...
@@ -355,42 +356,48 @@ const GetTripTemplate = async () =>{
TempId
:
0
}
if
(
searchData
.
value
.
TempId
)
queryMsg
.
TempId
=
searchData
.
value
.
TempId
else
if
(
searchData
.
value
.
TempId2
&&!
searchData
.
value
.
TempId
)
queryMsg
.
TempId
=
searchData
.
value
.
TempId2
else
if
(
searchData
.
value
.
sellTempId
)
queryMsg
.
TempId
=
searchData
.
value
.
sellTempId
else
if
(
TempId
.
value
)
queryMsg
.
TempId
=
TempId
.
value
let
dataRes
=
await
ConfigService
.
GetTripTemplateSlide
(
queryMsg
);
if
(
dataRes
.
data
.
resultCode
==
1
)
{
let
viewportRatio
=
1.414
if
(
dataRes
.
data
.
data
.
TempType
==
1
)
viewportRatio
=
0.7069
slidesStore
.
setViewportRatio
(
viewportRatio
)
if
(
SalesBack
.
value
==
0
||
(
SalesBack
.
value
==
1
&&
searchData
.
value
.
TempId
)){
let
viewportRatio
=
1.414
if
(
dataRes
.
data
.
data
.
TempType
==
1
)
viewportRatio
=
0.7069
slidesStore
.
setViewportRatio
(
viewportRatio
)
let
SlidesData
=
JSON
.
parse
(
dataRes
.
data
.
data
.
TempData
)
let
newSlides
=
[]
if
(
typeof
SlidesData
==
'object'
&&!
SlidesData
.
length
){
let
obj
=
{
pageType
:
1
,
...
SlidesData
}
newSlides
.
push
(
obj
)
}
else
if
(
SlidesData
.
length
>
0
){
newSlides
=
SlidesData
}
newSlides
.
forEach
(
x
=>
{
x
.
elements
.
forEach
(
y
=>
{
if
(
x
.
pageType
!=
1
&&
y
.
TemplateDataSource
&&
y
.
TemplateDataSource
.
index
==
null
){
Reflect
.
set
(
y
.
TemplateDataSource
,
'index'
,
null
)
let
SlidesData
=
JSON
.
parse
(
dataRes
.
data
.
data
.
TempData
)
let
newSlides
=
[]
if
(
typeof
SlidesData
==
'object'
&&!
SlidesData
.
length
){
let
obj
=
{
pageType
:
1
,
...
SlidesData
}
newSlides
.
push
(
obj
)
}
else
if
(
SlidesData
.
length
>
0
){
newSlides
=
SlidesData
}
newSlides
.
forEach
(
x
=>
{
x
.
elements
.
forEach
(
y
=>
{
if
(
x
.
pageType
!=
1
&&
y
.
TemplateDataSource
&&
y
.
TemplateDataSource
.
index
==
null
){
Reflect
.
set
(
y
.
TemplateDataSource
,
'index'
,
null
)
}
})
})
})
console
.
log
(
newSlides
,
'=======模版数据newSlides'
)
slidesStore
.
setSlides
(
newSlides
)
layoutsStore
.
setLayouts
(
JSON
.
parse
(
JSON
.
stringify
(
newSlides
)))
CoverImgStore
.
setCoverImg
(
dataRes
.
data
.
data
.
CoverImg
)
console
.
log
(
newSlides
,
'=======模版数据newSlides'
)
slidesStore
.
setSlides
(
newSlides
)
layoutsStore
.
setLayouts
(
JSON
.
parse
(
JSON
.
stringify
(
newSlides
)))
CoverImgStore
.
setCoverImg
(
dataRes
.
data
.
data
.
CoverImg
)
slidesStore
.
updateSlideIndex
(
0
)
datas
.
DataSource
.
pageType
=
newSlides
[
0
].
pageType
slidesStore
.
setTitle
(
dataRes
.
data
.
data
.
Title
)
}
queryObj
.
value
.
TempId
=
dataRes
.
data
.
data
.
TempId
queryObj
.
value
.
LineId
=
dataRes
.
data
.
data
.
LineId
queryObj
.
value
.
LineName
=
dataRes
.
data
.
data
.
LineName
queryObj
.
value
.
LtId
=
dataRes
.
data
.
data
.
LtId
queryObj
.
value
.
Title
=
dataRes
.
data
.
data
.
Title
queryObj
.
value
.
TempData
=
dataRes
.
data
.
data
.
TempData
queryObj
.
value
.
CoverImg
=
dataRes
.
data
.
data
.
CoverImg
queryObj
.
value
.
CountryName
=
dataRes
.
data
.
data
.
CountryName
...
...
@@ -398,8 +405,8 @@ const GetTripTemplate = async () =>{
queryObj
.
value
.
ColorName
=
dataRes
.
data
.
data
.
ColorName
queryObj
.
value
.
ColorStr
=
dataRes
.
data
.
data
.
ColorStr
queryObj
.
value
.
TempType
=
dataRes
.
data
.
data
.
TempType
slidesStore
.
updateSlideIndex
(
0
)
datas
.
DataSource
.
pageType
=
newSlides
[
0
].
pageType
if
(
searchData
.
value
.
sellId
)
sellGetTripTemplate
()
if
(
ConfigId
.
value
==
0
)
return
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
await
GetTripConfig
()
...
...
@@ -421,8 +428,8 @@ const sellGetTripTemplate = async () =>{
let
dataRes
=
await
ConfigService
.
sellGetTemplateDetails
(
queryMsg
);
if
(
dataRes
.
data
.
resultCode
==
1
)
{
let
dataObj
=
dataRes
.
data
.
data
queryObj
.
value
.
Title
=
dataRes
.
data
.
data
.
Title
if
(
!
searchData
.
value
.
TempId
){
slidesStore
.
setTitle
(
dataRes
.
data
.
data
.
Title
)
if
(
SalesBack
.
value
==
0
&&
searchData
.
value
.
sell
TempId
){
let
SlidesData
=
JSON
.
parse
(
dataObj
.
TempData
)
let
newSlides
=
[]
await
SlidesData
.
forEach
((
x
,
i
)
=>
{
...
...
@@ -623,7 +630,6 @@ const contextmenusThumbnailItem = (): ContextmenuItem[] => {
},
]
}
GetTripTemplate
()
</
script
>
...
...
src/views/Editor/Toolbar/ElementTemplateData.vue
View file @
8ce7b529
...
...
@@ -37,7 +37,8 @@
<p
class=
"q-mt-md"
><span
class=
"Required q-mr-md"
>
*
</span>
模版名称:
</p>
<div
class=
"row wrap q-mt-md"
>
<el-input
v-model=
"queryObj.Title"
placeholder=
"输入模板名称"
class=
"input-with-select"
></el-input>
<el-input
v-model=
"titleValue"
@
blur=
"handleUpdateTitle()"
placeholder=
"输入模板名称"
class=
"input-with-select"
></el-input>
</div>
<p
class=
"q-mt-md"
><span
class=
"Required q-mr-md"
>
*
</span>
国家:
</p>
<div
class=
"row wrap q-mt-md"
>
...
...
@@ -237,8 +238,9 @@
}
const
slidesStore
=
useSlidesStore
()
const
{
slides
,
slideIndex
,
viewportRatio
}
=
storeToRefs
(
slidesStore
)
const
{
title
,
slides
,
slideIndex
,
viewportRatio
}
=
storeToRefs
(
slidesStore
)
const
titleValue
=
ref
(
''
)
titleValue
.
value
=
title
.
value
const
coverImgStore
=
useScreenStore
()
const
isCoverImgStore
=
useScreenStore
()
const
{
model
,
ConfigId
,
TemplateDataSource
,
TemplateType
,
CoverImg
,
isCoverImg
,
TempId
,
SourceLoading
}
=
storeToRefs
(
useScreenStore
())
...
...
@@ -254,6 +256,11 @@
})
const
handleUpdateTitle
=
()
=>
{
slidesStore
.
setTitle
(
titleValue
.
value
)
queryObj
.
value
.
Title
=
titleValue
.
value
}
const
CancelAddColor
=
()
=>
{
datas
.
addColorsShow
=
false
datas
.
addColor
=
{
...
...
src/views/Market/Index.vue
View file @
8ce7b529
...
...
@@ -18,7 +18,7 @@
size=
"small"
icon=
"Plus"
@
click=
"addTemplate()"
style=
"color: #ffff;"
></el-button>
<el-button
v-if=
"SalesEditor>0"
v-tooltip=
"'返回到首页'"
type=
"primary"
v-tooltip=
"
SalesBack==1?'返回到上页':
'返回到首页'"
type=
"primary"
size=
"small"
@
click=
"CloseTemplate()"
style=
"color: #ffff;"
>
返回
<el-icon
class=
"el-icon--right"
><ArrowRightBold
/></el-icon>
...
...
@@ -34,7 +34,7 @@
class=
"text-small q-mr-md"
v-for=
"x in lines"
:key=
"x.LineID"
>
{{x.LineName}}
</el-check-tag>
</div>
<el-divider
style=
"margin:12px 0;border-top-color:#f3f6fb;"
></el-divider>
<div
class=
"row wrap q-pb-md"
>
<div
class=
"row wrap
items-center
q-pb-md"
>
<div
class=
"q-pb-md"
>
<div
class=
"row text-small items-center wrap"
>
<span
style=
"margin-right: 50px;"
>
适用国家:
</span>
...
...
@@ -178,7 +178,7 @@
import
LineService
from
'@/services/LineService'
import
ConfigService
from
'@/services/ConfigService'
import
{
userStore
}
from
"@/store/user"
;
import
{
useSlidesStore
,
useSellTemplate
}
from
'@/store'
import
{
useSlidesStore
,
useSellTemplate
}
from
'@/store'
import
{
useScreenStore
}
from
"@/store/screen"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
...
...
@@ -230,7 +230,7 @@
const
{
screening
,
market
,
model
,
isModel
,
ConfigId
,
TempId
}
=
storeToRefs
(
useScreenStore
())
const
SalesEditorStore
=
useSellTemplate
()
const
{
SalesEditor
}
=
storeToRefs
(
useSellTemplate
())
const
{
SalesEditor
,
SalesBack
}
=
storeToRefs
(
useSellTemplate
())
const
addTemplate
=
()
=>
{
marketStore
.
setMarket
(
!
market
)
...
...
@@ -238,7 +238,11 @@
}
const
CloseTemplate
=
()
=>
{
SalesEditorStore
.
setSalesEditor
(
0
)
if
(
SalesBack
.
value
==
1
){
marketStore
.
setMarket
(
false
)
SalesEditorStore
.
setSalesEditor
(
SalesEditor
.
value
)
}
else
SalesEditorStore
.
setSalesEditor
(
0
)
}
// 删除模版
const
deleteTemplate
=
(
item
:
any
)
=>
{
...
...
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