oyq28 4 months ago
parent
commit
54c7e6e139

+ 31 - 6
imcs-ui/src/views/dashboard/index.vue

@@ -194,7 +194,18 @@
         </div>
       </div>
     </el-col>
+
       <el-col :xs="24" :sm="10" :lg="6">
+        <span style="margin-right: 25px; float:right;">
+				<span>自动刷新:</span>
+				<el-switch v-model="switchOn"
+                   active-color="#13ce66"
+                   inactive-color="#ff4949"
+                   @change="switchClick"
+        >
+				</el-switch>
+
+			</span>
         <div class="colCls">
       		<div class="lastRow">
       			<!-- 登录监控 -->
@@ -235,6 +246,7 @@
     components: {countTo, BarChart},
     data() {
       return {
+        switchOn: false,
       	btnActive: "4",
       	timeRange: null,
 		isMachine: '0',
@@ -257,6 +269,7 @@
       }
     },
     created() {
+      this.switchOn = false
     	// 查询数据
       this.searchBarData("4")
       // 查询企业、产线、生产资源统计
@@ -274,9 +287,17 @@
     computed: {
     },
     mounted() {
-      this.startPolling();
+        this.startPolling();
     },
     methods: {
+      switchClick(value){
+        if(!value){
+          this.$emit('switchOff')
+        }else{
+          this.$emit('switchOn')
+        }
+        this.switchOn = value
+      },
     	// 【今日、本周、本月、全年】按钮-事件
       searchDate(flag){
       	this.btnActive = flag;
@@ -291,11 +312,12 @@
 		this.searchBarData(this.btnActive);
 	  },
       startPolling() {
-        // 使用 setInterval 每 5 秒调用一次接口
-        this.interval = setInterval(() => {
-          this.getWarning()
 
-        }, 20000);
+          // 使用 setInterval 每 5 秒调用一次接口
+          this.interval = setInterval(() => {
+            this.getWarning()
+
+          }, 20000);
 
         // 立即调用一次接口以初始化数据
         this.getWarning();
@@ -399,7 +421,10 @@
           }
         }).finally(() => this.loading = false);
       },
-      getWarning(params = {}) {
+      getWarning() {
+        if(!this.switchOn){
+          return
+        }
         this.loading = true;
         /*this.queryParams.current = params.current ? params.current : this.queryParams.current;
         this.queryParams.size = params.size ? params.size : this.queryParams.size;*/

+ 6 - 6
imcs-ui/src/views/zuihou/chfLargeScreen/twoDatasModel/component/main-item.vue

@@ -7,12 +7,12 @@
       :tableData="machineData.chfTwoDatas"
       class="item-2"
     />
-         <Progress
-          title="当前加工订单进度"
-          :tableData="machineData.chfTwoDatas"
-          :point="machineData.chfTwoDatas[0]?machineData.chfTwoDatas[0].point:0"
-          class="item-3"
-        />
+     <Progress
+      title="当前加工订单进度"
+      :tableData="machineData.chfTwoDatas"
+      :point="machineData.chfTwoDatas[0]?machineData.chfTwoDatas[0].point:0"
+      class="item-3"
+    />
      <Order
        title="待加工订单"
        :column="columnNow"

+ 8 - 1
imcs-ui/src/views/zuihou/chfLargeScreen/twoDatasModel/component/main.vue

@@ -25,6 +25,7 @@ export default {
     };
   },
   async created() {
+
     await this.fetchMachineData(); // 初始化时获取数据
   },
   methods: {
@@ -35,14 +36,20 @@ export default {
       } catch (error) {
         console.error("获取机床数据失败:", error);
       }*/
+      this.interval = setInterval(() => {
+        this.getData()
 
+      }, 20000);
+      this.getData()
+    },
+    getData(){
       taskMgrApi.chfTwoDatas().then(response => {
         const res = response.data;
         if (res.isSuccess) {
           this.machines = response.data.data;
         }
       });
-    },
+    }
   }
 };
 </script>

+ 3 - 3
imcs-ui/src/views/zuihou/chfLargeScreen/twoDatasModel/component/metric-component.vue

@@ -21,10 +21,10 @@
             padding-bottom: 5%;
           "
         >
-          度生产指标
+          度生产指标
         </div>
         <div style="font-size: 3vh">
-          30
+          18
         </div>
       </div>
     </div>
@@ -49,7 +49,7 @@
           年度目标
         </div>
         <div style="margin-bottom: 2vh; font-size: 3vh">
-          300件
+          800件
         </div>
       </div>
     </div>

+ 9 - 2
imcs-ui/src/views/zuihou/chfLargeScreen/twoDatasModel/component/production-condition.vue

@@ -17,7 +17,7 @@
       </div>
       <div style="display: flex;justify-content: space-around;margin: 5%">
         <div style="width: 60%;">
-          度产量
+          度产量
         </div>
         <div style="font-size: 2vh;width: 40%;">
           {{machines.monthCount}}
@@ -41,13 +41,20 @@ export default {
   },
   methods: {
     async fetchMachineData() {
+      this.interval = setInterval(() => {
+        this.getData()
+
+      }, 20000);
+      this.getData()
+    },
+    getData(){
       taskMgrApi.chfTwoDatasProductAndMes().then(response => {
         const res = response.data;
         if (res.isSuccess) {
           this.machines = response.data.data;
         }
       });
-    },
+    }
   }
 }
 </script>

+ 16 - 13
imcs-ui/src/views/zuihou/chfLargeScreen/twoDatasModel/component/progress.vue

@@ -12,6 +12,8 @@
         :key="item.prop"
         :prop="item.prop"
         :label="item.label"
+        :formatter="item.formatter"
+
       />
     </el-table>
     <el-progress
@@ -42,20 +44,22 @@ export default {
       type: Array,
       default: () => [
         {
-          prop: 'orderName',
-          label: '订单号'
+          prop: 'processedTime',
+          label: '已加工时',
+          width: 100
         },
         {
-          prop: 'productNum',
-          label: '零件数量'
+          prop: 'remainTime',
+          label: '剩余工时'
         },
         {
-          prop: 'produceNum',
-          label: '已生产'
+          prop: 'sumTime',
+          label: '总工时'
         },
         {
-          prop: 'deliveryTime',
-          label: '交付时间'
+          prop: 'point',
+          label: '进度',
+          formatter: (row) => `${row.point}%`
         },
       ],
     },
@@ -78,17 +82,16 @@ export default {
   margin-bottom: 1vh;
 }
 /*最外层透明*/
-/deep/ .el-table,
-/deep/ .el-table__expanded-cell {
+/deep/ .el-table, /deep/ .el-table__expanded-cell{
   background-color: transparent;
 }
 /* 表格内背景颜色 */
 /deep/ .el-table th {
-  background-color: skyblue;
-  color: #fff;
+  background-color: #457f968c;
+
 }
 /deep/ .el-table tr,
 /deep/ .el-table td {
-  background-color: #ccc;
+  background-color: transparent;
 }
 </style>

+ 1 - 0
imcs-ui/src/views/zuihou/dispatchMgr/productLineInfo/Index.vue

@@ -17,6 +17,7 @@
             row-key="id"
             style="width: 100%;"
           >
+            <el-table-column prop="orderName" label='订单名称'  width="80px"> </el-table-column>
             <el-table-column prop="taskNodeName" label='任务名称'  width="120px"> </el-table-column>
             <el-table-column prop="startStorge" label='开始点位'  width="100px"> </el-table-column>
             <el-table-column prop="endStorge" label='结束点位' width="100px"></el-table-column>