This commit is contained in:
lyp 2025-06-05 14:34:04 +08:00
parent 211759db49
commit 2f400d490f
11 changed files with 364 additions and 140 deletions

View File

@ -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

View File

@ -187,7 +187,7 @@ export default function OrderDetailModal(props: any) {
<Authorize authorizeInfo={authorizeInfo} ></Authorize>
</div>
<div style={{ display: activeKey == 'file' ? 'block' : 'none' }}>
<File user={props.user} orderId={props.orderId}></File>
<File user={props.user} upData={props.upData} orderId={props.orderId}></File>
</div>
{/* <div style={{ display: activeKey == 'result' ? 'block' : 'none' }}>
<Result ></Result>

View File

@ -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<any>({})
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) {
)}
/>
</Table>
<Modal title={'补充'}
<Modal title={disabled?'查看':'补充'}
destroyOnClose={true}
open={isModalVisible}
footer={null} // 将 footer 设置为 null 来隐藏自带按钮
@ -354,7 +443,7 @@ export default function File(props: any) {
onFinish={(value) => {
// 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='请输入需要补充内容'
></TextArea>
</Form.Item>
@ -435,15 +527,38 @@ export default function File(props: any) {
>
<Upload
disabled={disabled}
name="file"
action={uploadFileUrl()}
defaultFileList={upFileArray}
fileList={upFileArray}
onChange={(info) => {
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
}}>
<Button onClick={() => {
setIsModalVisible(false)
form.resetFields();
}}></Button>
<Button type="primary" htmlType="submit" ></Button>
<div style={{
display: disabled ? 'none' : 'unset',
}}>
<Button onClick={() => {
setIsModalVisible(false)
form.resetFields();
}}></Button>
<Button type="primary" htmlType="submit" style={{ marginLeft: 10 }} ></Button>
</div>
</div>
</Form.Item>

View File

@ -31,74 +31,78 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
const list = menuItem.map((item, index) => (
// 创建项目下三个选项
<li className={item.active ? 'active' : ''}
style={{
color: item.active? '' : 'var( --color-menuoption)'
}}
key={item.id} onClick={(e) => {
props.handleListItem(e, index, item);
setMenuActive(item.id)
// console.log(item.id);
<li className={item.active ? 'active' : ''}
style={{
color: item.active ? '' : 'var( --color-menuoption)'
}}
key={item.id} onClick={(e) => {
// 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 ? (<img src={item.icon} className="menu-icon" alt="加载失败" />) : <></>}
<span className="menu-name">{item.name}</span>
@ -108,7 +112,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
return (
<div className="menu-with-top-button" style={{
borderBottom: THEME=='fzkj'?'1px solid var(--color-menuborder)':'',
borderBottom: THEME == 'fzkj' ? '1px solid var(--color-menuborder)' : '',
}}>
{/* button 是三个黄色按钮 */}
<div className='top'>
@ -159,7 +163,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
textAlign: 'center',
lineHeight: '36px',
borderRadius: '5px',
}}>
{/* <img src={newImg} alt="" /> */}
@ -167,7 +171,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
<div style={{ display: props.button.name == '项目' ? 'block' : 'none', fontSize: 18 }}><PlusOutlined style={{
fontSize: 16,
marginRight: 5,
}}/></div>
}} /></div>
</div>
{/* <div style={{ display: props.button.name == '退款' ? 'block' : 'none' }}>申请</div> */}
{/* <div style={{ display: props.button.name == '补正' ? 'block' : 'none' }}>申请</div> */}

View File

@ -59,4 +59,8 @@ export interface IMenuWithTopButton {
tradingEndTime?: any,
tradingStatus?: any,
replaceKeyWords?: any,
replaceStatus?: any,
}

View File

