|
@@ -470,13 +470,63 @@ export default {
|
|
|
formRules: {},
|
|
|
|
|
|
edbList: [],//sheet1!$A$3:$A$13
|
|
|
- selectInput:''
|
|
|
+ selectInput:'',
|
|
|
+
|
|
|
+ editChartInfoId:0,//编辑时的图表id
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.edbList.push(this.createEbdListItem('A'))
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 编辑时初始化数据
|
|
|
+ initEditData(e){
|
|
|
+ console.log('edit回显数据',e);
|
|
|
+ const {ChartInfo,EdbInfoList}=e
|
|
|
+ this.editChartInfoId=ChartInfo.ChartInfoId
|
|
|
+ this.formData.chartName=ChartInfo.ChartName
|
|
|
+ this.formData.chartSource=JSON.parse(ChartInfo.SourcesFrom).text
|
|
|
+ this.formData.showChartSource=JSON.parse(ChartInfo.SourcesFrom).isShow
|
|
|
+ this.formData.chartType=ChartInfo.ChartType
|
|
|
+ this.formData.leftMin=ChartInfo.LeftMin?Number(ChartInfo.LeftMin):0
|
|
|
+ this.formData.leftMax=ChartInfo.LeftMax?Number(ChartInfo.LeftMax):0
|
|
|
+ this.formData.rightMin=ChartInfo.RightMin?Number(ChartInfo.RightMin):0
|
|
|
+ this.formData.rightMax=ChartInfo.RightMax?Number(ChartInfo.RightMax):0
|
|
|
+ this.formData.rightTwoMin=ChartInfo.Right2Min?Number(ChartInfo.Right2Min):0
|
|
|
+ this.formData.rightTwoMax=ChartInfo.Right2Max?Number(ChartInfo.Right2Max):0
|
|
|
+ if(ChartInfo.ChartType===2&&ChartInfo.SeasonExtraConfig){
|
|
|
+ this.SeasonExtraConfig.ChartLegend=ChartInfo.SeasonExtraConfig.ChartLegend
|
|
|
+ this.SeasonExtraConfig.XStartDate=ChartInfo.SeasonExtraConfig.XStartDate
|
|
|
+ this.SeasonExtraConfig.XEndDate=ChartInfo.SeasonExtraConfig.XEndDate
|
|
|
+ this.SeasonExtraConfig.JumpYear=ChartInfo.SeasonExtraConfig.JumpYear?true:false
|
|
|
+ this.SeasonExtraConfig.type=ChartInfo.Calendar
|
|
|
+ }
|
|
|
+
|
|
|
+ // 回显
|
|
|
+ const arr=EdbInfoList||[]
|
|
|
+ let temEdbList=[]
|
|
|
+ arr.forEach((item,index)=>{
|
|
|
+ temEdbList.push({
|
|
|
+ tag: '',
|
|
|
+ ExcelChartEdbId:item.EdbInfoId,
|
|
|
+ timeSerial: '',
|
|
|
+ valueSerial: '',
|
|
|
+ maxData:item.MaxData,//选中数据的最大值
|
|
|
+ minData:item.MinData,//选中数据的最小值
|
|
|
+ name: item.EdbAliasName,
|
|
|
+ axis: item.IsAxis,//哪个轴 1左轴 0右轴 2右二轴
|
|
|
+ EdbInfoType: item.EdbInfoType,//指标类型 1标准指标 0领先指标
|
|
|
+ leadVal: item.LeadValue,//领先值
|
|
|
+ leadUnit: item.LeadUnit,//领先单位
|
|
|
+ IsOrder: item.IsOrder,//是否逆序
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ this.edbList=temEdbList
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
// 点击选中哪个指标的时间\数值序列
|
|
|
handleChooseInput(e){
|
|
|
this.selectInput=e
|
|
@@ -600,10 +650,11 @@ export default {
|
|
|
createEbdListItem(t) {
|
|
|
return {
|
|
|
tag: t,
|
|
|
+ ExcelChartEdbId:0,
|
|
|
timeSerial: '',
|
|
|
valueSerial: '',
|
|
|
maxData:0,//选中数据的最大值
|
|
|
- minData:0,//选中数据的最大=小值
|
|
|
+ minData:0,//选中数据的最小值
|
|
|
name: '',
|
|
|
axis: 1,//哪个轴 1左轴 0右轴 2右二轴
|
|
|
EdbInfoType: 1,//指标类型 1标准指标 0领先指标
|
|
@@ -618,12 +669,35 @@ export default {
|
|
|
},
|
|
|
// 初始化表单
|
|
|
initData() {
|
|
|
- // this.
|
|
|
+ this.editChartInfoId=0
|
|
|
+ this.formData={
|
|
|
+ chartName: '',
|
|
|
+ chartSource: '平衡表',
|
|
|
+ showChartSource: false,
|
|
|
+ chartType: 1,
|
|
|
+ leftMin: 0,
|
|
|
+ leftMax: 0,
|
|
|
+ rightMin: 0,
|
|
|
+ rightMax: 0,
|
|
|
+ rightTwoMin: 0,
|
|
|
+ rightTwoMax: 0,
|
|
|
+ }
|
|
|
+ this.SeasonExtraConfig={
|
|
|
+ ChartLegend:[], // 图例名称数组
|
|
|
+ XStartDate:"01-01", // 横坐标显示范围 - 开始
|
|
|
+ XEndDate:"12-31", // 横坐标显示范围-结束
|
|
|
+ JumpYear:false, //是否跨年
|
|
|
+ isSpanYearDisable:false,
|
|
|
+ type:'公历',
|
|
|
+ }
|
|
|
+ this.edbList=[]
|
|
|
+ this.selectInput=''
|
|
|
+ this.edbList.push(this.createEbdListItem('A'))
|
|
|
},
|
|
|
- saveHandle() {
|
|
|
+ async saveHandle() {
|
|
|
const params={
|
|
|
ExcelInfoId:this.ExcelInfoId,
|
|
|
- ChartInfoId:0,
|
|
|
+ ChartInfoId:this.editChartInfoId||0,
|
|
|
ChartEdbInfoList:[],
|
|
|
ChartName:this.formData.chartName,
|
|
|
ChartType:this.formData.chartType,
|
|
@@ -631,12 +705,12 @@ export default {
|
|
|
text:this.formData.chartSource,
|
|
|
isShow:this.formData.showChartSource
|
|
|
}),
|
|
|
- LeftMin:this.formData.leftMin+'',
|
|
|
- LeftMax:this.formData.leftMax+'',
|
|
|
- RightMin:this.formData.rightMin+'',
|
|
|
- RightMax:this.formData.rightMax+'',
|
|
|
- Right2Min:this.formData.rightTwoMin+'',
|
|
|
- Right2Max:this.formData.rightTwoMax+'',
|
|
|
+ LeftMin:`${this.formData.leftMin}`,
|
|
|
+ LeftMax:`${this.formData.leftMax}`,
|
|
|
+ RightMin:`${this.formData.rightMin}`,
|
|
|
+ RightMax:`${this.formData.rightMax}`,
|
|
|
+ Right2Min:`${this.formData.rightTwoMin}`,
|
|
|
+ Right2Max:`${this.formData.rightTwoMax}`,
|
|
|
MinMaxSave:1,
|
|
|
Source:11
|
|
|
}
|
|
@@ -668,7 +742,7 @@ export default {
|
|
|
this.edbList.forEach(item=>{
|
|
|
arr.push({
|
|
|
FromTag:item.tag,
|
|
|
- ExcelChartEdbId:0,
|
|
|
+ ExcelChartEdbId:item.ExcelChartEdbId,
|
|
|
EdbName:item.name,
|
|
|
IsAxis:item.axis,
|
|
|
IsOrder:item.IsOrder,
|
|
@@ -688,13 +762,12 @@ export default {
|
|
|
if(!item.EdbName) return this.$message.warning(`第${index+1}个指标名称未填写`)
|
|
|
}
|
|
|
|
|
|
- sheetInterface.addBalanceChart(params).then(res=>{
|
|
|
- if(res.Ret===200){
|
|
|
- this.$message.success(this.$t('MsgPrompt.add_msg2'));
|
|
|
- this.$emit('success')
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
+ const res=this.editChartInfoId?await sheetInterface.editBalanceChart(params):await sheetInterface.addBalanceChart(params)
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success(this.$t('MsgPrompt.add_msg2'));
|
|
|
+ this.initData()
|
|
|
+ this.$emit('success')
|
|
|
+ }
|
|
|
},
|
|
|
cancelHandle() {
|
|
|
this.$emit('update:isShow', false);
|