ソースを参照

数据采集调整

dengrui 6 ヶ月 前
コミット
35f18dd02e

+ 10 - 3
src/layout/index.vue

@@ -1,11 +1,18 @@
 <template>
-  <div class="wh-full" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="加载中..."
-    element-loading-background="rgba(122, 122, 122, 1 )">
+  <div
+    class="wh-full"
+    v-loading.fullscreen.lock="fullscreenLoading"
+    element-loading-text="加载中..."
+    element-loading-background="rgba(122, 122, 122, 1 )"
+  >
     <Header />
     <section class="app-main">
       <router-view>
         <template #default="{ Component, route }">
-          <transition enter-active-class="animate__animated animate__fadeIn" mode="out-in">
+          <transition
+            enter-active-class="animate__animated animate__fadeIn"
+            mode="out-in"
+          >
             <keep-alive :include="['ProcessMain', 'ProSteps']">
               <component :is="Component" />
             </keep-alive>

+ 14 - 3
src/views/pro-steps/components/screwdriver.vue

@@ -29,6 +29,7 @@
             v-if="item.deviceType == 'DDLSD'"
             placeholder="请选择任务"
             size="large"
+            @change="changeTask"
             style="position: absolute; right: 460px; z-index: 2; width: 140px"
           >
             <el-option
@@ -47,7 +48,9 @@
               startTest1(item.deviceName, item.deviceNo, item.deviceType)
             "
             :disabled="
-              (item.deviceType == 'DDLSD' && !taskValue) || btnDisabled
+              (item.deviceType == 'DDLSD' && !taskValue) ||
+              btnDisabled ||
+              setDiabledStatus
             "
             >设置参数</el-button
           >
@@ -79,7 +82,7 @@
             >开始检测</el-button
           >
         </template>
-    
+
         <el-table
           :data="tableData[index]"
           v-if="item.deviceType != 'FJDJC'"
@@ -90,7 +93,6 @@
             :key="str"
             :prop="str"
             :label="showLable(str)"
-      
           >
             <template #default="{ row }">
               <div v-if="!row.updateStatus">
@@ -160,8 +162,16 @@ import {
 import { useProcessStore } from "@/store";
 import { useDictionaryStore } from "@/store";
 import { emitter, EventsNames } from "@/utils/common";
+defineOptions({
+  name: "Screwdriver",
+});
 const dictS = useDictionaryStore();
 const store = useProcessStore();
+const changeTask = () => {
+  console.log("1");
+  setDiabledStatus.value = false;
+};
+const setDiabledStatus = ref(false);
 const tableData = ref([]);
 const materialsData = ref([]);
 const router = useRouter();
@@ -188,6 +198,7 @@ const toStartData1 = async (data) => {
     const { code } = await setUpData(data);
     if (code == "200") {
       ElMessage.success("设置成功!");
+      setDiabledStatus.value = true;
     }
   } catch (e) {
   } finally {

+ 10 - 12
src/views/pro-steps/index.vue

@@ -72,7 +72,7 @@
             <el-scrollbar style="width: 100%">
               <router-view v-slot="{ Component, route }">
                 <keep-alive
-                  include="Dianjian,Jiluxiang,Duomeiticaiji,Esop,Jingu,Mingpaibangding,Shebeijilu,Tiaoshipipei,Wuliaocaiji"
+                  include="Dianjian,Jiluxiang,Duomeiticaiji,Esop,Jingu,Mingpaibangding,Shebeijilu,Tiaoshipipei,Wuliaocaiji,Screwdriver"
                 >
                   <component :is="Component" :key="route.fullPath" />
                 </keep-alive>
@@ -90,11 +90,14 @@ import OperationBar from "@/views/pro-steps/operationBar.vue";
 import { useProcessStore } from "@/store";
 import { getOpCompent } from "@/api/prosteps";
 
+defineOptions({
+  name: "ProSteps",
+});
 const store = useProcessStore();
 const key = ref(false);
-defineOptions({ name: "ProSteps" });
 const route = useRoute();
 const router = useRouter();
+const instance = getCurrentInstance();
 const loading = ref(false);
 const recondOPId = ref(null);
 const qrCode = ref(null);
@@ -206,15 +209,6 @@ const getOpCompentArray = async () => {
 const setSelectIndex = (index) => {
   selectIndex.value = index;
 };
-// const setSelectTag = () => {
-//   const nowRouteName = route.name;
-//   stepComponents.value.forEach((item, index) => {
-//     if (item.name == nowRouteName) {
-//       setSelectIndex(index);
-//     }
-//   });
-// };
-
 onActivated(async () => {
   //缓存组件数据逻辑
   if (recondOPId.value == null || qrCode.value == null) {
@@ -228,10 +222,14 @@ onActivated(async () => {
       //当发生改变时
       setSelectIndex(0);
       await getOpCompentArray();
-
       key.value = !key.value;
     } else {
       await getOpCompentArray();
+      if (
+        !instance.devtoolsRawSetupState.router.options.history.state.forward
+      ) {
+        key.value = !key.value;
+      }
     }
   }
 });