空白待填行问题

GST002_admin
Ly 2 months ago
parent ab0e8b589f
commit 6530b54e03
  1. 12
      src/views/registrationGroup/components/stuDialog.vue
  2. 8
      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,7 @@
/>
</div>
<div class="dialog-footer">
<el-button @click="$emit('update:modelValue', false)">关闭</el-button>
<el-button @click="closeDialog">关闭</el-button>
<el-button
type="primary"
@click="
@ -65,7 +65,8 @@
$emit(
'selected',
tableData.find((o) => o.id === selectedRowId) || {},
)
);
selectedRowId = null; // selectedRowId
}
"
>
@ -94,6 +95,7 @@ watch(
//
const tableData = reactive<any[]>([])
const selectedRowId = ref()
// const selectedRowId = ref<number | null>(null); // 使 null
//
const total = ref(0)
@ -112,6 +114,12 @@ const search = () => {
params.work_no="*"+name.value+"*"
getList()
}
//
const closeDialog = ()=>{
$emit('update:modelValue', false)
$emit('selected', {});
selectedRowId.value = null
}
const loading = ref(false)
const getList = async () => {
if (!props.modelValue) return

@ -202,9 +202,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.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