瀏覽代碼

测试bug修复-1

hbchen 1 年之前
父節點
當前提交
ba83968db1

+ 1 - 4
src/views/dataEntry_manage/chartSetting.vue

@@ -1560,12 +1560,9 @@ export default {
 
     /* 设置默认时间选中项 */
     setDefaultDateSelect() {
-      // console.log(this.chartInfo,'chartInfo');
-      // console.log(this.latestDate,'chartInfo');
-      // console.log();
       this.year_select = this.chartInfo.DateType;
-      this.count_year = this.chartInfo.StartYear;
       this.select_date = [this.chartInfo.StartDate, this.chartInfo.EndDate];
+      this.count_year = this.chartInfo.StartYear;
       this.calendar_type = this.chartInfo.Calendar; //日历类型
       
       if(this.chartInfo.ChartType==2){

+ 5 - 1
src/views/dataEntry_manage/components/LegendEditDia.vue

@@ -11,7 +11,7 @@
     <div class="dialog-legend">
       <div v-for="(item,index) in legendListCopy" :key="item.Name" class="legend-item">
         <div class="legend-item-color" :style="{backgroundColor:seasonColor[index]}"></div>
-        <el-input v-model="item.Value" placeholder="请输入图例名称" style="width: 295px;"></el-input>
+        <el-input v-model.trim="item.Value" placeholder="请输入图例名称" style="width: 295px;"></el-input>
       </div>
       <div class="legend-box-hint">默认取该曲线第一个数据年份作为图例名称,手动编辑为其他格式,则不再自动更新</div>
     </div>
@@ -56,6 +56,10 @@ watch: {
 },
 methods: {
   saveHandle() {
+    if(this.legendListCopy.some(item=> !item.Value)){
+      this.$message.error("所有图例名称都不能为空")
+      return
+    }
     this.$emit('saveLegend',this.legendListCopy)
   },
   cancelHandle() {

+ 19 - 8
src/views/dataEntry_manage/editChart.vue

@@ -628,6 +628,8 @@ export default {
 					};
           this.tableData = EdbInfoList;
 
+					this.calendar_type = this.chartInfo.Calendar; //日历类型
+
 					this.$nextTick(()=>{
 						this.setDefaultDateSelect(); //设置默认的日期选中
 						this.setDefaultPreviewOption() // 设置配置项
@@ -650,19 +652,28 @@ export default {
     setDefaultDateSelect() {
       this.year_select = this.chartInfo.DateType;
       this.select_date = [this.chartInfo.StartDate, this.chartInfo.EndDate];
-      this.calendar_type = this.chartInfo.Calendar; //日历类型
-      this.season_year = [
-        this.chartInfo.SeasonStartDate,
-        this.chartInfo.SeasonEndDate,
-      ];
+			this.count_year = this.chartInfo.StartYear;
+      // this.calendar_type = this.chartInfo.Calendar; //日历类型
+
+			if(this.chartInfo.ChartType==2){
+        if(this.year_select==20){
+          let latestYear = parseInt(this.tableData[0].LatestDate.substring(0,4))
+          this.season_year=[`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`]
+        }else if(this.year_select==6){
+          this.season_year = [this.chartInfo.SeasonStartDate,this.tableData[0].LatestDate];
+        }else{
+          this.season_year = [this.chartInfo.SeasonStartDate,this.chartInfo.SeasonEndDate]
+        }
+      }
+
       this.dateTip =
         this.chartInfo.DateType === 5
           ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
           : this.chartInfo.DateType === 6
           ? `${this.chartInfo.StartDate}~至今`
-					: this.chartInfo.DateType === 20
-          ?'最近5年'
-          : '请选择时间段';
+          : this.chartInfo.DateType === 20
+          ?`最近${this.chartInfo.StartYear}年`
+          :'请选择时间段';
 			
     },
     // 设置配置项