浏览代码

接口联调 暂存

cxmo 9 月之前
父节点
当前提交
d1f64255e9

+ 10 - 0
src/api/modules/chartApi.js

@@ -411,10 +411,20 @@ const dataBaseInterface = {
 		return http.post('/datamanage/edb_info/batch/add',params)
 	},
 	// 批量计算指标时获取当前筛选条件下选择的指标
+	/**
+	 * @param {Object} params
+	 * @param {Number} params.EdbInfoType 0-指标;1-预测指标
+	 * @returns 
+	 */
 	getBatchFilterAddEdbList:params=>{
 		return http.get('/datamanage/edb_info/calculate/multi/choice',params)
 	},
 	//批量计算指标时待选指标的搜索列表
+	/**
+	 * @param {Object} params
+	 * @param {Number} params.EdbInfoType 0-指标;1-预测指标
+	 * @returns 
+	 */
 	getBatchAddEdbSearchList:params=>{
 		return http.get('/datamanage/edb_info/calculate/multi/search',params)
 	},

+ 75 - 9
src/api/modules/chartRelevanceApi.js

@@ -253,15 +253,81 @@ export default{
     return http.post('/datamanage/multiple_graph/preview_cure',params)
   },
 
-  /**
-	 * 设置图表对应版本信息
-	 * @param {*} params 
-	 * ChartInfoId ChartName
-	 * @returns 
-	 */
-	setChartLangInfo: params => {
-		return http.post('/correlation/chart_info/base/edit',params)
-	},
+    /**
+     * 设置图表对应版本信息
+     * @param {*} params 
+     * ChartInfoId ChartName
+     * @returns 
+     */
+    setChartLangInfo: params => {
+        return http.post('/correlation/chart_info/base/edit',params)
+    },
+
+    /* 相关性功能拓展 */
+
+    /**
+     * 获取计算方式列表
+     * @param {Object} params 
+     * @param {Number} params.EdbInfoType  指标类型:0-普通指标;1-预测指标
+     * @returns 
+     */
+    getCalculateFormula:params => {
+        return http.get('/datamanage/factor_edb_series/calculate_func/list',params)
+    },
+    /**
+     * 添加多因子系列
+     * @param {Object} params 
+     * @param {String} params.SeriesName 系列名称
+     * @param {Number} params.EdbInfoType 指标类型:0-普通指标; 1-预测指标
+     * @param {Object[]} params.Calculates 选择的计算公式
+     * @param {String} params.Calculates[].Formula N值/移动天数/指数修匀alpha值/计算公式等
+     * @param {String} params.Calculates[].Calendar 公历/农历
+     * @param {String} params.Calculates[].Frequency 需要转换的频度
+     * @param {String} params.Calculates[].MoveType 移动方式:1-领先(默认);2-滞后
+     * @param {String} params.Calculates[].MoveFrequency 移动频度
+     * @param {String} params.Calculates[].FromFrequency 来源的频度
+     * @param {Number} params.Calculates[].Source 计算方式来源
+     * @param {Number} params.Calculates[].Sort 计算顺序
+     * @param {Number[]} params.EdbInfoIds 需要计算的指标
+     * @returns 
+     */
+    addFactorSeries:params=>{
+        return http.post('/datamanage/factor_edb_series/add',params)
+    },
+    /**
+     * 编辑多因子系列
+     * @param {Object} params 
+     * @param {String} params.SeriesId //因子系列ID
+     * //其他同添加
+     * @returns 
+     */
+    editFactorSeries:params=>{
+        return http.post('/datamanage/factor_edb_series/edit',params)
+    },
+    /**
+     * 获取多因子系列详情
+     * @param {Object} params
+     * @param {Number} params.SeriesId 因子指标系列ID
+     * @returns 
+     */
+    getFactorSeriesDetail:params=>{
+        return http.get('/datamanage/factor_edb_series/detail',params)
+    },
+    /**
+     * 获取相关性矩阵
+     * @param {Object} params
+     * @param {Number} params.BaseEdbInfoId 标的指标ID
+     * @param {Object} params.Correlation
+     * @param {Number} params.Correlation.CalculateValue 计算窗口
+     * @param {String} params.Correlation.CalculateUnit 计算窗口频度
+     * @param {Number} params.Correlation.LeadValue 分析周期
+     * @param {String} params.Correlation.LeadUnit 分析周期频度
+     * @param {Number[]} params.SeriesIds 因子系列Id
+     * @returns 
+     */
+    getCorrelationMatrix:params=>{
+        return http.post('datamanage/factor_edb_series/correlation/matrix',params)
+    },
 
 }
 

