From b5243244148e15d26b6390d91f4ce4dfc6f38fb7 Mon Sep 17 00:00:00 2001 From: lyp Date: Tue, 27 May 2025 10:47:05 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 4 +- src/request/api.ts | 22 + src/request/request.ts | 2 +- src/route/AppElectron/AppEdit.tsx | 413 +++++++++++++----- src/route/AppElectron/AppElectron.tsx | 254 +++++++++-- .../components/AppCompany/AppCompany.tsx | 143 +----- .../components/EditAppFiles/EditAppFiles.tsx | 160 ++++++- src/route/Contract/Contract.tsx | 3 +- .../TrademarkMall/TrademarkExpertEdit.tsx | 10 + src/route/TrademarkMall/trademark-edit.css | 8 + src/route/index/Index.tsx | 381 ++++++++++++---- src/route/router.tsx | 7 +- src/store/index.ts | 36 +- 13 files changed, 1056 insertions(+), 387 deletions(-) create mode 100644 src/route/TrademarkMall/TrademarkExpertEdit.tsx create mode 100644 src/route/TrademarkMall/trademark-edit.css diff --git a/.env.dev b/.env.dev index 2799469..9e9f0da 100644 --- a/.env.dev +++ b/.env.dev @@ -6,7 +6,7 @@ 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=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 diff --git a/src/request/api.ts b/src/request/api.ts index 8f6d57a..bbb0f66 100644 --- a/src/request/api.ts +++ b/src/request/api.ts @@ -121,3 +121,25 @@ export const updateBindPhone = (params:any) => phoneRequest.post(`/operator/api/ export const unbind = () => phoneRequest.get(`/operator/api/user-wx-update-username/unlock-phone`) //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + +// APP电子软著接口---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +//获取APP电子软著可买商品展示列表 +export const appGoodsList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/71831561-108f-49f0-92c8-f9e4f0483c02`) +// 获取运行系统选项 +export const runSystemList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/9fc8636a-b930-4e82-beb3-db7ca6151e6b`) +// 获取大类选项 +export const bigClassList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1`) +// 获取小类 +export const smallClassList = (id:string) => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1/${id}`) + + +// 下单购买APP电子软著 +export const buyAppGoods = (orderMoneyId:string) => aiShopRequest.post(`/aishop/api/apporder/pay/${orderMoneyId}`) +// 获取我的app电子软著订单列表 +export const appOrderList = (params:any) => aiShopRequest.get(`/aishop/api/apporder/listpage-self`, { params }) +// 获取app电子软著详情 +export const appOrderDetail = (appOrderId:any) => aiShopRequest.get(`/aishop/api/apporder/get/${appOrderId}`) +// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/src/request/request.ts b/src/request/request.ts index e5983da..ce4c7a7 100644 --- a/src/request/request.ts +++ b/src/request/request.ts @@ -64,7 +64,7 @@ request.interceptors.response.use( -// 买卖功能---------------------------------------------------------------------------- +// 买卖功能(交易中心/APP电子软著)---------------------------------------------------------------------------- const aiShopRequest = axios.create({ baseURL: aiShopBaseUrl, timeout: 5000, diff --git a/src/route/AppElectron/AppEdit.tsx b/src/route/AppElectron/AppEdit.tsx index 74976cf..03acd77 100644 --- a/src/route/AppElectron/AppEdit.tsx +++ b/src/route/AppElectron/AppEdit.tsx @@ -8,88 +8,265 @@ import EditAppFiles from './components/EditAppFiles/EditAppFiles'; import AppInfo from './components/AppInfo/AppInfo'; import AppCompany from './components/AppCompany/AppCompany'; import { useParams } from 'react-router-dom' +import { runSystemList, bigClassList, smallClassList } from '../../request/api' import './app-edit.css' import { RightOutlined } from '@ant-design/icons'; +import { + message, + Spin, + +} from 'antd'; +import { appOrderDetail } from '../../request/api' export default function AppEdit() { + const [messageApi, contextHolder] = message.useMessage(); const pathParams = useParams(); - // 进度 + const appOrderId = pathParams.appOrderId; + const [systemList, setSystemList] = useState([]); // 运行系统选项 + const [bigClass, setBigClass] = useState([]); // 软件分类(大类)选项 + const [smallClass, setSmallClass] = useState([]); // 软件分类(小类)选项 + // 获取运行系统选项 + const getRunSystemList = async () => { + try { + const res: any = await runSystemList(); + console.log('运行系统选项', res.map((item: any) => { + return { + label: item.dataName, + value: item.dataName, + } + })); + setSystemList(res.map((item: any) => { + return { + label: item.dataName, + value: item.dataName, + } + })) + } 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 getBigClassList = async () => { + try { + const res: any = await bigClassList(); + console.log('大类选项', res.map((item: any) => { + return { + label: item.dataName, + value: item.dataId, + } + })); + setBigClass(res.map((item: any) => { + return { + label: item.dataId, + value: item.dataName, + } + })) + } 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 getSmallClassList = async (id: string) => { + try { + const res: any = await smallClassList(id); + console.log(res); + setSmallClass(res.map((item: any) => { + return { + label: item.dataId, + value: item.dataName, + } + })) + } 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 [loading, setLoading] = useState(false); const [editProcess, setEditProcess] = useState(1); + // 企业/机构认证 + const [companyInfo, setCompanyInfo] = useState({ + companyName: '', // 企业名称 + companyNumber: '', // 企业统一社会信用代码 + companyPhoto: '', // 企业照片 + companyAuth: '',//授权书 + }); + // 软件基本信息 + const [appInfo, setAppInfo] = useState({ + appName: '', // 项目名称 + subName: '', // 软件简称 + versionName: '', // 版本号 + packageName: '', // 包名APPID + systemName: '', // 运行系统 + bigClassify: '', // 软件分类(大类) + subClassify: '', // 软件分类(小类) + developWay: '', // 开发方式 + completeTime: '', // 开发完成时期 + projOwnerName: '',//著作权人姓名 + projOwnerIdentity: '',//著作权人证件号 + projOwnerId: '',//著作权人信息ID + }) + // 材料信息 + const [filesInfo, setFilesInfo] = useState({ + sourceCodeDocFile: '',//源码 + softwareDocFile: '',//软件 + }) + // 获取详情 + const getAppOrderDetail = async () => { + try { + setLoading(true) + const res: any = await appOrderDetail(appOrderId); + console.log('详情', res); + setCompanyInfo({ + companyName: res.companyName, // 企业名称 + companyNumber: res.companyNumber, // 企业统一社会信用代码 + companyPhoto: res.companyPhoto, // 企业照片 + companyAuth: res.companyAuth,//授权书 + }) + setAppInfo({ + appName: res.appName, // 项目名称 + subName: res.subName, // 软件简称 + versionName: res.versionName, // 版本号 + packageName: res.packageName, // 包名APPID + systemName: res.systemName, // 运行系统 + bigClassify: res.bigClassify, // 软件分类(大类) + subClassify: res.subClassify, // 软件分类(小类) + developWay: res.developWay, // 开发方式 + completeTime: res.completeTime, // 开发完成时期 + projOwnerName: res.projOwnerName,//著作权人姓名 + projOwnerIdentity: res.projOwnerIdentity,//著作权人证件号 + projOwnerId: res.projOwnerId,//著作权人信息ID + }) + setFilesInfo({ + sourceCodeDocFile: res.sourceCodeDocFile,//源码 + softwareDocFile: res.softwareDocFile,//软件 + }) + setEditProcess(Number(res.appOrderProgress) + 1) + setLoading(false) + } 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) + } + + + } + // 进度 + // 获取详情 useEffect(() => { + getAppOrderDetail() //获取进度 - setEditProcess(1) - // 带来的id - console.log('参数', pathParams); - // 获取 信息 - + // setEditProcess(1) + getRunSystemList() + getBigClassList() + if(appInfo.bigClassify) { + getSmallClassList(appInfo.bigClassify) + } }, []); const height = window.innerHeight - 180; return ( -
-
-
-
= 1 ? '#3B60E8' : '', - color: editProcess >= 1 ? '#fff' : '#B1B1B1', - borderColor: editProcess >= 1 ? '' : '#B1B1B1' - }} - >1
-
= 1 ? '#353535' : '#878787', - fontWeight: editProcess >= 1 ? 'bold' : 'normal' - }} - >企业/机构认证
-
-
-
-
= 2 ? '#3B60E8' : '', - color: editProcess >= 2 ? '#fff' : '#B1B1B1', - borderColor: editProcess >= 2 ? '' : '#B1B1B1' - }}>2
-
= 2 ? '#353535' : '#878787', - fontWeight: editProcess >= 2 ? 'bold' : 'normal' - }} - >软件基本信息
-
-
-
-
= 3 ? '#3B60E8' : '', - color: editProcess >= 3 ? '#fff' : '#B1B1B1', - borderColor: editProcess >= 3 ? '' : '#B1B1B1' - }}>3
-
= 3 ? '#353535' : '#878787', - fontWeight: editProcess >= 3 ? 'bold' : 'normal' - }} - >鉴别材料
-
-
-
-
= 4 ? '#3B60E8' : '', - color: editProcess >= 4 ? '#fff' : '#B1B1B1', - borderColor: editProcess >= 4 ? '' : '#B1B1B1' - }}>4
-
= 4 ? '#353535' : '#878787', - fontWeight: editProcess >= 4 ? 'bold' : 'normal' - }} - > - {/* 功能特点 */} - 填报完成 + +
+ {contextHolder} +
+
+
= 1 ? '#3B60E8' : '', + color: editProcess >= 1 ? '#fff' : '#B1B1B1', + borderColor: editProcess >= 1 ? '' : '#B1B1B1' + }} + >1
+
= 1 ? '#353535' : '#878787', + fontWeight: editProcess >= 1 ? 'bold' : 'normal' + }} + >企业/机构认证
-
- {/*
+
+
+
= 2 ? '#3B60E8' : '', + color: editProcess >= 2 ? '#fff' : '#B1B1B1', + borderColor: editProcess >= 2 ? '' : '#B1B1B1' + }}>2
+
= 2 ? '#353535' : '#878787', + fontWeight: editProcess >= 2 ? 'bold' : 'normal' + }} + >软件基本信息
+
+
+
+
= 3 ? '#3B60E8' : '', + color: editProcess >= 3 ? '#fff' : '#B1B1B1', + borderColor: editProcess >= 3 ? '' : '#B1B1B1' + }}>3
+
= 3 ? '#353535' : '#878787', + fontWeight: editProcess >= 3 ? 'bold' : 'normal' + }} + >鉴别材料
+
+
+
+
= 4 ? '#3B60E8' : '', + color: editProcess >= 4 ? '#fff' : '#B1B1B1', + borderColor: editProcess >= 4 ? '' : '#B1B1B1' + }}>4
+
= 4 ? '#353535' : '#878787', + fontWeight: editProcess >= 4 ? 'bold' : 'normal' + }} + > + {/* 功能特点 */} + 填报完成 +
+
+ {/*
= 5 ? '#3B60E8' : '', @@ -119,60 +296,73 @@ export default function AppEdit() {
*/} -
-
-
- { - setEditProcess(num) - } - }> - {/* +
+
+ { + setEditProcess(num) + } + }> + {/* { setEditProcess(num) } }> */} -
-
- { - setEditProcess(num) - } - }> - {/* +
+ { + setEditProcess(num) + } + }> + {/* { setEditProcess(num) } }> */} -
-
- { - setEditProcess(num) - } - }> -
-
- {/* +
+ { + setEditProcess(num) + } + }> +
+
+ {/* { setEditProcess(num) } }> */} - { - setEditProcess(num) - } - }> -
- {/*
{ + setEditProcess(num) + } + }> +
+ {/*
*/} +
-
+ ) } diff --git a/src/route/AppElectron/AppElectron.tsx b/src/route/AppElectron/AppElectron.tsx index 29b9e9e..430a7c0 100644 --- a/src/route/AppElectron/AppElectron.tsx +++ b/src/route/AppElectron/AppElectron.tsx @@ -1,47 +1,241 @@ import { useState, useEffect } from 'react' +import { useSelector, useDispatch } from 'react-redux' import { Pagination, // Table, // Modal, - // Spin + // Spin, + message, + Spin, + Table } from 'antd'; +import { appOrderList } from '../../request/api' import './app-election.css' import nothingImg from '../../static/appimgs/nothing.png' +import { useLocation } from 'react-router-dom'; +import type { TableProps } from 'antd'; +import { useNavigate } from "react-router-dom"; +interface DataType { + appName: string; //项目名称 + bigClassify: string; //软件分类(大类) + appOrderPayMoney: number; //支付金额; + appOrderPayTime: string; //支付时间; + gmtCreate: string; +} export default function AppElectron() { - const height = window.innerHeight - 180; - const [page, setPage] = useState(1); - const [total, setTotal] = useState(0); - const data = [ - // { name: '123' } - ] - useEffect(() => { - setTotal(100) - }, [page]) - return ( -
- {data.length <= 0 ? (
+ const nav = useNavigate(); + const dispath = useDispatch() + const redxuState: any = useSelector(state => state) + const data = redxuState.appGoodsListData; + const columns: TableProps['columns'] = [ + { + title: '序号', + dataIndex: 'index', + key: 'index', + align: 'center', + width: 90, + render: (_text, _record, index) => (page - 1) * 10 + index + 1, // 显示序号,从1开始 - + }, + { + title: '项目名称', + dataIndex: 'appName', + key: 'appOrderId', + align: 'center', + ellipsis: { + showTitle: true, + }, + width: 200, + render: (text) => ( + + {text ? text : '未完善'} + + ) + + }, + { + title: '软件分类', + dataIndex: 'bigClassify', + align: 'center', + key: 'appOrderId', + width: 120, + ellipsis: { + showTitle: true, + }, + render: (text) => ( + + {text ? text : '未完善'} + + ) + }, + { + title: '支付金额', + dataIndex: 'appOrderPayMoney', + key: 'appOrderId', + align: 'center', + width: 120, + render: (text) => ( + + {text / 100} + + ) + }, + { + title: '支付时间', + dataIndex: 'appOrderPayTime', + align: 'center', + key: 'appOrderId', + width: 200, + }, + { + title: '审核状态', + dataIndex: 'checkStatus', + align: 'center', + key: 'appOrderId', + width: 100, + render: (text) => ( + + {text == '1' ? '待审核' : text == '2' ? '通过' : text == '0' ? '未通过' : '未提交'} + + ) + }, + { + title: '申请状态', + dataIndex: 'appOrderStatus', + align: 'center', + key: 'appOrderId', + width: 100, + render: (text) => ( + + {text == '1' ? '未付款' : text == '2' ? '资料填写中' : text == '3' ? '资料审核中' : text == '4' ? '下线申请中' : text == '5' ? '已下证' : '未知'} + + ) + }, + + { + title: '操作', + // dataIndex: 'contractManagementId', + align: 'center', + key: 'appOrderId', + width: 80, + render: (record) => (
暂无数据
-
) : ( -
-
+ cursor: 'pointer', + color: '#007FFF', + }} onClick={() => { + nav(`/app-edit/${record.appOrderId}`) + // console.log(record); + + + }}>编辑
+ ) + + }, + ] + const [messageApi, contextHolder] = message.useMessage(); + const height = window.innerHeight - 180; + const { state } = useLocation() + const keywords = state ? state.appKeyWords : '' + const checkStatus = state? state.checkStatus : '' + const appOrderStatus = state? state.appOrderStatus : '' + const [page, setPage] = useState(1); + // const [total, setTotal] = useState(0); + const [loading, setLoading] = useState(false); + // const [data, setData] = useState([]); + // 获取我得订单列表 + const getAppOrderList = async (page: number) => { + try { + setLoading(true) + const res: any = await appOrderList({ page, keywords, rows: 10,checkStatus,appOrderStatus }) + // console.log(res); + // setData(res.rows) + // setTotal(res.total) + setLoading(false) + 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) + } + + } + useEffect(() => { + setPage(1) + getAppOrderList(1) + }, [state,checkStatus,appOrderStatus]) + return ( + +
+ + + + {contextHolder} + + {data.length <= 0 ? ( +
+ + + +
暂无数据
+
+ ) : ( +
+
+ +
+ +
+
+ { + setPage(page) + getAppOrderList(page) + }} /> +
-
- { - setPage(page) - }} /> -
-
- )} + )} + +
+ + ) } diff --git a/src/route/AppElectron/components/AppCompany/AppCompany.tsx b/src/route/AppElectron/components/AppCompany/AppCompany.tsx index 820b2b6..7316fc0 100644 --- a/src/route/AppElectron/components/AppCompany/AppCompany.tsx +++ b/src/route/AppElectron/components/AppCompany/AppCompany.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useState,useEffect } from 'react' import './app-company.css' import { uploadFileUrl } from '../../../../request/request' import { Button, Form, Input, message, @@ -21,38 +21,7 @@ import type { GetProp, UploadProps } from 'antd'; // // pId: string; // } export default function AppCompany(props: any) { - // const [messageApi, contextHolder] = message.useMessage(); - // const [areaArray, setAreaArray] = useState([]); - // 加载城市列表 - // const loadCityList = async (selectedOptions: Option[]) => { - // const targetOption = selectedOptions[selectedOptions.length - 1]; - // // console.log('targetOption', targetOption.children); - // try { - // const res: any = await getCityList(targetOption.value as string); - // // console.log('城市列表', res); - - // const cities = res.map((city: any) => ({ - // value: city.areaId, - // label: city.areaName, - - // })); - // targetOption.children = cities; - // // 更新 areaArray 状态 - // setAreaArray([...areaArray]); - // } 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) - // } - // } - // }; + // 定义 beforeUpload 函数 const beforeUpload = (file: any) => { const isJpgOrPng = ['image/jpeg', 'image/png', 'image/bmp'].includes(file.type); @@ -138,6 +107,13 @@ export default function AppCompany(props: any) { submitInfo(values) }; + useEffect(() => { + // console.log('认证数据',props.companyInfo); + if(props.companyInfo.companyName){ + console.log('嘻嘻'); + + } + },[props.companyInfo]) return (
{/* {contextHolder} */} @@ -170,26 +146,7 @@ export default function AppCompany(props: any) { }} placeholder="请输入企业/机构名称" />
- {/*
-
所在省市:
- - - -
*/} +
统一社会信用代码*
@@ -206,85 +163,7 @@ export default function AppCompany(props: any) {
- {/*
-
-
企业/机构地址:
- - - -
-
-
成立日期:
- - - -
-
*/} - {/*
-
-
证件类型:
- - - - -
-
*/} +
{ @@ -107,6 +111,8 @@ export default function EditAppFiles(props: any) {
[ 下载 ]
- 源码文档说明 + { + setCodeVisible(true) + }} + >《应用软件源程序提交注意事项及相关规范》
@@ -272,6 +291,141 @@ export default function EditAppFiles(props: any) { }}>下一步
+ { + setCodeVisible(false) + + }}> + +
+
+ +
+
+ 源码文档需提交PDF格式的文件,软件源程序代码由前、后各连续30页组成。软件源程序多于60页的需要提交连续的前30及后30页,前30页和后30页应是各自连续的。 +
+
+ 1、源程序的第1页应当是程序或一个功能模块的开头,源程序的第60页应当是程序或一个功能模块的结尾,不满60页的需全部提供; +
+
+ 2、源程序每页应该≥50行,并标明页码; +
+
+ 3、编写源程序的语言应和申请表填写的语言保持一致; +
+
+ 4、源程序应和文档中介绍的主要功能存在关联性; +
+
+ 5、源程序编写内容中出现的署名或版权声明以及任何与权利归属有关的内容,著作权人名称应与申请的著作权人保持一致; +
+
+ 6、源程序中出现著作权人成立之前的创建或修改时间的,申请人应该确认是否存在前期开发行为,如有,需提交《前期开发说明》; + +
+
+ 7、源程序中尽量不要出现软件开发完成之后的日期;(出现软件完成日期之后的创建或修改时间的,如果只是纠错性的修改、适应性的调整,不造成软件的功能或性能发生重大变化而发生软件版本升级的,是正常合理的。) +
+
+ 8、源程序中出现他人的自由软件/开源软件的版权声明或相关许可证(License)信息的,且申请人认可源代码中含有他人的自由软件/开源软件源代码的情况,申请人需要提供相关的书面说明; +
+
+ 9、源程序如果有页眉,页面的软件名称、版本号与申请信息及其他申请材料中的软件名称、版本号应当一致; +
+
+ 10、源程序中的软件名称应与申请信息中的软件全称或简称一致,版本号也应该保持一致; +
+
+ 11、源程序如果有文件名,应和申请的软件名称或权利人保持一致,文件名可不填。 +
+
+ 12、源程序中不能含有危害国家安全、低俗、情色等非法内容。 +
+
+
+ { + setSoftVisible(false) + + }}> + +
+
+ +
+
+ 文档指软件的使用说明书或者设计说明书(选择其一提交),需提交PDF格式。一般应提交10-60页,整个文档不到60页的应提交全部,超过60页时,提交前、后各连续的30页,文档应图文并茂,语句通顺,每页应≥30行(有图除外)。 +
+
+ 1、软件使用说明书主要内容要求:从打开软件起开始截取软件的主要功能界面图,截图应带有主界面,不可截部分图,依次为主界面展示、界面的跳转,主要功能模块依次介绍,主要功能都应介绍。截图应截取完整的软件界面,且图片清晰可辨,需有详细的文字介绍,介绍其主要功能如何使用,上一个界面是通过什么操作跳转至下一个界面的; +
+
+ 2、软件设计说明书主要内容要求:应包含软件的基本处理流程、程序系统的组织结构、功能模块划分、接口和数据结构设计等主要设计内容; + +
+
+ 3、文档应和源程序存在一定的关联性; + +
+
+ 4、文档中截图不能含有他人的商标,如使用他人商标,应提交《商标使用授权书》; + +
+
+ 5、截图界面需和申请表中填写的硬件环境、软件环境相匹配; + +
+
+ + 6、文档中不能出现重复截图; + +
+
+ 7、文档页眉(如果有)的软件名称、版本号与申请表单及其他申请材料中的软件名称、版本号应当一致; + +
+
+ 8、文档内容(包括文字、截图等)中的软件名称应与申请表单中的软件全称或简称一致,版本号也应该保持一致; + +
+
+ 9、文档中出现的署名或版权声明以及任何与权利归属有关的内容,著作权人名称应与申请表单中一致; + +
+
+ + 10、文档应标明页码; +
+
+ 11、文档的文件名应和申请的软件名称或权利人保持一致,文件名可不填; + +
+
+ 12、文档中不能含有危害国家安全、低俗、情色等非法内容。 + +
+ + +
+
+
+ ) } 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/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 4819c29..ff8a4c9 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, @@ -21,7 +22,7 @@ import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx // import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx"; // import ListProj from "../../components/list/ListProj.tsx"; // import ListProjAgent from "../../components/list/ListProjAgent.tsx"; -// import { getMenuActive } from '../../util/cache.ts' +import { getMenuActive } from '../../util/cache.ts' import { @@ -53,10 +54,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"; @@ -80,10 +85,10 @@ interface DataType { } -// import app from '../../static/left/app.png' -// import appnew from '../../static/left/appnew.png' -// import tra from '../../static/left/tra.png' -// import tranew from '../../static/left/tranew.png' +import app from '../../static/left/app.png' +import appnew from '../../static/left/appnew.png' +import tra from '../../static/left/tra.png' +import tranew from '../../static/left/tranew.png' import topblack from '../../static/appimgs/topblack.png' import topblue from '../../static/appimgs/topblue.png' @@ -94,7 +99,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 = [ { @@ -880,7 +885,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 +911,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 +976,103 @@ 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(() => { + 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 [trademarkBox, setTrademarkBox] = useState(false) // 申请商标弹窗 const [trademarkModal, setTrademarkModal] = useState(false) // 申请商标弹窗 + // const [toRradeMarkModal, setToRradeMarkModal] = useState(false) // 申请商标编辑弹窗 // ---------------------------------------------------------------------------------------------------- const [correctionSearchBox, setCorrectionSearchBox] = useState(false) @@ -1155,16 +1250,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,//特价 @@ -1611,7 +1707,7 @@ export default function Index() { // getLanguageListDate() // getSoftTypeListDate() - + getAppGoodsList() }, []); useEffect(() => { // loactionStorage里的activeMenu @@ -1875,7 +1971,7 @@ export default function Index() { list={agentMenu.list} handleListItem={agentMenu.handleListItem} /> */} - {/* {THEME == 'mzw' ? ( + {THEME == 'mzw' ? ( <>
) : ( <> - )} */} + )} {THEME == 'mzw' ? ( + + + + + +
@@ -3667,73 +3827,105 @@ export default function Index() { centered > -
+
- {appGoodsArray.map((item: any) => { - return ( -
{ - setAppGoodsId(item.id) - }} - > -
-
- {item.title} -
+
+ {appGoodsArray.map((item: any, index: number) => { + return ( +
{ + setAppGoodsId(item.dataId) + // console.log('item.dataId: ', item.dataId); -
-
-
- - {item.price} - 元/件 + }} + > +
+
+ {item.dataSummary} +
+
+
+ + {item.dataName / 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) + } + } + + + 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 +3950,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..3b064d1 100644 --- a/src/route/router.tsx +++ b/src/route/router.tsx @@ -4,6 +4,7 @@ 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' @@ -226,13 +227,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: diff --git a/src/store/index.ts b/src/store/index.ts index 0c329f1..47e4954 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -9,22 +9,23 @@ 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: {}, } // 创建仓库 @@ -78,9 +79,12 @@ 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 + } return nstate } const store = createStore(reducer) From ca5c6f4a4d42d9f2a555dba547c426e7e358b29e Mon Sep 17 00:00:00 2001 From: lyp Date: Tue, 27 May 2025 11:35:21 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/route/AppElectron/AppEdit.tsx | 10 +- .../components/AppCompany/AppCompany.tsx | 168 +++++++++++------- 2 files changed, 107 insertions(+), 71 deletions(-) diff --git a/src/route/AppElectron/AppEdit.tsx b/src/route/AppElectron/AppEdit.tsx index 03acd77..12267bb 100644 --- a/src/route/AppElectron/AppEdit.tsx +++ b/src/route/AppElectron/AppEdit.tsx @@ -93,7 +93,7 @@ export default function AppEdit() { return { label: item.dataId, value: item.dataName, - } + } })) } catch (error: any) { @@ -196,8 +196,8 @@ export default function AppEdit() { getRunSystemList() getBigClassList() - if(appInfo.bigClassify) { - getSmallClassList(appInfo.bigClassify) + if (appInfo.bigClassify) { + getSmallClassList(appInfo.bigClassify) } }, []); const height = window.innerHeight - 180; @@ -302,6 +302,7 @@ export default function AppEdit() { display: editProcess == 1 ? 'block' : 'none' }}> { @@ -318,6 +319,7 @@ export default function AppEdit() { display: editProcess == 2 ? 'block' : 'none' }}> { @@ -353,6 +356,7 @@ export default function AppEdit() { } }> */} { const isJpgOrPng = ['image/jpeg', 'image/png', 'image/bmp'].includes(file.type); @@ -34,13 +35,13 @@ export default function AppCompany(props: any) { } return isJpgOrPng && isLt4M; }; - type FileType = Parameters>[0]; + // type FileType = Parameters>[0]; const [loading, setLoading] = useState(false); - const getBase64 = (img: FileType, callback: (url: string) => void) => { - const reader = new FileReader(); - reader.addEventListener('load', () => callback(reader.result as string)); - reader.readAsDataURL(img); - }; + // const getBase64 = (img: FileType, callback: (url: string) => void) => { + // const reader = new FileReader(); + // reader.addEventListener('load', () => callback(reader.result as string)); + // reader.readAsDataURL(img); + // }; const [imageUrl, setImageUrl] = useState(''); const handleChange: UploadProps['onChange'] = (info) => { if (info.file.status === 'uploading') { @@ -49,12 +50,18 @@ export default function AppCompany(props: any) { } if (info.file.status === 'done') { // Get this url from response in real world. - getBase64(info.file.originFileObj as FileType, (url) => { - setLoading(false); - setImageUrl(url); - }); - console.log(info); - + // getBase64(info.file.originFileObj as FileType, (url) => { + // setLoading(false); + // setImageUrl(url); + // }); + // console.log(info.file.response.data.fileId); + setLoading(false); + const fileId = info.file.response.data.fileId; + const url = showImage(fileId, false); + setImageUrl(url); + form.setFieldsValue({ + img: fileId, + }) } if (info.file.status === 'error') { setLoading(false); @@ -66,21 +73,52 @@ export default function AppCompany(props: any) { }) } }; - + const[textloading, setTextLoading] = useState(false); + const [textImageUrl, setTextImageUrl] = useState(''); + const textHandleChange: UploadProps['onChange'] = (info) => { + if (info.file.status === 'uploading') { + setTextLoading(true); + return; + } + if (info.file.status === 'done') { + // Get this url from response in real world. + // getBase64(info.file.originFileObj as FileType, (url) => { + // setLoading(false); + // setImageUrl(url); + // }); + // console.log(info.file.response.data.fileId); + setTextLoading(false); + const fileId = info.file.response.data.fileId; + const url = showImage(fileId, false); + setTextImageUrl(url); + form.setFieldsValue({ + textImg: fileId, + }) + } + if (info.file.status === 'error') { + setTextLoading(false); + // 显示错误提示 + message.error(`上传失败`); + //伤处表单name为ing的值 + form.setFieldsValue({ + textImg: '', // 将值设置为 undefined 以清除错误状态 + }) + } + }; // 自定义验证规则 - const validateUpload = () => { + // const validateUpload = () => { - if (loading) { - return Promise.reject(new Error('文件上传中,请等待上传完成')); - } - if (!imageUrl) { - return Promise.reject(new Error('请上传有效的文件')); - } - return Promise.resolve(); + // if (loading) { + // return Promise.reject(new Error('文件上传中,请等待上传完成')); + // } + // if (!imageUrl) { + // return Promise.reject(new Error('请上传有效的文件')); + // } + // return Promise.resolve(); - }; + // }; const token = sessionStorage.getItem('token') const submitInfo = (values: any) => { message.success('提交成功'); @@ -95,7 +133,7 @@ export default function AppCompany(props: any) { const handleSubmit = () => { // console.log(form); - props.setEditProcess(2); + // props.setEditProcess(2); // 调用表单实例的 submit 方法 form.submit(); @@ -108,12 +146,12 @@ export default function AppCompany(props: any) { }; useEffect(() => { - // console.log('认证数据',props.companyInfo); - if(props.companyInfo.companyName){ + // console.log('认证数据',props.companyInfo); + if (props.companyInfo.companyName) { console.log('嘻嘻'); - + } - },[props.companyInfo]) + }, [props.companyInfo]) return (
{/* {contextHolder} */} @@ -134,7 +172,7 @@ export default function AppCompany(props: any) { // background: 'pink' }}>
-
企业/机构名称*
+
企业/机构名称*
@@ -146,10 +184,10 @@ export default function AppCompany(props: any) { }} placeholder="请输入企业/机构名称" />
- +
统一社会信用代码*
+ }}>统一社会信用代码*
@@ -163,7 +201,7 @@ export default function AppCompany(props: any) {
- +
上传证件*
+ }}>上传证件*
{ - // setUpArray([]) - // setDisabled(false) - }} + headers={{ 'Auth': `Bearer ${token}` }} - disabled={!!imageUrl} + // disabled={!!imageUrl} // beforeUpload={beforeUpload} > {imageUrl ? @@ -239,20 +274,20 @@ export default function AppCompany(props: any) { }} onClick={() => { setImageUrl('') + form.setFieldsValue({ + img: '', // 将值设置为 undefined 以清除错误状态 + }) }} >删除
- { - // setUpArray([]) - // setDisabled(false) }} headers={{ 'Auth': `Bearer ${token}` }} - disabled={!!imageUrl} - // beforeUpload={beforeUpload} + // disabled={!!imageUrl} > - {imageUrl ? + {textImageUrl ?
- @@ -302,9 +331,9 @@ export default function AppCompany(props: any) { borderRadius: '5px', color: '#929292', }} - disabled={loading} + disabled={textloading} > - {loading ? 正在上传 : + {textloading ? 正在上传 : '点击上传文件' @@ -321,10 +350,13 @@ export default function AppCompany(props: any) { padding: '5px 10px', cursor: 'pointer', color: 'red', - display: imageUrl ? 'block' : 'none', + display: textImageUrl ? 'block' : 'none', }} onClick={() => { - setImageUrl('') + setTextImageUrl('') + form.setFieldsValue({ + textImg: '', // 将值设置为 undefined 以清除错误状态 + }) }} >删除
From 83f87eeedca2b25058c56b786006682832defb98 Mon Sep 17 00:00:00 2001 From: lyp Date: Tue, 27 May 2025 15:19:41 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/request/api.ts | 5 +- src/route/AppElectron/AppEdit.tsx | 5 + .../components/AppCompany/AppCompany.tsx | 576 ++++++++++-------- src/route/index/Index.tsx | 21 +- 4 files changed, 346 insertions(+), 261 deletions(-) diff --git a/src/request/api.ts b/src/request/api.ts index bbb0f66..0976593 100644 --- a/src/request/api.ts +++ b/src/request/api.ts @@ -135,11 +135,14 @@ export const bigClassList = () => aiShopRequest.get(`/aishop/api/data/listbypare // 获取小类 export const smallClassList = (id:string) => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1/${id}`) - // 下单购买APP电子软著 export const buyAppGoods = (orderMoneyId:string) => aiShopRequest.post(`/aishop/api/apporder/pay/${orderMoneyId}`) // 获取我的app电子软著订单列表 export const appOrderList = (params:any) => aiShopRequest.get(`/aishop/api/apporder/listpage-self`, { params }) // 获取app电子软著详情 export const appOrderDetail = (appOrderId:any) => aiShopRequest.get(`/aishop/api/apporder/get/${appOrderId}`) +// 生成授权书word文件 +export const authorizeWord = (appOrderId:any,companyName:string) => aiShopRequest.get(`/aishop/api/apporder/create-file/SHOP04/${appOrderId}?name=${companyName}授权书&companyName=${companyName}`) +// 企业认证 +export const companyAuth = (appOrderId:any,params:any) => aiShopRequest.post(`aishop/api/apporder/update/1/${appOrderId}`,{ params}) // ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/src/route/AppElectron/AppEdit.tsx b/src/route/AppElectron/AppEdit.tsx index 12267bb..e261f0e 100644 --- a/src/route/AppElectron/AppEdit.tsx +++ b/src/route/AppElectron/AppEdit.tsx @@ -304,6 +304,11 @@ export default function AppEdit() { { + setCompanyInfo(val) + } + } setEditProcess={ (num: number) => { setEditProcess(num) diff --git a/src/route/AppElectron/components/AppCompany/AppCompany.tsx b/src/route/AppElectron/components/AppCompany/AppCompany.tsx index 3c44656..fd479dc 100644 --- a/src/route/AppElectron/components/AppCompany/AppCompany.tsx +++ b/src/route/AppElectron/components/AppCompany/AppCompany.tsx @@ -1,10 +1,12 @@ import { useState, useEffect } from 'react' import './app-company.css' -import { uploadFileUrl, showImage } from '../../../../request/request' +import { uploadImageUrl, showImage } from '../../../../request/request' +import { authorizeWord, companyAuth } from '../../../../request/api' import { Button, Form, Input, message, // Select, DatePicker, Upload, Image, + Spin, // Cascader } from "antd" import { LoadingOutlined, } from '@ant-design/icons'; @@ -22,18 +24,38 @@ import type { UploadProps } from 'antd'; // // pId: string; // } export default function AppCompany(props: any) { - + const [messageApi, contextHolder] = message.useMessage(); + const [downLoading, setDownLoading] = useState(false) + const validateImageUrl = () => { + if (!imageUrl) { + return Promise.reject(new Error('请上传文件')); + } + return Promise.resolve(); + }; + const validateTextImageUrl = () => { + if (!textImageUrl) { + return Promise.reject(new Error('请上传文件')); + } + return Promise.resolve(); + }; // 定义 beforeUpload 函数 const beforeUpload = (file: any) => { const isJpgOrPng = ['image/jpeg', 'image/png', 'image/bmp'].includes(file.type); if (!isJpgOrPng) { message.error('只能上传 JPG、JPEG、PNG、BMP 格式的文件!'); + form.setFieldsValue({ + 'companyPhoto': '', + }); } const isLt4M = file.size / 1024 / 1024 < 4; if (!isLt4M) { message.error('文件大小不能超过 4MB!'); + form.setFieldsValue({ + 'companyPhoto': '', + }); } return isJpgOrPng && isLt4M; + }; // type FileType = Parameters>[0]; const [loading, setLoading] = useState(false); @@ -54,13 +76,13 @@ export default function AppCompany(props: any) { // setLoading(false); // setImageUrl(url); // }); - // console.log(info.file.response.data.fileId); + console.log(info.file.response.data.fileId); setLoading(false); const fileId = info.file.response.data.fileId; const url = showImage(fileId, false); setImageUrl(url); form.setFieldsValue({ - img: fileId, + companyPhoto: fileId, }) } if (info.file.status === 'error') { @@ -69,11 +91,11 @@ export default function AppCompany(props: any) { message.error(`上传失败`); //伤处表单name为ing的值 form.setFieldsValue({ - img: '', // 将值设置为 undefined 以清除错误状态 + companyPhoto: '', // 将值设置为 undefined 以清除错误状态 }) } }; - const[textloading, setTextLoading] = useState(false); + const [textloading, setTextLoading] = useState(false); const [textImageUrl, setTextImageUrl] = useState(''); const textHandleChange: UploadProps['onChange'] = (info) => { if (info.file.status === 'uploading') { @@ -92,7 +114,7 @@ export default function AppCompany(props: any) { const url = showImage(fileId, false); setTextImageUrl(url); form.setFieldsValue({ - textImg: fileId, + companyAuth: fileId, }) } if (info.file.status === 'error') { @@ -101,7 +123,7 @@ export default function AppCompany(props: any) { message.error(`上传失败`); //伤处表单name为ing的值 form.setFieldsValue({ - textImg: '', // 将值设置为 undefined 以清除错误状态 + companyAuth: '', // 将值设置为 undefined 以清除错误状态 }) } }; @@ -139,267 +161,319 @@ export default function AppCompany(props: any) { }; - const onFinish = (values: any) => { + const onFinish = async (values: any) => { // 处理表单提交逻辑 console.log('表单提交成功', values); - submitInfo(values) + console.log('发过来的数据', props.companyInfo); + if (values != props.companyInfo) { + try { + setDownLoading(true) + const res = await companyAuth(props.appOrderId, { + appOrderId: props.appOrderId, + ...values + }) + setDownLoading(false) + console.log(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) + } + } + + + } + // submitInfo(values) + console.log('imageurl', imageUrl); + }; useEffect(() => { - // console.log('认证数据',props.companyInfo); + console.log('认证数据', props.companyInfo); if (props.companyInfo.companyName) { console.log('嘻嘻'); } }, [props.companyInfo]) return ( -
- {/* {contextHolder} */} -
-
+ + {contextHolder} +
+ {/* {contextHolder} */} +
+
-
{ - message.error('请完善信息') - }} - > -
-
-
企业/机构名称*
- - - -
- -
-
统一社会信用代码*
- - - - -
-
- -
-
-
上传证件*
-
- - - {imageUrl ? -
- -
- : } - -
-
-
{ - setImageUrl('') - form.setFieldsValue({ - img: '', // 将值设置为 undefined 以清除错误状态 - }) - }} - >删除
-
-
-
- -
- - { - }} - headers={{ 'Auth': `Bearer ${token}` }} - // disabled={!!imageUrl} - > - {textImageUrl ? -
- -
- : } - -
-
-
{ - setTextImageUrl('') - form.setFieldsValue({ - textImg: '', // 将值设置为 undefined 以清除错误状态 - }) - }} - >删除
-
-
-
-
-
上传要求:
+ { + message.error('请完善信息') + }} + >
-
1.要求不得涂改,需确保四边角完整,文字图片证件号码清晰可见
-
2.请上传小于4MB的图片(JPG、JPEG、PNG、BMP)
+
+
企业/机构名称*
+ + + +
+ +
+
统一社会信用代码*
+ + + + +
-
-
+
+
+
上传证件*
+
+ + + {imageUrl ? +
+ +
+ : } + +
+
+
{ + setImageUrl('') + form.setFieldsValue({ + companyPhoto: '', // 将值设置为 undefined 以清除错误状态 + }) + }} + >删除
+
+
+ +
+
+
上传要求:
+
+
1.要求不得涂改,需确保四边角完整,文字图片证件号码清晰可见
+
2.请上传小于4MB的图片(JPG、JPEG、PNG、BMP)
+
+
+ + + +
+ +
+
+ +
- -
-
- -
-
+ ) } diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index ff8a4c9..da9f750 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -712,7 +712,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) // 日期 @@ -1035,14 +1035,17 @@ export default function Index() { } } useEffect(() => { - nav('/app-electron', { - state: { - appKeyWords: appKeyWords, - checkStatus: appExamineStatus, - appOrderStatus: appApplyStatus - } - }) - }, [appKeyWords,appExamineStatus,appApplyStatus]) + if (location.pathname == '/app-electron') { + nav('/app-electron', { + state: { + appKeyWords: appKeyWords, + checkStatus: appExamineStatus, + appOrderStatus: appApplyStatus + } + }) + } + + }, [appKeyWords, appExamineStatus, appApplyStatus]) // 获取电子软著可选商品列表 const getAppGoodsList = async () => { try { From 2a6d12ed782b4eecad6496db418aedee24419b20 Mon Sep 17 00:00:00 2001 From: lyp Date: Wed, 28 May 2025 17:28:16 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/request/api.ts | 22 +- src/route/AppElectron/AppEdit.tsx | 102 +- src/route/AppElectron/AppElectron.tsx | 27 +- .../components/AppCompany/AppCompany.tsx | 75 +- .../components/EditAppFiles/EditAppFiles.tsx | 940 +++++++++----- .../components/EditAppInfo/EditAppInfo.tsx | 1092 +++++++++++------ src/route/Correction/Correction.tsx | 4 +- src/route/index/Index.tsx | 18 +- 8 files changed, 1500 insertions(+), 780 deletions(-) diff --git a/src/request/api.ts b/src/request/api.ts index b3710fe..8b50a97 100644 --- a/src/request/api.ts +++ b/src/request/api.ts @@ -127,13 +127,13 @@ export const unbind = () => phoneRequest.get(`/operator/api/user-wx-update-usern // APP电子软著接口---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //获取APP电子软著可买商品展示列表 -export const appGoodsList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/71831561-108f-49f0-92c8-f9e4f0483c02`) +export const appGoodsList = () => aiShopRequest.get(`/aishop/api/apporder/money-list`) // 获取运行系统选项 export const runSystemList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/9fc8636a-b930-4e82-beb3-db7ca6151e6b`) // 获取大类选项 export const bigClassList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1`) // 获取小类 -export const smallClassList = (id:string) => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1/${id}`) +export const twoClass = (id:string) => aiShopRequest.get(`/aishop/api/data/listbyparentid/${id}`) // 下单购买APP电子软著 export const buyAppGoods = (orderMoneyId:string) => aiShopRequest.post(`/aishop/api/apporder/pay/${orderMoneyId}`) @@ -142,7 +142,21 @@ export const appOrderList = (params:any) => aiShopRequest.get(`/aishop/api/appor // 获取app电子软著详情 export const appOrderDetail = (appOrderId:any) => aiShopRequest.get(`/aishop/api/apporder/get/${appOrderId}`) // 生成授权书word文件 -export const authorizeWord = (appOrderId:any,companyName:string) => aiShopRequest.get(`/aishop/api/apporder/create-file/SHOP04/${appOrderId}?name=${companyName}授权书&companyName=${companyName}`) -// 企业认证 +export const authorizeWord = (appOrderId:string,companyName:string) => aiShopRequest.get(`/aishop/api/apporder/create-file/SHOP04/${appOrderId}?name=${companyName}授权书&companyName=${companyName}`) +// 生成合协议word文件 +export const agreementWord = (appOrderId:string,appName:string,versionName:string) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP01/${appOrderId}?name=${appName}合作协议&appName=${appName}&versionName=${versionName}`) +// 生成源码文档word文件 +export const sourceCodeWord = (appOrderId:string,) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP02/${appOrderId}?name=源码文档示例`) +// 生成软件文档word文件 +export const softwareDocumentWord = (appOrderId:string,) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP03/${appOrderId}?name=软件文档示例`) + +// 获取文件详细信息 +export const fileDetail = (fileId:string) => aiShopRequest.get(`aishop/api/file/list?ids=${fileId}`) +// 第一步 企业认证 export const companyAuth = (appOrderId:any,params:any) => aiShopRequest.post(`aishop/api/apporder/update/1/${appOrderId}`,params) +// 第二步 软件基本信息填写 +export const softwareInfo = (appOrderId:any,params:any) => aiShopRequest.post(`aishop/api/apporder/update/2/${appOrderId}`,params) +// 第三步 上传鉴别材料 +export const uploadMaterial = (appOrderId:any,params:any) => aiShopRequest.post(`/aishop/api/apporder/update/3/${appOrderId}`,params) + // ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/src/route/AppElectron/AppEdit.tsx b/src/route/AppElectron/AppEdit.tsx index e261f0e..3bd8361 100644 --- a/src/route/AppElectron/AppEdit.tsx +++ b/src/route/AppElectron/AppEdit.tsx @@ -8,7 +8,12 @@ import EditAppFiles from './components/EditAppFiles/EditAppFiles'; import AppInfo from './components/AppInfo/AppInfo'; import AppCompany from './components/AppCompany/AppCompany'; import { useParams } from 'react-router-dom' -import { runSystemList, bigClassList, smallClassList } from '../../request/api' +import { + runSystemList, bigClassList, + // twoClass, + // fileDetail +} from '../../request/api' +// import { showImage } from '../../request/request' import './app-edit.css' import { RightOutlined @@ -25,7 +30,7 @@ export default function AppEdit() { const appOrderId = pathParams.appOrderId; const [systemList, setSystemList] = useState([]); // 运行系统选项 const [bigClass, setBigClass] = useState([]); // 软件分类(大类)选项 - const [smallClass, setSmallClass] = useState([]); // 软件分类(小类)选项 + // const [smallClass, setSmallClass] = useState([]); // 软件分类(小类)选项 // 获取运行系统选项 const getRunSystemList = async () => { try { @@ -59,17 +64,17 @@ export default function AppEdit() { const getBigClassList = async () => { try { const res: any = await bigClassList(); - console.log('大类选项', res.map((item: any) => { + // console.log('大类选项', res.map((item: any) => { + // return { + // label: item.dataName, + // value: item.dataId, + // } + // })); + setBigClass(res.map((item: any) => { return { label: item.dataName, value: item.dataId, } - })); - setBigClass(res.map((item: any) => { - return { - label: item.dataId, - value: item.dataName, - } })) } catch (error: any) { @@ -85,29 +90,29 @@ export default function AppEdit() { } } // 获取小类选项 - const getSmallClassList = async (id: string) => { - try { - const res: any = await smallClassList(id); - console.log(res); - setSmallClass(res.map((item: any) => { - return { - label: item.dataId, - value: item.dataName, - } - })) - } catch (error: any) { + // const getSmallClassList = async (id: string) => { + // try { + // const res: any = await twoClass(id); + // console.log('小类', res); + // setSmallClass(res.map((item: any) => { + // return { + // label: item.dataId, + // value: item.dataName, + // } + // })) + // } 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) - } - } - } + // 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 [loading, setLoading] = useState(false); const [editProcess, setEditProcess] = useState(1); @@ -132,16 +137,20 @@ export default function AppEdit() { projOwnerName: '',//著作权人姓名 projOwnerIdentity: '',//著作权人证件号 projOwnerId: '',//著作权人信息ID + getFile: '',//获取文件 }) // 材料信息 const [filesInfo, setFilesInfo] = useState({ sourceCodeDocFile: '',//源码 softwareDocFile: '',//软件 }) + // 文件想想请 + // const [fileList, setFileList] = useState([]); // 获取详情 const getAppOrderDetail = async () => { try { setLoading(true) + const res: any = await appOrderDetail(appOrderId); console.log('详情', res); setCompanyInfo({ @@ -163,12 +172,24 @@ export default function AppEdit() { projOwnerName: res.projOwnerName,//著作权人姓名 projOwnerIdentity: res.projOwnerIdentity,//著作权人证件号 projOwnerId: res.projOwnerId,//著作权人信息ID + getFile: res.getFile,//获取文件 }) setFilesInfo({ sourceCodeDocFile: res.sourceCodeDocFile,//源码 softwareDocFile: res.softwareDocFile,//软件 }) setEditProcess(Number(res.appOrderProgress) + 1) + // const fileres: any = await fileDetail(res.getFile) + // console.log('文件详情', fileres); + + // setFileList([ + // { + // uid: fileres[0].fileId, + // name: fileres[0].fileName, + // status: 'done', + // url: showImage(fileres[0].fileId) + // } + // ]) setLoading(false) } catch (error: any) { @@ -196,9 +217,9 @@ export default function AppEdit() { getRunSystemList() getBigClassList() - if (appInfo.bigClassify) { - getSmallClassList(appInfo.bigClassify) - } + // if (appInfo.bigClassify) { + // getSmallClassList(appInfo.bigClassify) + // } }, []); const height = window.innerHeight - 180; return ( @@ -327,8 +348,14 @@ export default function AppEdit() { appOrderId={appOrderId} bigClass={bigClass} systemList={systemList} - smallClass={smallClass} + // smallClass={smallClass} + // fileList={fileList} appInfo={appInfo} + setAppInfo={ + (val: any) => { + setAppInfo(val) + } + } setEditProcess={ (num: number) => { setEditProcess(num) @@ -346,6 +373,11 @@ export default function AppEdit() { { + setFilesInfo(val) + } + } setEditProcess={ (num: number) => { setEditProcess(num) diff --git a/src/route/AppElectron/AppElectron.tsx b/src/route/AppElectron/AppElectron.tsx index 430a7c0..49674cd 100644 --- a/src/route/AppElectron/AppElectron.tsx +++ b/src/route/AppElectron/AppElectron.tsx @@ -21,6 +21,8 @@ interface DataType { appOrderPayMoney: number; //支付金额; appOrderPayTime: string; //支付时间; gmtCreate: string; + bigClassifyName: string; //软件分类(大类) + subClassifyName: string; //软件分类(子类) } export default function AppElectron() { const nav = useNavigate(); @@ -33,12 +35,14 @@ export default function AppElectron() { dataIndex: 'index', key: 'index', align: 'center', + fixed: 'left', width: 90, render: (_text, _record, index) => (page - 1) * 10 + index + 1, // 显示序号,从1开始 }, { title: '项目名称', + fixed: 'left', dataIndex: 'appName', key: 'appOrderId', align: 'center', @@ -58,13 +62,13 @@ export default function AppElectron() { dataIndex: 'bigClassify', align: 'center', key: 'appOrderId', - width: 120, + width: 200, ellipsis: { showTitle: true, }, - render: (text) => ( + render: (text, record) => ( - {text ? text : '未完善'} + {text ? ` ${record.bigClassifyName} / ${record.subClassifyName}` : '未完善'} ) }, @@ -117,15 +121,19 @@ export default function AppElectron() { // dataIndex: 'contractManagementId', align: 'center', key: 'appOrderId', - width: 80, + width: 200, + // bordeLeft: true, + fixed: 'right', render: (record) => (
{ nav(`/app-edit/${record.appOrderId}`) // console.log(record); - + }}>编辑
) @@ -136,8 +144,8 @@ export default function AppElectron() { const height = window.innerHeight - 180; const { state } = useLocation() const keywords = state ? state.appKeyWords : '' - const checkStatus = state? state.checkStatus : '' - const appOrderStatus = state? state.appOrderStatus : '' + const checkStatus = state ? state.checkStatus : '' + const appOrderStatus = state ? state.appOrderStatus : '' const [page, setPage] = useState(1); // const [total, setTotal] = useState(0); const [loading, setLoading] = useState(false); @@ -146,7 +154,7 @@ export default function AppElectron() { const getAppOrderList = async (page: number) => { try { setLoading(true) - const res: any = await appOrderList({ page, keywords, rows: 10,checkStatus,appOrderStatus }) + const res: any = await appOrderList({ page, keywords, rows: 10, checkStatus, appOrderStatus }) // console.log(res); // setData(res.rows) // setTotal(res.total) @@ -174,7 +182,7 @@ export default function AppElectron() { useEffect(() => { setPage(1) getAppOrderList(1) - }, [state,checkStatus,appOrderStatus]) + }, [state, checkStatus, appOrderStatus]) return (
@@ -210,6 +218,7 @@ export default function AppElectron() { scroll={{ y: `${height - 150}px` }} dataSource={data.rows} columns={columns} + bordered // pagination={{ // defaultPageSize: 10, // 设置默认一页显示 5 条数据 // }} diff --git a/src/route/AppElectron/components/AppCompany/AppCompany.tsx b/src/route/AppElectron/components/AppCompany/AppCompany.tsx index 31a7d05..540142b 100644 --- a/src/route/AppElectron/components/AppCompany/AppCompany.tsx +++ b/src/route/AppElectron/components/AppCompany/AppCompany.tsx @@ -142,7 +142,7 @@ export default function AppCompany(props: any) { // }; const token = sessionStorage.getItem('token') - + const height = window.innerHeight - 460; const [form] = Form.useForm(); @@ -154,15 +154,43 @@ export default function AppCompany(props: any) { form.submit(); }; + function deepCompareObjects(obj1: any, obj2: any): boolean { + // 若两个值严格相等,直接返回 true + if (obj1 === obj2) { + return true; + } + // 若其中一个值为 null 或不是对象类型,返回 false + if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) { + return false; + } + + // 获取两个对象的键数组 + const keys1 = Object.keys(obj1); + const keys2 = Object.keys(obj2); + + // 若键的数量不同,返回 false + if (keys1.length !== keys2.length) { + return false; + } + + // 遍历键,递归比较对应的值 + for (const key of keys1) { + if (!keys2.includes(key) || !deepCompareObjects(obj1[key], obj2[key])) { + return false; + } + } + + return true; + } const onFinish = async (values: any) => { // 处理表单提交逻辑 // console.log('表单提交成功', values); // console.log('发过来的数据', props.companyInfo); - if (JSON.stringify(values) !== JSON.stringify(props.companyInfo)) { + if (!deepCompareObjects(values, props.companyInfo)) { try { setDownLoading(true) - const res = await companyAuth(props.appOrderId, { + await companyAuth(props.appOrderId, { appOrderId: props.appOrderId, ...values }) @@ -171,7 +199,7 @@ export default function AppCompany(props: any) { }) props.setEditProcess(2); setDownLoading(false) - console.log(res); + // console.log(res); } catch (error: any) { setDownLoading(false) if (error.response) { @@ -186,17 +214,17 @@ export default function AppCompany(props: any) { } - }else{ + } else { props.setEditProcess(2); } - + }; useEffect(() => { - console.log('认证数据', props.companyInfo); + // console.log('认证数据', props.companyInfo); if (props.companyInfo.companyName) { - console.log('嘻嘻'); + // console.log('嘻嘻'); form.setFieldsValue({ companyName: props.companyInfo.companyName, companyNumber: props.companyInfo.companyNumber, @@ -356,15 +384,30 @@ export default function AppCompany(props: any) { onClick={async () => { // alert('下载授权书') if (form.getFieldValue('companyName')) { + try { + setDownLoading(true) + const res: any = await authorizeWord( + props.appOrderId, + form.getFieldValue('companyName'), + ) + setDownLoading(false) + window.open(showImage(res.fileId, false)); + } catch (error: any) { + setDownLoading(false) + 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 { + setDownLoading(false) + } // console.log(form.getFieldValue('companyName')); - setDownLoading(true) - const res: any = await authorizeWord( - props.appOrderId, - form.getFieldValue('companyName'), - ) - setDownLoading(false) - window.open(showImage(res.fileId, false)); - console.log(res); + } else { message.error('请完善企业/机构名称') diff --git a/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx b/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx index c5e26f9..693bfef 100644 --- a/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx +++ b/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx @@ -1,15 +1,64 @@ -import { useState } from 'react' -import { Button, Form, Upload, message, Modal } from "antd" -import { uploadFileUrl } from '../../../../request/request' +import { useEffect, useState } from 'react' +import { Button, Form, Upload, message, Modal, Spin } from "antd" +import { uploadFileUrl, showImage } from '../../../../request/request' import { UploadOutlined } from '@ant-design/icons'; +import { sourceCodeWord, softwareDocumentWord, uploadMaterial, fileDetail } from '../../../../request/api' import './edit-app-files.css' export default function EditAppFiles(props: any) { + const [messageApi, contextHolder] = message.useMessage(); + const [loading, setLoading] = useState(false) + const downCodeWord = async () => { + try { + setLoading(true) + const res: any = await sourceCodeWord(props.appOrderId) + window.open(showImage(res.fileId, false)); + setLoading(false) + + } catch (error: any) { + setLoading(false) + 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 downSoftWord = async () => { + try { + setLoading(true) + const res: any = await softwareDocumentWord(props.appOrderId) + setLoading(false) + + window.open(showImage(res.fileId, false)); + + } catch (error: any) { + setLoading(false) + 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 [codeVisible, setCodeVisible] = useState(false) // 软件文档弹窗 const [softVisible, setSoftVisible] = useState(false) // 定义允许上传的文件格式 - const ALLOWED_FILE_TYPES = ['.pdf', '.doc', '.docx', '.jpg', '.jpeg', '.png']; + const ALLOWED_FILE_TYPES = ['.pdf']; const beforeUpload = (file: File) => { const fileExt = file.name.slice(file.name.lastIndexOf('.')).toLowerCase(); if (!ALLOWED_FILE_TYPES.includes(fileExt)) { @@ -26,57 +75,69 @@ export default function EditAppFiles(props: any) { }; // 上传文件源码文档列表 const [upCodeArray, setUpCodeArray] = useState([]) - const [codeDis, setCodeDis] = useState(false) - const validateCodeFileUpload = (_rule: any, value: any) => { - if (!value || value.fileList.length === 0) { - return Promise.reject('请选择上传文件'); + // const [codeDis, setCodeDis] = useState(false) + const isUploading = upCodeArray.some((file: any) => file.status === 'uploading'); + const validateCodeFileUpload = () => { + // if (!value || value.fileList.length === 0) { + // return Promise.reject('请选择上传文件'); - } - const file = value.fileList[0]; - if (file.status === 'uploading') { - setCodeDis(true) - return Promise.reject('文件上传中,请稍候'); - } else if (file.status === 'error') { - setCodeDis(true) - setUpCodeArray([]) - return Promise.reject('文件上传失败,请删除后重新上传'); + // } + // const file = value.fileList[0]; + // if (file.status === 'uploading') { + // return Promise.reject('文件上传中,请稍候'); + // } else if (file.status === 'error') { + // setUpCodeArray([]) + // return Promise.reject('文件上传失败,请删除后重新上传'); - } else if (file.status !== 'done') { - setCodeDis(true) - setUpCodeArray([]) + // } else if (file.status !== 'done') { + // setUpCodeArray([]) - return Promise.reject('文件上传失败,请删除后重新上传'); - } else if (file.status === 'done') { - setCodeDis(true) - return Promise.resolve(); + // return Promise.reject('文件上传失败,请删除后重新上传'); + // } else if (file.status === 'done') { + // return Promise.resolve(); + // } + // return Promise.resolve(); + + + // 若开发方式为合作开发且未上传文件,则验证失败 + if ((upCodeArray.length === 0 || isUploading)) { + const errorMessage = isUploading ? '文件正在上传中,请等待上传完成' : '请上传源码文档'; + return Promise.reject(new Error(errorMessage)); } return Promise.resolve(); }; // 上传文件软件文档列表 const [upSoftArray, setUpSoftArray] = useState([]) - const [softDis, setSoftDis] = useState(false) - const validateSoftFileUpload = (_rule: any, value: any) => { - if (!value || value.fileList.length === 0) { - return Promise.reject('请选择上传文件'); + const upLodaing = upSoftArray.some((file: any) => file.status === 'uploading'); - } - const file = value.fileList[0]; - if (file.status === 'uploading') { - setSoftDis(true) - return Promise.reject('文件上传中,请稍候'); - } else if (file.status === 'error') { - setSoftDis(true) - setUpSoftArray([]) - return Promise.reject('文件上传失败,请删除后重新上传'); + // const [softDis, setSoftDis] = useState(false) + const validateSoftFileUpload = () => { + // if (!value || value.fileList.length === 0) { + // return Promise.reject('请选择上传文件'); - } else if (file.status !== 'done') { - setSoftDis(true) - setUpSoftArray([]) + // } + // const file = value.fileList[0]; + // if (file.status === 'uploading') { + // setSoftDis(true) + // return Promise.reject('文件上传中,请稍候'); + // } else if (file.status === 'error') { + // setSoftDis(true) + // setUpSoftArray([]) + // return Promise.reject('文件上传失败,请删除后重新上传'); - return Promise.reject('文件上传失败,请删除后重新上传'); - } else if (file.status === 'done') { - setSoftDis(true) - return Promise.resolve(); + // } else if (file.status !== 'done') { + // setSoftDis(true) + // setUpSoftArray([]) + + // return Promise.reject('文件上传失败,请删除后重新上传'); + // } else if (file.status === 'done') { + // setSoftDis(true) + // return Promise.resolve(); + // } + // return Promise.resolve(); + if ((upSoftArray.length === 0 || upLodaing)) { + const errorMessage = upLodaing ? '文件正在上传中,请等待上传完成' : '请上传软件文档'; + return Promise.reject(new Error(errorMessage)); } return Promise.resolve(); }; @@ -86,173 +147,379 @@ export default function EditAppFiles(props: any) { const [form] = Form.useForm(); const handleSubmit = () => { // console.log(form); - props.setEditProcess(4); + // props.setEditProcess(4); // 调用表单实例的 submit 方法 form.submit(); }; - const submitInfo = (values: any) => { - message.success('提交成功'); - console.log(values); - props.setEditProcess(3); + function deepCompareObjects(obj1: any, obj2: any): boolean { + // 若两个值严格相等,直接返回 true + if (obj1 === obj2) { + return true; + } + // 若其中一个值为 null 或不是对象类型,返回 false + if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) { + return false; + } + // 获取两个对象的键数组 + const keys1 = Object.keys(obj1); + const keys2 = Object.keys(obj2); + + // 若键的数量不同,返回 false + if (keys1.length !== keys2.length) { + return false; + } + + // 遍历键,递归比较对应的值 + for (const key of keys1) { + if (!keys2.includes(key) || !deepCompareObjects(obj1[key], obj2[key])) { + return false; + } + } + + return true; } - const onFinish = (values: any) => { + const onFinish = async (values: any) => { // 处理表单提交逻辑 - console.log('表单提交成功', values); - submitInfo(values) - console.log(upCodeArray); + // console.log('表单提交成功', values); + // submitInfo(values) + // console.log(upCodeArray); + // deepCompareObjects(values, props.filesInfo) + // console.log(!deepCompareObjects(values, props.filesInfo)); + // return + if (!deepCompareObjects(values, props.filesInfo)) { + try { + setLoading(true) + await uploadMaterial(props.appOrderId, { + ...values + }) + props.setFilesInfo( + { ...values } + ) + props.setEditProcess(4); + + + setLoading(false) + } catch (error: any) { + setLoading(false) + 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) + } + } else { + props.setEditProcess(4); + } + + + }; + const getCodeFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + console.log('文件详情', res); + setUpCodeArray([ + { + uid: res[0].fileId, + name: res[0].fileName, + status: 'done', + url: showImage(res[0].fileId, false) + }, + + ]) + } 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 getSoftFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + console.log('文件详情', res); + setUpSoftArray([ + { + uid: res[0].fileId, + name: res[0].fileName, + status: 'done', + url: showImage(res[0].fileId, false) + }, + + ]) + } 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) + } + } + } + useEffect(() => { + + if (props.filesInfo.sourceCodeDocFile) { + getCodeFileDetail(props.filesInfo.sourceCodeDocFile) + } + if (props.filesInfo.softwareDocFile) { + getSoftFileDetail(props.filesInfo.softwareDocFile) + } + form.setFieldsValue({ + sourceCodeDocFile: props.filesInfo.sourceCodeDocFile, + softwareDocFile: props.filesInfo.softwareDocFile, + }) + }, [props.filesInfo]) return ( -
-
-
-
+
+ {contextHolder} +
+
-
{ - const errorMessages = errorInfo.errorFields.map((field: any) => field.errors[0]); - if (errorMessages.some((msg: any) => msg.includes('文件上传失败'))) { - message.error('文件上传失败,请重新上传'); - } else if (errorMessages.some((msg: any) => msg.includes('文件上传中'))) { - message.error('文件上传中,请稍候'); - } else if (errorMessages.some((msg: any) => msg.includes('文件状态异常'))) { - message.error('文件状态异常,请重新上传'); - } else { - message.error('请完善信息'); - } - }} - > -
-
-
+ { + const errorMessages = errorInfo.errorFields.map((field: any) => field.errors[0]); + if (errorMessages.some((msg: any) => msg.includes('文件上传失败'))) { + message.error('文件上传失败,请重新上传'); + } else if (errorMessages.some((msg: any) => msg.includes('文件上传中'))) { + message.error('文件上传中,请稍候'); + } else if (errorMessages.some((msg: any) => msg.includes('文件状态异常'))) { + message.error('文件状态异常,请重新上传'); + } else { + message.error('请完善信息'); + } + }} + > +
+
-
源码文档*
-
- - { - console.log(fileList); - // console.log(upCodeArray); +
源码文档*
+
+ + { + const { fileList } = info; + setUpCodeArray(fileList); + if (info.file.status === 'uploading') { + return; + } + if (info.file.status === 'done') { + // console.log(info.file.response.data); + setUpCodeArray([ + { + uid: info.file.response.data.fileId, + name: info.file.response.data.fileName, + status: 'done', + url: showImage(info.file.response.data.fileId, false) + } + ]) - }} - onRemove={() => { - setUpCodeArray([]) - setCodeDis(false) - }} - beforeUpload={beforeUpload} - onPreview={handlePreview} - // onChange={handleUploadChange} - headers={{ 'Auth': `Bearer ${token}` }} - > - - - + form.setFieldsValue({ + sourceCodeDocFile: info.file.response.data.fileId, + }); + } + if (info.file.status === 'error') { + // 显示错误提示 + message.error(`上传失败`); + form.setFieldsValue({ + sourceCodeDocFile: '', // 清除表单值 + }); + } + // console.log(upCodeArray); + + }} + onRemove={() => { + setUpCodeArray([]) + form.setFieldsValue({ + sourceCodeDocFile: '', // 清除表单值 + }); + }} + beforeUpload={beforeUpload} + onPreview={handlePreview} + // onChange={handleUploadChange} + headers={{ 'Auth': `Bearer ${token}` }} + > + + + +
+ [ 下载1 ]
[ 下载 ] -
- { - setCodeVisible(true) + // background:'red', + top: '80px', }} - >《应用软件源程序提交注意事项及相关规范》 -
-
-
{ + setCodeVisible(true) + }} + >《应用软件源程序提交注意事项及相关规范》 +
+
-
软件文档*
-
- - { - console.log(fileList); - }} - onRemove={() => { - setUpSoftArray([]) - setSoftDis(false) - }} - beforeUpload={beforeUpload} - // onChange={handleUploadChange} - headers={{ 'Auth': `Bearer ${token}` }} - > - - - +
软件文档*
+
+ + { + const { fileList } = info; + setUpSoftArray(fileList); + if (info.file.status === 'uploading') { + return; + } + if (info.file.status === 'done') { + // console.log(info.file.response.data); + setUpSoftArray([ + { + uid: info.file.response.data.fileId, + name: info.file.response.data.fileName, + status: 'done', + url: showImage(info.file.response.data.fileId, false) + } + ]) + + form.setFieldsValue({ + softwareDocFile: info.file.response.data.fileId, + }); + } + if (info.file.status === 'error') { + // 显示错误提示 + message.error(`上传失败`); + form.setFieldsValue({ + softwareDocFile: '', // 清除表单值 + }); + } + + }} + onRemove={() => { + setUpSoftArray([]) + form.setFieldsValue({ + softwareDocFile: '', // 清除表单值 + }); + // setSoftDis(false) + }} + beforeUpload={beforeUpload} + // onChange={handleUploadChange} + headers={{ 'Auth': `Bearer ${token}` }} + > + + + +
+ [ 下载 ]
[ 下载 ] -
- { - setSoftVisible(true) + // background:'red', + top: '80px', }} - >《应用软件文档提交注意事项及相关规范》 + onClick={() => { + setSoftVisible(true) + }} + >《应用软件文档提交注意事项及相关规范》 +
-
- -
- {/*
+ +
+ {/*
{Array.from({ length: 100 }).map((_, index) => ( */} -
- -
-
- - - -
- { - setCodeVisible(false) - - }}> - -
-
- -
-
- 源码文档需提交PDF格式的文件,软件源程序代码由前、后各连续30页组成。软件源程序多于60页的需要提交连续的前30及后30页,前30页和后30页应是各自连续的。 -
-
- 1、源程序的第1页应当是程序或一个功能模块的开头,源程序的第60页应当是程序或一个功能模块的结尾,不满60页的需全部提供; -
-
- 2、源程序每页应该≥50行,并标明页码; -
-
- 3、编写源程序的语言应和申请表填写的语言保持一致; -
-
- 4、源程序应和文档中介绍的主要功能存在关联性; -
-
- 5、源程序编写内容中出现的署名或版权声明以及任何与权利归属有关的内容,著作权人名称应与申请的著作权人保持一致; -
-
- 6、源程序中出现著作权人成立之前的创建或修改时间的,申请人应该确认是否存在前期开发行为,如有,需提交《前期开发说明》; - -
-
- 7、源程序中尽量不要出现软件开发完成之后的日期;(出现软件完成日期之后的创建或修改时间的,如果只是纠错性的修改、适应性的调整,不造成软件的功能或性能发生重大变化而发生软件版本升级的,是正常合理的。) -
-
- 8、源程序中出现他人的自由软件/开源软件的版权声明或相关许可证(License)信息的,且申请人认可源代码中含有他人的自由软件/开源软件源代码的情况,申请人需要提供相关的书面说明; -
-
- 9、源程序如果有页眉,页面的软件名称、版本号与申请信息及其他申请材料中的软件名称、版本号应当一致; -
-
- 10、源程序中的软件名称应与申请信息中的软件全称或简称一致,版本号也应该保持一致; -
-
- 11、源程序如果有文件名,应和申请的软件名称或权利人保持一致,文件名可不填。 -
-
- 12、源程序中不能含有危害国家安全、低俗、情色等非法内容。 -
-
- { - setSoftVisible(false) - - }}> - -
-
- -
-
- 文档指软件的使用说明书或者设计说明书(选择其一提交),需提交PDF格式。一般应提交10-60页,整个文档不到60页的应提交全部,超过60页时,提交前、后各连续的30页,文档应图文并茂,语句通顺,每页应≥30行(有图除外)。 -
-
- 1、软件使用说明书主要内容要求:从打开软件起开始截取软件的主要功能界面图,截图应带有主界面,不可截部分图,依次为主界面展示、界面的跳转,主要功能模块依次介绍,主要功能都应介绍。截图应截取完整的软件界面,且图片清晰可辨,需有详细的文字介绍,介绍其主要功能如何使用,上一个界面是通过什么操作跳转至下一个界面的; -
-
- 2、软件设计说明书主要内容要求:应包含软件的基本处理流程、程序系统的组织结构、功能模块划分、接口和数据结构设计等主要设计内容; - -
-
- 3、文档应和源程序存在一定的关联性; - -
-
- 4、文档中截图不能含有他人的商标,如使用他人商标,应提交《商标使用授权书》; - -
-
- 5、截图界面需和申请表中填写的硬件环境、软件环境相匹配; - -
-
- - 6、文档中不能出现重复截图; - -
-
- 7、文档页眉(如果有)的软件名称、版本号与申请表单及其他申请材料中的软件名称、版本号应当一致; - -
-
- 8、文档内容(包括文字、截图等)中的软件名称应与申请表单中的软件全称或简称一致,版本号也应该保持一致; - -
-
- 9、文档中出现的署名或版权声明以及任何与权利归属有关的内容,著作权人名称应与申请表单中一致; - -
-
- - 10、文档应标明页码; -
-
- 11、文档的文件名应和申请的软件名称或权利人保持一致,文件名可不填; - -
-
- 12、文档中不能含有危害国家安全、低俗、情色等非法内容。 - -
+
+
+ +
- + { + setCodeVisible(false) -
+ }}> + +
+
+ +
+
+ 源码文档需提交PDF格式的文件,软件源程序代码由前、后各连续30页组成。软件源程序多于60页的需要提交连续的前30及后30页,前30页和后30页应是各自连续的。 +
+
+ 1、源程序的第1页应当是程序或一个功能模块的开头,源程序的第60页应当是程序或一个功能模块的结尾,不满60页的需全部提供; +
+
+ 2、源程序每页应该≥50行,并标明页码; +
+
+ 3、编写源程序的语言应和申请表填写的语言保持一致; +
+
+ 4、源程序应和文档中介绍的主要功能存在关联性; +
+
+ 5、源程序编写内容中出现的署名或版权声明以及任何与权利归属有关的内容,著作权人名称应与申请的著作权人保持一致; +
+
+ 6、源程序中出现著作权人成立之前的创建或修改时间的,申请人应该确认是否存在前期开发行为,如有,需提交《前期开发说明》; + +
+
+ 7、源程序中尽量不要出现软件开发完成之后的日期;(出现软件完成日期之后的创建或修改时间的,如果只是纠错性的修改、适应性的调整,不造成软件的功能或性能发生重大变化而发生软件版本升级的,是正常合理的。) +
+
+ 8、源程序中出现他人的自由软件/开源软件的版权声明或相关许可证(License)信息的,且申请人认可源代码中含有他人的自由软件/开源软件源代码的情况,申请人需要提供相关的书面说明; +
+
+ 9、源程序如果有页眉,页面的软件名称、版本号与申请信息及其他申请材料中的软件名称、版本号应当一致; +
+
+ 10、源程序中的软件名称应与申请信息中的软件全称或简称一致,版本号也应该保持一致; +
+
+ 11、源程序如果有文件名,应和申请的软件名称或权利人保持一致,文件名可不填。 +
+
+ 12、源程序中不能含有危害国家安全、低俗、情色等非法内容。 +
+
+
+ { + setSoftVisible(false) + + }}> + +
+
+ +
+
+ 文档指软件的使用说明书或者设计说明书(选择其一提交),需提交PDF格式。一般应提交10-60页,整个文档不到60页的应提交全部,超过60页时,提交前、后各连续的30页,文档应图文并茂,语句通顺,每页应≥30行(有图除外)。 +
+
+ 1、软件使用说明书主要内容要求:从打开软件起开始截取软件的主要功能界面图,截图应带有主界面,不可截部分图,依次为主界面展示、界面的跳转,主要功能模块依次介绍,主要功能都应介绍。截图应截取完整的软件界面,且图片清晰可辨,需有详细的文字介绍,介绍其主要功能如何使用,上一个界面是通过什么操作跳转至下一个界面的; +
+
+ 2、软件设计说明书主要内容要求:应包含软件的基本处理流程、程序系统的组织结构、功能模块划分、接口和数据结构设计等主要设计内容; + +
+
+ 3、文档应和源程序存在一定的关联性; + +
+
+ 4、文档中截图不能含有他人的商标,如使用他人商标,应提交《商标使用授权书》; + +
+
+ 5、截图界面需和申请表中填写的硬件环境、软件环境相匹配; + +
+
+ + 6、文档中不能出现重复截图; + +
+
+ 7、文档页眉(如果有)的软件名称、版本号与申请表单及其他申请材料中的软件名称、版本号应当一致; + +
+
+ 8、文档内容(包括文字、截图等)中的软件名称应与申请表单中的软件全称或简称一致,版本号也应该保持一致; + +
+
+ 9、文档中出现的署名或版权声明以及任何与权利归属有关的内容,著作权人名称应与申请表单中一致; + +
+
+ + 10、文档应标明页码; +
+
+ 11、文档的文件名应和申请的软件名称或权利人保持一致,文件名可不填; + +
+
+ 12、文档中不能含有危害国家安全、低俗、情色等非法内容。 + +
+ + +
+
+ +
+ ) } diff --git a/src/route/AppElectron/components/EditAppInfo/EditAppInfo.tsx b/src/route/AppElectron/components/EditAppInfo/EditAppInfo.tsx index 5c6523d..697657d 100644 --- a/src/route/AppElectron/components/EditAppInfo/EditAppInfo.tsx +++ b/src/route/AppElectron/components/EditAppInfo/EditAppInfo.tsx @@ -1,15 +1,80 @@ import { useEffect, useState } from 'react' import BelongPeople from '../../../../components/BelongPeople/BelongPeople.tsx' -import { Button, Form, Input, message, Select, Modal, DatePicker, Upload } from "antd" +import { Button, Form, Input, message, Select, Modal, DatePicker, Upload, Spin } from "antd" import { UploadOutlined } from '@ant-design/icons'; -import { uploadFileUrl } from '../../../../request/request' +import { uploadFileUrl, showImage } from '../../../../request/request' +import { twoClass, agreementWord, softwareInfo, fileDetail } from '../../../../request/api' import './edit-app-info.css' import locale from 'antd/es/date-picker/locale/zh_CN'; +import dayjs, { } from 'dayjs'; export default function EditAppInfo(props: any) { + const [downLoading, setDownLoading] = useState(false) + const [messageApi, contextHolder] = message.useMessage(); + // const [upFileId, setUpFileId] = useState('') //上传文件id + // const [upFileName, setUpFileName] = useState('') //上传文件名称 + // 大类 + const [bigClass, setBigClass] = useState('') + // 小类 + const [smallClassList, setSmallClassList] = useState([]) + // 获取小类 + const getSmallClassList = async (id: string) => { + try { + const res: any = await twoClass(id) + console.log(res); + setSmallClassList(res.map((item: any) => { + return { + label: item.dataName, + value: item.dataId, + } + })) + } 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) + } + } + } + useEffect(() => { + if (bigClass) { + // 获取小类 + getSmallClassList(bigClass) + } + }, [bigClass]) + const [upSoftArray, setUpSoftArray] = useState([ + // { + // uid: '1', + // name: 'example.pdf', + // status: 'done', + // url: 'http://gips3.baidu.com/it/u=3886271102,3123389489&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960' + // }, + ]) + // 检查是否存在上传中的文件 + const isUploading = upSoftArray.some((file: any) => file.status === 'uploading'); + const validateFileUpload = () => { + // if (upSoftArray.length == 0) { + // return Promise.reject(new Error('请上传合作协议')); + // } + // return Promise.resolve(); + const values = form.getFieldsValue(); + const developWay = values.developWay; + + // 若开发方式为合作开发且未上传文件,则验证失败 + if (developWay === '合作开发' && (upSoftArray.length === 0 || isUploading)) { + const errorMessage = isUploading ? '文件正在上传中,请等待上传完成' : '请上传合作协议'; + return Promise.reject(new Error(errorMessage)); + } + return Promise.resolve(); + }; const token = sessionStorage.getItem('token') const [upShow, setUpShow] = useState(false) //上传合作协议是否显示 // 定义允许上传的文件格式 - const ALLOWED_FILE_TYPES = ['.pdf', '.doc', '.docx', '.jpg', '.jpeg', '.png']; + const ALLOWED_FILE_TYPES = ['.pdf',]; const beforeUpload = (file: File) => { const fileExt = file.name.slice(file.name.lastIndexOf('.')).toLowerCase(); if (!ALLOWED_FILE_TYPES.includes(fileExt)) { @@ -19,8 +84,7 @@ export default function EditAppInfo(props: any) { return true; }; // 上传文件软件文档列表 - const [upSoftArray, setUpSoftArray] = useState([]) - const [softDis, setSoftDis] = useState(false) + // const [softDis, setSoftDis] = useState(false) // 所属者弹窗 const [belongModal, setBelongModal] = useState(false) const [belongPeopleInfo, setBelongPeopleInfo] = useState({ @@ -37,198 +101,373 @@ export default function EditAppInfo(props: any) { const setValue = (value: string) => { form.setFieldsValue({ - belongPeople: value + projOwnerName: value }) } - const submitInfo = (values: any) => { - message.success('提交成功'); - console.log(values); - props.setEditProcess(2); + // const submitInfo = (values: any) => { + // message.success('提交成功'); + // console.log(values); + // props.setEditProcess(2); - } + // } const height = window.innerHeight - 460; const [form] = Form.useForm(); const handleSubmit = () => { // console.log(form); - props.setEditProcess(3); + // props.setEditProcess(3); // 调用表单实例的 submit 方法 form.submit(); }; + function deepCompareObjects(obj1: any, obj2: any): boolean { + // 若两个值严格相等,直接返回 true + if (obj1 === obj2) { + return true; + } - const onFinish = (values: any) => { + // 若其中一个值为 null 或不是对象类型,返回 false + if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) { + return false; + } + + // 获取两个对象的键数组 + const keys1 = Object.keys(obj1); + const keys2 = Object.keys(obj2); + + // 若键的数量不同,返回 false + if (keys1.length !== keys2.length) { + return false; + } + + // 遍历键,递归比较对应的值 + for (const key of keys1) { + if (!keys2.includes(key) || !deepCompareObjects(obj1[key], obj2[key])) { + return false; + } + } + + return true; + } + const onFinish = async (values: any) => { // 处理表单提交逻辑 console.log('表单提交成功', values); - submitInfo(values) + console.log(dayjs(values.completeTime).format('YYYY-MM-DD')); + // 给表单赋值 time: dayjs(res.goodsGetTime, 'YYYY-MM-DD'), + // submitInfo(values) + // 给表单赋值 + const data = { + ...values, + completeTime: dayjs(values.completeTime).format('YYYY-MM-DD'), + projOwnerIdentity: belongPeopleInfo.authorIdCard,//著作权人证件号 + projOwnerId: belongPeopleInfo.authorId,//著作权人信息ID + } + + console.log('表单数据', data); + console.log('传递数据', props.appInfo); + // console.log(JSON.stringify(props.appInfo) == JSON.stringify(data)); + console.log(deepCompareObjects(props.appInfo, data)); + + // console.log(props.appInf == data); + // return + + if (!deepCompareObjects(props.appInfo, data)) { + + try { + setDownLoading(true) + await softwareInfo(props.appOrderId, { + // appName: values.appName, // 项目名称 + // subName: values.subName, // 软件简称 + // versionName: values.versionName, // 版本号 + // packageName: values.packageName, // 包名APPID + // systemName: values.systemName, // 运行系统 + // bigClassify: values.bigClassify, // 软件分类(大类) + // subClassify: values.subClassify, // 软件分类(小类) + // developWay: values.developWay, // 开发方式 + // completeTime: values.completeTime, // 开发完成时期 + // projOwnerName: values.projOwnerName,//著作权人姓名 + ...values, + completeTime: dayjs(values.completeTime).format('YYYY-MM-DD'), + projOwnerIdentity: belongPeopleInfo.authorIdCard,//著作权人证件号 + projOwnerId: belongPeopleInfo.authorId,//著作权人信息ID + appOrderId: props.appOrderId, + }) + props.setAppInfo({ + ...values, + completeTime: dayjs(values.completeTime).format('YYYY-MM-DD'), + getFile: upShow ? form.getFieldValue('getFile') : '', + projOwnerIdentity: belongPeopleInfo.authorIdCard,//著作权人证件号 + projOwnerId: belongPeopleInfo.authorId,//著作权人信息ID + }) + props.setEditProcess(3); + setDownLoading(false) + } catch (error: any) { + setDownLoading(false) + 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 { + setDownLoading(false) + } + } else { + props.setEditProcess(3); + + } + }; + const getFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + // console.log('文件详情', res); + setUpSoftArray([ + { + uid: res[0].fileId, + name: res[0].fileName, + status: 'done', + url: showImage(res[0].fileId, false) + }, + // { + // uid: '1', + // name: 'example.pdf', + // status: 'done', + // url: 'http://gips3.baidu.com/it/u=3886271102,3123389489&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960' + // }, + ]) + } 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) + } + } + } useEffect(() => { - - },[props.appInfo]) + if (props.appInfo.getFile) { + console.log('嘻嘻', props.appInfo.getFile); + getFileDetail(props.appInfo.getFile) + } + }, [props.appInfo.getFile]) + + useEffect(() => { + console.log('传过来的信息', props); + if (props.appInfo.appName) { + // setSmallClassList(props.smallClass) + form.setFieldsValue({ + appName: props.appInfo.appName, + subName: props.appInfo.subName, + versionName: props.appInfo.versionName, + packageName: props.appInfo.packageName, + systemName: props.appInfo.systemName, + bigClassify: props.appInfo.bigClassify, + subClassify: props.appInfo.subClassify, + developWay: props.appInfo.developWay, + // completeTime: props.appInfo.completeTime, + completeTime: dayjs(props.appInfo.completeTime, 'YYYY-MM-DD'), + projOwnerName: props.appInfo.projOwnerName, + getFile: props.appInfo.getFile, + }) + setBelongPeopleInfo(prevState => ({ + ...prevState, + authorName: props.appInfo.projOwnerName, + authorId: props.appInfo.projOwnerId, + authorIdCard: props.appInfo.projOwnerIdentity + })); + + + } + if (props.appInfo.bigClassify != '') { + getSmallClassList(props.appInfo.bigClassify) + } + if (props.appInfo.developWay == '合作开发') { + // setUpSoftArray([ + // { + // uid: '1', + // name: 'example.pdf', + // status: 'done', + // url: 'http://gips3.baidu.com/it/u=3886271102,3123389489&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960' + // } + // ]) + // getFileDetail(props.appInfo.getFile) + setUpShow(true) + + + } + + }, [props.appInfo]) return ( -
-
-
- -
{ - message.error('请完善信息') - }} - > -
-
-
软件全称*
- - - -
-
+
+ {contextHolder} +
+
+ { + message.error('请完善信息') + }} + > +
-
软件简称:
- +
软件全称*
+ - - -
-
-
-
-
版本号*
- + + +
+
- - + }}> +
软件简称:
+ + + +
-
-
包名(APPID)*
- +
版本号*
+ - - + ]}> + +
+
+
+
包名(APPID)*
+ + + +
-
-
-
-
运行系统*
- +
+
运行系统*
+ - - + options={props.systemList} + // defaultValue="" + placeholder={'请选择运行系统'} + /> + +
+
+
软件分类*
+ + + +
-
-
软件分类*
- - - -
-
- -
- {/*
+
+ {/*
发表状态:
*/} -
-
+
开发方式*
- 开发方式*
+ - { - console.log(value); - if (value == '2') { - setUpShow(true) - }else{ - setUpShow(false) - } - }} - /> - -
-
-
开发完成日期*
- { + console.log(value); + if (value == '合作开发') { + setUpShow(true) + } else { + setUpShow(false) + // 清空表单上传文件 + form.setFieldsValue({ + getFile: '' + }) + setUpSoftArray([]) + } + }} + /> + +
+
+
开发完成日期*
+ - {/* + {/* */} - - + /> + +
-
-
- {/*
+
+ {/*
软件作品说明:
*/} -
-
产权所属者*
- - - -
{ - setBelongModal(true) - }} - > - 选择 -
-
- { - setValue('') - setBelongPeopleInfo({ - authorName: '', - authorType: '', - authorIdCardType: '', - authorIdCard: '', - authorCrcAccount: 0, - authorId: '', - authorProvinceCity: '', - authorCrcAccountUsername: '', - authorCrcAccountPassword: '', - }) - }}> 取消 -
-
-
-
上传合作协议*
+
产权所属者*
+ + +
- - { - console.log(fileList); - }} - onRemove={() => { - setUpSoftArray([]) - setSoftDis(false) - }} - beforeUpload={beforeUpload} - // onChange={handleUploadChange} - headers={{ 'Auth': `Bearer ${token}` }} - > - - - -
- [ 下载协议 ] -
-
+ width: '300px', + height: '42px', + top: '0', + right: '0', + // background: 'skyblue', + textAlign: 'right', + lineHeight: '42px', + cursor: 'pointer', + paddingRight: '10px', + color: '#1F79FF', -
- {/*
{ + setBelongModal(true) + }} + > + 选择 +
+
+ { + setValue('') + setBelongPeopleInfo({ + authorName: '', + authorType: '', + authorIdCardType: '', + authorIdCard: '', + authorCrcAccount: 0, + authorId: '', + authorProvinceCity: '', + authorCrcAccountUsername: '', + authorCrcAccountPassword: '', + }) + }}> 取消 +
+
+
+
+
上传合作协议*: +
(请上传PDF格式文件)
+
+
+ + { + const { fileList } = info; + setUpSoftArray(fileList); // 更新 upSoftArray 状态 + + if (info.file.status === 'uploading') { + return; + } + if (info.file.status === 'done') { + console.log(info.file.response.data); + setUpSoftArray([ + { + uid: info.file.response.data.fileId, + name: info.file.response.data.fileName, + status: 'done', + url: showImage(info.file.response.data.fileId, false) + } + ]) + + form.setFieldsValue({ + getFile: info.file.response.data.fileId, + }); + } + if (info.file.status === 'error') { + // 显示错误提示 + message.error(`上传失败`); + form.setFieldsValue({ + getFile: '', // 清除表单值 + }); + } + + // if (info.file.status === 'uploading') { + // return; + // } + // if (info.file.status === 'done') { + + // console.log(info.file.response.data); + // setUpSoftArray([ + // { + // uid: info.file.response.data.fileId, + // name: info.file.response.data.fileName, + // status: 'done', + // url: showImage(info.file.response.data.fileId, false) + // } + // ]) + + // form.setFieldsValue({ + // getFile: info.file.response.data.fileId, + // }) + + // // setUpFileName(fileName) + // } + // if (info.file.status === 'error') { + // // 显示错误提示 + // message.error(`上传失败`); + // //伤处表单name为ing的值 + // form.setFieldsValue({ + // getFile: '', // 将值设置为 undefined 以清除错误状态 + // }) + + // } + }} + onRemove={() => { + setUpSoftArray([]) + // setSoftDis(false) + form.setFieldsValue({ + getFile: '', // 将值设置为 undefined 以清除错误状态 + }) + }} + beforeUpload={beforeUpload} + // onChange={handleUploadChange} + headers={{ 'Auth': `Bearer ${token}` }} + > + + + +
+ { + form.getFieldValue('appName') + if (form.getFieldValue('appName') && form.getFieldValue('versionName')) { + try { + setDownLoading(true) + console.log(form.getFieldValue('appName'), form.getFieldValue('versionName')); + const res: any = await agreementWord(props.appOrderId, form.getFieldValue('appName'), form.getFieldValue('versionName')) + window.open(showImage(res.fileId, false)); + setDownLoading(false) + } catch (error: any) { + setDownLoading(false) + 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 { + setDownLoading(false) + } + + + } else { + message.error('需先填写软件全称和版本号') + } + }} + >[ 下载协议 ] +
+
+ +
+ {/*
@@ -523,47 +874,48 @@ export default function EditAppInfo(props: any) {
*/} - + +
+ +
+
+ + +
+ { + setBelongModal(false) + + }}> + + { setBelongModal(false) }} setBelongPeopleInfo={setBelongPeopleInfo} belongPeopleInfo={belongPeopleInfo} setValue={setValue} isShow={true}> +
- -
-
- - -
- { - setBelongModal(false) - - }}> - - { setBelongModal(false) }} setBelongPeopleInfo={setBelongPeopleInfo} belongPeopleInfo={belongPeopleInfo} setValue={setValue} isShow={true}> - -
+ ) } diff --git a/src/route/Correction/Correction.tsx b/src/route/Correction/Correction.tsx index 78961da..1d7bc4d 100644 --- a/src/route/Correction/Correction.tsx +++ b/src/route/Correction/Correction.tsx @@ -1136,7 +1136,7 @@ export default function Correction() { }
- {/* 换名 - */} + ) : ( <> - )} + )} {/* { return (
{ - setAppGoodsId(item.dataId) + setAppGoodsId(item.id) // console.log('item.dataId: ', item.dataId); }} @@ -3863,7 +3863,7 @@ export default function Index() { backgroundImage: index !== 1 ? `url(${topblack})` : `url(${topblue})`, }} > - {item.dataSummary} + {item.title}
@@ -3874,7 +3874,7 @@ export default function Index() { {item.dataName / 100} + }}>{item.money / 100} 元/件
@@ -3917,6 +3917,8 @@ export default function Index() { } else { console.error(error) } + } finally { + setBuyLoading(false) } From 06e26bc36684bfccdd8feb3ad0a4a84ec6c358bb Mon Sep 17 00:00:00 2001 From: lyp Date: Thu, 29 May 2025 17:02:18 +0800 Subject: [PATCH 5/6] =?UTF-8?q?app=E7=94=B5=E5=AD=90=E8=BD=AF=E8=91=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/request/api.ts | 8 +- src/route/AppElectron/AppEdit.tsx | 31 +- src/route/AppElectron/AppElectron.tsx | 171 ++++- .../components/AppInfo/AppInfo.tsx | 632 ++++++++++++------ .../components/AppInfo/app-info.css | 5 +- .../components/EditAppFiles/EditAppFiles.tsx | 15 +- .../components/EditAppInfo/EditAppInfo.tsx | 16 +- .../AppElectron/components/File/File.tsx | 482 +++++++++++++ src/route/index/Index.tsx | 5 +- 9 files changed, 1129 insertions(+), 236 deletions(-) create mode 100644 src/route/AppElectron/components/File/File.tsx diff --git a/src/request/api.ts b/src/request/api.ts index 8b50a97..e4e87ac 100644 --- a/src/request/api.ts +++ b/src/request/api.ts @@ -134,7 +134,8 @@ export const runSystemList = () => aiShopRequest.get(`/aishop/api/data/listbypar export const bigClassList = () => aiShopRequest.get(`/aishop/api/data/listbyparentid/8abb5b58-83d2-465c-b164-a189efee28c1`) // 获取小类 export const twoClass = (id:string) => aiShopRequest.get(`/aishop/api/data/listbyparentid/${id}`) - +// 通过类得id获取内容 +export const getContent = (id:string) => aiShopRequest.get(`/aishop/api/data/get/${id}`) // 下单购买APP电子软著 export const buyAppGoods = (orderMoneyId:string) => aiShopRequest.post(`/aishop/api/apporder/pay/${orderMoneyId}`) // 获取我的app电子软著订单列表 @@ -149,7 +150,8 @@ export const agreementWord = (appOrderId:string,appName:string,versionName:strin export const sourceCodeWord = (appOrderId:string,) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP02/${appOrderId}?name=源码文档示例`) // 生成软件文档word文件 export const softwareDocumentWord = (appOrderId:string,) => aiShopRequest.get(`aishop/api/apporder/create-file/SHOP03/${appOrderId}?name=软件文档示例`) - +// 补充资料 +export const supplementAppData = (params:any) => aiShopRequest.post(`/aishop/api/correction/save-app`, params) // 获取文件详细信息 export const fileDetail = (fileId:string) => aiShopRequest.get(`aishop/api/file/list?ids=${fileId}`) // 第一步 企业认证 @@ -158,5 +160,7 @@ export const companyAuth = (appOrderId:any,params:any) => aiShopRequest.post(`ai export const softwareInfo = (appOrderId:any,params:any) => aiShopRequest.post(`aishop/api/apporder/update/2/${appOrderId}`,params) // 第三步 上传鉴别材料 export const uploadMaterial = (appOrderId:any,params:any) => aiShopRequest.post(`/aishop/api/apporder/update/3/${appOrderId}`,params) +// 第四步 提交审核 +export const submitapp = (appOrderId:any) => aiShopRequest.post(`/aishop/api/apporder/update/sub-check/${appOrderId}`) // ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/src/route/AppElectron/AppEdit.tsx b/src/route/AppElectron/AppEdit.tsx index 3bd8361..9537b33 100644 --- a/src/route/AppElectron/AppEdit.tsx +++ b/src/route/AppElectron/AppEdit.tsx @@ -35,12 +35,12 @@ export default function AppEdit() { const getRunSystemList = async () => { try { const res: any = await runSystemList(); - console.log('运行系统选项', res.map((item: any) => { - return { - label: item.dataName, - value: item.dataName, - } - })); + // console.log('运行系统选项', res.map((item: any) => { + // return { + // label: item.dataName, + // value: item.dataName, + // } + // })); setSystemList(res.map((item: any) => { return { label: item.dataName, @@ -123,6 +123,7 @@ export default function AppEdit() { companyPhoto: '', // 企业照片 companyAuth: '',//授权书 }); + const [checkStatus, setCheckStatus] = useState('') //审核状态 // 软件基本信息 const [appInfo, setAppInfo] = useState({ appName: '', // 项目名称 @@ -131,7 +132,9 @@ export default function AppEdit() { packageName: '', // 包名APPID systemName: '', // 运行系统 bigClassify: '', // 软件分类(大类) + // bigClassifyName: '', subClassify: '', // 软件分类(小类) + // subClassifyName: '', developWay: '', // 开发方式 completeTime: '', // 开发完成时期 projOwnerName: '',//著作权人姓名 @@ -139,11 +142,13 @@ export default function AppEdit() { projOwnerId: '',//著作权人信息ID getFile: '',//获取文件 }) + // 材料信息 const [filesInfo, setFilesInfo] = useState({ sourceCodeDocFile: '',//源码 softwareDocFile: '',//软件 }) + const [checkRemark, setCheckRemark] = useState('') //未通过原因 // 文件想想请 // const [fileList, setFileList] = useState([]); // 获取详情 @@ -152,7 +157,7 @@ export default function AppEdit() { setLoading(true) const res: any = await appOrderDetail(appOrderId); - console.log('详情', res); + // console.log('详情', res); setCompanyInfo({ companyName: res.companyName, // 企业名称 companyNumber: res.companyNumber, // 企业统一社会信用代码 @@ -173,12 +178,16 @@ export default function AppEdit() { projOwnerIdentity: res.projOwnerIdentity,//著作权人证件号 projOwnerId: res.projOwnerId,//著作权人信息ID getFile: res.getFile,//获取文件 + // bigClassifyName: res.bigClassifyName, + // subClassifyName: res.subClassifyName, }) setFilesInfo({ sourceCodeDocFile: res.sourceCodeDocFile,//源码 softwareDocFile: res.softwareDocFile,//软件 }) setEditProcess(Number(res.appOrderProgress) + 1) + setCheckStatus(res.checkStatus) + setCheckRemark(res.checkRemark) // const fileres: any = await fileDetail(res.getFile) // console.log('文件详情', fileres); @@ -393,6 +402,10 @@ export default function AppEdit() { } }> */} { + setCheckStatus(value) + }} appOrderId={appOrderId} companyInfo={companyInfo} appInfo={appInfo} @@ -401,7 +414,9 @@ export default function AppEdit() { (num: number) => { setEditProcess(num) } - }> + } + checkRemark={checkRemark} + >
{/*
state) const data = redxuState.appGoodsListData; + const [checkRemarkModal, setCheckRemarkModal] = useState(false) //未通过原因弹窗 + const [checkRemark, setCheckRemark] = useState('') //未通过原因 const columns: TableProps['columns'] = [ { title: '序号', @@ -68,7 +76,7 @@ export default function AppElectron() { }, render: (text, record) => ( - {text ? ` ${record.bigClassifyName} / ${record.subClassifyName}` : '未完善'} + {text ? ` ${record.bigClassifyName} - ${record.subClassifyName}` : '未完善'} ) }, @@ -97,9 +105,35 @@ export default function AppElectron() { align: 'center', key: 'appOrderId', width: 100, - render: (text) => ( + render: (text, record) => ( - {text == '1' ? '待审核' : text == '2' ? '通过' : text == '0' ? '未通过' : '未提交'} + {text == '1' ? + 待审核 + : text == '2' ? + 通过 + : text == '0' ? + { + setCheckRemark(record.checkRemark) + setCheckRemarkModal(true) + }} + >未通过 + : + 未提交 + } ) }, @@ -108,10 +142,10 @@ export default function AppElectron() { dataIndex: 'appOrderStatus', align: 'center', key: 'appOrderId', - width: 100, + width: 150, render: (text) => ( - {text == '1' ? '未付款' : text == '2' ? '资料填写中' : text == '3' ? '资料审核中' : text == '4' ? '下线申请中' : text == '5' ? '已下证' : '未知'} + {text == '1' ? '未付款' : text == '2' ? '资料填写中' : text == '3' ? '资料审核中' : text == '4' ? '线下申请中' : text == '5' ? '已下证' : '未知'} ) }, @@ -121,21 +155,79 @@ export default function AppElectron() { // dataIndex: 'contractManagementId', align: 'center', key: 'appOrderId', - width: 200, + width: 150, // bordeLeft: true, fixed: 'right', render: (record) => (
- }} onClick={() => { - nav(`/app-edit/${record.appOrderId}`) - // console.log(record); +
编辑
+ }} onClick={() => { + nav(`/app-edit/${record.appOrderId}`) + // console.log(record.checkStatus); + + + }}>{record.checkStatus == '' ? '编辑' : record.checkStatus == '0' ? '修改' : '查看'}
+
0 && record.appOrderStatus != '5' ? 'unset' : 'none', + + }} + onClick={() => { + setFileModal(true) + // console.log(record); + setAppOrderId(record.appOrderId) + + }} + > + 资料补充 +
+ {record.waitCorrectionCount} +
+
+
{ + console.log(record.appOrderResultFile); + + window.open(showImage(record.appOrderResultFile, false)); + }} + > + 查看证书 + +
+
) }, @@ -164,7 +256,7 @@ export default function AppElectron() { val: res }) } catch (error: any) { - + setLoading(false) if (error.response) { const data = error.response.data; messageApi.open({ @@ -242,7 +334,56 @@ export default function AppElectron() { )} + { + setCheckRemarkModal(false) + }} + // onOk={ + // // setModal(false) + // clickOk + // } + > + +
+ {checkRemark} +
+ +
+ { + // setOrderDetailModal(false) + // }} + onCancel={() => { + setFileModal(false) + }} + width={1150} + centered + > + { + getAppOrderList(page) + }} + user={'buy'} + orderId={appOrderId}> +
diff --git a/src/route/AppElectron/components/AppInfo/AppInfo.tsx b/src/route/AppElectron/components/AppInfo/AppInfo.tsx index a12b5d7..e571976 100644 --- a/src/route/AppElectron/components/AppInfo/AppInfo.tsx +++ b/src/route/AppElectron/components/AppInfo/AppInfo.tsx @@ -1,207 +1,455 @@ +import { useEffect, useState } from 'react'; import './app-info.css' -import { Button, message } from "antd" +import { Button, message, Spin, Modal } from "antd" +import { fileDetail, submitapp, getContent } from '../../../../request/api' +import { showImage } from '../../../../request/request' export default function AppInfo(props: any) { + const [messageApi, contextHolder] = message.useMessage(); const height = window.innerHeight - 460; + const [loading, setLoading] = useState(false); + const [modal, setModal] = useState(false); const handleSubmit = () => { - message.success('提交成功'); - + setModal(true) + // message.success('提交成功'); + // props.setCheckStatus('1') }; + const clickOk = async () => { + try { + setLoading(true) + await submitapp(props.appOrderId) + setModal(false) + setLoading(false) + message.success('提交成功'); + props.setCheckStatus('1') + } catch (error: any) { + setLoading(false) + + 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 companyInfo = props.companyInfo; + const appInfo = props.appInfo; + const filesInfo = props.filesInfo; + const [photofileDetail, setPhotofileDetail] = useState({ + + fileId: '', //文件id + fileName: '', //文件名称 + url: '' + }); + const [authfileDetail, setAuthfileDetail] = useState({ + fileId: '', //文件id + fileName: '', //文件名称 + url: '' + }) + const [file, setFile] = useState({ + fileId: '', //文件id + fileName: '', //文件名称 + url: '' + }) + const [codefileDetail, setCodefileDetail] = useState({ + fileId: '', //文件id + fileName: '', //文件名称 + url: '' + }) + const [softfileDetail, setSoftfileDetail] = useState({ + fileId: '', //文件id + fileName: '', //文件名称 + url: '' + }) + const getPhotoFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + setPhotofileDetail({ + fileId: res[0].fileId, //文件id + fileName: res[0].fileName, //文件名称 + url: showImage(res[0].fileId, false) + }) + } 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 getAuthFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + setAuthfileDetail({ + fileId: res[0].fileId, //文件id + fileName: res[0].fileName, //文件名称 + url: showImage(res[0].fileId, false) + }) + + } 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 getFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + setFile({ + fileId: res[0].fileId, //文件id + fileName: res[0].fileName, //文件名称 + url: showImage(res[0].fileId, false) + }) + } 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 getCodeFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + setCodefileDetail({ + fileId: res[0].fileId, //文件id + fileName: res[0].fileName, //文件名称 + url: showImage(res[0].fileId, false) + }) + } 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 getSoftFileDetail = async (id: string) => { + try { + const res: any = await fileDetail(id) + setSoftfileDetail({ + fileId: res[0].fileId, //文件id + fileName: res[0].fileName, //文件名称 + url: showImage(res[0].fileId, false) + }) + } 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 [bigClassName, setBigClassName] = useState('') + const [smallClassName, setSmallClassName] = useState('') + const getBigClassName = async (id: string) => { + try { + const res: any = await getContent(id) + // console.log(res); + + setBigClassName(res.dataName) + } 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 getSmallClassName = async (id: string) => { + try { + const res: any = await getContent(id) + // console.log(res); + setSmallClassName(res.dataName) + + } 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) + } + } + } + useEffect(() => { + if (companyInfo.companyPhoto) { + getPhotoFileDetail(companyInfo.companyPhoto) + + } + if (companyInfo.companyAuth) { + getAuthFileDetail(companyInfo.companyAuth) + } + if (appInfo.getFile) { + getFileDetail(appInfo.getFile) + } + if (filesInfo.sourceCodeDocFile) { + getCodeFileDetail(filesInfo.sourceCodeDocFile) + } + if (filesInfo.softwareDocFile) { + getSoftFileDetail(filesInfo.softwareDocFile) + } + if (appInfo.bigClassify) { + getBigClassName(appInfo.bigClassify) + } + if (appInfo.subClassify) { + getSmallClassName(appInfo.subClassify) + } + + }, [companyInfo.companyPhoto, companyInfo.companyAuth, appInfo.getFile, filesInfo.sourceCodeDocFile, filesInfo.softwareDocFile, appInfo.bigClassify, appInfo.subClassify]) return ( -
-
-
+
+ {contextHolder} +
- }}> -
-
企业/机构信息
-
-
-
企业/机构信息名称 :
-
嘻嘻嘻嘻公司
-
-
-
所在省市 :
-
辽宁省沈阳市
-
-
-
企业/机构地址 :
-
xxx路xxx号
-
-
-
证件类型 :
-
xx证
-
-
-
证件号 :
-
111111111
-
-
-
上传证件 :
-
xx.png
-
-
-
授权书 :
-
xxx.jpg
-
+
+ + +
+
软件基本信息
+
+
+
APP软件全称 :
+
{appInfo.appName}
+
+
+
软件简称 :
+
{appInfo.subName}
+
+
+
版本号 :
+
{appInfo.versionName}
+
+
+
包名(APPID) :
+
{appInfo.packageName}
+
+
+
运行系统 :
+
{appInfo.systemName}
+
+
+
软件分类 :
+
{bigClassName} - {smallClassName}
+
+
+
开发方式 :
+
{appInfo.developWay}
+
+ + +
+
开发完成日期 :
+
{appInfo.completeTime}
+
+ +
+
产权所属者 :
+
{appInfo.projOwnerName}
+
+ +
+
+ + + +
+ +
+
+
+ + +
+
+ 正在审核中... +
+
+ 审核通过
-
-
软件基本信息
-
-
-
APP软件全称 :
-
嘻嘻嘻嘻
-
-
-
软件简称 :
-
嘻嘻嘻嘻
-
-
-
版本号 :
-
v.10
-
-
-
包名(APPID) :
-
com.zhongxinhy.communitymanage
-
-
-
运行系统 :
-
android for phone
-
-
-
APP软件分类 :
-
应用 - 生活实用
-
-
-
开发方式 :
-
独立开发
-
- {/*
-
软件作品说明 :
-
原创
-
*/} -
-
开发完成日期 :
-
2025-05-05
-
- {/*
-
发表状态 :
-
未发表
-
*/} -
-
产权所属者 :
-
嘻嘻公司
-
- -
-
- {/*
-
权利说明
-
-
-
权力取得方式 :
-
原始
-
-
-
权利范围 :
-
全部权利
-
-
-
其他相关文件 :
-
asdasjdadja.png
-
- - -
-
*/} -
-
鉴别材料
-
- -
-
源码文档 :
-
asdkaksd.png
-
- - -
-
软件文档 :
-
asdkaksd.png
-
- -
-
- {/*
-
功能特点
-
-
-
硬件环境 :
-
1GHz以上处理器,1GB以上内存,16GB以上存储空间、安卓智能移动设备
-
-
-
软件环境 :
-
Android操作系统
-
-
-
编程语言 :
-
Java
-
-
-
源程序量 :
-
672384行左右
-
-
-
主要功能 :
-
隆盛社区APP软件主要功能有考勤打卡、房屋人口管理、工作轨迹、事件上报、事件处理、事件检查、学校管理、重点区域管理、重点场所、实有车辆、用户登录退出等功能。
-
-
-
技术特点 :
-
基于 Android Jetpack 组件构建,利用 ViewModel 和 LiveData 实现数据的高效管理与界面的实时更新,确保用户体验流畅。网络通信方面,运用 Retrofit 框架结合 OkHttp,实现安全快速的数据交互。
-
- -
-
*/} - {/*
-
著作权人
-
-
-
著作权人名称 :
-
嘻嘻嘻嘻嘻嘻嘻哈哈哈哈公司
-
- -
-
*/} -
- -
-
- -
+ { + setModal(false) -
+ }} + onOk={ + // setModal(false) + clickOk + } + > + +
+ 注 : 提交后无法修改,请确认信息是否正确! +
+ + + ) } diff --git a/src/route/AppElectron/components/AppInfo/app-info.css b/src/route/AppElectron/components/AppInfo/app-info.css index 34062ee..ba10480 100644 --- a/src/route/AppElectron/components/AppInfo/app-info.css +++ b/src/route/AppElectron/components/AppInfo/app-info.css @@ -35,4 +35,7 @@ .appInfoTextItemText{ max-width: 60%; /* background-color: pink; */ -} \ No newline at end of file + /* 下划线 */ + + +} diff --git a/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx b/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx index 693bfef..436b0c7 100644 --- a/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx +++ b/src/route/AppElectron/components/EditAppFiles/EditAppFiles.tsx @@ -68,11 +68,11 @@ export default function EditAppFiles(props: any) { return true; }; // 处理文件点击预览 - const handlePreview = (file: any) => { - console.log(file); + // const handlePreview = (file: any) => { + // console.log(file); - }; + // }; // 上传文件源码文档列表 const [upCodeArray, setUpCodeArray] = useState([]) // const [codeDis, setCodeDis] = useState(false) @@ -227,7 +227,7 @@ export default function EditAppFiles(props: any) { const getCodeFileDetail = async (id: string) => { try { const res: any = await fileDetail(id) - console.log('文件详情', res); + // console.log('源码文档文件详情', res); setUpCodeArray([ { uid: res[0].fileId, @@ -252,7 +252,6 @@ export default function EditAppFiles(props: any) { const getSoftFileDetail = async (id: string) => { try { const res: any = await fileDetail(id) - console.log('文件详情', res); setUpSoftArray([ { uid: res[0].fileId, @@ -385,7 +384,7 @@ export default function EditAppFiles(props: any) { }); }} beforeUpload={beforeUpload} - onPreview={handlePreview} + // onPreview={handlePreview} // onChange={handleUploadChange} headers={{ 'Auth': `Bearer ${token}` }} > @@ -406,7 +405,7 @@ export default function EditAppFiles(props: any) { onClick={ downCodeWord } - >[ 下载1 ] + >[ 下载 ]
{ try { const res: any = await twoClass(id) - console.log(res); + // console.log(res); setSmallClassList(res.map((item: any) => { return { label: item.dataName, @@ -153,8 +153,8 @@ export default function EditAppInfo(props: any) { } const onFinish = async (values: any) => { // 处理表单提交逻辑 - console.log('表单提交成功', values); - console.log(dayjs(values.completeTime).format('YYYY-MM-DD')); + // console.log('表单提交成功', values); + // console.log(dayjs(values.completeTime).format('YYYY-MM-DD')); // 给表单赋值 time: dayjs(res.goodsGetTime, 'YYYY-MM-DD'), // submitInfo(values) // 给表单赋值 @@ -165,10 +165,10 @@ export default function EditAppInfo(props: any) { projOwnerId: belongPeopleInfo.authorId,//著作权人信息ID } - console.log('表单数据', data); - console.log('传递数据', props.appInfo); + // console.log('表单数据', data); + // console.log('传递数据', props.appInfo); // console.log(JSON.stringify(props.appInfo) == JSON.stringify(data)); - console.log(deepCompareObjects(props.appInfo, data)); + // console.log(deepCompareObjects(props.appInfo, data)); // console.log(props.appInf == data); // return @@ -256,13 +256,13 @@ export default function EditAppInfo(props: any) { } useEffect(() => { if (props.appInfo.getFile) { - console.log('嘻嘻', props.appInfo.getFile); + // console.log('嘻嘻', props.appInfo.getFile); getFileDetail(props.appInfo.getFile) } }, [props.appInfo.getFile]) useEffect(() => { - console.log('传过来的信息', props); + // console.log('传过来的信息', props); if (props.appInfo.appName) { // setSmallClassList(props.smallClass) form.setFieldsValue({ diff --git a/src/route/AppElectron/components/File/File.tsx b/src/route/AppElectron/components/File/File.tsx new file mode 100644 index 0000000..0d7349a --- /dev/null +++ b/src/route/AppElectron/components/File/File.tsx @@ -0,0 +1,482 @@ +import { useEffect, useState } from 'react' +import { Table, Space, Modal, Input, Form, Upload, Button } from "antd" +import { UploadOutlined } from '@ant-design/icons'; +import { sellSupplementList, buySupplementList, supplementDetail, getFileTypeByIds, supplementAppData } from '../../../../request/api' +import { showImage, uploadFileUrl } from '../../../../request/request' +const { Column } = Table; +import useMessage from "antd/es/message/useMessage"; +// import './File.css' +const { TextArea } = Input; +export default function File(props: any) { + const [upFileArray, setUpFileArray] = useState([]) // 上传的文件数组 + // 自定义验证函数 + 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)) { + callback(); + } else { + callback('内容和附件至少需要填写或上传一项'); + } + }; + // 点击上传资料确定 + const submitData = async (params: any) => { + try { + await supplementAppData({ + correctionParentId: correctionId, + // correctionType: CorrectionType, + orderId: props.orderId, + correctionFiles: params.correctionFiles, + correctionRemark: params.correctionRemark, + }) + if (props.user == 'sell') { + getSellSupplementList() + } else if (props.user == 'buy') { + getBuySupplementList() + } + props.upData() + messageApi.open({ + type: 'success', + content: '已提交', + }) + setIsModalVisible(false) + // form.resetFields(); + + // console.log(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 token = sessionStorage.getItem('token') + const [form] = Form.useForm(); + const [messageApi, messageContext] = useMessage(); + const [correctionId, setCorrectionId] = useState('') // 点击查看内容选中的id + // const [CorrectionType, setCorrectionType] = useState('') + // 补充资料弹窗 + const [isModalVisible, setIsModalVisible] = useState(false) + const [page, setPage] = useState(1) // 当前页码 + const [total, setTotal] = useState(0) // 总条数 + const [data, setData] = useState([]) + const getSellSupplementList = async () => { + try { + const res: any = await sellSupplementList({ + orderId: props.orderId, + page: page, + rows: 10 + }) + setPage(res.page) + setTotal(res.total) + console.log(res); + setData(res.rows) + // let newData:any = []; + // for (let i = 0; i < 10; i++) { + // newData = newData.concat(res.rows); + // } + // setData(newData); + + } 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 getBuySupplementList = async () => { + try { + const res: any = await buySupplementList({ + orderId: props.orderId, + page: page, + rows: 10 + }) + setPage(res.page) + setTotal(res.total) + // console.log(res); + setData(res.rows) + } 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 [fileList, setFileList] = useState([]) // 上传文件列表 + // 获取文件类型 + const getFileTypeByIdsArray = async (ids: string) => { + try { + const res: any = await getFileTypeByIds({ + ids: ids + }) + setFileList(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 [detailData, setDetailData] = useState({}) + const getSupplementDetail = async (id: string) => { + try { + const res: any = await supplementDetail(id) + // console.log(res); + setDetailData(res) + await getFileTypeByIdsArray(res.correctionFiles) + + } 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) + } + } + } + useEffect(() => { + if (props.user == 'sell') { + getSellSupplementList() + } else if (props.user == 'buy') { + getBuySupplementList() + } + }, [page]) + return ( +
+ {messageContext} + { + setPage(currentPage); + }, + showSizeChanger: false, + current: page + + } + } + // pagination={false} // 不显示分页 + style={{ textAlign: 'center' }} // 设置表格内容居中显示 + rowKey="correctionId" // 指定数据项的唯一标识符 + > + ( + index + 1 + )} align="center" /> + ( +
{text}
+ )} + // render={(text) => ( + // {text} + // )} + /> + ( +
{text}
+ )} + /> + + ( + <> + 待补充 + 已补充 + + )} + /> + + {/* */} + ( + + { + // console.log(record.correctionId); + setCorrectionId(record.correctionId) + getSupplementDetail(record.correctionId) + setIsModalVisible(true) + // 清空表单 + form.resetFields(); + // setCorrectionType(record.correctionType) + }}>查看内容 + + + )} + /> +
+ { + setIsModalVisible(false); + // 清空表单 + form.resetFields(); + }} + centered + > +
+ {/* {correctionId} + {CorrectionType} */} +
+
+
平台需要您补充的内容说明
+
+
+
主题
+ +
+
+
内容
+ +
+
+
附件
+ {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/index/Index.tsx b/src/route/index/Index.tsx index 377453f..ceb0876 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -3314,6 +3314,7 @@ export default function Index() { style={{ background: 'var(--color-searchbtn)' }} onClick={() => { setAppModal(true) + setAppGoodsId('') }} >申请电子软著 @@ -3822,7 +3823,7 @@ export default function Index() { footer={null} onCancel={() => { setAppModal(false) - setAppGoodsId('') + }} okButtonProps={{ style: { background: 'red', color: 'white' } }} width={830} From 8d6fded57110d4eb8be9e6bb7d263c623ce3b9d1 Mon Sep 17 00:00:00 2001 From: lyp Date: Fri, 30 May 2025 14:34:21 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8D=A2=E5=90=8D=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 15 +- src/components/ReplaceModal/ReplaceModal.tsx | 464 +++++++++++++ src/components/menu/MenuWithTopButton.tsx | 6 + src/route/Replace/Replace.tsx | 645 +++++++++++++++++++ src/route/index/Index.tsx | 276 +++++++- src/route/router.tsx | 5 + src/store/index.ts | 12 + 7 files changed, 1412 insertions(+), 11 deletions(-) create mode 100644 src/components/ReplaceModal/ReplaceModal.tsx create mode 100644 src/route/Replace/Replace.tsx diff --git a/.env.dev b/.env.dev index 9e9f0da..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_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() + }}> + 选择 +
+
+
+ +
+
+ 换名原因* +
+ +