Archer_cdm 2 years ago
parent
commit
af358464d2
  1. 18
      api/app/lib/controllers/departmentTrain/index.js
  2. 124
      api/app/lib/models/dept_training.js
  3. 9
      api/app/lib/routes/departmentTrain/index.js
  4. 138
      web/client/src/sections/humanAffairs/containers/resourceRepository.jsx
  5. 23
      web/client/src/sections/humanAffairs/style.less

18
api/app/lib/controllers/departmentTrain/index.js

@ -0,0 +1,18 @@
'use strict';
async function getDepartmentTrainRecordList(ctx) {
try {
ctx.status = 200;
ctx.body = {};
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: '查询部门培训记录列表失败'
}
}
}
module.exports = {
getDepartmentTrainRecordList
}

124
api/app/lib/models/dept_training.js

@ -0,0 +1,124 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const DeptTraining = sequelize.define("deptTraining", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true
},
departmentName: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "departmentname",
autoIncrement: false
},
trainingType: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "trainingtype",
autoIncrement: false
},
trainDate: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "traindate",
autoIncrement: false
},
trainContent: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "traincontent",
autoIncrement: false
},
trainWho: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "trainwho",
autoIncrement: false
},
trainer: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "trainer",
autoIncrement: false
},
trainMethod: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "trainmethod",
autoIncrement: false
},
appraisalMethod: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "appraisalmethod",
autoIncrement: false
},
trainTime: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "traintime",
autoIncrement: false
},
attachPath: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "attachpath",
autoIncrement: false
},
origin: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "origin",
autoIncrement: false
}
}, {
tableName: "dept_training",
comment: "",
indexes: []
});
dc.models.DeptTraining = DeptTraining;
return DeptTraining;
};

9
api/app/lib/routes/departmentTrain/index.js

@ -0,0 +1,9 @@
'use strict';
const departmentTrain = require('../../controllers/departmentTrain');
module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/department/train/record/list'] = { content: '查询部门培训记录列表', visible: true };
router.get('/department/train/record/list', departmentTrain.getDepartmentTrainRecordList);
};

138
web/client/src/sections/humanAffairs/containers/resourceRepository.jsx

