【新增】试卷任务前端分类,监控管理前端
This commit is contained in:
@@ -74,7 +74,8 @@
|
||||
|
||||
<!-- 多选列 -->
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="试卷编号" align="center" prop="paperId" />
|
||||
<el-table-column label="试卷id" align="center" prop="paperId" />
|
||||
<el-table-column label="试卷编号" align="center" prop="num" />
|
||||
<el-table-column label="使用次数" align="center" prop="counts" />
|
||||
<el-table-column label="抽卷方式" align="center" prop="rollUp">
|
||||
<template #default="scope">
|
||||
@@ -90,11 +91,16 @@
|
||||
<span v-else-if="scope.row.isAb === '1'">B卷</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYS_YES_NO" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="启用状态" align="center" prop="status" width="120">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="'0'"
|
||||
:inactive-value="'1'"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -194,6 +200,7 @@ interface PaperItem {
|
||||
rollUp: string;
|
||||
isAb: string;
|
||||
status: string;
|
||||
num:string;
|
||||
// 你可以根据需要扩展更多字段
|
||||
}
|
||||
|
||||
@@ -321,6 +328,26 @@ const batchDelete = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleStatusChange = async (row: any) => {
|
||||
console.log(row.paperId, row.status+"row.taskId, row.status");
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
// 调用API更新状态
|
||||
await PaperApi.updatePaperStatus(row.paperId, row.status);
|
||||
message.success(row.status === '0' ? '已启用' : '已停用');
|
||||
// 刷新列表
|
||||
await getList();
|
||||
} catch (error) {
|
||||
// 如果请求失败,恢复原来的状态
|
||||
row.status = row.status === '0' ? '1' : '0';
|
||||
message.error('状态更新失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化操作
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
Reference in New Issue
Block a user