|
|
@@ -1385,59 +1385,84 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 鼠标移入增加新增和删除按钮
|
|
|
+ * @desc : 增加当前行hover
|
|
|
* @author : 周兴
|
|
|
- * @date : 2022/4/19 10:56
|
|
|
+ * @date : 2023/5/17 16:39
|
|
|
*/
|
|
|
- handleCellMouseEnter(e) {
|
|
|
+ addHover(rowIndex){
|
|
|
if (this.readonly) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
if (this.operateFlag) {
|
|
|
// 如果行不变,不用执行
|
|
|
- if (e && (e.rowIndex != this.rowIndex)) {
|
|
|
+ if (rowIndex != this.rowIndex) {
|
|
|
if (this.tableData && this.tableData.length > 0) {
|
|
|
this.tableData.forEach(it => {
|
|
|
this.$set(it, '_hover', false)
|
|
|
})
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- if (e.rowIndex >= 0 && this.tableData[e.rowIndex]) {
|
|
|
- this.$set(this.tableData[e.rowIndex], '_hover', true)
|
|
|
- }
|
|
|
- }, 300)
|
|
|
- }
|
|
|
- }
|
|
|
- // 鼠标移入后,当前行变为编辑状态
|
|
|
- if (e && e.row) {
|
|
|
- this.colIndex = e.columnIndex
|
|
|
- // 鼠标移入自动进行行切换
|
|
|
- if (this.mouseEnterEditFlag) {
|
|
|
- // this.$refs[this.name].setActiveRow(e.row)
|
|
|
- // // console.log('ttt',e.row,e.rowIndex,this.currentRowIndex)
|
|
|
- // this.$refs[this.name].setCurrentRow(e.row)
|
|
|
- // if(this.rowIndex !== e.rowIndex){
|
|
|
- // this.currentChangeGetData({ oldRowIndex:this.rowIndex,rowIndex:e.rowIndex })
|
|
|
- // }
|
|
|
}
|
|
|
- this.rowIndex = e.rowIndex
|
|
|
+ setTimeout(() => {
|
|
|
+ if (rowIndex >= 0 && this.tableData[rowIndex]) {
|
|
|
+ this.$set(this.tableData[rowIndex], '_hover', true)
|
|
|
+ }
|
|
|
+ }, 30)
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 鼠标移入增加新增和删除按钮
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2022/4/19 10:56
|
|
|
+ */
|
|
|
+ handleCellMouseEnter(e) {
|
|
|
+ // if (this.readonly) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (this.operateFlag) {
|
|
|
+ // // 如果行不变,不用执行
|
|
|
+ // if (e && (e.rowIndex != this.rowIndex)) {
|
|
|
+ // if (this.tableData && this.tableData.length > 0) {
|
|
|
+ // this.tableData.forEach(it => {
|
|
|
+ // this.$set(it, '_hover', false)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // setTimeout(() => {
|
|
|
+ // if (e.rowIndex >= 0 && this.tableData[e.rowIndex]) {
|
|
|
+ // this.$set(this.tableData[e.rowIndex], '_hover', true)
|
|
|
+ // }
|
|
|
+ // }, 300)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // 鼠标移入后,当前行变为编辑状态
|
|
|
+ // if (e && e.row) {
|
|
|
+ // this.colIndex = e.columnIndex
|
|
|
+ // // 鼠标移入自动进行行切换
|
|
|
+ // if (this.mouseEnterEditFlag) {
|
|
|
+ // // this.$refs[this.name].setActiveRow(e.row)
|
|
|
+ // // // console.log('ttt',e.row,e.rowIndex,this.currentRowIndex)
|
|
|
+ // // this.$refs[this.name].setCurrentRow(e.row)
|
|
|
+ // // if(this.rowIndex !== e.rowIndex){
|
|
|
+ // // this.currentChangeGetData({ oldRowIndex:this.rowIndex,rowIndex:e.rowIndex })
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
+ // this.rowIndex = e.rowIndex
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 鼠标移出删除新增和删除按钮
|
|
|
* @author : 周兴
|
|
|
* @date : 2022/4/19 10:56
|
|
|
*/
|
|
|
handleCellMouseLeave(e) {
|
|
|
- if (this.operateFlag) {
|
|
|
- setTimeout(() => {
|
|
|
- if (e && e.rowIndex != this.rowIndex) {
|
|
|
- if (e.rowIndex >= 0 && this.tableData[e.rowIndex]) {
|
|
|
- this.$set(this.tableData[e.rowIndex], '_hover', false)
|
|
|
- }
|
|
|
- }
|
|
|
- }, 300)
|
|
|
- }
|
|
|
+ // if (this.operateFlag) {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // if (e && e.rowIndex != this.rowIndex) {
|
|
|
+ // if (e.rowIndex >= 0 && this.tableData[e.rowIndex]) {
|
|
|
+ // this.$set(this.tableData[e.rowIndex], '_hover', false)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }, 300)
|
|
|
+ // }
|
|
|
},
|
|
|
/**
|
|
|
* @desc : desc
|
|
|
@@ -2275,7 +2300,11 @@ export default {
|
|
|
* @date : 2022/4/21 13:43
|
|
|
*/
|
|
|
currentChangeGetData(e) {
|
|
|
- this.$emit('current-change', e, this.tableData)
|
|
|
+ e.oldRowIndex = this.currentRowIndex;
|
|
|
+ this.$emit('current-change', e, this.tableData);
|
|
|
+ this.currentRowIndex = e.rowIndex;
|
|
|
+ // 给当前行增加hover
|
|
|
+ this.addHover(this.currentRowIndex);
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 根据field获取
|
|
|
@@ -4107,6 +4136,17 @@ export default {
|
|
|
itemCode: 'uniqueCode',
|
|
|
itemName: 'moldlineCode'
|
|
|
},
|
|
|
+ //todo 暂时先注掉
|
|
|
+ // //产品型号
|
|
|
+ // {
|
|
|
+ // itemCode: 'uniqueCode',
|
|
|
+ // itemName: 'appModelProduct'
|
|
|
+ // },
|
|
|
+ // //模具型号
|
|
|
+ // {
|
|
|
+ // itemCode: 'uniqueCode',
|
|
|
+ // itemName: 'appModelMould'
|
|
|
+ // },
|
|
|
]
|
|
|
//替换的列
|
|
|
this.columnsUpdate.push(
|