@ -1,11 +1,11 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Button, Col, Row, Input, Tree, Space } from '@douyinfe/semi-ui';
import { Button, Col, Row, Input, Tree, Table, Space } from '@douyinfe/semi-ui';
import { IconSearch } from '@douyinfe/semi-icons';
import '../style.less'
const ResourceRepository = (props) => {
const { dispatch, actions } = props;
const { dispatch, actions, clientHeight } = props;
const treeData = [
{
label: '亚洲',
@ -106,9 +106,123 @@ const ResourceRepository = (props) => {
const style = {
width: 260,
height: 420,
height: clientHeight - 294,
border: '1px solid var(--semi-color-border)'
};
const columns = [
{
title: '文件类型',
dataIndex: 'name',
},
{
title: '文件名称',
dataIndex: 'size',
},
{
title: '大小',
dataIndex: 'owner',
},
{
title: '更新时间',
dataIndex: 'updateTime',
}, {
title: '操作',
dataIndex: 'action',
}
];
const data = [
// {
// key: '1',
// name: 'Semi Design 稿.fig',
// nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/figma-icon.png',
// size: '2M',
// owner: '',
// updateTime: '2020-02-02 05:13',
// avatarBg: 'grey',
// },
// {
// key: '2',
// name: 'Semi Design 稿',
// nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
// size: '2M',
// owner: '',
// updateTime: '2020-01-17 05:31',
// avatarBg: 'red',
// },
// {
// key: '3',
// name: '',
// nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
// size: '34KB',
// owner: 'Zoey Edwards',
// updateTime: '2020-01-26 11:01',
// avatarBg: 'light-blue',
// },
{
key: '4',
name: 'Semi Design 设计稿.fig',
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/figma-icon.png',
size: '2M',
owner: '姜鹏志',
updateTime: '2020-02-02 05:13',
avatarBg: 'grey',
},
{
key: '5',
name: 'Semi Design 分享演示文稿',
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
size: '2M',
owner: '郝宣',
updateTime: '2020-01-17 05:31',
avatarBg: 'red',
},
{
key: '6',
name: '设计文档',
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
size: '34KB',
owner: 'Zoey Edwards',
updateTime: '2020-01-26 11:01',
avatarBg: 'light-blue',
},
{
key: '7',
name: 'Semi Design 设计稿.fig',
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/figma-icon.png',
size: '2M',
owner: '姜鹏志',
updateTime: '2020-02-02 05:13',
avatarBg: 'grey',
},
{
key: '8',
name: 'Semi Design 分享演示文稿',
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
size: '2M',
owner: '郝宣',
updateTime: '2020-01-17 05:31',
avatarBg: 'red',
},
{
key: '9',
name: '设计文档',
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
size: '34KB',
owner: 'Zoey Edwards',
updateTime: '2020-01-26 11:01',
avatarBg: 'light-blue',
},
{
key: '10',
name: '设计文档',
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
size: '34KB',
owner: 'Zoey Edwards',
updateTime: '2020-01-26 11:01',
avatarBg: 'light-blue',
}
];
return (
<>
@ -120,7 +234,7 @@ const ResourceRepository = (props) => {
<div style={{ color: '#033C9A', fontSize: 14, margin: '0px 8px' }}>/</div>
<div style={{ color: '#033C9A', fontSize: 14 }}>培训资源储存库</div>
</div>
<div style={{ background: '#FFFFFF', boxShadow: '0px 0px 12px 2px rgba(220,222,224,0.2)', borderRadius: 2, padding: '20px 0px 20px 19px ', marginTop: 12 }}>
<div style={{ background: '#FFFFFF', boxShadow: '0px 0px 12px 2px rgba(220,222,224,0.2)', borderRadius: 2, padding: '20px', marginTop: 12 }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<div style={{ width: 0, height: 20, borderLeft: '3px solid #0F7EFB', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div>
@ -130,31 +244,31 @@ const ResourceRepository = (props) => {
</div>
<Row className='resourceRepository'>
{/* 左侧 */}
<Col span={6}>
<Col className='left' span={6}>
<Button theme='solid' type='primary' >新建文件夹</Button>
<br />
<Input suffix={<IconSearch />} showClear placeholder="请输入"></Input>
<Tree
treeData={treeData}
defaultExpandAll
directory
style={style}
/>
</Col>
{/* 右侧内容 */}
<Col span={18}>
<Row gutter={16}>
<Col span={12}>
<Col span={18} className='right'>
<Row type="flex" justify="space-around" align="middle">
<Col span={18}>
<Space>
<Button theme='solid' type='primary' >上传文件</Button>
<span><strong>当前文件夹公司培训资源/人力资源部2/2022-11</strong></span>
<span className="path-lable"><strong>当前文件夹公司培训资源/人力资源部2/2022-11</strong></span>
</Space>
</Col>
<Col span={12} justify="end">
<Col span={6} >
<Input suffix={<IconSearch />} showClear placeholder="文件名称、更新时间"></Input>
</Col>
</Row>
<br />
<Table columns={columns} dataSource={data} pagination={false} />
</Col>
</Row>
</div>

23
web/client/src/sections/humanAffairs/style.less

@ -9,13 +9,24 @@
}
.resourceRepository{
margin-top: 20px;
.semi-button{
margin-bottom: 20px;
.left{
.semi-input-wrapper{
width: 260px;
}
.semi-tree-wrapper{
margin-top: 20px;
}
}
.semi-input-wrapper{
width: 260px;
.right{
.path-lable{
margin-bottom: 20px;
}
.semi-input-wrapper{
margin-bottom: 20px;
}
}
.semi-tree-wrapper{
margin-top: 20px;
.semi-button{
margin-bottom: 20px;
}
}

Loading…
Cancel
Save