|
@@ -47,8 +47,8 @@
|
|
<Delete />
|
|
<Delete />
|
|
</el-icon>
|
|
</el-icon>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button plain :disabled="checkedColumns.length === 0"> 分配角色 </el-button>
|
|
|
|
- <el-button plain :disabled="checkedColumns.length === 0"> 密码重置 </el-button>
|
|
|
|
|
|
+ <el-button plain :disabled="curSelectionRows.length === 0" @click="assignRoleVisibile = true"> 分配角色 </el-button>
|
|
|
|
+ <el-button plain :disabled="curSelectionRows.length === 0" @click="resetPwdVisibile = true"> 密码重置 </el-button>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template #filterAvatarSlot="scope">
|
|
<template #filterAvatarSlot="scope">
|
|
@@ -88,6 +88,22 @@
|
|
:form-options="formOptions"
|
|
:form-options="formOptions"
|
|
@submit="submitHandler"
|
|
@submit="submitHandler"
|
|
/>
|
|
/>
|
|
|
|
+
|
|
|
|
+ <assign-role-dialog
|
|
|
|
+ v-if="assignRoleVisibile"
|
|
|
|
+ v-model="assignRoleVisibile"
|
|
|
|
+ :user-ids="curSelectionRows.map(item => item.id)"
|
|
|
|
+ @successFn="updateParams()"
|
|
|
|
+ @closed="assignRoleVisibile = false"
|
|
|
|
+ ></assign-role-dialog>
|
|
|
|
+
|
|
|
|
+ <reset-pwd
|
|
|
|
+ v-if="resetPwdVisibile"
|
|
|
|
+ v-model="resetPwdVisibile"
|
|
|
|
+ :user-ids="curSelectionRows.map(item => item.id)"
|
|
|
|
+ @closed="resetPwdVisibile = false"
|
|
|
|
+ >
|
|
|
|
+ </reset-pwd>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script lang="tsx" setup>
|
|
<script lang="tsx" setup>
|
|
@@ -98,6 +114,9 @@ import { ElMessage, ElTree } from 'element-plus'
|
|
import { useTablePage } from '@/hooks/useTablePage'
|
|
import { useTablePage } from '@/hooks/useTablePage'
|
|
import { Plus, Delete } from '@element-plus/icons-vue'
|
|
import { Plus, Delete } from '@element-plus/icons-vue'
|
|
import StatusIndicator from '@/components/StatusIndicator'
|
|
import StatusIndicator from '@/components/StatusIndicator'
|
|
|
|
+import AssignRoleDialog from './assign-role.vue'
|
|
|
|
+import ResetPwd from './reset-pwd.vue'
|
|
|
|
+
|
|
const visible = ref(false) // 弹窗显示隐藏
|
|
const visible = ref(false) // 弹窗显示隐藏
|
|
const isCreate = ref(true)
|
|
const isCreate = ref(true)
|
|
const activeData = ref({})
|
|
const activeData = ref({})
|
|
@@ -167,6 +186,8 @@ const formOptions = ref({
|
|
}
|
|
}
|
|
}) // 新增的表单
|
|
}) // 新增的表单
|
|
const showGroupLoading = ref(false)
|
|
const showGroupLoading = ref(false)
|
|
|
|
+const assignRoleVisibile = ref(false)
|
|
|
|
+const resetPwdVisibile = ref(false)
|
|
const groupFilterText = ref('')
|
|
const groupFilterText = ref('')
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
|
|
|
|
@@ -330,6 +351,7 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
|
|
const deleteItem = async ids => {
|
|
const deleteItem = async ids => {
|
|
try {
|
|
try {
|
|
await user.userDeleteApi(ids)
|
|
await user.userDeleteApi(ids)
|
|
|
|
+ updateParams()
|
|
} catch (e) {
|
|
} catch (e) {
|
|
console.log('删除失败')
|
|
console.log('删除失败')
|
|
ElMessage.error(`删除失败~`)
|
|
ElMessage.error(`删除失败~`)
|
|
@@ -343,12 +365,8 @@ const table_del = row => {
|
|
|
|
|
|
//批量删除
|
|
//批量删除
|
|
const batch_del = () => {
|
|
const batch_del = () => {
|
|
- /* console.log(tableOpts.curRow);
|
|
|
|
- debugger
|
|
|
|
- const id = tableOpts.curRow.map(item => item.id)*/
|
|
|
|
- // 多选数据
|
|
|
|
- console.log(curSelectionRows.value, 'curSelectionRows.value')
|
|
|
|
- // deleteItem(id)
|
|
|
|
|
|
+ const ids = curSelectionRows.value.map(item => item.id) // 多选数据
|
|
|
|
+ deleteItem(ids)
|
|
}
|
|
}
|
|
|
|
|
|
// 弹窗事件
|
|
// 弹窗事件
|