|
@@ -56,7 +56,7 @@
|
|
|
:data-cindex="columnHeader[cell_index]"
|
|
|
:data-key="cell.Uid"
|
|
|
@click="clickCell($event, cell)"
|
|
|
- @dblclick="dblClickCell($event,cell)"
|
|
|
+ @dblclick="dblClickCellHandle($event,cell)"
|
|
|
@contextmenu.prevent="rightClickHandle($event,cell)"
|
|
|
@mouseenter="getRelationEdbInfo(cell)"
|
|
|
@copy="copyCellHandle($event,cell)"
|
|
@@ -111,6 +111,7 @@
|
|
|
@select="selectTarget($event,cell)"
|
|
|
@click="clickCell($event, cell)"
|
|
|
@change.native="changeVal($event, cell)"
|
|
|
+ @keydown.native="keyEnterHandle($event,cell)"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<edbDetailPopover :info="scope.item">
|
|
@@ -223,7 +224,9 @@ export default {
|
|
|
|
|
|
cellrelationEdbInfo: {},
|
|
|
|
|
|
- copyCellItem: {},//复制的单元格信息
|
|
|
+ copyCellItem: {},//复制时的单元格信息 用于粘贴赋值
|
|
|
+
|
|
|
+ calculateClickCell: null,//双击公式单元格时的单元格信息 用于之后选其他单元格拼接公式
|
|
|
|
|
|
isInsertDateDialog: false,//导入日期弹窗
|
|
|
insertDateInfo: {
|
|
@@ -270,6 +273,13 @@ export default {
|
|
|
|
|
|
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([4,5].includes(cell.DataType)) {
|
|
|
const { key } = e.target.dataset;
|
|
@@ -280,6 +290,7 @@ export default {
|
|
|
relation_edb.key && setRelationStyle(relation_edb)
|
|
|
}
|
|
|
|
|
|
+ //选择指标弹窗打开时选择日期更新弹窗数据
|
|
|
this.isSelectTargetValueDialog&&this.$refs.selectTargetValueRef.chooseEdb(this.$refs.selectTargetValueRef.edbInfo)
|
|
|
},
|
|
|
|
|
@@ -441,7 +452,7 @@ export default {
|
|
|
cell.DataType = 6;
|
|
|
let calculateVal = await this.getValueByFormula(value);
|
|
|
cell.ShowValue = calculateVal;
|
|
|
- this.$set(cell,'CanEdit',false)
|
|
|
+ // this.calculateClickCell = cell;
|
|
|
|
|
|
}else {//自定义值
|
|
|
cell.DataType = 3;
|
|
@@ -831,11 +842,23 @@ export default {
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
|
|
|
+ /* 公式单元格enter时切换编辑状态 */
|
|
|
+ keyEnterHandle(e,cell) {
|
|
|
+ e.keyCode===13 && cell.DataType===6 && this.$set(cell,'CanEdit',false)
|
|
|
+ this.calculateClickCell = null
|
|
|
+ resetDialogCellStyle()
|
|
|
+ },
|
|
|
+
|
|
|
/* 支持公式单元格双击切换状态 */
|
|
|
- dblClickCell(e,cell) {
|
|
|
- if(this.disabled || cell.DataType!==6) return
|
|
|
+ dblClickCellHandle(e,cell) {
|
|
|
+ if(this.disabled || cell.DataType!==6 || this.calculateClickCell) return
|
|
|
|
|
|
this.$set(cell,'CanEdit',true)
|
|
|
+
|
|
|
+ this.calculateClickCell = cell;
|
|
|
+
|
|
|
+ setRelationStyle({ key:cell.Uid },'td-choose-insert-target')
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
if(e.target.childNodes[0].childNodes[0].childNodes[1].nodeName==='INPUT') e.target.childNodes[0].childNodes[0].childNodes[1].focus();
|
|
|
})
|