diff options
Diffstat (limited to 'src/FundLab.Web')
| -rw-r--r-- | src/FundLab.Web/App.fs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/FundLab.Web/App.fs b/src/FundLab.Web/App.fs index 6fe1189..5d091dc 100644 --- a/src/FundLab.Web/App.fs +++ b/src/FundLab.Web/App.fs @@ -169,6 +169,8 @@ type RawSipPlan = status: string anchorDate: string nextTradeDate: string + lastExecutionStatus: obj + lastExecutionDate: obj } type RawRedemption = @@ -276,6 +278,8 @@ type SipPlan = status: string anchorDate: string nextTradeDate: string + lastExecutionStatus: string option + lastExecutionDate: string option } type OrderDetail = @@ -458,6 +462,8 @@ module Api = status = raw.status anchorDate = raw.anchorDate nextTradeDate = raw.nextTradeDate + lastExecutionStatus = decodeOptionalText raw.lastExecutionStatus + lastExecutionDate = decodeOptionalText raw.lastExecutionDate } let decodeRedemption (raw: RawRedemption) : RedemptionDetail = @@ -2253,6 +2259,21 @@ let private sipPlanRow (plan: SipPlan) = Html.span [ prop.className "order-cell"; prop.text (sprintf "频率 %s" (sipFrequencyText plan.frequency)) ] Html.span [ prop.className "order-cell"; prop.text (sprintf "起投日 %s" plan.anchorDate) ] Html.span [ prop.className "order-cell"; prop.text (sprintf "下次扣款 %s" plan.nextTradeDate) ] + + let lastExecution = + match plan.lastExecutionStatus with + | Some status -> + let label = + if status = "succeeded" then "已执行" + elif status = "pending_nav" then "待净值" + elif status = "insufficient_cash" then "现金不足" + elif status = "failed" then "失败" + else status + + sprintf "最近执行 %s(%s)" label (plan.lastExecutionDate |> Option.defaultValue "—") + | None -> "最近执行 暂无" + + Html.span [ prop.className "order-cell"; prop.text lastExecution ] Html.span [ prop.className "order-status"; prop.text (if plan.status = "active" then "进行中" else plan.status) ] ] ] |
