个人选着
Showing
1 changed file
with
13 additions
and
2 deletions
| ... | @@ -195,6 +195,7 @@ const open = (params) => { | ... | @@ -195,6 +195,7 @@ const open = (params) => { |
| 195 | show.value = true | 195 | show.value = true |
| 196 | isNational.value = params.isNational | 196 | isNational.value = params.isNational |
| 197 | choosedList = params.choosedList | 197 | choosedList = params.choosedList |
| 198 | tableData.value = [] | ||
| 198 | getList() | 199 | getList() |
| 199 | } | 200 | } |
| 200 | defineExpose({ | 201 | defineExpose({ |
| ... | @@ -226,6 +227,7 @@ const selectable = (row) => { | ... | @@ -226,6 +227,7 @@ const selectable = (row) => { |
| 226 | } | 227 | } |
| 227 | } | 228 | } |
| 228 | const getList = () => { | 229 | const getList = () => { |
| 230 | console.log(user.userId) | ||
| 229 | loading.value = true | 231 | loading.value = true |
| 230 | getPerPersonList(query.value, user.userId).then(res => { | 232 | getPerPersonList(query.value, user.userId).then(res => { |
| 231 | total.value = res.total | 233 | total.value = res.total |
| ... | @@ -249,7 +251,7 @@ function handleSelectionChange(val) { | ... | @@ -249,7 +251,7 @@ function handleSelectionChange(val) { |
| 249 | if (val.length == 1) { | 251 | if (val.length == 1) { |
| 250 | handelTeammate(val[0].id) | 252 | handelTeammate(val[0].id) |
| 251 | } | 253 | } |
| 252 | 254 | if (val.length == 0) getList() | |
| 253 | // 判断是否队友 | 255 | // 判断是否队友 |
| 254 | if (val.length == 2) { | 256 | if (val.length == 2) { |
| 255 | if (val[0].sex != val[1].sex) { | 257 | if (val[0].sex != val[1].sex) { |
| ... | @@ -277,7 +279,16 @@ async function handelTeammate(id) { | ... | @@ -277,7 +279,16 @@ async function handelTeammate(id) { |
| 277 | id | 279 | id |
| 278 | }) | 280 | }) |
| 279 | dancing.value = res.data | 281 | dancing.value = res.data |
| 280 | tableData.value.filter(p => p.id == id || p.id == dancing.value) | 282 | const arr = [] |
| 283 | for (const v of tableData.value) { | ||
| 284 | if (v.id == id || v.id == dancing.value) { | ||
| 285 | arr.push(v) | ||
| 286 | } | ||
| 287 | } | ||
| 288 | tableData.value = arr | ||
| 289 | nextTick(() => { | ||
| 290 | reSetChoosed() | ||
| 291 | }) | ||
| 281 | console.log(res) | 292 | console.log(res) |
| 282 | console.log(tableData.value) | 293 | console.log(tableData.value) |
| 283 | } | 294 | } | ... | ... |
-
Please register or sign in to post a comment