【修改】试卷任务增加修改操作,试卷换题增加关键字搜索条件,mysql出题增加数据库名字段

This commit is contained in:
YOHO\20373
2025-06-16 22:21:22 +08:00
parent 4a365355cb
commit 95ca5a32c5
19 changed files with 234 additions and 145 deletions

View File

@@ -91,8 +91,8 @@
<template #default="scope">
<el-switch
v-model="scope.row.status"
:active-value="'0'"
:inactive-value="'1'"
:active-value="0"
:inactive-value="1"
@change="handleStatusChange(scope.row)"
/>
</template>
@@ -106,6 +106,13 @@
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row)"
>
修改
</el-button>
<el-button
link
type="primary"
@@ -218,12 +225,12 @@ const handleStatusChange = async (row: any) => {
loading.value = true;
// 调用API更新状态
await SmsChannelApi.updateTaskStatus(row.taskId, row.status);
message.success(row.status === '0' ? '已启用' : '已停用');
message.success(row.status === 0 ? '已启用' : '已停用');
// 刷新列表
await getList();
} catch (error) {
// 如果请求失败,恢复原来的状态
row.status = row.status === '0' ? '1' : '0';
row.status = row.status === 0 ? 1 : 0;
message.error('状态更新失败');
} finally {
loading.value = false;
@@ -239,11 +246,10 @@ const handleSelectionChange = (rows) => {
/** 添加/修改操作 */
const formRef = ref();
const openForm = (type: string, id?: number) => {
const openForm = (type: string, row?: object) => {
showAdd.value = true
nextTick(() => {
taskAddRef.value?.open(type, id)
taskAddRef.value?.open(type, row)
});
}