Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_web
Commits
f63b9396
Commit
f63b9396
authored
Nov 07, 2023
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备网关
parent
c039b8ff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
1 deletions
+64
-1
device.js
src/api/system/device.js
+10
-0
index.vue
src/views/system/device/index.vue
+54
-1
No files found.
src/api/system/device.js
View file @
f63b9396
...
...
@@ -42,3 +42,13 @@ export function delDevice(id) {
method
:
'delete'
})
}
//开门、关门、取电、断电
export
function
openOrClose
(
data
)
{
return
request
({
url
:
'/system/device/openOrClose'
,
method
:
'post'
,
data
:
data
})
}
src/views/system/device/index.vue
View file @
f63b9396
...
...
@@ -117,6 +117,39 @@
v-hasPermi=
"['system:device:remove']"
>
删除
</el-button>
<el-button
v-if=
"scope.row.devType=='CCEE'"
size=
"mini"
type=
"text"
icon=
"el-icon-switch"
@
click=
"openOrClose(scope.row, '10')"
v-hasPermi=
"['system:device:edit']"
>
开门
</el-button>
<el-button
v-if=
"scope.row.devType=='CCEE'"
size=
"mini"
type=
"text"
icon=
"el-icon-switch"
@
click=
"openOrClose(scope.row, '30')"
v-hasPermi=
"['system:device:edit']"
>
关门
</el-button>
<el-button
v-if=
"scope.row.devType=='0001'"
size=
"mini"
type=
"text"
icon=
"el-icon-switch"
@
click=
"openOrClose(scope.row, '20')"
v-hasPermi=
"['system:device:edit']"
>
取电
</el-button>
<el-button
v-if=
"scope.row.devType=='0001'"
size=
"mini"
type=
"text"
icon=
"el-icon-switch"
@
click=
"openOrClose(scope.row, '40')"
v-hasPermi=
"['system:device:edit']"
>
断电
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -197,7 +230,7 @@
</template>
<
script
>
import
{
listDevice
,
getDevice
,
delDevice
,
addDevice
,
updateDevice
}
from
"@/api/system/device"
;
import
{
listDevice
,
getDevice
,
delDevice
,
addDevice
,
updateDevice
,
openOrClose
}
from
"@/api/system/device"
;
import
selectStore
from
"./selectStore"
;
...
...
@@ -383,6 +416,26 @@ export default {
}).
catch
(()
=>
{
});
},
/** 开门、关门、取电、断电 */
openOrClose
(
row
,
opType
)
{
let
data
=
{
devId
:
row
.
devId
,
opType
:
opType
};
openOrClose
(
data
).
then
(
response
=>
{
let
msg
=
'操作成功'
;
if
(
opType
===
'10'
)
{
msg
=
'开门成功'
;
}
if
(
opType
===
'20'
)
{
msg
=
'取电成功'
;
}
if
(
opType
===
'30'
)
{
msg
=
'关门成功'
;
}
if
(
opType
===
'40'
)
{
msg
=
'断电成功'
;
}
this
.
$modal
.
msgSuccess
(
msg
);
});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'system/device/export'
,
{
...
...
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