Browse Source

开关控制1

xu 1 day ago
parent
commit
724560cb3c
3 changed files with 21 additions and 4 deletions
  1. 8 0
      web/src/api/device.js
  2. 8 0
      web/src/api/tunnel.js
  3. 5 4
      web/src/view/admin/device/device.vue

+ 8 - 0
web/src/api/device.js

@@ -22,6 +22,14 @@ export const generateDeviceFile = (id) => {
   })
 }
 
+export const deviceSwitch = (data) => {
+  return service({
+    url: '/device/deviceSwitch',
+    method: 'post',
+    data
+  })
+}
+
 export const createDevice = (data) => {
   return service({
     url: '/device/createDevice',

+ 8 - 0
web/src/api/tunnel.js

@@ -38,6 +38,14 @@ export const updateTunnel = (data) => {
   })
 }
 
+export const updateTunnelLamp = (data) => {
+  return service({
+    url: '/tunnel/updateTunnelLamp',
+    method: 'put',
+    data
+  })
+}
+
 export const updateTactics = (data) => {
   return service({
     url: '/tunnel/updateTactics',

+ 5 - 4
web/src/view/admin/device/device.vue

@@ -356,7 +356,7 @@
           prop="radarId"
         >
           <el-input
-            v-model="device.radarId"
+            v-model.number="device.radarId"
             style="width: 200px;"
           />
         </el-form-item>
@@ -365,7 +365,7 @@
           prop="serialId"
         >
           <el-input
-            v-model="device.serialId"
+            v-model.number="device.serialId"
             style="width: 200px;"
           />
         </el-form-item>
@@ -483,7 +483,7 @@
           prop="radarId"
         >
           <el-input
-            v-model="device.radarId"
+            v-model.number="device.radarId"
             style="width: 200px;"
           />
         </el-form-item>
@@ -492,7 +492,7 @@
           prop="serialId"
         >
           <el-input
-            v-model="device.serialId"
+            v-model.number="device.serialId"
             style="width: 200px;"
           />
         </el-form-item>
@@ -732,6 +732,7 @@ const deviceEditDialog = ref(false)
 const isDeviceEditDialog = (val) => {
   deviceEditDialog.value = true
   device.value = val
+  isDevice.value = deviceGenre.value.find(item => item.ID === device.value.genre).type
 }
 
 const deviceEdit = async() => {