zmh 2 years ago
parent
commit
6db7c67212
  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