From 69a1b3bf45738f048361ee4ccb6bdc64fce35720 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 12 三月 2025 11:31:46 +0800
Subject: [PATCH] 更新

---
 admin/src/components/business/OperaDeviceLedWindow.vue |   79 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/admin/src/components/business/OperaDeviceLedWindow.vue b/admin/src/components/business/OperaDeviceLedWindow.vue
new file mode 100644
index 0000000..c135b7e
--- /dev/null
+++ b/admin/src/components/business/OperaDeviceLedWindow.vue
@@ -0,0 +1,79 @@
+<template>
+    <GlobalWindow
+        :title="title"
+        :visible.sync="visible"
+        :confirm-working="isWorking"
+        @confirm="confirm"
+    >
+        <el-form :model="form" ref="form" :rules="rules">
+            <el-form-item label="鏄剧ず鍐呭" prop="title">
+                <el-input v-model="form.title" placeholder="璇疯緭鍏ED灞忔樉绀哄唴瀹�" v-trim/>
+            </el-form-item>
+            <el-form-item label="鎾斁閫熷害" prop="speed">
+                <el-input type="number" v-model="form.speed" placeholder="璇疯緭鍏ユ挱鏀鹃�熷害锛屾暟瀛楄秺灏忔挱鏀捐秺蹇紝寤鸿閫熷害8" v-trim/>
+            </el-form-item>
+        </el-form>
+    </GlobalWindow>
+</template>
+
+<script>
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+export default {
+  name: 'OperaDeviceWindow',
+  extends: BaseOpera,
+  components: { GlobalWindow },
+  data () {
+    return {
+      // 琛ㄥ崟鏁版嵁
+      form: {
+        id: null,
+        title: '',
+        speed: 13
+      },
+      // 楠岃瘉瑙勫垯
+      rules: {
+        title: [
+          { required: true, message: '璇疯緭鍏ED灞忔樉绀哄唴瀹�' }
+        ]
+      }
+    }
+  },
+  created () {
+    this.config({
+      api: '/business/device',
+      'field.id': 'id'
+    })
+  },
+  methods: {
+    confirm () {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return
+        }
+        this.confirmDo()
+      })
+    },
+    confirmDo () {
+      // 璋冪敤鏂板缓鎺ュ彛
+      this.isWorking = true
+      this.api.setLedContent({
+        deviceId: this.form.id,
+        speed: this.form.speed,
+        content: this.form.title
+      })
+        .then(() => {
+          this.visible = false
+          this.$tip.apiSuccess('鍙戦�佹垚鍔�')
+          this.$emit('success')
+        })
+        .catch(e => {
+          // this.$tip.apiFailed(e)
+        })
+        .finally(() => {
+          this.isWorking = false
+        })
+    }
+  }
+}
+</script>

--
Gitblit v1.9.3