fixed build error
This commit is contained in:
parent
3878c2e0f4
commit
0047563204
@ -1,13 +1,13 @@
|
|||||||
import {Button, Form, Space, Toast} from "@douyinfe/semi-ui";
|
import {Button, Form, Space, Toast} from "@douyinfe/semi-ui";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import {useEffect, useRef, useState} from "react";
|
import {useRef, useState} from "react";
|
||||||
|
|
||||||
import {Card} from "@/components/card";
|
import {Card} from "@/components/card";
|
||||||
import {BillTypes} from "@/service/bill-types.ts";
|
import {BillTypes} from "@/service/bill-types.ts";
|
||||||
import {BillDetailItems, useBillQRCode} from "@/components/bill";
|
import {BillDetailItems, useBillQRCode} from "@/components/bill";
|
||||||
|
|
||||||
import styles from './manual.module.less'
|
import styles from './manual.module.less'
|
||||||
import {createManualBill, getBillDetail} from "@/service/api/bill.ts";
|
import {createManualBill,} from "@/service/api/bill.ts";
|
||||||
import {useSetState} from "ahooks";
|
import {useSetState} from "ahooks";
|
||||||
import {BizError} from "@/service/types.ts";
|
import {BizError} from "@/service/types.ts";
|
||||||
import {IconAlertTriangle} from "@douyinfe/semi-icons";
|
import {IconAlertTriangle} from "@douyinfe/semi-icons";
|
||||||
@ -15,7 +15,6 @@ import dayjs from "dayjs";
|
|||||||
import * as Sentry from '@sentry/react'
|
import * as Sentry from '@sentry/react'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function Index() {
|
export default function Index() {
|
||||||
const {t} = useTranslation()
|
const {t} = useTranslation()
|
||||||
const frm = useRef<Form<ManualCreateBillParam>>(null)
|
const frm = useRef<Form<ManualCreateBillParam>>(null)
|
||||||
@ -27,7 +26,7 @@ export default function Index() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handleSubmit = (values: ManualCreateBillParam) => {
|
const handleSubmit = (values: ManualCreateBillParam) => {
|
||||||
setState({loading: true,errorMessage:''})
|
setState({loading: true, errorMessage: ''})
|
||||||
createManualBill(values).then((ret) => {
|
createManualBill(values).then((ret) => {
|
||||||
console.log(ret)
|
console.log(ret)
|
||||||
frm.current?.formApi.reset();
|
frm.current?.formApi.reset();
|
||||||
@ -37,11 +36,11 @@ export default function Index() {
|
|||||||
setBillInfo(ret)
|
setBillInfo(ret)
|
||||||
//getBillDetail(ret.id).then(setBillInfo);
|
//getBillDetail(ret.id).then(setBillInfo);
|
||||||
}).catch((e: BizError) => {
|
}).catch((e: BizError) => {
|
||||||
Sentry.captureMessage('Error: create manual bill error',{
|
Sentry.captureMessage('Error: create manual bill error', {
|
||||||
level: 'error',
|
level: 'error',
|
||||||
extra: {
|
extra: {
|
||||||
message:e.message,
|
message: e.message,
|
||||||
request_id:e.request_id,
|
request_id: e.request_id,
|
||||||
...values
|
...values
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -57,7 +56,7 @@ export default function Index() {
|
|||||||
const BillInfo = ({bill}: { bill?: BillModel }) => {
|
const BillInfo = ({bill}: { bill?: BillModel }) => {
|
||||||
if (!bill) return null;
|
if (!bill) return null;
|
||||||
return (<>
|
return (<>
|
||||||
<BillDetailItems bill={bill} />
|
<BillDetailItems bill={bill}/>
|
||||||
<Button onClick={exportQRCode} style={{marginTop: 20}} theme={'solid'} type={'primary'}>Download QR
|
<Button onClick={exportQRCode} style={{marginTop: 20}} theme={'solid'} type={'primary'}>Download QR
|
||||||
code</Button>
|
code</Button>
|
||||||
</>)
|
</>)
|
||||||
@ -85,10 +84,10 @@ export default function Index() {
|
|||||||
rules={[
|
rules={[
|
||||||
{required: true, message: t('manual.amount_required')},
|
{required: true, message: t('manual.amount_required')},
|
||||||
{
|
{
|
||||||
type:'number',
|
type: 'number',
|
||||||
validator:(_,v)=>{
|
validator: (_, v) => {
|
||||||
console.log(_,v)
|
console.log(_, v)
|
||||||
return !isNaN(v) && Number(v)>0;
|
return !isNaN(v) && Number(v) > 0;
|
||||||
},
|
},
|
||||||
message: t('manual.amount_gt0')
|
message: t('manual.amount_gt0')
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user