Browse Source

fix 保存指标后,标的指标不允许修改

cxmo 11 months ago
parent
commit
0003c6929c

+ 4 - 4
src/views/chartRelevance_manage/components/explainText.js

@@ -1,7 +1,7 @@
 //相关性分析
 export const chartrelevanceTextArr = [
     `<p style='font-weight:bold;'>相关性计算处理逻辑:</p>
-    <p>单因子:</p>
+    <p style='font-weight:bold;'>单因子:</p>
     <p>1、取数:取计算窗口的时间长度,从当前时间往前推移对应的时间长度,取该日期区间,指标A序列值和指标B序列值;</p>
     <p>2、变频:根据指标A和指标B的频度对取出的数据序列做如下处理</p>
     <p>①指标A高频,对指标B升频(线性方程插值法补全数据);</p>
@@ -17,12 +17,12 @@ export const chartrelevanceTextArr = [
     <p>1、计算窗口:参与计算的时间段长度,从两个指标都有值的日期开始滚动的取计算窗口长度的值进行计算,如配置计算窗口1个月,则2023.7.28的值取2023.6.28~2023.7.28时间段,2023.7.27的值取2023.6.27~2023.7.27时间段;</p>
     <p>2、B领先A:B指标领先A指标的参数,为0时不领先;</p>
     <p style='height:20px;'></p>
-    <p>多因子:</p>
+    <p style='font-weight:bold;'>多因子:</p>
     <p>可一次选择多个指标,与标的指标进行相关性计算。每一个因子指标与标的指标的计算逻辑,同单因子模式。</p>`
 ]
 export const chartrelevanceTextArrEn=[
     `<p style='font-weight:bold;'>Instruction for Correlation Calculation Processing Logic:</p>
-    <p>Single Indicator:</p>
+    <p style='font-weight:bold;'>Single Indicator:</p>
     <p>1、 Data Retrieval: Determine the time length of the calculation window, and move backwards from the current time by this duration to obtain a range of dates. Retrieve values for indicator A series and indicator B series within this date range.</p>
     <p>2、Frequency Adjustment:</p>
     <p>a. If indicator A is higher frequency, upsample indicator B (use linear equation interpolation to fill in data).</p>
@@ -38,7 +38,7 @@ export const chartrelevanceTextArrEn=[
     <p>1. Calculation Window: The length of time involved in calculations starts from when both indicators have available values and rolls forward taking values within the duration of the calculation window for computation. For example, if configured with a 1-month calculation window, then the value for July 28th, 2023 will be taken from June 28th to July 28th, 2023; while the value for July 27th will be taken from June 27th to July 27th.</p>
     <p>2. B Leads A: The parameter by which indicator B leads ahead of indicator A; when set to 0, there is no lead.</p>
     <p style='height:20px;'></p>
-    <p>Multiple Indicators:</p>
+    <p style='font-weight:bold;'>Multiple Indicators:</p>
     <p>Multiple indicators can be selected at a time to calculate the correlation with the target indicator. The calculation logic of each factor index and the target index is the same as the Single Indicato.</p>`
 ]
 

+ 5 - 0
src/views/chartRelevance_manage/components/selectTarget.vue

@@ -4,6 +4,7 @@
       style="width: 100%"
       v-model="targetType"
       :placeholder="$t('StatisticAnalysis.StatisticFeatureChart.selecr_indicator_pld')"
+      :disabled="isDisabled"
       @change="targetTypeChange"
       v-if="selectStyleType===1&&filter"
     >
@@ -82,6 +83,7 @@
       :filterable="!search_txt"
       remote
       clearable
+      :disabled="isDisabled"
       :placeholder="$t('Edb.InputHolderAll.select_edb_name')"
       :style="`width: ${width}; ${filter?'margin-top: 20px':''}`"
       :remote-method="searchHandle"
