From 38f21e0b7c0366293af7006b731951f914359209 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 22 Dec 2022 10:49:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?(fixed)7526=20=E6=96=87=E4=BB=B6=E5=8F=8A?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../containers/resourceRepository.jsx | 2 +- .../src/sections/humanAffairs/style.less | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx index 69a52a2..a60a585 100644 --- a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx +++ b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx @@ -75,7 +75,7 @@ const ResourceRepository = (props) => { const child = data.children ? true : false; const key = data.key.split('/'); return (
- {label.length > 8 ? label.substring(0, 8) + '...' : label} + {label.length > 7 ? label.substring(0, 7) + '...' : label} {true == data.operation ? handleFolderClick(child ? '编辑' : '编辑子', !child, key[1], key[2] || undefined)} /> diff --git a/web/client/src/sections/humanAffairs/style.less b/web/client/src/sections/humanAffairs/style.less index 74ca87a..7d97fdc 100644 --- a/web/client/src/sections/humanAffairs/style.less +++ b/web/client/src/sections/humanAffairs/style.less @@ -24,19 +24,22 @@ margin-bottom: 20px; } - .tree-icon { - padding-left: 6px; - opacity: 0; - -webkit-transition: opacity 0.1s 0.2s; - - .semi-icon { - padding-left: 6px; + .semi-tree-option-list-block .semi-tree-option:hover{ + .tree-icon { + opacity: 1; + -webkit-transition: opacity 0.2s; } } - - .tree-icon:hover { - opacity: 1; - -webkit-transition: opacity 0.2s; + .semi-tree-option-list-block .semi-tree-option{ + .tree-icon { + padding-left: 6px; + opacity: 0; + -webkit-transition: opacity 0.1s 0.2s; + + .semi-icon { + padding-left: 6px; + } + } } } From a806d18224b7895a5d3bf66d88650c9865aa0102 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 22 Dec 2022 11:01:38 +0800 Subject: [PATCH 2/4] =?UTF-8?q?(fixed)7520=20=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/humanAffairs/containers/resourceRepository.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx index a60a585..aef873e 100644 --- a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx +++ b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx @@ -129,7 +129,8 @@ const ResourceRepository = (props) => { const handleDelFile = (id) => { dispatch(delResourceFile(id)).then(res => { if (res.success) { - getFile(currentSelect); + getFile(currentSelect, { limit: 10, page: 0 }, { restSearch: true }); + } }) } @@ -177,6 +178,8 @@ const ResourceRepository = (props) => { const query = pagination ? { ...pagination, type: arr[0] } : { ...paginationQuery, type: arr[0] }; if (opt && opt.restSearch) { //选中树节点重置 + setKeyword(null); + setDataRange(null); } else { if (keyword) { query.keyword = keyword; } if (dataRange) { From 69e7a4641fdeb4c91a64f6fe10101e67b558d3a6 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 22 Dec 2022 11:35:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?(fixed)7516=20=E6=97=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E4=B8=8D=E5=BA=94=E8=AF=A5=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=88=B0=E8=B5=84=E6=96=99=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/resourceRepository/index.js | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/api/app/lib/controllers/resourceRepository/index.js b/api/app/lib/controllers/resourceRepository/index.js index 8da6e42..348404f 100644 --- a/api/app/lib/controllers/resourceRepository/index.js +++ b/api/app/lib/controllers/resourceRepository/index.js @@ -136,37 +136,24 @@ async function getResourceFileList(ctx, next) { findObj.limit = Number(limit); findObj.offset = Number(page) * Number(limit); } + const where = { fileName: { $not: null } }; + if (departmentName) { + where.departmentName = departmentName; + } + if (startTime && endTime) { + where.updateDate = { $between: [startTime, endTime] }; + } + if (keyword) { + where.fileName = { $like: `%${keyword}%` }; + } + findObj.where = where; if ("公司培训资料" == type) { - findObj.where = { fileName: { $not: null } }; - if (departmentName) { - findObj.where.departmentName = departmentName; - } - if (trainDate) { - findObj.where.trainDate = trainDate; - } - if (startTime && endTime) { - findObj.where.updateDate = { $between: [startTime, endTime] }; - } - if (keyword) { - findObj.where.fileName = { $like: `%${keyword}%` }; - } + if (trainDate) { findObj.where.trainDate = trainDate; } rlst = await models.TrainingInformation.findAndCountAll(findObj); } else { - if (departmentName) { - const where = { - departmentName: departmentName - } - if (trainDate) { - where.trainDate = { $between: [moment(trainDate).startOf('month').format('YYYY-MM-DD HH:mm:ss'), moment(trainDate).endOf('month').format('YYYY-MM-DD HH:mm:ss')] }; - } - if (startTime && endTime) { - where.updateDate = { $between: [startTime, endTime] }; - } - if (keyword) { - where.fileName = { $like: `%${keyword}%` }; - } - findObj.where = where; + if (trainDate) { + findObj.where.trainDate = { $between: [moment(trainDate).startOf('month').format('YYYY-MM-DD HH:mm:ss'), moment(trainDate).endOf('month').format('YYYY-MM-DD HH:mm:ss')] }; } rlst = await models.DeptTraining.findAndCountAll(findObj); } From cecdec259169d41fe3b61668d7e10542ea452518 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 22 Dec 2022 11:40:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?(fixed)7520=20=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/humanAffairs/containers/resourceRepository.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx index aef873e..89036c8 100644 --- a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx +++ b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx @@ -178,6 +178,7 @@ const ResourceRepository = (props) => { const query = pagination ? { ...pagination, type: arr[0] } : { ...paginationQuery, type: arr[0] }; if (opt && opt.restSearch) { //选中树节点重置 + setPaginatioQuery({ limit: 10, page: 0 }); setKeyword(null); setDataRange(null); } else {