2026-07-27 17:12:09 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="zh-CN" class="dark">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
<title>PMS 持仓管理系统</title>
|
|
|
|
|
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css"/>
|
|
|
|
|
<link rel="stylesheet" href="https://unpkg.com/element-plus/theme-chalk/dark/css-vars.css"/>
|
|
|
|
|
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
|
|
|
|
<script src="https://unpkg.com/element-plus"></script>
|
|
|
|
|
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
|
|
|
<style>
|
|
|
|
|
body { margin:0; background:#0f0f0f; color:#ccc; font-family:'Inter',system-ui,sans-serif; }
|
|
|
|
|
.app { padding:12px 18px 32px; }
|
|
|
|
|
.hd { display:flex; align-items:center; gap:14px; flex-wrap:wrap;
|
|
|
|
|
padding:10px 14px; background:#1a1a1a; border:1px solid #333; border-radius:8px; }
|
|
|
|
|
.hd h1 { font-size:17px; margin:0; color:#eee; font-weight:600; letter-spacing:.5px; }
|
|
|
|
|
.hd .ver { color:#666; font-size:12px; }
|
|
|
|
|
.spacer { flex:1; }
|
|
|
|
|
.metrics { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0; }
|
|
|
|
|
.m { background:#1a1a1a; border:1px solid #333; border-radius:8px; padding:10px 14px; min-width:118px; }
|
|
|
|
|
.m .k { color:#888; font-size:12px; }
|
|
|
|
|
.m .v { color:#eee; font-size:18px; font-weight:600; margin-top:3px; }
|
|
|
|
|
.m .v.up { color:#f56c6c; } .m .v.down { color:#67c23a; }
|
|
|
|
|
.panel { background:#1a1a1a; border:1px solid #333; border-radius:8px; padding:14px; margin-bottom:14px; }
|
|
|
|
|
.panel h3 { margin:0 0 10px; font-size:14px; color:#409EFF; font-weight:600; }
|
|
|
|
|
.muted { color:#777; font-size:12px; }
|
|
|
|
|
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
|
|
|
|
|
.banner { margin:10px 0; }
|
|
|
|
|
.el-table { background:transparent !important; font-size:13px; }
|
|
|
|
|
.tier { font-size:12px; color:#909399; }
|
|
|
|
|
.mono { font-family:ui-monospace,Menlo,Consolas,monospace; }
|
|
|
|
|
.nowrap { white-space:nowrap; }
|
|
|
|
|
pre.json { background:#111; border:1px solid #333; border-radius:6px; padding:10px;
|
|
|
|
|
max-height:420px; overflow:auto; font-size:12px; color:#bbb; }
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div id="app" class="app" v-cloak>
|
|
|
|
|
|
|
|
|
|
<div class="hd">
|
|
|
|
|
<h1>PMS 持仓管理系统</h1>
|
|
|
|
|
<span class="ver">v{{ health.version || '-' }} · {{ health.now || '' }}
|
|
|
|
|
<el-tag v-if="health.trade_day" size="small" type="success" effect="dark">交易日</el-tag>
|
|
|
|
|
<el-tag v-else size="small" type="info" effect="dark">非交易日</el-tag>
|
|
|
|
|
</span>
|
|
|
|
|
<div class="spacer"></div>
|
|
|
|
|
<el-tag :type="ov.buy_halt ? 'danger':'info'" effect="dark" size="small">
|
|
|
|
|
买入 {{ ov.buy_halt ? '已暂停':'正常' }}</el-tag>
|
|
|
|
|
<el-tag :type="ov.exec_halt ? 'danger':'info'" effect="dark" size="small">
|
|
|
|
|
执行 {{ ov.exec_halt ? '已暂停':'正常' }}</el-tag>
|
|
|
|
|
<el-tag type="warning" effect="dark" size="small">自主档位 {{ ov.autonomy || '-' }}</el-tag>
|
2026-07-28 09:10:07 +08:00
|
|
|
<el-tag :type="dm.shadow ? 'info':'success'" effect="dark" size="small">
|
|
|
|
|
下发 {{ dm.mode || '-' }}</el-tag>
|
2026-07-27 17:12:09 +08:00
|
|
|
<el-button size="small" @click="openReport">日报</el-button>
|
|
|
|
|
<el-button size="small" @click="opsDrawer=true">运维</el-button>
|
|
|
|
|
<el-button size="small" type="primary" :loading="loading" @click="loadAll">刷新</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-alert v-if="err" class="banner" :title="err" type="error" effect="dark" show-icon
|
|
|
|
|
@close="err=''"/>
|
|
|
|
|
<el-alert v-if="ov.sector_ready===false" class="banner" type="warning" effect="dark" show-icon
|
|
|
|
|
:closable="false"
|
|
|
|
|
title="行业划分数据源未配置 —— 行业集中度硬拦截已停用, 行业类命令置灰 (设计 §5)"/>
|
|
|
|
|
<el-alert v-if="ov.price_missing && ov.price_missing.length" class="banner" type="warning"
|
|
|
|
|
effect="dark" show-icon :closable="false"
|
|
|
|
|
:title="'以下持仓取不到实时价, 已用摊薄成本兜底: ' + ov.price_missing.join(', ')"/>
|
|
|
|
|
<el-alert v-if="health.calendar_degraded" class="banner" type="warning" effect="dark" show-icon
|
|
|
|
|
:closable="false" title="交易日历降级: 未安装 chinesecalendar, 节假日不可辨"/>
|
2026-07-28 09:10:07 +08:00
|
|
|
<el-alert v-if="dm.shadow" class="banner" type="info" effect="dark" show-icon :closable="false"
|
|
|
|
|
:title="'影子运行中 —— ' + (dm.hint || '')"/>
|
2026-07-27 17:12:09 +08:00
|
|
|
|
|
|
|
|
<div class="metrics">
|
|
|
|
|
<div class="m"><div class="k">总规模</div><div class="v">{{ money(ov.scale) }}</div></div>
|
|
|
|
|
<div class="m"><div class="k">组合市值</div><div class="v">{{ money(ov.portfolio_mv) }}</div></div>
|
|
|
|
|
<div class="m"><div class="k">总仓位</div>
|
|
|
|
|
<div class="v">{{ pct(ov.portfolio_pct) }}<span class="muted"> / {{ pct(ov.portfolio_cap) }}</span></div></div>
|
|
|
|
|
<div class="m"><div class="k">可用额度</div><div class="v">{{ money(ov.cap_room) }}</div></div>
|
|
|
|
|
<div class="m"><div class="k">持仓数</div>
|
|
|
|
|
<div class="v">{{ ov.names_count }}<span class="muted"> / {{ ov.max_names }}</span></div></div>
|
|
|
|
|
<div class="m"><div class="k">浮动盈亏</div>
|
|
|
|
|
<div class="v" :class="(ov.float_pnl||0)>=0?'up':'down'">{{ money(ov.float_pnl) }}</div></div>
|
|
|
|
|
<div class="m"><div class="k">厚垫 / 负垫</div>
|
|
|
|
|
<div class="v">{{ ov.solid_names }} / {{ ov.neg_names }}</div></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-tabs v-model="tab" type="border-card">
|
|
|
|
|
|
|
|
|
|
<!-- ==================== ① 参数设置 ==================== -->
|
|
|
|
|
<el-tab-pane label="参数设置" name="params">
|
|
|
|
|
<div class="row" style="margin-bottom:10px">
|
|
|
|
|
<span class="muted">页面改动持久化到 pms_runtime_param, 优先于 settings.py 初值; 基础设施连接串只在 .env 维护。</span>
|
|
|
|
|
<div class="spacer"></div>
|
|
|
|
|
<el-button size="small" type="primary" :disabled="!dirtyCount" @click="saveParams">
|
|
|
|
|
保存修改 ({{ dirtyCount }})</el-button>
|
|
|
|
|
<el-button size="small" @click="loadParams">放弃修改</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="params" size="small" height="560" border>
|
|
|
|
|
<el-table-column prop="key" label="参数" width="240" class-name="mono"/>
|
|
|
|
|
<el-table-column label="当前值" width="200">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-select v-if="s.row.key==='PMS_AUTONOMY'" v-model="s.row.value" size="small">
|
|
|
|
|
<el-option v-for="o in ['full','propose_only','off']" :key="o" :label="o" :value="o"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-select v-else-if="s.row.key==='PMS_SECTOR_SOURCE'" v-model="s.row.value" size="small">
|
|
|
|
|
<el-option label="(空) 停用行业约束" value=""/>
|
|
|
|
|
<el-option label="custom_table" value="custom_table"/>
|
|
|
|
|
<el-option label="gp_stock_category" value="gp_stock_category"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-switch v-else-if="s.row.type==='bool'" v-model="s.row.value"/>
|
|
|
|
|
<el-input v-else v-model="s.row.value" size="small"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="file_default" label="文件初值" width="130"/>
|
|
|
|
|
<el-table-column label="来源" width="80">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-tag size="small" :type="s.row.source==='table'?'success':'info'" effect="dark">
|
|
|
|
|
{{ s.row.source==='table' ? '页面' : '文件' }}</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="desc" label="说明" min-width="260"/>
|
|
|
|
|
<el-table-column prop="updated_at" label="更新时间" width="160" class-name="muted"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
|
|
<!-- ==================== ② 命令台 ==================== -->
|
|
|
|
|
<el-tab-pane label="命令台" name="cmd">
|
|
|
|
|
<div class="panel">
|
|
|
|
|
<h3>下达命令</h3>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<el-select v-model="form.cmd_type" filterable placeholder="选择命令" style="width:300px"
|
|
|
|
|
@change="onCmdChange">
|
|
|
|
|
<el-option-group v-for="g in ['A','B','C']" :key="g" :label="groupLabel(g)">
|
|
|
|
|
<el-option v-for="c in catalog.filter(x=>x.group===g)" :key="c.cmd_type"
|
|
|
|
|
:label="c.label + ' · ' + c.cmd_type" :value="c.cmd_type"
|
|
|
|
|
:disabled="c.disabled">
|
|
|
|
|
<span>{{ c.label }}</span>
|
|
|
|
|
<span class="muted" style="float:right">{{ c.cls==='param'?'参数':'任务' }}</span>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-option-group>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-tag v-if="curSpec" size="small" effect="dark"
|
|
|
|
|
:type="curSpec.cls==='param'?'warning':'primary'">
|
|
|
|
|
{{ curSpec.cls==='param' ? '参数命令 (立即生效)' : '任务命令 (生成方案)' }}</el-tag>
|
|
|
|
|
<el-tag v-if="curSpec && curSpec.danger" size="small" type="danger" effect="dark">高危</el-tag>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="muted" v-if="curSpec && curSpec.note" style="margin:8px 0">{{ curSpec.note }}</div>
|
|
|
|
|
<div class="row" style="margin-top:10px" v-if="curSpec">
|
|
|
|
|
<div v-for="(f,name) in curSpec.fields" :key="name" class="row">
|
|
|
|
|
<span class="muted">{{ fieldLabel(name) }}</span>
|
|
|
|
|
<el-select v-if="f.type==='enum'" v-model="form.params[name]" size="small" style="width:150px">
|
|
|
|
|
<el-option v-for="o in f.choices" :key="o" :label="o" :value="o"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-input v-else v-model="form.params[name]" size="small" style="width:150px"
|
|
|
|
|
:placeholder="f.required===false ? '可留空(默认)' : ''">
|
|
|
|
|
<template v-if="f.type==='pct'" #append>%</template>
|
|
|
|
|
<template v-else-if="f.type==='money'" #append>元</template>
|
|
|
|
|
<template v-else-if="f.type==='price'" #append>元</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<el-input v-model="form.note" size="small" style="width:200px" placeholder="备注(可选)"/>
|
|
|
|
|
<el-button type="primary" size="small" :loading="issuing" @click="issue(false)">下达</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="muted" style="margin-top:8px" v-if="curSpec && curSpec.cls==='task'">
|
|
|
|
|
任务命令下达后立即生成方案并落 pms_plan; 指令下发由择时执行器负责 (下一批交付)。
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="panel">
|
|
|
|
|
<h3>在途命令与进度</h3>
|
|
|
|
|
<el-table :data="commands" size="small" border max-height="420"
|
|
|
|
|
:row-class-name="()=>''">
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<div style="padding:8px 16px">
|
|
|
|
|
<div class="muted">参数: <span class="mono">{{ JSON.stringify(s.row.params) }}</span></div>
|
|
|
|
|
<div class="muted" v-if="s.row.progress && s.row.progress.notes">
|
|
|
|
|
说明: {{ (s.row.progress.notes||[]).join(' | ') }}</div>
|
|
|
|
|
<el-button size="small" style="margin:8px 0" @click="loadPlans(s.row.command_id)">
|
|
|
|
|
查看方案明细</el-button>
|
|
|
|
|
<el-table v-if="plansOf===s.row.command_id" :data="plans" size="small" border>
|
|
|
|
|
<el-table-column prop="ts_code" label="股票" width="110" class-name="mono"/>
|
|
|
|
|
<el-table-column prop="action" label="动作" width="80"/>
|
|
|
|
|
<el-table-column prop="qty" label="数量" width="90"/>
|
|
|
|
|
<el-table-column label="金额" width="110">
|
|
|
|
|
<template #default="p">{{ money(p.row.amount) }}</template></el-table-column>
|
|
|
|
|
<el-table-column prop="priority" label="优先级" width="80"/>
|
|
|
|
|
<el-table-column prop="status" label="状态" width="90"/>
|
|
|
|
|
<el-table-column prop="deadline" label="截止" width="110"/>
|
|
|
|
|
<el-table-column prop="reason" label="理由" min-width="260"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="command_id" label="命令号" width="160" class-name="mono"/>
|
|
|
|
|
<el-table-column prop="cmd_type" label="类型" width="160"/>
|
|
|
|
|
<el-table-column prop="ts_code" label="标的" width="110" class-name="mono"/>
|
|
|
|
|
<el-table-column label="状态" width="100">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-tag size="small" effect="dark" :type="stTag(s.row.status)">{{ s.row.status }}</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="进度" min-width="220">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<div v-if="s.row.progress && s.row.progress.target_amount">
|
|
|
|
|
<el-progress :percentage="progPct(s.row.progress)" :stroke-width="10"
|
|
|
|
|
:text-inside="true" status="success"/>
|
|
|
|
|
<span class="muted">{{ money(s.row.progress.done_amount) }} /
|
|
|
|
|
{{ money(s.row.progress.target_amount) }}
|
|
|
|
|
<template v-if="s.row.progress.gap"> · 缺口 {{ money(s.row.progress.gap) }}</template>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<span v-else class="muted">{{ (s.row.progress||{}).plan_count || 0 }} 条方案</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="issued_at" label="下达时间" width="160" class-name="muted"/>
|
|
|
|
|
<el-table-column label="操作" width="150">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-button size="small" :disabled="!canCancel(s.row)"
|
|
|
|
|
@click="cancelCmd(s.row.command_id)">撤销</el-button>
|
|
|
|
|
<el-button size="small" :disabled="!canCancel(s.row) || s.row.cmd_class!=='task'"
|
|
|
|
|
@click="replan(s.row.command_id)">重规划</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
|
|
<!-- ==================== ③ 持仓与账本 ==================== -->
|
|
|
|
|
<el-tab-pane label="持仓与账本" name="pos">
|
|
|
|
|
<div class="panel">
|
|
|
|
|
<h3>持仓总览 ({{ positions.length }} 只)</h3>
|
|
|
|
|
<el-table :data="positions" size="small" border max-height="460">
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<div style="padding:8px 16px">
|
|
|
|
|
<el-button size="small" @click="loadLots(s.row.ts_code)">查看批次</el-button>
|
|
|
|
|
<el-table v-if="lotsOf===s.row.ts_code" :data="lots" size="small" border
|
|
|
|
|
style="margin-top:8px">
|
|
|
|
|
<el-table-column prop="lot_type" label="批次" width="90"/>
|
|
|
|
|
<el-table-column prop="qty" label="剩余" width="90"/>
|
|
|
|
|
<el-table-column prop="closed_qty" label="已核销" width="90"/>
|
|
|
|
|
<el-table-column prop="open_price" label="开仓价" width="100"/>
|
|
|
|
|
<el-table-column prop="close_avg_price" label="核销均价" width="100"/>
|
|
|
|
|
<el-table-column prop="realized_pnl" label="已实现" width="100"/>
|
|
|
|
|
<el-table-column prop="open_date" label="开仓日" width="110"/>
|
|
|
|
|
<el-table-column prop="instruction_id" label="来源指令" min-width="180"
|
|
|
|
|
class-name="mono"/>
|
|
|
|
|
<el-table-column prop="note" label="备注" min-width="160"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="ts_code" label="股票" width="110" class-name="mono"/>
|
|
|
|
|
<el-table-column prop="sector" label="行业" width="100"/>
|
|
|
|
|
<el-table-column prop="status" label="状态" width="90"/>
|
|
|
|
|
<el-table-column label="冻结" width="110">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-tag v-if="s.row.frozen_reason && s.row.frozen_reason!=='NONE'" size="small"
|
|
|
|
|
type="danger" effect="dark">{{ s.row.frozen_reason }}</el-tag>
|
|
|
|
|
<span v-else class="muted">—</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="total_qty" label="持仓" width="90"/>
|
|
|
|
|
<el-table-column prop="avail_qty" label="可卖" width="90"/>
|
|
|
|
|
<el-table-column label="批次(底/补/加/补仓/T)" width="170">
|
|
|
|
|
<template #default="s"><span class="mono nowrap">{{ s.row.base_qty }}/{{ s.row.fill_qty }}/{{ s.row.add_qty }}/{{ s.row.dca_qty }}/{{ s.row.t0_qty }}</span></template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="avg_cost" label="摊薄成本" width="100"/>
|
|
|
|
|
<el-table-column prop="price" label="现价" width="90"/>
|
|
|
|
|
<el-table-column label="安全垫" width="130">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-tag size="small" effect="dark" :type="cuTag(s.row.cushion_state)">
|
|
|
|
|
{{ pct(s.row.cushion_pct) }} {{ s.row.cushion_state }}</el-tag>
|
|
|
|
|
<span v-if="s.row.neg_cushion_days>0" class="muted"> 连负{{ s.row.neg_cushion_days }}日</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="占规模" width="90">
|
|
|
|
|
<template #default="s">{{ pct(s.row.pct_of_scale) }}</template></el-table-column>
|
|
|
|
|
<el-table-column label="市值" width="110">
|
|
|
|
|
<template #default="s">{{ money(s.row.market_value) }}</template></el-table-column>
|
|
|
|
|
<el-table-column label="参考位(支/压/止损)" width="180">
|
|
|
|
|
<template #default="s"><span class="mono nowrap">{{ s.row.support_ref||'-' }}/{{ s.row.pressure_ref||'-' }}/{{ s.row.stop_ref||'-' }}</span>
|
|
|
|
|
<span class="muted"> {{ s.row.ref_source||'' }}</span></template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="做T" width="80">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-tag v-if="s.row.t0_enabled" size="small" type="warning" effect="dark">
|
|
|
|
|
{{ pct(s.row.t0_ratio) }}</el-tag><span v-else class="muted">—</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="panel">
|
|
|
|
|
<h3>在途指令</h3>
|
2026-07-28 09:10:07 +08:00
|
|
|
<el-table :data="instructions" size="small" border max-height="320">
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<div style="padding:6px 16px">
|
|
|
|
|
<div class="muted" v-if="(s.row.progress||{}).last_decision">
|
|
|
|
|
最近判定 [{{ s.row.progress.last_decision.at }}]
|
|
|
|
|
<b>{{ s.row.progress.last_decision.action }}</b> —
|
|
|
|
|
{{ s.row.progress.last_decision.reason }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="muted" v-if="(s.row.progress||{}).deadline">
|
|
|
|
|
执行窗口截止: {{ s.row.progress.deadline }}
|
|
|
|
|
<template v-if="(s.row.progress||{}).window_verdict">
|
|
|
|
|
· {{ s.row.progress.window_verdict.note }}</template>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table v-if="((s.row.progress||{}).children||[]).length"
|
|
|
|
|
:data="s.row.progress.children" size="small" border
|
|
|
|
|
style="margin-top:6px">
|
|
|
|
|
<el-table-column prop="ymd" label="日期" width="100"/>
|
|
|
|
|
<el-table-column prop="at" label="时点" width="90"/>
|
|
|
|
|
<el-table-column prop="qty" label="数量" width="90"/>
|
|
|
|
|
<el-table-column prop="limit" label="限价" width="90"/>
|
|
|
|
|
<el-table-column prop="mode" label="通道" width="100"/>
|
|
|
|
|
<el-table-column label="兜底" width="70">
|
|
|
|
|
<template #default="c">{{ c.row.forced ? '是' : '—' }}</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="reason" label="出手依据" min-width="260"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div v-else class="muted" style="margin-top:6px">尚无出手记录</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2026-07-27 17:12:09 +08:00
|
|
|
<el-table-column prop="instruction_id" label="指令号" width="230" class-name="mono"/>
|
|
|
|
|
<el-table-column prop="ts_code" label="股票" width="110" class-name="mono"/>
|
2026-07-28 09:10:07 +08:00
|
|
|
<el-table-column prop="action" label="动作" width="80"/>
|
2026-07-27 17:12:09 +08:00
|
|
|
<el-table-column prop="side" label="方向" width="70"/>
|
2026-07-28 09:10:07 +08:00
|
|
|
<el-table-column prop="qty" label="数量" width="80"/>
|
|
|
|
|
<el-table-column prop="exec_qty" label="已成交" width="80"/>
|
|
|
|
|
<el-table-column label="进度" width="130">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-progress :percentage="insPct(s.row)" :stroke-width="10" :text-inside="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="status" label="状态" width="115"/>
|
|
|
|
|
<el-table-column prop="origin_type" label="来源" width="80"/>
|
|
|
|
|
<el-table-column label="操作" width="90">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-button size="small" @click="cancelIns(s.row.instruction_id)">撤销</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2026-07-27 17:12:09 +08:00
|
|
|
</el-table>
|
|
|
|
|
<div class="muted" style="margin-top:6px">
|
2026-07-28 09:10:07 +08:00
|
|
|
{{ dm.hint }} 展开可看每日子单与择时依据; 成交量以下游回放为准, 不拿下发量当成交量。
|
2026-07-27 17:12:09 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="panel">
|
|
|
|
|
<h3>评审账本 (规则闸 / 研判闸 / 人工裁决全量留痕)</h3>
|
|
|
|
|
<el-table :data="ledger" size="small" border max-height="260">
|
|
|
|
|
<el-table-column prop="decided_at" label="时间" width="160"/>
|
|
|
|
|
<el-table-column prop="ts_code" label="股票" width="110" class-name="mono"/>
|
|
|
|
|
<el-table-column prop="action" label="动作" width="90"/>
|
|
|
|
|
<el-table-column prop="arbiter" label="评审方" width="90"/>
|
|
|
|
|
<el-table-column label="结论" width="90">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-tag size="small" effect="dark" :type="s.row.verdict==='PASS'?'success':'danger'">
|
|
|
|
|
{{ s.row.verdict }}</el-tag></template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="price_at" label="评审价" width="90"/>
|
|
|
|
|
<el-table-column label="未通过项" min-width="240">
|
|
|
|
|
<template #default="s"><span class="muted">{{ (s.row.failed_checks||[]).join(' | ') }}</span></template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="reason" label="理由" min-width="200"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
|
|
<!-- ==================== ④ 提议确认 ==================== -->
|
|
|
|
|
<el-tab-pane name="prop">
|
|
|
|
|
<template #label>
|
|
|
|
|
提议确认
|
|
|
|
|
<el-badge v-if="proposals.length" :value="proposals.length" class="ml"/>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="panel">
|
|
|
|
|
<h3>待确认队列 (自主档位 {{ ov.autonomy }})</h3>
|
|
|
|
|
<div class="muted" style="margin-bottom:8px">
|
|
|
|
|
propose_only 档位下, 增持类自主动作全部在此等待裁决; 减持方向不设确认门槛。
|
|
|
|
|
采纳后先落指令表 (先记账后动作), 由择时执行器分日出手。
|
|
|
|
|
</div>
|
2026-07-28 09:29:53 +08:00
|
|
|
<el-alert v-if="dm.judge && !dm.judge.available" type="warning" effect="dark" show-icon
|
|
|
|
|
:closable="false" style="margin-bottom:10px"
|
|
|
|
|
:title="'研判闸未接通 —— ' + dm.judge.reason + ' (补足/加仓/补仓一律降级为人工确认)'"/>
|
2026-07-27 17:12:09 +08:00
|
|
|
<el-table :data="proposals" size="small" border max-height="420">
|
|
|
|
|
<el-table-column prop="proposal_id" label="提议号" width="230" class-name="mono"/>
|
|
|
|
|
<el-table-column prop="ts_code" label="股票" width="110" class-name="mono"/>
|
|
|
|
|
<el-table-column prop="action" label="动作" width="90"/>
|
|
|
|
|
<el-table-column prop="qty" label="数量" width="90"/>
|
|
|
|
|
<el-table-column label="硬数字" min-width="320">
|
|
|
|
|
<template #default="s"><span class="mono muted">{{ JSON.stringify(s.row.hard_numbers) }}</span></template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="judge_verdict" label="研判" width="100"/>
|
|
|
|
|
<el-table-column prop="expire_at" label="失效时间" width="160"/>
|
|
|
|
|
<el-table-column label="裁决" width="170">
|
|
|
|
|
<template #default="s">
|
|
|
|
|
<el-button size="small" type="success" @click="decide(s.row,'ACCEPTED')">采纳</el-button>
|
|
|
|
|
<el-button size="small" type="danger" @click="decide(s.row,'DECLINED')">驳回</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
<!-- 运维抽屉 -->
|
|
|
|
|
<el-drawer v-model="opsDrawer" title="运维操作 (与调度器同一份实现)" size="46%">
|
|
|
|
|
<div class="muted" style="margin-bottom:10px">
|
|
|
|
|
调度器 (--profile sched) 会自动按调度总表执行; 此处按钮用于未接调度或临时验证时手动触发。
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
2026-07-28 09:10:07 +08:00
|
|
|
<el-button @click="ops('plan-pending')" :loading="opsLoading">推进待规划命令</el-button>
|
|
|
|
|
<el-button @click="ops('materialize')" :loading="opsLoading">方案转指令</el-button>
|
|
|
|
|
<el-button type="primary" @click="ops('exec-tick?dry_run=true')" :loading="opsLoading">
|
|
|
|
|
出手试算 (不下发)</el-button>
|
|
|
|
|
<el-button @click="ops('exec-tick')" :loading="opsLoading">出手一跳</el-button>
|
|
|
|
|
<el-button @click="ops('sweep-windows')" :loading="opsLoading">窗口收口</el-button>
|
|
|
|
|
</div>
|
2026-07-28 09:29:53 +08:00
|
|
|
<div class="row" style="margin-top:8px">
|
|
|
|
|
<el-button type="primary" @click="ops('scan-proposals?dry_run=true')" :loading="opsLoading">
|
|
|
|
|
提议扫描试算 (不落表)</el-button>
|
|
|
|
|
<el-button @click="ops('scan-proposals')" :loading="opsLoading">提议扫描</el-button>
|
|
|
|
|
</div>
|
2026-07-28 09:10:07 +08:00
|
|
|
<div class="row" style="margin-top:8px">
|
2026-07-27 17:12:09 +08:00
|
|
|
<el-button @click="ops('replay')" :loading="opsLoading">成交回放</el-button>
|
|
|
|
|
<el-button @click="ops('reconcile')" :loading="opsLoading">账本对账</el-button>
|
|
|
|
|
<el-button @click="ops('premarket')" :loading="opsLoading">盘前准备</el-button>
|
|
|
|
|
<el-button @click="ops('daily-settle')" :loading="opsLoading">日终结算</el-button>
|
|
|
|
|
<el-button @click="ops('report')" :loading="opsLoading">生成日报</el-button>
|
|
|
|
|
<el-button @click="loadSchema" :loading="opsLoading">导出下游表结构</el-button>
|
|
|
|
|
</div>
|
2026-07-28 09:10:07 +08:00
|
|
|
<div class="muted" style="margin-top:10px">
|
|
|
|
|
当前下发通道: <b>{{ dm.mode }}</b> —— {{ dm.hint }}
|
|
|
|
|
(通道在「参数设置 → PMS_DISPATCH_MODE」切换)
|
|
|
|
|
</div>
|
2026-07-27 17:12:09 +08:00
|
|
|
<pre class="json" v-if="opsResult">{{ opsResult }}</pre>
|
|
|
|
|
</el-drawer>
|
|
|
|
|
|
|
|
|
|
<!-- 日报抽屉 -->
|
|
|
|
|
<el-drawer v-model="reportDrawer" :title="'运营日报 ' + (report.ymd||'')" size="52%">
|
|
|
|
|
<div v-if="(report.report||{}).attention">
|
|
|
|
|
<h3 style="color:#409EFF;font-size:14px">关注区</h3>
|
|
|
|
|
<el-table :data="report.report.attention" size="small" border>
|
|
|
|
|
<el-table-column prop="type" label="事项" width="130"/>
|
|
|
|
|
<el-table-column label="内容">
|
|
|
|
|
<template #default="s"><span class="mono muted">{{ JSON.stringify(s.row) }}</span></template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
<pre class="json">{{ JSON.stringify(report.report||{}, null, 2) }}</pre>
|
|
|
|
|
</el-drawer>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
const { createApp, ref, reactive, computed, onMounted } = Vue;
|
|
|
|
|
const api = axios.create({ timeout: 60000 });
|
|
|
|
|
|
|
|
|
|
createApp({
|
|
|
|
|
setup() {
|
|
|
|
|
const tab = ref('cmd'), loading = ref(false), err = ref('');
|
|
|
|
|
const health = ref({}), ov = ref({}), params = ref([]), paramsRaw = ref({});
|
|
|
|
|
const catalog = ref([]), commands = ref([]), plans = ref([]), plansOf = ref('');
|
|
|
|
|
const positions = ref([]), lots = ref([]), lotsOf = ref('');
|
|
|
|
|
const instructions = ref([]), ledger = ref([]), proposals = ref([]);
|
2026-07-28 09:10:07 +08:00
|
|
|
const report = ref({}), reportDrawer = ref(false), dm = ref({});
|
2026-07-27 17:12:09 +08:00
|
|
|
const opsDrawer = ref(false), opsResult = ref(''), opsLoading = ref(false);
|
|
|
|
|
const issuing = ref(false);
|
|
|
|
|
const form = reactive({ cmd_type: '', params: {}, note: '' });
|
|
|
|
|
|
|
|
|
|
const curSpec = computed(() => catalog.value.find(c => c.cmd_type === form.cmd_type));
|
|
|
|
|
const dirtyCount = computed(() =>
|
|
|
|
|
params.value.filter(p => String(p.value) !== String(paramsRaw.value[p.key])).length);
|
|
|
|
|
|
|
|
|
|
const money = v => (v === null || v === undefined || v === '') ? '—'
|
|
|
|
|
: Number(v).toLocaleString('zh-CN', { maximumFractionDigits: 0 });
|
|
|
|
|
const pct = v => (v === null || v === undefined || v === '') ? '—'
|
|
|
|
|
: (Number(v) * 100).toFixed(2) + '%';
|
|
|
|
|
const groupLabel = g => ({ A: 'A 资金与总体参数', B: 'B 组合级动作', C: 'C 个股级动作' }[g]);
|
|
|
|
|
const fieldLabel = n => ({
|
|
|
|
|
pct: '比例', scale: '总规模', cap: '上限', target: '目标', n: '数量', mode: '档位',
|
|
|
|
|
ratio: '比例', window_tdays: '窗口(交易日)', ts_code: '股票代码', target_pct: '目标仓位',
|
|
|
|
|
sector: '行业', t_ratio: 'T仓比例', price: '价格', confirm: '二次确认',
|
|
|
|
|
target_command_id: '目标命令号'
|
|
|
|
|
}[n] || n);
|
|
|
|
|
const stTag = s => ({ EXECUTING: 'primary', DONE: 'success', PARTIAL: 'warning',
|
|
|
|
|
CANCELLED: 'info', EFFECTIVE: 'success', SUPERSEDED: 'info' }[s] || 'warning');
|
|
|
|
|
const cuTag = s => ({ SOLID: 'success', THIN: 'warning', NONE: 'danger' }[s] || 'info');
|
|
|
|
|
const canCancel = r => r.cmd_class === 'task' &&
|
|
|
|
|
['PENDING', 'PLANNING', 'EXECUTING', 'PARTIAL'].includes(r.status);
|
|
|
|
|
const progPct = p => {
|
|
|
|
|
const t = Number(p.target_amount || 0), d = Number(p.done_amount || 0);
|
|
|
|
|
return t > 0 ? Math.min(100, Math.round(d / t * 100)) : 0;
|
|
|
|
|
};
|
2026-07-28 09:10:07 +08:00
|
|
|
const insPct = r => {
|
|
|
|
|
const q = Number(r.qty || 0), e = Number(r.exec_qty || 0);
|
|
|
|
|
return q > 0 ? Math.min(100, Math.round(e / q * 100)) : 0;
|
|
|
|
|
};
|
2026-07-27 17:12:09 +08:00
|
|
|
|
|
|
|
|
async function call(method, url, body) {
|
|
|
|
|
try {
|
|
|
|
|
const r = await api[method](url, body);
|
|
|
|
|
if (r.data && r.data.ok === false) { err.value = r.data.error || '请求失败'; }
|
|
|
|
|
return r.data;
|
|
|
|
|
} catch (e) { err.value = url + ' → ' + e.message; return { ok: false, error: e.message }; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function loadParams() {
|
|
|
|
|
const d = await call('get', '/api/params');
|
|
|
|
|
const list = ((d.data || d).params) || [];
|
|
|
|
|
params.value = list;
|
|
|
|
|
paramsRaw.value = Object.fromEntries(list.map(p => [p.key, p.value]));
|
|
|
|
|
}
|
|
|
|
|
async function saveParams() {
|
|
|
|
|
const items = params.value
|
|
|
|
|
.filter(p => String(p.value) !== String(paramsRaw.value[p.key]))
|
|
|
|
|
.map(p => ({ key: p.key, value: p.value }));
|
|
|
|
|
const d = await call('post', '/api/params', { items });
|
|
|
|
|
const bad = (d.results || []).filter(r => !r.ok);
|
|
|
|
|
if (bad.length) ElementPlus.ElMessage.error(bad.map(b => b.error).join('; '));
|
|
|
|
|
else ElementPlus.ElMessage.success('已保存 ' + items.length + ' 项');
|
|
|
|
|
await loadParams(); await loadOverview();
|
|
|
|
|
}
|
|
|
|
|
async function loadOverview() {
|
|
|
|
|
const d = await call('get', '/api/overview'); ov.value = d.data || d || {};
|
|
|
|
|
health.value = await call('get', '/health');
|
|
|
|
|
}
|
|
|
|
|
async function loadCatalog() {
|
|
|
|
|
const d = await call('get', '/api/commands/catalog');
|
|
|
|
|
catalog.value = ((d.data || d).commands) || [];
|
|
|
|
|
}
|
|
|
|
|
async function loadCommands() {
|
|
|
|
|
const d = await call('get', '/api/commands?limit=60'); commands.value = d.data || [];
|
|
|
|
|
}
|
|
|
|
|
async function loadPositions() {
|
|
|
|
|
const d = await call('get', '/api/positions'); positions.value = d.positions || [];
|
|
|
|
|
}
|
|
|
|
|
async function loadInstructions() {
|
|
|
|
|
const d = await call('get',
|
|
|
|
|
'/api/instructions?status=PROPOSED,RULE_PASSED,JUDGE_PASSED,DISPATCHED&limit=100');
|
|
|
|
|
instructions.value = d.data || [];
|
|
|
|
|
}
|
|
|
|
|
async function loadLedger() {
|
|
|
|
|
const d = await call('get', '/api/ledger?limit=60'); ledger.value = d.data || [];
|
|
|
|
|
}
|
|
|
|
|
async function loadProposals() {
|
|
|
|
|
const d = await call('get', '/api/proposals'); proposals.value = d.data || [];
|
|
|
|
|
}
|
|
|
|
|
async function loadPlans(cid) {
|
|
|
|
|
plansOf.value = cid;
|
|
|
|
|
const d = await call('get', '/api/plans?command_id=' + cid); plans.value = d.data || [];
|
|
|
|
|
}
|
|
|
|
|
async function loadLots(code) {
|
|
|
|
|
lotsOf.value = code;
|
|
|
|
|
const d = await call('get', '/api/positions/' + code + '/lots?status='); lots.value = d.data || [];
|
|
|
|
|
}
|
2026-07-28 09:10:07 +08:00
|
|
|
async function loadDispatchMode() {
|
|
|
|
|
const d = await call('get', '/api/dispatch-mode'); dm.value = d.data || d || {};
|
|
|
|
|
}
|
2026-07-27 17:12:09 +08:00
|
|
|
async function loadAll() {
|
|
|
|
|
loading.value = true; err.value = '';
|
|
|
|
|
await Promise.all([loadOverview(), loadParams(), loadCatalog(), loadCommands(),
|
2026-07-28 09:10:07 +08:00
|
|
|
loadPositions(), loadInstructions(), loadLedger(), loadProposals(),
|
|
|
|
|
loadDispatchMode()]);
|
2026-07-27 17:12:09 +08:00
|
|
|
loading.value = false;
|
|
|
|
|
}
|
2026-07-28 09:10:07 +08:00
|
|
|
async function cancelIns(iid) {
|
|
|
|
|
try {
|
|
|
|
|
await ElementPlus.ElMessageBox.confirm('撤销指令 ' + iid + '?', '确认',
|
|
|
|
|
{ type: 'warning' });
|
|
|
|
|
} catch (e) { return; }
|
|
|
|
|
const d = await call('post', '/api/instructions/' + iid + '/cancel', {});
|
|
|
|
|
ElementPlus.ElMessage[(d.ok ? 'success' : 'error')](d.message || d.error);
|
|
|
|
|
await Promise.all([loadInstructions(), loadLedger()]);
|
|
|
|
|
}
|
2026-07-27 17:12:09 +08:00
|
|
|
|
|
|
|
|
function onCmdChange() {
|
|
|
|
|
form.params = {};
|
|
|
|
|
const s = curSpec.value; if (!s) return;
|
|
|
|
|
Object.entries(s.fields).forEach(([k, f]) => {
|
|
|
|
|
if (f.default !== undefined) form.params[k] = f.default;
|
|
|
|
|
if (f.type === 'enum' && f.choices && f.choices.length === 1) form.params[k] = f.choices[0];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function buildParams() {
|
|
|
|
|
const s = curSpec.value, out = {};
|
|
|
|
|
Object.entries(s.fields).forEach(([k, f]) => {
|
|
|
|
|
let v = form.params[k];
|
|
|
|
|
if (v === undefined || v === null || v === '') return;
|
|
|
|
|
out[k] = (f.type === 'pct') ? (String(v).trim() + '%') : v;
|
|
|
|
|
});
|
|
|
|
|
return out;
|
|
|
|
|
}
|
|
|
|
|
async function issue(force) {
|
|
|
|
|
const s = curSpec.value;
|
|
|
|
|
if (!s) { ElementPlus.ElMessage.warning('请先选择命令'); return; }
|
|
|
|
|
if (s.danger && !force) {
|
|
|
|
|
try {
|
|
|
|
|
await ElementPlus.ElMessageBox.confirm(
|
|
|
|
|
'【' + s.label + '】是高危命令, 将对全部持仓生效。确认执行?', '二次确认',
|
|
|
|
|
{ type: 'warning', confirmButtonText: '确认执行', cancelButtonText: '取消' });
|
|
|
|
|
} catch (e) { return; }
|
|
|
|
|
}
|
|
|
|
|
issuing.value = true;
|
|
|
|
|
const body = { cmd_type: s.cmd_type, params: buildParams(), note: form.note, force: !!force };
|
|
|
|
|
const d = await call('post', '/api/commands', body);
|
|
|
|
|
issuing.value = false;
|
|
|
|
|
if (d.ok) {
|
|
|
|
|
ElementPlus.ElMessage.success('命令 ' + d.command_id + ' 已下达 · ' + (d.status || ''));
|
|
|
|
|
const notes = ((d.plan || {}).notes || []); if (notes.length)
|
|
|
|
|
ElementPlus.ElMessage.info(notes.join(' | '));
|
|
|
|
|
err.value = '';
|
|
|
|
|
await Promise.all([loadCommands(), loadOverview(), loadPositions(), loadParams()]);
|
|
|
|
|
} else if ((d.conflicts || []).length) {
|
|
|
|
|
const txt = d.conflicts.map(c => c.with_cmd_type + '(' + c.with_command_id + '): ' + c.reason)
|
|
|
|
|
.join('\n');
|
|
|
|
|
try {
|
|
|
|
|
await ElementPlus.ElMessageBox.confirm(
|
|
|
|
|
'与在途命令冲突:\n' + txt + '\n\n命令冲突由用户裁决 —— 仍要并行下达?', '命令冲突',
|
|
|
|
|
{ type: 'warning', confirmButtonText: '仍然下达', cancelButtonText: '放弃' });
|
|
|
|
|
await issue(true);
|
|
|
|
|
} catch (e) { /* 用户放弃 */ }
|
|
|
|
|
} else {
|
|
|
|
|
ElementPlus.ElMessage.error((d.errors || [d.error]).join('; '));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async function cancelCmd(cid) {
|
|
|
|
|
const d = await call('post', '/api/commands/' + cid + '/cancel');
|
|
|
|
|
ElementPlus.ElMessage[(d.ok ? 'success' : 'error')](d.message || d.error);
|
|
|
|
|
await loadCommands();
|
|
|
|
|
}
|
|
|
|
|
async function replan(cid) {
|
|
|
|
|
const d = await call('post', '/api/commands/' + cid + '/replan');
|
|
|
|
|
ElementPlus.ElMessage[(d.ok ? 'success' : 'error')](d.ok ? '已重新生成方案' :
|
|
|
|
|
(d.errors || [d.error]).join('; '));
|
|
|
|
|
await loadCommands(); if (plansOf.value === cid) await loadPlans(cid);
|
|
|
|
|
}
|
|
|
|
|
async function decide(row, decision) {
|
|
|
|
|
const d = await call('post', '/api/proposals/' + row.proposal_id + '/decide', { decision });
|
|
|
|
|
if (d.ok) ElementPlus.ElMessage.success(decision === 'ACCEPTED'
|
|
|
|
|
? ('已采纳, 指令 ' + d.instruction_id) : '已驳回');
|
|
|
|
|
else ElementPlus.ElMessage.error(d.error);
|
|
|
|
|
await Promise.all([loadProposals(), loadInstructions(), loadLedger()]);
|
|
|
|
|
}
|
|
|
|
|
async function ops(name) {
|
|
|
|
|
opsLoading.value = true;
|
|
|
|
|
const d = await call('post', '/api/ops/' + name);
|
|
|
|
|
opsResult.value = JSON.stringify(d, null, 2); opsLoading.value = false;
|
|
|
|
|
await loadAll();
|
|
|
|
|
}
|
|
|
|
|
async function loadSchema() {
|
|
|
|
|
opsLoading.value = true;
|
|
|
|
|
const d = await call('get', '/api/ops/downstream-schema');
|
|
|
|
|
opsResult.value = JSON.stringify(d, null, 2); opsLoading.value = false;
|
|
|
|
|
}
|
|
|
|
|
async function openReport() {
|
|
|
|
|
const d = await call('get', '/api/report'); report.value = d.data || d || {};
|
|
|
|
|
reportDrawer.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(loadAll);
|
|
|
|
|
return { tab, loading, err, health, ov, params, catalog, commands, plans, plansOf,
|
|
|
|
|
positions, lots, lotsOf, instructions, ledger, proposals, report, reportDrawer,
|
2026-07-28 09:10:07 +08:00
|
|
|
opsDrawer, opsResult, opsLoading, issuing, form, curSpec, dirtyCount, dm,
|
|
|
|
|
money, pct, groupLabel, fieldLabel, stTag, cuTag, canCancel, progPct, insPct,
|
2026-07-27 17:12:09 +08:00
|
|
|
loadAll, loadParams, saveParams, loadPlans, loadLots, onCmdChange, issue,
|
2026-07-28 09:10:07 +08:00
|
|
|
cancelCmd, replan, decide, ops, loadSchema, openReport, cancelIns };
|
2026-07-27 17:12:09 +08:00
|
|
|
}
|
|
|
|
|
}).use(ElementPlus).mount('#app');
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|