From 8d6fded57110d4eb8be9e6bb7d263c623ce3b9d1 Mon Sep 17 00:00:00 2001 From: lyp Date: Fri, 30 May 2025 14:34:21 +0800 Subject: [PATCH] =?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() + }}> + 选择 +
+
+
+ +
+
+ 换名原因* +
+ +