讲师管理bug

This commit is contained in:
zhangsir
2024-11-28 14:09:04 +08:00
parent 4392e764c1
commit ffeab66978
3 changed files with 28 additions and 6 deletions

View File

@@ -70,6 +70,10 @@
type: Array,
default: () => []
},
selectedRows:{
type: Array,
default: () => []
},
});
const emit = defineEmits(["update:params", "update:selectedRowKeys", "update:selectedRows"]);
const rowSelectKeys = ref([]);
@@ -81,6 +85,7 @@
watch(()=>data.value,(val)=>{
if(val&&props.selectedRowKeys){
rowSelectKeys.value = props.selectedRowKeys
selectsData.value = props.selectedRows
}
})
const rowSelection = computed(() => (props.type ? {
@@ -116,6 +121,22 @@
function onSelectChange(e, l) {
rowSelectKeys.value = e;
const array = []
l.includes(undefined)&&(
selectsData.value = [...selectsData.value,...l],
selectsData.value = selectsData.value.filter(t => t),
selectsData.value = Array.from(new Set(selectsData.value.map(item => item.id)))
.map(id => selectsData.value.find(item => item.id === id)),
selectsData.value.map(item=>{
e.some(i=>{
if(item.id === i){
array.push(item)
return true
}
})
}),
l = array
)
selectsData.value = l;
emit("update:selectedRowKeys", e);
emit("update:selectedRows", l);

View File

@@ -154,11 +154,11 @@ watch(stuSelectRows,(val)=>{
}
teaunm.value = val.map((res,index)=>{
return {
userName:res.realName,
userNo:res.userNo,
userName:res?.realName,
userNo:res?.userNo,
type: props.type,
userId: res.id,
label: res.realName + res.userNo,
userId: res?.id,
label: res?.realName + res?.userNo,
...res
}
})

View File

@@ -536,7 +536,7 @@ const getTableDate = (obj) => {
})
}
const downOpen = () => {
alert('没有接口')
window.open(`/manageApi/admin/export/exportTeacherAffiliation?name=${state.searchParam.name || ''}`)
}
const addContentData = () => {
state.showContent = true
@@ -555,7 +555,8 @@ const getTableDate = (obj) => {
label: item.userName + item.userNo,
value: item.userId,
realName: item.userName,
...item
...item,
id: item.userId
};
});
state.formParam.actValue = state.formParam.actArray.map(item => item.label).join(',');