mirror of
https://github.com/PlayEdu/backend
synced 2025-06-28 18:42:49 +08:00
Compare commits
28 Commits
c13bf7ef3c
...
895385c4d7
Author | SHA1 | Date | |
---|---|---|---|
|
895385c4d7 | ||
|
46e9949ce0 | ||
|
57e216fc07 | ||
|
1cf8b33a81 | ||
|
0666d9a769 | ||
|
5b124ca821 | ||
|
54b47dc105 | ||
|
3b3be12cac | ||
|
e479ec7848 | ||
|
2b8e8777c7 | ||
|
3d6ea85e41 | ||
|
d9850260e9 | ||
|
da6fc9639f | ||
|
d2e28b9548 | ||
|
e12c13e5cd | ||
|
b553659a95 | ||
|
f69b432b12 | ||
|
d6a0d2bfec | ||
|
42f5d77e4f | ||
|
aa8e1d88aa | ||
|
f7fe5e35f4 | ||
|
8013964441 | ||
|
caf377eb1a | ||
|
272e9a5d50 | ||
|
7d37329713 | ||
|
e0bd169069 | ||
|
d06214aec0 | ||
|
a8432cece7 |
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Row, Col, Empty, Table, Spin } from "antd";
|
import { Row, Col, Empty, Table, Spin, Typography, Input, Button } from "antd";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import { resource } from "../../api";
|
import { resource } from "../../api";
|
||||||
import styles from "./index.module.less";
|
import styles from "./index.module.less";
|
||||||
@ -47,6 +47,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
|
|||||||
const [size, setSize] = useState(10);
|
const [size, setSize] = useState(10);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
|
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
|
||||||
|
const [title, setTitle] = useState("");
|
||||||
|
|
||||||
// 加载列表
|
// 加载列表
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -70,7 +71,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
|
|||||||
size,
|
size,
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
title,
|
||||||
"WORD,EXCEL,PPT,PDF,TXT,RAR,ZIP",
|
"WORD,EXCEL,PPT,PDF,TXT,RAR,ZIP",
|
||||||
categoryIds
|
categoryIds
|
||||||
)
|
)
|
||||||
@ -92,6 +93,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
|
|||||||
const resetVideoList = () => {
|
const resetVideoList = () => {
|
||||||
setPage(1);
|
setPage(1);
|
||||||
setVideoList([]);
|
setVideoList([]);
|
||||||
|
setTitle("");
|
||||||
setRefresh(!refresh);
|
setRefresh(!refresh);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -178,14 +180,42 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col span={17}>
|
<Col span={17}>
|
||||||
<Row style={{ marginBottom: 24, paddingLeft: 10 }}>
|
<Row style={{ marginBottom: 24, paddingLeft: 10 }}>
|
||||||
<Col span={24}>
|
<div className="float-left j-b-flex">
|
||||||
<UploadCoursewareButton
|
<UploadCoursewareButton
|
||||||
categoryIds={category_ids}
|
categoryIds={category_ids}
|
||||||
onUpdate={() => {
|
onUpdate={() => {
|
||||||
resetVideoList();
|
resetVideoList();
|
||||||
}}
|
}}
|
||||||
></UploadCoursewareButton>
|
></UploadCoursewareButton>
|
||||||
</Col>
|
<div className="d-flex">
|
||||||
|
<div className="d-flex mr-24">
|
||||||
|
<Typography.Text>名称:</Typography.Text>
|
||||||
|
<Input
|
||||||
|
value={title}
|
||||||
|
onChange={(e) => {
|
||||||
|
setTitle(e.target.value);
|
||||||
|
}}
|
||||||
|
allowClear
|
||||||
|
style={{ width: 160 }}
|
||||||
|
placeholder="请输入名称关键字"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="d-flex">
|
||||||
|
<Button className="mr-16" onClick={resetVideoList}>
|
||||||
|
重 置
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
setPage(1);
|
||||||
|
setRefresh(!refresh);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查 询
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
{init && (
|
{init && (
|
||||||
<div className="float-left text-center mt-30">
|
<div className="float-left text-center mt-30">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Row, Col, Empty, Table, Spin } from "antd";
|
import { Row, Col, Empty, Table, Spin, Typography, Input, Button } from "antd";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import { resource } from "../../api";
|
import { resource } from "../../api";
|
||||||
import styles from "./index.module.less";
|
import styles from "./index.module.less";
|
||||||
@ -48,6 +48,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
|
|||||||
const [size, setSize] = useState(10);
|
const [size, setSize] = useState(10);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
|
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
|
||||||
|
const [title, setTitle] = useState("");
|
||||||
|
|
||||||
// 加载列表
|
// 加载列表
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -66,7 +67,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
let categoryIds = category_ids.join(",");
|
let categoryIds = category_ids.join(",");
|
||||||
resource
|
resource
|
||||||
.resourceList(page, size, "", "", "", "VIDEO", categoryIds)
|
.resourceList(page, size, "", "", title, "VIDEO", categoryIds)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
setTotal(res.data.result.total);
|
setTotal(res.data.result.total);
|
||||||
setVideoExtra(res.data.videos_extra);
|
setVideoExtra(res.data.videos_extra);
|
||||||
@ -85,6 +86,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
|
|||||||
const resetVideoList = () => {
|
const resetVideoList = () => {
|
||||||
setPage(1);
|
setPage(1);
|
||||||
setVideoList([]);
|
setVideoList([]);
|
||||||
|
setTitle("");
|
||||||
setRefresh(!refresh);
|
setRefresh(!refresh);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -170,14 +172,42 @@ export const UploadVideoSub = (props: PropsInterface) => {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col span={17}>
|
<Col span={17}>
|
||||||
<Row style={{ marginBottom: 24, paddingLeft: 10 }}>
|
<Row style={{ marginBottom: 24, paddingLeft: 10 }}>
|
||||||
<Col span={24}>
|
<div className="float-left j-b-flex">
|
||||||
<UploadVideoButton
|
<UploadVideoButton
|
||||||
categoryIds={category_ids}
|
categoryIds={category_ids}
|
||||||
onUpdate={() => {
|
onUpdate={() => {
|
||||||
resetVideoList();
|
resetVideoList();
|
||||||
}}
|
}}
|
||||||
></UploadVideoButton>
|
></UploadVideoButton>
|
||||||
</Col>
|
<div className="d-flex">
|
||||||
|
<div className="d-flex mr-24">
|
||||||
|
<Typography.Text>名称:</Typography.Text>
|
||||||
|
<Input
|
||||||
|
value={title}
|
||||||
|
onChange={(e) => {
|
||||||
|
setTitle(e.target.value);
|
||||||
|
}}
|
||||||
|
allowClear
|
||||||
|
style={{ width: 160 }}
|
||||||
|
placeholder="请输入名称关键字"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="d-flex">
|
||||||
|
<Button className="mr-16" onClick={resetVideoList}>
|
||||||
|
重 置
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
setPage(1);
|
||||||
|
setRefresh(!refresh);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查 询
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
{init && (
|
{init && (
|
||||||
<div className="float-left text-center mt-30">
|
<div className="float-left text-center mt-30">
|
||||||
|
@ -20,6 +20,10 @@ code {
|
|||||||
monospace;
|
monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.w-100 {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.w-174px {
|
.w-174px {
|
||||||
max-width: 134px;
|
max-width: 134px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -234,7 +234,7 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
|
|||||||
const arr = [...chapters];
|
const arr = [...chapters];
|
||||||
if (arr[index].id) {
|
if (arr[index].id) {
|
||||||
courseChapter
|
courseChapter
|
||||||
.updateCourseChapter(id, Number(arr[index].id), value, arr.length)
|
.updateCourseChapter(id, Number(arr[index].id), value, index + 1)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
console.log("ok");
|
console.log("ok");
|
||||||
getDetail();
|
getDetail();
|
||||||
|
@ -65,6 +65,7 @@ export const TreeHours = (props: PropInterface) => {
|
|||||||
}
|
}
|
||||||
props.onRemoveItem(id);
|
props.onRemoveItem(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDrop: TreeProps["onDrop"] = (info) => {
|
const onDrop: TreeProps["onDrop"] = (info) => {
|
||||||
const dropKey = info.node.key;
|
const dropKey = info.node.key;
|
||||||
const dragKey = info.dragNode.key;
|
const dragKey = info.dragNode.key;
|
||||||
@ -96,23 +97,35 @@ export const TreeHours = (props: PropInterface) => {
|
|||||||
|
|
||||||
// Find dragObject
|
// Find dragObject
|
||||||
let dragObj: DataNode;
|
let dragObj: DataNode;
|
||||||
loop(data, dragKey, (item, index, arr) => {
|
let dragLength = (info.dragNode as any).props.pos.split("-").length;
|
||||||
arr.splice(index, 1);
|
let dropLength = (info.node as any).props.pos.split("-").length;
|
||||||
dragObj = item;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!info.dropToGap) {
|
if (!info.dropToGap) {
|
||||||
// Drop on the content
|
// Drop on the content
|
||||||
loop(data, dropKey, (item) => {
|
if (
|
||||||
item.children = item.children || [];
|
(dropPosition == 0 && dropPos.length == 3) ||
|
||||||
// where to insert 示例添加到头部,可以是随意位置
|
(dropPosition == 0 && dropPos.length == 2 && dragLength == 2)
|
||||||
item.children.unshift(dragObj);
|
) {
|
||||||
});
|
} else {
|
||||||
|
loop(data, dragKey, (item, index, arr) => {
|
||||||
|
arr.splice(index, 1);
|
||||||
|
dragObj = item;
|
||||||
|
});
|
||||||
|
loop(data, dropKey, (item) => {
|
||||||
|
item.children = item.children || [];
|
||||||
|
// where to insert 示例添加到头部,可以是随意位置
|
||||||
|
item.children.unshift(dragObj);
|
||||||
|
});
|
||||||
|
}
|
||||||
} else if (
|
} else if (
|
||||||
((info.node as any).props.children || []).length > 0 && // Has children
|
((info.node as any).props.children || []).length > 0 && // Has children
|
||||||
(info.node as any).props.expanded && // Is expanded
|
(info.node as any).props.expanded && // Is expanded
|
||||||
dropPosition === 1 // On the bottom gap
|
dropPosition === 1 // On the bottom gap
|
||||||
) {
|
) {
|
||||||
|
loop(data, dragKey, (item, index, arr) => {
|
||||||
|
arr.splice(index, 1);
|
||||||
|
dragObj = item;
|
||||||
|
});
|
||||||
loop(data, dropKey, (item) => {
|
loop(data, dropKey, (item) => {
|
||||||
item.children = item.children || [];
|
item.children = item.children || [];
|
||||||
// where to insert 示例添加到头部,可以是随意位置
|
// where to insert 示例添加到头部,可以是随意位置
|
||||||
@ -121,6 +134,16 @@ export const TreeHours = (props: PropInterface) => {
|
|||||||
// item to the tail of the children
|
// item to the tail of the children
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
if (
|
||||||
|
(dragLength == 3 && dropLength == 2) ||
|
||||||
|
(dragLength == 2 && dropLength == 3)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loop(data, dragKey, (item, index, arr) => {
|
||||||
|
arr.splice(index, 1);
|
||||||
|
dragObj = item;
|
||||||
|
});
|
||||||
let ar: DataNode[] = [];
|
let ar: DataNode[] = [];
|
||||||
let i: number;
|
let i: number;
|
||||||
loop(data, dropKey, (_item, index, arr) => {
|
loop(data, dropKey, (_item, index, arr) => {
|
||||||
|
@ -60,6 +60,22 @@ type HourCountModel = {
|
|||||||
[key: number]: string;
|
[key: number]: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type PerCourseRecordsModel = {
|
||||||
|
[key: number]: {
|
||||||
|
course_id: number;
|
||||||
|
created_at: string;
|
||||||
|
finished_at: string;
|
||||||
|
finished_duration: number;
|
||||||
|
hour_id: number;
|
||||||
|
id: number;
|
||||||
|
is_finished: number;
|
||||||
|
real_duration: number;
|
||||||
|
total_duration: number;
|
||||||
|
updated_at: string;
|
||||||
|
user_id: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const CourseUserPage = () => {
|
const CourseUserPage = () => {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const result = new URLSearchParams(useLocation().search);
|
const result = new URLSearchParams(useLocation().search);
|
||||||
@ -69,6 +85,7 @@ const CourseUserPage = () => {
|
|||||||
const [hourCount, setHourCount] = useState<HourCountModel>({});
|
const [hourCount, setHourCount] = useState<HourCountModel>({});
|
||||||
const [userDepIds, setUserDepIds] = useState<DepIdsModel>({});
|
const [userDepIds, setUserDepIds] = useState<DepIdsModel>({});
|
||||||
const [departments, setDepartments] = useState<DepartmentsModel>({});
|
const [departments, setDepartments] = useState<DepartmentsModel>({});
|
||||||
|
const [perRecords, setPerRecords] = useState<PerCourseRecordsModel>({});
|
||||||
const [refresh, setRefresh] = useState(false);
|
const [refresh, setRefresh] = useState(false);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const [size, setSize] = useState(10);
|
const [size, setSize] = useState(10);
|
||||||
@ -135,8 +152,8 @@ const CourseUserPage = () => {
|
|||||||
dataIndex: "created_at",
|
dataIndex: "created_at",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
{records[record.id] ? (
|
{perRecords[record.id] ? (
|
||||||
<span>{dateFormat(records[record.id].created_at)}</span>
|
<span>{dateFormat(perRecords[record.id].created_at)}</span>
|
||||||
) : hourCount[record.id] ? (
|
) : hourCount[record.id] ? (
|
||||||
<span>{dateFormat(hourCount[record.id])}</span>
|
<span>{dateFormat(hourCount[record.id])}</span>
|
||||||
) : (
|
) : (
|
||||||
@ -213,6 +230,7 @@ const CourseUserPage = () => {
|
|||||||
setList(res.data.data);
|
setList(res.data.data);
|
||||||
setHourCount(res.data.user_course_hour_user_first_at);
|
setHourCount(res.data.user_course_hour_user_first_at);
|
||||||
setRecords(res.data.user_course_records);
|
setRecords(res.data.user_course_records);
|
||||||
|
setPerRecords(res.data.per_user_earliest_records);
|
||||||
setCourse(res.data.course);
|
setCourse(res.data.course);
|
||||||
setDepartments(res.data.departments);
|
setDepartments(res.data.departments);
|
||||||
setUserDepIds(res.data.user_dep_ids);
|
setUserDepIds(res.data.user_dep_ids);
|
||||||
|
@ -558,7 +558,7 @@ const DashboardPage = () => {
|
|||||||
<div className={styles["usage-guide"]}>
|
<div className={styles["usage-guide"]}>
|
||||||
<img className={styles["banner"]} src={banner} alt="" />
|
<img className={styles["banner"]} src={banner} alt="" />
|
||||||
<Link
|
<Link
|
||||||
to="https://www.playedu.xyz/docs/docs/guide/"
|
to="https://www.playedu.xyz/book/opensource-handbook/article/wFymJ4SXcX"
|
||||||
target="blank"
|
target="blank"
|
||||||
className={styles["link"]}
|
className={styles["link"]}
|
||||||
>
|
>
|
||||||
|
@ -413,16 +413,6 @@ const DepartmentPage = () => {
|
|||||||
<div className="playedu-main-top mb-24">
|
<div className="playedu-main-top mb-24">
|
||||||
{contextHolder}
|
{contextHolder}
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<PerButton
|
|
||||||
type="primary"
|
|
||||||
text="新建部门"
|
|
||||||
class="mr-16"
|
|
||||||
icon={<PlusOutlined />}
|
|
||||||
p="department-cud"
|
|
||||||
onClick={() => setCreateVisible(true)}
|
|
||||||
disabled={null}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{ldapEnabled ? (
|
{ldapEnabled ? (
|
||||||
<PerButton
|
<PerButton
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -433,7 +423,17 @@ const DepartmentPage = () => {
|
|||||||
onClick={() => ldapSync()}
|
onClick={() => ldapSync()}
|
||||||
disabled={null}
|
disabled={null}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : (
|
||||||
|
<PerButton
|
||||||
|
type="primary"
|
||||||
|
text="新建部门"
|
||||||
|
class="mr-16"
|
||||||
|
icon={<PlusOutlined />}
|
||||||
|
p="department-cud"
|
||||||
|
onClick={() => setCreateVisible(true)}
|
||||||
|
disabled={null}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
{
|
{
|
||||||
title: "课时标题",
|
title: "课时标题",
|
||||||
dataIndex: "title",
|
dataIndex: "title",
|
||||||
|
|
||||||
render: (title: string) => (
|
render: (title: string) => (
|
||||||
<>
|
<>
|
||||||
<span>{title}</span>
|
<span>{title}</span>
|
||||||
@ -68,7 +67,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "总时长",
|
title: "总时长",
|
||||||
width: 120,
|
|
||||||
dataIndex: "duration",
|
dataIndex: "duration",
|
||||||
render: (duration: number) => (
|
render: (duration: number) => (
|
||||||
<>
|
<>
|
||||||
@ -78,7 +76,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "已学习时长",
|
title: "已学习时长",
|
||||||
width: 120,
|
|
||||||
dataIndex: "finished_duration",
|
dataIndex: "finished_duration",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -96,7 +93,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "是否学完",
|
title: "是否学完",
|
||||||
width: 100,
|
|
||||||
dataIndex: "is_finished",
|
dataIndex: "is_finished",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -112,7 +108,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "开始时间",
|
title: "开始时间",
|
||||||
width: 150,
|
|
||||||
dataIndex: "created_at",
|
dataIndex: "created_at",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -126,7 +121,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "学完时间",
|
title: "学完时间",
|
||||||
width: 150,
|
|
||||||
dataIndex: "finished_at",
|
dataIndex: "finished_at",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -142,7 +136,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 70,
|
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
{records && records[record.id] ? (
|
{records && records[record.id] ? (
|
||||||
@ -222,7 +215,7 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
footer={null}
|
footer={null}
|
||||||
>
|
>
|
||||||
<div className="d-flex mt-24">
|
<div className="mt-24">
|
||||||
<PerButton
|
<PerButton
|
||||||
type="primary"
|
type="primary"
|
||||||
text="重置学习记录"
|
text="重置学习记录"
|
||||||
@ -235,10 +228,7 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
disabled={null}
|
disabled={null}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div className="mt-24" style={{ maxHeight: 800, overflowY: "auto" }}>
|
||||||
className="d-flex mt-24"
|
|
||||||
style={{ maxHeight: 800, overflowY: "auto" }}
|
|
||||||
>
|
|
||||||
<Table
|
<Table
|
||||||
columns={column}
|
columns={column}
|
||||||
dataSource={list}
|
dataSource={list}
|
||||||
|
@ -89,13 +89,13 @@ const MemberPage = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setDid(Number(result.get("did")));
|
if (result.get("refresh")) {
|
||||||
if (Number(result.get("did"))) {
|
resetLocalSearchParams({
|
||||||
let arr = [];
|
page: 1,
|
||||||
arr.push(Number(result.get("did")));
|
});
|
||||||
setDepIds(arr);
|
setRefresh(!refresh);
|
||||||
}
|
}
|
||||||
}, [result.get("did")]);
|
}, [result.get("refresh")]);
|
||||||
|
|
||||||
const columns: ColumnsType<DataType> = [
|
const columns: ColumnsType<DataType> = [
|
||||||
{
|
{
|
||||||
|
@ -57,6 +57,22 @@ type DepartmentsListModel = {
|
|||||||
updated_at: string;
|
updated_at: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type PerCourseRecordsModel = {
|
||||||
|
[key: number]: {
|
||||||
|
course_id: number;
|
||||||
|
created_at: string;
|
||||||
|
finished_at: string;
|
||||||
|
finished_duration: number;
|
||||||
|
hour_id: number;
|
||||||
|
id: number;
|
||||||
|
is_finished: number;
|
||||||
|
real_duration: number;
|
||||||
|
total_duration: number;
|
||||||
|
updated_at: string;
|
||||||
|
user_id: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const MemberLearnPage = () => {
|
const MemberLearnPage = () => {
|
||||||
let chartRef = useRef(null);
|
let chartRef = useRef(null);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -69,6 +85,7 @@ const MemberLearnPage = () => {
|
|||||||
const [currentCourses, setCurrentCourses] = useState<DataType[]>([]);
|
const [currentCourses, setCurrentCourses] = useState<DataType[]>([]);
|
||||||
const [openCourses, setOpenCourses] = useState<CourseModel[]>([]);
|
const [openCourses, setOpenCourses] = useState<CourseModel[]>([]);
|
||||||
const [records, setRecords] = useState<UserCourseRecordsModel>({});
|
const [records, setRecords] = useState<UserCourseRecordsModel>({});
|
||||||
|
const [perRecords, setPerRecords] = useState<PerCourseRecordsModel>({});
|
||||||
const [hourCount, setHourCount] = useState<HourCountModel>({});
|
const [hourCount, setHourCount] = useState<HourCountModel>({});
|
||||||
const [total2, setTotal2] = useState(0);
|
const [total2, setTotal2] = useState(0);
|
||||||
const [refresh2, setRefresh2] = useState(false);
|
const [refresh2, setRefresh2] = useState(false);
|
||||||
@ -194,6 +211,7 @@ const MemberLearnPage = () => {
|
|||||||
setOpenCourses(res.data.open_courses);
|
setOpenCourses(res.data.open_courses);
|
||||||
setHourCount(res.data.user_course_hour_count);
|
setHourCount(res.data.user_course_hour_count);
|
||||||
setRecords(res.data.user_course_records);
|
setRecords(res.data.user_course_records);
|
||||||
|
setPerRecords(res.data.per_course_earliest_records);
|
||||||
if (res.data.departments.length > 0) {
|
if (res.data.departments.length > 0) {
|
||||||
let box: OptionModel[] = [];
|
let box: OptionModel[] = [];
|
||||||
res.data.departments.map((item: any) => {
|
res.data.departments.map((item: any) => {
|
||||||
@ -247,8 +265,8 @@ const MemberLearnPage = () => {
|
|||||||
dataIndex: "created_at",
|
dataIndex: "created_at",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
{records[record.id] ? (
|
{perRecords[record.id] ? (
|
||||||
<span>{dateFormat(records[record.id].created_at)}</span>
|
<span>{dateFormat(perRecords[record.id].created_at)}</span>
|
||||||
) : (
|
) : (
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
)}
|
)}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Modal, Table, message, Space, Dropdown, Button } from "antd";
|
import {
|
||||||
|
Modal,
|
||||||
|
Table,
|
||||||
|
message,
|
||||||
|
Space,
|
||||||
|
Dropdown,
|
||||||
|
Typography,
|
||||||
|
Input,
|
||||||
|
Button,
|
||||||
|
} from "antd";
|
||||||
import type { MenuProps } from "antd";
|
import type { MenuProps } from "antd";
|
||||||
import { resource } from "../../../api";
|
import { resource } from "../../../api";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
@ -63,6 +72,7 @@ const ResourceVideosPage = () => {
|
|||||||
const [multiConfig, setMultiConfig] = useState(false);
|
const [multiConfig, setMultiConfig] = useState(false);
|
||||||
const [updateId, setUpdateId] = useState(0);
|
const [updateId, setUpdateId] = useState(0);
|
||||||
const [playUrl, setPlayUrl] = useState("");
|
const [playUrl, setPlayUrl] = useState("");
|
||||||
|
const [title, setTitle] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCateId(Number(result.get("cid")));
|
setCateId(Number(result.get("cid")));
|
||||||
@ -231,7 +241,7 @@ const ResourceVideosPage = () => {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
let categoryIds = category_ids.join(",");
|
let categoryIds = category_ids.join(",");
|
||||||
resource
|
resource
|
||||||
.resourceList(page, size, "", "", "", "VIDEO", categoryIds)
|
.resourceList(page, size, "", "", title, "VIDEO", categoryIds)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
setTotal(res.data.result.total);
|
setTotal(res.data.result.total);
|
||||||
setVideoList(res.data.result.data);
|
setVideoList(res.data.result.data);
|
||||||
@ -250,6 +260,7 @@ const ResourceVideosPage = () => {
|
|||||||
setSize(10);
|
setSize(10);
|
||||||
setVideoList([]);
|
setVideoList([]);
|
||||||
setSelectedRowKeys([]);
|
setSelectedRowKeys([]);
|
||||||
|
setTitle("");
|
||||||
setRefresh(!refresh);
|
setRefresh(!refresh);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -328,7 +339,34 @@ const ResourceVideosPage = () => {
|
|||||||
删除
|
删除
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="d-flex"></div>
|
<div className="d-flex">
|
||||||
|
<div className="d-flex mr-24">
|
||||||
|
<Typography.Text>名称:</Typography.Text>
|
||||||
|
<Input
|
||||||
|
value={title}
|
||||||
|
onChange={(e) => {
|
||||||
|
setTitle(e.target.value);
|
||||||
|
}}
|
||||||
|
allowClear
|
||||||
|
style={{ width: 160 }}
|
||||||
|
placeholder="请输入名称关键字"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="d-flex">
|
||||||
|
<Button className="mr-16" onClick={resetVideoList}>
|
||||||
|
重 置
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
setPage(1);
|
||||||
|
setRefresh(!refresh);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查 询
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="float-left">
|
<div className="float-left">
|
||||||
{multiConfig ? (
|
{multiConfig ? (
|
||||||
|
@ -149,12 +149,12 @@ export const SystemAdministratorCreate: React.FC<PropInterface> = ({
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label="邮箱"
|
label="邮箱"
|
||||||
name="email"
|
name="email"
|
||||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
rules={[{ required: true, message: "请输入管理员邮箱!" }]}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
allowClear
|
allowClear
|
||||||
style={{ width: 200 }}
|
style={{ width: 200 }}
|
||||||
placeholder="请输入学员邮箱"
|
placeholder="请输入管理员邮箱"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
@ -111,7 +111,7 @@ export const SystemAdministratorUpdate: React.FC<PropInterface> = ({
|
|||||||
<>
|
<>
|
||||||
{open ? (
|
{open ? (
|
||||||
<Modal
|
<Modal
|
||||||
title="编辑管理人员"
|
title="编辑管理员"
|
||||||
centered
|
centered
|
||||||
forceRender
|
forceRender
|
||||||
open={true}
|
open={true}
|
||||||
@ -168,12 +168,12 @@ export const SystemAdministratorUpdate: React.FC<PropInterface> = ({
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label="邮箱"
|
label="邮箱"
|
||||||
name="email"
|
name="email"
|
||||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
rules={[{ required: true, message: "请输入管理员邮箱!" }]}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
allowClear
|
allowClear
|
||||||
style={{ width: 200 }}
|
style={{ width: 200 }}
|
||||||
placeholder="请输入学员邮箱"
|
placeholder="请输入管理员邮箱"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="密码" name="password">
|
<Form.Item label="密码" name="password">
|
||||||
|
@ -39,86 +39,53 @@ export const SystemAdminrolesCreate: React.FC<PropInterface> = ({
|
|||||||
|
|
||||||
const getParams = () => {
|
const getParams = () => {
|
||||||
adminRole.createAdminRole().then((res: any) => {
|
adminRole.createAdminRole().then((res: any) => {
|
||||||
const arr: Option[] = [
|
const arr: any = [];
|
||||||
{
|
const arr2: any = [];
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const arr2: Option[] = [
|
|
||||||
{
|
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员日志",
|
|
||||||
value: "管理员日志-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员角色",
|
|
||||||
value: "管理员角色-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "线上课",
|
|
||||||
value: "线上课-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "资源分类",
|
|
||||||
value: "资源分类-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "部门",
|
|
||||||
value: "部门-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "系统配置",
|
|
||||||
value: "系统配置-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "其它",
|
|
||||||
value: "其它-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let actions = res.data.perm_action.action;
|
let actions = res.data.perm_action.action;
|
||||||
let permissions = res.data.perm_action.data;
|
let permissions = res.data.perm_action.data;
|
||||||
for (let i = 0; i < permissions.length; i++) {
|
for (let i = 0; i < permissions.length; i++) {
|
||||||
arr.map((item: any) => {
|
const key = arr.findIndex(
|
||||||
if (item.title === permissions[i].group_name) {
|
(it: any) => it.title === permissions[i].group_name
|
||||||
item.children.push({
|
);
|
||||||
title: permissions[i].name,
|
if (key >= 0) {
|
||||||
value: permissions[i].id,
|
arr[key].children.push({
|
||||||
});
|
title: permissions[i].name,
|
||||||
}
|
value: permissions[i].id,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
arr.push({
|
||||||
|
title: permissions[i].group_name,
|
||||||
|
value: permissions[i].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: permissions[i].name,
|
||||||
|
value: permissions[i].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (let j = 0; j < actions.length; j++) {
|
for (let j = 0; j < actions.length; j++) {
|
||||||
arr2.map((item: any) => {
|
const key = arr2.findIndex(
|
||||||
if (item.title === actions[j].group_name) {
|
(it: any) => it.title === actions[j].group_name
|
||||||
item.children.push({
|
);
|
||||||
title: actions[j].name,
|
if (key >= 0) {
|
||||||
value: actions[j].id,
|
arr2[key].children.push({
|
||||||
});
|
title: actions[j].name,
|
||||||
}
|
value: actions[j].id,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
arr2.push({
|
||||||
|
title: actions[j].group_name,
|
||||||
|
value: actions[j].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: actions[j].name,
|
||||||
|
value: actions[j].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setPermissions(arr);
|
setPermissions(arr);
|
||||||
setActions(arr2);
|
setActions(arr2);
|
||||||
|
@ -53,86 +53,53 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
|||||||
|
|
||||||
const getParams = () => {
|
const getParams = () => {
|
||||||
adminRole.createAdminRole().then((res: any) => {
|
adminRole.createAdminRole().then((res: any) => {
|
||||||
const arr: Option[] = [
|
const arr: any = [];
|
||||||
{
|
const arr2: any = [];
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const arr2: Option[] = [
|
|
||||||
{
|
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员日志",
|
|
||||||
value: "管理员日志-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员角色",
|
|
||||||
value: "管理员角色-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "线上课",
|
|
||||||
value: "线上课-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "资源分类",
|
|
||||||
value: "资源分类-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "部门",
|
|
||||||
value: "部门-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "系统配置",
|
|
||||||
value: "系统配置-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "其它",
|
|
||||||
value: "其它-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let actions = res.data.perm_action.action;
|
let actions = res.data.perm_action.action;
|
||||||
let permissions = res.data.perm_action.data;
|
let permissions = res.data.perm_action.data;
|
||||||
for (let i = 0; i < permissions.length; i++) {
|
for (let i = 0; i < permissions.length; i++) {
|
||||||
arr.map((item: any) => {
|
const key = arr.findIndex(
|
||||||
if (item.title === permissions[i].group_name) {
|
(it: any) => it.title === permissions[i].group_name
|
||||||
item.children.push({
|
);
|
||||||
title: permissions[i].name,
|
if (key >= 0) {
|
||||||
value: permissions[i].id,
|
arr[key].children.push({
|
||||||
});
|
title: permissions[i].name,
|
||||||
}
|
value: permissions[i].id,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
arr.push({
|
||||||
|
title: permissions[i].group_name,
|
||||||
|
value: permissions[i].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: permissions[i].name,
|
||||||
|
value: permissions[i].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (let j = 0; j < actions.length; j++) {
|
for (let j = 0; j < actions.length; j++) {
|
||||||
arr2.map((item: any) => {
|
const key = arr2.findIndex(
|
||||||
if (item.title === actions[j].group_name) {
|
(it: any) => it.title === actions[j].group_name
|
||||||
item.children.push({
|
);
|
||||||
title: actions[j].name,
|
if (key >= 0) {
|
||||||
value: actions[j].id,
|
arr2[key].children.push({
|
||||||
});
|
title: actions[j].name,
|
||||||
}
|
value: actions[j].id,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
arr2.push({
|
||||||
|
title: actions[j].group_name,
|
||||||
|
value: actions[j].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: actions[j].name,
|
||||||
|
value: actions[j].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setPermissions(arr);
|
setPermissions(arr);
|
||||||
setActions(arr2);
|
setActions(arr2);
|
||||||
|
@ -14,13 +14,14 @@ import {
|
|||||||
} from "antd";
|
} from "antd";
|
||||||
import { appConfig, system } from "../../../api/index";
|
import { appConfig, system } from "../../../api/index";
|
||||||
import { UploadImageButton } from "../../../compenents";
|
import { UploadImageButton } from "../../../compenents";
|
||||||
import { useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import type { TabsProps } from "antd";
|
import type { TabsProps } from "antd";
|
||||||
import type { CheckboxChangeEvent } from "antd/es/checkbox";
|
import type { CheckboxChangeEvent } from "antd/es/checkbox";
|
||||||
import {
|
import {
|
||||||
SystemConfigStoreInterface,
|
SystemConfigStoreInterface,
|
||||||
saveConfigAction,
|
saveConfigAction,
|
||||||
} from "../../../store/system/systemConfigSlice";
|
} from "../../../store/system/systemConfigSlice";
|
||||||
|
import logoIcon from "../../../assets/logo.png";
|
||||||
|
|
||||||
const SystemConfigPage = () => {
|
const SystemConfigPage = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@ -33,6 +34,9 @@ const SystemConfigPage = () => {
|
|||||||
const [nameChecked, setNameChecked] = useState(false);
|
const [nameChecked, setNameChecked] = useState(false);
|
||||||
const [emailChecked, setEmailChecked] = useState(false);
|
const [emailChecked, setEmailChecked] = useState(false);
|
||||||
const [idCardchecked, setIdCardChecked] = useState(false);
|
const [idCardchecked, setIdCardChecked] = useState(false);
|
||||||
|
const memberDefaultAvatar = useSelector(
|
||||||
|
(state: any) => state.systemConfig.value.memberDefaultAvatar
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDetail();
|
getDetail();
|
||||||
@ -52,6 +56,8 @@ const SystemConfigPage = () => {
|
|||||||
});
|
});
|
||||||
if (configData[i].key_value !== "") {
|
if (configData[i].key_value !== "") {
|
||||||
setLogo(configData[i].key_value);
|
setLogo(configData[i].key_value);
|
||||||
|
} else {
|
||||||
|
setLogo(logoIcon);
|
||||||
}
|
}
|
||||||
} else if (configData[i].key_name === "system.api_url") {
|
} else if (configData[i].key_name === "system.api_url") {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
@ -122,7 +128,11 @@ const SystemConfigPage = () => {
|
|||||||
"system.pc_index_footer_msg": configData[i].key_value,
|
"system.pc_index_footer_msg": configData[i].key_value,
|
||||||
});
|
});
|
||||||
} else if (configData[i].key_name === "member.default_avatar") {
|
} else if (configData[i].key_name === "member.default_avatar") {
|
||||||
setAvatar(configData[i].key_value);
|
if (configData[i].key_value !== "") {
|
||||||
|
setAvatar(configData[i].key_value);
|
||||||
|
} else {
|
||||||
|
setAvatar(memberDefaultAvatar);
|
||||||
|
}
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
"member.default_avatar": configData[i].key_value,
|
"member.default_avatar": configData[i].key_value,
|
||||||
});
|
});
|
||||||
|
@ -24,22 +24,12 @@ export function timeFormat(dateStr: number) {
|
|||||||
return "-";
|
return "-";
|
||||||
}
|
}
|
||||||
var d = moment.duration(dateStr, "seconds");
|
var d = moment.duration(dateStr, "seconds");
|
||||||
let value =
|
let value = d.hours() + "时" + d.minutes() + "分" + d.seconds() + "秒";
|
||||||
Math.floor(d.asDays()) +
|
|
||||||
"天" +
|
|
||||||
d.hours() +
|
|
||||||
"时" +
|
|
||||||
d.minutes() +
|
|
||||||
"分" +
|
|
||||||
d.seconds() +
|
|
||||||
"秒";
|
|
||||||
|
|
||||||
if (Math.floor(d.asDays()) === 0) {
|
if (d.hours() === 0) {
|
||||||
if (d.hours() === 0) {
|
value = d.minutes() + "分" + d.seconds() + "秒";
|
||||||
value = d.minutes() + "分" + d.seconds() + "秒";
|
} else {
|
||||||
} else {
|
value = d.hours() + "时" + d.minutes() + "分" + d.seconds() + "秒";
|
||||||
value = d.hours() + "时" + d.minutes() + "分" + d.seconds() + "秒";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user