fix(render): 修复表格内点击无响应(Vue2 on:{click} → Vue3 onClick)
班级管理「班主任/副班主任/校区」三列、任教管理操作列用的是
h(..., { on: { click: fn } })。Vue3 不再识别 on 对象,事件根本没绑上,
所以点单元格毫无反应。改为顶层 onClick(含带 stopPropagation 的清空按钮),
treeMixin 的树节点点击同步修正。
This commit is contained in:
@@ -19,11 +19,9 @@ export default {
|
||||
cursor: "pointer",
|
||||
backgroundColor: node.node.selected ? "#e5e5e5" : ""
|
||||
},
|
||||
on: {
|
||||
click: (e) => {
|
||||
e.stopPropagation()
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
this.$emit("on-tree-change", node.node);
|
||||
}
|
||||
}
|
||||
}, data.title)
|
||||
]);
|
||||
|
||||
@@ -365,9 +365,7 @@ style: { width: '150px' }})
|
||||
cursor: 'pointer',
|
||||
margin: '0 auto'
|
||||
},
|
||||
on: {
|
||||
click: () => this.openTeacherSelect(params.index, 'headTeacher')
|
||||
}
|
||||
onClick: () => this.openTeacherSelect(params.index, 'headTeacher')
|
||||
}, [
|
||||
h('span', {
|
||||
style: {
|
||||
@@ -391,8 +389,7 @@ style: { width: '150px' }})
|
||||
flexShrink: 0,
|
||||
fontSize: '14px'
|
||||
},
|
||||
on: {
|
||||
click: (e) => {
|
||||
onClick: (e) => {
|
||||
e.stopPropagation()
|
||||
var item={
|
||||
id:params.row.id,
|
||||
@@ -407,7 +404,6 @@ style: { width: '150px' }})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, '×') : null
|
||||
])
|
||||
}
|
||||
@@ -428,9 +424,7 @@ style: { width: '150px' }})
|
||||
cursor: 'pointer',
|
||||
margin: '0 auto'
|
||||
},
|
||||
on: {
|
||||
click: () => this.openTeacherSelect(params.index, 'secondTeacherName')
|
||||
}
|
||||
onClick: () => this.openTeacherSelect(params.index, 'secondTeacherName')
|
||||
}, [
|
||||
h('span', {
|
||||
style: {
|
||||
@@ -454,8 +448,7 @@ style: { width: '150px' }})
|
||||
flexShrink: 0,
|
||||
fontSize: '14px'
|
||||
},
|
||||
on: {
|
||||
click: (e) => {
|
||||
onClick: (e) => {
|
||||
e.stopPropagation()
|
||||
var item={
|
||||
id:params.row.id,
|
||||
@@ -470,7 +463,6 @@ style: { width: '150px' }})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, '×') : null
|
||||
])
|
||||
}
|
||||
@@ -491,9 +483,7 @@ style: { width: '150px' }})
|
||||
cursor: 'pointer',
|
||||
margin: '0 auto'
|
||||
},
|
||||
on: {
|
||||
click: () => this.openCampusSelect(params.index)
|
||||
}
|
||||
onClick: () => this.openCampusSelect(params.index)
|
||||
}, [
|
||||
h('span', {
|
||||
style: {
|
||||
@@ -517,8 +507,7 @@ style: { width: '150px' }})
|
||||
flexShrink: 0,
|
||||
fontSize: '14px'
|
||||
},
|
||||
on: {
|
||||
click: (e) => {
|
||||
onClick: (e) => {
|
||||
e.stopPropagation()
|
||||
var item={
|
||||
id:params.row.id,
|
||||
@@ -533,7 +522,6 @@ style: { width: '150px' }})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, '×') : null
|
||||
])
|
||||
}
|
||||
@@ -726,17 +714,7 @@ onClick: () => this.deleteRow(params.index, params.row)})
|
||||
|
||||
<style scoped>
|
||||
/* 根容器占满父高度 */
|
||||
.container-full-height {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 6px;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.container-full-height {width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column}
|
||||
.layout-flex-row {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
@@ -324,11 +324,9 @@ export default {
|
||||
cursor: 'pointer',
|
||||
margin: '0 auto'
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
onClick: () => {
|
||||
this.openTeacherModal(params.index, params.row, subId)
|
||||
}
|
||||
}
|
||||
}, [
|
||||
h('span', {
|
||||
style: {
|
||||
@@ -353,8 +351,7 @@ export default {
|
||||
fontSize: '14px',
|
||||
cursor: 'pointer'
|
||||
},
|
||||
on: {
|
||||
click: (e) => {
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
const row = params.row;
|
||||
let delId = null;
|
||||
@@ -370,7 +367,6 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, '×') : null
|
||||
]);
|
||||
}
|
||||
@@ -514,11 +510,7 @@ attrs: { title: '重置本行所有任教' }})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.teach-manage-page {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.teach-manage-page {width: 100%; box-sizing: border-box}
|
||||
.top-filter-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
Reference in New Issue
Block a user