This commit is contained in:
yziiy
2025-09-27 16:18:50 +08:00
parent abc2a7b2fb
commit 98616cbe0f
4 changed files with 17 additions and 16 deletions

View File

@@ -8,23 +8,24 @@ function getRef() {
return selectUserList.value;
}
const searchLabel = ref([
{ label: "用户ID", prop: "user_id", type: "input" }
{ label: "用户ID", prop: "user_code", type: "input" }
]);
const searchForm = ref({})
const multipleTable = ref(null)
const onSearch = (formData) => {
userList.value = []
selectUserList.value = []
getAllUserList(formData)
}
const props = defineProps(["userList"]);
const getAllUserList = async () => {
const { code, data } = await getUserList()
const getAllUserList = async (form) => {
const { code, data } = await getUserList({ ...form })
userList.value = code ? data : []
setTimeout(() => {
if (userList.value.length) {
userList.value.forEach(ele => {
const listData = props.userList.map(e => { return Number(e) })
if (listData.includes(ele.id)) {
selectUserList.value.push()
multipleTable.value.toggleRowSelection(ele, true)
}
})
@@ -35,7 +36,7 @@ function handleSelectionChange(val) {
selectUserList.value = val
}
onMounted(() => {
getAllUserList()
getAllUserList(searchForm.value)
})
defineExpose({ getRef });
</script>