feat:用户导出bug

This commit is contained in:
dzc committed 2025-06-23 14:50:02 +08:00
1 parent 6d517e6873
commit cff707f9af
3 files changed
+59 -129

No files matched your search

+4 -4
View File
@@ -12,16 +12,16 @@ ENV = 'development'
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期 # VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/ # VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/ # VITE_ADMIN_PROXY_PATH = http://localhost:9999/
# VITE_ADMIN_PROXY_PATH = http://192.168.101.139:9999/ # 邓-本地 VITE_ADMIN_PROXY_PATH = http://192.168.101.139:9999/ # 邓-本地
VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上 # VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
# 图片访问基础地址 # 图片访问基础地址
# VITE_IMAGE_BASE_PATH = http://123.157.250.162:8089/api/ # 测试线上 # VITE_IMAGE_BASE_PATH = http://123.157.250.162:8089/api/ # 测试线上
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期 # VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc # VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
# VITE_IMAGE_BASE_PATH = http://localhost:9999 # VITE_IMAGE_BASE_PATH = http://localhost:9999
# VITE_IMAGE_BASE_PATH = http://192.168.101.139:9999 # 邓-本地 VITE_IMAGE_BASE_PATH = http://192.168.101.139:9999 # 邓-本地
VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上 # VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
# 代码生成服务地址 # 代码生成服务地址
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003 VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
+4 -18
View File
@@ -1,23 +1,9 @@
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<vue3-tree-org <vue3-tree-org ref="treeOrgRef" :props="props" :data="data" :label-style="style" :define-menus="getMenus()"
ref="treeOrgRef" :default-expand-level="expandLevel" center :horizontal="horizontal" :collapsable="collapsable"
:props="props" :only-one-node="onlyOneNode" :filter-node-method="filterNodeMethod" :clone-node-drag="cloneNodeDrag"
:data="data" :node-add="addNode" :node-delete="delNode" :node-edit="editNode" @on-node-click="onNodeClick" />
:label-style="style"
:define-menus="getMenus()"
:default-expand-level="expandLevel"
center
:horizontal="horizontal"
:collapsable="collapsable"
:only-one-node="onlyOneNode"
:filter-node-method="filterNodeMethod"
:clone-node-drag="cloneNodeDrag"
:node-add="addNode"
:node-delete="delNode"
:node-edit="editNode"
@on-node-click="onNodeClick"
/>
</div> </div>
<dept-form ref="deptDialogRef" @refresh="getOrgData()" /> <dept-form ref="deptDialogRef" @refresh="getOrgData()" />
</template> </template>
+51 -107
View File
@@ -1,16 +1,9 @@
<template> <template>
<div class="layout-padding"> <div class="layout-padding">
<div class="layout-padding-auto layout-padding-view"> <div class="layout-padding-auto layout-padding-view">
<DraggableDepTree <DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
ref="draggableDepTreeRef" @getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
placeholder="请输入部门名称" :defaultTreeWidth="20" :nodeClickable="false">
:show-expand="true"
@getSelectNode="handleGetSelectNode"
switch-inactive-text="包含"
switch-active-text="不包含"
:defaultTreeWidth="20"
:nodeClickable="false"
>
<template #default> <template #default>
<el-row v-show="showSearch"> <el-row v-show="showSearch">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList"> <el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
@@ -37,31 +30,18 @@
</el-row> </el-row>
<el-row> <el-row>
<div class="mb8" style="width: 100%"> <div class="mb8" style="width: 100%">
<el-button v-auth="'sys_user_add'" icon="folder-add" type="primary" @click="userDialogRef.openDialog()">新增</el-button> <el-button v-auth="'sys_user_add'" icon="folder-add" type="primary"
<el-button plain v-auth="'sys_user_export'" class="ml10" icon="upload-filled" type="primary" @click="excelUploadRef.show()"> @click="userDialogRef.openDialog()">新增</el-button>
<el-button plain v-auth="'sys_user_export'" class="ml10" icon="upload-filled" type="primary"
@click="excelUploadRef.show()">
导入 导入
</el-button> </el-button>
<el-button <el-button plain v-auth="'sys_user_del'" :disabled="multiple" class="ml10" icon="Delete"
plain type="primary" @click="handleDelete(selectObjs)">
v-auth="'sys_user_del'"
:disabled="multiple"
class="ml10"
icon="Delete"
type="primary"
@click="handleDelete(selectObjs)"
>
删除 删除
</el-button> </el-button>
<el-button <el-button plain v-auth="'sys_user_del'" v-if="activeName == '1'" :disabled="multiple"
plain class="ml10" icon="VideoPlay" type="primary" @click="doBatchDeal">
v-auth="'sys_user_del'"
v-if="activeName == '1'"
:disabled="multiple"
class="ml10"
icon="VideoPlay"
type="primary"
@click="doBatchDeal"
>
审批 审批
</el-button> </el-button>
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
@@ -69,26 +49,15 @@
<el-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" /> <el-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
</el-tabs> </el-tabs>
<right-toolbar <right-toolbar v-model:showSearch="showSearch" :export="'sys_user_export'"
v-model:showSearch="showSearch" @exportExcel="exportExcel" @queryTable="getDataList" class="ml10"
:export="'sys_user_export'" style="float: right" />
@exportExcel="exportExcel"
@queryTable="getDataList"
class="ml10"
style="float: right"
/>
</div> </div>
</div> </div>
</el-row> </el-row>
<el-table <el-table v-loading="state.loading" :data="state.dataList" @selection-change="handleSelectionChange"
v-loading="state.loading" row-key="userId" border :cell-style="tableStyle.cellStyle"
:data="state.dataList" :header-cell-style="tableStyle.headerCellStyle">
@selection-change="handleSelectionChange"
row-key="userId"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
>
<el-table-column :selectable="handleSelectable" type="selection" width="40" /> <el-table-column :selectable="handleSelectable" type="selection" width="40" />
<el-table-column label="#" type="index" width="60" fixed="left" /> <el-table-column label="#" type="index" width="60" fixed="left" />
<el-table-column label="用户名" prop="username" fixed="left" show-overflow-tooltip /> <el-table-column label="用户名" prop="username" fixed="left" show-overflow-tooltip />
@@ -97,18 +66,15 @@
<el-table-column label="部门" prop="deptName" show-overflow-tooltip min-width="150" /> <el-table-column label="部门" prop="deptName" show-overflow-tooltip min-width="150" />
<el-table-column label="角色" show-overflow-tooltip min-width="150"> <el-table-column label="角色" show-overflow-tooltip min-width="150">
<template #default="scope"> <template #default="scope">
<el-tag v-for="(item, index) in scope.row.roleList" :key="index">{{ item.roleName }}</el-tag> <el-tag v-for="(item, index) in scope.row.roleList" :key="index">{{ item.roleName
}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="启用" show-overflow-tooltip min-width="150"> <el-table-column label="启用" show-overflow-tooltip min-width="150">
<template #default="{ row }"> <template #default="{ row }">
<el-switch <el-switch :disabled="!auth('sys_user_edit') || row.processStatus != '2'"
:disabled="!auth('sys_user_edit') || row.processStatus != '2'" v-model="row.lockFlag" @change="changeSwitch(row)" active-value="0"
v-model="row.lockFlag" inactive-value="9"></el-switch>
@change="changeSwitch(row)"
active-value="0"
inactive-value="9"
></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="人脸"> <el-table-column label="人脸">
@@ -118,68 +84,44 @@
</el-table-column> </el-table-column>
<el-table-column v-if="false" label="全局人脸" show-overflow-tooltip> <el-table-column v-if="false" label="全局人脸" show-overflow-tooltip>
<template #default="{ row }"> <template #default="{ row }">
<el-switch <el-switch :disabled="!auth('userFace_sysUserFace_global_face')" v-if="row.isGlobalFace"
:disabled="!auth('userFace_sysUserFace_global_face')" v-model="row.isGlobalFace" @change="changeGlobalFaceSwitch(row)" active-value="1"
v-if="row.isGlobalFace" inactive-value="0" />
v-model="row.isGlobalFace"
@change="changeGlobalFaceSwitch(row)"
active-value="1"
inactive-value="0"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属商户" prop="merchantName" show-overflow-tooltip min-width="150" /> <el-table-column label="所属商户" prop="merchantName" show-overflow-tooltip min-width="150" />
<el-table-column <el-table-column v-auths="['sys_user_edit', 'userFace_sysUserFace_view', 'sys_user_del']"
v-auths="['sys_user_edit', 'userFace_sysUserFace_view', 'sys_user_del']" label="操作" min-width="300" width="300" fixed="right">
label="操作"
min-width="300"
width="300"
fixed="right"
>
<template #default="{ row }"> <template #default="{ row }">
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<!-- 重置密码 --> <!-- 重置密码 -->
<popover-input v-if="row.processStatus == '2'" v-model="inputPassword" @confirm="changePassword(row)"> <popover-input v-if="row.processStatus == '2'" v-model="inputPassword"
@confirm="changePassword(row)">
<template #default> <template #default>
<el-button v-auth="'sys_user_edit'" icon="RefreshLeft" text type="primary" class="mr-4">密码</el-button> <el-button v-auth="'sys_user_edit'" icon="RefreshLeft" text type="primary"
class="mr-4">密码</el-button>
</template> </template>
</popover-input> </popover-input>
<!-- 修改信息 --> <!-- 修改信息 -->
<el-button <el-button v-if="row.processStatus == '2'" v-auth="'sys_user_edit'" icon="edit-pen"
v-if="row.processStatus == '2'" text type="primary" @click="userDialogRef.openDialog(row.userId)">
v-auth="'sys_user_edit'"
icon="edit-pen"
text
type="primary"
@click="userDialogRef.openDialog(row.userId)"
>
修改 修改
</el-button> </el-button>
<!-- 人脸管理 --> <!-- 人脸管理 -->
<el-button <el-button v-if="row.processStatus == '2'" v-auth="'userFace_sysUserFace_view'"
v-if="row.processStatus == '2'" icon="User" text type="primary" @click="faceManageRef.openDialog(row.userId)">
v-auth="'userFace_sysUserFace_view'"
icon="User"
text
type="primary"
@click="faceManageRef.openDialog(row.userId)"
>
人脸管理 人脸管理
</el-button> </el-button>
<el-button v-if="row.processStatus == 1" type="primary" size="small" link icon="VideoPlay" @click="deal(row)"> <el-button v-if="row.processStatus == 1" type="primary" size="small" link
icon="VideoPlay" @click="deal(row)">
开始处理 开始处理
</el-button> </el-button>
<!-- 删除用户 --> <!-- 删除用户 -->
<el-tooltip content="admin 不允许被删除" :disabled="row.userId !== '1'" placement="top"> <el-tooltip content="admin 不允许被删除" :disabled="row.userId !== '1'" placement="top">
<span style="margin-left: 12px"> <span style="margin-left: 12px">
<el-button <el-button icon="delete" v-auth="'sys_user_del'"
icon="delete" :disabled="row.username === 'admin'" text type="primary"
v-auth="'sys_user_del'" @click="handleDelete([row.userId])">
:disabled="row.username === 'admin'"
text
type="primary"
@click="handleDelete([row.userId])"
>
删除 删除
</el-button> </el-button>
</span> </span>
@@ -188,20 +130,16 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-bind="state.pagination" @current-change="currentChangeHandle" @size-change="sizeChangeHandle" /> <pagination v-bind="state.pagination" @current-change="currentChangeHandle"
@size-change="sizeChangeHandle" />
</template> </template>
</DraggableDepTree> </DraggableDepTree>
</div> </div>
<user-form ref="userDialogRef" @refresh="getDataList(false)" :deptId="state.queryForm.deptId" /> <user-form ref="userDialogRef" @refresh="getDataList(false)" :deptId="state.queryForm.deptId" />
<face-manage ref="faceManageRef" @refresh="getDataList(false)" /> <face-manage ref="faceManageRef" @refresh="getDataList(false)" />
<upload-excel <upload-excel ref="excelUploadRef" title="用户导入" temp-url="/admin/sys-file/local/file/user.xlsx"
ref="excelUploadRef" url="/admin/user/import-face" @refreshDataList="getDataList" />
title="用户导入"
temp-url="/admin/sys-file/local/file/user.xlsx"
url="/admin/user/import-face"
@refreshDataList="getDataList"
/>
<!-- 审批抽屉 --> <!-- 审批抽屉 -->
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" /> <process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
@@ -307,7 +245,13 @@ const taskSubmitEvent = () => {
// 导出excel // 导出excel
const exportExcel = () => { const exportExcel = () => {
postDownBlobFile("/admin/user/export", Object.assign(state.queryForm, { ids: selectObjs }), "用户管理.xlsx") const _data = { ...state.queryForm }
if (_data.role) {
_data.role = [_data.role]
} else {
_data.role = []
}
postDownBlobFile("/admin/user/export", Object.assign(_data, { ids: selectObjs }), "用户管理.xlsx")
} }
// 是否可以多选 // 是否可以多选