空白待填行问题

GST002_H5
Ly 2 months ago
parent 5914e5e4d6
commit 3d504f0aec
  1. 14
      src/views/registrationGroup/components/stuDialog.vue
  2. 22
      src/views/registrationGroup/components/stuList.vue
  3. 13
      src/views/registrationGroup/components/teaDialog.vue
  4. 8
      src/views/registrationGroup/components/teaList.vue

@ -56,7 +56,10 @@
/>
</div>
<div class="dialog-footer">
<el-button @click="$emit('update:modelValue', false)">关闭</el-button>
<!-- <el-button @click="$emit('update:modelValue', false)">关闭</el-button> -->
<el-button
@click="closeDialog"
>关闭</el-button>
<el-button
type="primary"
@click="
@ -64,8 +67,9 @@
$emit('update:modelValue', false)
$emit(
'selected',
tableData.find((o) => o.id === selectedRowId) || {},
tableData.find((o) => o.id === selectedRowId),
)
selectedRowId = null
}
"
>
@ -95,6 +99,12 @@ watch(
const tableData = reactive<any[]>([])
const selectedRowId = ref()
//
const closeDialog = ()=>{
$emit('update:modelValue', false)
$emit('selected', {});
selectedRowId.value = null
}
//
const total = ref(0)

@ -126,6 +126,7 @@ import { getTeamList } from '@/api/oldRace'
import { useRoute } from 'vue-router'
const route = useRoute()
const userModel = userStore()
const visible = ref(false)
//
const isDisable = ref(false)
isDisable.value = route.query.info as any
@ -167,15 +168,7 @@ onMounted(() => {
})
}, 500)
})
// watch(()=>userModel.userInfo,()=>{
// if(tableData.length === 1) return
// tableData.push({
// userId: userModel.userInfo.id,
// realname: userModel.userInfo.realname,
// captain: '1',
// teamSeq: 1,
// })
// })
const add = () => {
const length = tableData.push({
realname: '', //
@ -193,18 +186,21 @@ const add = () => {
const target = ref<any>()
const openDialog = (row: any) => {
// console.log(row,'row');
visible.value = true
target.value = row
}
const visible = ref(false)
//
const handleSelected = (row: any = {}) => {
// tableData
if (Object.keys(row).length === 0) {
if (tableData.length > 0) {
tableData.pop(); //
}
}
if (tableData.some((o) => o.userId === row.id)) {
ElMessage({
message: '用户不能多选!',
message: '已有该用户,不能重复选择用户!',
type: 'error',
})
return

@ -53,7 +53,7 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="$emit('update:modelValue', false)">关闭</el-button>
<el-button @click="closeDialog">关闭</el-button>
<el-button
type="primary"
@click="
@ -61,8 +61,9 @@
$emit('update:modelValue', false)
$emit(
'selected',
tableData.find((o) => o.user_id === selectedRowId) || {},
)
tableData.find((o) => o.id === selectedRowId) || {},
);
selectedRowId = null; // selectedRowId
}
"
>
@ -91,6 +92,12 @@ watch(
//
const tableData = reactive<any[]>([])
const selectedRowId = ref()
//
const closeDialog = ()=>{
$emit('update:modelValue', false)
$emit('selected', {});
selectedRowId.value = null
}
//
const total = ref(0)

@ -187,9 +187,15 @@ const visible = ref(false)
//
const handleSelected = (row: any = {}) => {
// tableData
if (Object.keys(row).length === 0) {
if (tableData.length > 0) {
tableData.pop(); //
}
}
if (tableData.some((o) => o.teacherid === row.user_id)) {
ElMessage({
message: '用户不能多选!',
message: '已有该用户,不能重复选择用户!',
type: 'error',
})
return

Loading…
Cancel
Save