【修改】试卷任务增加修改操作,试卷换题增加关键字搜索条件,mysql出题增加数据库名字段
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, nextTick } from 'vue';
|
||||
import { onMounted } from 'vue';
|
||||
import { useFormData } from '@/utils/use-form-data';
|
||||
@@ -130,8 +130,8 @@ const specialtyOptions = ref([]);
|
||||
taskNum:'',
|
||||
taskSpecialty: '',
|
||||
taskType: '2',
|
||||
isTemplate: '',
|
||||
status: '',
|
||||
isTemplate: 1,
|
||||
status: 0,
|
||||
updateTime: '',
|
||||
updateBy: '',
|
||||
deptId: '',
|
||||
@@ -187,7 +187,7 @@ const fetchSpecialtyOptions = async () => {
|
||||
saveOrUpdate(form)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
message.success('修改成功');
|
||||
handleCancel();
|
||||
emit('done');
|
||||
})
|
||||
@@ -199,15 +199,15 @@ const fetchSpecialtyOptions = async () => {
|
||||
};
|
||||
|
||||
/** 弹窗打开事件 */
|
||||
const open = () => {
|
||||
// if (props.data) {
|
||||
// assignFields(props.data);
|
||||
// isUpdate.value = true;
|
||||
// } else {
|
||||
//
|
||||
// isUpdate.value = false;
|
||||
// }
|
||||
resetFields();
|
||||
const open = async (type: 'create' | 'update', data?: any) => {
|
||||
console.log(data+"datadatadata")
|
||||
if (data) {
|
||||
assignFields(data);
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
resetFields();
|
||||
isUpdate.value = false;
|
||||
}
|
||||
// 设置批次为 当前时间 + 5位随机数
|
||||
const now = new Date();
|
||||
const pad = (n) => n.toString().padStart(2, '0');
|
||||
|
@@ -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"
|
||||
@@ -221,13 +228,11 @@ 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)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/** 状态切换处理 */
|
||||
@@ -238,12 +243,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;
|
||||
|
Reference in New Issue
Block a user