修改页面布局样式

This commit is contained in:
zlt 2026-08-12 15:55:29 +08:00
parent df0f1dbec5
commit 7b7eef674d
1 changed files with 48 additions and 31 deletions

View File

@ -101,6 +101,11 @@ pre.json{background:var(--surface-2);border:1px solid var(--hair);border-radius:
.el-tabs__item.is-active{color:var(--ink);}
.el-tabs__active-bar{background:var(--accent);}
.el-tabs__nav-wrap::after{background:var(--hair);height:1px;}
.pos-exp{display:grid;grid-template-columns:minmax(0,540px) minmax(0,1fr);gap:26px;padding:10px 16px 12px;}
.pos-exp .exp-h{font-size:13px;font-weight:600;color:var(--ink-2);margin-bottom:8px;}
.exp-led{padding:5px 0;border-bottom:1px solid var(--hair);font-size:12.5px;line-height:1.5;}
.exp-led:last-child{border-bottom:none;}
@media(max-width:900px){.pos-exp{grid-template-columns:1fr;gap:14px;}}
</style>
</head>
<body>
@ -206,23 +211,26 @@ pre.json{background:var(--surface-2);border:1px solid var(--hair);border-radius:
<el-table :data="heldPositions" size="small" border max-height="460" @expand-change="onPosExpand">
<el-table-column type="expand">
<template #default="s">
<div style="padding:6px 16px">
<div class="muted" style="margin-bottom:6px">持仓批次 + 账本(展开即载入,无需再点按钮)</div>
<el-table v-if="lotsOf===s.row.ts_code && lots.length" :data="lots" size="small" border>
<el-table-column label="批次" width="100"><template #default="l">{{ tx('lot', l.row.lot_type) }}</template></el-table-column>
<el-table-column prop="qty" label="剩余" width="80"></el-table-column>
<el-table-column prop="open_price" label="开仓价" width="90"></el-table-column>
<el-table-column prop="open_date" label="开仓日" width="110"></el-table-column>
<el-table-column prop="realized_pnl" label="已实现" width="90"></el-table-column>
</el-table>
<div class="muted" v-else-if="lotsOf===s.row.ts_code" style="padding:2px 0">无持仓批次</div>
<div class="muted" v-else style="padding:2px 0">载入中…</div>
<div style="border-top:1px solid #333;margin:8px 0 4px"></div>
<div class="muted" style="margin-bottom:2px">该股账本</div>
<div class="muted" v-if="!ledger.filter(x=>x.ts_code===s.row.ts_code).length">今日暂无记录</div>
<div v-for="(l,i) in ledger.filter(x=>x.ts_code===s.row.ts_code)" :key="i" style="padding:2px 0">
<span class="muted">{{ (l.decided_at||'').slice(5,16) }}</span>
{{ tx('arbiter', l.arbiter) }}{{ tx('verdict', l.verdict) }} {{ tx('action', l.action) }}<span v-if="l.reason" class="muted"> — {{ l.reason }}</span>
<div class="pos-exp">
<div>
<div class="exp-h">持仓批次</div>
<el-table v-if="lotsOf===s.row.ts_code && lots.length" :data="lots" size="small">
<el-table-column label="批次" min-width="84"><template #default="l">{{ tx('lot', l.row.lot_type) }}</template></el-table-column>
<el-table-column prop="qty" label="剩余" width="72" align="right"></el-table-column>
<el-table-column prop="open_price" label="开仓价" width="80" align="right"></el-table-column>
<el-table-column prop="open_date" label="开仓日" width="104"></el-table-column>
<el-table-column prop="realized_pnl" label="已实现" width="84" align="right"></el-table-column>
</el-table>
<div class="muted" v-else-if="lotsOf===s.row.ts_code" style="padding:4px 0">无持仓批次</div>
<div class="muted" v-else style="padding:4px 0">载入中…</div>
</div>
<div>
<div class="exp-h">该股账本</div>
<div class="muted" v-if="!ledger.filter(x=>x.ts_code===s.row.ts_code).length" style="padding:4px 0">今日暂无记录</div>
<div v-for="(l,i) in ledger.filter(x=>x.ts_code===s.row.ts_code)" :key="i" class="exp-led">
<span class="muted mono">{{ (l.decided_at||'').slice(5,16) }}</span>
{{ tx('arbiter', l.arbiter) }}{{ tx('verdict', l.verdict) }} {{ tx('action', l.action) }}<span v-if="l.reason" class="muted"> — {{ l.reason }}</span>
</div>
</div>
</div>
</template>
@ -248,7 +256,7 @@ pre.json{background:var(--surface-2);border:1px solid var(--hair);border-radius:
</el-table-column>
<el-table-column label="状态" width="120">
<template #default="s">{{ tx('posStatus', s.row.status) }}
<div v-if="s.row.frozen_reason && s.row.frozen_reason!=='NONE'" style="color:#f56c6c">{{ tx('frozen', s.row.frozen_reason) }}</div></template>
<div v-if="s.row.frozen_reason && s.row.frozen_reason!=='NONE'" style="color:var(--warn)">{{ tx('frozen', s.row.frozen_reason) }}</div></template>
</el-table-column>
<el-table-column label="下一步" min-width="150"><template #default="s"><span class="muted">{{ nextStep(s.row) }}</span></template></el-table-column>
<el-table-column label="操作" width="220">
@ -350,15 +358,17 @@ pre.json{background:var(--surface-2);border:1px solid var(--hair);border-radius:
</template></el-table-column>
</el-table>
<h3 style="margin-top:14px">操作日志 · 最近 {{ opLog.length }} 条</h3>
<div class="muted" style="margin-bottom:6px">每一次页面写操作都留一行;被仓位 / 盈亏 / T+1 可卖 / 单股上限挡下的,连原因一起记,不静默。</div>
<div class="muted" v-if="!opLog.length">还没有操作记录。</div>
<div v-for="(o,i) in opLog" :key="i" style="padding:3px 0;border-bottom:1px solid #262626">
<span class="muted">{{ (o.at||'').slice(11,16) }}</span>
<el-tag size="small" :type="o.result==='OK'?'primary':(o.result==='BLOCKED'?'warning':'info')" style="margin:0 6px">{{ o.result }}</el-tag>
<b>{{ o.op }}</b><span v-if="o.ts_code" class="muted"> · {{ nm(o.ts_code) }}</span>
<span v-if="o.reason" style="color:#f56c6c"> — {{ o.reason }}</span>
</div>
<h3 style="margin-top:14px;cursor:pointer" @click="showOpLog=!showOpLog">操作日志 · {{ opLog.length }} 条 <span class="muted" style="font-size:12px;font-weight:normal">{{ showOpLog?'▲ 收起':'▼ 展开' }}</span></h3>
<template v-if="showOpLog">
<div class="muted" style="margin-bottom:6px">每一次页面写操作都留一行;被仓位 / 盈亏 / T+1 可卖 / 单股上限挡下的,连原因一起记,不静默。</div>
<div class="muted" v-if="!opLog.length">还没有操作记录。</div>
<div v-for="(o,i) in opLog" :key="i" class="feed-row">
<span class="muted mono">{{ (o.at||'').slice(11,16) }}</span>
<el-tag size="small" :type="o.result==='OK'?'primary':(o.result==='BLOCKED'?'warning':'info')" style="margin:0 6px">{{ o.result }}</el-tag>
<b>{{ o.op }}</b><span v-if="o.ts_code" class="muted"> · {{ nm(o.ts_code) }}</span>
<span v-if="o.reason" style="color:var(--warn)"> — {{ o.reason }}</span>
</div>
</template>
</div>
<!-- 挂交易方案 对话框 (非盲填: 现价/持仓/可卖/浮盈都摆出来) -->
@ -488,7 +498,8 @@ pre.json{background:var(--surface-2);border:1px solid var(--hair);border-radius:
</div>
</div>
<div class="panel tblk">
<h3>设置</h3>
<h3 style="cursor:pointer" @click="showSettings=!showSettings">设置 <span class="muted" style="font-size:12px;font-weight:normal">{{ showSettings?'▲ 收起':'▼ 展开' }}</span></h3>
<template v-if="showSettings">
<div class="muted" style="margin-bottom:8px">每组先给一句「现在是什么状态」的合成说明,再让你改其中的项。改完点保存即时生效。</div>
<div class="set-card">
<div class="set-sum">资金与仓位纪律:{{ sumPosition }}</div>
@ -527,15 +538,16 @@ pre.json{background:var(--surface-2);border:1px solid var(--hair);border-radius:
<el-button size="small" @click="loadParams">放弃</el-button>
<span class="muted">关闭补仓=把「补仓上限」设为 0调低总仓上限可能触发降仓提议。</span>
</div>
</template>
</div>
<!-- 6) 系统在盯的候选 -->
<div class="panel tblk">
<h3>系统在盯的候选 <span class="muted" style="font-weight:400">· 今日选股计划 · 计划日 {{ planStatus.date || '—' }}</span></h3>
<div class="sub2">决策系统盯着、可能冒出建仓提议的票。<b style="color:var(--ink-2)">每只都标了今天为什么下单、或为什么没下单。</b></div>
<div class="sub2">系统还在盯、可能建仓的票。已下单 / 待你确认 / 被否决的,见上方「今日在办」与「等我拍板」。</div>
<div class="pool-note" v-if="(openScan.notes||[]).length"><span v-for="(n,i) in openScan.notes" :key="i">{{ n }}<span v-if="i < openScan.notes.length-1"></span></span></div>
<div class="muted" v-if="planStatus.ok===false">上游计划暂不可用。</div>
<el-table v-else :data="planRows.slice(0,20)" size="small" max-height="360" empty-text="暂无">
<el-table v-else :data="watchCandidates" size="small" max-height="360" empty-text="今天没有在盯待建的候选(都已处理,见上方)">
<el-table-column label="#" width="52" align="right"><template #default="s"><span class="mono muted">{{ s.row.rank }}</span></template></el-table-column>
<el-table-column label="股票" min-width="150"><template #default="s"><b>{{ s.row.name || nm(s.row.ts_code) }}</b> <span class="muted mono">{{ s.row.ts_code }}</span></template></el-table-column>
<el-table-column label="主题" width="130"><template #default="s"><span class="tag" v-if="s.row.theme">{{ s.row.theme }}</span><span v-else class="muted"></span></template></el-table-column>
@ -1238,6 +1250,8 @@ createApp({
const instructions = ref([]), ledger = ref([]), proposals = ref([]);
const strategies = ref([]), stratEnabled = ref(false), opLog = ref([]);
const showLedger = ref(false); // 「今天发生了什么」默认折叠
const showOpLog = ref(false); // 操作日志默认折叠
const showSettings = ref(false); // 设置默认折叠
const openScan = ref({ by_code: {}, notes: [] });
const insTab = ref('live');
const stratDlg = reactive({ visible:false, busy:false, reasons:[], ts_code:'', price:0,
@ -1417,6 +1431,8 @@ createApp({
const d = dispOf(r.ts_code);
return d.cls === 'deny' ? { ts_code: r.ts_code, name: (r.name || nm(r.ts_code)), why: d.why } : null;
}).filter(Boolean));
const watchCandidates = computed(() => (planRows.value || []).filter(r =>
['would', 'wait'].includes(dispOf(r.ts_code).cls)).slice(0, 20));
const settingKeys = ['PMS_TOTAL_SCALE', 'PMS_PORTFOLIO_CAP', 'PMS_STOCK_CAP',
'PMS_MAX_NAMES', 'PMS_CASH_RESERVE',
@ -1901,7 +1917,8 @@ createApp({
strategies, stratEnabled, opLog, stratDlg, stratQty, loadStrategies, loadOpLog,
openStrategy, validateStrategy, attachStrategy, setStrategyStatus, stratStateText, resumeBuy,
showLedger, onPosExpand,
openScan, insTab, todayYmd, insLive, insDone, insEnd, dispOf, loadOpenScan, denyToday };
openScan, insTab, todayYmd, insLive, insDone, insEnd, dispOf, loadOpenScan, denyToday,
showOpLog, showSettings, watchCandidates };
}
}).use(ElementPlus).mount('#app');
</script>