Эх сурвалжийг харах

更换按钮、调换位置及增加定时器

zhangliang2 2 жил өмнө
parent
commit
74e1766316

+ 26 - 9
src/views/workManagement/autoRunProjectList.vue

@@ -97,9 +97,9 @@
                 <el-table-column label="操作" slot="cgInfos" align="center">
                     <template v-slot="scope">
                         <i
-                            @click="runRow(scope.row.id, scope.row.parallelism)"
-                            class="el-icon-video-play elIcon"
-                            title="运行"
+                            @click="viewRow(scope.row.id)"
+                            class="el-icon-view elIcon"
+                            title="查看"
                         ></i>
                         <i
                             @click="editRow(scope.row)"
@@ -107,9 +107,9 @@
                             title="编辑"
                         ></i>
                         <i
-                            @click="viewRow(scope.row.id)"
-                            class="el-icon-view elIcon"
-                            title="查看"
+                            @click="runRow(scope.row.id, scope.row.parallelism)"
+                            class="el-icon-refresh-right elIcon"
+                            title="运行"
                         ></i>
                         <i
                             v-if="scope.row.automaticRunState === '1'"
@@ -197,6 +197,7 @@ export default {
             },
             checkedArr: [],
             curRow: {}, // 当前row
+            timer: null,
         };
     },
     methods: {
@@ -216,6 +217,12 @@ export default {
                 createEndDate: this.searchParams.createEndDate,
             };
             this.refreshList(pageMap);
+
+            if (this.timer) clearInterval(this.timer);
+
+            this.timer = setInterval(() => {
+                if (this.$refs["table"]) this.doSearch();
+            }, 1000 * 60);
         },
         //刷新table
         refreshList(param) {
@@ -371,11 +378,21 @@ export default {
         },
     },
 
-    mounted() {},
+    mounted() {
+        if (this.timer) clearInterval(this.timer);
+
+        this.timer = setInterval(() => {
+            if (this.$refs["table"]) this.doSearch();
+        }, 1000 * 60);
+    },
+
+    beforeDestroy() {
+        clearInterval(this.timer);
+    },
 };
 </script>
 
-<style lang='less' scoped>
+<style lang="less" scoped>
 .btnsPanel {
     margin: 45px 40px 15px;
     text-align: right;
@@ -388,4 +405,4 @@ export default {
         margin-right: 60px;
     }
 }
-</style>
+</style>

+ 1 - 1
src/views/workManagement/autoRunSubProjectList.vue

@@ -70,7 +70,7 @@
                         <i
                             v-if="scope.row.nowRunState === '20'"
                             @click="stopRow(scope.row.id)"
-                            class="el-icon-video-pause elIcon"
+                            class="myIconPause elIcon"
                             title="中止"
                         ></i>
                         <!-- 下载只有执行完成才可展示 nowRunState 30展示  -->

+ 29 - 12
src/views/workManagement/manualRunProjectList.vue

@@ -112,14 +112,9 @@
                 <el-table-column label="操作" slot="cgInfos" align="center">
                     <template v-slot="scope">
                         <i
-                            v-if="
-                                scope.row.nowRunState === '10' ||
-                                scope.row.nowRunState === '30' ||
-                                scope.row.nowRunState === '40'
-                            "
-                            @click="runRow(scope.row.id, scope.row.parallelism)"
-                            class="el-icon-video-play elIcon"
-                            title="运行"
+                            @click="viewRow(scope.row.id)"
+                            class="el-icon-view elIcon"
+                            title="查看"
                         ></i>
                         <i
                             v-if="
@@ -131,14 +126,19 @@
                             title="编辑"
                         ></i>
                         <i
-                            @click="viewRow(scope.row.id)"
-                            class="el-icon-view elIcon"
-                            title="查看"
+                            v-if="
+                                scope.row.nowRunState === '10' ||
+                                scope.row.nowRunState === '30' ||
+                                scope.row.nowRunState === '40'
+                            "
+                            @click="runRow(scope.row.id, scope.row.parallelism)"
+                            class="el-icon-refresh-right elIcon"
+                            title="运行"
                         ></i>
                         <i
                             v-if="scope.row.nowRunState === '20'"
                             @click="stopRow(scope.row.id)"
-                            class="el-icon-video-pause elIcon"
+                            class="myIconPause elIcon"
                             title="中止"
                         ></i>
                         <i
@@ -286,6 +286,7 @@ export default {
             dialogVisible: false,
             curRow: {}, // 当前row
             downDisabled: false, // 用于判断是否可下载工作报告
+            timer: null,
         };
     },
     methods: {
@@ -317,6 +318,12 @@ export default {
                 finishDateEnd: this.searchParams.finishDateEnd,
             };
             this.refreshList(pageMap);
+
+            if (this.timer) clearInterval(this.timer);
+
+            this.timer = setInterval(() => {
+                if (this.$refs["table"]) this.doSearch();
+            }, 1000 * 60);
         },
         //刷新table
         refreshList(param) {
@@ -515,12 +522,22 @@ export default {
     },
 
     async mounted() {
+        if (this.timer) clearInterval(this.timer);
+
+        this.timer = setInterval(() => {
+            if (this.$refs["table"]) this.doSearch();
+        }, 1000 * 60);
+
         // console.log(666);
         await this.$dicsListsInit({
             nowRunStateList: "projectRunState",
             evaluationLevelList: "evaluationLevel",
         });
     },
+
+    beforeDestroy() {
+        clearInterval(this.timer);
+    },
 };
 </script>