|
@@ -133,14 +133,8 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="140">
|
|
|
<template #default="{ row }">
|
|
|
- <el-button size="small" type="primary" link @click="onEdit(row)"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- @click="onResetPassword(row)"
|
|
|
+ <el-button type="primary" link @click="onEdit(row)">编辑</el-button>
|
|
|
+ <el-button type="danger" link @click="onResetPassword(row)"
|
|
|
>重置密码</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -189,7 +183,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { reactive, ref, onMounted, computed } from 'vue';
|
|
|
+ import { reactive, ref, computed } from 'vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
import { CaretBottom } from '@element-plus/icons-vue';
|
|
|
import { userListPage, resetUserPassword, enableUser } from '@/api/user';
|
|
@@ -223,7 +217,7 @@
|
|
|
toPage,
|
|
|
pageSizeChange,
|
|
|
handleSelectionChange,
|
|
|
- } = useTable<UserItem>(userListPage, searchModel);
|
|
|
+ } = useTable<UserItem>(userListPage, searchModel, true);
|
|
|
|
|
|
const modifyUserRef = ref<InstanceType<typeof ModifyUser> | null>(null);
|
|
|
const batchCreateUserDialogRef = ref<InstanceType<
|
|
@@ -308,8 +302,8 @@
|
|
|
|
|
|
// 批量启用、禁用
|
|
|
const onBatchEnable = async (enabled: boolean) => {
|
|
|
- if (canBatchAction.value) {
|
|
|
- ElMessage.warning('请至少选择一个用户');
|
|
|
+ if (!canBatchAction.value) {
|
|
|
+ ElMessage.error('请至少选择一个用户');
|
|
|
return;
|
|
|
}
|
|
|
const action = enabled ? '启用' : '禁用';
|
|
@@ -334,8 +328,8 @@
|
|
|
|
|
|
// 批量重置密码
|
|
|
const onBatchResetPassword = async () => {
|
|
|
- if (canBatchAction.value) {
|
|
|
- ElMessage.warning('请至少选择一个用户');
|
|
|
+ if (!canBatchAction.value) {
|
|
|
+ ElMessage.error('请至少选择一个用户');
|
|
|
return;
|
|
|
}
|
|
|
const confirm = await modalConfirm(
|
|
@@ -355,8 +349,4 @@
|
|
|
console.error('操作失败:', error);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
- onMounted(() => {
|
|
|
- // getList();
|
|
|
- });
|
|
|
</script>
|