【修改】 试题录入,选择题

This commit is contained in:
DESKTOP-932OMT8\REN
2025-05-13 10:34:27 +08:00
committed by 陆光LG
parent 12cbdaa78a
commit a22a77ecc1
3 changed files with 161 additions and 75 deletions

View File

@@ -118,9 +118,11 @@
<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>
</el-table-column>
<el-table-column label="专业" align="center" prop="specialtyName" width="120" />
@@ -173,35 +175,17 @@
<el-button
type="primary"
link
@click="openForm('update', scope.row.id)"
@click="openForm('update', scope.row.quId)"
>
<Icon icon="ep:edit" />修改
</el-button>
<el-dropdown
@command="(command) => handleCommand(command, scope.row)"
<el-button
type="primary"
link
@click="openForm('update', scope.row.quId)"
>
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
command="handleDelete"
v-if="checkPermi(['system:user:delete'])"
>
<Icon icon="ep:delete" />删除
</el-dropdown-item>
<el-dropdown-item
command="handleResetPwd"
>
<Icon icon="ep:key" />重置密码
</el-dropdown-item>
<el-dropdown-item
command="handleRole"
>
<Icon icon="ep:circle-check" />分配角色
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<Icon icon="ep:delete" />删除
</el-button>
</div>
</template>
</el-table-column>
@@ -361,10 +345,14 @@ const findNamePathFromTreeList = (treeList: Tree[], targetId: number): string[]
const formRef = ref()
const cformRef = ref()
const openForm = (type: string, id?: number) => {
console.log(queryParams)
if (queryParams.subjectName == "") {
return message.confirm('请选择题型!');
}
if (chooseQuestionType.value.includes("选择题")){
cformRef.value.open(type, id)
} else {
formRef.value.open(type, id)
formRef.value.open(queryParams, type, id)
}
}
@@ -372,13 +360,11 @@ const openForm = (type: string, id?: number) => {
const importFormRef = ref()
/** 修改用户状态 */
const handleStatusChange = async (row: UserApi.UserVO) => {
const handleStatusChange = async (row: any) => {
try {
// 修改状态的二次确认
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
await message.confirm('确认要"' + text + '""' + row.username + '"用户吗?')
await message.confirm('确认要修改' + row.quId + '"试题状态吗?')
// 发起修改状态
await UserApi.updateUserStatus(row.id, row.status)
// 刷新列表
await getList()
} catch {