@@ -136,6 +138,9 @@ export default {
       },
       width: {
         default:'100%'
+      },
+      isDisabled:{
+        default:false
       }
     },
     watch:{

+ 6 - 0
src/views/chartRelevance_manage/relevance/components/multipleIndForm.vue

@@ -4,7 +4,9 @@
         <el-form-item 
             :label="$t('StatisticAnalysis.ChartRelevance.target_indicator')" 
             prop="IndTarget" class="select-target">
+            <!-- 添加后的图表不允许修改标的指标 -->
             <selectTarget 
+                :isDisabled="isMultipleChartAdd"
                 :defaultId="chartInfoData.EdbInfoList?chartInfoData.EdbInfoList[0].EdbInfoId:''"
                 :defaultOpt="chartInfoData.EdbInfoList?[chartInfoData.EdbInfoList[0]]:[]" 
                 :defaultType="chartInfoData.EdbInfoList?chartInfoData.EdbInfoList[0].EdbInfoCategoryType:''"
@@ -205,6 +207,10 @@ export default {
         SeriesList:{
             type:Object,
             default:[]
+        },
+        isMultipleChartAdd:{
+            type:Boolean,
+            default:false
         }
     },
     computed:{

+ 19 - 3
src/views/chartRelevance_manage/relevance/relevanceChartEditorV2.vue

@@ -37,6 +37,7 @@
                         v-if="infoForm.Model===2"
                         ref="multipleIndForm"
                         :info-form="infoForm"
+                        :isMultipleChartAdd="isMultipleChartAdd"
                         :chart-info-data="chartInfoData"
                         :SeriesList="SeriesList"
                         @selectTarget="handleSelectTarget"
@@ -270,6 +271,7 @@ export default {
             factorTableData:[],//多因子-相关性矩阵表格
             factorTableDataSortCopy:[],//复制一份,用于还原排序
             multipleChartData:_.cloneDeep(baseChartInfo),//多因子图表信息
+            IndTarget:{},//存储标的指标信息
             showMultipleChart:false,//是否显示多因子相关性图表
 
             isSaveChartToBase:false,
@@ -404,7 +406,9 @@ export default {
             this.infoForm[type] = target.EdbInfoId||''
             const {max,min,data} = await this.getEdbDetail(target)
             if(type==='IndTarget'){
-                this.multipleChartData.ChartInfo = data
+                this.IndTarget = data
+                //点计算时,才真正赋值ChartInfo
+                //this.multipleChartData.ChartInfo = data
             }
             //若为单因子,选择AB指标后预览曲线图
             if(!['EdbInfoIdA','EdbInfoIdB'].includes(type)) return 
@@ -456,6 +460,16 @@ export default {
                 this.infoForm.MultipleGraphConfigId = MultipleGraphConfigId;
                 this.previewSingleChart({})
             }else{
+                //已添加指标后重新计算
+                if(this.isMultipleChartAdd){
+                    const {ChartInfoId,UniqueCode,ClassifyId} = this.multipleChartData.ChartInfo
+                    this.multipleChartData.ChartInfo = this.IndTarget
+                    this.multipleChartData.ChartInfo.ChartInfoId = ChartInfoId
+                    this.multipleChartData.ChartInfo.UniqueCode = UniqueCode
+                    this.multipleChartData.ChartInfo.ClassifyId = ClassifyId
+                }else{
+                    this.multipleChartData.ChartInfo = this.IndTarget
+                }
                 //多因子:根据分析周期生成相关性矩阵,在未添加曲线前不生成图表
                 this.previewMultipleTable()
             }
@@ -786,7 +800,7 @@ export default {
         },
         //多因子-保存/更新/另存为图表
         async saveMultipleChart({ChartName,ClassifyId,type}){
-            const {IndTarget,Correlation} = this.infoForm
+            const {/* IndTarget, */Correlation} = this.infoForm
             const {SourcesFrom,YDataList} = this.multipleChartData
             const SeriesEdb = YDataList.map(i=>{
                 return {
@@ -794,6 +808,8 @@ export default {
                     EdbInfoId:i.Id
                 }
             })
+            //BaseEdbInfoId取当前图表中的Id 不取form里的
+            const BaseEdbInfoId = this.multipleChartData.ChartInfo.EdbInfoId
             const SeriesIds = this.$refs.multipleIndForm.factorList.map(i=>i.SeriesId)
             const LegendConfig = YDataList.map(i=>{
                 return {
@@ -806,7 +822,7 @@ export default {
             let params = {
                 ChartName,ClassifyId,
                 AnalysisMode:1,
-                BaseEdbInfoId:IndTarget,
+                BaseEdbInfoId:BaseEdbInfoId/* IndTarget */,
                 FactorCorrelation:{
                     ...Correlation,
                     SeriesEdb,