mirror of
https://github.com/PlayEdu/backend
synced 2025-06-23 17:42:48 +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}";
|
||||
} 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}";
|
||||
} 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}";
|
||||
} else {
|
||||
value = value.replace("{idCard}", "");
|
||||
}
|
||||
form.setFieldsValue({
|
||||
"player.bullet_secret_text": value,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const onFinish = (values: any) => {
|
||||
@ -155,39 +161,17 @@ const SystemConfigPage = () => {
|
||||
{
|
||||
key: "1",
|
||||
label: `网站设置`,
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
label: `播放设置`,
|
||||
},
|
||||
];
|
||||
|
||||
const onChange = (key: string) => {
|
||||
setTabKey(Number(key));
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Row className="playedu-main-body">
|
||||
<Tabs
|
||||
className="float-left"
|
||||
defaultActiveKey="1"
|
||||
items={items}
|
||||
onChange={onChange}
|
||||
/>
|
||||
<div className="float-left mt-24">
|
||||
children: (
|
||||
<Form
|
||||
form={form}
|
||||
name="basic"
|
||||
labelCol={{ span: 3 }}
|
||||
wrapperCol={{ span: 21 }}
|
||||
style={{ width: 1000 }}
|
||||
style={{ width: 1000, paddingTop: 30 }}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
>
|
||||
{tabKey === 1 && (
|
||||
<>
|
||||
{logo && (
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
@ -196,12 +180,7 @@ const SystemConfigPage = () => {
|
||||
labelCol={{ style: { marginTop: 8, marginLeft: 54 } }}
|
||||
>
|
||||
<div className="d-flex">
|
||||
<Image
|
||||
preview={false}
|
||||
width={150}
|
||||
height={50}
|
||||
src={logo}
|
||||
/>
|
||||
<Image preview={false} width={150} height={50} src={logo} />
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
@ -256,35 +235,47 @@ const SystemConfigPage = () => {
|
||||
label="API访问地址"
|
||||
name="system.api_url"
|
||||
>
|
||||
<Input
|
||||
style={{ width: 274 }}
|
||||
placeholder="请填写API访问地址"
|
||||
/>
|
||||
<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端访问地址"
|
||||
/>
|
||||
<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端访问地址"
|
||||
/>
|
||||
<Input style={{ width: 274 }} placeholder="请填写H5端访问地址" />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
{tabKey === 2 && (
|
||||
<>
|
||||
<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
|
||||
@ -301,10 +292,7 @@ const SystemConfigPage = () => {
|
||||
<Form.Item style={{ marginBottom: 30 }} label="跑马灯内容">
|
||||
<Space align="baseline" style={{ height: 32 }}>
|
||||
<Form.Item name="player.bullet_secret_text">
|
||||
<Input
|
||||
style={{ width: 274 }}
|
||||
placeholder="自定义跑马灯内容"
|
||||
/>
|
||||
<Input style={{ width: 274 }} placeholder="自定义跑马灯内容" />
|
||||
</Form.Item>
|
||||
<Checkbox className="ml-24" onChange={addName}>
|
||||
姓名
|
||||
@ -329,11 +317,7 @@ const SystemConfigPage = () => {
|
||||
label="跑马灯不透明度"
|
||||
name="player.bullet_secret_opacity"
|
||||
>
|
||||
<Slider
|
||||
style={{ width: 400 }}
|
||||
range
|
||||
defaultValue={[0, 100]}
|
||||
/>
|
||||
<Slider style={{ width: 400 }} range defaultValue={[0, 100]} />
|
||||
</Form.Item>
|
||||
{thumb && (
|
||||
<Form.Item
|
||||
@ -343,12 +327,7 @@ const SystemConfigPage = () => {
|
||||
labelCol={{ style: { marginTop: 75, marginLeft: 42 } }}
|
||||
>
|
||||
<div className="d-flex">
|
||||
<Image
|
||||
preview={false}
|
||||
width={320}
|
||||
height={180}
|
||||
src={thumb}
|
||||
/>
|
||||
<Image preview={false} width={320} height={180} src={thumb} />
|
||||
<div className="d-flex ml-24">
|
||||
<UploadImageButton
|
||||
onSelected={(url) => {
|
||||
@ -384,8 +363,6 @@ const SystemConfigPage = () => {
|
||||
</div>
|
||||
</Form.Item>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<Form.Item
|
||||
style={{ marginBottom: 30 }}
|
||||
wrapperCol={{ offset: 2, span: 21 }}
|
||||
@ -395,7 +372,23 @@ const SystemConfigPage = () => {
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const onChange = (key: string) => {
|
||||
setTabKey(Number(key));
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Row className="playedu-main-body">
|
||||
<Tabs
|
||||
className="float-left"
|
||||
defaultActiveKey="1"
|
||||
items={items}
|
||||
onChange={onChange}
|
||||
/>
|
||||
</Row>
|
||||
</>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user