5.11 招标文件名称,建档项目名称标段名称增加空格换行符制表符特殊字符过滤

This commit is contained in:
jl-zhoujl2
2022-05-11 12:50:39 +08:00
parent 216d65fe55
commit 54335a40ac
11 changed files with 96 additions and 75 deletions

View File

@ -12,6 +12,7 @@ import { getProMethod } from "@/utils/session";
import WebOffice0609, { WebOfficeRefProps } from "@/pages/webOffice/weboffice0609"; import WebOffice0609, { WebOfficeRefProps } from "@/pages/webOffice/weboffice0609";
import moment from "moment"; import moment from "moment";
import { AnnouncementGetMsg1, AnnouncementGetMsg2, AnnouncementGetMsg3, AnnouncementGetMsg4 } from "@/utils/AboutAnnouncementHelp"; import { AnnouncementGetMsg1, AnnouncementGetMsg2, AnnouncementGetMsg3, AnnouncementGetMsg4 } from "@/utils/AboutAnnouncementHelp";
import { trim } from "@/utils/CommonUtils";
interface BiddingDocumentProps { interface BiddingDocumentProps {
modalVisible: boolean; modalVisible: boolean;
@ -213,7 +214,7 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
let fromData = { let fromData = {
"tpId": tpId, "tpId": tpId,
"documentName": form.getFieldValue("documentName"), "documentName": trim(form.getFieldValue("documentName")),
"documentSetId": form.getFieldValue("documentSetId"), "documentSetId": form.getFieldValue("documentSetId"),
"sections": packageMsg, "sections": packageMsg,
"contentFileId": ref.current?.DocFileCode, "contentFileId": ref.current?.DocFileCode,

View File

@ -1,3 +1,4 @@
import { trim } from '@/utils/CommonUtils';
import { message } from 'antd'; import { message } from 'antd';
import { updateForm } from './service'; import { updateForm } from './service';
@ -22,6 +23,7 @@ export const changeDict = (dictList: any[], code: any) => {
*/ */
export const handleUpdate = async (fields: any) => { export const handleUpdate = async (fields: any) => {
fields.bidSectName = trim(fields.bidSectName);
const success = await updateForm(fields).then((res) => { const success = await updateForm(fields).then((res) => {
if (res.code == 200) { if (res.code == 200) {
message.success('编辑成功'); message.success('编辑成功');

View File

@ -7,7 +7,7 @@ import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils';
import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service'; import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service';
import { getDicData } from '@/utils/session'; import { getDicData } from '@/utils/session';
import '@/assets/lq_style.less'; import '@/assets/lq_style.less';
import { isEmpty } from '@/utils/CommonUtils'; import { isEmpty, trim } from '@/utils/CommonUtils';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
const { Option } = Select; const { Option } = Select;
@ -203,6 +203,7 @@ const ProjectDocumentation: React.FC<ProcurementMethodItem> = (props) => {
values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId; values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId;
} }
values.regionDictName = regionDictName; values.regionDictName = regionDictName;
values.projectName = trim(values.projectName);
!isIPassDecode && (values['isIPassDecode'] = '1'); !isIPassDecode && (values['isIPassDecode'] = '1');
updateUtils(values); updateUtils(values);
//tab标段页解除禁用 //tab标段页解除禁用
@ -355,12 +356,12 @@ const ProjectDocumentation: React.FC<ProcurementMethodItem> = (props) => {
<Form.Item <Form.Item
label="代理机构项目编号" label="代理机构项目编号"
name="agencyCompanyProjectNum" name="agencyCompanyProjectNum"
// rules={[ // rules={[
// { // {
// validator: (_, value) => // validator: (_, value) =>
// /[\u4E00-\u9FA5]/i.test(value) ? Promise.reject('不能输入汉字') : Promise.resolve() // /[\u4E00-\u9FA5]/i.test(value) ? Promise.reject('不能输入汉字') : Promise.resolve()
// } // }
// ]} // ]}
> >
<Input maxLength={49} disabled={whetherReadonly} readOnly={whetherReadonly} /> <Input maxLength={49} disabled={whetherReadonly} readOnly={whetherReadonly} />
</Form.Item> </Form.Item>

View File

@ -7,7 +7,7 @@ import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils';
import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service'; import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service';
import { getDicData } from '@/utils/session'; import { getDicData } from '@/utils/session';
import '@/assets/lq_style.less'; import '@/assets/lq_style.less';
import { isEmpty } from '@/utils/CommonUtils'; import { isEmpty, trim } from '@/utils/CommonUtils';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
const { Option } = Select; const { Option } = Select;
@ -194,6 +194,7 @@ const ProjectDocumentation: React.FC<ProcurementMethodItem> = (props) => {
values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId; values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId;
} }
values.regionDictName = regionDictName; values.regionDictName = regionDictName;
values.projectName = trim(values.projectName);
updateUtils(values); updateUtils(values);
//tab标段页解除禁用 //tab标段页解除禁用
setTabFlag(false); setTabFlag(false);

View File

@ -7,7 +7,7 @@ import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils';
import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service'; import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service';
import { getDicData } from '@/utils/session'; import { getDicData } from '@/utils/session';
import '@/assets/lq_style.less'; import '@/assets/lq_style.less';
import { isEmpty } from '@/utils/CommonUtils'; import { isEmpty, trim } from '@/utils/CommonUtils';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
const { Option } = Select; const { Option } = Select;
@ -202,6 +202,7 @@ const ProjectDocumentation: React.FC<ProcurementMethodItem> = (props) => {
values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId; values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId;
} }
values.regionDictName = regionDictName; values.regionDictName = regionDictName;
values.projectName = trim(values.projectName);
!isIPassDecode && (values['isIPassDecode'] = '1'); !isIPassDecode && (values['isIPassDecode'] = '1');
updateUtils(values); updateUtils(values);
//tab标段页解除禁用 //tab标段页解除禁用

View File

@ -7,7 +7,7 @@ import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils';
import { getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service'; import { getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service';
import { getDicData } from '@/utils/session'; import { getDicData } from '@/utils/session';
import '@/assets/lq_style.less'; import '@/assets/lq_style.less';
import { isEmpty } from '@/utils/CommonUtils'; import { isEmpty, trim } from '@/utils/CommonUtils';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
const { Option } = Select; const { Option } = Select;
@ -200,6 +200,7 @@ const ProjectDocumentation: React.FC<ProcurementMethodItem> = (props) => {
values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId; values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId;
} }
values.regionDictName = regionDictName; values.regionDictName = regionDictName;
values.projectName = trim(values.projectName);
!isIPassDecode && (values['isIPassDecode'] = '1'); !isIPassDecode && (values['isIPassDecode'] = '1');
updateUtils(values); updateUtils(values);
//tab标段页解除禁用 //tab标段页解除禁用

View File

@ -7,7 +7,7 @@ import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils';
import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service'; import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service';
import { getDicData } from '@/utils/session'; import { getDicData } from '@/utils/session';
import '@/assets/lq_style.less'; import '@/assets/lq_style.less';
import { isEmpty } from '@/utils/CommonUtils'; import { isEmpty, trim } from '@/utils/CommonUtils';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
const { Option } = Select; const { Option } = Select;
@ -204,6 +204,7 @@ const ProjectDocumentation: React.FC<ProcurementMethodItem> = (props) => {
values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId; values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId;
} }
values.regionDictName = regionDictName; values.regionDictName = regionDictName;
values.projectName = trim(values.projectName);
!isIPassDecode && (values['isIPassDecode'] = '1'); !isIPassDecode && (values['isIPassDecode'] = '1');
updateUtils(values); updateUtils(values);
//tab标段页解除禁用 //tab标段页解除禁用

View File

@ -5,7 +5,7 @@ import React, { useEffect, useState } from 'react';
import { Form, Input, Button, Select, Radio, Col, Row, Modal } from 'antd'; import { Form, Input, Button, Select, Radio, Col, Row, Modal } from 'antd';
import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils'; import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils';
import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service'; import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service';
import { isEmpty } from '@/utils/CommonUtils'; import { isEmpty, trim } from '@/utils/CommonUtils';
import { getDicData } from '@/utils/session'; import { getDicData } from '@/utils/session';
import '@/assets/lq_style.less'; import '@/assets/lq_style.less';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
@ -203,6 +203,7 @@ const ProjectDocumentation: React.FC<ProcurementMethodItem> = (props) => {
values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId; values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId;
} }
values.regionDictName = regionDictName; values.regionDictName = regionDictName;
values.projectName = trim(values.projectName);
!isIPassDecode && (values['isIPassDecode'] = '1'); !isIPassDecode && (values['isIPassDecode'] = '1');
updateUtils(values); updateUtils(values);
//tab标段页解除禁用 //tab标段页解除禁用

View File

@ -5,7 +5,7 @@
import { Form, Input, Button, Select, Radio, Col, Row, Modal } from 'antd'; import { Form, Input, Button, Select, Radio, Col, Row, Modal } from 'antd';
import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils'; import { getSelectName, ProcurementMethodItem, updateUtils } from '../utils';
import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service'; import { getBudgetAmountById, getByProvincesNumber, getDictRegion, getId, getProvince, getProvinces } from '../service';
import { isEmpty } from '@/utils/CommonUtils'; import { isEmpty, trim } from '@/utils/CommonUtils';
import { getDicData } from '@/utils/session'; import { getDicData } from '@/utils/session';
import '@/assets/lq_style.less'; import '@/assets/lq_style.less';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
@ -203,6 +203,7 @@ import { btnAuthority } from '@/utils/authority';
values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId; values.regionDictId = isEmpty(values.regionDictId) ? values.regionDictCity : values.regionDictId;
} }
values.regionDictName = regionDictName; values.regionDictName = regionDictName;
values.projectName = trim(values.projectName);
!isIPassDecode && (values['isIPassDecode'] = '1'); !isIPassDecode && (values['isIPassDecode'] = '1');
updateUtils(values); updateUtils(values);
//tab标段页解除禁用 //tab标段页解除禁用

View File

@ -1,14 +1,15 @@
import {BarsOutlined, UploadOutlined} from "@ant-design/icons" import { BarsOutlined, UploadOutlined } from "@ant-design/icons"
import {Button, Card, Checkbox, Col, Collapse, Form, Input, message, Modal, Row, Spin, Upload} from "antd" import { Button, Card, Checkbox, Col, Collapse, Form, Input, message, Modal, Row, Spin, Upload } from "antd"
import React, {useEffect, useRef, useState} from "react" import React, { useEffect, useRef, useState } from "react"
import {GetfileUsablePackage, GetfileMsg, creatfile, creatNotice} from "../service"; import { GetfileUsablePackage, GetfileMsg, creatfile, creatNotice } from "../service";
import Weboffice from "@/pages/webOffice/weboffice"; import Weboffice from "@/pages/webOffice/weboffice";
import {deleteFileObjId, getFileBidList, SnowflakeID} from "@/services/untilService"; import { deleteFileObjId, getFileBidList, SnowflakeID } from "@/services/untilService";
import ExtendUpload from "@/utils/ExtendUpload"; import ExtendUpload from "@/utils/ExtendUpload";
import {UploadProps} from "antd/lib/upload/interface"; import { UploadProps } from "antd/lib/upload/interface";
import WebOffice0609, { WebOfficeRefProps } from "@/pages/webOffice/weboffice0609"; import WebOffice0609, { WebOfficeRefProps } from "@/pages/webOffice/weboffice0609";
import { trim } from "@/utils/CommonUtils";
interface BiddingDocumentProps { interface BiddingDocumentProps {
modalVisible: boolean; modalVisible: boolean;
@ -21,12 +22,12 @@ interface BiddingDocumentProps {
} }
const layout = { const layout = {
labelCol: {span: 7}, labelCol: { span: 7 },
wrapperCol: {span: 10}, wrapperCol: { span: 10 },
}; };
const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => { const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
const {Panel} = Collapse; const { Panel } = Collapse;
const {titleName, modalVisible, onCancel, type, tpId, pkId, SX} = props; const { titleName, modalVisible, onCancel, type, tpId, pkId, SX } = props;
const [TpPackageId, setTpPackageId] = useState<any[]>([]); //标包信息 const [TpPackageId, setTpPackageId] = useState<any[]>([]); //标包信息
const [spinning, setSping] = useState<boolean>();//加载遮罩 const [spinning, setSping] = useState<boolean>();//加载遮罩
const [editInformation, setEditInformation] = useState<boolean>(false);//是否可编 const [editInformation, setEditInformation] = useState<boolean>(false);//是否可编
@ -38,7 +39,7 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
const [UploadList, setUploadList] = useState<any>(); //存upload列表 const [UploadList, setUploadList] = useState<any>(); //存upload列表
const [UploadID, setUploadID] = useState<any>("empty"); //upload 业务id const [UploadID, setUploadID] = useState<any>("empty"); //upload 业务id
const UploadProps: UploadProps = { const UploadProps: UploadProps = {
name:"file", name: "file",
disabled: editInformation disabled: editInformation
} }
@ -51,7 +52,7 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
useEffect(() => { useEffect(() => {
Int(); Int();
form.resetFields();//清除form中数据 form.resetFields();//清除form中数据
}, [type, pkId]); }, [type, pkId]);
const Int = () => { const Int = () => {
@ -67,7 +68,7 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
onCancel(); onCancel();
} }
for (const item of res.data) { for (const item of res.data) {
thisData.push({"label": item.bsName, "value": item.bsId}) thisData.push({ "label": item.bsName, "value": item.bsId })
} }
setSping(false); setSping(false);
setEditInformation(false);//可编辑 setEditInformation(false);//可编辑
@ -83,11 +84,11 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
}); });
} else if (type == "edit") {//=========================================================修改 } else if (type == "edit") {//=========================================================修改
GetfileUsablePackage(tpId,pkId).then(res => { GetfileUsablePackage(tpId, pkId).then(res => {
if (res.code == 200) { if (res.code == 200) {
let thisData2 = []; let thisData2 = [];
for (const item of res.data) { for (const item of res.data) {
thisData2.push({"label": item.bsName, "value": item.bsId}) thisData2.push({ "label": item.bsName, "value": item.bsId })
} }
setTpPackageId(thisData2); setTpPackageId(thisData2);
} }
@ -100,10 +101,10 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
} }
form.setFieldsValue({ form.setFieldsValue({
"documentName": data.documentName, "documentName": data.documentName,
"documentSetId": data.documentSetId, "documentSetId": data.documentSetId,
"sectionIds": defPak, "sectionIds": defPak,
}, },
) )
setUploadID(data.documentSetId); setUploadID(data.documentSetId);
setSping(false); setSping(false);
@ -125,15 +126,15 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
let thisData1 = []; let thisData1 = [];
let defPak = []; let defPak = [];
for (const item of data.sections) { for (const item of data.sections) {
thisData1.push({"label": item.bsName, "value": item.bsId}) thisData1.push({ "label": item.bsName, "value": item.bsId })
defPak.push(item.bsId); defPak.push(item.bsId);
} }
setTpPackageId(thisData1); setTpPackageId(thisData1);
form.setFieldsValue({ form.setFieldsValue({
"documentName": data.documentName, "documentName": data.documentName,
"documentSetId": data.documentSetId, "documentSetId": data.documentSetId,
"sectionIds": defPak, "sectionIds": defPak,
}, },
) )
@ -167,12 +168,12 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
for (const item of TpPackageId) {//包数据 for (const item of TpPackageId) {//包数据
for (const item1 of form.getFieldValue("sectionIds")) for (const item1 of form.getFieldValue("sectionIds"))
if (item.value == item1) if (item.value == item1)
packageMsg.push({"bsId": item.value, "bsName": item.label}) packageMsg.push({ "bsId": item.value, "bsName": item.label })
} }
const fromData = { const fromData = {
"tpId": tpId, "tpId": tpId,
"documentName": form.getFieldValue("documentName"), "documentName": trim(form.getFieldValue("documentName")),
"documentSetId": form.getFieldValue("documentSetId"), "documentSetId": form.getFieldValue("documentSetId"),
"sections": packageMsg, "sections": packageMsg,
"contentFileId": ref.current?.DocFileCode, "contentFileId": ref.current?.DocFileCode,
@ -243,7 +244,7 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
}, },
]} ]}
> >
<Input maxLength={200} readOnly={editInformation}/> <Input maxLength={200} readOnly={editInformation} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="关联标段" label="关联标段"
@ -258,7 +259,7 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
<Checkbox.Group <Checkbox.Group
options={TpPackageId} options={TpPackageId}
style={{width: '100%'}} style={{ width: '100%' }}
disabled={editInformation} disabled={editInformation}
> >
</Checkbox.Group> </Checkbox.Group>
@ -268,11 +269,11 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
name="documentSetId" name="documentSetId"
extra="单个附件最大30MB" extra="单个附件最大30MB"
> >
{UploadID!="empty"? <ExtendUpload uploadProps={UploadProps} bid={UploadID}/>:null} {UploadID != "empty" ? <ExtendUpload uploadProps={UploadProps} bid={UploadID} /> : null}
</Form.Item> </Form.Item>
</Form> </Form>
<h3 className="first-title"></h3> <h3 className="first-title"></h3>
<Card style={{textAlign: "center"}}> <Card style={{ textAlign: "center" }}>
<div> <div>
{/* {docBtnName != "" ? {/* {docBtnName != "" ?
<Weboffice memberBtnName={docBtnName} readonly={docReadOnly} btnStyle={docSaveBtn} btnName={"保存"} <Weboffice memberBtnName={docBtnName} readonly={docReadOnly} btnStyle={docSaveBtn} btnName={"保存"}
@ -280,12 +281,12 @@ const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
: null : null
} */} } */}
{docBtnName != "" ? ( {docBtnName != "" ? (
<WebOffice0609 <WebOffice0609
readOnly={docReadOnly} readOnly={docReadOnly}
DOCFileCode={docFileCode} DOCFileCode={docFileCode}
webOfficeRef={ref} webOfficeRef={ref}
/> />
): null} ) : null}
</div> </div>
</Card> </Card>
</Spin> </Spin>

