Commit 336176d0 authored by 成旭东's avatar 成旭东

fix

parent 7ad07a39
Pipeline #28012 passed with stage
in 2 minutes 42 seconds
...@@ -15,6 +15,8 @@ const { Option } = Select; ...@@ -15,6 +15,8 @@ const { Option } = Select;
const DrawerForm = (props: any) => { const DrawerForm = (props: any) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [selectProjectID, setSelectProjectID] = useState('');
const { const {
estateData, estateData,
getProjectList, getProjectList,
...@@ -84,6 +86,10 @@ const DrawerForm = (props: any) => { ...@@ -84,6 +86,10 @@ const DrawerForm = (props: any) => {
} }
} }
const changeProject = (val: any) => {
setSelectProjectID(val);
}
return ( return (
<> <>
<Form <Form
...@@ -105,6 +111,7 @@ const DrawerForm = (props: any) => { ...@@ -105,6 +111,7 @@ const DrawerForm = (props: any) => {
<Select <Select
showSearch showSearch
onSearch={searchProject} onSearch={searchProject}
onChange={changeProject}
> >
{estateData.list.map((item: any, index: any) => ( {estateData.list.map((item: any, index: any) => (
<Option key={index} value={item.id}> <Option key={index} value={item.id}>
...@@ -113,6 +120,10 @@ const DrawerForm = (props: any) => { ...@@ -113,6 +120,10 @@ const DrawerForm = (props: any) => {
))} ))}
</Select> </Select>
</FormItem> </FormItem>
<div style={{ marginBottom: '24px', display: 'flex', alignItems: 'center' }}>
<span style={{ width: '34%', fontSize: '14px', color: 'rgba(0, 0, 0, 0.85)', lineHeight: '32px' }}>楼盘ID:</span>
<Input disabled value={selectProjectID || (editeObj && editeObj.project && editeObj.project.id) || ''} />
</div>
<FormItem <FormItem
name="title" name="title"
label="视频标题" label="视频标题"
...@@ -176,6 +187,21 @@ const DrawerForm = (props: any) => { ...@@ -176,6 +187,21 @@ const DrawerForm = (props: any) => {
<Switch /> <Switch />
</FormItem> </FormItem>
<FormItem <FormItem
name="status"
label="在线状态"
rules={[
{
required: true,
message: '选择上下线状态',
},
]}
>
<Select>
<Option value="online">上线</Option>
<Option value="offline">下线</Option>
</Select>
</FormItem>
<FormItem
name="cover_image" name="cover_image"
label="视频背景图" label="视频背景图"
rules={[ rules={[
...@@ -370,6 +396,11 @@ const VideoList: React.FC<any> = (props) => { ...@@ -370,6 +396,11 @@ const VideoList: React.FC<any> = (props) => {
updateData(id, params); updateData(id, params);
} }
// 切换在线状态
const changeStatus = (params: any, id: number) => {
updateData(id, params);
}
// 编辑视频 // 编辑视频
const editeVideo = (obj: any) => { const editeVideo = (obj: any) => {
const currentEstateData = estateData.list.map((item: any) => item.id); const currentEstateData = estateData.list.map((item: any) => item.id);
...@@ -513,6 +544,23 @@ const VideoList: React.FC<any> = (props) => { ...@@ -513,6 +544,23 @@ const VideoList: React.FC<any> = (props) => {
}, record.id) }} /> }, record.id) }} />
) )
}, { }, {
title: '在线状态',
dataIndex: 'status',
key: 'status',
width: 100,
render: (text: any, record: any) => {
const statusMap = {
online: true,
offline: false,
}
return (
<Switch checked={statusMap[text]} onChange={(val) => { changeStatus({
status: val ? 'online' : 'offline',
}, record.id) }} />
)
}
}, {
title: '操作', title: '操作',
dataIndex: 'operate', dataIndex: 'operate',
key: 'operate', key: 'operate',
...@@ -549,7 +597,7 @@ const VideoList: React.FC<any> = (props) => { ...@@ -549,7 +597,7 @@ const VideoList: React.FC<any> = (props) => {
columns={projectColumns} columns={projectColumns}
onChange={handleStandardTableChange} onChange={handleStandardTableChange}
pagination={videoData.pagination} pagination={videoData.pagination}
scroll={{ x: 910 }} scroll={{ x: 1010 }}
/> />
</Card> </Card>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment