浏览代码

标识线部分字段固定number格式

cxmo 8 月之前
父节点
当前提交
fadffebeab
共有 1 个文件被更改,包括 31 次插入10 次删除
  1. 31 10
      src/views/dataEntry_manage/components/addMarkerDialog.vue

+ 31 - 10
src/views/dataEntry_manage/components/addMarkerDialog.vue

@@ -234,7 +234,9 @@
                                 </p>
                                 <p><!-- 期数前移 -->{{ $t('Chart.Detail.edb_periods') }}{{ $t('Chart.Detail.edb_periods_lead') }}
                                     <el-input style="width:60px" type="number" class="number-input"
-                                    v-model="markerForm.startTime.conf.moveForward" />
+                                    v-model.number="markerForm.startTime.conf.moveForward" 
+                                    @change="e => {markerForm.startTime.conf.moveForward=Number(e);}"
+                                    />
                                     <!-- 期 -->{{ $t('Chart.Detail.edb_period') }}
                                 </p>
                             </div>
@@ -288,7 +290,9 @@
                                 </p>
                                 <p><!-- 期数前移 -->{{ $t('Chart.Detail.edb_periods') }}{{ $t('Chart.Detail.edb_periods_lead') }}
                                     <el-input style="width:60px" type="number" class="number-input"
-                                    v-model="markerForm.endTime.conf.moveForward" />
+                                    v-model.number="markerForm.endTime.conf.moveForward" 
+                                    @change="e => {markerForm.endTime.conf.moveForward=Number(e);}"
+                                    />
                                     <!-- 期 -->{{ $t('Chart.Detail.edb_period') }}
                                 </p>
                             </div>
@@ -309,9 +313,11 @@
                     <!--区间均值加N倍标准差-->
                     <div class="format">
                         <el-radio v-model="markerForm.calculation" :label="2">{{ $t('Chart.Detail.cal_range_val') }}{{ $t('Chart.Detail.cal_range_mean') }}</el-radio>
-                        <p>{{ $t('Chart.Detail.cal_range_plus') }}<el-input 
+                        <p>{{ $t('Chart.Detail.cal_range_plus') }}
+                            <el-input 
                             style="width:60px" 
-                            v-model="markerForm.calculationValue" 
+                            v-model.number="markerForm.calculationValue" 
+                            @change="e => {markerForm.calculationValue=Number(e);}"
                             type="number" class="number-input"></el-input>{{ $t('Chart.Detail.cal_range_times') }} {{ $t('Chart.Detail.cal_range_std') }}</p>
                     </div>
                     <!--区间分位-->
@@ -451,8 +457,18 @@ export default {
         this.markerForm = {
           ...this.form.data
         }
-        if(!this.markerForm.markLineType){
-            Object.assign(this.markerForm,this.markerExtraConfig)
+        //标识线特殊处理
+        if(this.form.markerType==='line'){
+            if(!this.markerForm.markLineType){
+                Object.assign(this.markerForm,this.markerExtraConfig)
+            }else{
+                //重置计算方式的值
+                const {calculation} = this.markerForm
+                if(calculation===3){
+                    this.calculationValue = this.markerForm.calculationValue
+                    this.markerForm.calculationValue = 1
+                }
+            }
         }
       }else {
         this.editIndex = 0;
@@ -473,8 +489,14 @@ export default {
           textColor: themeOpt.markerOptions.style.color,
           textFontSize: themeOpt.markerOptions.style.fontSize,
           isShow: true,
-          //补上额外参数
-          ...this.markerExtraConfig
+        }
+        //标识线特殊处理
+        if(this.form.markerType==='line'){
+           this.markerForm = {
+            ...this.markerForm,
+            ...this.markerExtraConfig
+           }
+            this.calculationValue = 50
         }
       }
     }
@@ -640,9 +662,8 @@ export default {
       //form.calculation+calculationType 共同判断计算方式
       if(this.markerForm.calculation===3){
             item.calculation = this.calculationType
-            item.calculationValue = this.calculationValue
+            item.calculationValue = Number(this.calculationValue)
       }
-      
       this.editIndex 
         ? this.$emit('edit',{
             index: this.editIndex,