|
@@ -134,11 +134,15 @@
|
|
|
border
|
|
border
|
|
|
ref="assignTable"
|
|
ref="assignTable"
|
|
|
:data="assignList"
|
|
:data="assignList"
|
|
|
- @selection-change="handleAssignSelectionChange"
|
|
|
|
|
|
|
+
|
|
|
:row-key="'blindStructuresId'"
|
|
:row-key="'blindStructuresId'"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
>
|
|
>
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="55">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <el-radio v-model="selectedRadio" :label="row.blindStructuresId"> </el-radio>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<!-- <el-table-column label="blindStructuresId" align="center" prop="blindStructuresId" width="100" show-overflow-tooltip />-->
|
|
<!-- <el-table-column label="blindStructuresId" align="center" prop="blindStructuresId" width="100" show-overflow-tooltip />-->
|
|
|
<el-table-column prop="blindStructuresName" label="盲注结构名称" align="center" width="150" show-overflow-tooltip />
|
|
<el-table-column prop="blindStructuresName" label="盲注结构名称" align="center" width="150" show-overflow-tooltip />
|
|
|
<el-table-column prop="blindDescription" label="盲注结构描述" align="center" width="200" show-overflow-tooltip />
|
|
<el-table-column prop="blindDescription" label="盲注结构描述" align="center" width="200" show-overflow-tooltip />
|
|
@@ -215,6 +219,9 @@ const assignForm = reactive({
|
|
|
selectedIds: [] as number[]
|
|
selectedIds: [] as number[]
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+// 单选控制变量(用于绑定 el-radio)
|
|
|
|
|
+const selectedRadio = ref<number | null>(null);
|
|
|
|
|
+
|
|
|
const assignList = ref<TournamentsBindStructuresVO[]>([]);
|
|
const assignList = ref<TournamentsBindStructuresVO[]>([]);
|
|
|
const assignSelectedList = ref<TournamentsBindStructuresVO[]>([]);
|
|
const assignSelectedList = ref<TournamentsBindStructuresVO[]>([]);
|
|
|
const assignTotal = ref(0);
|
|
const assignTotal = ref(0);
|
|
@@ -382,7 +389,7 @@ async function openAssignDialog(row: TournamentsVO) {
|
|
|
assignForm.tournamentId = Number(row.id);
|
|
assignForm.tournamentId = Number(row.id);
|
|
|
assignQuery.tournamentId = Number(row.id); // 这里明确转成 number
|
|
assignQuery.tournamentId = Number(row.id); // 这里明确转成 number
|
|
|
// 加载盲注列表
|
|
// 加载盲注列表
|
|
|
-/* await getAssignList();*/
|
|
|
|
|
|
|
+
|
|
|
assignDialog.visible = true;
|
|
assignDialog.visible = true;
|
|
|
// 请求分配盲注结构列表
|
|
// 请求分配盲注结构列表
|
|
|
getAssignList().then(() => {
|
|
getAssignList().then(() => {
|
|
@@ -402,7 +409,7 @@ async function submitAssign() {
|
|
|
proxy?.$modal.msgError('请选择至少一个盲注结构');
|
|
proxy?.$modal.msgError('请选择至少一个盲注结构');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ debugger;
|
|
|
buttonLoading.value = true;
|
|
buttonLoading.value = true;
|
|
|
try {
|
|
try {
|
|
|
await assignTournamentBlindStructures({
|
|
await assignTournamentBlindStructures({
|
|
@@ -423,14 +430,11 @@ const assignTable = ref(); // 对应 el-table 的 ref
|
|
|
|
|
|
|
|
// 初始化选中行
|
|
// 初始化选中行
|
|
|
function initSelectedRows() {
|
|
function initSelectedRows() {
|
|
|
- const selected = assignList.value.filter((item) => item.allocationStatus === 1);
|
|
|
|
|
- selected.forEach((item) => {
|
|
|
|
|
- const row = assignList.value.find((r) => r.blindStructuresId === item.blindStructuresId);
|
|
|
|
|
- if (row) {
|
|
|
|
|
- assignTable.value?.toggleRowSelection(row, true);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- assignForm.selectedIds = selected.map((item) => item.blindStructuresId);
|
|
|
|
|
|
|
+ const selected = assignList.value.find((item) => item.allocationStatus === 1);
|
|
|
|
|
+ if (selected) {
|
|
|
|
|
+ selectedRadio.value = selected.blindStructuresId;
|
|
|
|
|
+ assignForm.selectedIds = [selected.blindStructuresId];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
watch(
|
|
watch(
|
|
@@ -444,4 +448,15 @@ watch(
|
|
|
},
|
|
},
|
|
|
{ deep: true, immediate: true }
|
|
{ deep: true, immediate: true }
|
|
|
);
|
|
);
|
|
|
|
|
+
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => selectedRadio.value,
|
|
|
|
|
+ (newVal) => {
|
|
|
|
|
+ if (newVal !== null) {
|
|
|
|
|
+ assignForm.selectedIds = [newVal];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ assignForm.selectedIds = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+);
|
|
|
</script>
|
|
</script>
|