禁止使用英文单引号

This commit is contained in:
lyp 2025-07-18 09:30:39 +08:00
parent 3c8abb7362
commit 1b170f2bbc

View File

@ -502,7 +502,7 @@ export default function ProjNew() {
// console.log('项目信息', data); // console.log('项目信息', data);
if (state.type == 'replace') { if (state.type == 'replace') {
setChangePrice( setChangePrice(
data.pay.servicePackageId?0:(data.pay.payment) / 100) data.pay.servicePackageId ? 0 : (data.pay.payment) / 100)
} }
setChangeProjName(data.projName) setChangeProjName(data.projName)
// 给表单赋值 // 给表单赋值
@ -570,12 +570,25 @@ export default function ProjNew() {
wrapperCol={{ span: 24 }} wrapperCol={{ span: 24 }}
style={{ width: '100%' }} style={{ width: '100%' }}
onFinish={(formData) => { onFinish={(formData) => {
// console.log(formData.projName); // const modifiedProjName = formData.projName.replace(/'/g, '');
// console.log(modifiedProjName);
// const originalProjName = formData.projName;
// const modifiedProjName = originalProjName.replace(/'/g, '');
// if (originalProjName !== modifiedProjName) {
// messageApi.open({
// type: 'warning',
// content: '禁止使用英文单引号,已去除',
// });
// form.setFieldsValue({ projName: modifiedProjName });
// }
// return
setIsCreateModalOpen(true); setIsCreateModalOpen(true);
setProjInfo({ setProjInfo({
projName: formData.projName, projName: formData.projName,
// projName: modifiedProjName,
projIntroduction: formData.projIntroduction, projIntroduction: formData.projIntroduction,
belongPeople: formData.belongPeople, belongPeople: formData.belongPeople,
contacts: formData.contacts, contacts: formData.contacts,
@ -642,6 +655,18 @@ export default function ProjNew() {
name="projName" name="projName"
rules={[ rules={[
{ required: true, message: '请输入系统全称' }, { required: true, message: '请输入系统全称' },
{
validator: (_rule, value, callback) => {
if (value) {
const modifiedValue = value.replace(/'/g, '');
if (value !== modifiedValue) {
// 更新表单值
form.setFieldsValue({ projName: modifiedValue });
}
}
callback();
},
},
]} ]}
> >
@ -671,7 +696,7 @@ export default function ProjNew() {
width: '780px', width: '780px',
height: '42px', height: '42px',
}} }}
placeholder="请输入系统全称 (注系统全称建议以“软件”、“系统”、“平台”或“APP”结尾)" placeholder="请输入系统全称 (注系统全称建议以“软件”、“系统”、“平台”或“APP”结尾,禁止使用英文单引号)"
options={selectList} options={selectList}
onSearch={(value) => { onSearch={(value) => {
// setProjNameValue(value); // setProjNameValue(value);
@ -738,7 +763,7 @@ export default function ProjNew() {
position: 'absolute', left: 165, position: 'absolute', left: 165,
display: showTip ? 'unset' : 'none', display: showTip ? 'unset' : 'none',
color: 'green', color: 'green',
}}>APP</div> }}>APP使</div>
</div> </div>
<div style={{ <div style={{
display: 'flex', display: 'flex',