物业之前,新工作台
This commit is contained in:
@@ -106,7 +106,7 @@ const props = defineProps<{
|
||||
|
||||
// ✅ 手动设置默认值(替代 withDefaults)
|
||||
const isMultiple = computed(() => props.isMultiple ?? false);
|
||||
const returnvalue = computed(() => props.returnvalue ?? 'userId'); // 👈 默认 userId
|
||||
const returnvalue = computed(() => props.returnvalue ?? 'id'); // 👈 默认 userId
|
||||
|
||||
const { userid } = toRefs(props);
|
||||
|
||||
@@ -267,6 +267,7 @@ function confirm() {
|
||||
// ✅ 返回整个对象
|
||||
emit('change', multipleSelection.value[0]);
|
||||
} else {
|
||||
console.log(multipleSelection.value[0], returnvalue.value);
|
||||
// 返回指定字段
|
||||
emit('change', multipleSelection.value[0][returnvalue.value as keyof tableType]);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ const handleRowClick = (row: tableType) => {
|
||||
// 统一回显 userid 选中(安全版)
|
||||
const handleUserSelection = () => {
|
||||
if (!userid.value || !tableData.value.length) return;
|
||||
console.log('user', userid, tableData.value);
|
||||
|
||||
const target = tableData.value.find((item) => item.userId == userid.value);
|
||||
if (target) {
|
||||
|
||||
Reference in New Issue
Block a user