diff --git a/lib/common/static/instance_ui.js b/lib/common/static/instance_ui.js index 709f783..ca8a73a 100644 --- a/lib/common/static/instance_ui.js +++ b/lib/common/static/instance_ui.js @@ -151,7 +151,14 @@ } function inferJournalDirection(o) { - const text = String((o && o.entry_reason) || ""); + const hint = String((o && (o.direction_hint || o.direction)) || "").toLowerCase(); + if (hint === "long" || hint === "buy" || hint === "多") { + return { text: "做多", cls: "direction-long" }; + } + if (hint === "short" || hint === "sell" || hint === "空") { + return { text: "做空", cls: "direction-short" }; + } + const text = String((o && (o.entry_reason || o.note)) || ""); if (/做空|空头|short/i.test(text)) { return { text: "做空", cls: "direction-short" }; } @@ -164,9 +171,9 @@ function renderJournalListHtml(data) { if (!data || !data.length) return ""; const mobile = isMobileCompactRecords(); - return data - .map(function (o) { - if (mobile) { + if (mobile) { + return data + .map(function (o) { const dir = inferJournalDirection(o); const pnlCls = pnlClassFromValue(o.pnl); const dirHtml = dir @@ -181,20 +188,48 @@ `; - } - const moodTags = (o.mood_issues || []).join(",") || "无"; + }) + .join(""); + } + const rows = data + .map(function (o) { + const moodTags = Array.isArray(o.mood_issues) + ? o.mood_issues.join(",") + : o.mood_issues || ""; + const mood = moodTags || "无"; const id = escapeHtml(o.id); - return `
| 品种 | 周期 | 方向 | 下单类型 | 开仓类型 | +盈亏U | 开仓时间 | 平仓时间 | 持仓 | 心态标签 | 操作 | +
|---|
已保存的复盘(每页5条).
-已保存的复盘(每页5条).
+