system-copyright-react/src/route/proj/ProjNew.tsx

1508 lines
70 KiB
TypeScript
Raw Normal View History

2024-03-14 18:33:58 +08:00
import './proj-new.css';
2024-05-12 07:45:51 +08:00
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
2025-03-02 11:41:21 +08:00
import { Table, AutoComplete, Button, Flex, Form, Input, message, Modal, Spin, Checkbox, DatePicker, Select } from "antd";
import { useContext, useEffect, useState, useRef } from "react";
2025-03-02 11:52:24 +08:00
// import { useLocation } from 'react-router-dom';
2024-05-12 07:45:51 +08:00
import { get, post } from "../../util/AjaxUtils.ts";
2024-06-21 16:18:01 +08:00
// import {GlobalContext} from "../../context/GlobalContext.ts";
2024-06-17 16:35:28 +08:00
import {
2024-06-14 15:50:34 +08:00
// IProjCharge,
2024-06-17 16:35:28 +08:00
ProjAdditionalType, ProjChargeType
} from "../../interfaces/proj/IProj.ts";
2024-07-15 16:58:47 +08:00
import locale from 'antd/es/date-picker/locale/zh_CN';
2024-05-12 07:45:51 +08:00
import { GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts";
2024-06-17 16:35:28 +08:00
import BelongPeople from '../../components/BelongPeople/BelongPeople.tsx'
2024-07-15 16:58:47 +08:00
import ContactPeople from '../../components/ContactPeople/ContactPeople.tsx'
import dayjs from 'dayjs';
2024-09-02 16:41:02 +08:00
import SelectCouponModal from '../../components/CouponModal/SelectCouponModal.tsx'
2025-03-02 11:41:21 +08:00
// import { key } from 'localforage';
import homes from '../../static/homes.png'
const { TextArea } = Input;
2024-05-23 14:57:22 +08:00
// const { TextArea } = Input;
2024-03-20 18:30:39 +08:00
type ProjInfo = {
projName: string;
projIntroduction: string;
2024-07-15 16:58:47 +08:00
belongPeople: string;
contacts: string;
projDevCompleteDate: string;
2024-12-23 10:35:32 +08:00
coupon?: string;
projVersion: string;
2025-01-16 14:03:58 +08:00
backendCodeLang: string;
2025-03-02 11:41:21 +08:00
envIndustry?: string
packageName?: string
2024-03-14 18:33:58 +08:00
};
2025-03-02 11:41:21 +08:00
import type {
TableColumnsType,
TableProps
} from 'antd';
interface DataType {
key: React.Key;
packageName: string;
packageMoney: number;
packageDescription: string;
packageInfoId: string;
packageOrderId: string;
}
2025-03-28 09:44:48 +08:00
import { useDispatch,useSelector } from 'react-redux'
2024-03-14 18:33:58 +08:00
export default function ProjNew() {
2025-03-11 14:06:21 +08:00
const dispath = useDispatch()
2025-03-07 08:45:05 +08:00
// 更新redux的套餐包信息
2025-03-11 14:06:21 +08:00
const getMyPackNum = () => {
get<any>({
messageApi,
url: `/api/proj/servicepkg/packageorder/count/self`,
onBefore() {
},
onSuccess({ data }) {
dispath({
type: 'upPackNum',
val: {
ALL: data.ALL,
MATERIAL: data.MATERIAL,
}
})
},
onFinally() {
}
})
}
2025-03-28 09:44:48 +08:00
const redxuState: any = useSelector(state => state)
// const [packageType, setPackageType] = useState('')
const packNum = redxuState.packNum
const [packselectShow, setPackselectShow] = useState(false)
2025-03-02 11:41:21 +08:00
const [debounceTimer, setDebounceTimer] = useState<any>(null);
// 创建一个 ref 来引用推荐列表容器
const recommendListRef = useRef<HTMLDivElement>(null);
// const [projNameValue, setProjNameValue] = useState('');
const [recommendModal, setRecommendModal] = useState(false) //推荐弹窗
// 土建弹窗输入框内容
const [recommendInput, setRecommendInput] = useState('')
// 推荐窗口加载中
// const [ailoading, setAiloading] = useState(false)
const [recommendList, setRecommendList] = useState<any[]>([
// '呵呵呵哒系统',
// '坐的我屁股疼系统',
// '坐的腰也非常疼系统',
// '减肥还是不减肥系统系统',
// '我要酷酷吃吃吃吃吃吃系统我要酷酷吃吃吃吃吃吃系统我要酷酷吃吃吃吃吃吃系统我要酷酷吃吃吃吃吃吃系统',
// '晚上吃点啥系统',
// '晚上吃点啥系统',
// '晚上吃点啥系统',
// '晚上吃点啥系统',
// '晚上吃点啥系统',
// '晚上吃点啥系统',
// '晚上吃点啥系统',
]) //推荐系统全称列表
// 根据输入内容获取标题
const getRecommendList = () => {
// // setRecommendList([])
post<any>({
messageApi,
url: `/api/proj/recommend/list-proj-name/ai`,
body: {
prompt: recommendInput
},
onBefore() {
setRecommendLoading(true)
},
onSuccess({ data }) {
if (recommendListRef.current) {
recommendListRef.current.scrollTop = 0;
}
// console.log(data);
setRecommendList(data)
},
onFinally() {
setRecommendLoading(false)
},
})
}
const [recommendLoading, setRecommendLoading] = useState(false) //推荐系统全称列表加载状态
const [selectList, setSelectList] = useState<any[]>([]) //联想先择的系统名列表
// 获取历史项目名称列表
const getHistoryList = (value: string) => {
// const encodedValue = encodeURIComponent(value);
get({
messageApi,
url: `/api/proj/recommend/list-proj-name/history`,
config: {
params: {
keywords: value
}
},
onBefore() {
},
onSuccess({ data }: any) {
// console.log(data);
setSelectList(data.map((item: any, index: any) => {
return {
key: index,
value: item
}
}))
},
onFinally() {
},
})
}
const [packList, setPackList] = useState<any[]>([]) //服务包列表
2025-03-02 11:52:24 +08:00
// const location = useLocation();
2025-03-02 11:41:21 +08:00
// const { price } = location.state || {};
2025-03-02 11:52:24 +08:00
// const [showPrice, setShowPrice] = useState(location.state.price) //显示的价格
2025-03-02 11:41:21 +08:00
const [selectPack, setSelectPack] = useState(false) //是否选择了服务器套餐
2024-09-02 16:41:02 +08:00
// 是否显示优惠券
const [couponShow, setcouponShow] = useState(true)
2024-06-21 16:18:01 +08:00
// const globalContext = useContext(GlobalContext);
2024-07-15 16:58:47 +08:00
const dateFormat = 'YYYY年MM月DD日';
2024-04-02 18:45:46 +08:00
const globalDispatchContext = useContext(GlobalDispatchContext);
2024-03-14 18:33:58 +08:00
const nav = useNavigate();
2024-03-20 18:30:39 +08:00
const pathParams = useParams();
const [queryParams] = useSearchParams();
2024-03-14 18:33:58 +08:00
2024-03-20 18:30:39 +08:00
const [messageApi, contextHolder] = message.useMessage();
const [loading, setLoading] = useState<boolean>(false);
2024-05-21 11:21:34 +08:00
const height = window.innerHeight - 180;
2024-11-19 14:58:17 +08:00
// 提示结尾是否带关键字弹窗
// const [hasKeywords, setHasKeywords] = useState<boolean>(false);
// 创建项目弹窗
2024-03-20 18:30:39 +08:00
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
const [isEditModalOpen, setIsEditModalOpen] = useState(false);
const [chargePrice, setChargePrice] = useState(0);
const [projInfo, setProjInfo] = useState<ProjInfo>({
projName: '',
projIntroduction: '',
2024-07-15 16:58:47 +08:00
belongPeople: '',
contacts: '',
projDevCompleteDate: '',
2024-12-23 10:35:32 +08:00
projVersion: '',
2025-01-16 14:03:58 +08:00
backendCodeLang: '',
2025-03-02 11:41:21 +08:00
// packageInfoId: ''
2024-03-20 18:30:39 +08:00
});
2024-06-17 16:35:28 +08:00
const [form] = Form.useForm<ProjInfo>();
// 所属者弹窗
const [belongModal, setBelongModal] = useState(false)
2024-07-15 16:58:47 +08:00
// 联系人弹窗
const [concatModal, setConcatModal] = useState(false)
2024-06-17 16:35:28 +08:00
// const [belongPeopleName ,setBelongPeopleName] = useState('')
const [belongPeopleInfo, setBelongPeopleInfo] = useState({
authorName: '',
authorType: '',
authorIdCardType: '',
authorIdCard: '',
2025-03-28 09:44:48 +08:00
authorCrcAccount: 0,
2024-07-15 16:58:47 +08:00
authorId: '',
2025-03-28 09:44:48 +08:00
authorProvinceCity: '',
authorCrcAccountPassword: '',
authorCrcAccountUsername: ''
2024-06-17 16:35:28 +08:00
})
2024-07-15 16:58:47 +08:00
const [concatPeopleInfo, setConcatPeopleInfo] = useState({
applyConcatId: '',
applyContactCsaNo: '',
applyContactEmail: '',
applyContactName: '',
applyContactPhone: '',
applyContactCompany: ''
})
2024-08-30 10:07:41 +08:00
// 优惠券弹窗
2024-09-02 16:41:02 +08:00
const [couponModal, setCouponModal] = useState(false)
2025-03-02 11:41:21 +08:00
// 服务包弹窗
const [packModal, setPackModal] = useState(false)
// 套餐包弹窗表格信息
const [total, setTotal] = useState(0)
const [nowPackageName, setNowPackageName] = useState('') //临时选择名字
2025-03-02 11:52:24 +08:00
// const [nowpackageInfoId, setNowpackageInfoId] = useState('') //临时选择包id
// const [packageInfoId, setPackageInfoId] = useState('') //确定选择包id
2025-03-02 11:41:21 +08:00
const [nowpackageOrderId, setNowpackageOrderId] = useState('') //临时选择订单id
const [packageOrderId, setPackageOrderId] = useState('') //确定选择订单id
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([packageOrderId]); //被选择的而项目
const rowSelection: TableProps<DataType>['rowSelection'] = {
selectedRowKeys,
onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => {
setSelectedRowKeys(selectedRowKeys);
setNowPackageName(selectedRows[0].packageName)
2025-03-02 11:52:24 +08:00
// setNowpackageInfoId(selectedRows[0].packageInfoId)
2025-03-02 11:41:21 +08:00
setNowpackageOrderId(selectedRows[0].packageOrderId)
},
};
2024-07-15 16:58:47 +08:00
const setValue = (value: string) => {
2024-06-17 16:35:28 +08:00
form.setFieldsValue({
2024-07-15 16:58:47 +08:00
belongPeople: value
})
}
const setConcatValue = (value: string) => {
form.setFieldsValue({
contacts: value
2024-06-17 16:35:28 +08:00
})
}
2024-03-21 22:22:35 +08:00
const [createProjId, setCreateProjId] = useState('');
2024-05-23 16:20:14 +08:00
const oldlistProjChargeAdditional: string[] = [];
2024-05-29 14:43:48 +08:00
const [listProjChargeAdditional, setlistProjChargeAdditional] = useState<string[]>([])
2024-09-06 17:26:09 +08:00
// 是否可用优惠券
const [hasCoupon, setHasCoupon] = useState(false)
// 给优惠券栏赋值
const setCouponTitle = (value: string) => {
form.setFieldsValue({
coupon: value
});
}
// 优惠券id
const [couponId, setCouponId] = useState('')
2025-03-02 11:41:21 +08:00
2024-09-06 17:26:09 +08:00
// 优惠券减的钱数
const [couponNum, setCouponNum] = useState(0)
// 查看是否有可用获取优惠券信息
const getCouponData = () => {
get({
messageApi,
url: `/api/coupon/user/listpage/self`,
// url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`,
config: {
params: {
page: 1,
rows: 10,
isEffective: 1,
isUsed: 0,
}
},
onBefore() {
},
onSuccess(data: any) {
if (data.data.rows.length > 0) {
setHasCoupon(true)
}
},
onFinally() {
},
})
}
2024-11-19 14:58:17 +08:00
//判断是否以“软件”、“系统”、“平台”或“APP”结尾
function isEndsWithKeywords(str: string) {
const keywords = ["软件", "系统", "平台", "APP"];
return keywords.some(keyword => str.endsWith(keyword));
}
// 提示信息是否显示
const [showTip, setShowTip] = useState(false)
2025-03-02 11:41:21 +08:00
const [page, setPage] = useState(1);
const packColumns: TableColumnsType<DataType> = [
{
title: '序号',
dataIndex: 'index',
key: 'packageOrderId',
align: 'center',
render: (_text, _record, index) => (page - 1) * 5 + index + 1, // 显示序号从1开始
},
{
title: '套餐名称',
dataIndex: 'packageName',
key: 'packageOrderId',
// 居中显示
align: 'center',
},
{
title: '当前剩余次数',
dataIndex: 'packageTotalSurplusCount',
align: 'center',
key: 'packageOrderId',
render: (text: number) => {
return <div>{text} </div>
}
},
{
title: '下单时间',
align: 'center',
dataIndex: 'gmtCreate',
key: 'packageOrderId',
// render: (text: string) => {
// return <div title={text} style={{ width: 200, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{text}</div>
// }
},
];
// 获取我得服务包信息
2025-03-04 19:55:31 +08:00
const getPickList = (page: number) => {
2025-03-02 11:41:21 +08:00
get<any>({
messageApi,
2025-03-02 18:07:03 +08:00
url: `/api/proj/servicepkg/packageorder/listpage/self`,
2025-03-02 11:41:21 +08:00
config: {
params: {
page: page,
rows: 5,
2025-03-04 19:55:31 +08:00
keyong: "keyong",
2025-03-02 18:07:03 +08:00
packageType: pathParams.projChargeType,
2025-03-02 11:41:21 +08:00
}
},
onBefore() {
2024-11-19 14:58:17 +08:00
2025-03-02 11:41:21 +08:00
},
onSuccess({ data }) {
// console.log(data);
// const list = data as any;
// setSelectList(data.rows)
setPackList(data.rows)
setTotal(data.total)
// const newPackList = data.rows.map((item: any) => {
// return {
// value: item.packageInfoId,
// label: item.packageName,
// key: item.packageNo,
// }
// });
// //
// setPackList(newPackList);
// setHasMore(data.total / 5 > page);
},
onFinally() {
2024-11-19 14:58:17 +08:00
2025-03-02 11:41:21 +08:00
}
})
}
2025-03-03 17:07:31 +08:00
// useEffect(() => {
// getPickList();
// }, [page]);
2025-03-02 11:41:21 +08:00
// useEffect(() => {
// if(projInfo.packageInfoId == ''){
// setPage(1)
// }
// },[projInfo.packageInfoId])
2025-03-28 09:44:48 +08:00
useEffect(() => {
if(packNum.ALL > 0 && pathParams.projChargeType == 'ALL'){
setPackselectShow(true)
}
if(packNum.MATERIAL > 0 && pathParams.projChargeType == 'MATERIAL'){
setPackselectShow(true)
}
}, [packNum]);
2024-03-20 18:30:39 +08:00
useEffect(() => {
get({
messageApi: messageApi,
url: '/api/proj/charge/get',
2024-05-12 07:45:51 +08:00
onSuccess({ data }) {
2024-07-31 16:00:30 +08:00
// console.log(data);
2024-06-17 16:35:28 +08:00
2024-06-14 15:50:34 +08:00
const charge = data as any;
2024-05-08 17:54:01 +08:00
// console.log('创建页price',charge.proj.materialAgent);
2024-05-12 07:45:51 +08:00
2024-03-20 18:30:39 +08:00
let price = 0;
switch (pathParams.projChargeType) {
case ProjChargeType.ALL:
2024-06-14 15:50:34 +08:00
// price = charge.proj.all;
2024-11-19 14:58:17 +08:00
price = charge.projTypes[0].price;
2024-03-20 18:30:39 +08:00
break;
2024-06-14 15:50:34 +08:00
// case ProjChargeType.MATERIAL_AGENT:
// price = charge.proj.materialAgent;
// break;
// case ProjChargeType.MATERIAL_AGENT_URGENT:
// price = charge.proj.materialAgentUrgent;
// break;
2024-03-20 18:30:39 +08:00
case ProjChargeType.MATERIAL:
2024-11-19 14:58:17 +08:00
price = charge.projTypes[1].price;
2024-03-20 18:30:39 +08:00
break;
case ProjChargeType.FREE:
2024-06-14 15:50:34 +08:00
price = charge.projTypes[2].price;
2024-03-20 18:30:39 +08:00
break;
default:
messageApi.error({
type: 'error',
content: '价格类型错误',
})
}
2024-05-12 07:45:51 +08:00
const pkg = queryParams.get('pkg') == 'true' ? true : false
const videoDemo = queryParams.get('videoDemo') == 'true' ? true : false
2024-07-29 17:22:42 +08:00
const urgent = queryParams.get('urgent') == 'true' ? true : false
2024-05-08 17:54:01 +08:00
if (pkg) {
2024-03-20 18:30:39 +08:00
price += charge.additional.pkg;
2024-05-23 16:20:14 +08:00
oldlistProjChargeAdditional.push(ProjAdditionalType.PKG);
2024-07-31 16:00:30 +08:00
// console.log(listProjChargeAdditional);
2024-05-29 14:43:48 +08:00
2024-03-20 18:30:39 +08:00
}
2024-05-08 17:54:01 +08:00
if (videoDemo) {
2024-03-20 18:30:39 +08:00
price += charge.additional.videoDemo;
2024-05-23 16:20:14 +08:00
oldlistProjChargeAdditional.push(ProjAdditionalType.VIDEO_DEMO);
2024-07-31 16:00:30 +08:00
// console.log(listProjChargeAdditional);
2024-05-23 16:20:14 +08:00
2024-03-20 18:30:39 +08:00
}
2024-09-02 16:41:02 +08:00
if (urgent) {
2024-07-29 17:22:42 +08:00
price += charge.additional.urgent;
oldlistProjChargeAdditional.push(ProjAdditionalType.URGENT);
2024-07-31 16:00:30 +08:00
// console.log(listProjChargeAdditional);
2024-07-29 17:22:42 +08:00
}
2024-03-20 18:30:39 +08:00
setChargePrice(price);
2024-05-23 16:20:14 +08:00
setlistProjChargeAdditional(oldlistProjChargeAdditional)
2024-05-12 07:45:51 +08:00
// console.log('传递信息pkg:',pkg,'videoDemo:',videoDemo);
2024-03-20 18:30:39 +08:00
}
})
2024-09-02 16:41:02 +08:00
// console.log('类型', pathParams.projChargeType);
if (pathParams.projChargeType == 'FREE') {
setcouponShow(false)
}
2024-09-06 17:26:09 +08:00
getCouponData()
2025-03-02 11:41:21 +08:00
// console.log('价格', showPrice);
2025-03-03 17:07:31 +08:00
getPickList(1)
2025-03-02 11:41:21 +08:00
// console.log()
2024-03-20 18:30:39 +08:00
}, []);
2024-03-14 23:34:40 +08:00
2024-03-14 18:33:58 +08:00
return (
<>
2024-03-20 18:30:39 +08:00
{contextHolder}
2024-05-12 07:45:51 +08:00
{/* <Breadcrumb
2024-03-14 18:33:58 +08:00
items={[
{title: <Link to={'/'}></Link>},
{title: <Link to={'/proj-create'}></Link>},
2024-03-14 23:34:40 +08:00
{title: '新建项目'},
2024-03-14 18:33:58 +08:00
]}
2024-05-12 07:45:51 +08:00
/> */}
2024-05-29 14:43:48 +08:00
<div className='projNew' style={{ height: `${height}px`, overflow: 'auto' }}>
2024-03-14 23:34:40 +08:00
<div className="proj-new">
2024-05-12 07:45:51 +08:00
{/* <div className="proj-title">请完善项目的基本信息</div> */}
2024-03-14 23:34:40 +08:00
<div className="proj-form">
<Form
name="basic"
2024-06-17 16:35:28 +08:00
form={form}
2025-01-20 15:24:23 +08:00
initialValues={{
2025-01-20 16:13:35 +08:00
projVersion: 'V1.0',
2025-01-20 15:24:23 +08:00
backendCodeLang: 'JAVA'
}} // 添加 initialValues 属性
2024-03-14 23:34:40 +08:00
layout={'vertical'}
2024-05-12 07:45:51 +08:00
labelCol={{ span: 24 }}
wrapperCol={{ span: 24 }}
2024-05-23 14:57:22 +08:00
style={{ width: '100%' }}
2024-03-20 18:30:39 +08:00
onFinish={(formData) => {
2025-03-02 11:41:21 +08:00
// console.log(formData.projName);
2024-03-20 18:30:39 +08:00
setIsCreateModalOpen(true);
setProjInfo({
projName: formData.projName,
2024-06-17 16:35:28 +08:00
projIntroduction: formData.projIntroduction,
2024-07-15 16:58:47 +08:00
belongPeople: formData.belongPeople,
contacts: formData.contacts,
projDevCompleteDate: formData.projDevCompleteDate,
2025-01-20 16:13:35 +08:00
projVersion: formData.projVersion ? formData.projVersion : 'V1.0',
2025-01-16 14:03:58 +08:00
backendCodeLang: formData.backendCodeLang,
2025-03-02 11:41:21 +08:00
// packageInfoId: formData.packageInfoId?formData.packageInfoId : '',
2024-03-20 18:30:39 +08:00
})
}}
2024-03-14 23:34:40 +08:00
autoComplete="off"
2024-03-14 18:33:58 +08:00
>
2025-03-04 19:55:31 +08:00
<div style={{
2025-03-03 11:24:57 +08:00
width: 800,
marginLeft: 130,
display: 'flex',
justifyContent: 'center',
marginBottom: 30,
fontWeight: 'bold',
2025-03-04 19:55:31 +08:00
fontSize: 18,
marginTop: 5
2025-03-03 11:24:57 +08:00
}}>
<img src={homes} width={19} height={19} style={{
marginTop: 4,
marginRight: 5,
}} alt="" />
<div> </div>
</div>
2025-03-02 11:41:21 +08:00
2024-11-19 14:58:17 +08:00
<div style={{ position: 'relative' }}>
<div className='formItemOne'>
2025-03-07 08:45:05 +08:00
<div className='formItem-title oneTitle'><span style={{ color: 'red' }}>*</span></div>
2024-11-19 14:58:17 +08:00
<Form.Item<ProjInfo>
name="projName"
rules={[
{ required: true, message: '请输入系统全称' },
]}
>
2025-03-02 11:41:21 +08:00
{/* <Input onChange={(e) => {
// 打印值
// console.log(e.target.value);
if (e.target.value) {
if (isEndsWithKeywords(e.target.value)) {
setShowTip(false)
} else {
setShowTip(true)
}
} else {
2024-11-19 14:58:17 +08:00
setShowTip(false)
2025-03-02 11:41:21 +08:00
}
}} style={{ background: '#eeeeee', width: '800px', height: '50px', fontSize: '16px' }} placeholder="请输入系统全称 (注系统全称建议以“软件”、“系统”、“平台”或“APP”结尾)" /> */}
<AutoComplete
className='changeStyle'
allowClear
style={{
2025-03-02 14:33:51 +08:00
// background: '#eeeeee',
2025-03-04 19:55:31 +08:00
// fontSize: '16px',
width: '780px',
height: '42px',
2025-03-02 11:41:21 +08:00
}}
placeholder="请输入系统全称 (注系统全称建议以“软件”、“系统”、“平台”或“APP”结尾)"
options={selectList}
onSearch={(value) => {
// setProjNameValue(value);
if (value) {
if (isEndsWithKeywords(value)) {
setShowTip(false);
} else {
setShowTip(true);
}
2024-11-19 14:58:17 +08:00
} else {
2025-03-02 11:41:21 +08:00
setShowTip(false);
2024-11-19 14:58:17 +08:00
}
2025-03-02 11:41:21 +08:00
}}
onChange={(value) => {
// setProjNameValue(value);
// console.log(value);
2024-11-19 14:58:17 +08:00
2025-03-02 11:41:21 +08:00
if (value) {
// getHistoryList(value);
if (isEndsWithKeywords(value)) {
setShowTip(false);
} else {
setShowTip(true);
}
// 清除之前的定时器
if (debounceTimer) {
clearTimeout(debounceTimer);
}
// 设置新的定时器
const newTimer = setTimeout(() => {
getHistoryList(value);
}, 1000);
// 更新定时器 ID
setDebounceTimer(newTimer);
} else {
setShowTip(false);
setSelectList([])
}
}}
2024-11-19 14:58:17 +08:00
2025-03-02 11:41:21 +08:00
/>
2024-11-19 14:58:17 +08:00
</Form.Item>
</div>
2025-03-02 11:41:21 +08:00
<a
onClick={() => {
// form.setFieldsValue({
// projName: '嘻嘻'
// });
setRecommendModal(true)
setRecommendList([])
}}
style={{
position: 'absolute',
right: -35,
2025-03-04 19:55:31 +08:00
top: 10,
2025-03-02 11:41:21 +08:00
}}></a>
2024-11-19 14:58:17 +08:00
<div style={{
2025-03-04 23:27:17 +08:00
position: 'absolute', left: 165,
2024-11-19 14:58:17 +08:00
display: showTip ? 'unset' : 'none',
color: 'green',
}}>APP</div>
2024-06-17 16:35:28 +08:00
</div>
2025-03-02 11:41:21 +08:00
<div style={{
display: 'flex',
2025-03-04 23:27:17 +08:00
marginTop: 20
2025-03-04 19:55:31 +08:00
}}>
<div className='formItemOne' style={{ position: 'relative' }}>
<div className='formItem-title ' style={{
// position: 'relative',
// background: 'pink',
}}>
2025-03-13 15:43:27 +08:00
2025-03-04 19:55:31 +08:00
</div>
<Form.Item<ProjInfo>
name="belongPeople"
2025-03-13 15:43:27 +08:00
rules={[
// { required: true, message: '请选择/创建知识产权所属者' }
]}
2025-03-04 19:55:31 +08:00
>
<Input style={{ background: '#eeeeee', width: '310px', height: '42px', color: '#3B3B3B' }} placeholder="请选择/创建知识产权所属者" disabled />
</Form.Item>
<div style={{
2025-03-28 09:44:48 +08:00
display: belongPeopleInfo.authorId ? 'none' : 'unset',
2025-03-07 08:45:05 +08:00
position: 'absolute', right: 20,
2025-03-05 01:10:41 +08:00
// fontSize: 16,
2025-03-07 08:45:05 +08:00
color: " #1F79FF", cursor: 'pointer',
2025-03-04 19:55:31 +08:00
// background:'pink',
width: 290,
textAlign: 'right',
}} onClick={() => {
setBelongModal(true)
}}></div>
2025-03-14 18:09:36 +08:00
<div style={{
2025-03-28 09:44:48 +08:00
display: belongPeopleInfo.authorId ? 'unset' : 'none',
2025-03-14 18:09:36 +08:00
position: 'absolute', right: 0,
// fontSize: 16,
color: " #1F79FF", cursor: 'pointer',
// background:'pink',
width: 50,
textAlign: 'center',
}} onClick={() => {
setValue('')
setBelongPeopleInfo({
authorName: '',
authorType: '',
authorIdCardType: '',
authorIdCard: '',
2025-03-28 09:44:48 +08:00
authorCrcAccount: 0,
2025-03-14 18:09:36 +08:00
authorId: '',
2025-03-28 09:44:48 +08:00
authorProvinceCity: '',
authorCrcAccountUsername: '',
authorCrcAccountPassword: '',
2025-03-14 18:09:36 +08:00
})
}}></div>
2025-03-04 19:55:31 +08:00
</div>
<div className='formItemOne' style={{ position: 'relative' }}>
<div className='formItem-title '>
2025-03-07 08:45:05 +08:00
<span style={{ color: 'red' }}>*</span>
2025-03-04 19:55:31 +08:00
</div>
<Form.Item<ProjInfo>
name="contacts"
rules={[{ required: true, message: '请选择/创建知识产权联系人' }]}
>
<Input style={{ background: '#eeeeee', width: '310px', height: '42px', color: '#3B3B3B' }} placeholder="请选择/创建知识产权联系人" disabled />
</Form.Item>
<div style={{
2025-03-07 08:45:05 +08:00
position: 'absolute', right: 20,
2025-03-05 01:10:41 +08:00
// fontSize: 16,
2025-03-07 08:45:05 +08:00
color: " #1F79FF", cursor: 'pointer',
2025-03-04 19:55:31 +08:00
width: 290,
textAlign: 'right',
}} onClick={() => {
setConcatModal(true)
}}></div>
</div>
</div>
<div style={{
display: 'flex',
2025-03-04 23:27:17 +08:00
marginTop: 20
2025-03-02 11:41:21 +08:00
}}>
<div className='formItemOne' style={{}}>
2025-03-07 08:45:05 +08:00
<div className='formItem-title oneTitle'><span style={{ color: 'red' }}>*</span></div>
2025-03-02 11:41:21 +08:00
<Form.Item<ProjInfo>
name="projVersion"
2025-01-20 15:24:23 +08:00
2025-03-02 11:41:21 +08:00
>
<Input
2025-01-20 15:24:23 +08:00
2025-03-02 14:33:51 +08:00
style={{
// background: '#eeeeee',
2025-03-04 19:55:31 +08:00
width: '310px', height: '42px',
// fontSize: '16px'
2025-03-02 14:33:51 +08:00
}} placeholder="请输入系统版本 (注默认版本为v1.0)" />
2024-12-23 10:35:32 +08:00
2025-03-02 11:41:21 +08:00
</Form.Item>
2024-12-23 10:35:32 +08:00
2025-03-02 11:41:21 +08:00
</div>
<div className='formItemOne' style={{}}>
2025-03-07 08:45:05 +08:00
<div className='formItem-title oneTitle'><span style={{ color: 'red' }}>*</span></div>
2025-03-02 11:41:21 +08:00
<Form.Item<ProjInfo>
name="backendCodeLang"
rules={[
{ required: true, message: '请选择系统语言' },
2025-01-16 14:03:58 +08:00
]}
>
2025-03-02 11:41:21 +08:00
<Select
2025-03-04 19:55:31 +08:00
style={{
width: '310px', height: '42px',
// fontSize: '16px',
}}
2025-03-02 11:41:21 +08:00
placeholder="请选择系统语言"
className='langselect'
// defaultValue="JAVA"
options={[
{ value: 'JAVA', label: 'JAVA' },
2025-03-17 11:21:13 +08:00
// { value: 'NODE', label: 'NODE(JAVASCRIPT)' },
// { value: 'PYTHON', label: 'PYTHON' },
// { value: 'GO', label: 'GO' },
2025-03-02 11:41:21 +08:00
]}
>
</Select>
</Form.Item>
</div>
2025-01-16 14:03:58 +08:00
</div>
2025-01-20 15:24:23 +08:00
2025-03-02 11:41:21 +08:00
<div style={{
display: 'flex',
2025-03-04 23:27:17 +08:00
marginTop: 20
2025-03-02 11:41:21 +08:00
}}>
2024-06-17 16:35:28 +08:00
2025-03-02 11:41:21 +08:00
{/* <div className='formItemOne' style={{}}>
<div className='formItem-title oneTitle'>/*</div>
<Form.Item<ProjInfo>
name="envIndustry"
rules={[
{ required: true, message: '请选面向行业/领域' },
]}
>
<Select
style={{ width: '310px', height: '50px', fontSize: '16px', }}
placeholder="请选面向行业/领域"
className='langselect'
// defaultValue="JAVA"
options={[
{ value: '1', label: '中小企业' },
{ value: '2', label: '事业单位' },
{ value: '3', label: '个人' },
]}
>
</Select>
</Form.Item>
</div> */}
<div className='formItemOne' style={{}}>
<div className='formItem-title '>
</div>
<Form.Item<ProjInfo>
// label="开发完成时间"
name="projDevCompleteDate"
// rules={[{ required: true, message: '请输入开发完成时间' }]}
>
<DatePicker placeholder="请选择开发完成日期"
className='detaPicker'
format={dateFormat}
locale={locale}
// style={{ width: '100%' }}
2025-03-02 14:33:51 +08:00
style={{
2025-03-04 19:55:31 +08:00
height: '42px', width: '310px',
// fontSize: 16,
2025-03-02 14:33:51 +08:00
// background: '#eeeeee',
}}
2025-03-02 11:41:21 +08:00
disabledDate={(current) => current && current > dayjs().endOf('day')}
2024-07-15 16:58:47 +08:00
2025-03-02 11:41:21 +08:00
/>
</Form.Item>
</div>
{/* 服务包 */}
2025-01-20 15:24:23 +08:00
<div style={{
2025-03-02 18:07:03 +08:00
display: couponId || pathParams.projChargeType == 'FREE' ? 'none' : 'unset'
2025-03-02 11:41:21 +08:00
}}>
<div className='formItemOne' >
<div className='formItemOne' style={{ position: 'relative' }}>
<div className='formItem-title oneTitle'></div>
<Form.Item<ProjInfo>
name="packageName"
rules={[
// { required: true, message: '请选择系统语言' },
]}
>
{/* <Select
disabled={packList.length > 0 ? false : true}
style={{ width: '310px', height: '50px', fontSize: '16px', }}
placeholder={packList.length > 0 ? '请选择服务包' : '暂无服务包'}
className='langselect'
// defaultValue="JAVA"
options={packList}
allowClear
onChange={(value) => {
if (value) {
setShowPrice(0)
setSelectPack(true)
setcouponShow(false)
} else {
setShowPrice(location.state.price)
setSelectPack(false)
setcouponShow(true)
}
}}
>
</Select> */}
2025-03-02 14:33:51 +08:00
<Input
className="custom-input"
style={{
// background: '#eeeeee',
2025-03-04 19:55:31 +08:00
// fontSize: 16,
width: '310px', height: '42px', color: '#3B3B3B'
2025-03-28 09:44:48 +08:00
}}
// placeholder={packList.length > 0 ? '请选择套餐包' : '暂无套餐包'}
placeholder={packselectShow ? '请选择套餐包' : '暂无套餐包'}
2025-03-02 14:33:51 +08:00
disabled
/>
2025-01-20 15:24:23 +08:00
2025-03-02 11:41:21 +08:00
</Form.Item>
2025-03-28 09:44:48 +08:00
<div style={{
position: 'absolute',
// left: 165,
left: 158,
top: 40,
// display: showTip ? 'unset' : 'none',
color: 'red',
fontSize: 18,
fontWeight: 'bold',
}}></div>
2025-03-02 18:07:03 +08:00
<div
style={{
2025-03-05 01:10:41 +08:00
display: selectPack ? 'none' : 'unset', position: 'absolute', right: 23,
// fontSize: 16,
2025-03-28 09:44:48 +08:00
// color: packList.length ? '#1F79FF' : '#676767', cursor: 'pointer',
color: packselectShow ? '#1F79FF' : '#676767', cursor: 'pointer',
2025-03-02 18:07:03 +08:00
// background:'pink',
width: 290,
textAlign: 'right',
}}
onClick={() => {
if (packList.length > 0) {
setPackModal(true)
2025-03-28 09:44:48 +08:00
setPage(1)
2025-03-02 18:07:03 +08:00
setSelectedRowKeys([])
2025-03-03 17:07:31 +08:00
getPickList(1)
2025-03-02 18:07:03 +08:00
// #1F79FF
} else {
messageApi.error('无可用套餐包')
}
2025-03-02 11:41:21 +08:00
2025-03-02 18:07:03 +08:00
}}></div>
2025-03-28 09:44:48 +08:00
<div style={{ display: selectPack ? 'unset' : 'none', position: 'absolute', right: 23, color: '#1F79FF', cursor: 'pointer' }} onClick={() => {
2025-03-02 11:52:24 +08:00
// setPackageInfoId('')
2025-03-02 11:41:21 +08:00
setPackageOrderId('')
2025-03-28 09:44:48 +08:00
setNowpackageOrderId('')
setNowPackageName ('')
2025-03-02 11:41:21 +08:00
form.setFieldsValue({
packageName: ''
})
setSelectPack(false)
// setcouponShow(true)
setcouponShow(true)
2025-03-02 11:52:24 +08:00
// setShowPrice(location.state.price)
2025-03-02 11:41:21 +08:00
}}></div>
2025-03-02 14:33:51 +08:00
2025-03-02 11:41:21 +08:00
</div>
</div>
</div>
2024-07-15 16:58:47 +08:00
</div>
2025-03-02 11:41:21 +08:00
<div style={{
display: 'flex',
2025-03-04 23:27:17 +08:00
marginTop: 20
2025-03-02 11:41:21 +08:00
}}>
<div style={{ display: couponShow ? 'unset' : 'none' }}>
<div className='formItemOne' style={{ position: 'relative' }}>
<div className='formItem-title '>
</div>
<Form.Item<ProjInfo>
name="coupon"
// rules={[{ required: true, message: '请选择优惠券' }]}
>
2025-03-04 19:55:31 +08:00
<Input style={{
background: '#eeeeee',
// fontSize: 16,
width: '310px', height: '42px', color: '#3B3B3B'
}} placeholder={hasCoupon ? '请选择优惠券' : '暂无可用优惠券'} disabled />
2025-03-02 11:41:21 +08:00
</Form.Item>
2025-03-02 18:07:03 +08:00
<div style={{
2025-03-05 01:10:41 +08:00
display: couponId ? 'none' : 'unset', position: 'absolute', right: 23,
// fontSize: 16,
2025-03-07 08:45:05 +08:00
color: hasCoupon ? '#1F79FF' : '#676767', cursor: 'pointer',
2025-03-02 18:07:03 +08:00
width: 290,
textAlign: 'right',
}} onClick={() => {
2025-03-02 11:41:21 +08:00
if (hasCoupon) {
setCouponModal(true)
// #1F79FF
} else {
messageApi.error('无可用优惠券')
}
// if (!selectPack) {
// if (hasCoupon) {
// setCouponModal(true);
// } else {
// messageApi.error('暂无可用优惠券');
// }
// } else {
// messageApi.error('服务包已选择,不可使用优惠券');
// }
}}></div>
<div style={{ display: couponId ? 'unset' : 'none', position: 'absolute', right: 23, fontSize: 16, color: '#1F79FF', cursor: 'pointer' }} onClick={() => {
setCouponTitle('')
setCouponId('')
setCouponNum(0)
}}></div>
</div>
2024-07-15 16:58:47 +08:00
</div>
</div>
2025-03-02 11:41:21 +08:00
{/* <div style={{
marginLeft: 50,
// fontWeight: 'bold',
fontSize: 16,
marginTop: 5,
color: 'green',
fontWeight: 'bold',
}}> : </div> */}
2025-03-04 19:55:31 +08:00
{/* <div style={{
2025-03-02 11:41:21 +08:00
height: 2,
background: '#E9E9E9',
// width: 900,
marginLeft: 50,
marginTop: 20,
marginBottom: 20,
2025-03-04 19:55:31 +08:00
}}></div> */}
{/* <div style={{
2025-03-02 11:41:21 +08:00
width: 800,
marginLeft: 130,
display: 'flex',
justifyContent: 'center',
marginBottom: 30,
fontWeight: 'bold',
2025-03-04 19:55:31 +08:00
fontSize: 18,
marginTop: 20
2025-03-02 11:41:21 +08:00
}}>
<img src={homes} width={19} height={19} style={{
marginTop: 4,
marginRight: 5,
}} alt="" />
2025-03-03 11:24:57 +08:00
<div> </div>
2025-03-02 11:41:21 +08:00
2025-03-04 19:55:31 +08:00
</div> */}
2025-03-07 08:45:05 +08:00
2024-05-29 14:43:48 +08:00
<div className='software-protocol'>
<Form.Item
name="agreement"
valuePropName="checked"
rules={[
{
validator: (_, value) =>
value ? Promise.resolve() : Promise.reject(new Error('请阅读并勾选《软件委托开发协议》')),
},
]}
>
<Checkbox>
2024-06-17 16:35:28 +08:00
<a onClick={() => {
2024-05-31 09:19:30 +08:00
window.open('https://www.aimzhu.com/Seda.html')
}}></a>
2024-05-29 14:43:48 +08:00
</Checkbox>
2024-05-12 07:45:51 +08:00
</Form.Item>
</div>
2025-03-03 11:24:57 +08:00
<div style={{
height: 2,
background: '#E9E9E9',
// width: 900,
marginLeft: 50,
marginTop: 20,
marginBottom: 20,
}}></div>
2024-05-23 14:57:22 +08:00
{/* <div className='formItemTwo'>
2024-05-12 07:45:51 +08:00
<div className='formItem-title '></div>
<Form.Item<ProjInfo>
name="projIntroduction"
>
<TextArea rows={10} style={{ background: '#eeeeee', resize: 'none',width:"328px",height:'220px',fontSize:'16px' }} placeholder="请对系统作出简单的描述,以使可准确生成资料..." />
</Form.Item>
2024-05-23 14:57:22 +08:00
</div> */}
2024-05-29 14:43:48 +08:00
<div style={{ marginTop: '' }}>
2025-03-02 11:41:21 +08:00
<div style={{
// background: 'pink',
display: 'flex',
justifyContent: 'space-evenly',
// alignItems: 'center',
}}>
<div style={{
fontSize: 30,
// color:'red',
fontWeight: 'bold',
// background:'pink',
lineHeight: '40px'
2025-03-28 09:44:48 +08:00
}}>
2025-03-02 11:41:21 +08:00
<span
style={{
color: 'red',
2024-05-29 14:43:48 +08:00
}}
2024-05-21 11:21:34 +08:00
>
2025-03-02 11:52:24 +08:00
{/* {(showPrice / 100 - couponNum) < 0 ? 0 : showPrice / 100 - couponNum} */}
{selectPack ? 0 : (chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum}
2025-03-02 11:41:21 +08:00
</span>
</div>
<div style={{
// background:'skyBlue',
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
// width:200,
}}>
<Form.Item>
<Flex align="center" justify="center" gap="large">
<Button type="primary" htmlType="submit"
size='large'
// style={{
// backgroundColor: 'var(--color-primary)', width: '216px',
// height: '50px', fontSize: '16px', marginLeft: '53px'
// }}
// onClick={()=>{
// // 打印
// }}
>
</Button>
<Button
style={{
marginLeft: 10,
}}
size='large'
type="default" htmlType="button" onClick={() => {
nav(-1);
}}
>
</Button>
</Flex>
</Form.Item>
</div>
</div>
2024-05-12 07:45:51 +08:00
</div>
2024-03-14 23:34:40 +08:00
</Form>
</div>
2024-03-14 18:33:58 +08:00
</div>
</div>
2024-03-20 18:30:39 +08:00
<Modal title="提示"
2025-03-02 11:41:21 +08:00
centered
2024-05-12 07:45:51 +08:00
okText="确定"
cancelText="取消"
open={isCreateModalOpen}
onOk={() => {
2024-05-23 16:20:14 +08:00
// console.log('最终',listProjChargeAdditional);
2024-06-21 16:18:01 +08:00
// console.log(belongPeopleInfo.authorId);
2024-07-15 16:58:47 +08:00
post<any>({
messageApi,
url: '/api/proj/create',
body: {
2025-03-02 11:41:21 +08:00
// packageInfoId: projInfo.packageInfoId,
2024-07-15 16:58:47 +08:00
projName: projInfo.projName,
2024-12-23 10:35:32 +08:00
projVersion: projInfo.projVersion,
2025-01-16 14:03:58 +08:00
backendCodeLang: projInfo.backendCodeLang,
2024-07-15 16:58:47 +08:00
projChargeType: pathParams.projChargeType,
listProjChargeAdditional: listProjChargeAdditional,
// dayjs(formInfo.getFieldValue('projDevCompleteDate')).format(dateFormat),
2025-01-20 15:24:23 +08:00
projDevCompleteDate: projInfo.projDevCompleteDate ? dayjs(projInfo.projDevCompleteDate).format(dateFormat) : '',
2024-07-15 16:58:47 +08:00
authorCrcAccount: belongPeopleInfo.authorCrcAccount,
2025-03-28 09:44:48 +08:00
authorCrcAccountPassword: belongPeopleInfo.authorCrcAccountPassword,
authorCrcAccountUsername: belongPeopleInfo.authorCrcAccountUsername,
2024-07-15 16:58:47 +08:00
authorId: belongPeopleInfo.authorId,
authorIdCard: belongPeopleInfo.authorIdCard,
authorIdCardType: belongPeopleInfo.authorIdCardType,
authorName: belongPeopleInfo.authorName,
authorProvinceCity: belongPeopleInfo.authorProvinceCity,
authorType: belongPeopleInfo.authorType,
2024-09-02 16:41:02 +08:00
applyContactCompany: concatPeopleInfo.applyContactCompany,
applyContactCsaNo: concatPeopleInfo.applyContactCsaNo,
applyContactEmail: concatPeopleInfo.applyContactEmail,
applyContactId: concatPeopleInfo.applyConcatId,
applyContactName: concatPeopleInfo.applyContactName,
applyContactPhone: concatPeopleInfo.applyContactPhone,
2024-11-19 14:58:17 +08:00
couponId: couponId ? couponId : '',
2025-03-02 11:41:21 +08:00
// packageInfoId: packageInfoId ? packageInfoId : ''
packageOrderId: packageOrderId ? packageOrderId : '',
2024-07-15 16:58:47 +08:00
},
onBefore() {
setLoading(true);
},
onSuccess({ data }) {
setIsEditModalOpen(true);
setCreateProjId(data.data);
reloadUser(messageApi, globalDispatchContext).then(() => {
messageApi.success('扣款成功');
});
2025-03-11 14:06:21 +08:00
getMyPackNum()
2024-07-15 16:58:47 +08:00
},
onFinally() {
setLoading(false);
}
})
2024-05-12 07:45:51 +08:00
setIsCreateModalOpen(false);
2024-07-15 16:58:47 +08:00
2024-05-12 07:45:51 +08:00
}}
onCancel={() => {
setIsCreateModalOpen(false);
2024-11-19 14:58:17 +08:00
2024-05-12 07:45:51 +08:00
}}>
2025-03-02 11:41:21 +08:00
<div>
{/* {(chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum} */}
{selectPack ? 0 : (chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum}
</div>
2024-03-20 18:30:39 +08:00
</Modal>
<Modal title="提示"
2024-05-12 07:45:51 +08:00
okText="确定"
cancelText="取消"
2025-03-05 01:10:41 +08:00
centered
2024-05-12 07:45:51 +08:00
open={isEditModalOpen}
onOk={() => {
2025-02-26 16:57:47 +08:00
sessionStorage.setItem('projName', projInfo.projName);
2024-05-12 07:45:51 +08:00
if (pathParams.projChargeType == ProjChargeType.ALL) {
nav(`/proj-eall/${createProjId}`);
} else if (pathParams.projChargeType == ProjChargeType.FREE) {
nav(`/proj-efree/${createProjId}`);
} else {
nav(`/proj-edit/${createProjId}`);
}
}}
onCancel={() => {
setIsEditModalOpen(false);
}}>
2024-03-20 18:30:39 +08:00
<div></div>
2024-03-14 23:34:40 +08:00
</Modal>
2024-11-19 14:58:17 +08:00
{/* <Modal title=""
okText="更改"
cancelText="继续"
open={hasKeywords}
onOk={() => {
//Form表单的projName变为空
form.resetFields(['projName']);
setHasKeywords(false);
}}
centered
onCancel={() => {
setHasKeywords(false);
setIsCreateModalOpen(true);
}}>
<div>APP</div>
</Modal> */}
2024-07-15 16:58:47 +08:00
<Modal title="选择联系人"
destroyOnClose
2025-03-02 11:41:21 +08:00
centered
2024-07-15 16:58:47 +08:00
open={concatModal}
width={1200}
footer={null}
onCancel={() => {
setConcatModal(false)
}}>
<ContactPeople isShow={true} closeModal={() => { setConcatModal(false) }} setConcatPeopleInfo={setConcatPeopleInfo} concatPeopleInfo={concatPeopleInfo} setConcatValue={setConcatValue}></ContactPeople>
</Modal>
2024-06-17 16:35:28 +08:00
<Modal title="选择所属者"
destroyOnClose
2025-03-02 11:41:21 +08:00
centered
2024-06-17 16:35:28 +08:00
open={belongModal}
width={1200}
footer={null}
onCancel={() => {
setBelongModal(false)
}}>
2024-07-15 16:58:47 +08:00
<BelongPeople closeModal={() => { setBelongModal(false) }} setBelongPeopleInfo={setBelongPeopleInfo} belongPeopleInfo={belongPeopleInfo} setValue={setValue} isShow={true}></BelongPeople>
2024-06-17 16:35:28 +08:00
</Modal>
2024-08-30 15:53:34 +08:00
<Modal title="选择优惠券"
2024-08-30 10:07:41 +08:00
destroyOnClose
2025-03-02 11:41:21 +08:00
centered
2024-08-30 10:07:41 +08:00
open={couponModal}
width={809}
footer={null}
onCancel={() => {
setCouponModal(false)
}}>
2024-09-06 17:26:09 +08:00
<SelectCouponModal
couponId={couponId}
setCouponId={(value: string) => {
setCouponId(value)
}}
2024-11-19 14:58:17 +08:00
couponNum={couponNum}
2024-09-06 17:26:09 +08:00
setCouponNum={(value: number) => {
setCouponNum(value)
}}
setCouponTitle={(value: string) => {
setCouponTitle(value)
}}
closeModal={() => {
setCouponModal(false)
}}
></SelectCouponModal>
2024-08-30 15:53:34 +08:00
</Modal>
2025-03-02 11:41:21 +08:00
<Modal title="选择套餐包"
destroyOnClose
centered
open={packModal}
width={809}
footer={null}
onCancel={() => {
setPackModal(false)
setNowPackageName('')
2025-03-02 11:52:24 +08:00
// setNowpackageInfoId('')
2025-03-02 11:41:21 +08:00
setNowpackageOrderId('')
2025-03-03 17:07:31 +08:00
// setPage(1)
2025-03-02 11:41:21 +08:00
}}>
<div>
<Table
columns={packColumns}
dataSource={packList}
rowSelection={{
...rowSelection,
// selectedRowKeys,
type: 'radio', // 设置为单选
// onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => {
// setSelectedRowKeys(selectedRowKeys);
// },
}}
pagination={{
defaultPageSize: 5, // 设置默认一页显示 5 条数据,
current: page,
total: total,
onChange: (page: number) => {
setPage(page)
2025-03-03 17:07:31 +08:00
getPickList(page)
2025-03-02 11:41:21 +08:00
// console.log(page);
}
}}
rowKey="packageOrderId"
onRow={(record) => {
return {
onClick: (event: React.MouseEvent<HTMLTableRowElement>) => {
event.stopPropagation();
// setPackSelectNo(record.packageInfoId)
setSelectedRowKeys([record.packageOrderId]);
setNowPackageName(record.packageName)
2025-03-02 11:52:24 +08:00
// setNowpackageInfoId(record.packageInfoId)
2025-03-02 11:41:21 +08:00
setNowpackageOrderId(record.packageOrderId)
},
style: { cursor: 'pointer' } // 鼠标显示为小手
};
}}
/>
<div style={{
display: 'flex',
justifyContent: 'flex-end',
marginTop: 10,
}}>
<Button onClick={() => {
setPackModal(false)
setNowPackageName('')
2025-03-02 11:52:24 +08:00
// setNowpackageInfoId('')
2025-03-02 11:41:21 +08:00
setNowpackageOrderId('')
}}></Button>
<Button
style={{
marginLeft: 10
}}
type="primary"
onClick={() => {
2025-03-28 09:44:48 +08:00
if (!nowPackageName) {
messageApi.error('请选择套餐包')
return
}
2025-03-02 11:41:21 +08:00
// setPickSelectNo(nowPickSelectNo)
2025-03-02 11:52:24 +08:00
// setShowPrice(0)
2025-03-02 11:41:21 +08:00
setSelectPack(true)
setcouponShow(false)
2025-03-02 11:52:24 +08:00
// setPackageInfoId(nowpackageInfoId)
2025-03-02 11:41:21 +08:00
setPackageOrderId(nowpackageOrderId)
form.setFieldsValue({
packageName: nowPackageName
})
setPackModal(false)
}}></Button>
</div>
</div>
</Modal>
<Modal title="推荐系统全称"
destroyOnClose
centered
open={recommendModal}
width={600}
footer={null}
onCancel={() => {
setRecommendModal(false)
}}>
<Spin tip="正在生成..." spinning={recommendLoading} >
<TextArea
placeholder='请简单介绍您想创建的系统,我们会根据您的描述为您推荐系统全称'
// 禁止下拉标
style={{
resize: 'none',
height: 133,
fontSize: 16,
padding: 20,
}}
// 回车事件
onKeyDown={(e) => {
if (e.keyCode == 13) {
// 禁止默认回车事件
e.preventDefault();
getRecommendList()
}
}}
onChange={(e) => {
// console.log(e.target.value);
setRecommendInput(e.target.value)
}}
/>
<div style={{
display: recommendList.length > 0 ? 'unset' : 'none',
}}>
<div style={{
marginTop: 10,
fontSize: 16,
fontWeight: 'bold',
}}>
</div>
<div
ref={recommendListRef}
style={{
display: 'flex',
alignItems: 'center',
flexDirection: 'column',
// background: 'pink',
paddingBottom: 10,
height: 300,
overflowY: 'scroll',
}}>
{
recommendList.map((item, index) => {
return (
<div key={index}
title={item}
style={{
fontSize: 18,
marginTop: 10,
cursor: 'pointer',
width: '100%',
background: '#F3F3F3',
padding: 10,
boxSizing: 'border-box',
textAlign: 'center',
// // 禁止换行 唱出部分用...代替
// whiteSpace: 'nowrap',
// overflowY: 'hidden',
// textOverflow: 'ellipsis',
// lineHeight: '20px',
}}
onClick={() => {
form.setFieldsValue({
projName: item
});
if (isEndsWithKeywords(item)) {
setShowTip(false);
} else {
setShowTip(true);
}
messageApi.success(`已选择${item}`);
setRecommendModal(false)
}}
>
{item}
</div>
)
})
}
</div>
</div>
<div style={{
2025-03-28 09:44:48 +08:00
// textAlign: 'right',
2025-03-02 11:41:21 +08:00
marginTop: 10,
2025-03-28 09:44:48 +08:00
// background: '#F3F3F3',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
2025-03-02 11:41:21 +08:00
}}>
2025-03-28 09:44:48 +08:00
<div style={{
fontSize: 16,
fontWeight: 'bold',
}}>
<div><span style={{
color: 'red',
}}> </span> </div>
<div style={{
color:'#1677ff',
}}></div>
</div>
2025-03-02 11:41:21 +08:00
<Button type="primary"
style={{
width: 100,
}}
onClick={() => {
getRecommendList()
}}
>{
recommendList.length > 0 ? '换一批' : '生成'
}</Button>
</div>
</Spin>
</Modal>
2024-05-12 07:45:51 +08:00
<Spin tip="正在提交..." spinning={loading} fullscreen />
2024-03-14 18:33:58 +08:00
</>
)
}