使用vue开发实现XixunPlayer的功能.
实现设备重启
/**
* @Author: 858834013@qq.com
* @Name: reboot
* @Date: 2022-04-26
* @Desc: XixunPlayer实现重启
*/
<template>
<div class="reboot">
<el-popconfirm
title="确定要重启吗?"
@confirm="reboot"
>
<el-button type="danger" class="mb20" slot="reference" size="mini">重启</el-button>
</el-popconfirm>
</div>
</template>
<script>
import { getdata } from '@/api/led/led'
export default {
name: 'edit',
components: {},
props: {
id: {
type: String | Number,
default () {
return 0
}
}
},
mounted: function () {
},
data () {
return {}
},
methods: {
reboot () {
var that = this
getdata(that.id, {
'type': 'callCardService',
'fn': 'reboot',
'arg1': 1
}).then(function (res) {
if (res.result) {
that.$message({
message: '重启成功',
type: 'success'
})
} else {
that.$message.error('重启失败')
}
})
},
}
}
</script>
<style lang="scss" scoped>
.reboot {
display: inline-block;
}
</style>