Files
bd-training-exam/src/components/operate/tabelSelect.vue

92 lines
2.9 KiB
Vue
Raw Normal View History

2026-03-27 17:39:28 +08:00
<template>
<el-table-column min-width="100" width="100" :column-key="报名状态">
<template #header>
<div>
<el-text class="mx-1"> 报名状态 </el-text>
</div>
</template>
<template #default="scope">
<div class="flex justify-center items-center text-base">
<el-button
v-if="
(scope.row.status == '0' && scope.row.applicationStatus == '2') ||
(scope.row.status == '0' && scope.row.applicationStatus == '3') ||
(scope.row.status == '0' && scope.row.applicationStatus == '4')
"
style="font-weight: bold"
type="primary"
size="default"
plain="true"
:disabled="
new Date() < new Date(scope.row.origin_applicationEnd) &&
scope.row.applicationCheck == 0 &&
!scope.row.applicationCheckSwitch
? false
: true
"
@click="applicationDialog(scope.$index, scope.row)"
>
报名
</el-button>
</div>
<div class="flex justify-center items-center text-base">
<el-button
v-if="
(scope.row.status == '0' && scope.row.applicationStatus == '0') ||
(scope.row.status == '0' && scope.row.applicationStatus == '1')
"
style="font-weight: bold"
type="danger"
size="default"
plain="true"
@click="cancelApplicationDialog(scope.$index, scope.row)"
>
取消报名
</el-button>
</div>
<div
v-if="scope.row.status != '0' && scope.row.applicationStatus == '1'"
style="color: rgb(16, 184, 130); background-color: rgba(16, 184, 130, 0.1)"
class="flex justify-center items-center text-base"
>
报名成功
</div>
<div
v-if="scope.row.status != '0' && scope.row.applicationStatus == '2'"
style="color: rgb(240, 70, 70); background-color: rgba(240, 70, 70, 0.1)"
class="flex justify-center items-center text-base"
>
报名失败
</div>
<div
v-if="scope.row.status != '0' && scope.row.applicationStatus == '3'"
style="color: rgb(255, 200, 0); background-color: rgba(255, 200, 0, 0.1)"
class="flex justify-center items-center text-base"
>
报名取消
</div>
<div
v-if="scope.row.status != '0' && scope.row.applicationStatus == '4'"
style="color: rgb(56, 188, 248); background-color: rgba(56, 188, 248, 0.1)"
class="flex justify-center items-center text-base"
>
未参与
</div>
</template>
</el-table-column>
</template>
<script setup>
const emit = defineEmits(["applicationDialog", "cancelApplicationDialog"]);
const applicationDialog = (index, row) => {
emit("applicationDialog", { data: row });
};
const cancelApplicationDialog = (index, row) => {
emit("cancelApplicationDialog", { data: row });
};
</script>
<style scoped></style>