更新
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user