Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
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
海康威视
web-project
Commits
f9c91904
Commit
f9c91904
authored
Oct 23, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一键启停
parent
520c3973
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
809 additions
and
804 deletions
+809
-804
OnekeyStartStopPage.vue
src/views/RemotePage/OnekeyStartStopPage.vue
+809
-804
No files found.
src/views/RemotePage/OnekeyStartStopPage.vue
View file @
f9c91904
...
@@ -33,8 +33,8 @@
...
@@ -33,8 +33,8 @@
</div>
</div>
<div
class=
"demo-button"
>
<div
class=
"demo-button"
>
<el-button
type=
"primary"
:loading=
"isLoading"
@
click=
"TransferOpen"
>
一键启动
</el-button>
<el-button
type=
"primary"
:loading=
"isLoading"
@
click=
"TransferOpen"
>
一键启动
</el-button>
<el-button
type=
"primary"
:loading=
"isLoading"
@
click=
"OnekeyStopEnd"
>
一键停止
</el-button
>
<!--
<el-button
type=
"primary"
:loading=
"isLoading"
@
click=
"OnekeyStopEnd"
>
一键停止
</el-button>
--
>
<!--
<el-button
type=
"primary"
:loading=
"isLoading"
@
click=
"TransferClose"
>
一键停止
</el-button>
--
>
<el-button
type=
"primary"
:loading=
"isLoading"
@
click=
"TransferClose"
>
一键停止
</el-button
>
</div>
</div>
</div>
</div>
</el-card>
</el-card>
...
@@ -104,6 +104,7 @@ import { vFloatNumber } from "../../utils/directives.js";
...
@@ -104,6 +104,7 @@ import { vFloatNumber } from "../../utils/directives.js";
import
{
fa
}
from
'element-plus/es/locale'
;
import
{
fa
}
from
'element-plus/es/locale'
;
import
{
useRoute
}
from
"vue-router"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
selectOneStartStop
,
selectIsScheduleByUserId
,
setOneStartStop
}
from
'../../api/oneKeyStartStop/index.js'
import
{
selectOneStartStop
,
selectIsScheduleByUserId
,
setOneStartStop
}
from
'../../api/oneKeyStartStop/index.js'
import
{
userInfo
}
from
'os'
;
const
enterpriseId
=
ref
(
null
);
const
enterpriseId
=
ref
(
null
);
const
cascaderRef
=
ref
(
null
);
const
cascaderRef
=
ref
(
null
);
const
isLoading
=
ref
(
false
);
const
isLoading
=
ref
(
false
);
...
@@ -122,6 +123,8 @@ const countDown = ref(120);
...
@@ -122,6 +123,8 @@ const countDown = ref(120);
const
props
=
{
multiple
:
false
,
emitPath
:
false
}
const
props
=
{
multiple
:
false
,
emitPath
:
false
}
const
isRunning
=
ref
(
false
);
const
isRunning
=
ref
(
false
);
const
isStop
=
ref
(
false
);
const
isStop
=
ref
(
false
);
const
userInfo
=
store
.
getters
.
getUserInfo
();
var
startPercent
=
reactive
(
new
Array
({
var
startPercent
=
reactive
(
new
Array
({
index
:
0
,
index
:
0
,
icon
:
new
URL
(
'/imgs/oneKey/ElectricSwitch.png'
,
import
.
meta
.
url
).
href
,
icon
:
new
URL
(
'/imgs/oneKey/ElectricSwitch.png'
,
import
.
meta
.
url
).
href
,
...
@@ -617,7 +620,7 @@ async function TransferOpen() {
...
@@ -617,7 +620,7 @@ async function TransferOpen() {
}
}
activeStep
.
value
=
0
;
activeStep
.
value
=
0
;
if
(
data
.
circuitBreakerSwitchOnStatus
)
{
if
(
data
.
circuitBreakerSwitchOnStatus
===
false
)
{
ElMessage
.
error
(
result
.
data
.
transferName
+
" 供热设备总断路器非合闸状态,一键启动失败!"
);
ElMessage
.
error
(
result
.
data
.
transferName
+
" 供热设备总断路器非合闸状态,一键启动失败!"
);
startPercent
[
0
].
color
=
"rgb(176 63 63)"
;
startPercent
[
0
].
color
=
"rgb(176 63 63)"
;
handleSetOneStartStop
(
stationId
.
value
,
transferId
.
value
,
false
,
undefined
,
1
,
undefined
)
handleSetOneStartStop
(
stationId
.
value
,
transferId
.
value
,
false
,
undefined
,
1
,
undefined
)
...
@@ -731,8 +734,9 @@ async function OneKeyStart(num) {
...
@@ -731,8 +734,9 @@ async function OneKeyStart(num) {
scheduledTasks
()
// 定时查询
scheduledTasks
()
// 定时查询
isLoading
.
value
=
true
;
isLoading
.
value
=
true
;
try
{
try
{
const
userId
=
userInfo
.
userId
;
var
result
=
await
http
.
post
(
"api/remote/OnekeyControl/WriteStart"
,
{
"transferId"
:
transferId
.
value
,
"num"
:
num
});
const
pwd
=
userInfo
.
password
;
var
result
=
await
http
.
post
(
"api/remote/OnekeyControl/WriteStart"
,
{
"transferId"
:
transferId
.
value
,
"num"
:
num
,
"userId"
:
userId
,
"Password"
:
pwd
});
if
(
result
)
{
if
(
result
)
{
if
(
result
.
success
)
{
if
(
result
.
success
)
{
activeStep
.
value
=
8
;
activeStep
.
value
=
8
;
...
@@ -754,10 +758,11 @@ async function OneKeyStart(num) {
...
@@ -754,10 +758,11 @@ async function OneKeyStart(num) {
}
}
async
function
OnekeyStop
(){
async
function
OnekeyStop
(){
console
.
log
(
'1111111'
)
try
{
try
{
isLoading
.
value
=
true
;
isLoading
.
value
=
true
;
var
result
=
await
http
.
post
(
"api/remote/OnekeyControl/WriteStop"
,
transferId
.
value
);
const
userId
=
userInfo
.
userId
;
const
pwd
=
userInfo
.
password
;
var
result
=
await
http
.
post
(
"api/remote/OnekeyControl/WriteStop"
,
{
"transferId"
:
transferId
.
value
,
"num"
:
0
,
"userId"
:
userId
,
"Password"
:
pwd
});
if
(
!
result
)
{
if
(
!
result
)
{
ElMessage
.
error
(
"远程服务器连接异常,一键停止执行失败!"
);
ElMessage
.
error
(
"远程服务器连接异常,一键停止执行失败!"
);
isLoading
.
value
=
false
;
isLoading
.
value
=
false
;
...
@@ -928,8 +933,8 @@ function getSteps() {
...
@@ -928,8 +933,8 @@ function getSteps() {
const
item
=
res
.
data
.
find
(
item
=>
(
item
.
runStart
===
true
&&
item
.
stopStart
===
false
)
||
(
item
.
runStart
===
false
&&
item
.
stopStart
===
true
))
const
item
=
res
.
data
.
find
(
item
=>
(
item
.
runStart
===
true
&&
item
.
stopStart
===
false
)
||
(
item
.
runStart
===
false
&&
item
.
stopStart
===
true
))
// 获取的数组里,都是false就输出第一个
// 获取的数组里,都是false就输出第一个
const
itemTwo
=
res
.
data
.
find
(
item
=>
item
.
unitId
===
transferId
.
value
)
const
itemTwo
=
res
.
data
.
find
(
item
=>
item
.
unitId
===
transferId
.
value
)
console
.
log
(
'item'
,
item
)
//
console.log('item',item)
console
.
log
(
'itemTwo'
,
itemTwo
)
//
console.log('itemTwo',itemTwo)
if
(
item
)
{
if
(
item
)
{
if
(
isLoading
.
value
===
false
)
{
if
(
isLoading
.
value
===
false
)
{
if
(
item
.
stopStart
===
true
)
{
if
(
item
.
stopStart
===
true
)
{
...
@@ -950,7 +955,7 @@ function getSteps() {
...
@@ -950,7 +955,7 @@ function getSteps() {
isStop
.
value
=
false
;
isStop
.
value
=
false
;
}
}
const
getItem
=
item
?
item
:
itemTwo
const
getItem
=
item
?
item
:
itemTwo
console
.
log
(
'getItem'
,
getItem
)
//
console.log('getItem',getItem)
if
(
getItem
.
runStepsFlag
===
true
)
{
if
(
getItem
.
runStepsFlag
===
true
)
{
activeStep
.
value
=
getItem
.
runSteps
activeStep
.
value
=
getItem
.
runSteps
...
@@ -1148,7 +1153,7 @@ watch(
...
@@ -1148,7 +1153,7 @@ watch(
transform
:translate
(
-50
%
,
-50
%
)
;
transform
:translate
(
-50
%
,
-50
%
)
;
max-height
:calc
(
100
%
-
30px
)
;
max-height
:calc
(
100
%
-
30px
)
;
max-width
:calc
(
100
%
-
30px
)
;
max-width
:calc
(
100
%
-
30px
)
;
}
}
.el-dialog
.el-dialog__body
{
.el-dialog
.el-dialog__body
{
max-height
:
100%
;
max-height
:
100%
;
flex
:
1
;
flex
:
1
;
...
...
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