Browse Source

更新设备操作接口

develop
little4 2 months ago
parent
commit
2cdd28953c
  1. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RemoteMachine/index.vue
  2. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/index.vue

10
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RemoteMachine/index.vue

@ -16,11 +16,11 @@
</ElTabPane>
</ElTabs>
</div>
<template #footer v-hasPermi="['business:home:equipmentBox']">
<Button v-if="activeName != 'first' && data.deviceState == '1'" @click.native="deviceControlVisible = true">
<template #footer>
<Button v-if="check('business:home:equipmentBox') && activeName != 'first' && data.deviceState == '1'" @click.native="deviceControlVisible = true">
设备操作
</Button>
<Button v-else-if="activeName != 'first'" style="background-color: #bbb">
<Button v-else-if="check('business:home:equipmentBox') && activeName != 'first'" style="background-color: #bbb">
设备离线
</Button>
</template>
@ -38,6 +38,7 @@ import LineChart from "../../LineChart/index.vue";
import DeviceParams from "./components/DeviceParams.vue";
import DeviceControlDialog from "./components/DeviceControlDialog.vue";
import { checkPermi } from "@/utils/permission.js";
import request from "@/utils/request";
import {
@ -138,6 +139,9 @@ export default {
if (roadInfo) this.data.roadName = roadInfo.roadName;
},
methods: {
check(arr){
return checkPermi(arr);
},
async getDeviceInfo() {
return request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || "10.0.36.143-1883"

10
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/index.vue

@ -16,11 +16,11 @@
</ElTabPane>
</ElTabs>
</div>
<template #footer v-hasPermi="['business:home:equipmentBox']">
<Button v-if="activeName != 'first' && data.deviceState == '1'" @click.native="deviceControlVisible = true">
<template #footer>
<Button v-if="check('business:home:equipmentBox') && activeName != 'first' && data.deviceState == '1'" @click.native="deviceControlVisible = true">
设备操作
</Button>
<Button v-else-if="activeName != 'first'" style="background-color: #bbb">
<Button v-else-if="check('business:home:equipmentBox') && activeName != 'first'" style="background-color: #bbb">
设备离线
</Button>
</template>
@ -38,6 +38,7 @@ import LineChart from "../../LineChart/index.vue";
import DeviceParams from "./components/DeviceParams.vue";
import DeviceControlDialog from "./components/DeviceControlDialog.vue";
import { checkPermi } from "@/utils/permission.js";
import request from "@/utils/request";
import {
@ -146,6 +147,9 @@ export default {
// if (roadInfo) this.data.roadName = roadInfo.roadName;
},
methods: {
check(arr){
return checkPermi(arr);
},
async getDeviceInfo() {
return request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || "10.0.36.143-1883"

Loading…
Cancel
Save