Browse Source

培训资料库:默认两个文件夹返回

master
周沫沫历险记 2 years ago
parent
commit
7a0b880e41
  1. 8
      api/app/lib/controllers/resourceRepository/index.js

8
api/app/lib/controllers/resourceRepository/index.js

@ -11,11 +11,12 @@ async function getResourceClassify(ctx) {
findObj.limit = Number(limit);
findObj.offset = Number(offset);
}
rlst = [{
label: "公司培训资料", value: "company", key: "company", operation: true, children: []
}, { label: "部门培训资料", value: 'dept', key: 'dept', operation: false, children: [] }];
const trainingInformationLevel = await models.TrainingInformationLevel.findAll(findObj);
if (trainingInformationLevel.length) {
rlst = [{
label: "公司培训资料", value: "company", key: "company", operation: true,
}, { label: "部门培训资料", value: 'dept', key: 'dept', operation: false }];
for (let level of trainingInformationLevel) {
const { id, type, departmentname, traindate, origin } = level;
@ -96,6 +97,7 @@ async function getResourceClassify(ctx) {
}
}
}
ctx.status = 200;
ctx.body = rlst;
} catch (error) {

Loading…
Cancel
Save