2 コミット d57ea46532 ... bbbe7bb38e

作者 SHA1 メッセージ 日付
  hum bbbe7bb38e feat: 时间点策略起测水位通过停泊点策略选择 1 年間 前
  hum d54b81836d feat: 测流任务暂停 1 年間 前

+ 5 - 1
ruoyi-ui/src/views/analysis/task/index.vue

@@ -52,11 +52,15 @@
               <span class="status-circle"></span>
               <span class="status-text">已完成</span>
             </span>
+            <span class="status status-running" v-else-if="scope.row.status === 3">
+              <span class="status-circle"></span>
+              <span class="status-text">已暂停</span>
+            </span>
           </template>
         </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
-            <template v-if="scope.row.status === 0">
+            <template v-if="scope.row.status === 0 || scope.row.status === 3">
               <el-button size="mini" type="text" icon="el-icon-edit" @click="goRealTime(scope.row)">实时动态</el-button>
               <el-button size="mini" type="text" icon="el-icon-edit" @click="handleStop(scope.row)">终止</el-button>
             </template>

+ 4 - 1
ruoyi-ui/src/views/analysis/task/realtime.vue

@@ -1,6 +1,6 @@
 <template>
   <div v-if="task.taskid">
-    <Realtime v-if="task.status === 0" :task="task" @refresh="loadTask" />
+    <Realtime v-if="task.status === 0 || task.status === 3" :task="task" @refresh="loadTask" />
     <Result v-if="task.status === 2" :task="task" @refresh="loadTask" />
   </div>
 </template>
@@ -34,6 +34,9 @@ export default {
         if (res.data === null) {
           this.$message.error("测流任务不存在");
         } else {
+          if (![0, 2, 3].includes(res.data.status)) {
+            this.$router.back();
+          }
           this.task = res.data;
         }
       })

+ 24 - 12
ruoyi-ui/src/views/site/plain-time/add.vue

@@ -14,14 +14,17 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="起测水位" prop="wlevel">
-              <el-input-number
-                placeholder="请输入起测水位"
+              <el-select
                 v-model="form.wlevel"
-                @change="wlevel => plain.wlevel = wlevel"
-                :precision="2"
-                :step="0.1"
-                :min="plain.wlevelmin"
-                :max="plain.wlevelmax" />
+                placeholder="请选择停泊点策略"
+                @change="wlevel => plain.wlevel = wlevel">
+                <el-option
+                  v-for="item in points"
+                  :key="item.planid"
+                  :label="`停泊点策略${item.planid}(${item.wlevel})`"
+                  :value="item.wlevel">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
         </el-row>
@@ -64,7 +67,7 @@
 
 <script>
 import { getSite, getConfig } from '@/api/site/site'
-import { savePlainTime, getSiteSection, getPlainTime } from '@/api/site/berthing'
+import { savePlainTime, getSiteSection, getPlainTime, listPlainPoint } from '@/api/site/berthing'
 import SectionChart from './chart';
 
 export default {
@@ -78,11 +81,12 @@ export default {
       site: {},
       loading: false,
       times: [],
+      points: [],
       plain: {
         sections: [],
-        wlevelmax: 0,
-        wlevelmin: 0,
-        wlevel: 0,
+        wlevelmax: '',
+        wlevelmin: '',
+        wlevel: '',
       },
       form: {
         timeId: '',
@@ -91,7 +95,7 @@ export default {
         siteId: '',
         siteName: '',
         type: '',
-        wlevel: 0,
+        wlevel: '',
       },
       rules: {
         wlevel: [
@@ -106,6 +110,12 @@ export default {
     }
   },
   methods: {
+    loadPoints() {
+      listPlainPoint({ siteId: this.siteId, page: 1, size: 10000 }).then(response => {
+          this.points = response.data.records;
+        }
+      );
+    },
     loadPlainTime() {
       getPlainTime(this.timeId).then((res) => {
         const { timeId, siteId, wlevel, times } = res.data || {};
@@ -118,6 +128,7 @@ export default {
 
         this.siteId = siteId;
         this.loadSite();
+        this.loadPoints();
         this.loadSection();
         this.loadConfig();
       })
@@ -182,6 +193,7 @@ export default {
     this.siteId = this.$route.query.siteId;
     if (this.siteId) {
       this.loadSite();
+      this.loadPoints();
       this.loadSection();
       this.loadConfig();
     }