From f268eaf2191e66fbd75b36117ff77d73ac08f41a Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Wed, 23 Nov 2022 14:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E5=8D=A1=E7=89=87=EF=BC=8C?= =?UTF-8?q?=E8=81=8C=E4=BD=8D=E6=8D=A2=E4=B8=BA=E5=B2=97=E4=BD=8D=E3=80=82?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97=E6=90=9C=E7=B4=A2=E8=81=8C=E4=BD=8D?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=BA=E5=B2=97=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/member/index.js | 8 ++++-- api/app/lib/utils/member.js | 12 ++++----- .../components/personnelModal.jsx | 27 ++----------------- .../containers/employeeInformation.jsx | 2 +- .../containers/personnelFiles.jsx | 27 ++----------------- 5 files changed, 16 insertions(+), 60 deletions(-) diff --git a/api/app/lib/controllers/member/index.js b/api/app/lib/controllers/member/index.js index 37d5b84..1593234 100644 --- a/api/app/lib/controllers/member/index.js +++ b/api/app/lib/controllers/member/index.js @@ -103,7 +103,8 @@ async function searchPepMember (ctx) { const userRes = await clickHouse.pepEmis.query(` SELECT user.id AS pepUserId, - user.people_code AS userCode, + user.people_code AS userCode, + basicdata_post.name AS userPost, user.name AS userName, role.name AS roleName, role.id AS roleId, @@ -118,7 +119,9 @@ async function searchPepMember (ctx) { LEFT JOIN department_user ON department_user.user = user.id LEFT JOIN department - ON department.id = department_user.department + ON department.id = department_user.department + LEFT JOIN basicdata_post + ON basicdata_post.id = user.post WHERE user.delete = '0' ${whereOption.length ? `AND ${whereOption.join(' OR ')}` : ''} @@ -154,6 +157,7 @@ async function searchPepMember (ctx) { id: u.roleId, name: u.roleName }] : [], + userPost:u.userPost }) } }) diff --git a/api/app/lib/utils/member.js b/api/app/lib/utils/member.js index f0ce54a..3f4c7a2 100644 --- a/api/app/lib/utils/member.js +++ b/api/app/lib/utils/member.js @@ -200,13 +200,11 @@ module.exports = function (app, opts) { `: ''} WHERE member.del = '0' - ${keywordTarget == 'role' && keyword ? ` - AND user.id IN ( - SELECT user_role.user - FROM ${pepEmis}.user_role AS user_role - INNER JOIN ${pepEmis}.role AS role - ON role.id = user_role.role - AND role.name LIKE '%${keyword}%' + ${keywordTarget == 'post' && keyword ? ` + AND user.post IN ( + SELECT basicDataPost.id + FROM ${pepEmis}.basicdata_post AS basicDataPost + where basicDataPost.name LIKE '%${keyword}%' ) ` : ''} ${keywordTarget == 'dep' && keyword ? ` diff --git a/web/client/src/sections/humanAffairs/components/personnelModal.jsx b/web/client/src/sections/humanAffairs/components/personnelModal.jsx index 425d835..30727fc 100644 --- a/web/client/src/sections/humanAffairs/components/personnelModal.jsx +++ b/web/client/src/sections/humanAffairs/components/personnelModal.jsx @@ -240,33 +240,10 @@ function pushModal (props) {
- 职位: + 岗位:
- { - peoplePro.role.map((ite, idx) => { - let roleArr = [] - for (let i = 0; i < peoplePro.role.length; i++) { - roleArr.push(peoplePro.role[i].name) - } - return ( -
- {idx == 0 ? - (ite.name) : ('') - } - { - peoplePro.role.length > 1 && idx == 1 ? ( - -
- +{peoplePro.role.length - 1} -
-
- ) : ('') - } -
- ) - }) - } + {peoplePro.userPost || ''}
diff --git a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx index 13e28f0..553c264 100644 --- a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx +++ b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx @@ -492,7 +492,7 @@ const employeeInformation = (props) => { style={{ width: 200 }} initValue={"name"} > - 职位 + 岗位 部门 编号 姓名 diff --git a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx index d3420f4..7dd5c49 100644 --- a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx +++ b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx @@ -87,7 +87,7 @@ const Rest = (props) => {