|
|
@@ -135,8 +135,7 @@ const onPasswordReset = (data?: any) => {
|
|
|
}
|
|
|
|
|
|
// 修改状态
|
|
|
-const onChangeStatus = async (row: any) => {
|
|
|
- const status = row.status === 1 ? 0 : 1
|
|
|
+const onChangeStatus = async (status: number, row: any) => {
|
|
|
await updateUserStatus(row.accountId, status)
|
|
|
ElMessage.success({
|
|
|
message: '修改成功',
|
|
|
@@ -296,7 +295,16 @@ const onCommand = (command: string, row: any) => {
|
|
|
<el-table-column align="center" label="状态" width="80">
|
|
|
<template #default="scope">
|
|
|
<div v-if="scope.row.isFixed !== 1">
|
|
|
- <el-switch v-model="scope.row.status" :loading="scope.row.loading" inline-prompt active-text="启用" inactive-text="禁用" @before-change="() => onChangeStatus(scope.row)" />
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.status"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="2"
|
|
|
+ :loading="scope.row.loading"
|
|
|
+ inline-prompt
|
|
|
+ active-text="启用"
|
|
|
+ inactive-text="禁用"
|
|
|
+ @change="(status) => onChangeStatus(status, scope.row)"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|