+ 8 - 8
src/views/chartRelevance_manage/relevance/components/batchSelectFormula.vue

@@ -2,7 +2,7 @@
     <div class="batch-select-formula-wrap">
         <el-form :model="formulaForm" :rules="formulaRules" label-width="80px" ref="formulaForm">
             <div class="formula-list">
-                <div class="list-item" v-for="(item,index) in formulaForm.formulaList" :key="index">
+                <div class="list-item" v-for="(item,index) in formulaForm.CalculateStep" :key="index">
                     <span>
                         <img @click="deleteFormula(index)" style="width:15px;height:15px;cursor: pointer;" src="~@/assets/img/ai_m/delete.png" alt="">
                     </span>
@@ -68,7 +68,7 @@
                         :label="$t('StatisticAnalysis.ChartRelevance.series_name')"
                         label-width="120px"
                     >
-                        <el-input v-model.trim="formulaForm.name" style="width:230px" 
+                        <el-input v-model.trim="formulaForm.SeriesName" style="width:230px" 
                         :placeholder="$t('StatisticAnalysis.ChartRelevance.series_name_placeholder')"></el-input>
                     </el-form-item>
                 </div>
@@ -132,8 +132,8 @@ export default {
     data() {
         return {
             formulaForm:{
-                formulaList:[],
-                name:''
+                CalculateStep:[],
+                SeriesName:''
             },
             formulaRules:{},
         };
@@ -141,7 +141,7 @@ export default {
     methods: {
         //打开弹窗时,在外层组件调用
         initFormulaList(){
-            this.formulaForm.formulaList = _.cloneDeep(this.dataFormulaList)
+            this.formulaForm.CalculateStep = _.cloneDeep(this.dataFormulaList)
         },
         validator(rule,value,callback){
             if(Number(value)<=0||Number(value)>=1){
@@ -151,7 +151,7 @@ export default {
             }
         },
         addFormula(){
-            this.formulaForm.formulaList.push({
+            this.formulaForm.CalculateStep.push({
                 formulaType:5,
                 nNum:1,
                 calendarType:'公历',
@@ -159,10 +159,10 @@ export default {
             })
         },
         deleteFormula(index){
-            if(this.formulaForm.formulaList.length>=5){
+            if(this.formulaForm.CalculateStep.length>=5){
                 return this.$message.warning(/* "最多仅能添加5个计算公式" */ this.$t('StatisticAnalysis.ChartRelevance.formulaform_add_hint'))
             }
-            this.formulaForm.formulaList.splice(index,1)
+            this.formulaForm.CalculateStep.splice(index,1)
         },
         async checkForm(){
             return await this.$refs.formulaForm.validate()

+ 41 - 38
src/views/chartRelevance_manage/relevance/components/multipleIndForm.vue

@@ -21,7 +21,7 @@
                         v-for="(item,index) in factorList" :key="index">
                         <span>
                             <i class="el-icon-arrow-right"></i>
-                            {{ item.name }}
+                            {{ item.SeriesName }}
                         </span>
                         <span  @click.stop="openAddDialog(item)" style="margin-left: auto;">
                             <img src="~@/assets/img/icons/edit_blue_new.png" alt="" style="width: 16px; height: 16px; margin-right: 5px">
@@ -95,9 +95,9 @@
             <div class="dialog-content">
                 <!-- 选择指标 or 预测指标 -->
                 <div class="table-radio-wrap">
-                    <el-radio-group v-model="factorData.edbType" @input="changeEdbType">
-                        <el-radio label="1">ETA指标</el-radio>
-                        <el-radio label="2">预测指标</el-radio>
+                    <el-radio-group v-model="factorData.EdbInfoType" @input="changeEdbType">
+                        <el-radio :label="0">ETA指标</el-radio>
+                        <el-radio :label="1">预测指标</el-radio>
                     </el-radio-group>
                     
                 </div>
@@ -190,9 +190,10 @@
 <script>
 import batchSelectTable from './batchSelectTable'
 import batchSelectFormula from './batchSelectFormula'
-import formMixin from './formMixin';
+import formMixin from './formMixin'
 import { frequencySelectList } from '@/utils/defaultOptions'
-import { dataBaseInterface,departInterence } from '@/api/api.js';
+import { dataBaseInterface,departInterence } from '@/api/api.js'
+import * as preDictEdbInterface from "@/api/modules/predictEdbApi.js"
 export default {
     mixins:[formMixin],
 	components: { batchSelectTable, batchSelectFormula },
@@ -242,33 +243,33 @@ export default {
     },
     data(){
         return {
-            edbType:'1',
+            edbType:'0',
             factorList:[
                 {
-                    "name":"7894567",
-                    "formulaList":[],
-                    "selectList":[
-                        {"EdbInfoId":104758,"EdbName":"7894567","EdbNameEn":"aaaa"},
-                        {"EdbInfoId":104845,"EdbName":"生成指标","EdbNameEn":"生成指标"}
+                    "SeriesId": 4, 
+                    "SeriesName": "系列名称A001", 
+                    "EdbInfoType": 0, //0指标,1预测指标
+                    "CalculateStep":[ //计算公式
+                        {
+                            "Formula": "", 
+                            "Calendar": "", 
+                            "Frequency": "", 
+                            "MoveType": 0, 
+                            "MoveFrequency": "", 
+                            "FromFrequency": "", 
+                            "Source": 3, 
+                            "Sort": 1 
+                        },
                     ],
-                    "edbType":'1'
+                    "EdbMappings":[],//所有的指标
                 },
-                {
-                    "name":"美国10年通胀预期同比",
-                    "formulaList":[],
-                    "selectList":[
-                        {"EdbInfoId":104176,"EdbName":"美国10年通胀预期同比","EdbNameEn":"美国10年通胀预期同比"},
-                        {"EdbInfoId":104177,"EdbName":"天津螺纹价格同比","EdbNameEn":"天津螺纹价格同比"}
-                    ],
-                    "edbType":'2'
-                }
-            ], //mock用,之后替换成infoForm中表示因子系列的字段
+            ], //多因子系列列表
             isAddFactorDialogShow:false,
             factorData:{
-                name:'',//因子系列名称
-                formulaList:[],//因子系列计算公式
-                selectList:[],//因子系列选择的指标
-                edbType:'1',//选择的指标类型:1指标2预测指标
+                SeriesName:'',//因子系列名称
+                CalculateStep:[],//因子系列计算公式
+                EdbMappings:[],//因子系列选择的指标
+                EdbInfoType:0,//选择的指标类型:0指标1预测指标
             },
             tableData:[],
             tableSelectParams:{
@@ -294,10 +295,8 @@ export default {
     },
     methods:{
         openAddDialog(data){
-            const {name='',formulaList=[],selectList=[],edbType='1'} = data
-            this.factorData = {
-                name,formulaList,selectList,edbType
-            }
+            this.factorData = _.cloneDeep(data)
+            console.log('data?',data)
             this.getClassifyOpt()
             this.getSysUserOpt()
             //清空筛选项
@@ -310,7 +309,7 @@ export default {
             if(this.isAddFactorDialogShow){
                 console.log('change')
                 //若切换指标类型,清空选项
-                this.factorData.selectList = []
+                this.factorData.EdbMappings = []
                 this.getClassifyOpt()
             }
         },
@@ -333,7 +332,9 @@ export default {
             this.listCheckAllChange(false)
         },
         async getClassifyOpt(){
-            const res=await dataBaseInterface.menuListV3()
+            const res= this.factorData.EdbInfoType===0
+                        ?await dataBaseInterface.menuListV3()
+                        :await preDictEdbInterface.classifyListV2()
             if (res.Ret !== 200) return
 
             const filterNodes = (arr)=>{
@@ -392,7 +393,8 @@ export default {
                 Keyword:keyword,
                 Frequency,
                 SelectAll:this.isSelectAll,
-                EdbInfoIds:selectList.join(',')
+                EdbInfoIds:selectList.join(','),
+                EdbInfoType:Number(this.factorData.EdbInfoType||0)
             })
             if(res.Ret!==200) return 
             //去重
@@ -428,7 +430,8 @@ export default {
                 PageSize: this.tableParams.pageSize,
                 SysUserIds,ClassifyIds,Frequency,
                 Keyword:keyword,
-                NotFrequency:''
+                NotFrequency:'',
+                EdbInfoType:Number(this.factorData.EdbInfoType||0)
             })
             this.tableLoading=false
             if(res.Ret!==200) return 
@@ -454,10 +457,10 @@ export default {
         addFactorIndicators(){
             //因子指标系列push
             const selectData = this.$refs.batchSelectTable.selectData
-            const {name,formulaList} = this.$refs.batchSelectFormula.formulaForm
+            const {SeriesName,CalculateStep} = this.$refs.batchSelectFormula.formulaForm
             this.factorList.push({
-                name,formulaList,
-                selectList:selectData,
+                SeriesName,CalculateStep,
+                EdbMappings:selectData,
             })
             this.isAddFactorDialogShow = false
         },