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