ww664853070
2 years ago
16 changed files with 380 additions and 78 deletions
@ -0,0 +1,18 @@ |
|||
CREATE TABLE PUBLIC.dept_training ( |
|||
ID serial NOT NULL CONSTRAINT dept_training_pkey PRIMARY KEY, |
|||
departmentname VARCHAR ( 255 ) NOT NULL, |
|||
trainingtype VARCHAR ( 255 ) NOT NULL, |
|||
traindate TIMESTAMP NOT NULL, |
|||
traincontent VARCHAR ( 255 ) NOT NULL, |
|||
trainwho VARCHAR ( 255 ), |
|||
trainer VARCHAR ( 255 ), |
|||
trainmethod VARCHAR ( 255 ) NOT NULL, |
|||
appraisalmethod VARCHAR ( 255 ) NOT NULL, |
|||
traintime VARCHAR ( 255 ) NOT NULL, |
|||
attachpath VARCHAR ( 255 ), |
|||
origin VARCHAR ( 255 ), |
|||
filesize VARCHAR ( 255 ), |
|||
filename VARCHAR ( 255 ), |
|||
filetype VARCHAR ( 255 ), |
|||
updatedate TIMESTAMP WITH TIME ZONE |
|||
); |
@ -0,0 +1,17 @@ |
|||
CREATE TABLE personal_training ( |
|||
ID serial PRIMARY KEY NOT NULL, |
|||
personalName VARCHAR ( 255 ) NOT NULL,-- 姓名 |
|||
departmentName VARCHAR ( 255 ) NOT NULL,-- 部门名称 |
|||
trainingType VARCHAR ( 255 ) NOT NULL,-- 培训类型 |
|||
topic VARCHAR ( 255 ) NOT NULL,-- 课程主题 |
|||
trainer VARCHAR ( 255 ) NOT NULL,-- 培训讲师 |
|||
trainDate TIMESTAMP NOT NULL,-- 培训时间 |
|||
trainTime VARCHAR ( 255 ) NOT NULL,-- 培训时长 |
|||
trainMethod VARCHAR ( 255 ) NOT NULL,-- 培训方式 |
|||
attendanceScore VARCHAR ( 255 ),-- 考勤分数 |
|||
appraisalMethod VARCHAR ( 255 ) NOT NULL,-- 考核形式 |
|||
appraisalScore VARCHAR ( 255 ),-- 考核分数 |
|||
totalScore VARCHAR ( 255 ),-- 总分 |
|||
origin VARCHAR ( 255 ) --来源 |
|||
|
|||
); |
@ -0,0 +1,29 @@ |
|||
create table training_information |
|||
( |
|||
id serial not null |
|||
constraint training_information_record_pkey |
|||
primary key, |
|||
departmentname varchar(255) not null, |
|||
traindate varchar(255), |
|||
filetype varchar(255), |
|||
filename varchar(255), |
|||
filesize varchar(255), |
|||
updatedate timestamp, |
|||
attachpath varchar(255) |
|||
); |
|||
|
|||
comment on table training_information is '公司培训资源库'; |
|||
|
|||
comment on column training_information.departmentname is '部门分类'; |
|||
|
|||
comment on column training_information.traindate is '时间(三级目录)'; |
|||
|
|||
comment on column training_information.filetype is '文件类型'; |
|||
|
|||
comment on column training_information.filename is '文件名'; |
|||
|
|||
comment on column training_information.filesize is '文件大小'; |
|||
|
|||
comment on column training_information.updatedate is '更新时间'; |
|||
|
|||
comment on column training_information.attachpath is '文件路径'; |
@ -0,0 +1,99 @@ |
|||
import React, { useRef } from 'react'; |
|||
import { Modal, Form, Button, Input } from '@douyinfe/semi-ui'; |
|||
|
|||
const FolderModal = (props) => { |
|||
const { modalData, oldData, onCancel, onOk } = props; |
|||
const { title, childFolder, departmentName, trainDate } = modalData; |
|||
const add = title.includes("新建"); |
|||
|
|||
const form = useRef();//表单 |
|||
const validatName = (val) => { |
|||
if (val && '' == val.trim()) { |
|||
return '不可以为空'; |
|||
} else |
|||
if (val.length > 20) { |
|||
return '最大20字符'; |
|||
} else { |
|||
if (oldData.children) { |
|||
if (childFolder) {//三级目录 |
|||
let deptChild = oldData.children.find(r => r.label == departmentName).children; |
|||
if (!add) { |
|||
deptChild = deptChild.filter(r => trainDate != r.label); |
|||
} |
|||
const old = deptChild.find(r => r.label == val.trim()); |
|||
if (old) { |
|||
return ("该文件已存在"); |
|||
} else { |
|||
return ''; |
|||
} |
|||
} else { //二级目录 |
|||
let deptData = oldData.children; |
|||
if (!add) { |
|||
deptData = deptData.filter(r => departmentName != r.label); |
|||
} |
|||
const old = deptData.find(r => r.label == val.trim()); |
|||
if (old) { |
|||
return ("该文件已存在"); |
|||
} else { |
|||
return ''; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return ''; |
|||
} |
|||
const handleOk = () => { |
|||
|
|||
form.current.validate().then((values) => { |
|||
if (!add) { |
|||
values.oldDepName = departmentName; |
|||
values.oldTrainDate = trainDate; |
|||
} |
|||
onOk(add, values); |
|||
}); |
|||
} |
|||
return (<Modal |
|||
title={`${title}文件夹`} |
|||
visible={true} |
|||
maskClosable={false} |
|||
onOk={handleOk} |
|||
onCancel={onCancel}> |
|||
<Form |
|||
getFormApi={(formApi) => (form.current = formApi)} |
|||
labelPosition={'left'} |
|||
labelAlign={'right'} |
|||
labelCol={{ span: 6 }} |
|||
wrapperCol={{ span: 18 }} |
|||
> |
|||
{!childFolder && <Form.Input |
|||
field="name" |
|||
label="主文件夹" |
|||
initValue="公司档案" |
|||
disabled={true} |
|||
/>} |
|||
<Form.Input |
|||
field="departmentName" |
|||
label="二级文件夹" |
|||
initValue={departmentName} |
|||
disabled={childFolder} |
|||
validate={validatName} |
|||
trigger='blur' |
|||
rules={[{ required: true, message: "请输入二级文件夹" }, |
|||
{ whitespace: true, message: '不允许输入空格' }, |
|||
// { max: 20, message: "最多输入20个字符" } |
|||
]} |
|||
/> |
|||
{childFolder && |
|||
< Form.Input |
|||
field="trainDate" |
|||
label="子文件夹" |
|||
initValue={trainDate} |
|||
validate={validatName} |
|||
trigger='blur' |
|||
rules={[{ required: true, message: "请输入子文件夹" }]} |
|||
/>} |
|||
</Form> |
|||
</Modal > |
|||
) |
|||
} |
|||
export default FolderModal |
Loading…
Reference in new issue