|
@@ -494,7 +494,7 @@ export default {
|
|
|
name:curTdEle.getAttribute("title")
|
|
|
}]
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
curTdEle.classList.add('select-td')
|
|
|
|
|
|
this.$nextTick(()=>{
|
|
@@ -917,6 +917,8 @@ export default {
|
|
|
|
|
|
//excel父节点点击检测
|
|
|
parentClick(e){
|
|
|
+
|
|
|
+
|
|
|
const{metaKey,ctrlKey}=e
|
|
|
let target = e.target;
|
|
|
console.log(target,'target');
|
|
@@ -925,21 +927,36 @@ export default {
|
|
|
for (let i = 0; i < bgs.length; i++) {
|
|
|
bgs[i].classList.remove("oldlace-bg");
|
|
|
}
|
|
|
- //console.log(target.getAttribute('trindex'))
|
|
|
- if(target.getAttribute('trindex') !== null && target.getAttribute('tdindex')){
|
|
|
+ let tdEle = this.getParentTD(target);
|
|
|
+ console.log(tdEle,'tdEle');
|
|
|
+ let target1
|
|
|
+ if(tdEle){
|
|
|
+ let mydiv=tdEle.getElementsByTagName('div')
|
|
|
+ target1=mydiv[0]
|
|
|
+ }else{
|
|
|
+ tdEle=target
|
|
|
+ let mydiv=tdEle.getElementsByTagName('div')
|
|
|
+ target=mydiv[0]
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(target.getAttribute('trindex') !== null && target.getAttribute('tdindex')||target1.getAttribute('trindex') !== null && target1.getAttribute('tdindex')){
|
|
|
let tdEle = this.getParentTD(target);
|
|
|
if(tdEle){
|
|
|
target.classList.add("oldlace-bg");
|
|
|
if(metaKey||ctrlKey){
|
|
|
target.classList.add("select-td");
|
|
|
+
|
|
|
this.checkList.push({
|
|
|
- tr:target.getAttribute('trindex'),
|
|
|
- td:target.getAttribute('tdindex'),
|
|
|
+ tr:target.getAttribute('trindex')||target1.getAttribute('trindex'),
|
|
|
+ td:target.getAttribute('tdindex')||target1.getAttribute('tdindex'),
|
|
|
})
|
|
|
}else{
|
|
|
target.classList.remove("select-td");
|
|
|
this.checkList.forEach((ele,index)=>{
|
|
|
- if(ele.tr===target.getAttribute('trindex')){
|
|
|
+ if(ele.tr===target.getAttribute('trindex')||ele.tr===target1.getAttribute('trindex')){
|
|
|
this.checkList.splice(index,1)
|
|
|
}
|
|
|
})
|