|
@@ -35,7 +35,7 @@
|
|
|
v-if="infoForm.Model===2"
|
|
|
ref="multipleIndForm"
|
|
|
:info-form="infoForm"
|
|
|
- :chart-info-data="{}"
|
|
|
+ :chart-info-data="chartInfoData"
|
|
|
:SeriesList="SeriesList"
|
|
|
@selectTarget="handleSelectTarget"
|
|
|
></multipleIndForm>
|
|
@@ -75,8 +75,8 @@
|
|
|
@saveEdb="(params)=>{handleSave(params);isSaveEdbToBase = true;}"
|
|
|
/>
|
|
|
<!-- 图表数据来源 -->
|
|
|
- <div class="source">
|
|
|
- 数据来源
|
|
|
+ <div class="source" v-if="chartBatchData.SourcesFrom.text&&chartBatchData.SourcesFrom.isShow">
|
|
|
+ {{ $t('Edb.Detail.source') }}:{{ chartBatchData.SourcesFrom.text }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 滚动相关性1 -->
|
|
@@ -172,6 +172,7 @@
|
|
|
:isChartSetting="true"
|
|
|
:isChartAdd="isMultipleChartAdd"
|
|
|
height="300"
|
|
|
+ @handleEdit="saveMultipleChart"
|
|
|
@saveChart="(params)=>{handleSave(params);isSaveChartToBase = true;}"
|
|
|
@saveEdb="(params)=>{handleSave(params);isSaveEdbToBase = true;}"
|
|
|
@chartSettingChange="handleChangeChartSetting"
|
|
@@ -451,6 +452,12 @@ export default {
|
|
|
const res = await chartRelevanceApi.previewChartBatch({...this.infoForm});
|
|
|
if(res.Ret !== 200) return
|
|
|
this.chartBatchData = res.Data;
|
|
|
+ const SourcesFrom = this.chartBatchData.CorrelationData.ChartInfo.SourcesFrom
|
|
|
+ try{
|
|
|
+ this.chartBatchData.SourcesFrom = SourcesFrom?JSON.parse(SourcesFrom):baseSourcesFrom
|
|
|
+ }catch(e){
|
|
|
+ this.chartBatchData.SourcesFrom = baseSourcesFrom
|
|
|
+ }
|
|
|
},
|
|
|
//预览多因子矩阵 初始化 factorTableData
|
|
|
previewMultipleTable(){
|
|
@@ -564,7 +571,7 @@ export default {
|
|
|
//相关性矩阵-删除曲线
|
|
|
deleteCurve(row){
|
|
|
const index = this.multipleChartData.YDataList.findIndex(i=>i.EdbInfoId===row.EdbInfoId)
|
|
|
- index&&this.multipleChartData.YDataList.splice(index,1)
|
|
|
+ index!==-1&&this.multipleChartData.YDataList.splice(index,1)
|
|
|
row.isAdd = false
|
|
|
if(!this.multipleChartData.YDataList.length){
|
|
|
this.showMultipleChart = false
|
|
@@ -579,7 +586,7 @@ export default {
|
|
|
* 数据来源:新字段 SourcesFrom.text
|
|
|
* 数据来源开关:新字段 SourcesFrom.isShow
|
|
|
*/
|
|
|
- const SourcesFrom = _.cloneDeep(this.multipleChartData.SourcesFrom)
|
|
|
+ const SourcesFrom = this.infoForm.Model===1?_.cloneDeep(this.chartBatchData.SourcesFrom):_.cloneDeep(this.multipleChartData.SourcesFrom)
|
|
|
this.settingData = {
|
|
|
SourcesFrom,
|
|
|
chartName:data.ChartName,
|
|
@@ -685,9 +692,9 @@ export default {
|
|
|
UniqueCode:this.$route.query.code
|
|
|
}).then(res=>{
|
|
|
if(res.Ret!==200) return
|
|
|
- const {ChartName,ChartInfoId,UniqueCode,ExtraConfig,SourcesFrom} = res.Data.ChartInfo
|
|
|
+ const {ChartName,ChartClassifyId,ChartInfoId,UniqueCode,ExtraConfig,SourcesFrom} = res.Data.ChartInfo
|
|
|
this.multipleChartData.ChartInfo = {
|
|
|
- ChartName,ChartInfoId,UniqueCode,Source:3
|
|
|
+ ClassifyId:ChartClassifyId,ChartName,ChartInfoId,UniqueCode,Source:3
|
|
|
}
|
|
|
const {EdbInfoList,XEdbIdValue,YDataList,CorrelationChartInfo} = res.Data
|
|
|
const {LeadValue,LeadUnit} = CorrelationChartInfo
|
|
@@ -698,11 +705,12 @@ export default {
|
|
|
this.multipleChartData.EdbInfoList = EdbInfoList
|
|
|
this.multipleChartData.YDataList = YDataList
|
|
|
try{
|
|
|
- this.multipleChartData.SourcesFrom = JSON.parse(SourcesFrom)
|
|
|
+ this.multipleChartData.SourcesFrom = SourcesFrom?JSON.parse(SourcesFrom):baseSourcesFrom
|
|
|
}catch(e){
|
|
|
this.multipleChartData.SourcesFrom = baseSourcesFrom
|
|
|
}
|
|
|
this.showMultipleChart = true
|
|
|
+ this.isMultipleChartAdd = true
|
|
|
|
|
|
})
|
|
|
//获取表单及矩阵详情
|
|
@@ -721,6 +729,9 @@ export default {
|
|
|
LeadValue,LeadUnit,CalculateValue,CalculateUnit
|
|
|
}
|
|
|
}
|
|
|
+ this.chartInfoData = {
|
|
|
+ EdbInfoList:[BaseEdbInfo]
|
|
|
+ }
|
|
|
//因子列表
|
|
|
this.SeriesList = EdbSeries
|
|
|
//相关性矩阵
|
|
@@ -768,18 +779,19 @@ export default {
|
|
|
}
|
|
|
console.log('test',params)
|
|
|
const {ChartInfoId} = this.multipleChartData.ChartInfo
|
|
|
+ const isEdit = ChartInfoId&&type!=='saveOther'
|
|
|
//另存为/新增->add 更新->edit
|
|
|
- const res = ChartInfoId
|
|
|
+ const res = isEdit
|
|
|
?await chartRelevanceApi.editMultipleFactor({...params,ChartInfoId})
|
|
|
:await chartRelevanceApi.addMultipleFactor(params)
|
|
|
//计算中...
|
|
|
if(res.Ret!==200) return
|
|
|
- if(!ChartInfoId){
|
|
|
+ if(!isEdit){
|
|
|
this.isMultipleChartAdd = true
|
|
|
this.multipleChartData.ChartInfo.ChartInfoId = res.Data.ChartInfoId
|
|
|
this.multipleChartData.ChartInfo.UniqueCode = res.Data.UniqueCode
|
|
|
}
|
|
|
- this.$message.success(`${ChartInfoId?'更新':'保存'}成功`)
|
|
|
+ this.$message.success(`${isEdit?'更新':'保存'}成功`)
|
|
|
//设置缩略图
|
|
|
this.$refs[`chartCard`+2].setChartImage(2,ChartInfoId)
|
|
|
this.isSaveChartToBase = false
|