This commit is contained in:
van
2026-09-30 17:33:13 +08:00
parent 6905a6823d
commit f09bb12d27
+40 -2
View File
@@ -49,12 +49,35 @@
</el-col>
</el-row>
<el-row v-if="current" :gutter="16" class="table-row">
<el-col :xs="24">
<el-card shadow="hover">
<div slot="header">分销类型(自有单 / 代下单 F-W·F-H / 代下单单)</div>
<el-table :data="current.byKind || []" stripe size="small">
<el-table-column prop="name" label="类型" min-width="100" />
<el-table-column prop="validOrderCount" label="有效单" width="80" />
<el-table-column prop="refundCount" label="退款" width="70" />
<el-table-column prop="totalProfit" label="利润" width="110">
<template slot-scope="scope">{{ money(scope.row.totalProfit) }}</template>
</el-table-column>
<el-table-column prop="profitRatePct" label="利润率" width="90">
<template slot-scope="scope">{{ fmtNum(scope.row.profitRatePct) }}%</template>
</el-table-column>
<el-table-column prop="avgProfit" label="单均" width="100">
<template slot-scope="scope">{{ money(scope.row.avgProfit) }}</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<el-row v-if="current" :gutter="16" class="table-row">
<el-col :xs="24" :lg="12">
<el-card shadow="hover">
<div slot="header">分销标记</div>
<el-table :data="current.byMark || []" stripe size="small" max-height="360">
<el-table-column prop="name" label="标记" min-width="110" />
<el-table-column prop="kind" label="类型" width="90" />
<el-table-column prop="orderCount" label="单量" width="70" />
<el-table-column prop="payment" label="付款" width="100">
<template slot-scope="scope">{{ money(scope.row.payment) }}</template>
@@ -143,7 +166,7 @@
</el-dialog>
<el-card v-if="stats" class="json-card" shadow="hover">
<div slot="header">统计 JSON(发给模型的数据)</div>
<div slot="header">提交给模型 {{ llmChars }} 字符(无缩进列数组;框内换行只为方便看,上方卡片仍是完整对象)</div>
<el-input type="textarea" :value="statsJson" :autosize="{ minRows: 8, maxRows: 22 }" readonly />
</el-card>
</div>
@@ -171,7 +194,8 @@ export default {
logsLoading: false,
logDialogVisible: false,
logDialogMeta: '',
logDialogReport: ''
logDialogReport: '',
llmJson: ''
}
},
computed: {
@@ -199,6 +223,13 @@ export default {
return this.stats && this.stats.compare ? this.stats.compare : {}
},
statsJson() {
if (this.llmJson) {
try {
return JSON.stringify(JSON.parse(this.llmJson), null, 2)
} catch (e) {
return this.llmJson
}
}
if (!this.stats) return ''
try {
return JSON.stringify(this.stats, null, 2)
@@ -206,6 +237,11 @@ export default {
return ''
}
},
llmChars() {
if (this.llmJson) return this.llmJson.length
const n = this.stats && this.stats.llmJsonChars
return n || 0
},
summaryItems() {
if (!this.current) return []
return [
@@ -265,9 +301,11 @@ export default {
if (!data) {
this.stats = null
this.report = ''
this.llmJson = ''
return
}
this.stats = data.stats || data
this.llmJson = data.llmJson || (this.stats && this.stats.llmJson) || ''
this.periodLabel = data.periodLabel || (this.stats && this.stats.periodLabel) || ''
this.report = data.report || ''
this.aiError = data.aiError || ''