diff --git a/.env.dev b/.env.dev index 2799469..e71d70a 100644 --- a/.env.dev +++ b/.env.dev @@ -3,10 +3,23 @@ VITE_BASE_URL=http://${VITE_HOST} VITE_COPY_BASE_URL=${VITE_BASE_URL}:7025 VITE_OPERATOR_BASE_URL=${VITE_BASE_URL}:8091 VITE_OPERATOR_PLUGIN_BASE_URL=${VITE_BASE_URL}:8099 -VITE_AI_SHOP_BASE_URL=http://192.168.0.115:8081 +VITE_AI_SHOP_BASE_URL=http://192.168.0.15:8081 VITE_WEBSOCKET_BASE_URL=ws://${VITE_HOST}:7025/copyright # 18634604067 -# VITE_USERID=80d3365e-0597-4988-979e-18ef1c3ec671 -VITE_USERID=e3e40f95-7a3f-4b53-a1a0-51dd4e881d74 +VITE_USERID=80d3365e-0597-4988-979e-18ef1c3ec671 +# VITE_USERID=e3e40f95-7a3f-4b53-a1a0-51dd4e881d74 # VITE_CURRENT_THEME=fzkj VITE_CURRENT_THEME=mzw +# VITE_HOST=121.36.71.250:58038 +# VITE_BASE_URL=http://${VITE_HOST} +# VITE_COPY_BASE_URL=${VITE_BASE_URL} +# VITE_OPERATOR_BASE_URL=${VITE_BASE_URL} +# VITE_OPERATOR_PLUGIN_BASE_URL=${VITE_BASE_URL} +# VITE_AI_SHOP_BASE_URL=${VITE_BASE_URL} +# # VITE_WEBSOCKET_BASE_URL=ws://${VITE_HOST}:7025/copyright +# VITE_WEBSOCKET_BASE_URL=ws://${VITE_HOST}/copyright +# # 18634604067 +# VITE_USERID=80d3365e-0597-4988-979e-18ef1c3ec671   +# # VITE_USERID=e3e40f95-7a3f-4b53-a1a0-51dd4e881d74   +# # VITE_CURRENT_THEME=fzkj +# VITE_CURRENT_THEME=mzw \ No newline at end of file diff --git a/src/components/ReplaceModal/ReplaceModal.tsx b/src/components/ReplaceModal/ReplaceModal.tsx new file mode 100644 index 0000000..923ccc3 --- /dev/null +++ b/src/components/ReplaceModal/ReplaceModal.tsx @@ -0,0 +1,464 @@ +// import React from 'react' +import { useEffect, useState } from 'react' +// import './RefunModal.css' +import { + Form, + // Select, + Button, Upload, message, Input, Modal, Table, Empty +} from 'antd'; +import type { TableColumnsType } from 'antd'; +const { Search } = Input; +import { UploadOutlined } from '@ant-design/icons'; +import { + // DevUserId + get, post, uploadFileUrl +} from "../../util/AjaxUtils.ts"; +// import { getMenuActive } from '../../util/cache.ts' +import { useDispatch } from 'react-redux' +const { TextArea } = Input; +interface DataType { + // key: React.Key; + projName: string; + projContext: string; + gmtCreate: string; + projId: string +} +export default function ReplaceModal(props: any) { + const token = sessionStorage.getItem('token') + const columns: TableColumnsType = [ + { + title: '序号', + dataIndex: 'index', + align: 'center', + width: 80, + render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号,从1开始 + }, + { + title: '项目名称', + dataIndex: 'projName', + align: 'center', + + render: (text: string) => <>{text}, + }, + // { + // title: '已通过补正次数', + // dataIndex: 'approvedCount', + // align: 'center', + // width: 130, + // render: (text) => <>{text}, // 显示序号,从1开始 + // }, + { + title: '所属者名称', + dataIndex: 'applyContactName', + align: 'center', + + render: (text: string) => <>{text}, + }, + { + title: '编号', + dataIndex: 'projContext', + align: 'center', + + + }, + { + title: '创建时间', + dataIndex: 'gmtCreate', + align: 'center', + + }, + ]; + + const [messageApi, contextHolder] = message.useMessage(); + // 选择项目得临时name + const [newprojName, setnewprojName] = useState('') + // 选择项目得name + const [projName, setProjName] = useState('') + // 选择得项目临时id + const [newprojId, setnewProjId] = useState('') + // 选择 项目的id + const [projId, setProjId] = useState('') + //默认选择得项目 + const [selectedRowKeys, setselectedRowKeys] = useState([]) + // 分页 + const [page, setPage] = useState(1) + const [total, setTotal] = useState(0) + // 搜索关键字 + const [keywords, setKeywords] = useState('') + // 选择项目弹窗 + const [projModal, setProjModal] = useState(false) + // 上传附件 + const [correctionArray, setCorrectionArray] = useState([]); + // const [selectedReason, setSelectedReason] = useState(''); //选择原因 + + // const handleReasonChange = (value: any) => { + // setSelectedReason(value); + // }; + // 获取当前选择类型 + // const type = getMenuActive() == 'Correction-PENDING' ? 'PENDING' : getMenuActive() == 'Correction-APPROVED' ? 'APPROVED' : getMenuActive() == 'Correction-REJECTED' ? 'REJECTED' : getMenuActive() == 'Correction-CANCELED' ? 'CANCELED' : '' + const dispath = useDispatch() + const [correctionDataArray, setCorrectionDataArray] = useState([]) //未补正项目 + const [isDisabled, setIsDisabled] = useState(false) //提交按钮是否禁用 + const [form] = Form.useForm(); + // 关键字搜索 + const handleSearch = (value: string) => { + setKeywords(value) + } + const handleChange = (e: any) => { + if (e.target.value == '') { + setKeywords('') + } + } + // 提交表单 + const onFinish = (values: any) => { + dispath({ + type: 'newReplace', + val: true + }) + // console.log('Form values:', values); + + // console.log(refunArray); + + // console.log(values); + post({ + messageApi, + url: `/api/proj/rename/apply/save`, + body: { + projId: projId, + renameReason: values.other, + renameVoucher: correctionArray.join(','), + // correctionType: values.correctionType + }, + onBefore() { + setIsDisabled(true) + }, + onSuccess() { + messageApi.success('提交成功') + setIsDisabled(true) + setTimeout(() => { + props.closeModal() + + }, 500) + + getData() + + + + }, + onFinally() { + setIsDisabled(false) + } + }) + }; + const getData = () => { + get({ + messageApi, + url: `/api/proj/rename/apply/listpage/self`, + config: { + params: { + page: 1, + rows: 20, + applyStatus: '' + } + }, + onSuccess(data: any) { + // console.log('更新'); + + // dispath({ + // type: 'upCorrectionArray', + // val: data.data.rows + // }) + // dispath({ + // type: 'upCorrectionTotal', + // val: data.data.total + // }) + dispath({ + type: 'upReplaceArray', + val: data.data.rows + }) + dispath({ + type: 'upReplaceTotal', + val: data.data.total + }) + + + } + }) + } + // 获取未补正项目 + const getCorrectionData = () => { + get({ + messageApi, + url: `/api/proj/rename/apply/listpage-proj-unapply/self`, + config: { + params: { + page: page, + rows: 20, + keywords + } + }, + onBefore() { + + + }, + onSuccess(data: any) { + // console.log(data.data.rows); + // const newArray = (data.data).map((item: { projId: any; projName: any; }) => ({ + // value: item.projId, + // label: item.projName + // })) + setCorrectionDataArray(data.data.rows) + setTotal(data.data.total) + + }, + onFinally() { + + + }, + }) + } + + useEffect(() => { + getCorrectionData() + + + }, [page, keywords]) + + return ( +
+ {contextHolder} +
+
+
+ 换名软著* +
+
+ + + + + + +
{ + setProjModal(true) + setKeywords('') + setPage(1) + getCorrectionData() + }}> + 选择 +
+
+
+ +
+
+ 换名原因* +
+ + +
+
+
附件
+ {fileList.length > 0 ? ( + //
材料列表
+
+ { + fileList.map((item: any) => { + return ( +
{ + + window.open(showImage(item.fileId, false)) + + }} + > + {item.fileName} +
+ ) + }) + } +
+ + ) : ( +
+ 无 +
+ )} +
+
+
+
在下面填写您补充的内容
+
+ { + + // 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(','); + // console.log('提取的 uid 字符串:', uidString); + // // 你可以在这里继续处理 uid 字符串,比如发送请求等 + + // } + // const uids = value.upFile ? (value.upFile.fileList.map((file: any) => file.uid)).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={() => { + messageApi.open({ + type: 'error', + content: '内容和附件至少需要填写或上传一项', + }) + }} + autoComplete="off" + > +
+
内容
+ validateContentOrFile(rule, value, callback, form), + }, + + ]} + > + + + +
+
+
附件
+
+ validateContentOrFile(rule, value, callback, form), + }, + ]} + > + + { + setUpFileArray(info.fileList) + // console.log(info.fileList); + + }} + + headers={{ 'Auth': `Bearer ${token}` }} + + > + + + + + +
+ +
+ + +
+ + +
+
+ + +
+
+ + + ) +} diff --git a/src/route/Contract/Contract.tsx b/src/route/Contract/Contract.tsx index 2561da9..00e9b26 100644 --- a/src/route/Contract/Contract.tsx +++ b/src/route/Contract/Contract.tsx @@ -125,7 +125,8 @@ export default function CONTRACT() {
{/* 表格 */}
0 ? 'block' : 'none', padding: 10 }}> diff --git a/src/route/Replace/Replace.tsx b/src/route/Replace/Replace.tsx new file mode 100644 index 0000000..0b66007 --- /dev/null +++ b/src/route/Replace/Replace.tsx @@ -0,0 +1,645 @@ +// import './Correction.css'; +import { useState, useEffect, } from 'react'; +import { + // Table, + Pagination, + Modal, + // Tag, + message, Spin, + Empty, + Dropdown, + // Button +} from 'antd'; +// import { +// // MenuFoldOutlined, +// ClearOutlined +// } from '@ant-design/icons'; +import { useSelector, useDispatch } from 'react-redux' +import { + get, + put, + downloadUrl, + // Axios, + // post +} from '../../util/AjaxUtils' +// import type { TableProps } from 'antd'; +import { useLocation } from 'react-router-dom'; +// import { getMenuActive } from '../../util/cache' +// import { useNavigate } from "react-router-dom"; +// interface DataType { +// projName: string; +// type: string; //类型 +// correctionType: string; //补正种类 +// correctionReason: string; +// gmtCreate: string; //补正时间 +// gmtReview: string;//审核时间 +// reviewReason: string;//审核意见 +// projId: string; +// applyStatus: string;//审核状态 +// correctionVoucherFileKVs: any //补正凭证 +// projCorrectionApplyId: string +// authorName: string; +// } +import revokeImg from '../../static/revoke.png' +// import { useLocation } from 'react-router-dom' +import logoImg from '../../static/projBox/logo.png' +import reason from '../../static/projBox/reson.png' +import green from '../../static/projBox/green.png' +import red from '../../static/projBox/red.png' +import blue from '../../static/projBox/blue.png' +import black from '../../static/projBox/black.png' +import numbg from '@theme/img/projBox/num.png' +import titleBg from '@theme/img/projBox/background.png' +import timeImg from '@theme/img/projBox/timeback.png' +import { useNavigate } from "react-router-dom"; +export default function Replcae() { + // 标签变量 + const nav = useNavigate(); + const height = window.innerHeight - 180; + const [messageApi, contextHolder] = message.useMessage(); + const { state } = useLocation() + const [isLoading, setIsLoading] = useState(false) + + const [revokeModal, setRevokeModal] = useState(false) //撤销弹窗 + + const keyWords = state ? state.keywords : '' + const applyStatus = state ? state.applyStatus : '' + const tagCor = state ? state.tagCor : '' + const authorId = state ? state.authorId : '' + const correctionNumType = state ? state.correctionNumType : '' + const correctionType = state ? state.correctionType : '' + + const [page, setPage] = useState(1) // 分页 + + + const dispath = useDispatch() + const redxuState: any = useSelector(state => state) + const replaceArray = redxuState.replaceArray + // const [tagIdArray,setTagIdArray] = useState([]) + const total = redxuState.replaceTotal + const newReplace = redxuState.newReplace + const [projRenameApplyId, setprojRenameApplyId] = useState('') //要撤销的id + + // const [tagCorArray, setTagCorArray] = useState([]) + // 获取补正标签 + // const getCorTag = () => { + // get({ + // messageApi, + // url: `/api/proj/correction/apply/tag/list-tag`, + // onBefore() { + + // }, + // onSuccess(data: any) { + // // console.log('标签信息', data); + // const newarrty: any = (data.data).map((item: any) => ({ + // value: item.key, + // label: item.value + // })); + // // console.log('标签信息', newarrty); + + // setTagCorArray(newarrty) + + // }, + // onFinally() { + + // } + // }) + // } + const getData = (page: number) => { + const [part1, part2] = tagCor ? tagCor.split(':') : ['', '']; + get({ + messageApi, + url: `/api/proj/rename/apply/listpage/self`, + // url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`, + config: { + params: { + page: page, + rows: 20, + projName: keyWords, + applyStatus: applyStatus, + // type: correctionNumType, + // correctionType: correctionType, + authorId: authorId, + tagDataId: part1, + tagNot: part2 == 'TAG_NOT' ? true : '', + } + }, + onBefore() { + setIsLoading(true) + }, + onSuccess(data: any) { + // console.log('呵呵', data.data.rows); + // setData(data.data.rows) + // console.log(data.data.rows); + + dispath({ + type: 'upReplaceArray', + val: data.data.rows + }) + dispath({ + type: 'upReplaceTotal', + val: data.data.total + }) + // setTotal(data.data.total) + }, + onFinally() { + setIsLoading(false) + }, + }) + } + // // 更新标签状态 + // const upTag = (dataId: string, projCorrectionApplyId: string, projId: string) => { + // post({ + // messageApi, + // url: `/api/proj/correction/apply/tag/save-or-delete`, + // body: { + // dataId, + // projCorrectionApplyId, + // projId + // }, + // onBefore() { + + // }, + // onSuccess(data) { + // // console.log(data.data.data); + // // props.upData + // // props.updata() + // // setTagStatus(data.data.data) + // // 根据返回的状态更新 tagIdArray + // if (data.data.data === 'SAVE') { + // // setTagIdArray((prevArray: any) => [...prevArray, dataId]); + // } else if (data.data.data === 'DELETE') { + // // setTagIdArray((prevArray: any[]) => prevArray.filter(id => id !== dataId)); + // } + + // }, + // onFinally() { + + // } + // }) + // } + // 撤销补正 + const projRefund = () => { + put({ + messageApi, + url: `/api/proj/rename/apply/cancel/self/${projRenameApplyId}`, + + onBefore() { + + }, + onSuccess() { + setRevokeModal(false) + messageApi.success('已撤销'); + get({ + messageApi, + url: `/api/proj/rename/apply/listpage/self`, + // url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`, + config: { + params: { + page: page, + rows: 20, + projName: keyWords, + applyStatus: applyStatus, + // type: correctionNumType, + // correctionType: correctionType, + authorId: authorId + } + }, + onSuccess(data: any) { + // console.log(data.data.rows); + // setData(data.data.rows) + + // setTotal(data.data.total) + if (data.data.rows.length == 0 && page > 1) { + getData(page - 1) + } else { + dispath({ + type: 'upReplaceArray', + val: data.data.rows + }) + dispath({ + type: 'upReplaceTotal', + val: data.data.total + }) + } + } + }) + }, + onFinally() { + // setIsProjIntroductionLoading(false) + // renderData() + } + }) + } + + useEffect(() => { + // getData(1) + + getData(1) + setPage(1) + // console.log(tagCor); + // console.log('嘻嘻',correctionArray); + + + }, [keyWords, applyStatus, authorId, correctionNumType, correctionType, tagCor]) + useEffect(() => { + // 获取id为refun的元素 + const refun: any = document.getElementById('refun'); + // 当更换页码时候滚动到最上面 + refun.scrollTop = 0; + + }, [replaceArray]) + useEffect(() => { + // getData(1) + if (newReplace) { + setPage(1) + getData(1) + dispath({ + type: 'newCorrection', + val: false + }) + } + + + }, [newReplace]) + useEffect(() => { + // getCorTag() + // dispath({ + // type: 'upCorrectionArray', + // val: updatedArray + // }); + // getData(1) + }, []) + + return ( +
+ {contextHolder} +
+ + {replaceArray.length == 0 ? +
+ +
+ : <> + + {replaceArray.map((item: any, index: any) => { + // const downCode = [ + // { + // key: 'downword', + // label: ( + //
{ + + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${item.projId}`) + // }} + // > + // Word + //
+ // ), + // }, + // { + // key: 'downpdf', + // label: ( + //
{ + + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/pdf/${item.projId}`) + // }} + // > + // PDF + //
+ // ), + // }, + + // ] + // const downManual = [ + // { + // key: 'downword', + // label: ( + //
{ + + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${item.projId}`) + + + // }} + // > + // Word + //
+ // ), + // }, + // { + // key: 'downpdf', + // label: ( + //
{ + + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/pdf/${item.projId}`) + // }} + // > + // PDF + //
+ // ), + // }, + + // ] + const voucherItems = item.renameVoucherFileKVs.map((item: any) => ({ + key: item.key, + label: ( +
{ + window.open(downloadUrl(item.key, false), '_blank') + }} + style={{ maxWidth: 200, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }} + title={item.value} + > + {item.value} +
+ ), + })); + return ( +
+ +
+
申请时间 : {item.gmtCreate}
+
+ +
+
{ + nav(`/proj-edit/${item.projId}`); + sessionStorage.setItem('projName', item.projName); + sessionStorage.setItem('projStatus', item.generate.generateStatus == 'SUCCESS' ? '查看' : '编辑'); + }} title={item.projName}> + {item.projName} +
+ + + {/*
+ { + tagCorArray.map((tagitem: any) => { + + const [part1, part2] = tagitem.value.split(':'); + if (part2 !== 'TAG_NOT') { + return ( +
{ + + + post({ + messageApi, + url: `/api/proj/rename/apply/tag/save-or-delete`, + body: { + dataId: part1, + projRenameApplyId: item.projRenameApplyId, + projId: item.projId + }, + onBefore() { + + }, + onSuccess(data) { + + + if (data.data.data === 'SAVE') { + + e.target.style.background = 'var(--color-tagactive)'; + e.target.style.color = '#ffffff'; + e.target.style.border = '1px solid var(--color-tagactive)'; + + + } else if (data.data.data === 'DELETE') { + + e.target.style.background = ''; + e.target.style.color = '#5a5a5a'; + e.target.style.border = '1px solid #5a5a5a'; + + } + + }, + onFinally() { + + } + }) + } + } + > + {tagitem.label} +
+ ) + } + + }) + } +
*/} + + + +
+
+
+
+ {(page - 1) * 20 + index + 1} +
+
+ +
+
+
+ 产权所属者 : {item.authorName ? item.authorName : '无'} +
+
+
换名凭证
+ +
(查看) + + +
+
+
+
+ + +
+ +
+
+ +
换名原因
+
+
+ {item.renameReason} +
+
+ +
+
+ + +
{item.applyStatus == 'PENDING' ? '待审核' : item.applyStatus == 'CANCELED' ? '已撤销' : item.applyStatus == 'APPROVED' ? '已通过' : item.applyStatus == 'REJECTED' ? '未通过' : '未知状态'}
+
{item.gmtReview}
+
+
+ 审核意见 : {item.reviewReason} +
+
+ +
+ +
+
+ +
{ + nav( + `/proj-new/MATERIAL?pkg=&videoDemo=`, + { + state: { + type: 'replace', + projId: item.projId, + } + } + ); + }} + > + 换名 +
+
{ + setRevokeModal(true) + setprojRenameApplyId(item.projRenameApplyId) + }} + style={{ display: item.applyStatus == 'PENDING' ? 'block' : 'none' }} + >撤销换名
+
+ 项目已关闭 +
+ {/*
{ + setRevokeModal(true) + setprojCorrectionApplyId(item.projCorrectionApplyId) + }} + style={{ display: item.applyStatus == 'PENDING' ? 'block' : 'none' }} + >撤销补正
+
+ 项目已关闭 +
+
+
+ +
+ + 下载代码 + +
+
+ + 下载手册 + +
+
+
*/} + + +
+ + + +
+
+ ) + })} + } +
+ + +
+
+ { + setPage(page) + getData(page) + + }} /> +
+ { + setRevokeModal(false) + projRefund() + }} + onCancel={() => { + setRevokeModal(false) + }} + okButtonProps={{ style: { background: 'red', color: 'white' } }} + style={{ + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + height: `${height}px`, + }}> +
+ +
+ 是否撤销该条换名申请 +
+ +
+
+
+ ) +} diff --git a/src/route/TrademarkMall/TrademarkExpertEdit.tsx b/src/route/TrademarkMall/TrademarkExpertEdit.tsx new file mode 100644 index 0000000..1ccf5d1 --- /dev/null +++ b/src/route/TrademarkMall/TrademarkExpertEdit.tsx @@ -0,0 +1,10 @@ +import React from 'react' +import './trademark-edit.css' +export default function TrademarkExpertEdit() { + const height = window.innerHeight - 180; + return ( +
+ +
+ ) +} diff --git a/src/route/TrademarkMall/trademark-edit.css b/src/route/TrademarkMall/trademark-edit.css new file mode 100644 index 0000000..a64b9da --- /dev/null +++ b/src/route/TrademarkMall/trademark-edit.css @@ -0,0 +1,8 @@ +.trademarkExpertBox { + margin-top: 18px; + background-color: rgb(255, 255, 255); + padding: 0px 19px 0px 19px; + box-sizing: border-box; + padding: 30px 45px 0 45px; + box-sizing: border-box; +} \ No newline at end of file diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index b08764f..322637b 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -1,8 +1,9 @@ import './index.css'; // import { MouseEvent, Reducer, useEffect, useReducer, useState, useContext } from "react"; -import { MouseEvent, Reducer, useEffect, useReducer, useState } from "react"; +import { MouseEvent, Reducer, useEffect, useReducer, useState, useContext } from "react"; import { useSelector, useDispatch } from 'react-redux' import { useNavigate, useSearchParams, Outlet } from "react-router-dom"; +import { GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts"; import { Modal, // Row, @@ -16,6 +17,7 @@ import { IMenuListItem, IMenuWithTopButton } from "../../interfaces/menu/IMenuWi import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx"; import RefunModal from '../../components/RefunModal/RefunModal.tsx' import CorrectionModal from '../../components/CorrectionModal/CorrectionModal.tsx' +import ReplaceModal from '../../components/ReplaceModal/ReplaceModal.tsx' import ContractModal from '../../components/ContractModal/ContractModal.tsx' // import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx' // import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx"; @@ -53,10 +55,14 @@ import { // downloadUrl, post, getCouponUrl } from '../../util/AjaxUtils.ts' -// import { getLanguageList, getSoftTypeList } from '../../request/api' -import { setMenuActive, +import { + // getLanguageList, getSoftTypeList + appGoodsList, buyAppGoods, appOrderList +} from '../../request/api' +import { + setMenuActive, // getMenuActive - } from '../../util/cache.ts' +} from '../../util/cache.ts' import gpsImg from '@theme/img/right/gps.png' import backImg from '@theme/img/right/back.png' // import { Link } from "react-router-dom"; @@ -94,7 +100,7 @@ import firImg from '../../static/fir.png' import noFirImg from '../../static/noFir.png' export default function Index() { - + const globalDispatchContext = useContext(GlobalDispatchContext); // const height = window.innerHeight - 180; const columns: TableColumnsType = [ { @@ -462,6 +468,8 @@ export default function Index() { { id: 'REFUN', name: '退款项目' }, // correction { id: 'CORRECTION', name: '补正项目' }, + { id: 'REPLACENAME', name: '换名项目' }, + { id: 'CONTRACT', name: '合同下载' }, ], @@ -707,7 +715,7 @@ export default function Index() { const [sellBelongType, setSellBelongType] = useState(null) // 所属人类型 // 更改所属人类型 const sellBelongTypeChange = (value: string) => { - console.log(`selected ${value}`); + // console.log(`selected ${value}`); setSellBelongType(value) } const [sellDate, setSellDate] = useState(null) // 日期 @@ -880,7 +888,7 @@ export default function Index() { const copyrightKeyWordshandleSearch = () => { setCopyrightKeywords(copyrightNewKeywords) } - const [specialPrice,setSpecialPrice] = useState(false) //商品特价标识 + const [specialPrice, setSpecialPrice] = useState(false) //商品特价标识 const copyrightInit = () => { setMinPrice(null) setMaxPrice(null) @@ -906,11 +914,11 @@ export default function Index() { copyrightLanguage: copyrightLanguage, copyrightType: copyrightType, // 新增特价标识 - goodsFlag:specialPrice?'特价':'' + goodsFlag: specialPrice ? '特价' : '' } }) } - }, [copyrightKeywords, minPrice, maxPrice, sort, copyrightDate, copyrightLanguage, copyrightType,specialPrice]) + }, [copyrightKeywords, minPrice, maxPrice, sort, copyrightDate, copyrightLanguage, copyrightType, specialPrice]) // ---------------------------------------------------------------------------------------------- @@ -971,13 +979,153 @@ export default function Index() { // APP电子软著框是否显示---------------------------------------------------------------------------------------- const [appSearchBox, setAppSearchBox] = useState(false) + const [appKeyWords, setAppKeyWords] = useState('') // 电子软著搜索关键字 + const [showAppkeyWords, setShowAppkeyWords] = useState('') // 电子软著搜索关键字显示 const [appModal, setAppModal] = useState(false) // 申请电子软著弹窗 const [toEditsModal, setToEditsModal] = useState(false) // 电子软著编辑弹窗 + const [appGoodsArray, setAppGoodsArray] = useState([]) // 电子软著可选商品列表 + const [buyLoading, setBuyLoading] = useState(false) // 购买loading + const [appOrderId, setAppOrderId] = useState() // 电子软著订单id + const [appExamineStatus, setAppExamineStatus] = useState(null) // 电子软著审核状态 + const [appApplyStatus, setAppApplyStatus] = useState(null) // 电子软著申请状态 + const appInit = () => { + setAppKeyWords('') + setShowAppkeyWords('') + setAppExamineStatus(null) + setAppApplyStatus(null) + } + const getAppOrderList = async (page: number) => { + try { + + const res: any = await appOrderList({ page, keywords: '', rows: 10 }) + + dispath({ + type: 'upAppGoodsListData', + val: res + }) + } 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) + } + } finally { + setLoading(false) + } + + } + //电子软著点击搜索 + const handleAppSearch = (value: string) => { + setAppKeyWords(value) + // nav('/app-electron', { + // state: { + // appKeyWords: value, + // } + // }) + } + // 电子软著删除关键字 + const handleAppChange = (e: any) => { + setShowAppkeyWords(e.target.value) + if (e.target.value == '') { + setAppKeyWords('') + + + } + } + useEffect(() => { + if (location.pathname == '/app-electron') { + nav('/app-electron', { + state: { + appKeyWords: appKeyWords, + checkStatus: appExamineStatus, + appOrderStatus: appApplyStatus + } + }) + } + + }, [appKeyWords, appExamineStatus, appApplyStatus]) + // 获取电子软著可选商品列表 + const getAppGoodsList = async () => { + try { + const res = await appGoodsList() + // console.log('电子软著可选商品列表', res); + setAppGoodsArray(res) + } 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 [replaceSearchBox, setReplaceSearchBox] = useState(false) + const [nowReplaceKeyWords, setNowReplaceKeyWords] = useState('') // 换名搜索关键字 + const [replaceKeyWords, setReplaceKeyWords] = useState('') // 换名搜索关键字 + const [replaceStatus, setReplaceStatus] = useState(null) // 换名搜索状态 + const repacleInit = () => { + setReplaceKeyWords('') + setNowReplaceKeyWords('') + setReplaceStatus(null) + setauthorId('') + setauthorName('') + setNowauthorId('') + setNowauthorName('') + setselectedRowKeys([]); + } + const [replaceModal, setReplaceModal] = useState(false) // 申请换名 + // 换名搜索关键字 + const replacehandleSearch = (value: string) => { + setReplaceKeyWords(value) + + } + const replacehandleChange = (e: any) => { + setNowReplaceKeyWords(e.target.value) + if (e.target.value == '') { + setReplaceKeyWords('') + } + } + useEffect(() => { + if (location.pathname == '/replace') { + nav('/replace', { + state: { + keywords: replaceKeyWords, + applyStatus: replaceStatus, + authorId: authorId + } + }) + } + }, [replaceKeyWords, replaceStatus, authorId]) + + + + + + + // ----------------------------------------------------------------------------------------------- + + + // 申请商标是否显示------------------------------------------------------------------------------ const [trademarkBox, setTrademarkBox] = useState(false) // 申请商标弹窗 const [trademarkModal, setTrademarkModal] = useState(false) // 申请商标弹窗 + // const [toRradeMarkModal, setToRradeMarkModal] = useState(false) // 申请商标编辑弹窗 // ---------------------------------------------------------------------------------------------------- const [correctionSearchBox, setCorrectionSearchBox] = useState(false) @@ -1155,16 +1303,17 @@ export default function Index() { // app电子软著数组 - const appGoodsArray = [ - { id: '1', title: '10个工作日下证', price: '500', back: 'black' }, - { id: '2', title: '3个工作日下证', price: '900', back: 'blue' }, - { id: '3', title: '1个工作日下证', price: '2599', back: 'black' }, - { id: '4', title: '当天下证', price: '3699', back: 'black' }, - ] + // const appGoodsArray = [ + // { id: '1', title: '10个工作日下证', price: '500', back: 'black' }, + // { id: '2', title: '3个工作日下证', price: '900', back: 'blue' }, + // { id: '3', title: '1个工作日下证', price: '2599', back: 'black' }, + // { id: '4', title: '当天下证', price: '3699', back: 'black' }, + // ] + // 商标数组 const trademarkArray = [ { - id: '1', title: '智能申请注册', nowprice: '500', + id: '1', title: '智能申请注册', nowprice: '270', old: true, //是否显示原价 oldprice: '318', //原价 cheap: true,//特价 @@ -1232,6 +1381,8 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) + } else if (location.pathname.includes('/proj-create')) { setShowSearchBox(false) setRrefunSearchBox(false) @@ -1243,6 +1394,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) setNow('创建项目') // setPathArray([{ title: 首页 }, { title: '创建项目' }]) @@ -1259,6 +1411,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setEditname(location.pathname) // setPathArray([{ title: 首页 }, { title: '编辑项目' }]) @@ -1274,6 +1427,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: '新建项目' }]) @@ -1289,6 +1443,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: '编辑项目' }]) @@ -1304,6 +1459,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: '编辑项目' }]) @@ -1319,6 +1475,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '标题简介' }]) @@ -1334,6 +1491,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '基本信息' }]) @@ -1349,6 +1507,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '登录界面设置' }]) @@ -1364,6 +1523,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '系统菜单管理' }]) @@ -1379,6 +1539,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '系统菜单顺序' }]) @@ -1394,6 +1555,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '软件功能特点' }]) @@ -1409,6 +1571,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '添加菜单' }]) } else if (location.pathname.includes('/proj-edit/config-mod-edit')) { @@ -1423,6 +1586,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-2) }}>编辑项目 }, { title: { nav(-1) }}>系统菜单管理 }, { title: '编辑菜单' }]) // /config-mod-edit /config-mod-show @@ -1438,6 +1602,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-2) }}>编辑项目 }, { title: { nav(-1) }}>系统菜单管理 }, { title: '查看菜单' }]) // /config-mod-edit @@ -1453,6 +1618,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) @@ -1470,6 +1636,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setPathArray([{ title: '首页' }]) // /config-mod-edit /product-release /transaction-order @@ -1485,6 +1652,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setPathArray([{ title: '首页' }]) // /config-mod-edit /product-release /transaction-order @@ -1500,6 +1668,7 @@ export default function Index() { setTradingSearchBox(true) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setPathArray([{ title: '首页' }]) // /config-mod-edit /product-release /transaction-order @@ -1516,6 +1685,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '软件功能特点' }]) @@ -1532,6 +1702,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) // setNewname(location.pathname) // setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '软件功能特点' }]) @@ -1547,6 +1718,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) } else if (location.pathname.includes('/app-electron')) { setShowSearchBox(false) @@ -1560,6 +1732,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(true) setTrademarkBox(false) + setReplaceSearchBox(false) } else if (location.pathname.includes('/app-edit')) { setShowSearchBox(false) @@ -1573,6 +1746,7 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(false) + setReplaceSearchBox(false) } else if (location.pathname.includes('/trademark-mall')) { @@ -1587,6 +1761,21 @@ export default function Index() { setTradingSearchBox(false) setAppSearchBox(false) setTrademarkBox(true) + setReplaceSearchBox(false) + } + else if (location.pathname.includes('/replace')) { + setShowSearchBox(false) + setRrefunSearchBox(false) + setCorrectionSearchBox(false) + setContractSearchBox(false) + setNow('首页 / 换名') + setSellSearchBox(false) + setSellOrderSearchBox(false) + setCopyrightSearchBox(false) + setTradingSearchBox(false) + setAppSearchBox(false) + setTrademarkBox(false) + setReplaceSearchBox(true) } }, [location.pathname]) @@ -1611,7 +1800,7 @@ export default function Index() { // getLanguageListDate() // getSoftTypeListDate() - + getAppGoodsList() }, []); useEffect(() => { // loactionStorage里的activeMenu @@ -1667,6 +1856,7 @@ export default function Index() { }) } + }, [type, chargeAdditionals, keywords, tagDataId, projRemindId, payStatus, authorId, refunKeywords, applyStatus, correctionKeywords, correctionNumType, correctionType, correctionApplyStatus, tagCor]); // const [menuName,setMenuName] = useState('') @@ -1948,8 +2138,8 @@ export default function Index() { ) : ( <> - )} */} - {/* {THEME == 'mzw' ? ( + )} + {THEME == 'mzw' ? (
+ +
+
+
+
+
+ + + + + +
{ + // setauthorName('哈哈哈哈哈哈哈哈哈哈嘎嘎嘎嘎嘎嘎') + setOwnerPage(1) + getProjOwnerList(1, '') + setSelectBelongPeople(true) + setselectedRowKeys([]) + setNowauthorId('') + setNowauthorName('') + // nav('/home', { + // state: { + // keyword: keywords, + // type: type, + // chargeAdditionals: chargeAdditionals, + // tagDataId: tagDataId, + // authorId: '1', + // payStatus: payStatus, + // projRemindId: projRemindId, + // // tagNot + // } + // }) + }} + + > +
+ + { + setauthorName('') + setauthorId('') + setNowauthorId('') + setNowauthorName('') + setselectedRowKeys([]); + nav('/replace', { + state: { + keywords: replaceKeyWords, + applyStatus: replaceStatus, + authorId: '', + } + }) + }} + /> +
+ +
+
+ + + + + +
@@ -3384,6 +3787,23 @@ export default function Index() { { setCorrectionModal(false) }} > + { + setReplaceModal(false) + }} + okButtonProps={{ style: { background: 'red', color: 'white' } }} + width={592} + centered + + > + { setReplaceModal(false) }} + > + { setAppModal(false) - setAppGoodsId('') + }} okButtonProps={{ style: { background: 'red', color: 'white' } }} width={830} @@ -3667,73 +4087,107 @@ export default function Index() { centered > -
+
- {appGoodsArray.map((item: any) => { - return ( -
{ - setAppGoodsId(item.id) - }} - > -
-
- {item.title} -
+
+ {appGoodsArray.map((item: any, index: number) => { + return ( +
{ + setAppGoodsId(item.id) + // console.log('item.dataId: ', item.dataId); -
-
-
- - {item.price} - 元/件 + }} + > +
+
+ {item.title} +
+
+
+ + {item.money / 100} + 元/件 +
+ +
-
- ) + ) - })} + })} +
+
+
{ + if (appGoodsId) { + // alert('开发中') + // 创建按订单 如果成功 询问是否继续编辑 + // setAppGoodsId('') + try { + setBuyLoading(true) + const res = await buyAppGoods(appGoodsId) + setAppOrderId(res.data) + setBuyLoading(false) + setAppModal(false) + getAppOrderList(1) + setToEditsModal(true) + appInit() + reloadUser(messageApi, globalDispatchContext).then(() => { + messageApi.success('扣款成功'); + }); + // 更新redux中的appGoodsListAray + + } 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) + } + } finally { + setBuyLoading(false) + } + + + return + + } else { + messageApi.error('请选择商品') + } + }}>下单购买
+
-
-
{ - if (appGoodsId) { - // alert('开发中') - // 创建按订单 如果成功 询问是否继续编辑 - setAppGoodsId('') - setAppModal(false) - setToEditsModal(true) - } else { - messageApi.error('请选择商品') - } - }}>下单购买
-
-
+ { setToEditsModal(false) - nav('/app-edit/dajsdkjakdl') + nav(`/app-edit/${appOrderId}`) }} // 设置确定和取消得文字 okText="编辑" @@ -3758,6 +4212,7 @@ export default function Index() { >
已生成订单,是否编辑
+ {item.nowprice} +
{ console.log(item.nowprice); + setTrademarkModal(false) + nav('/trademark-expert-edit') + + console.log('简单'); }} - >立即购买
+ >开始编辑
{ console.log(item.nowprice); - + console.log('复杂'); }} - >立即购买
+ >开始编辑 diff --git a/src/route/router.tsx b/src/route/router.tsx index d888065..4bab0d4 100644 --- a/src/route/router.tsx +++ b/src/route/router.tsx @@ -4,12 +4,14 @@ import ProductRelease from '../route/ProductRelease/ProductRelease.tsx' import AppElectron from '../route/AppElectron/AppElectron.tsx' import AppEdit from '../route/AppElectron/AppEdit.tsx' import TrademarkMall from '../route/TrademarkMall/TrademarkMall.tsx' +import TrademarkExpertEdit from '../route/TrademarkMall/TrademarkExpertEdit.tsx' import TransactionOrder from '../route/TransactionOrder/TransactionOrder.tsx' import CopyrightGgoods from '../route/CopyrightGgoods/CopyrightGgoods.tsx' import TradingGoods from '../route/TradingGoods/TradingGoods.tsx' import Refun from '../route/Refun/Refun.tsx' import Correction from '../route/Correction/Correction.tsx' import Contract from '../route/Contract/Contract.tsx'; +import Replace from '../route/Replace/Replace.tsx'; import Index from "../route/index/Index.tsx"; // import Search from "../route/SearchList/SearchList.tsx"; import ProjCreate from "./proj/ProjCreate.tsx"; @@ -226,13 +228,17 @@ export const router = createHashRouter( element: }, { - path: '/app-edit/:appId', + path: '/app-edit/:appOrderId', element: }, { path: '/trademark-mall', element: }, + { + path:'/trademark-expert-edit', + element: + }, { path: '/transaction-order', element: @@ -256,6 +262,10 @@ export const router = createHashRouter( { path: '/contract', element: + }, + { + path: '/replace', + element: }, { path: '/proj-create', diff --git a/src/store/index.ts b/src/store/index.ts index 0c329f1..a02487a 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -9,22 +9,26 @@ const baseState = { // val: '' // }, belongArray: [], - refunArray:[], - correctionArray:[], - contractArray:[], - contractTotal:0, - refunTotal:0, - correctionTotal:0, - couponModal:false, - projName:'', - projStatus:'', - newRefun:false, - newCorrection:false, - packNum:{ - ALL:0, - MATERIAL:0, + refunArray: [], + correctionArray: [], + contractArray: [], + contractTotal: 0, + refunTotal: 0, + correctionTotal: 0, + couponModal: false, + projName: '', + projStatus: '', + newRefun: false, + newCorrection: false, + packNum: { + ALL: 0, + MATERIAL: 0, }, - phoneModal:false, + phoneModal: false, + appGoodsListData: {}, + replaceArray: [], + replaceTotal: 0, + newReplace: false, } // 创建仓库 @@ -51,6 +55,9 @@ const reducer = (state = baseState, action: any) => { if (action.type == 'upCorrectionArray') { nstate.correctionArray = action.val } + if (action.type == 'upReplaceArray') { + nstate.replaceArray = action.val + } if (action.type == 'upContractArray') { nstate.contractArray = action.val } @@ -60,6 +67,9 @@ const reducer = (state = baseState, action: any) => { if (action.type == 'upCorrectionTotal') { nstate.correctionTotal = action.val } + if (action.type == 'upReplaceTotal') { + nstate.replaceTotal = action.val + } if (action.type == 'changeCouponModal') { nstate.couponModal = action.val } @@ -78,9 +88,15 @@ const reducer = (state = baseState, action: any) => { if (action.type == 'upPackNum') { nstate.packNum = action.val } - if(action.type == 'changePhoneModal'){ + if (action.type == 'changePhoneModal') { nstate.phoneModal = action.val } + if (action.type == 'upAppGoodsListData') { + nstate.appGoodsListData = action.val + } + if (action.type == 'newReplace') { + nstate.newReplace = action.val + } return nstate } const store = createStore(reducer)