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://pjcloud.center.takin.cc/
# VITE_ADMIN_PROXY_PATH = http://localhost: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://192.168.101.139:9999/ # 邓-本地
# 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.156.230.15:8089/api/ # 测试线上-过期
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
# VITE_IMAGE_BASE_PATH = http://localhost: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://192.168.101.139:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
# 代码生成服务地址
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
+4 -18
View File
@@ -1,23 +1,9 @@
<template>
<div style="height: 100%">
<vue3-tree-org
ref="treeOrgRef"
:props="props"
:data="data"
: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"
/>
<vue3-tree-org ref="treeOrgRef" :props="props" :data="data" :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>
<dept-form ref="deptDialogRef" @refresh="getOrgData()" />
</template>
+51 -107
View File
@@ -1,16 +1,9 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<DraggableDepTree
ref="draggableDepTreeRef"
placeholder="请输入部门名称"
:show-expand="true"
@getSelectNode="handleGetSelectNode"
switch-inactive-text="包含"
switch-active-text="不包含"
:defaultTreeWidth="20"
:nodeClickable="false"
>
<DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
@getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
:defaultTreeWidth="20" :nodeClickable="false">
<template #default>
<el-row v-show="showSearch">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
@@ -37,31 +30,18 @@
</el-row>
<el-row>
<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 plain v-auth="'sys_user_export'" class="ml10" icon="upload-filled" type="primary" @click="excelUploadRef.show()">
<el-button v-auth="'sys_user_add'" icon="folder-add" type="primary"
@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
plain
v-auth="'sys_user_del'"
:disabled="multiple"
class="ml10"
icon="Delete"
type="primary"
@click="handleDelete(selectObjs)"
>
<el-button plain v-auth="'sys_user_del'" :disabled="multiple" class="ml10" icon="Delete"
type="primary" @click="handleDelete(selectObjs)">
删除
</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 plain v-auth="'sys_user_del'" v-if="activeName == '1'" :disabled="multiple"
class="ml10" icon="VideoPlay" type="primary" @click="doBatchDeal">
审批
</el-button>
<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-tabs>
<right-toolbar
v-model:showSearch="showSearch"
:export="'sys_user_export'"
@exportExcel="exportExcel"
@queryTable="getDataList"
class="ml10"
style="float: right"
/>
<right-toolbar v-model:showSearch="showSearch" :export="'sys_user_export'"
@exportExcel="exportExcel" @queryTable="getDataList" class="ml10"
style="float: right" />
</div>
</div>
</el-row>
<el-table
v-loading="state.loading"
:data="state.dataList"
@selection-change="handleSelectionChange"
row-key="userId"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
>
<el-table v-loading="state.loading" :data="state.dataList" @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 label="#" type="index" width="60" fixed="left" />
<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="角色" show-overflow-tooltip min-width="150">
<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>
</el-table-column>
<el-table-column label="启用" show-overflow-tooltip min-width="150">
<template #default="{ row }">
<el-switch
:disabled="!auth('sys_user_edit') || row.processStatus != '2'"
v-model="row.lockFlag"
@change="changeSwitch(row)"
active-value="0"
inactive-value="9"
></el-switch>
<el-switch :disabled="!auth('sys_user_edit') || row.processStatus != '2'"
v-model="row.lockFlag" @change="changeSwitch(row)" active-value="0"
inactive-value="9"></el-switch>
</template>
</el-table-column>
<el-table-column label="人脸">
@@ -118,68 +84,44 @@
</el-table-column>
<el-table-column v-if="false" label="全局人脸" show-overflow-tooltip>
<template #default="{ row }">
<el-switch
:disabled="!auth('userFace_sysUserFace_global_face')"
v-if="row.isGlobalFace"
v-model="row.isGlobalFace"
@change="changeGlobalFaceSwitch(row)"
active-value="1"
inactive-value="0"
/>
<el-switch :disabled="!auth('userFace_sysUserFace_global_face')" v-if="row.isGlobalFace"
v-model="row.isGlobalFace" @change="changeGlobalFaceSwitch(row)" active-value="1"
inactive-value="0" />
</template>
</el-table-column>
<el-table-column label="所属商户" prop="merchantName" show-overflow-tooltip min-width="150" />
<el-table-column
v-auths="['sys_user_edit', 'userFace_sysUserFace_view', 'sys_user_del']"
label="操作"
min-width="300"
width="300"
fixed="right"
>
<el-table-column v-auths="['sys_user_edit', 'userFace_sysUserFace_view', 'sys_user_del']"
label="操作" min-width="300" width="300" fixed="right">
<template #default="{ row }">
<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>
<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>
</popover-input>
<!-- 修改信息 -->
<el-button
v-if="row.processStatus == '2'"
v-auth="'sys_user_edit'"
icon="edit-pen"
text
type="primary"
@click="userDialogRef.openDialog(row.userId)"
>
<el-button v-if="row.processStatus == '2'" v-auth="'sys_user_edit'" icon="edit-pen"
text type="primary" @click="userDialogRef.openDialog(row.userId)">
修改
</el-button>
<!-- 人脸管理 -->
<el-button
v-if="row.processStatus == '2'"
v-auth="'userFace_sysUserFace_view'"
icon="User"
text
type="primary"
@click="faceManageRef.openDialog(row.userId)"
>
<el-button v-if="row.processStatus == '2'" v-auth="'userFace_sysUserFace_view'"
icon="User" text type="primary" @click="faceManageRef.openDialog(row.userId)">
人脸管理
</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-tooltip content="admin 不允许被删除" :disabled="row.userId !== '1'" placement="top">
<span style="margin-left: 12px">
<el-button
icon="delete"
v-auth="'sys_user_del'"
:disabled="row.username === 'admin'"
text
type="primary"
@click="handleDelete([row.userId])"
>
<el-button icon="delete" v-auth="'sys_user_del'"
:disabled="row.username === 'admin'" text type="primary"
@click="handleDelete([row.userId])">
删除
</el-button>
</span>
@@ -188,20 +130,16 @@
</template>
</el-table-column>
</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>
</DraggableDepTree>
</div>
<user-form ref="userDialogRef" @refresh="getDataList(false)" :deptId="state.queryForm.deptId" />
<face-manage ref="faceManageRef" @refresh="getDataList(false)" />
<upload-excel
ref="excelUploadRef"
title="用户导入"
temp-url="/admin/sys-file/local/file/user.xlsx"
url="/admin/user/import-face"
@refreshDataList="getDataList"
/>
<upload-excel ref="excelUploadRef" 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" />
@@ -307,7 +245,13 @@ const taskSubmitEvent = () => {
// 导出excel
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")
}
// 是否可以多选