|
@@ -175,10 +175,16 @@ export default {
|
|
|
//接口获取更新后的数据
|
|
|
changeTableData(index){
|
|
|
const {IsConvert,ConvertType,ConvertValue,ConvertUnit,ConvertEnUnit,EdbInfoId} = this.updateData[index]
|
|
|
- //if(!IsConvert) return
|
|
|
//计算方式是否合法
|
|
|
if(!this.checkConver(ConvertType,ConvertValue)){
|
|
|
- return this.$message.warning("数据转换不合法")
|
|
|
+ return this.$message.warning("数据转换不合法,请检查数值")
|
|
|
+ }
|
|
|
+ //如果类型为对数,检测数据是否包含负数
|
|
|
+ if(ConvertType===3){
|
|
|
+ const {MaxData,MinData} = this.tableData[index]
|
|
|
+ if(MinData<0||MaxData<0){
|
|
|
+ return this.$message.warning("指标数据含有负数,无法进行对数运算")
|
|
|
+ }
|
|
|
}
|
|
|
//柱形图单独设置
|
|
|
if(this.chartInfo.ChartType===7){
|
|
@@ -206,19 +212,17 @@ export default {
|
|
|
this.chartInfo.Unit = ConvertUnit
|
|
|
this.chartInfo.UnitEn = ConvertEnUnit
|
|
|
}
|
|
|
- const temp = EdbInfoList[0]
|
|
|
- temp.EdbAliasName = this.tableData[index].EdbAliasName
|
|
|
- this.tableData.splice(index,1,temp)
|
|
|
- //this.updateData[index] = this.formatUpdateData(this.tableData[index])
|
|
|
+ //this.tableData.splice(index,1,temp)
|
|
|
+ //需要保留tableData[]的其他属性,仅修改属性
|
|
|
+ this.tableData[index].DataList = EdbInfoList[0].DataList
|
|
|
+ this.tableData[index].ConvertUnit = EdbInfoList[0].ConvertUnit
|
|
|
+ this.tableData[index].ConvertEnUnit = EdbInfoList[0].ConvertEnUnit
|
|
|
+ this.tableData[index].MaxData = EdbInfoList[0].MaxData
|
|
|
+ this.tableData[index].MinData = EdbInfoList[0].MinData
|
|
|
})
|
|
|
},
|
|
|
setChangeBarData(index){
|
|
|
const {ConvertType,ConvertValue,ConvertUnit,ConvertEnUnit} = this.updateData[index]
|
|
|
- //if(!IsConvert) return
|
|
|
- //计算方式是否合法
|
|
|
- if(!this.checkConver(ConvertType,ConvertValue)){
|
|
|
- return this.$message.warning("数据转换不合法")
|
|
|
- }
|
|
|
if(index===this.useUnit&&this.chartInfo.ChartType===7){
|
|
|
this.chartInfo.Unit = ConvertUnit||'无'
|
|
|
this.chartInfo.UnitEn = ConvertEnUnit
|
|
@@ -399,25 +403,33 @@ export default {
|
|
|
async getPreviewSplineInfo() {
|
|
|
let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
|
|
|
let params = {
|
|
|
- ChartType: this.chartInfo.ChartType,
|
|
|
- DateType: this.year_select,
|
|
|
- StartDate: [5 , 6].includes(this.year_select)
|
|
|
- ? dateArray[0]
|
|
|
- : '',
|
|
|
- EndDate: this.year_select === 5 ? dateArray[1]: '',
|
|
|
- Calendar: this.calendar_type,
|
|
|
+ ChartType: this.chartInfo.ChartType,
|
|
|
+ DateType: this.year_select,
|
|
|
+ StartDate: [5 , 6].includes(this.year_select)
|
|
|
+ ? dateArray[0]
|
|
|
+ : '',
|
|
|
+ EndDate: this.year_select === 5 ? dateArray[1]: '',
|
|
|
+ Calendar: this.calendar_type,
|
|
|
StartYear:this.count_year || 0,
|
|
|
// ETA1.0.5 去除了这两个入参
|
|
|
- // SeasonStartDate: this.season_year ? this.season_year[0] : '',
|
|
|
- // SeasonEndDate: this.season_year ? this.season_year[1] : '',
|
|
|
+ // SeasonStartDate: this.season_year ? this.season_year[0] : '',
|
|
|
+ // SeasonEndDate: this.season_year ? this.season_year[1] : '',
|
|
|
SeasonExtraConfig:this.SeasonExtraConfig,
|
|
|
- ChartEdbInfoList: this.tableData.map(_ => ({
|
|
|
- EdbInfoId: _.EdbInfoId,
|
|
|
- EdbInfoType: _.EdbInfoType,
|
|
|
- LeadValue: _.EdbInfoType ? 0 : Number(_.LeadValue),
|
|
|
- LeadUnit: _.EdbInfoType ? '' : _.LeadUnit,
|
|
|
- }))
|
|
|
- }
|
|
|
+ ChartEdbInfoList: this.tableData.map((_,index) => {
|
|
|
+ const {IsConvert,ConvertType,ConvertValue,ConvertUnit,ConvertEnUnit} = this.updateData[index]
|
|
|
+ return {
|
|
|
+ EdbInfoId: _.EdbInfoId,
|
|
|
+ EdbInfoType: _.EdbInfoType,
|
|
|
+ LeadValue: _.EdbInfoType ? 0 : Number(_.LeadValue),
|
|
|
+ LeadUnit: _.EdbInfoType ? '' : _.LeadUnit,
|
|
|
+ IsConvert:Number(IsConvert),
|
|
|
+ ConvertType,
|
|
|
+ ConvertValue:Number(ConvertValue),
|
|
|
+ ConvertUnit:IsConvert?ConvertUnit:'',
|
|
|
+ ConvertEnUnit:IsConvert?ConvertEnUnit:''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
const res = await dataBaseInterface.getSplinePreviewData(params)
|
|
|
|