diff --git a/src/route/ProductRelease/components/EditModal/EditModal.tsx b/src/route/ProductRelease/components/EditModal/EditModal.tsx index f888628..aa73287 100644 --- a/src/route/ProductRelease/components/EditModal/EditModal.tsx +++ b/src/route/ProductRelease/components/EditModal/EditModal.tsx @@ -165,7 +165,7 @@ export default function EditModal(props: any) { }); const handleChange: UploadProps['onChange'] = (info) => { - + if (info.file.status === 'uploading') { setLoading(true); return; diff --git a/src/route/TrademarkMall/TrademarkAiEdit.tsx b/src/route/TrademarkMall/TrademarkAiEdit.tsx index bc487d8..f768d09 100644 --- a/src/route/TrademarkMall/TrademarkAiEdit.tsx +++ b/src/route/TrademarkMall/TrademarkAiEdit.tsx @@ -14,7 +14,9 @@ export default function TrademarkAiEdit() { const [editProcess, setEditProcess] = useState(1); return (
-
+
(); // 文字商标表单 const [formB] = Form.useForm(); // 图形商标表单 const height = window.innerHeight - 350; const [goodsType, setGoodsType] = useState('a') + // 生成方式 + const [generateType, setGenerateType] = useState('1') const handleSubmit = () => { // console.log(form); // props.setEditProcess(2); @@ -21,6 +29,71 @@ export default function EditOne(props: any) { } }; + const [fileList, setFileList] = useState([]); + + const handleChange: UploadProps['onChange'] = (info) => { + // console.log(info.file.status); + + + if (info.file.status === 'uploading') { + // setFileList([]) + return; + } + if (info.file.status === 'done') { + + // const fileId = info.file.response.data.fileId; + // // console.log(downloadUrl(fileId)); + + // const url = showImage(fileId, false); + setFileList([ + { + uid: info.file.response.data.fileId, + name: info.file.response.data.fileName, + status: 'done', + url: showImage(info.file.response.data.fileId, false) + } + ]) + + return; + } + if (info.file.status === 'error') { + message.error(`上传失败`); + return; + } + }; + // 自动生成的img + const [generateImgId, setGenerateImgId] = useState('') + const [imgList, setImgList] = useState([]) + const upImgHandleChange: UploadProps['onChange'] = (info) => { + console.log(info.file.status); + + + if (info.file.status === 'uploading') { + // setFileList([]) + return; + } + if (info.file.status === 'done') { + + // const fileId = info.file.response.data.fileId; + // // console.log(downloadUrl(fileId)); + + // const url = showImage(fileId, false); + setImgList([ + { + uid: info.file.response.data.fileId, + name: info.file.response.data.fileName, + status: 'done', + url: showImage(info.file.response.data.fileId, false) + } + ]) + + return; + } + if (info.file.status === 'error') { + message.error(`上传失败`); + return; + } + }; const onFinishA = (values: any) => { console.log(values); props.setEditProcess(2); @@ -34,6 +107,19 @@ export default function EditOne(props: any) { const onChange = (e: any) => { setGoodsType(e.target.value) }; + const generateTypeChange = (e: any) => { + setGenerateType(e.target.value) + // 给FormA表单的imgUrl赋值 + // if (e.target.value === '1') { + // formA.setFieldsValue({ imgUrl: generateImgId }) + // } + // if (e.target.value === '2') { + // formA.setFieldsValue({ imgUrl: imgList[0]?.uid}) + // } + formA.setFieldsValue({ imgUrl: '' }) + setGenerateImgId('') + setImgList([]) + } return (
@@ -42,11 +128,25 @@ export default function EditOne(props: any) { // background: 'pink', padding: '10px', boxSizing: 'border-box', + overflow: 'auto', }}> -
- +
+
+ ! +
+
+
智能商标申请存在较高的失败风险,建议无商标申请经验的用户使用“专家辅助申请"或"至尊无忧注册"提高商标申清通过率。
+
当前仅提供文字、图形或文字图形组合商标申请;暂不支持立体商标、声音商标、证明商标、集体商标的申请。
+
商标局录入的商标信息以商标图样为准,且最终使用需与商标图样一致,请您确认手动上传的商标图样是您想要注册的商标。
+
-
+
基本信息
@@ -74,36 +174,137 @@ export default function EditOne(props: any) { name="FormA" form={formA} onFinish={onFinishA} + onFinishFailed={(errorInfo) => { + // console.log(errorInfo) + // message.error('请填写完整的信息!') + errorInfo.errorFields.forEach((field) => { + if (field.errors.length > 0) { + // 显示每条错误信息 + message.error(field.errors[0]); + } + }); + }} initialValues={{ softWare: '' }} style={{ marginTop: 20 }} > -
+
商标名称*
- - - + - + + - + +
+
+ 若您的商标涉及他人姓名/肖像/期刊,请下载授权声明书模板,填写完盖章签字后 +
+ { + const isPNG = file.type === 'image/png'; + const isPDF = file.type === 'application/pdf'; + const isJPG = file.type === 'image/jpg' || file.type === 'image/jpeg'; + if (!isPNG && !isPDF && !isJPG) { + // console.error('仅支持 PNG、PDF、JPG 格式的文件!'); + message.error('仅支持 PNG、PDF、JPG 格式的文件!'); + } + return isPNG || isPDF || isJPG; + }} + // fileList={[]} + onChange={handleChange} + showUploadList={false} + headers={{ 'Auth': `Bearer ${token}` }} + disabled={fileList.length > 0} + > + 上传附件 + +
+
+ ({fileList.length}/1) +
+
+ {fileList.length > 0 ? ( +
+
{ + window.open(showImage(fileList[0].uid, false)) + }}> + {fileList[0].name} +
+
{ + setFileList([]) + }}>
+
+ ) : ( + <> + )} + {/* 嘻嘻 */} + {/* */} +
+
+
+ 2021年12月10日起,商标名称作为必填项提交至商标局。商标局审核人员会根据商标图样中的文字字母等实际展示的信息重新命名商标名称,并展示在商标局官网。 如何解决请参考文档 +
+ +
+ +
商标说明*: @@ -121,7 +322,7 @@ export default function EditOne(props: any) { color: 'black', resize: 'none' }} - placeholder="商标说明" + placeholder="例:商标由中文“**”、英文“**”及图形构成,无特殊含义。" > @@ -131,21 +332,152 @@ export default function EditOne(props: any) {
- - - - {/* -
- +
+
+ 商标类型*
- */} +
+ + 自动生成 + 手动上传 + +
+
+
+
+ + + + +
+ 暂无图片 +
+
+
+ +
+
+
+ { + const isPNG = file.type === 'image/png'; + const isJPG = file.type === 'image/jpg' || file.type === 'image/jpeg'; + if (!isPNG && !isJPG) { + // console.error('仅支持 PNG、PDF、JPG 格式的文件!'); + message.error('仅支持 PNG、JPG 格式的文件!'); + } + return isPNG || isJPG; + }} + // fileList={[]} + onChange={upImgHandleChange} + showUploadList={false} + headers={{ 'Auth': `Bearer ${token}` }} + disabled={imgList.length > 0} + > +
+ 上传图片 +
+
+
+ +
+ +
+
@@ -159,31 +491,7 @@ export default function EditOne(props: any) { initialValues={{ softWare: '' }} style={{ marginTop: 20 }} > -
-
- 商标名称*: -
- - - - - - - - - -