浏览代码

优化单多因子切换,编辑页不允许切换

cxmo 10 月之前
父节点
当前提交
e2bad330c2
共有 1 个文件被更改,包括 8 次插入17 次删除
  1. 8 17
      src/views/chartRelevance_manage/relevance/relevanceChartEditorV2.vue

+ 8 - 17
src/views/chartRelevance_manage/relevance/relevanceChartEditorV2.vue

@@ -16,7 +16,9 @@
                     <el-form-item 
                         :label="$t('StatisticAnalysis.ChartRelevance.analytical_model')" 
                         prop="Model" required>
-                        <el-select v-model="infoForm.Model" style="width: 100%;">
+                        <el-select v-model="infoForm.Model" style="width: 100%;" 
+                        :disabled="$route.query.code"
+                        @change="changeModel">
                             <el-option :label="$t('StatisticAnalysis.ChartRelevance.single_indicator')" :value="1"></el-option>
                             <el-option :label="$t('StatisticAnalysis.ChartRelevance.multiple_indicators')" :value="2"></el-option>
                         </el-select>
@@ -276,21 +278,8 @@ export default {
             isSettingChartShow:false,
 
             showExplain:false,//显示操作说明
-            isGetDetail:false,//行为标识
         };
     },
-    watch:{
-        //单多因子切换时,重置表单
-        'infoForm.Model'(newval){
-            //是否为获取详情切换Model,若是,不重置表单
-            if(this.isGetDetail){
-                this.isGetDetail = false
-                return
-            }
-            this.typeModel = newval
-            this.resetForm()
-        }
-    },
     computed:{
         //领先期数label
         LeadLabelName(){
@@ -345,15 +334,18 @@ export default {
             }
             return ''
         },
+        changeModel(){
+            this.typeModel = this.infoForm.Model
+            this.resetForm()
+        },
         //重置表单
         resetForm(){
             this.infoForm = _.cloneDeep(baseForm)
             this.chartBatchData = null
             this.factorTableData = []
             this.showMultipleChart = false
-            const model = this.typeModel
+            this.infoForm.Model = this.typeModel
             this.typeModel = 0
-            this.infoForm.Model = model
         },
         //选择指标后获取指标详情
         async getEdbDetail({EdbInfoId,EdbInfoType}) {
@@ -600,7 +592,6 @@ export default {
         //编辑-获取相关性图表详情
         getRelevanceChartDetail(){
             //判断是单因子or多因子
-            this.isGetDetail = true
             if(this.$route.query.type!=1){
                 this.getSingleDetail()
             }else{