This commit is contained in:
dzc committed 2025-04-29 12:39:29 +08:00
commit db2317481b
1 file changed
+44 -12
@@ -26,21 +26,36 @@
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">查询</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
<el-button
plain
v-auth="'sys_user_del'"
v-if="activeName == '1'"
:disabled="multiple"
class="ml10"
icon="VideoPlay"
type="primary"
@click="doBatchDeal"
>
审批
</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button
plain
v-auth="'userFace_sysUserFace_del'"
:disabled="multiple"
class="ml10"
icon="Delete"
type="primary"
@click="handleDelete(selectIds)"
>
删除
</el-button>
<el-button
plain
v-auth="'sys_user_del'"
v-if="activeName == '1'"
:disabled="multiple"
class="ml10"
icon="VideoPlay"
type="primary"
@click="doBatchDeal"
>
审批
</el-button>
</div>
</el-row>
<el-tabs class="flex-1" v-model="activeName" @tab-click="handleClickTabItem">
<el-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
</el-tabs>
@@ -123,6 +138,7 @@ const loading = ref()
// 多选rows
const selectObjs = ref([]) as any
const selectIds = ref([]) as any
// 是否可以多选
const multiple = ref(true)
@@ -175,6 +191,7 @@ const handleSelectable = (row: any) => {
// 多选事件
const handleSelectionChange = (objs: { userId: string; processId: string | null }[]) => {
selectObjs.value = objs.map(({ userId, processId }) => ({ userId, processId }))
selectIds.value = objs.map((item: any) => item.id)
multiple.value = !objs.length
}
@@ -219,4 +236,19 @@ const delFace = async (row: any) => {
loading.value.close()
}
}
// 批量删除人脸
const handleDelete = async (ids: any) => {
try {
await useMessage().delConfirm("是否批量删除人脸?")
loadingStart()
await userFaceApi.delObjs(ids).finally(() => loading.value.close())
useMessage().success("删除成功")
getDataList()
} catch (error: any) {
useMessage().error(error)
} finally {
loading.value.close()
}
}
</script>