From 93cfe2fe06eb1b6cbdbd45dcd65a435a7299ef07 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 13 五月 2025 11:57:49 +0800
Subject: [PATCH] gx修护

---
 src/views/deviceWindoes2.vue |  153 ++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 121 insertions(+), 32 deletions(-)

diff --git a/src/views/deviceWindoes2.vue b/src/views/deviceWindoes2.vue
index da1e367..c45a1c5 100644
--- a/src/views/deviceWindoes2.vue
+++ b/src/views/deviceWindoes2.vue
@@ -38,21 +38,19 @@
                 style="margin-left: 5%; font-size: 300%; height: 100%"
                 >{{ deviceData.性别 }}</span
                 >
-                <div style="
-                  position: absolute;
-                  top: 0;
-                  right: 0;
-                  display: grid;
-                  padding: 5px;
-                  font-size: 300%;
-                  height: 100%
-                ">
-                <span class="grid-container"
-                  style="height: 100%;color: #303133;padding-right: 20px;"
-                  >
-                  <el-image  @click="centerDialogVisible=true" :src="shezhi"></el-image>
-                  </span>
-                </div>
+                
+                
+                
+                <div style="position: absolute; top: 0; right: 0; display: flex;  align-items: center; justify-content: flex-end; padding: 5px; height: 100%;">
+                  <div class="grid-container" style="display: flex; align-items: center; padding-right: 20px;">
+                      <span style="display: inline-block; margin-right: 15px;">
+                          <img @click="dingshiShow" :src="dingshi" alt="Image 1">
+                      </span>
+                      <span style="display: inline-block;">
+                          <img @click="centerDialogVisible=true" :src="shezhi" alt="Image 2">
+                      </span>
+                  </div>
+              </div>
             </el-row>
         </div>
         <div class="chongjian" style="height: 50%;">
@@ -785,7 +783,7 @@
       <span>
         <el-form label-position="left" label-width="auto" style="max-width: 600px">
           <el-space fill>
-            <el-alert type="warning" show-icon :closable="false">
+            <el-alert type="绑定设备" show-icon :closable="false">
               <p>"请输入设备编号后才能使用不然无法定位到数据来源:</p>
               <p>也可以选择二维码图片文件识别</p>
             </el-alert>
@@ -806,7 +804,59 @@
           </el-button>
         </div>
       </template>
-    </el-dialog>
+      </el-dialog>
+      <el-dialog v-model="centerDialogVisible2" title="定时任务设置" width="600" center>
+        <span>
+            <div>
+              <el-form  :model="formInline"  label-width="100px">
+                <el-form-item label="时间设定:">
+                  <el-col :span="10">
+                    <el-input-number style="width: 100%;" v-model="formInline.xiaoshi" :min="1" :max="10" />
+                  </el-col>
+                  <el-col :span="2" class="text-center">
+                    <span class="text-gray-500">小时 </span>
+                  </el-col>
+                  <el-col :span="10">
+                    <el-input-number style="width: 100%;" v-model="formInline.fenzhong" :min="1" :max="59" />
+                  </el-col>
+                  <el-col :span="2" class="text-center">
+                    <span class="text-gray-500">分钟 </span>
+                  </el-col>
+                </el-form-item>
+               
+                <el-form-item label="提醒内容:">
+                  <el-input v-if="!formInline.selectOpen"
+                      v-model="formInline.alertText"
+                      style="max-width: 600px"
+                      placeholder="请填写报警内容"
+                      type="textarea"
+                      class="input-with-select"
+                    >
+                  </el-input>
+                  <el-select v-else  v-model="formInline.selectType" style="width: 100%;" placeholder="选择内容" >
+                      <el-option label="测血压" value="测血压" />
+                      <el-option label="开超滤" value="开超滤" />
+                      <el-option label="给药" value="给药" />
+                  </el-select>
+                
+                </el-form-item>
+                <el-form-item label="定型文:">
+                  <el-switch v-model="formInline.selectOpen" />
+                </el-form-item>
+
+              </el-form>
+
+            </div>
+        </span>
+        <template #footer>
+          <div class="dialog-footer">
+            <el-button @click="centerDialogVisible2=false">取消</el-button>
+            <el-button type="primary" @click="setDingshi">
+              确定
+            </el-button>
+          </div>
+        </template>
+      </el-dialog>
     </div>  
     
     
