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
1d94e02d
Commit
1d94e02d
authored
Jul 08, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时更新数据 接口
parent
16de2048
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
17 deletions
+93
-17
ConfigService.ts
src/services/ConfigService.ts
+8
-0
index.vue
src/views/Editor/EditorHeader/index.vue
+27
-15
index.vue
src/views/Editor/Thumbnails/index.vue
+44
-0
ElementNormalData.vue
src/views/Editor/Toolbar/ElementNormalData.vue
+14
-2
No files found.
src/services/ConfigService.ts
View file @
1d94e02d
...
...
@@ -89,6 +89,14 @@ class ConfigService{
return
Api
.
Post
(
"triptemplate_RemoveTripOther"
,
params
)
}
/**
* 销售行程获取缓存数据
*/
static
async
GetTripOtherMongo
(
Id
:
any
):
Promise
<
HttpResponse
>
{
let
params
=
{
Id
}
return
Api
.
Post
(
"triptemplate_GetTripOtherMongo"
,
params
)
}
/**
* 销售行程定时更新数据
*/
...
...
src/views/Editor/EditorHeader/index.vue
View file @
1d94e02d
...
...
@@ -142,7 +142,7 @@
<
script
lang=
"ts"
setup
>
import
{
ArrowDown
}
from
'@element-plus/icons-vue'
import
{
nextTick
,
ref
,
reactive
,
inject
,
computed
,
watch
,
provide
}
from
'vue'
import
{
nextTick
,
ref
,
reactive
,
inject
,
computed
,
watch
,
provide
,
onBeforeUnmount
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
toPng
,
toJpeg
}
from
'html-to-image'
import
message
from
'@/utils/message'
...
...
@@ -229,7 +229,7 @@ if(queryObj.value.Title) titleValue.value = queryObj.value.Title
const
MonitoringNumber
=
ref
(
0
)
const
MonitoringTNumber
=
ref
(
0
)
const
timer
=
1
0
const
timer
=
3
0
const
Countdown
=
ref
<
any
>
(
timer
)
const
intervalId
=
ref
(
null
);
const
showTimer
=
ref
(
false
);
...
...
@@ -255,6 +255,9 @@ const goBack = (type:any) =>{
path
=
`/market/op/
${
ConfigId
.
value
}
/
${
TempType
.
value
}
`
router
.
push
({
path
})
}
else
if
(
model
.
value
==
2
){
clearInterval
(
intervalId
.
value
);
intervalId
.
value
=
null
;
UpdateItinerary
()
if
(
type
==
1
)
{
searchData
.
value
.
SalesEditor
=
router
.
currentRoute
.
value
.
params
if
(
searchData
.
value
.
sellId
)
searchData
.
value
.
TempId2
=
queryObj
.
value
.
TempId
...
...
@@ -321,11 +324,9 @@ const UpdateItinerary = async () => {
}
const
result
=
await
ConfigService
.
SetTripOtherTemp
(
queryMsg
);
if
(
result
.
data
.
resultCode
==
1
)
{
console
.
log
(
Countdown
.
value
,
'======成功'
)
datas
.
loading
=
false
}
else
{
datas
.
loading
=
false
console
.
log
(
'更新行程数据成功-----'
)
}
datas
.
loading
=
false
}
}
...
...
@@ -621,6 +622,8 @@ const setTemplate = async (type) =>{
datas
.
loading
=
true
await
SetTripTemplateConfig
()
}
else
if
(
model
.
value
==
2
&&
SalesEditor
.
value
>
0
){
clearInterval
(
intervalId
.
value
);
intervalId
.
value
=
null
;
if
(
type
==
1
||!
searchData
.
value
.
sellId
){
let
obj
=
{
FileName
:
queryObj
.
value
.
Title
,
...
...
@@ -665,25 +668,34 @@ watch(()=>autoSave.value,(newVal)=>{
}
})
watch
(()
=>
slides
.
value
,(
newVal
,
oldVal
)
=>
{
if
(
!
MonitoringNumber
.
value
||
MonitoringNumber
.
value
<
2
)
MonitoringNumber
.
value
++
if
(
MonitoringNumber
.
value
>
1
)
{
Countdown
.
value
=
timer
benginTimer
()
if
(
model
.
value
==
2
&&
SalesEditor
.
value
>
0
){
if
(
!
MonitoringNumber
.
value
||
MonitoringNumber
.
value
<
2
)
MonitoringNumber
.
value
++
if
(
MonitoringNumber
.
value
>
1
)
{
Countdown
.
value
=
timer
benginTimer
()
}
}
},{
deep
:
true
,
immediate
:
false
})
watch
(()
=>
queryObj
.
value
.
Title
,(
newVal
,
oldVal
)
=>
{
if
(
!
MonitoringTNumber
.
value
||
MonitoringTNumber
.
value
<
2
)
MonitoringTNumber
.
value
++
if
(
MonitoringTNumber
.
value
>
1
)
{
Countdown
.
value
=
timer
benginTimer
()
if
(
model
.
value
==
2
&&
SalesEditor
.
value
>
0
){
if
(
!
MonitoringTNumber
.
value
||
MonitoringTNumber
.
value
<
2
)
MonitoringTNumber
.
value
++
if
(
MonitoringTNumber
.
value
>
1
)
{
Countdown
.
value
=
timer
benginTimer
()
}
}
console
.
log
(
'000---'
,
MonitoringTNumber
.
value
)
})
handleUpdateTitle
()
onBeforeUnmount
(()
=>
{
clearInterval
(
intervalId
.
value
);
intervalId
.
value
=
null
;
});
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/Editor/Thumbnails/index.vue
View file @
1d94e02d
...
...
@@ -754,11 +754,55 @@ const sellGetTripTemplate = async () =>{
slidesStore
.
setSlides
(
newSlides
)
}
}
else
ElMessage
({
showClose
:
true
,
message
:
dataRes
.
data
.
message
,
type
:
'warning'
,
})
if
(
searchData
.
value
.
sellId
)
getTripOtherMongo
()
}
catch
(
error
)
{
}
}
// 销售模版缓存数据
const
getTripOtherMongo
=
async
()
=>
{
try
{
const
loadingObj
=
ElLoading
.
service
({
text
:
'正在获取缓存数据'
,
lock
:
true
})
let
dataRes
=
await
ConfigService
.
GetTripOtherMongo
(
searchData
.
value
.
sellId
);
if
(
dataRes
.
data
.
resultCode
==
1
)
{
let
dataObj
=
dataRes
.
data
.
data
let
SlidesData
=
JSON
.
parse
(
dataObj
.
TempData
)
let
newSlides
=
[]
SlidesData
.
forEach
((
x
,
i
)
=>
{
x
.
elements
.
forEach
((
y
:
any
)
=>
{
if
(
y
.
content
&&
y
.
defaultFontName
&&
y
.
defaultFontName
.
includes
(
','
))
y
.
defaultFontName
=
y
.
defaultFontName
.
split
(
','
)[
0
]
if
(
y
.
content
&&
(
y
.
content
.
includes
(
'&nbsp;'
))){
y
.
content
=
y
.
content
.
replaceAll
(
'&nbsp;'
,
' '
)
//y.content=y.content.replaceAll(' ',' ')
}
if
(
y
.
contentStr
&&
!
y
.
contentStr
.
includes
(
'<p'
)
&&
y
.
content
&&
y
.
content
.
includes
(
y
.
contentStr
)){
let
temp
=
HtmlUtil
.
htmlEncodeByRegExp
(
y
.
contentStr
)
if
(
temp
!=
y
.
contentStr
)
{
y
.
content
=
y
.
content
.
replace
(
y
.
contentStr
,
temp
)
}
}
})
newSlides
.
push
(
x
)
})
slidesStore
.
setSlides
(
newSlides
)
loadingObj
.
close
()
}
else
{
loadingObj
.
close
()
ElMessage
({
showClose
:
true
,
message
:
dataRes
.
data
.
message
,
type
:
'warning'
,
})
}
}
catch
(
error
)
{
}
...
...
src/views/Editor/Toolbar/ElementNormalData.vue
View file @
1d94e02d
...
...
@@ -13,7 +13,14 @@
<div
class=
"symbol-item NormalDataCenter cursor-pointer"
:class=
"[current==item.Feature?'active':'']"
v-for=
"(item,index) in dataList"
@
click=
"setElText(item,index)"
>
<div
class=
"title fz14 text-weight-bold text-ellipsis"
>
{{item.Name}}
</div>
<div
class=
"title fz14 text-weight-bold text-ellipsis"
>
<el-tooltip
style=
"width: 100%;"
effect=
"dark"
:content=
"item.Name"
placement=
"top"
>
{{item.Name}}
</el-tooltip>
</div>
<div
class=
"images"
>
<el-image
:src=
"item.PicPath"
style=
"width: 100%;"
fit=
"cover"
>
...
...
@@ -25,7 +32,12 @@
</el-image>
</div>
<div
class=
"text fz12"
>
{{item.Feature}}
<el-tooltip
style=
"width:200px;"
effect=
"dark"
:content=
"item.Feature"
placement=
"top"
>
{{item.Feature}}
</el-tooltip>
</div>
</div>
</div>
...
...
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