|
|
|
@ -2,12 +2,11 @@ |
|
|
|
|
<el-dialog :modelValue="modelValue" @update:modelValue="(newValue: boolean) => $emit('update:modelValue', newValue)" |
|
|
|
|
title="用户信息" width="800" draggable overflow> |
|
|
|
|
<div class="table-box"> |
|
|
|
|
<el-table ref="multipleTableRef" border :data="tableData" @row-click="(row: any) => selectedRow = row" |
|
|
|
|
append-to-body |
|
|
|
|
class="table" v-loading="loading"> |
|
|
|
|
<el-table ref="multipleTableRef" border :data="tableData" @row-click="(row: any) => selectedRowId = row.id" |
|
|
|
|
append-to-body class="table" v-loading="loading"> |
|
|
|
|
<el-table-column label="选择" width="55"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-radio v-model="selectedRow" :value="scope.row" /> |
|
|
|
|
<el-radio v-model="selectedRowId" :value="scope.row.id" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="序号"> |
|
|
|
@ -29,7 +28,7 @@ |
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
<el-button @click="$emit('update:modelValue', false)">关闭</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="() => { $emit('update:modelValue', false); $emit('selected', selectedRow); }">确认</el-button> |
|
|
|
|
@click="() => { $emit('update:modelValue', false); $emit('selected', tableData.find(o => o.id === selectedRowId) || {}); }">确认</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
@ -41,7 +40,7 @@ import { getMembersList } from '@/api/person'; |
|
|
|
|
import { useRoute } from 'vue-router'; |
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
|
|
|
|
|
const props = defineProps(['modelValue', 'type']); |
|
|
|
|
const props = defineProps(['modelValue']); |
|
|
|
|
const $emit = defineEmits(['update:modelValue', 'selected']); |
|
|
|
|
const route = useRoute(); |
|
|
|
|
|
|
|
|
@ -49,7 +48,7 @@ watch(() => props.modelValue, () => getList()); |
|
|
|
|
|
|
|
|
|
// 数据 |
|
|
|
|
const tableData = reactive<any[]>([]); |
|
|
|
|
const selectedRow = ref(); |
|
|
|
|
const selectedRowId = ref(); |
|
|
|
|
|
|
|
|
|
// 分页 |
|
|
|
|
const total = ref(0); |
|
|
|
|