Forráskód Böngészése

查询条件时间病原体必填

cynthia-qin 1 hónapja
szülő
commit
4dcacd0129

+ 7 - 0
src/views/statistics/Spatiotemporal-distribution/index.vue

@@ -168,10 +168,17 @@ export default {
       }
     },
     async fetchAllData() {
+      if (!this.form.assemblyAccession) {
+        this.$message.error('请输入NCBI基因组序列编号');
+        return;
+      }
       if (this.form.dateRange.length > 0) {
         const [startDate, endDate] = this.form.dateRange;
         this.form.startDate = startDate;
         this.form.endDate = endDate;
+      } else {
+         this.$message.error('请输入时间');
+        return;
       }
       // 获取数据
       try {

+ 10 - 4
src/views/statistics/popularity-prediction/index.vue

@@ -6,7 +6,7 @@
       <el-form :inline="true" :model="form" size="small">
 
         <el-form-item label="病原体">
-          <el-select v-model="form.pathogenId" placeholder="请选择病原体">
+          <el-select v-model="form.sysPathogenConfigId" placeholder="请选择病原体">
             <el-option v-for="item in pathogen" :key="item.id" :label="item.name" :value="item.id"></el-option>
           </el-select>
         </el-form-item>
@@ -87,14 +87,13 @@ export default {
         let totalValue = 0;
         Object.keys(item).forEach(key => {
           if (key!== 'area' && key!== 'eng') {
-            const value = item[key];
+            const value = Number(item[key]);
             if (!isNaN(value) && value!== null && value!== undefined) {
               pathogenData[key] = value;
               totalValue += value;
             }
           }
         });
-
         return {
           name: item.eng || item.area || '未知区域',
           value: isNaN(totalValue)? 0 : totalValue,
@@ -379,12 +378,19 @@ export default {
       });
     },
     async initData() {
+      if (!this.form.sysPathogenConfigId) {
+        this.$message.error('请输入病原体名称');
+        return;
+      }
        if (this.form.dateRange.length  > 0) {
         const [startDate, endDate] = this.form.dateRange;
         this.form.startDate = startDate;
         this.form.endDate = endDate;
+      } else {
+        this.$message.error('请输入时间');
+        return;
       }
-      const res0 =await getPathogenConfig(this.form.pathogenId)
+      const res0 =await getPathogenConfig(this.form.sysPathogenConfigId)
       this.$nextTick(() => {
         let tree = d3.layout.phylotree().svg(d3.select("#tree_display"))
         .options({

+ 1 - 1
src/views/statistics/sample-statistics/index.vue

@@ -455,7 +455,7 @@ export default {
     },
     async fetchData() {
       if (!this.assemblyAccession) {
-        this.$message.error('请输入病原体注册号');
+        this.$message.error('请输入NCBI基因组序列编号');
         return;
       }
       this.getAllConfigList();