Browse Source

温度设置

dengrui 7 months ago
parent
commit
1221dac7f0
2 changed files with 65 additions and 1 deletions
  1. 7 0
      src/api/prosteps/screwdriver.ts
  2. 58 1
      src/views/pro-steps/components/screwdriver.vue

+ 7 - 0
src/api/prosteps/screwdriver.ts

@@ -58,3 +58,10 @@ export function setUpData(data: any): Promise<ResData> {
     data,
   });
 }
+export function setUpData1(data: any): Promise<ResData> {
+  return request({
+    url: `/api/v1/process/data/acquisition/setUp1`,
+    method: "post",
+    data,
+  });
+}

+ 58 - 1
src/views/pro-steps/components/screwdriver.vue

@@ -24,6 +24,7 @@
             style="font-size: 18px; color: rgb(10, 89, 247); font-weight: 600"
             >新增数据</span
           >
+          <!-- DDLSD -->
           <el-select
             v-model="taskValue"
             v-if="item.deviceType == 'DDLSD'"
@@ -68,6 +69,44 @@
               :value="item.value"
             />
           </el-select>
+          <!-- DDLSD -->
+          <!-- WKDLT -->
+
+          <el-input-number
+            @click.stop
+            style="
+              position: absolute;
+              right: 300px;
+              z-index: 2;
+              margin-bottom: 1px;
+            "
+            v-model="tipTemperature"
+            :min="50"
+            :max="450"
+            v-if="item.deviceType == 'WKDLT'"
+          />
+          <span
+            v-if="item.deviceType == 'WKDLT'"
+            style="
+              position: absolute;
+              right: 345px;
+              z-index: 2;
+              margin-bottom: 1px;
+              font-size: 16px;
+              color: black !important;
+            "
+            >℃</span
+          >
+          <el-button
+            class="ces"
+            type="primary"
+            style="position: absolute; right: 180px; z-index: 2"
+            v-if="item.deviceType == 'WKDLT'"
+            @click.stop="setTipTemperature"
+            :disabled="tipTemperatureDisabled"
+            >设置温度</el-button
+          >
+          <!-- WKDLT -->
           <el-button
             class="ces"
             type="primary"
@@ -158,6 +197,7 @@ import {
   getTaskList,
   startData,
   setUpData,
+  setUpData1,
 } from "@/api/prosteps/screwdriver";
 import { useProcessStore } from "@/store";
 import { useDictionaryStore } from "@/store";
@@ -167,8 +207,23 @@ defineOptions({
 });
 const dictS = useDictionaryStore();
 const store = useProcessStore();
+const tipTemperature = ref(50);
+const tipTemperatureDisabled = ref(false);
+const setTipTemperature = async () => {
+  try {
+    tipTemperatureDisabled.value = true;
+    const { code } = await setUpData1({ tipTemperature: tipTemperature.value });
+    if (code == "200") {
+      ElMessage.success("设置成功!");
+    }
+  } catch (e) {
+  } finally {
+    setTimeout(() => {
+      tipTemperatureDisabled.value = false;
+    }, 5000);
+  }
+};
 const changeTask = () => {
-  console.log("1");
   setDiabledStatus.value = false;
 };
 const setDiabledStatus = ref(false);
@@ -264,6 +319,8 @@ const startTest1 = (a, b, c) => {
 };
 const showLable = (key) => {
   switch (key) {
+    case "temperature":
+      return "温度";
     case "CH5Val":
       return "温度";
     case "CH6Val":