View File

@ -11,7 +11,7 @@
* 判断是否等于空 * 判断是否等于空
* @param value * @param value
*/ */
export function isEmpty(value: any) { export function isEmpty(value: any) {
return value === null || value === void 0 || value === ''; return value === null || value === void 0 || value === '';
} }
/** /**
@ -223,7 +223,7 @@ projectTypeCodeMaps.set("/Comparison", ["procurement_mode_3"]);
//招募 //招募
projectTypeCodeMaps.set("/Recruit", ["procurement_mode_4"]); projectTypeCodeMaps.set("/Recruit", ["procurement_mode_4"]);
//谈判 //谈判
projectTypeCodeMaps.set("/Negotiation", ["procurement_mode_5", "procurement_mode_6", ]); projectTypeCodeMaps.set("/Negotiation", ["procurement_mode_5", "procurement_mode_6",]);
//询价 //询价
projectTypeCodeMaps.set("/Inquiry", ["procurement_mode_7"]); projectTypeCodeMaps.set("/Inquiry", ["procurement_mode_7"]);
@ -265,40 +265,50 @@ export const numberToChinese = (num: any) => {
var AA = new Array("零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十"); var AA = new Array("零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十");
var BB = new Array("", "十", "百", "仟", "萬", "億", "点", ""); var BB = new Array("", "十", "百", "仟", "萬", "億", "点", "");
var a = ("" + num).replace(/(^0*)/g, "").split("."), var a = ("" + num).replace(/(^0*)/g, "").split("."),
k = 0, k = 0,
re = ""; re = "";
for (var i = a[0].length - 1; i >= 0; i--) { for (var i = a[0].length - 1; i >= 0; i--) {
switch (k) { switch (k) {
case 0: case 0:
re = BB[7] + re; re = BB[7] + re;
break; break;
case 4: case 4:
if (!new RegExp("0{4}//d{" + (a[0].length - i - 1) + "}$") if (!new RegExp("0{4}//d{" + (a[0].length - i - 1) + "}$")
.test(a[0])) .test(a[0]))
re = BB[4] + re; re = BB[4] + re;
break; break;
case 8: case 8:
re = BB[5] + re; re = BB[5] + re;
BB[7] = BB[5]; BB[7] = BB[5];
k = 0; k = 0;
break; break;
} }
if (k % 4 == 2 && a[0].charAt(i + 2) != '0' && a[0].charAt(i + 1) == '0') if (k % 4 == 2 && a[0].charAt(i + 2) != '0' && a[0].charAt(i + 1) == '0')
re = AA[0] + re; re = AA[0] + re;
if (a[0].charAt(i) != '0') if (a[0].charAt(i) != '0')
re = AA[a[0].charAt(i)] + BB[k % 4] + re; re = AA[a[0].charAt(i)] + BB[k % 4] + re;
k++; k++;
} }
if (a.length > 1) // 加上小数部分(如果有小数部分) if (a.length > 1) // 加上小数部分(如果有小数部分)
{ {
re += BB[6]; re += BB[6];
for (var i = 0; i < a[1].length; i++) for (var i = 0; i < a[1].length; i++)
re += AA[a[1].charAt(i)]; re += AA[a[1].charAt(i)];
} }
if (re == '一十') if (re == '一十')
re = "十"; re = "十";
if (re.match(/^一/) && re.length == 3) if (re.match(/^一/) && re.length == 3)
re = re.replace("一", ""); re = re.replace("一", "");
return re; return re;
} }
/**
* 删除行首行尾的空白字符方法(包括空格、制表符、换页符等等)
* @param str
* @returns
*/
export const trim = (str: string | undefined) => {
let _str = str?.replace(/(^\s*)|(\s*$)/g, "");
_str = _str?.replace(/[<>|\\/?:*""“”\s\r\n\t]/, "");
return _str;
}