|
|
@@ -1,6 +1,6 @@
|
|
|
import TextAideInput from "@/pages/launchSystemV3/components/TextAideInput"
|
|
|
import { extractAndFilterBracketsContent, txtLength } from "@/utils/utils"
|
|
|
-import { Button, Card, Form, InputNumber, Modal, Popconfirm, Radio, Space, Tooltip, message } from "antd"
|
|
|
+import { Button, Card, Form, Input, InputNumber, Modal, Popconfirm, Radio, Space, Tooltip, message } from "antd"
|
|
|
import React, { useEffect, useState } from "react"
|
|
|
import { TextTypeList } from "../../const"
|
|
|
import { DeleteOutlined, MinusCircleOutlined, PlusOutlined } from "@ant-design/icons"
|
|
|
@@ -170,7 +170,7 @@ const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData,
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- const newTextDto = updateTextDto(textDto);
|
|
|
+ const newTextDto = updateTextDto(textDto);
|
|
|
|
|
|
if ([1, 0, 5].includes(type)) {
|
|
|
form.setFieldsValue({
|
|
|
@@ -376,6 +376,12 @@ const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData,
|
|
|
} else if (txtLength(value) > item.restriction.textRestriction.maxLength) {
|
|
|
return Promise.reject('请输入正确的' + item.label)
|
|
|
}
|
|
|
+ // 新增:文案首尾不能包含换行符
|
|
|
+ const first = value.charAt(0);
|
|
|
+ const last = value.charAt(value.length - 1);
|
|
|
+ if (first === '\n' || first === '\r' || last === '\n' || last === '\r') {
|
|
|
+ return Promise.reject('文案首尾不能包含换行符');
|
|
|
+ }
|
|
|
const result = extractAndFilterBracketsContent(value);
|
|
|
if (result.extracted.length > 4) {
|
|
|
return Promise.reject('表情数量不得超出: 4 个')
|
|
|
@@ -408,7 +414,7 @@ const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData,
|
|
|
<Form.Item className="submit_pull">
|
|
|
<Space>
|
|
|
<Button onClick={onClose}>取消</Button>
|
|
|
- <Button type="primary" htmlType="submit" className="modalResetCss">
|
|
|
+ <Button type="primary" className="modalResetCss" onClick={() => form.submit()}>
|
|
|
确定
|
|
|
</Button>
|
|
|
</Space>
|