瀏覽代碼

开关控制1

xu 2 天之前
父節點
當前提交
724560cb3c
共有 3 個文件被更改,包括 21 次插入4 次删除
  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() => {