Merge pull request #6 from PlayEdu/dev

Dev
This commit is contained in:
Teng 2023-05-31 10:39:10 +08:00 committed by GitHub
commit b2e67e1a99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 162 additions and 15 deletions

View File

@ -104,6 +104,7 @@ export const LeftMenu: React.FC = () => {
}
newOpenKeys.push(openKeys[i]);
}
return newOpenKeys;
};

View File

@ -62,7 +62,11 @@ export const SelectResource = (props: PropsInterface) => {
open={props.open}
width={800}
maskClosable={false}
onOk={() => props.onSelected(selectKeys, selectVideos)}
onOk={() => {
props.onSelected(selectKeys, selectVideos);
setSelectKeys([]);
setSelectVideos([]);
}}
>
<Row>
<Tabs defaultActiveKey="1" items={items} onChange={onChange} />

View File

@ -218,7 +218,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
paddingLeft: 10,
}}
>
{videoList.length > 0 && (
{videoList.length > 0 && total > 10 && (
<Col
span={24}
style={{ display: "flex", flexDirection: "row-reverse" }}

View File

@ -241,6 +241,10 @@ export const CourseCreate: React.FC<PropInterface> = ({
};
const selectData = (arr: any, videos: any) => {
if (arr.length === 0) {
message.error("请选择视频");
return;
}
let keys = [...hours];
let data = [...treeData];
keys = keys.concat(arr);
@ -251,6 +255,10 @@ export const CourseCreate: React.FC<PropInterface> = ({
};
const selectChapterData = (arr: any, videos: any) => {
if (arr.length === 0) {
message.error("请选择视频");
return;
}
const data = [...chapters];
const keys = [...chapterHours];
keys[addvideoCurrent] = keys[addvideoCurrent].concat(arr);

View File

@ -117,6 +117,10 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
});
}
}
if (hours.length === 0) {
message.error("请选择视频");
return;
}
courseHour
.storeCourseHourMulti(id, hours)
.then((res: any) => {
@ -148,6 +152,10 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
});
}
}
if (hours.length === 0) {
message.error("请选择视频");
return;
}
courseHour
.storeCourseHourMulti(id, hours)
.then((res: any) => {

View File

@ -263,7 +263,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[0].user_id
].name
]?.name
}
</div>
)}
@ -288,7 +288,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[1].user_id
].name
]?.name
}
</div>
)}
@ -313,7 +313,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[2].user_id
].name
]?.name
}
</div>
)}
@ -334,7 +334,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[3].user_id
].name
]?.name
}
</div>
)}
@ -355,7 +355,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[4].user_id
].name
]?.name
}
</div>
)}
@ -380,7 +380,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[5].user_id
].name
]?.name
}
</div>
)}
@ -401,7 +401,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[6].user_id
].name
]?.name
}
</div>
)}
@ -422,7 +422,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[7].user_id
].name
]?.name
}
</div>
)}
@ -443,7 +443,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[8].user_id
].name
]?.name
}
</div>
)}
@ -464,7 +464,7 @@ const DashboardPage = () => {
{
basicData.user_learn_top10_users[
basicData.user_learn_top10[9].user_id
].name
]?.name
}
</div>
)}

View File

