Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
live-management-web
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
live-management-web
Commits
61a0fd88
Commit
61a0fd88
authored
Sep 06, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中控台更新
parent
a065d056
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
src/pages/InteractiveResponse/components/randomPlayDialog.vue
+24
-4
src/utils/request.ts
+1
-1
No files found.
src/pages/InteractiveResponse/components/randomPlayDialog.vue
View file @
61a0fd88
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
Dialog
from
'@/components/Dialog.vue'
;
import
Dialog
from
'@/components/Dialog.vue'
;
import
{
computed
,
onMounted
,
ref
}
from
'vue'
;
import
{
computed
,
on
BeforeUnmount
,
on
Mounted
,
ref
}
from
'vue'
;
import
FormItem
from
'@/componentsUsiness/formItem.vue'
;
import
FormItem
from
'@/componentsUsiness/formItem.vue'
;
import
Input
from
'@/components/input/index.vue'
;
import
Input
from
'@/components/input/index.vue'
;
import
Switch
from
'@/components/switch'
;
import
Switch
from
'@/components/switch'
;
...
@@ -47,6 +47,8 @@ const route = useRoute();
...
@@ -47,6 +47,8 @@ const route = useRoute();
// 本地数据的key
// 本地数据的key
const
localKey
=
'reply_random_play_'
;
const
localKey
=
'reply_random_play_'
;
// 最少间隔和默认间隔
const
defaultInterval
=
120
;
const
visible
=
computed
({
const
visible
=
computed
({
get
()
{
get
()
{
...
@@ -61,7 +63,7 @@ let interval = null;
...
@@ -61,7 +63,7 @@ let interval = null;
let
localInterval
=
null
;
let
localInterval
=
null
;
// 间隔
// 间隔
const
inputValue
=
ref
(
''
);
const
inputValue
=
ref
(
defaultInterval
+
''
);
const
switchValue
=
ref
(
false
);
const
switchValue
=
ref
(
false
);
...
@@ -119,7 +121,20 @@ const openLocalInterval = () => {
...
@@ -119,7 +121,20 @@ const openLocalInterval = () => {
},
5000
);
},
5000
);
};
};
const
closeLocalIneterval
=
()
=>
{
window
.
clearInterval
(
localInterval
);
clearInterval
(
localInterval
);
localInterval
=
null
;
};
const
onSave
=
()
=>
{
const
onSave
=
()
=>
{
if
(
switchValue
.
value
)
{
if
(
!
inputValue
.
value
||
inputValue
.
value
<
defaultInterval
)
{
show_message
(
'间隔不能低于2分钟'
);
return
;
}
}
if
(
!
route
.
query
.
id
)
{
if
(
!
route
.
query
.
id
)
{
show_message
(
'禁止访问'
);
show_message
(
'禁止访问'
);
return
;
return
;
...
@@ -139,7 +154,7 @@ const onSave = () => {
...
@@ -139,7 +154,7 @@ const onSave = () => {
// 数据存本地,根据id
// 数据存本地,根据id
cache
.
setCache
(
getCacheId
(),
{
cache
.
setCache
(
getCacheId
(),
{
interval
:
inputValue
.
value
,
interval
:
inputValue
.
value
<
defaultInterval
?
defaultInterval
:
inputValue
.
value
,
status
:
switchValue
.
value
,
status
:
switchValue
.
value
,
});
});
visible
.
value
=
false
;
visible
.
value
=
false
;
...
@@ -148,7 +163,7 @@ const onSave = () => {
...
@@ -148,7 +163,7 @@ const onSave = () => {
const
init
=
()
=>
{
const
init
=
()
=>
{
const
data
=
cache
.
getCache
(
getCacheId
());
const
data
=
cache
.
getCache
(
getCacheId
());
if
(
data
)
{
if
(
data
)
{
inputValue
.
value
=
data
.
interval
;
inputValue
.
value
=
data
.
interval
+
''
;
switchValue
.
value
=
data
.
status
;
switchValue
.
value
=
data
.
status
;
}
}
// 打开随机播放
// 打开随机播放
...
@@ -161,6 +176,11 @@ onMounted(() => {
...
@@ -161,6 +176,11 @@ onMounted(() => {
init
();
init
();
openLocalInterval
();
openLocalInterval
();
});
});
onBeforeUnmount
(()
=>
{
closeInterval
();
closeLocalIneterval
();
});
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
src/utils/request.ts
View file @
61a0fd88
...
@@ -8,7 +8,7 @@ const error_messaage = '请求错误';
...
@@ -8,7 +8,7 @@ const error_messaage = '请求错误';
const
getBaseUrl
=
async
()
=>
{
const
getBaseUrl
=
async
()
=>
{
if
(
isDev
())
{
if
(
isDev
())
{
//
return 'http://156.247.11.21:93';
return
'http://156.247.11.21:93'
;
return
''
;
return
''
;
}
}
// 默认线上地址
// 默认线上地址
...
...
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