diff --git a/.env.dev b/.env.dev index c1d55b0..5a4483b 100644 --- a/.env.dev +++ b/.env.dev @@ -6,9 +6,9 @@ VITE_OPERATOR_PLUGIN_BASE_URL=${VITE_BASE_URL}:8099 VITE_AI_SHOP_BASE_URL=http://192.168.0.115:8081 VITE_WEBSOCKET_BASE_URL=ws://${VITE_HOST}:7025/copyright # 18634604067 -# VITE_USERID=80d3365e-0597-4988-979e-18ef1c3ec671 +VITE_USERID=80d3365e-0597-4988-979e-18ef1c3ec671 # VITE_USERID=e3e40f95-7a3f-4b53-a1a0-51dd4e881d74 -VITE_USERID=5cc90b84-905e-4027-9f6c-ab47e9c320a1 +# VITE_USERID=5cc90b84-905e-4027-9f6c-ab47e9c320a1 # VITE_CURRENT_THEME=fzkj VITE_CURRENT_THEME=mzw # VITE_HOST=121.36.71.250:58038 diff --git a/src/components/OrderDetailModal/OrderDetailModal.tsx b/src/components/OrderDetailModal/OrderDetailModal.tsx index ad59ba3..4b3fd57 100644 --- a/src/components/OrderDetailModal/OrderDetailModal.tsx +++ b/src/components/OrderDetailModal/OrderDetailModal.tsx @@ -187,7 +187,7 @@ export default function OrderDetailModal(props: any) {
- +
{/*
diff --git a/src/components/OrderDetailModal/components/File/File.tsx b/src/components/OrderDetailModal/components/File/File.tsx index 88a2fd8..6c47799 100644 --- a/src/components/OrderDetailModal/components/File/File.tsx +++ b/src/components/OrderDetailModal/components/File/File.tsx @@ -12,7 +12,7 @@ export default function File(props: any) { // 自定义验证函数 const validateContentOrFile = (_rule: any, _value: any, callback: (error?: string) => void, form: any) => { const { upCorrectionRemark, upFile } = form.getFieldsValue(); - if (upCorrectionRemark || (upFile && Array.isArray(upFile.fileList) && upFile.fileList.length > 0)) { + if (upCorrectionRemark || upFile) { callback(); } else { callback('内容和附件至少需要填写或上传一项'); @@ -126,6 +126,8 @@ export default function File(props: any) { const res: any = await getFileTypeByIds({ ids: ids }) + // console.log(res); + setFileList(res) } catch (error: any) { @@ -141,14 +143,99 @@ export default function File(props: any) { } } } + // 获取上传过的文件类型 + const getUpFileTypeByIdsArray = async (ids: string) => { + try { + const res: any = await getFileTypeByIds({ + ids: ids + }) + console.log(res); + const newUpFile = res.map((item: any) => { + return { + uid: item.fileId, + name: item.fileName, + status: 'done', + url: showImage(item.fileId, false) + } + }) + // console.log(newUpFile, 'newUpFile'); + setUpFileArray(newUpFile) + + } catch (error: any) { + + if (error.response) { + const data = error.response.data; + messageApi.open({ + type: 'error', + content: data.msg ? data.msg : `${data.path}(${data.status})`, + }); + } else { + console.error(error) + } + } + } // 补充资料详情 const [detailData, setDetailData] = useState({}) + const [disabled, setDisabled] = useState(false) // 是否禁用 const getSupplementDetail = async (id: string) => { try { const res: any = await supplementDetail(id) // console.log(res); + // 给表单赋值 + // form.setFieldsValue({ + // upCorrectionRemark: res.correctionRemark, // 内容 + // upFile:'1111' + // }) + // 给上传列表赋值 + // setUpFileArray([{ + // uid: '1111', + // name: '嘻嘻', + // status: 'done', + // url: 'www.baidu.com' + // }]) + + setDetailData(res) await getFileTypeByIdsArray(res.correctionFiles) + // console.log(props.user, 'user'); + const userId = props.user == 'sell' ? res.sellId : res.buyId; + // console.log(userId, 'userId'); + if (userId) { + console.log('已补充'); + setDisabled(true) + const newData: any = await supplementDetail(userId) + console.log('以补充材料', newData); + form.setFieldsValue({ + upCorrectionRemark: newData.correctionRemark, // 内容 + + }) + if (newData.correctionFiles) { + getUpFileTypeByIdsArray(newData.correctionFiles) + // const newArray:any = getFileTypeByIds({ + // ids: newData.correctionFiles + // }) + // console.log(newArray, 'newArray'); + // console.log('有补充资料'); + // // 循环newArray 形成新 + // const newUpFile = newArray.map((item:any)=>{ + // return { + // uid: item.fileId, + // name: item.fileName, + // status: 'done', + // url: 'www.baidu.com' + // } + // }) + // console.log(newUpFile, 'newUpFile'); + + + } + + + + } else { + setDisabled(false) + } + } catch (error: any) { @@ -254,6 +341,8 @@ export default function File(props: any) { setCorrectionId(record.correctionId) getSupplementDetail(record.correctionId) setIsModalVisible(true) + // 清空上传的文件数组 + setUpFileArray([]) // 清空表单 form.resetFields(); // setCorrectionType(record.correctionType) @@ -263,7 +352,7 @@ export default function File(props: any) { )} /> - { - // console.log(value); + console.log(value); // if (value.upFile && Array.isArray(value.upFile.fileList)) { // const uids = value.upFile.fileList.map((file: any) => file.uid); // const uidString = uids.join(','); @@ -366,19 +455,21 @@ export default function File(props: any) { // console.log('提取的 uid 字符串:', uids); + submitData({ + correctionFiles: value.upFile ? value.upFile : '', + correctionRemark: value.upCorrectionRemark ? value.upCorrectionRemark : '', + }) + // console.log(upFileArray); + // 将upFileArray 数组里的uid 提取出来 + // const uids = upFileArray.map((file: any) => file.uid).join(','); + + // const uids = upFileArray.map((file: any) => file.response.data.fileId).join(','); + // console.log('提取的 uid 字符串:', uids); // submitData({ // correctionFiles: uids, // correctionRemark: value.upCorrectionRemark, // }) - // console.log(upFileArray); - // 将upFileArray 数组周末和每项的response里的data 里的 fileId 拼接成一个字符串,用逗号隔开 - const uids = upFileArray.map((file: any) => file.response.data.fileId).join(','); - // console.log('提取的 uid 字符串:', uids); - submitData({ - correctionFiles: uids, - correctionRemark: value.upCorrectionRemark, - }) - + }} onFinishFailed={() => { @@ -408,6 +499,7 @@ export default function File(props: any) { width: 900, }} + disabled={disabled} placeholder='请输入需要补充内容' > @@ -435,15 +527,38 @@ export default function File(props: any) { > { - setUpFileArray(info.fileList) - // console.log(info.fileList); - + // console.log(info.file.status); + // setUpFileArray(info.fileList) + const { fileList } = info; + const newFileArray = fileList.map((file) => { + if (file.status === 'done' && file.response) { + return { + uid: file.response.data.fileId, + name: file.response.data.fileName, + status: 'done', + url: showImage(file.response.data.fileId, false) + }; + } + return file; + }); + setUpFileArray(newFileArray); + // console.log(newFileArray); + const uids = newFileArray.map((file: any) => file.uid).join(','); + // console.log(uids); + + // 给form 赋值 + form.setFieldsValue({ + upFile: uids, + }) + + }} - + headers={{ 'Auth': `Bearer ${token}` }} > @@ -465,11 +580,15 @@ export default function File(props: any) { gap: 10, // marginTop: 20 }}> - - +
+ + +
diff --git a/src/components/menu/MenuWithTopButton.tsx b/src/components/menu/MenuWithTopButton.tsx index 3d30fd0..61e6626 100644 --- a/src/components/menu/MenuWithTopButton.tsx +++ b/src/components/menu/MenuWithTopButton.tsx @@ -31,74 +31,78 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) { const list = menuItem.map((item, index) => ( // 创建项目下三个选项 -
  • { - - props.handleListItem(e, index, item); - setMenuActive(item.id) - // console.log(item.id); +
  • { - // const goHome = item.id == 'ALL' || item.id == 'PROCESSING' || item.id == 'COMPLETE' - // if (props.button.name == '项目') { - if (props.button.name == '项目') { + props.handleListItem(e, index, item); + setMenuActive(item.id) + // console.log(item.id); - navugate('/home', { - state: { - keyword: props.keywords, - type: props.type, - chargeAdditionals: props.chargeAdditionals, - tagDataId: props.tagDataId, - authorId: props.authorId, - payStatus: props.payStatus - } - }) - } - if (item.id == 'REFUN') { - // props.disableBelongpeople() - navugate('/refun', { - state: { - keywords: props.refunKeywords, - applyStatus: props.applyStatus, - authorId: props.authorId - } - }) - } - if (item.id == 'CORRECTION') { - // props.disableBelongpeople() - navugate('/correction', { - state: { - keywords: props.correctionKeywords, - correctionNumType: props.correctionNumType, - correctionType: props.correctionType, - applyStatus: props.correctionApplyStatus, - authorId: props.authorId, - tagCor: props.tagCor, - } - }) - } - if (item.id == 'CONTRACT') { - // props.disableBelongpeople() - navugate('/contract', { - state: { - // keywords: props.correctionKeywords, - // correctionNumType:props.correctionNumType, - // correctionType:props.correctionType, - // applyStatus: props.correctionApplyStatus, - // authorId: props.authorId - } - }) - } - if (item.id == 'REPLACENAME') { - // props.disableBelongpeople() - navugate('/replace', { - - }) - } + // const goHome = item.id == 'ALL' || item.id == 'PROCESSING' || item.id == 'COMPLETE' + // if (props.button.name == '项目') { + if (props.button.name == '项目') { - }}> + navugate('/home', { + state: { + keyword: props.keywords, + type: props.type, + chargeAdditionals: props.chargeAdditionals, + tagDataId: props.tagDataId, + authorId: props.authorId, + payStatus: props.payStatus + } + }) + } + if (item.id == 'REFUN') { + // props.disableBelongpeople() + navugate('/refun', { + state: { + keywords: props.refunKeywords, + applyStatus: props.applyStatus, + authorId: props.authorId + } + }) + } + if (item.id == 'CORRECTION') { + // props.disableBelongpeople() + navugate('/correction', { + state: { + keywords: props.correctionKeywords, + correctionNumType: props.correctionNumType, + correctionType: props.correctionType, + applyStatus: props.correctionApplyStatus, + authorId: props.authorId, + tagCor: props.tagCor, + } + }) + } + if (item.id == 'CONTRACT') { + // props.disableBelongpeople() + navugate('/contract', { + state: { + // keywords: props.correctionKeywords, + // correctionNumType:props.correctionNumType, + // correctionType:props.correctionType, + // applyStatus: props.correctionApplyStatus, + // authorId: props.authorId + } + }) + } + if (item.id == 'REPLACENAME') { + // props.disableBelongpeople() + navugate('/replace', { + state: { + keywords: props.replaceKeyWords, + applyStatus: props.replaceStatus, + authorId: props.authorId + } + }) + } + + }}> {item.icon ? (加载失败) : <>} {item.name} @@ -108,7 +112,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) { return (
    {/* button 是三个黄色按钮 */}
    @@ -159,7 +163,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) { textAlign: 'center', lineHeight: '36px', borderRadius: '5px', - + }}> {/* */} @@ -167,7 +171,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
    创建
    + }} />创建
    {/*
    申请
    */} {/*
    申请
    */} diff --git a/src/interfaces/menu/IMenuWithTopButton.ts b/src/interfaces/menu/IMenuWithTopButton.ts index e9e5ad7..8e997db 100644 --- a/src/interfaces/menu/IMenuWithTopButton.ts +++ b/src/interfaces/menu/IMenuWithTopButton.ts @@ -59,4 +59,8 @@ export interface IMenuWithTopButton { tradingEndTime?: any, tradingStatus?: any, + + replaceKeyWords?: any, + replaceStatus?: any, + } \ No newline at end of file diff --git a/src/route/Correction/Correction.tsx b/src/route/Correction/Correction.tsx index 96ba272..655d5d0 100644 --- a/src/route/Correction/Correction.tsx +++ b/src/route/Correction/Correction.tsx @@ -883,7 +883,8 @@ export default function Correction() { useEffect(() => { // getData(1) - + // console.log(state); + getData(1) setPage(1) // console.log(tagCor); diff --git a/src/route/Replace/Replace.tsx b/src/route/Replace/Replace.tsx index 0b66007..4ca4376 100644 --- a/src/route/Replace/Replace.tsx +++ b/src/route/Replace/Replace.tsx @@ -234,7 +234,8 @@ export default function Replcae() { useEffect(() => { // getData(1) - + // console.log(state); + getData(1) setPage(1) // console.log(tagCor); diff --git a/src/route/TrademarkMall/TrademarkAiEdit.tsx b/src/route/TrademarkMall/TrademarkAiEdit.tsx index f768d09..344fe26 100644 --- a/src/route/TrademarkMall/TrademarkAiEdit.tsx +++ b/src/route/TrademarkMall/TrademarkAiEdit.tsx @@ -15,7 +15,7 @@ export default function TrademarkAiEdit() { return (
    - +
    - +
    - +
    - +
    - +
    diff --git a/src/route/TrademarkMall/components/EditOne/EditOne.tsx b/src/route/TrademarkMall/components/EditOne/EditOne.tsx index 8903bff..4855661 100644 --- a/src/route/TrademarkMall/components/EditOne/EditOne.tsx +++ b/src/route/TrademarkMall/components/EditOne/EditOne.tsx @@ -1,5 +1,5 @@ import { useState } from 'react' -import { Button, Radio, Form, Input, Upload, message, Image } from 'antd' +import { Button, Radio, Form, Input, Upload, message, Image, Spin } from 'antd' import './EditOne.css' import { uploadFileUrl, showImage } from '../../../../request/request' import { @@ -64,20 +64,25 @@ export default function EditOne(props: any) { // 自动生成的img const [generateImgId, setGenerateImgId] = useState('') const [imgList, setImgList] = useState([]) + // 上传商标文字图片 + const [textLodaing, setTextLodaing] = useState(false) const upImgHandleChange: UploadProps['onChange'] = (info) => { console.log(info.file.status); if (info.file.status === 'uploading') { // setFileList([]) + setTextLodaing(true) return; } if (info.file.status === 'done') { - + setTextLodaing(false) // const fileId = info.file.response.data.fileId; // // console.log(downloadUrl(fileId)); // const url = showImage(fileId, false); + console.log(info.file.response.data.fileId); + setImgList([ { uid: info.file.response.data.fileId, @@ -86,22 +91,24 @@ export default function EditOne(props: any) { url: showImage(info.file.response.data.fileId, false) } ]) + formA.setFieldsValue({ imgUrl: info.file.response.data.fileId }) return; } if (info.file.status === 'error') { + setTextLodaing(false) message.error(`上传失败`); return; } }; const onFinishA = (values: any) => { console.log(values); - props.setEditProcess(2); + // props.setEditProcess(2); } const onFinishB = (values: any) => { console.log(values); - props.setEditProcess(2); + // props.setEditProcess(2); } const onChange = (e: any) => { @@ -367,7 +374,7 @@ export default function EditOne(props: any) { color: 'black', resize: 'none' }} - value={generateType == '1' ? generateImgId : imgList[0]?.uid} + // value={generateType == '1' ? generateImgId : imgList[0]?.uid} placeholder="商标说明" > @@ -389,6 +396,7 @@ export default function EditOne(props: any) { }}> 暂无图片
    + {/* 自动生成图片 */}
    + {/* 手动上传图片 */}
    0 ? 'unset' : 'none', width: 200, height: 100, background: 'white', @@ -429,45 +438,97 @@ export default function EditOne(props: any) { fontSize: '20px', border: '1px dashed #d6d6d6', }}> - { - 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} - > -
    - 上传图片 -
    -
    +
    + +
    +
    { + setImgList([]) + formA.setFieldsValue({ imgUrl: '' }) + }} + >删除
    + +
    + + +
    + + { + 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} + > +
    + 上传图片 +
    +
    +