@ -98,6 +98,7 @@ const ResourceImagesPage = () => {
const resetImageList = () => {
setPage(1);
setImageList([]);
setSelectKey([]);
setRefresh(!refresh);
};

View File

@ -65,6 +65,14 @@ const SystemConfigPage = () => {
form.setFieldsValue({
"player.poster": configData[i].key_value,
});
} else if (configData[i].key_name === "player.disabled_drag") {
let value = 0;
if (configData[i].key_value === "1") {
value = 1;
}
form.setFieldsValue({
"player.disabled_drag": value,
});
} else if (
configData[i].key_name === "player.is_enabled_bullet_secret"
) {
@ -109,6 +117,26 @@ const SystemConfigPage = () => {
form.setFieldsValue({
"member.default_avatar": configData[i].key_value,
});
} else if (configData[i].key_name === "minio.access_key") {
form.setFieldsValue({
"minio.access_key": configData[i].key_value,
});
} else if (configData[i].key_name === "minio.secret_key") {
form.setFieldsValue({
"minio.secret_key": configData[i].key_value,
});
} else if (configData[i].key_name === "minio.bucket") {
form.setFieldsValue({
"minio.bucket": configData[i].key_value,
});
} else if (configData[i].key_name === "minio.endpoint") {
form.setFieldsValue({
"minio.endpoint": configData[i].key_value,
});
} else if (configData[i].key_name === "minio.domain") {
form.setFieldsValue({
"minio.domain": configData[i].key_value,
});
}
}
});
@ -122,6 +150,14 @@ const SystemConfigPage = () => {
}
};
const onDragChange = (checked: boolean) => {
if (checked) {
form.setFieldsValue({ "player.disabled_drag": 1 });
} else {
form.setFieldsValue({ "player.disabled_drag": 0 });
}
};
const addName = (e: CheckboxChangeEvent) => {
var value = form.getFieldValue("player.bullet_secret_text");
if (e.target.checked) {
@ -307,6 +343,16 @@ const SystemConfigPage = () => {
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item style={{ marginBottom: 30 }} label="禁止拖动进度条">
<Space align="baseline" style={{ height: 32 }}>
<Form.Item name="player.disabled_drag" valuePropName="checked">
<Switch onChange={onDragChange} />
</Form.Item>
<div className="helper-text ml-24">
</div>
</Space>
</Form.Item>
<Form.Item style={{ marginBottom: 30 }} label="播放器跑马灯">
<Space align="baseline" style={{ height: 32 }}>
<Form.Item
@ -376,7 +422,6 @@ const SystemConfigPage = () => {
<div className="d-flex">
<Image
preview={false}
width={320}
height={180}
src={thumb}
style={{ borderRadius: 6 }}
@ -390,7 +435,7 @@ const SystemConfigPage = () => {
}}
></UploadImageButton>
<div className="helper-text ml-24">
推荐尺寸:19200x1080px
推荐尺寸:1920x1080px
</div>
</div>
</div>
@ -412,7 +457,7 @@ const SystemConfigPage = () => {
}}
></UploadImageButton>
<div className="helper-text ml-24">
推荐尺寸:19200x1080px
推荐尺寸:1920x1080px
</div>
</div>
</div>
@ -502,6 +547,86 @@ const SystemConfigPage = () => {
</Form>
),
},
{
key: "4",
label: `MinIO存储`,
children: (
<Form
form={form}
name="IO-basic"
labelCol={{ span: 3 }}
wrapperCol={{ span: 21 }}
style={{ width: 1000, paddingTop: 30 }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item
style={{ marginBottom: 30 }}
label="AccessKey"
name="minio.access_key"
>
<Input
style={{ width: 274 }}
allowClear
placeholder="请填写AccessKey"
/>
</Form.Item>
<Form.Item
style={{ marginBottom: 30 }}
label="SecretKey"
name="minio.secret_key"
>
<Input
style={{ width: 274 }}
allowClear
placeholder="请填写SecretKey"
/>
</Form.Item>
<Form.Item
style={{ marginBottom: 30 }}
label="Bucket"
name="minio.bucket"
>
<Input
style={{ width: 274 }}
allowClear
placeholder="请填写Bucket"
/>
</Form.Item>
<Form.Item
style={{ marginBottom: 30 }}
label="Endpoint"
name="minio.endpoint"
>
<Input
style={{ width: 274 }}
allowClear
placeholder="请填写Endpoint"
/>
</Form.Item>
<Form.Item
style={{ marginBottom: 30 }}
label="Domain"
name="minio.domain"
>
<Input
style={{ width: 274 }}
allowClear
placeholder="请填写Domain"
/>
</Form.Item>
<Form.Item
style={{ marginBottom: 30 }}
wrapperCol={{ offset: 3, span: 21 }}
>
<Button type="primary" htmlType="submit" loading={loading}>
</Button>
</Form.Item>
</Form>
),
},
];
const onChange = (key: string) => {