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
8c555eed
Commit
8c555eed
authored
Nov 30, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app.vue调整获取模版接口
parent
4921f3e0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
45 deletions
+70
-45
App.vue
src/App.vue
+35
-4
screen.ts
src/store/screen.ts
+5
-0
index.vue
src/views/Editor/EditorHeader/index.vue
+7
-4
index.vue
src/views/Editor/Thumbnails/index.vue
+2
-1
index.vue
src/views/Editor/index.vue
+14
-10
Index.vue
src/views/Market/Index.vue
+7
-26
No files found.
src/App.vue
View file @
8c555eed
...
...
@@ -16,6 +16,7 @@ import { deleteDiscardedDB } from '@/utils/database'
import
{
isPC
,
query
}
from
'./utils/common'
import
{
userStore
}
from
'./store/user'
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
import
ConfigService
from
'@/services/ConfigService'
import
Editor
from
'./views/Editor/index.vue'
import
Screen
from
'./views/Screen/index.vue'
...
...
@@ -30,21 +31,24 @@ const isFinish = ref(false)
const
_isPC
=
isPC
()
const
mainStore
=
useMainStore
()
const
snapshotStore
=
useSnapshotStore
()
const
modelStore
=
useScreenStore
()
const
ConfigIdStore
=
useScreenStore
()
const
marketStore
=
useScreenStore
()
const
isModelStore
=
useScreenStore
()
const
TempIdStore
=
useScreenStore
()
const
{
databaseId
}
=
storeToRefs
(
mainStore
)
const
{
screening
,
market
,
model
,
ConfigId
}
=
storeToRefs
(
useScreenStore
())
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
window
.
onbeforeunload
=
()
=>
false
}
const
userLoginHandler
=
async
()
=>
{
let
param
=
query
()
let
userId
=
1
let
ConfigId
=
0
// 9117
let
ConfigId
=
9117
// 9117
let
model
=
1
if
(
param
.
uid
)
userId
=
parseInt
(
param
.
uid
)
if
(
param
.
ConfigId
)
ConfigId
=
parseInt
(
param
.
ConfigId
)
...
...
@@ -52,7 +56,8 @@ const userLoginHandler = async ()=>{
ConfigIdStore
.
setConfigId
(
ConfigId
)
modelStore
.
setModel
(
model
)
try
{
await
userStore
().
setUserLoginAsync
(
userId
)
await
userStore
().
setUserLoginAsync
(
userId
,
ConfigId
)
if
(
ConfigId
)
await
GetTripConfig
(
ConfigId
)
}
catch
(
error
)
{
}
...
...
@@ -69,7 +74,6 @@ const userLoginHandler = async ()=>{
.
catch
(()
=>
{})
}
userLoginHandler
()
onMounted
(
async
()
=>
{
await
deleteDiscardedDB
()
...
...
@@ -77,6 +81,33 @@ onMounted(async () => {
mainStore
.
setAvailableFonts
()
})
/**
* 根据团期配置编号获取行程详情
*/
const
GetTripConfig
=
async
(
ConfigId
)
=>
{
try
{
let
queryMsg
=
{
ConfigId
:
ConfigId
}
let
datasRes
=
await
ConfigService
.
triptemplateGetTripConfig
(
queryMsg
);
if
(
datasRes
.
data
.
resultCode
==
1
)
{
if
(
datasRes
.
data
.
data
&&
datasRes
.
data
.
data
.
length
>
0
&&
datasRes
.
data
.
data
[
0
].
TempId
){
isModelStore
.
setIsModel
(
true
)
marketStore
.
setMarket
(
!
market
)
TempIdStore
.
setTempId
(
datasRes
.
data
.
data
[
0
].
TempId
)
}
}
else
{
return
ElMessage
({
showClose
:
true
,
message
:
datasRes
.
data
.
message
,
type
:
'warning'
,
})
}
}
catch
(
error
)
{
console
.
log
(
"triptemplate_GetTripConfig"
,
error
);
}
}
userLoginHandler
()
// 应用注销时向 localStorage 中记录下本次 indexedDB 的数据库ID,用于之后清除数据库
window
.
addEventListener
(
'unload'
,
()
=>
{
const
discardedDB
=
localStorage
.
getItem
(
LOCALSTORAGE_KEY_DISCARDED_DB
)
...
...
src/store/screen.ts
View file @
8c555eed
...
...
@@ -9,6 +9,7 @@ export interface ScreenState {
ConfigId
:
number
,
TemplateType
:
[],
TemplateDataSource
:
[],
TempId
:
number
,
CoverImg
:
any
,
isCoverImg
:
boolean
,
dataLoading
:
boolean
,
...
...
@@ -25,6 +26,7 @@ export const useScreenStore = defineStore('screen', {
ConfigId
:
0
,
TemplateType
:
[],
// 数据源分类
TemplateDataSource
:
[],
// 所有数据源
TempId
:
0
,
CoverImg
:
null
,
// 封面图
isCoverImg
:
false
,
// 封面
dataLoading
:
false
,
// 记录保存是否成功
...
...
@@ -62,6 +64,9 @@ export const useScreenStore = defineStore('screen', {
setTemplateDataSource
(
TemplateDataSource
:
[])
{
this
.
TemplateDataSource
=
TemplateDataSource
},
setTempId
(
TempId
:
number
)
{
this
.
TempId
=
TempId
},
setDataLoading
(
dataLoading
:
boolean
)
{
this
.
dataLoading
=
dataLoading
},
...
...
src/views/Editor/EditorHeader/index.vue
View file @
8c555eed
...
...
@@ -157,9 +157,10 @@ searchData.value = inject(injectKeyTemplate)
const
marketStore
=
useScreenStore
()
const
CoverImgStore
=
useScreenStore
()
const
dataLoadingStore
=
useScreenStore
()
const
TempIdStore
=
useScreenStore
()
const
psdVisibleStatus
=
ref
(
false
)
const
{
market
,
model
,
ConfigId
,
CoverImg
,
dataLoading
}
=
storeToRefs
(
useScreenStore
())
const
{
market
,
model
,
ConfigId
,
CoverImg
,
dataLoading
,
TempId
}
=
storeToRefs
(
useScreenStore
())
// 返回到首页
const
goBack
=
()
=>
{
...
...
@@ -175,7 +176,8 @@ const goBack = () =>{
}
]
if
(
model
.
value
)
{
searchData
.
value
.
TempId
=
0
// searchData.value.TempId = 0
TempIdStore
.
setTempId
(
0
)
marketStore
.
setMarket
(
true
)
slidesStore
.
setSlides
(
list
)
layoutsStore
.
setLayouts
([])
...
...
@@ -192,7 +194,8 @@ const goBack = () =>{
}
)
.
then
(()
=>
{
searchData
.
value
.
TempId
=
0
// searchData.value.TempId = 0
TempIdStore
.
setTempId
(
0
)
marketStore
.
setMarket
(
true
)
slidesStore
.
setSlides
(
list
)
layoutsStore
.
setLayouts
([])
...
...
@@ -275,6 +278,7 @@ const SetTripTemplateConfig = async () => {
}
// 保存
const
setTemplate
=
async
()
=>
{
console
.
log
(
queryObj
.
value
,
'-------'
)
if
(
dataLoading
.
value
){
dataLoadingStore
.
setDataLoading
(
false
)
}
...
...
@@ -322,7 +326,6 @@ const setTemplate = async () =>{
// }
// }
}
console
.
log
(
queryObj
.
value
,
'-------'
)
queryObj
.
value
.
TempData
=
JSON
.
stringify
(
slides
.
value
)
datas
.
loading
=
true
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
...
...
src/views/Editor/Thumbnails/index.vue
View file @
8c555eed
...
...
@@ -64,6 +64,7 @@ import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import
LayoutPool
from
'./LayoutPool.vue'
import
Popover
from
'@/components/Popover.vue'
import
Draggable
from
'vuedraggable'
const
mainStore
=
useMainStore
()
const
slidesStore
=
useSlidesStore
()
const
layoutsStore
=
useSlidesStore
()
...
...
@@ -76,7 +77,7 @@ const { slidesLoadLimit } = useLoadSlides()
const
TemplateTypeStore
=
useScreenStore
()
const
CoverImgStore
=
useScreenStore
()
const
dataLoadingStore
=
useScreenStore
()
const
{
ConfigId
,
TemplateDataSource
,
TemplateType
,
dataLoading
}
=
storeToRefs
(
TemplateTypeStore
)
const
{
ConfigId
,
TemplateDataSource
,
TemplateType
,
dataLoading
,
TempId
}
=
storeToRefs
(
TemplateTypeStore
)
const
selectedSlidesIndex
=
computed
(()
=>
[...
_selectedSlidesIndex
.
value
,
slideIndex
.
value
])
const
presetLayoutPopoverVisible
=
ref
(
false
)
...
...
src/views/Editor/index.vue
View file @
8c555eed
...
...
@@ -51,15 +51,27 @@ import Modal from '@/components/Modal.vue'
import
DataaSource
from
'./DataaSource/index.vue'
import
ConfigService
from
'@/services/ConfigService'
const
slidesStore
=
useSlidesStore
()
const
TemplateTypeStore
=
useScreenStore
()
const
TempDataSourceStore
=
useScreenStore
()
const
{
slides
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
const
{
TemplateType
,
ConfigId
,
TempId
}
=
storeToRefs
(
TemplateTypeStore
)
const
pageTypesList
=
ref
([]
as
any
)
const
searchData
=
ref
({}
as
any
)
searchData
.
value
=
inject
(
injectKeyTemplate
)
let
TempIds
=
0
if
(
TempId
.
value
&&!
searchData
.
value
.
TempId
)
TempIds
=
TempId
.
value
if
(
searchData
.
value
.
TempId
)
TempIds
=
searchData
.
value
.
TempId
const
datas
=
reactive
({
DataSource
:{
FeatureImgList
:
[],
ConfigId
:
inject
(
injectKeyTemplate
).
ConfigId
?
inject
(
injectKeyTemplate
).
ConfigId
:
0
,
ConfigId
:
ConfigId
.
value
?
ConfigId
.
value
:
0
,
pageType
:
1
,
//1基础 2酒店 3景 4餐
DataSourceOverlay
:
false
,
DataSourceList
:[],
queryObj
:{
TempId
:
inject
(
injectKeyTemplate
).
TempId
?
inject
(
injectKeyTemplate
).
TempId
:
0
,
//编号(新增传0) 是 [int]
TempId
:
TempIds
,
//编号(新增传0) 是 [int]
LineId
:
null
,
//线路Id 是 [int]
LineName
:
''
,
//线路名称 是 [string]
LtId
:
null
,
//系列Id 是 [int]
...
...
@@ -77,14 +89,6 @@ const datas = reactive({
})
const
slidesStore
=
useSlidesStore
()
const
TemplateTypeStore
=
useScreenStore
()
const
TempDataSourceStore
=
useScreenStore
()
const
{
slides
,
slideIndex
}
=
storeToRefs
(
slidesStore
)
const
{
TemplateType
}
=
storeToRefs
(
TemplateTypeStore
)
const
pageTypesList
=
ref
([]
as
any
)
watch
(()
=>
datas
.
DataSource
,
()
=>
{
provide
(
injectKeyDataSource
,
datas
.
DataSource
)
})
...
...
src/views/Market/Index.vue
View file @
8c555eed
...
...
@@ -148,7 +148,7 @@
</template>
<
script
setup
lang=
"ts"
>
import
{
reactive
,
ref
,
inject
}
from
"vue"
;
import
{
reactive
,
ref
,
inject
,
watch
}
from
"vue"
;
import
LineService
from
'@/services/LineService'
import
ConfigService
from
'@/services/ConfigService'
import
{
userStore
}
from
"@/store/user"
;
...
...
@@ -192,8 +192,12 @@
const
marketStore
=
useScreenStore
()
const
isModelStore
=
useScreenStore
()
const
layoutsStore
=
useSlidesStore
()
const
{
screening
,
market
,
model
,
isModel
,
ConfigId
}
=
storeToRefs
(
useScreenStore
())
const
{
screening
,
market
,
model
,
isModel
,
ConfigId
,
TempId
}
=
storeToRefs
(
useScreenStore
())
console
.
log
(
TempId
,
'----TempId'
)
watch
(()
=>
TempId
.
value
,
(
n
,
o
)
=>
{
console
.
log
(
TempId
,
'----TempId111'
)
searchData
.
value
.
TempId
=
TempId
.
value
})
const
addTemplate
=
()
=>
{
marketStore
.
setMarket
(
!
market
)
}
...
...
@@ -230,29 +234,6 @@
}
}
/**
* 根据团期配置编号获取行程详情
*/
const
GetTripConfig
=
async
()
=>
{
try
{
if
(
!
ConfigId
||
isModel
)
return
let
queryMsg
=
{
ConfigId
:
ConfigId
}
let
datasRes
=
await
ConfigService
.
triptemplateGetTripConfig
(
queryMsg
);
if
(
datasRes
.
data
.
resultCode
==
1
)
{
if
(
datasRes
.
data
.
data
&&
datasRes
.
data
.
data
.
length
>
0
&&
datasRes
.
data
.
data
[
0
].
TempId
){
searchData
.
value
.
TempId
=
datasRes
.
data
.
data
[
0
].
TempId
isModelStore
.
setIsModel
(
true
)
marketStore
.
setMarket
(
!
market
)
}
}
}
catch
(
error
)
{
console
.
log
(
"triptemplate_GetTripConfig"
,
error
);
}
}
GetTripConfig
()
/**
* 页面跳转
*/
...
...
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