@@ -816,6 +866,7 @@
   import { BrowserMultiFormatReader, NotFoundException, ChecksumException, FormatException } from '@zxing/library';
   import TQS88 from "../img/TQS88.png";
   import shezhi from '../img/shezhi.png'
+  import dingshi from '../img/dingshi.png'
   import xinlv from '../img/xinlv.png'
   import tsl from '../img/tsl.png'
   import zlms from '../img/zlms.png'
@@ -829,6 +880,7 @@
   import { Local } from '../utils/storage';
   import * as echarts from "echarts";
   import { jgTime4 } from "../utils/formatTime";
+  import {setTimeoutAlert} from '../utils/httpApi'
   const { proxy } = getCurrentInstance() as any;
   // 在需要使用的组件中引入
   import { ChatDotSquare } from '@element-plus/icons-vue';
@@ -851,6 +903,14 @@
     dbp:'111',
     zuihouTime:new Date()
   })
+  const formInline=ref({
+    xiaoshi:0,
+    fenzhong:5,
+    alertText:'',
+    selectType:'',
+    selectOpen:false
+  })
+  
   const 当前客户耗材集合=ref({})
   const deviceData = ref({
     iot_传输时间: "2025-01-10 19:15:24",
@@ -1019,6 +1079,7 @@
   const video = ref<HTMLVideoElement | null>(null);
   // 识别数据流
   let stream: MediaStream | null = null;
+  const centerDialogVisible2=ref(false)
   const centerDialogVisible = ref(false);
   const background = ref("");
   const txztText = ref("");
@@ -1053,6 +1114,34 @@
   const xiaoduzhuangti = computed(() => {
     return false;
   });
+  // 打开定时任务设置
+  const dingshiShow=(()=>{
+    formInline.value={
+      xiaoshi:0,
+      fenzhong:5,
+      alertText:'',
+      selectType:'',
+      selectOpen:false
+    }
+    centerDialogVisible2.value=true
+  })
+  // 保存定时任务
+  const setDingshi=(()=>{
+    console.log('--------------------')
+    console.log(formInline.value)
+    console.log(deviceCode.value)
+    const minutes=formInline.value.xiaoshi*60+formInline.value.fenzhong
+    let alertText=''
+    if(formInline.value.selectOpen){
+      alertText=formInline.value.selectType
+    }else{
+      alertText=formInline.value.alertText
+    }
+    setTimeoutAlert({deviceCode:deviceCode.value,minutes:minutes,alertText:alertText}).then(res=>{
+      console.log(res.data)
+    })
+    // centerDialogVisible2.value=false
+  })
   // 状态颜色
   const zhuangtaiColor = computed(() => {
     const list = deviceData.value.设备状态列表;
@@ -1262,20 +1351,20 @@
     // http://testbs.ihemodialysis.com/sse/sseEvent
     // const test='http://testbs.ihemodialysis.com/sse/sseEvent/'
     数据初始化.value=true
-      const loading = ElLoading.service({
-        lock: true,
-        text: '数据初始化中。。。',
-        background: 'rgba(0, 0, 0, 0.7)',
-        svg:`<path class="path" d="
-          M 30 15
-          L 28 17
-          M 25.61 25.61
-          A 15 15, 0, 0, 1, 15 30
-          A 15 15, 0, 1, 1, 27.99 7.5
-          L 15 15
-        " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
-        `
-      })
+      // const loading = ElLoading.service({
+      //   lock: true,
+      //   text: '数据初始化中。。。',
+      //   background: 'rgba(0, 0, 0, 0.7)',
+      //   svg:`<path class="path" d="
+      //     M 30 15
+      //     L 28 17
+      //     M 25.61 25.61
+      //     A 15 15, 0, 0, 1, 15 30
+      //     A 15 15, 0, 1, 1, 27.99 7.5
+      //     L 15 15
+      //   " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
+      //   `
+      // })
       const test='https://backend.ihemodialysis.com/sse/sseEvent/'
       const stateArr = [
       { key: 0, value: "正在链接中" },
@@ -1326,7 +1415,7 @@
                   },500)
                 }else if(dataBody.推送类型==='中央监控大屏信息'){
                   数据初始化.value=false
-                  loading.close()
+                  // loading.close()
                   console.log(Date.now() + 'DEV')
                   if(dataBody?.透析状态){
                     deviceData.value=dataBody?.透析状态

--
Gitblit v1.8.0