pm 11 месяцев назад
Родитель
Сommit
e311363bae

+ 3 - 1
.env.development

@@ -1,5 +1,7 @@
 # 页面标题
-VUE_APP_TITLE = 国软科技
+# VUE_APP_TITLE = 国软科技
+VUE_APP_TITLE = 博士安全
+
 
 # 开发环境配置
 ENV = 'development'

+ 3 - 1
.env.production

@@ -1,5 +1,7 @@
 # 页面标题
-VUE_APP_TITLE = 国软科技
+# VUE_APP_TITLE = 国软科技
+VUE_APP_TITLE = 博士安全
+
 
 # 生产环境配置
 ENV = 'production'

+ 2 - 1
.env.staging

@@ -1,5 +1,6 @@
 # 页面标题
-VUE_APP_TITLE = 国软科技
+# VUE_APP_TITLE = 国软科技
+VUE_APP_TITLE = 博士安全
 
 NODE_ENV = production
 

BIN
public/favicon copy.ico


BIN
public/favicon.ico


BIN
src/assets/logo/logo.png


BIN
src/assets/logo/logo2.png


+ 2 - 1
src/layout/components/Sidebar/Logo.vue

@@ -35,7 +35,8 @@ export default {
   },
   data() {
     return {
-      title: '国软科技',
+      // title: '国软科技',
+      title:'博士安全',
       logo: logoImg
     }
   }

+ 2 - 2
src/views/login.vue

@@ -72,8 +72,8 @@ export default {
     return {
       codeUrl: "",
       loginForm: {
-        username: "grkj2",
-        password: "grkj123",
+        username: "wzbs",
+        password: "123456",
         rememberMe: false,
         code: "",
         uuid: ""

+ 38 - 5
src/views/mes/job/jobplay/index.vue

@@ -229,6 +229,7 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      intervalId: null,
       // 车间数据
       workshopList: [],
       // 作业区域数据
@@ -290,12 +291,44 @@ export default {
     this.getList();
     this.getWorkareaList();
   },
-  // mounted() {
-  //   setInterval(() => {
-  //     this.getList();
-  //   }, 5000);
-  // },
+  mounted() {
+    // setInterval(() => {
+    //   this.getList();
+    // }, 5000);
+    this.startRefreshing();
+    // 监听页面可见性变化
+    document.addEventListener("visibilitychange", this.handleVisibilityChange);
+  },
+  beforeDestroy() {
+    // 清理定时器和事件监听器
+    this.stopRefreshing();
+    document.removeEventListener(
+      "visibilitychange",
+      this.handleVisibilityChange
+    );
+  },
   methods: {
+    startRefreshing() {
+      // 防止多次触发刷新
+      if (this.intervalId) return;
+      this.intervalId = setInterval(() => {
+        this.getList();
+      }, 5000);
+    },
+    stopRefreshing() {
+      if (this.intervalId) {
+        clearInterval(this.intervalId);
+        this.intervalId = null;
+      }
+    },
+    handleVisibilityChange() {
+      if (document.visibilityState === "visible") {
+        this.startRefreshing();
+      } else {
+        this.stopRefreshing();
+      }
+    },
+
     generateStatus(row) {
       // 从数据中获取值
       const colockNum = row.colockNum || 0; // 总框数

+ 38 - 6
src/views/mes/job/jobplay/jobPlayDetail.vue

@@ -174,7 +174,8 @@ export default {
       lockUserList: [],
       colockUserList: [],
       ticketPointsList: [],
-      ticketId:null
+      ticketId: null,
+      intervalId: null,
     };
   },
 
@@ -183,10 +184,10 @@ export default {
     if (this.$route.query.ticketId) {
       this.ticketId = this.$route.query.ticketId;
       // 将 ticketId 存储到 localStorage
-      localStorage.setItem('ticketId', this.ticketId);
+      localStorage.setItem("ticketId", this.ticketId);
     } else {
       // 从 localStorage 获取 ticketId
-      this.ticketId = localStorage.getItem('ticketId');
+      this.ticketId = localStorage.getItem("ticketId");
     }
     // this.initWebSocket();
 
@@ -197,9 +198,20 @@ export default {
   },
   mounted() {
     this.getJobPlayInfo();
-    setInterval(() => {
-      this.getJobPlayInfo();
-    }, 5000);
+    // setInterval(() => {
+    //   this.getJobPlayInfo();
+    // }, 5000);
+    this.startRefreshing();
+    // 监听页面可见性变化
+    document.addEventListener("visibilitychange", this.handleVisibilityChange);
+  },
+  beforeDestroy() {
+    // 清理定时器和事件监听器
+    this.stopRefreshing();
+    document.removeEventListener(
+      "visibilitychange",
+      this.handleVisibilityChange
+    );
   },
   methods: {
     // initWebSocket(){
@@ -220,6 +232,26 @@ export default {
     // sendMsg(){
     //   sendMsg('aaa');
     // },
+    startRefreshing() {
+      // 防止多次触发刷新
+      if (this.intervalId) return;
+      this.intervalId = setInterval(() => {
+        this.getJobPlayInfo();
+      }, 5000);
+    },
+    stopRefreshing() {
+      if (this.intervalId) {
+        clearInterval(this.intervalId);
+        this.intervalId = null;
+      }
+    },
+    handleVisibilityChange() {
+      if (document.visibilityState === "visible") {
+        this.startRefreshing();
+      } else {
+        this.stopRefreshing();
+      }
+    },
     getJobPlayInfo() {
       getJobPlayTicketInfo(this.ticketId).then((res) => {
         console.log(res, "作业执行详细信息");