|
@@ -1,24 +1,16 @@
|
|
-import React, { useEffect, useState, memo } from 'react';
|
|
|
|
-
|
|
|
|
-import {
|
|
|
|
- Button,
|
|
|
|
- Card,
|
|
|
|
- Col,
|
|
|
|
- Form,
|
|
|
|
- Input,
|
|
|
|
- Row,
|
|
|
|
- Select,
|
|
|
|
- Switch,
|
|
|
|
- Popconfirm,
|
|
|
|
- Tooltip,
|
|
|
|
- Space,
|
|
|
|
-} from 'antd';
|
|
|
|
|
|
+import React, { memo, useEffect, useState } from 'react';
|
|
|
|
+
|
|
|
|
+import { Button, Card, Form, Input, Popconfirm, Select, Space, Switch, Tooltip } from 'antd';
|
|
|
|
|
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
|
|
|
|
import CustomUpload from '@/components/upload/index';
|
|
import CustomUpload from '@/components/upload/index';
|
|
|
|
|
|
-import { IBanner, EJumpType as Etype } from './types';
|
|
|
|
|
|
+import { EJumpType as Etype, IBanner } from './types';
|
|
|
|
+
|
|
|
|
+import './item.less';
|
|
|
|
+
|
|
|
|
+const { TextArea } = Input;
|
|
|
|
|
|
const { Option } = Select;
|
|
const { Option } = Select;
|
|
|
|
|
|
@@ -50,6 +42,7 @@ const BannerItem: React.FC<IProps> = ({ itemData, collecrtItem, delItem }) => {
|
|
|
|
|
|
// change form
|
|
// change form
|
|
const changeForm = (key: string, value: any) => {
|
|
const changeForm = (key: string, value: any) => {
|
|
|
|
+ console.log(key, value);
|
|
form.setFieldsValue({ key: value });
|
|
form.setFieldsValue({ key: value });
|
|
|
|
|
|
itemData[key] = value;
|
|
itemData[key] = value;
|
|
@@ -77,6 +70,16 @@ const BannerItem: React.FC<IProps> = ({ itemData, collecrtItem, delItem }) => {
|
|
imgUrl={itemData.imgUrl}
|
|
imgUrl={itemData.imgUrl}
|
|
/>
|
|
/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
|
+ <Form.Item label="封面标题" name="coverTitle">
|
|
|
|
+ <TextArea
|
|
|
|
+ rows={4}
|
|
|
|
+ placeholder="请填写"
|
|
|
|
+ maxLength={18}
|
|
|
|
+ showCount
|
|
|
|
+ allowClear
|
|
|
|
+ onChange={(e) => changeForm('coverTitle', e.target.value)}
|
|
|
|
+ />
|
|
|
|
+ </Form.Item>
|
|
<Form.Item label="跳转类型" name="jumpType">
|
|
<Form.Item label="跳转类型" name="jumpType">
|
|
<Select
|
|
<Select
|
|
placeholder="请选择跳转类型"
|
|
placeholder="请选择跳转类型"
|
|
@@ -90,7 +93,7 @@ const BannerItem: React.FC<IProps> = ({ itemData, collecrtItem, delItem }) => {
|
|
{/* 跳转到h5 */}
|
|
{/* 跳转到h5 */}
|
|
{form.getFieldValue('jumpType') === Etype.h5 && (
|
|
{form.getFieldValue('jumpType') === Etype.h5 && (
|
|
<Form.Item label="跳转地址" name="jumpPath">
|
|
<Form.Item label="跳转地址" name="jumpPath">
|
|
- <Input onChange={(e) => changeForm('jumpPath', e.target.value)} />
|
|
|
|
|
|
+ <Input allowClear onChange={(e) => changeForm('jumpPath', e.target.value)} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
)}
|
|
)}
|
|
|
|
|