@ -883,7 +883,8 @@ export default function Correction() {
useEffect(() => {
// getData(1)
// console.log(state);
getData(1)
setPage(1)
// console.log(tagCor);

View File

@ -234,7 +234,8 @@ export default function Replcae() {
useEffect(() => {
// getData(1)
// console.log(state);
getData(1)
setPage(1)
// console.log(tagCor);

View File

@ -15,7 +15,7 @@ export default function TrademarkAiEdit() {
return (
<div className='trademarkAiBox' style={{ height: `${height}px`, overflow: 'auto' }}>
<div className='editProcessBox' style={{
marginBottom:20
marginBottom: 20
}}>
<div className='editProcess' >
<div className='editProcessNum'
@ -112,34 +112,45 @@ export default function TrademarkAiEdit() {
display: editProcess == 1 ? 'block' : 'none'
}}>
<EditOne
key={editProcess}
setEditProcess={setEditProcess}
></EditOne>
</div>
<div style={{
display: editProcess == 2 ? 'block' : 'none'
}}>
<EditTwo setEditProcess={setEditProcess}></EditTwo>
<EditTwo
key={editProcess}
setEditProcess={setEditProcess}></EditTwo>
</div>
<div style={{
display: editProcess == 3 ? 'block' : 'none'
}}>
<EditThree setEditProcess={setEditProcess}></EditThree>
<EditThree
key={editProcess}
setEditProcess={setEditProcess}></EditThree>
</div>
<div style={{
display: editProcess == 4 ? 'block' : 'none'
}}>
<EditFour setEditProcess={setEditProcess}></EditFour>
<EditFour
key={editProcess}
setEditProcess={setEditProcess}></EditFour>
</div>
<div style={{
display: editProcess == 5 ? 'block' : 'none'
}}>
<EditFive setEditProcess={setEditProcess}></EditFive>
<EditFive
key={editProcess}
setEditProcess={setEditProcess}></EditFive>
</div>
<div style={{
display: editProcess == 6 ? 'block' : 'none'
}}>
<EditSix setEditProcess={setEditProcess}></EditSix>
<EditSix
key={editProcess}
setEditProcess={setEditProcess}></EditSix>
</div>
</div>
</div>

View File

@ -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<any>('')
const [imgList, setImgList] = useState<any>([])
// 上传商标文字图片
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="商标说明"
>
</TextArea>
@ -389,6 +396,7 @@ export default function EditOne(props: any) {
}}>
</div>
{/* 自动生成图片 */}
<div style={{
display: generateType == '1' && generateImgId != '' ? 'unset' : 'none',
width: 200,
@ -415,8 +423,9 @@ export default function EditOne(props: any) {
<Image src={generateImgId} height={100} style={{ maxWidth: 200, height: '100%' }} ></Image>
</div>
</div>
{/* 手动上传图片 */}
<div style={{
display: generateType == '2' ? 'unset' : 'none',
display: generateType == '2' && imgList.length > 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',
}}>
<Upload
name="file"
maxCount={1}
action={uploadFileUrl()}
beforeUpload={(file) => {
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}
>
<div style={{
width: 200,
height: 100,
background: 'white',
color: 'black',
lineHeight: '100px',
textAlign: 'center',
fontSize: '20px',
border: '1px dashed #d6d6d6',
}}>
</div>
</Upload>
<div style={{
width: '100%',
height: '100%',
// background:'pink',
overflow: 'hidden',
display: 'flex',
justifyContent: 'center',
alignItems: 'flex-start',
}}>
<Image src={imgList[0]?.url} height={100} style={{ maxWidth: 200, height: '100%' }} ></Image>
</div>
<div style={{
position: 'absolute',
bottom: 0,
right: -50,
fontSize: '16px',
lineHeight:'16px',
// background:'pink',
cursor:'pointer',
padding:'5px',
color:'red'
}}
onClick={()=>{
setImgList([])
formA.setFieldsValue({ imgUrl: '' })
}}
></div>
</div>
<div style={{
display: generateType == '2' && imgList.length <= 0 ? 'unset' : 'none',
width: 200,
height: 100,
background: 'white',
color: 'black',
position: 'absolute',
top: 0,
left: 0,
lineHeight: '100px',
textAlign: 'center',
fontSize: '20px',
border: '1px dashed #d6d6d6',
}}>
<Spin tip="正在处理,请稍后..." size="small" spinning={textLodaing}>
<Upload
name="file"
maxCount={1}
action={uploadFileUrl()}
beforeUpload={(file) => {
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}
>
<div style={{
width: 200,
height: 100,
background: 'white',
color: 'black',
lineHeight: '100px',
textAlign: 'center',
fontSize: '20px',
border: '1px dashed #d6d6d6',
}}>
</div>
</Upload>
</Spin>
</div>
</div>
<Button type="primary"
onClick={() => {
setGenerateImgId('http://gips2.baidu.com/it/u=1674525583,3037683813&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024')
// 给FormA表单的imgUrl赋值
formA.setFieldsValue({
imgUrl: 'http://gips2.baidu.com/it/u=1674525583,3037683813&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024'
})
}}
style={{
marginTop: '70px',

View File

@ -504,7 +504,9 @@ export default function TradingGoods() {
justifyContent: 'center',
height: `${height}px`,
}}>
<OrderDetail orderId={orderId} user={'buy'}></OrderDetail>
<OrderDetail orderId={orderId} user={'buy'} upData={() => {
getDataList(page)
}}></OrderDetail>
</Modal>
<Modal
title="补充资料"

View File

@ -2006,6 +2006,10 @@ export default function Index() {
correctionType={correctionType ? correctionType : ''}
correctionApplyStatus={correctionApplyStatus ? correctionApplyStatus : ''}
tagCor={tagCor ? tagCor : ''}
// 换名
replaceKeyWords={replaceKeyWords? replaceKeyWords : ''}
replaceStatus={replaceStatus? replaceStatus : ''}
// enableBelongpeople = {()=>{setClickBelongpeople(true)}}
/>
@ -2145,6 +2149,7 @@ export default function Index() {
button={sellMenu.button}
list={sellMenu.list}
handleListItem={sellMenu.handleListItem}
sellKeywords={sellKeywords}
sellBelongType={sellBelongType}
sellDate={sellDate}
@ -2155,6 +2160,22 @@ export default function Index() {
sellEndTime={sellEndTime}
sellOrderStatus={sellOrderStatus}
sellOrderKeywords={sellOrderKeywords}
copyrightKeywords={copyrightKeywords}
minPrice={minPrice}
maxPrice={maxPrice}
sort={sort}
copyrightDate={copyrightDate}
copyrightLanguage={copyrightLanguage}
copyrightType={copyrightType}
tradingKeywords={tradingKeywords}
tradingStartTime={tradingStartTime}
tradingEndTime={tradingEndTime}
tradingStatus={tradingStatus}
/>
) : (
<></>