mirror of
https://github.com/PlayEdu/backend
synced 2025-06-13 08:05:39 +08:00
Merge branch 'dev' of https://gitee.com/playeduxyz/backend into dev
This commit is contained in:
commit
980d559fb9
23
README.md
23
README.md
@ -1 +1,22 @@
|
|||||||
### PlayEdu 后台界面项目
|
<p align="center">
|
||||||
|
<img src="https://playedu.xyz/images/index/logo-big.png?v=2023032901" width="150"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h1 align="center">后台界面程序 - PlayEdu开源培训系统</h1>
|
||||||
|
<p align="center">一款开源的培训系统,您可以使用它快速搭建私有化内部培训平台</p>
|
||||||
|
|
||||||
|
### 常用链接
|
||||||
|
|
||||||
|
+ [官网](https://playedu.xyz)
|
||||||
|
+ [快速上手](https://playedu.xyz/docs/docs/category/%E5%90%8E%E5%8F%B0%E7%95%8C%E9%9D%A2%E7%A8%8B%E5%BA%8F%E5%AE%89%E8%A3%85)
|
||||||
|
|
||||||
|
### 开发团队
|
||||||
|
|
||||||
|
杭州白书科技有限公司
|
||||||
|
|
||||||
|
### 使用协议
|
||||||
|
|
||||||
|
欢迎使用杭州白书科技有限公司提供的开源培训解决方案!请您仔细阅读以下条款。通过使用 PlayEdu ,您表示同意接受以下所有条款。
|
||||||
|
|
||||||
|
+ 本开源项目中所有代码基于 Apache-2.0 许可协议,您默认遵守许可协议中约定的义务。
|
||||||
|
+ 您默认授权我们将您使用 PlayEdu 所在业务的 Logo 放置在本官网展示。
|
Binary file not shown.
@ -8,7 +8,6 @@ import { getHost } from "../../utils/index";
|
|||||||
|
|
||||||
const MemberImportPage = () => {
|
const MemberImportPage = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [tableData, setWageTableData] = useState<any>([]);
|
|
||||||
const [errorData, setErrorData] = useState<any>([]);
|
const [errorData, setErrorData] = useState<any>([]);
|
||||||
|
|
||||||
const uploadProps = {
|
const uploadProps = {
|
||||||
@ -30,41 +29,39 @@ const MemberImportPage = () => {
|
|||||||
reader.readAsBinaryString(f);
|
reader.readAsBinaryString(f);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
onRemove: () => {
|
|
||||||
setWageTableData([]);
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
const handleImpotedJson = (jsonArr: any, file: any) => {
|
const handleImpotedJson = (jsonArr: any[], file: any) => {
|
||||||
//jsonArr返回的是你上传的excel表格的每一行的数据 是数组形式
|
jsonArr.splice(0, 2); // 去掉表头[第一行规则描述,第二行表头名]
|
||||||
jsonArr.splice(0, 1); // 去掉表头
|
let data: any[] = [];
|
||||||
const jsonArrData = jsonArr.map((item: any, index: number) => {
|
for (let i = 0; i < jsonArr.length; i++) {
|
||||||
// console.log(item, index);
|
let tmpItem = jsonArr[i];
|
||||||
let jsonObj = item;
|
if (typeof tmpItem === undefined) {
|
||||||
//在这写你需要的处理逻辑
|
break;
|
||||||
// jsonObj.id = data.length + index + 1;
|
}
|
||||||
// jsonObj.key = data.length + index + 1 + '';
|
if (tmpItem.length === 0) {
|
||||||
// jsonObj.name = item[0];
|
//空行
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
data.push({
|
||||||
|
deps: tmpItem[0],
|
||||||
|
email: tmpItem[1],
|
||||||
|
password: tmpItem[2],
|
||||||
|
name: tmpItem[3],
|
||||||
|
id_card: tmpItem[4],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// jsonObj.profession = item[1];
|
storeBatchTableData(data);
|
||||||
// jsonObj.pay = item[2];
|
|
||||||
// jsonObj.work = item[3];
|
|
||||||
return jsonObj;
|
|
||||||
});
|
|
||||||
|
|
||||||
// setData([...data, ...jsonArrData]);
|
|
||||||
setWageTableData(jsonArrData);
|
|
||||||
storeBatchTableData(jsonArrData);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const storeBatchTableData = (data: any) => {
|
const storeBatchTableData = (data: any) => {
|
||||||
user
|
user
|
||||||
.storeBatch(2, data)
|
.storeBatch(2, data)
|
||||||
.then((res: any) => {
|
.then(() => {
|
||||||
message.success("导入成功!");
|
message.success("导入成功!");
|
||||||
navigate(-1);
|
navigate(-1);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
setWageTableData([]);
|
|
||||||
if (e.code === -1) {
|
if (e.code === -1) {
|
||||||
setErrorData(e.data);
|
setErrorData(e.data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user