|
@@ -593,6 +593,20 @@ export default {
|
|
|
if(this.selectionStart){
|
|
|
// 找到当前sheet 数据
|
|
|
const sobj=this.sheetOpts.filter(_e=>_e.ExcelInfoId===this.activeSheetId)[0]
|
|
|
+ // 如果选择的不是同行或者同列
|
|
|
+ if(!(this.selectionStart.col==this.selectionEnd.col||this.selectionStart.row==this.selectionEnd.row)){
|
|
|
+ this.$message.warning(this.$t('CustomAnalysisPage.only_allowed_select_msg'));
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断选择的顺序如果是从后往前选择交换 start 和end
|
|
|
+ if((this.selectionStart.col==this.selectionEnd.col&&this.selectionStart.row>this.selectionEnd.row)||(this.selectionStart.row==this.selectionEnd.row&&this.selectionStart.col>this.selectionEnd.col)){
|
|
|
+ const temStart=JSON.parse(JSON.stringify(this.selectionStart))
|
|
|
+ const temEnd=JSON.parse(JSON.stringify(this.selectionEnd))
|
|
|
+ this.selectionEnd=temStart
|
|
|
+ this.selectionStart=temEnd
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
const str=`${sobj.ExcelName}!$${this.columnHeader[this.selectionStart.col]}$${this.selectionStart.row+1}:$${this.columnHeader[this.selectionEnd.col]}$${this.selectionEnd.row+1}`
|
|
|
this.$refs.balanceAddChart.tableSelect(this.selectionStart,this.selectionEnd,str)
|
|
|
}
|