This commit is contained in:
禺狨 2023-03-23 14:01:20 +08:00
parent f84f192d4b
commit 60f78e9e07

View File

@ -16,7 +16,7 @@ import { appConfig } from "../../api/index";
import { useParams, useNavigate } from "react-router-dom"; import { useParams, useNavigate } from "react-router-dom";
import { UploadImageButton } from "../../compenents"; import { UploadImageButton } from "../../compenents";
import type { TabsProps } from "antd"; import type { TabsProps } from "antd";
// import { Colorpicker } from "antd-colorpicker"; import type { CheckboxChangeEvent } from "antd/es/checkbox";
export const SystemIndexPage: React.FC = () => { export const SystemIndexPage: React.FC = () => {
const params = useParams(); const params = useParams();
@ -97,6 +97,17 @@ export const SystemIndexPage: React.FC = () => {
} }
}; };
const addName = (e: CheckboxChangeEvent) => {
var value = form.getFieldValue("player.bullet_secret_text");
if (e.target.checked) {
value += "${user.mobile}";
console.log(value);
form.setFieldsValue({
"player.bullet_secret_text": value,
});
}
};
const onFinish = (values: any) => { const onFinish = (values: any) => {
if (loading) { if (loading) {
return; return;
@ -232,7 +243,7 @@ export const SystemIndexPage: React.FC = () => {
> >
<Form.Item <Form.Item
style={{ marginBottom: 30 }} style={{ marginBottom: 30 }}
label="启用跑马灯" label="播放器跑马灯"
name="player.is_enabled_bullet_secret" name="player.is_enabled_bullet_secret"
valuePropName="checked" valuePropName="checked"
> >
@ -250,21 +261,23 @@ export const SystemIndexPage: React.FC = () => {
> >
<div className="d-flex"> <div className="d-flex">
<Input style={{ width: 274 }} placeholder="自定义跑马灯内容" /> <Input style={{ width: 274 }} placeholder="自定义跑马灯内容" />
<Checkbox className="ml-24"></Checkbox> <Checkbox className="ml-24" onChange={addName}>
</Checkbox>
<Checkbox className="ml-24"></Checkbox> <Checkbox className="ml-24"></Checkbox>
<Checkbox className="ml-24"></Checkbox> <Checkbox className="ml-24"></Checkbox>
</div> </div>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
style={{ marginBottom: 30 }} style={{ marginBottom: 30 }}
label="跑马灯颜色" label="跑马灯文字颜色"
name="player.bullet_secret_color" name="player.bullet_secret_color"
> >
{/* <Colorpicker /> */} <Input type="color" style={{ width: 32, padding: 0 }} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
style={{ marginBottom: 30 }} style={{ marginBottom: 30 }}
label="跑马灯透明度" label="跑马灯透明度"
name="player.bullet_secret_opacity" name="player.bullet_secret_opacity"
> >
{/* <Colorpicker /> */} {/* <Colorpicker /> */}