|
@@ -30,7 +30,7 @@
|
|
|
</template>
|
|
|
<template #extraToHeader>
|
|
|
<el-button hc-btn type="primary" @click="addUserClick">新增</el-button>
|
|
|
- <el-button hc-btn type="danger">删除</el-button>
|
|
|
+ <el-button hc-btn type="danger" @click="delUserClick">删除</el-button>
|
|
|
<el-button hc-btn type="info">角色配置</el-button>
|
|
|
<el-button hc-btn type="warning">密码重置</el-button>
|
|
|
<el-button hc-btn type="info">平台配置</el-button>
|
|
@@ -59,8 +59,9 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onActivated, ref } from 'vue'
|
|
|
-import { getArrValue, isNullES } from 'js-fast-way'
|
|
|
+import { HcDelMsg } from 'hc-vue3-ui'
|
|
|
import { getDictionaryData } from '~uti/tools'
|
|
|
+import { arrToId, getArrValue, isNullES } from 'js-fast-way'
|
|
|
import HcDataDialog from './modules/user/data.vue'
|
|
|
import deptApi from '~api/system/dept'
|
|
|
import mainApi from '~api/system/user'
|
|
@@ -180,6 +181,19 @@ const delRowClick = async ({ item }, resolve) => {
|
|
|
resolve()
|
|
|
}
|
|
|
|
|
|
+//批量删除
|
|
|
+const delUserClick = () => {
|
|
|
+ const rows = tableCheckKeys.value
|
|
|
+ if (rows.length <= 0) {
|
|
|
+ window.$message.warning('请先勾选要删除的用户')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ HcDelMsg(async (resolve) => {
|
|
|
+ await delUserData(arrToId(rows, 'id'))
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
//删除用户
|
|
|
const delUserData = async (id) => {
|
|
|
const { isRes } = await mainApi.del(id)
|