feat(reports, risk, deployment): 支持开注商经营报表、风险池按开注商操作并调整 PM2 部署目录
Some checks failed
lotteryadmin CI / build (push) Has been cancelled

This commit is contained in:
2026-07-10 10:23:46 +08:00
parent 1164d9d728
commit d6826d5a1c
22 changed files with 147 additions and 33 deletions

View File

@@ -65,6 +65,7 @@ type DraftRiskRow = Omit<RiskCapItemRow, "id"> & { clientKey: string };
function newRow(): DraftRiskRow {
return {
clientKey: `new-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
provider_code: "GLOBAL",
draw_id: null,
normalized_number: "0000",
cap_amount: 0,
@@ -79,6 +80,7 @@ function isDefaultRiskRow(row: DraftRiskRow): boolean {
function defaultRiskRowFromAmount(amount: number): DraftRiskRow {
return {
clientKey: `default-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
provider_code: "GLOBAL",
draw_id: null,
normalized_number: "0000",
cap_amount: amount,
@@ -175,6 +177,7 @@ export function RiskCapDocScreen() {
setDetail(d);
const mapped = d.items.map((it) => ({
clientKey: `srv-${it.id}`,
provider_code: it.provider_code ?? "GLOBAL",
draw_id: it.draw_id,
normalized_number: it.normalized_number,
cap_amount: it.cap_amount,
@@ -285,6 +288,7 @@ export function RiskCapDocScreen() {
setSaving(true);
try {
const payload = rowsToSave.map((r) => ({
provider_code: r.provider_code ?? "GLOBAL",
draw_id: r.draw_id && r.draw_id > 0 ? r.draw_id : null,
normalized_number: r.normalized_number,
cap_amount: r.cap_amount,
@@ -294,6 +298,7 @@ export function RiskCapDocScreen() {
setDetail(d);
const saved = d.items.map((it) => ({
clientKey: `srv-${it.id}`,
provider_code: it.provider_code ?? "GLOBAL",
draw_id: it.draw_id,
normalized_number: it.normalized_number,
cap_amount: it.cap_amount,
@@ -320,6 +325,7 @@ export function RiskCapDocScreen() {
setDetail(d);
const pub = d.items.map((it) => ({
clientKey: `srv-${it.id}`,
provider_code: it.provider_code ?? "GLOBAL",
draw_id: it.draw_id,
normalized_number: it.normalized_number,
cap_amount: it.cap_amount,
@@ -351,6 +357,7 @@ export function RiskCapDocScreen() {
setDetail(d);
const nd = d.items.map((it) => ({
clientKey: `srv-${it.id}`,
provider_code: it.provider_code ?? "GLOBAL",
draw_id: it.draw_id,
normalized_number: it.normalized_number,
cap_amount: it.cap_amount,
@@ -424,6 +431,7 @@ export function RiskCapDocScreen() {
setDetail(d);
const mapped = d.items.map((it) => ({
clientKey: `srv-${it.id}`,
provider_code: it.provider_code ?? "GLOBAL",
draw_id: it.draw_id,
normalized_number: it.normalized_number,
cap_amount: it.cap_amount,
@@ -691,4 +699,4 @@ export function RiskCapDocScreen() {
<ConfirmDialog />
</ConfigDocPage>
);
}
}