mirror of
https://github.com/PlayEdu/backend
synced 2025-06-23 08:32:49 +08:00
系统配置优化和线上课列表选修、必修渲染
This commit is contained in:
parent
3663d7da1f
commit
b03c3be59a
@ -156,9 +156,9 @@ const CoursePage = () => {
|
||||
},
|
||||
{
|
||||
title: "必修/选修",
|
||||
dataIndex: "isRequired",
|
||||
render: (isRequired: number) => (
|
||||
<span>{isRequired === 1 ? "必修课" : "选修课"}</span>
|
||||
dataIndex: "is_required",
|
||||
render: (is_required: number) => (
|
||||
<span>{is_required === 1 ? "必修课" : "选修课"}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
@ -108,29 +108,35 @@ const SystemConfigPage = () => {
|
||||
var value = form.getFieldValue("player.bullet_secret_text");
|
||||
if (e.target.checked) {
|
||||
value += "{name}";
|
||||
form.setFieldsValue({
|
||||
"player.bullet_secret_text": value,
|
||||
});
|
||||
} else {
|
||||
value = value.replace("{name}", "");
|
||||
}
|
||||
form.setFieldsValue({
|
||||
"player.bullet_secret_text": value,
|
||||
});
|
||||
};
|
||||
|
||||
const addEmail = (e: CheckboxChangeEvent) => {
|
||||
var value = form.getFieldValue("player.bullet_secret_text");
|
||||
if (e.target.checked) {
|
||||
value += "{email}";
|
||||
form.setFieldsValue({
|
||||
"player.bullet_secret_text": value,
|
||||
});
|
||||
} else {
|
||||
value = value.replace("{email}", "");
|
||||
}
|
||||
form.setFieldsValue({
|
||||
"player.bullet_secret_text": value,
|
||||
});
|
||||
};
|
||||
const addIdCard = (e: CheckboxChangeEvent) => {
|
||||
var value = form.getFieldValue("player.bullet_secret_text");
|
||||
if (e.target.checked) {
|
||||
value += "{idCard}";
|
||||
form.setFieldsValue({
|
||||
"player.bullet_secret_text": value,
|
||||
});
|
||||
} else {
|
||||
value = value.replace("{idCard}", "");
|
||||
}
|
||||
form.setFieldsValue({
|
||||
"player.bullet_secret_text": value,
|
||||
});
|
||||
};
|
||||
|
||||
const onFinish = (values: any) => {
|
||||
@ -155,10 +161,218 @@ const SystemConfigPage = () => {
|
||||
{
|
||||
key: "1",
|
||||
label: `网站设置`,
|
||||
children: (
|
||||
<Form
|
||||
form={form}
|
||||
name="basic"
|
||||
labelCol={{ span: 3 }}
|
||||
wrapperCol={{ span: 21 }}
|
||||
style={{ width: 1000, paddingTop: 30 }}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
>
|
||||
{logo && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站Logo"
|
||||
name="system.logo"
|
||||
labelCol={{ style: { marginTop: 8, marginLeft: 54 } }}
|
||||
>
|
||||
<div className="d-flex">
|
||||
<Image preview={false} width={150} height={50} src={logo} />
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setLogo(url);
|
||||
form.setFieldsValue({ "system.logo": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
</div>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:240x80px,支持JPG、PNG)
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
{!logo && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站Logo"
|
||||
name="system.logo"
|
||||
>
|
||||
<div className="d-flex">
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setLogo(url);
|
||||
form.setFieldsValue({ "system.logo": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
</div>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:240x80px,支持JPG、PNG)
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站标题"
|
||||
name="system.name"
|
||||
>
|
||||
<Input style={{ width: 274 }} placeholder="请填写网站标题" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站页脚"
|
||||
name="system.pc_index_footer_msg"
|
||||
>
|
||||
<Input style={{ width: 274 }} placeholder="请填写网站页脚" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="API访问地址"
|
||||
name="system.api_url"
|
||||
>
|
||||
<Input style={{ width: 274 }} placeholder="请填写API访问地址" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="PC端访问地址"
|
||||
name="system.pc_url"
|
||||
>
|
||||
<Input style={{ width: 274 }} placeholder="请填写PC端访问地址" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="H5端访问地址"
|
||||
name="system.h5_url"
|
||||
>
|
||||
<Input style={{ width: 274 }} placeholder="请填写H5端访问地址" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
wrapperCol={{ offset: 2, span: 21 }}
|
||||
>
|
||||
<Button type="primary" htmlType="submit" loading={loading}>
|
||||
保存
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
label: `播放设置`,
|
||||
children: (
|
||||
<Form
|
||||
form={form}
|
||||
name="n-basic"
|
||||
labelCol={{ span: 3 }}
|
||||
wrapperCol={{ span: 21 }}
|
||||
style={{ width: 1000, paddingTop: 30 }}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
>
|
||||
<Form.Item style={{ marginBottom: 30 }} label="播放器跑马灯">
|
||||
<Space align="baseline" style={{ height: 32 }}>
|
||||
<Form.Item
|
||||
name="player.is_enabled_bullet_secret"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch onChange={onSwitchChange} />
|
||||
</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 name="player.bullet_secret_text">
|
||||
<Input style={{ width: 274 }} placeholder="自定义跑马灯内容" />
|
||||
</Form.Item>
|
||||
<Checkbox className="ml-24" onChange={addName}>
|
||||
姓名
|
||||
</Checkbox>
|
||||
<Checkbox className="ml-24" onChange={addEmail}>
|
||||
邮箱
|
||||
</Checkbox>
|
||||
<Checkbox className="ml-24" onChange={addIdCard}>
|
||||
身份证号
|
||||
</Checkbox>
|
||||
</Space>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="跑马灯文字颜色"
|
||||
name="player.bullet_secret_color"
|
||||
>
|
||||
<Input type="color" style={{ width: 32, padding: 0 }} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="跑马灯不透明度"
|
||||
name="player.bullet_secret_opacity"
|
||||
>
|
||||
<Slider style={{ width: 400 }} range defaultValue={[0, 100]} />
|
||||
</Form.Item>
|
||||
{thumb && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="播放器封面"
|
||||
name="player.poster"
|
||||
labelCol={{ style: { marginTop: 75, marginLeft: 42 } }}
|
||||
>
|
||||
<div className="d-flex">
|
||||
<Image preview={false} width={320} height={180} src={thumb} />
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setThumb(url);
|
||||
form.setFieldsValue({ "player.poster": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:19200x1080px,视频播放未开始时展示)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
{!thumb && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="播放器封面"
|
||||
name="player.poster"
|
||||
>
|
||||
<div className="d-flex">
|
||||
<div className="d-flex">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setThumb(url);
|
||||
form.setFieldsValue({ "player.poster": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:19200x1080px,视频播放未开始时展示)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
wrapperCol={{ offset: 2, span: 21 }}
|
||||
>
|
||||
<Button type="primary" htmlType="submit" loading={loading}>
|
||||
保存
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@ -175,227 +389,6 @@ const SystemConfigPage = () => {
|
||||
items={items}
|
||||
onChange={onChange}
|
||||
/>
|
||||
<div className="float-left mt-24">
|
||||
<Form
|
||||
form={form}
|
||||
name="basic"
|
||||
labelCol={{ span: 3 }}
|
||||
wrapperCol={{ span: 21 }}
|
||||
style={{ width: 1000 }}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
>
|
||||
{tabKey === 1 && (
|
||||
<>
|
||||
{logo && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站Logo"
|
||||
name="system.logo"
|
||||
labelCol={{ style: { marginTop: 8, marginLeft: 54 } }}
|
||||
>
|
||||
<div className="d-flex">
|
||||
<Image
|
||||
preview={false}
|
||||
width={150}
|
||||
height={50}
|
||||
src={logo}
|
||||
/>
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setLogo(url);
|
||||
form.setFieldsValue({ "system.logo": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
</div>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:240x80px,支持JPG、PNG)
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
{!logo && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站Logo"
|
||||
name="system.logo"
|
||||
>
|
||||
<div className="d-flex">
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setLogo(url);
|
||||
form.setFieldsValue({ "system.logo": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
</div>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:240x80px,支持JPG、PNG)
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站标题"
|
||||
name="system.name"
|
||||
>
|
||||
<Input style={{ width: 274 }} placeholder="请填写网站标题" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="网站页脚"
|
||||
name="system.pc_index_footer_msg"
|
||||
>
|
||||
<Input style={{ width: 274 }} placeholder="请填写网站页脚" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="API访问地址"
|
||||
name="system.api_url"
|
||||
>
|
||||
<Input
|
||||
style={{ width: 274 }}
|
||||
placeholder="请填写API访问地址"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="PC端访问地址"
|
||||
name="system.pc_url"
|
||||
>
|
||||
<Input
|
||||
style={{ width: 274 }}
|
||||
placeholder="请填写PC端访问地址"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="H5端访问地址"
|
||||
name="system.h5_url"
|
||||
>
|
||||
<Input
|
||||
style={{ width: 274 }}
|
||||
placeholder="请填写H5端访问地址"
|
||||
/>
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
{tabKey === 2 && (
|
||||
<>
|
||||
<Form.Item style={{ marginBottom: 30 }} label="播放器跑马灯">
|
||||
<Space align="baseline" style={{ height: 32 }}>
|
||||
<Form.Item
|
||||
name="player.is_enabled_bullet_secret"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch onChange={onSwitchChange} />
|
||||
</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 name="player.bullet_secret_text">
|
||||
<Input
|
||||
style={{ width: 274 }}
|
||||
placeholder="自定义跑马灯内容"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Checkbox className="ml-24" onChange={addName}>
|
||||
姓名
|
||||
</Checkbox>
|
||||
<Checkbox className="ml-24" onChange={addEmail}>
|
||||
邮箱
|
||||
</Checkbox>
|
||||
<Checkbox className="ml-24" onChange={addIdCard}>
|
||||
身份证号
|
||||
</Checkbox>
|
||||
</Space>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="跑马灯文字颜色"
|
||||
name="player.bullet_secret_color"
|
||||
>
|
||||
<Input type="color" style={{ width: 32, padding: 0 }} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="跑马灯不透明度"
|
||||
name="player.bullet_secret_opacity"
|
||||
>
|
||||
<Slider
|
||||
style={{ width: 400 }}
|
||||
range
|
||||
defaultValue={[0, 100]}
|
||||
/>
|
||||
</Form.Item>
|
||||
{thumb && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="播放器封面"
|
||||
name="player.poster"
|
||||
labelCol={{ style: { marginTop: 75, marginLeft: 42 } }}
|
||||
>
|
||||
<div className="d-flex">
|
||||
<Image
|
||||
preview={false}
|
||||
width={320}
|
||||
height={180}
|
||||
src={thumb}
|
||||
/>
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setThumb(url);
|
||||
form.setFieldsValue({ "player.poster": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:19200x1080px,视频播放未开始时展示)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
{!thumb && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
label="播放器封面"
|
||||
name="player.poster"
|
||||
>
|
||||
<div className="d-flex">
|
||||
<div className="d-flex">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
setThumb(url);
|
||||
form.setFieldsValue({ "player.poster": url });
|
||||
}}
|
||||
></UploadImageButton>
|
||||
<div className="helper-text ml-24">
|
||||
(推荐尺寸:19200x1080px,视频播放未开始时展示)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
wrapperCol={{ offset: 2, span: 21 }}
|
||||
>
|
||||
<Button type="primary" htmlType="submit" loading={loading}>
|
||||
保存
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
</Row>
|
||||
</>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user