payDetail页面增加了一个disableClose的参数
This commit is contained in:
parent
c5cd9ac6d1
commit
58f01d86f7
|
|
@ -11,5 +11,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
closeWhenFailure: boolean;
|
closeWhenFailure: boolean;
|
||||||
mode: "frontend" | "backend";
|
mode: "frontend" | "backend";
|
||||||
autoSuccessAt: boolean;
|
autoSuccessAt: boolean;
|
||||||
|
disableClose: boolean;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ export default OakComponent({
|
||||||
closeWhenFailure: false,
|
closeWhenFailure: false,
|
||||||
mode: 'frontend',
|
mode: 'frontend',
|
||||||
autoSuccessAt: true,
|
autoSuccessAt: true,
|
||||||
|
disableClose: false,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
showCloseConfirmMp: false,
|
showCloseConfirmMp: false,
|
||||||
|
|
@ -126,7 +127,7 @@ export default OakComponent({
|
||||||
unsub: undefined,
|
unsub: undefined,
|
||||||
unsubShip: undefined,
|
unsubShip: undefined,
|
||||||
},
|
},
|
||||||
formData({ data }) {
|
formData({ data, props }) {
|
||||||
const application = this.features.application.getApplication();
|
const application = this.features.application.getApplication();
|
||||||
const iState = data?.iState;
|
const iState = data?.iState;
|
||||||
let iStateStr = this.t(`pay:v.iState.${iState}`);
|
let iStateStr = this.t(`pay:v.iState.${iState}`);
|
||||||
|
|
@ -163,7 +164,7 @@ export default OakComponent({
|
||||||
pay: data,
|
pay: data,
|
||||||
application,
|
application,
|
||||||
iStateColor,
|
iStateColor,
|
||||||
closable: !!(data?.["#oakLegalActions"]?.includes('close')),
|
closable: !props.disableClose && !!(data?.["#oakLegalActions"]?.includes('close')),
|
||||||
startPayable,
|
startPayable,
|
||||||
succeedable,
|
succeedable,
|
||||||
offline,
|
offline,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ export default function Render(props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (<>
|
return (<>
|
||||||
<Card title={t('title')} extra={<Space>
|
<Card className={Styles.card} title={t('title')} extra={<Space>
|
||||||
{succeedable ? <Button type="primary" onClick={() => {
|
{succeedable ? <Button type="primary" onClick={() => {
|
||||||
if (autoSuccessAt) {
|
if (autoSuccessAt) {
|
||||||
succeed(Date.now());
|
succeed(Date.now());
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
.card {
|
||||||
|
min-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,7 @@ export default OakComponent({
|
||||||
closeWhenFailure: false,
|
closeWhenFailure: false,
|
||||||
mode: 'frontend' as 'frontend' | 'backend',
|
mode: 'frontend' as 'frontend' | 'backend',
|
||||||
autoSuccessAt: true,
|
autoSuccessAt: true,
|
||||||
|
disableClose: false,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
showCloseConfirmMp: false,
|
showCloseConfirmMp: false,
|
||||||
|
|
@ -147,7 +148,7 @@ export default OakComponent({
|
||||||
unsub: undefined as undefined | (() => void),
|
unsub: undefined as undefined | (() => void),
|
||||||
unsubShip: undefined as undefined | (() => void),
|
unsubShip: undefined as undefined | (() => void),
|
||||||
},
|
},
|
||||||
formData({ data }) {
|
formData({ data, props }) {
|
||||||
const application = this.features.application.getApplication();
|
const application = this.features.application.getApplication();
|
||||||
const iState = data?.iState;
|
const iState = data?.iState;
|
||||||
let iStateStr = this.t(`pay:v.iState.${iState}`);
|
let iStateStr = this.t(`pay:v.iState.${iState}`);
|
||||||
|
|
@ -193,7 +194,7 @@ export default OakComponent({
|
||||||
pay: data,
|
pay: data,
|
||||||
application,
|
application,
|
||||||
iStateColor,
|
iStateColor,
|
||||||
closable: !!(data?.["#oakLegalActions"]?.includes('close')),
|
closable: !props.disableClose && !!(data?.["#oakLegalActions"]?.includes('close')),
|
||||||
startPayable,
|
startPayable,
|
||||||
succeedable,
|
succeedable,
|
||||||
offline,
|
offline,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
.card {
|
||||||
|
min-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,25 @@ export default function Render(props: WebComponentProps<EntityDict, 'pay', false
|
||||||
const { iState, price, entity } = pay;
|
const { iState, price, entity } = pay;
|
||||||
|
|
||||||
const BtnPart2: React.ReactElement[] = [];
|
const BtnPart2: React.ReactElement[] = [];
|
||||||
if (startPayable) {
|
|
||||||
|
if (succeedable) {
|
||||||
|
BtnPart2.push(
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
if (autoSuccessAt) {
|
||||||
|
succeed(Date.now());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setShowSa(true);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t('pay:action.succeedPaying')}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (startPayable) {
|
||||||
BtnPart2.push(
|
BtnPart2.push(
|
||||||
<Button
|
<Button
|
||||||
style={{ backgroundColor: '#04BE02' }}
|
style={{ backgroundColor: '#04BE02' }}
|
||||||
|
|
@ -345,63 +363,49 @@ export default function Render(props: WebComponentProps<EntityDict, 'pay', false
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (closable) {
|
if (closable) {
|
||||||
BtnPart2.push(
|
BtnPart2.push(
|
||||||
<Button
|
<Button
|
||||||
danger
|
danger
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('cc.title'),
|
title: t('cc.title'),
|
||||||
content: t('cc.content'),
|
content: t('cc.content'),
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
await execute('close');
|
await execute('close');
|
||||||
onClose();
|
onClose();
|
||||||
},
|
},
|
||||||
okText: t('common::confirm'),
|
okText: t('common::confirm'),
|
||||||
cancelText: t('common::action.cancel'),
|
cancelText: t('common::action.cancel'),
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('pay:action.close')}
|
{t('pay:action.close')}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (goBackable) {
|
if (goBackable) {
|
||||||
BtnPart2.push(
|
BtnPart2.push(
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
onClick={goBack}
|
onClick={goBack}
|
||||||
>
|
>
|
||||||
{t('common::back')}
|
{t('common::back')}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Card
|
<Card
|
||||||
|
className={Styles.card}
|
||||||
title={t('title')}
|
title={t('title')}
|
||||||
extra={
|
extra={
|
||||||
<Space>
|
<Space>
|
||||||
{
|
<Tag color={iStateColor}>
|
||||||
succeedable ? <Button
|
{t(`pay:v.iState.${iState}`)}
|
||||||
type="primary"
|
</Tag>
|
||||||
onClick={() => {
|
|
||||||
if (autoSuccessAt) {
|
|
||||||
succeed(Date.now());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
setShowSa(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t('pay:action.succeedPaying')}
|
|
||||||
</Button> : <Tag color={iStateColor}>
|
|
||||||
{t(`pay:v.iState.${iState}`)}
|
|
||||||
</Tag>
|
|
||||||
}
|
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue