|
@@ -345,11 +345,11 @@ export default {
|
|
setFocus(e);
|
|
setFocus(e);
|
|
|
|
|
|
/* 如果当前有公式单元格在编辑就拼接当前单元格进公式 */
|
|
/* 如果当前有公式单元格在编辑就拼接当前单元格进公式 */
|
|
- if(this.calculateClickCell && this.calculateClickCell.Uid!==cell.Uid) {
|
|
|
|
- console.log(this.calculateClickCell)
|
|
|
|
- const { cindex,rindex } = e.target.dataset;
|
|
|
|
- this.calculateClickCell.Value += `${cindex}${rindex}`
|
|
|
|
- }
|
|
|
|
|
|
+ // if(this.calculateClickCell && this.calculateClickCell.Uid!==cell.Uid) {
|
|
|
|
+ // console.log(this.calculateClickCell)
|
|
|
|
+ // const { cindex,rindex } = e.target.dataset;
|
|
|
|
+ // this.calculateClickCell.Value += `${cindex}${rindex}`
|
|
|
|
+ // }
|
|
|
|
|
|
//是插值单元格时寻找关联依赖的单元格 设置选框
|
|
//是插值单元格时寻找关联依赖的单元格 设置选框
|
|
if([4,5,7].includes(cell.DataType)) {
|
|
if([4,5,7].includes(cell.DataType)) {
|
|
@@ -530,11 +530,11 @@ export default {
|
|
}else if(value.startsWith('=')) { //公式单元格
|
|
}else if(value.startsWith('=')) { //公式单元格
|
|
cell.DataType = 6;
|
|
cell.DataType = 6;
|
|
let calculateVal = await this.getValueByFormula(value);
|
|
let calculateVal = await this.getValueByFormula(value);
|
|
|
|
+ if(!calculateVal) return
|
|
cell.ShowValue = calculateVal;
|
|
cell.ShowValue = calculateVal;
|
|
//处理公式关系
|
|
//处理公式关系
|
|
this.$set(cell,'Extra',this.dealFormulaConstruction(value))
|
|
this.$set(cell,'Extra',this.dealFormulaConstruction(value))
|
|
|
|
|
|
- console.log(cell)
|
|
|
|
|
|
|
|
}else {//自定义值
|
|
}else {//自定义值
|
|
cell.DataType = 3;
|
|
cell.DataType = 3;
|
|
@@ -636,9 +636,9 @@ export default {
|
|
console.log(factors)
|
|
console.log(factors)
|
|
|
|
|
|
//根据因数找单元格
|
|
//根据因数找单元格
|
|
- let isAllCell = factors.some(_ => findCellByFactor(_)=== null)
|
|
|
|
|
|
+ let isAllCell = factors.some(_ => findCellByFactor(_)===null||isNaN(findCellByFactor(_)))
|
|
if(isAllCell) {
|
|
if(isAllCell) {
|
|
- this.$message.warning('公式有误,参数不存在')
|
|
|
|
|
|
+ this.$message.warning('公式参数有误')
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
|
|
|
|
@@ -828,7 +828,6 @@ export default {
|
|
this.config.data.splice(index,1)
|
|
this.config.data.splice(index,1)
|
|
|
|
|
|
}
|
|
}
|
|
- // console.log(this.insertRelationArr)
|
|
|
|
},
|
|
},
|
|
|
|
|
|
/* 删除时清除关联关系 和删除单元格有关联的插入值单元格和 */
|
|
/* 删除时清除关联关系 和删除单元格有关联的插入值单元格和 */
|
|
@@ -1057,20 +1056,18 @@ export default {
|
|
this.$refs[`inputRef${e.target.dataset.key}`]&&this.$refs[`inputRef${e.target.dataset.key}`][0].close()
|
|
this.$refs[`inputRef${e.target.dataset.key}`]&&this.$refs[`inputRef${e.target.dataset.key}`][0].close()
|
|
|
|
|
|
cell.DataType===6 && this.$set(cell,'CanEdit',false)
|
|
cell.DataType===6 && this.$set(cell,'CanEdit',false)
|
|
- this.calculateClickCell = null
|
|
|
|
- resetDialogCellStyle()
|
|
|
|
|
|
+ // this.calculateClickCell = null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
/* 支持公式单元格双击切换状态 */
|
|
/* 支持公式单元格双击切换状态 */
|
|
dblClickCellHandle(e,cell) {
|
|
dblClickCellHandle(e,cell) {
|
|
- if(this.disabled || cell.DataType!==6 || this.calculateClickCell) return
|
|
|
|
|
|
+ if(this.disabled || cell.DataType!==6) return
|
|
|
|
|
|
this.$set(cell,'CanEdit',true)
|
|
this.$set(cell,'CanEdit',true)
|
|
|
|
|
|
- this.calculateClickCell = cell;
|
|
|
|
-
|
|
|
|
- setRelationStyle({ key:cell.Uid },'td-choose-insert-target')
|
|
|
|
|
|
+ // this.calculateClickCell = cell;
|
|
|
|
+ // setRelationStyle({ key:cell.Uid },'td-choose-insert-target')
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if(e.target.childNodes[0].childNodes[0].childNodes[1].nodeName==='INPUT') e.target.childNodes[0].childNodes[0].childNodes[1].focus();
|
|
if(e.target.childNodes[0].childNodes[0].childNodes[1].nodeName==='INPUT') e.target.childNodes[0].childNodes[0].childNodes[1].focus();
|