@chenchaolong/plugin-trade-compliance-workbench 1.0.42 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/remote-components/trade-compliance-workbench/app.css +1 -1
- package/dist/lib/remote-components/trade-compliance-workbench/app.js +5 -5
- package/dist/lib/remote-ui/pages/analytics.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/analytics.js +23 -154
- package/dist/lib/remote-ui/pages/analytics.js.map +1 -1
- package/dist/lib/remote-ui/styles.css +42 -27
- package/dist/lib/workbench.service.js +61 -24
- package/dist/lib/workbench.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../src/lib/remote-ui/pages/analytics.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../src/lib/remote-ui/pages/analytics.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiC,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAsB,sBAAsB,EAAmC,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAErM,OAAO,2BAA2B,CAAA;AAElC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,aAAa,CAAA;IACnB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACxD,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAA;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,GAAG,cAAc,CAI1G;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,kBAAkB,2CAgE7G;AA6WD,wBAAgB,uBAAuB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,2CAiB3E;AA8ID,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,GAAG,kBAAkB,EAAE,CAYtG"}
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Decimal } from 'decimal.js';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { DataGrid,
|
|
4
|
+
import { DataGrid, RiskNotice } from '../components/data-grid.js';
|
|
5
5
|
import './analytics-prototype.css';
|
|
6
6
|
export function analyticsPageSizeQuery(query, pageSize) {
|
|
7
7
|
return query.mode === 'PURCHASE'
|
|
8
8
|
? { ...query, page: 1, pageSize }
|
|
9
9
|
: { ...query, page: 1, pageSize };
|
|
10
10
|
}
|
|
11
|
-
const purchaseFilters = [
|
|
12
|
-
{ type: 'date-range', key: 'orderDate', label: '下单日期' },
|
|
13
|
-
{ type: 'text', key: 'supplier', label: '供应商' },
|
|
14
|
-
{ type: 'text', key: 'productName', label: '商品名称' },
|
|
15
|
-
{ type: 'text', key: 'hsCode', label: '海关编码' }
|
|
16
|
-
];
|
|
17
|
-
const salesFilters = [
|
|
18
|
-
{ type: 'date-range', key: 'orderDate', label: '下单日期' },
|
|
19
|
-
{ type: 'text', key: 'customer', label: '客户' },
|
|
20
|
-
{ type: 'text', key: 'productName', label: '商品名称' },
|
|
21
|
-
{ type: 'text', key: 'hsCode', label: '海关编码' }
|
|
22
|
-
];
|
|
23
11
|
export function AnalyticsPage({ data, committedQuery, busy, error, onQuery, onExportXlsx }) {
|
|
24
12
|
const fallbackQuery = React.useMemo(() => queryFromData(data), [data.mode, data.dimension, data.details.page, data.details.pageSize]);
|
|
25
13
|
const committed = committedQuery ?? fallbackQuery;
|
|
@@ -28,23 +16,18 @@ export function AnalyticsPage({ data, committedQuery, busy, error, onQuery, onEx
|
|
|
28
16
|
const [filters, setFilters] = React.useState(() => filterStateFromQuery(committed));
|
|
29
17
|
const [activeDialog, setActiveDialog] = React.useState(null);
|
|
30
18
|
const [drilldown, setDrilldown] = React.useState(null);
|
|
19
|
+
const [infoModal, setInfoModal] = React.useState(null);
|
|
31
20
|
const [detailsOpen, setDetailsOpen] = React.useState(false);
|
|
32
21
|
React.useEffect(() => {
|
|
33
22
|
setMode(committed.mode);
|
|
34
23
|
setDimension(committed.dimension);
|
|
35
24
|
setFilters(filterStateFromQuery(committed));
|
|
36
25
|
}, [committed]);
|
|
37
|
-
const dimensions = mode === 'PURCHASE' ? [['SUPPLIER', '供应商'], ['PRODUCT', '商品名称']] : [['CUSTOMER', '客户'], ['PRODUCT', '商品名称']];
|
|
38
26
|
const typedFilters = toAnalyticsFilters(filters);
|
|
39
27
|
const queryFor = (nextMode, nextDimension, page, nextFilters) => nextMode === 'PURCHASE'
|
|
40
28
|
? { mode: nextMode, dimension: nextDimension === 'SUPPLIER' ? 'SUPPLIER' : 'PRODUCT', filters: purchaseAnalyticsFilters(nextFilters), page, pageSize: data.details.pageSize || 20 }
|
|
41
29
|
: { mode: nextMode, dimension: nextDimension === 'CUSTOMER' ? 'CUSTOMER' : 'PRODUCT', filters: salesAnalyticsFilters(nextFilters), page, pageSize: data.details.pageSize || 20 };
|
|
42
30
|
const runQuery = (page = 1, nextMode = mode, nextDimension = dimension) => onQuery(queryFor(nextMode, nextDimension, page, typedFilters));
|
|
43
|
-
const switchMode = (nextMode) => {
|
|
44
|
-
const nextDimension = nextMode === 'PURCHASE' ? 'SUPPLIER' : 'CUSTOMER';
|
|
45
|
-
void onQuery(queryFor(nextMode, nextDimension, 1, {}));
|
|
46
|
-
};
|
|
47
|
-
const switchDimension = (nextDimension) => { void runQuery(1, mode, nextDimension); };
|
|
48
31
|
const exportCurrent = (scope) => {
|
|
49
32
|
if (!onExportXlsx)
|
|
50
33
|
return;
|
|
@@ -52,7 +35,7 @@ export function AnalyticsPage({ data, committedQuery, busy, error, onQuery, onEx
|
|
|
52
35
|
void onExportXlsx(request.mode === 'PURCHASE' ? { mode: request.mode, dimension: request.dimension, filters: request.filters, format: 'XLSX' } : { mode: request.mode, dimension: request.dimension, filters: request.filters, format: 'XLSX' });
|
|
53
36
|
setActiveDialog(null);
|
|
54
37
|
};
|
|
55
|
-
return _jsxs("section", { className: "tcw-analytics-page", "aria-label": "\u6570\u636E\u5206\u6790", children: [_jsxs("div", { className: "tcw-analytics-cockpit-hero", children: [_jsxs("div", { children: [_jsx("h1", { children: "\u5916\u8D38\u5408\u89C4\u7ECF\u8425\u9A7E\u9A76\u8231" }), _jsx("p", { children: "\u7ECF\u8425\u8D44\u91D1\u3001\u5408\u540C\u5BA1\u6838\u3001\u5546\u54C1\u7BA1\u63A7\u3001\u5236\u88C1\u547D\u4E2D\u3001\u5229\u6DA6\u5F02\u5E38\u7EDF\u4E00\u76D1\u63A7" })] }), _jsxs("div", { className: "tcw-analytics-page-actions", children: [onExportXlsx && _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", "aria-label": "\u5BFC\u51FA\u6570\u636E", onClick: () => setActiveDialog('export'), children: [_jsx("i", { className: "ri-download-2-line", "aria-hidden": "true" }), "\u5BFC\u51FA\u62A5\u8868"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => void runQuery(), children: [_jsx("i", { className: "ri-refresh-line", "aria-hidden": "true" }), "\u5237\u65B0"] })] })] }),
|
|
38
|
+
return _jsxs("section", { className: "tcw-analytics-page", "aria-label": "\u6570\u636E\u5206\u6790", children: [_jsxs("div", { className: "tcw-analytics-cockpit-hero", children: [_jsxs("div", { children: [_jsxs("nav", { className: "tcw-analytics-cockpit-crumbs", "aria-label": "\u6570\u636E\u5206\u6790\u9762\u5305\u5C51", children: [_jsx("span", { children: "\u9996\u9875" }), _jsx("i", { className: "ri-arrow-right-s-line", "aria-hidden": "true" }), _jsx("strong", { children: "\u6570\u636E\u5206\u6790" })] }), _jsx("h1", { children: "\u5916\u8D38\u5408\u89C4\u7ECF\u8425\u9A7E\u9A76\u8231" }), _jsx("p", { children: "\u7ECF\u8425\u8D44\u91D1\u3001\u5408\u540C\u5BA1\u6838\u3001\u5546\u54C1\u7BA1\u63A7\u3001\u5236\u88C1\u547D\u4E2D\u3001\u5229\u6DA6\u5F02\u5E38\u7EDF\u4E00\u76D1\u63A7" })] }), _jsxs("div", { className: "tcw-analytics-page-actions", children: [onExportXlsx && _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", "aria-label": "\u5BFC\u51FA\u6570\u636E", onClick: () => setActiveDialog('export'), children: [_jsx("i", { className: "ri-download-2-line", "aria-hidden": "true" }), "\u5BFC\u51FA\u62A5\u8868"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => void runQuery(), children: [_jsx("i", { className: "ri-refresh-line", "aria-hidden": "true" }), "\u5237\u65B0"] })] })] }), _jsx("div", { className: "tcw-analytics-query", children: _jsxs("div", { className: "tcw-analytics-toolbar", children: [_jsxs("span", { className: "tcw-analytics-chip tcw-analytics-chip--org", children: [_jsx("i", { className: "ri-building-2-line", "aria-hidden": "true" }), "\u5F53\u524D\u7EC4\u7EC7\uFF1A\u534E\u5357\u5916\u8D38\u4E8B\u4E1A\u90E8"] }), _jsx("span", { className: "tcw-analytics-label", children: "\u7EDF\u8BA1\u5468\u671F\uFF1A" }), _jsxs("button", { type: "button", className: "tcw-analytics-chip", onClick: () => setFilters(current => ({ ...current, orderDate: quickRange(3) })), children: [_jsx("i", { className: "ri-calendar-event-line", "aria-hidden": "true" }), data.currentYear, " \u5E74\u5EA6"] }), _jsxs("div", { className: "tcw-segmented-control tcw-analytics-period", role: "group", "aria-label": "\u7EDF\u8BA1\u65F6\u95F4", children: [_jsxs("button", { type: "button", "aria-pressed": false, onClick: () => setFilters(current => ({ ...current, orderDate: quickRange(3) })), children: [_jsx("i", { className: "ri-calendar-check-line", "aria-hidden": "true" }), "\u672C\u6708"] }), _jsxs("button", { type: "button", "aria-pressed": false, onClick: () => setActiveDialog('filter'), children: [_jsx("i", { className: "ri-calendar-2-line", "aria-hidden": "true" }), "\u81EA\u5B9A\u4E49\u533A\u95F4"] })] }), _jsx("span", { className: "tcw-analytics-label", children: "\u5E01\u79CD\uFF1A" }), _jsxs("button", { type: "button", className: "tcw-analytics-chip", children: [_jsx("i", { className: "ri-money-cny-circle-line", "aria-hidden": "true" }), "CNY"] }), _jsxs("span", { className: "tcw-analytics-chip tcw-analytics-chip--refresh", children: [_jsx("i", { className: "ri-time-line", "aria-hidden": "true" }), "\u6700\u8FD1\u5237\u65B0\uFF1A", data.currentYear, "-08-05 10:32"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", "aria-label": "\u7B5B\u9009\u6761\u4EF6\u5165\u53E3", onClick: () => setActiveDialog('filter'), children: [_jsx("i", { className: "ri-filter-3-line", "aria-hidden": "true" }), "\u7B5B\u9009\u6761\u4EF6"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => setDetailsOpen(true), children: [_jsx("i", { className: "ri-table-line", "aria-hidden": "true" }), "\u5B8C\u6574\u660E\u7EC6"] })] }) }), _jsx(AnalyticsCockpit, { data: data, onDrilldown: setDrilldown, onInfo: setInfoModal }), error && _jsx(RiskNotice, { children: error }), busy && _jsxs("div", { className: "tcw-inline-loading", role: "status", children: [_jsx("span", { className: "tcw-spinner", "aria-hidden": "true" }), "\u6570\u636E\u52A0\u8F7D\u4E2D"] }), drilldown && _jsx(AnalyticsDrilldownPanel, { data: data, drilldown: drilldown, onClose: () => setDrilldown(null) }), detailsOpen && _jsx(AnalyticsDetailsModal, { mode: mode, dimension: dimension, data: data, onClose: () => setDetailsOpen(false), onPageChange: page => void runQuery(page), onPageSizeChange: pageSize => void onQuery(analyticsPageSizeQuery(queryFor(mode, dimension, 1, typedFilters), pageSize)) }), infoModal && _jsx(AnalyticsInfoModal, { info: infoModal, onClose: () => setInfoModal(null) }), _jsx(AdvancedFilterModal, { active: activeDialog === 'filter', filters: filters, onFilterChange: (key, value) => setFilters(current => ({ ...current, [key]: value })), onApply: () => { void runQuery(); setActiveDialog(null); }, onReset: () => { setFilters({}); void onQuery(queryFor(mode, dimension, 1, {})); setActiveDialog(null); }, onClose: () => setActiveDialog(null) }), onExportXlsx && _jsx(BusinessExportModal, { active: activeDialog === 'export', total: data.details.total, onClose: () => setActiveDialog(null), onExport: exportCurrent })] });
|
|
56
39
|
}
|
|
57
40
|
const analyticsExportFields = [
|
|
58
41
|
{ key: 'label', label: '客户/供应商名称' },
|
|
@@ -62,13 +45,13 @@ const analyticsExportFields = [
|
|
|
62
45
|
{ key: 'status', label: '审核状态' },
|
|
63
46
|
{ key: 'createdAt', label: '创建时间' }
|
|
64
47
|
];
|
|
65
|
-
function AnalyticsCockpit({ data, onDrilldown }) {
|
|
48
|
+
function AnalyticsCockpit({ data, onDrilldown, onInfo }) {
|
|
66
49
|
const dashboard = data.dashboard;
|
|
67
|
-
const customerValueRows =
|
|
68
|
-
const receivableRiskRows =
|
|
69
|
-
const supplierRiskRows =
|
|
70
|
-
const salesFileRows =
|
|
71
|
-
const riskOrderRows =
|
|
50
|
+
const customerValueRows = dashboard.customerValueTop5.map(item => ({ key: item.customerId, name: item.customerName, salesAmountCny: item.salesAmountCny, grossProfitRate: item.estimatedGrossProfitRate, unreceivedCny: item.unreceivedCny, riskStatus: item.riskStatus }));
|
|
51
|
+
const receivableRiskRows = dashboard.receivableRiskTop5.map(item => ({ key: item.customerId, name: item.customerName, unreceivedCny: item.unreceivedCny, orderCount: item.orderCount, latestOrderDate: item.latestOrderDate }));
|
|
52
|
+
const supplierRiskRows = dashboard.supplierRiskTop5.map(item => ({ key: item.supplierId, name: item.supplierName, unpaidCny: item.unpaidCny, sanctionHitCount: item.sanctionHitCount, productRiskHitCount: item.productRiskHitCount, purchaseOrderCount: item.purchaseOrderCount }));
|
|
53
|
+
const salesFileRows = dashboard.salesFileReviews.map(item => ({ key: item.fileId, fileName: item.fileName, fileType: item.fileType, orderNo: item.salesOrderNo, reason: item.reason, status: '待复核' }));
|
|
54
|
+
const riskOrderRows = dashboard.riskOrders.map(item => ({ key: item.orderKey, orderNo: item.orderNo, partyName: item.partyName, riskType: item.riskType, riskAmountCny: item.riskAmountCny, status: item.status }));
|
|
72
55
|
const monthlyDeltas = monthlyDeltaLabels(dashboard.monthlyTrend);
|
|
73
56
|
const kpis = [
|
|
74
57
|
{ label: '采购总额', value: compactMoney(dashboard.kpis.purchaseTotalCny), subtext: monthlyDeltas.purchase, fullValue: `${money(dashboard.kpis.purchaseTotalCny)} CNY`, icon: 'ri-shopping-cart-line', tone: 'money' },
|
|
@@ -82,13 +65,13 @@ function AnalyticsCockpit({ data, onDrilldown }) {
|
|
|
82
65
|
{ label: '合规待办数', value: `${dashboard.kpis.complianceTodoCount} 项`, subtext: `队列 ${dashboard.todos.length} 类`, icon: 'ri-shield-check-line', tone: 'warn' },
|
|
83
66
|
{ label: '风险敞口金额', value: compactMoney(dashboard.kpis.riskExposureCny), subtext: `资金风险占比 ${amountRatio(dashboard.kpis.riskExposureCny, addMoney(dashboard.kpis.salesTotalCny, dashboard.kpis.purchaseTotalCny))}`, fullValue: `${money(dashboard.kpis.riskExposureCny)} CNY`, icon: 'ri-shield-flash-line', tone: 'risk' }
|
|
84
67
|
];
|
|
85
|
-
return _jsxs("section", { className: "tcw-analytics-cockpit", "aria-label": "\u5916\u8D38\u5408\u89C4\u7ECF\u8425\u9A7E\u9A76\u8231", children: [_jsx("div", { className: "tcw-analytics-kpi-grid", children: kpis.map(item => _jsxs("button", { type: "button", className: `is-${item.tone}`, title: 'fullValue' in item ? item.fullValue : item.value, onClick: () => onDrilldown({ title: `${item.label}下钻明细`, tone: item.tone === 'success' || item.tone === 'warn' ? 'money' : item.tone }), children: [_jsx("span", { children: item.label }), _jsx("i", { className: item.icon, "aria-hidden": "true" }), _jsx("strong", { children: item.value }), _jsx("small", { children: item.subtext.startsWith('较上月') ? _jsxs(_Fragment, { children: [_jsx("em", { children: "\u8F83\u4E0A\u6708" }), _jsx("b", { children: item.subtext.replace('较上月 ', '') })] }) : item.subtext })] }, item.label)) }), _jsxs("div", { className: "tcw-analytics-cockpit-layout", children: [_jsx(Panel, { title: "\u5408\u89C4\u5F85\u529E\u961F\u5217", icon: "ri-list-check-3", className: "tcw-analytics-panel--queue", action: _jsx(PanelLink, {
|
|
68
|
+
return _jsxs("section", { className: "tcw-analytics-cockpit", "aria-label": "\u5916\u8D38\u5408\u89C4\u7ECF\u8425\u9A7E\u9A76\u8231", children: [_jsx("div", { className: "tcw-analytics-kpi-grid", children: kpis.map(item => _jsxs("button", { type: "button", className: `is-${item.tone}`, title: 'fullValue' in item ? item.fullValue : item.value, onClick: () => onDrilldown({ title: `${item.label}下钻明细`, tone: item.tone === 'success' || item.tone === 'warn' ? 'money' : item.tone }), children: [_jsx("span", { children: item.label }), _jsx("i", { className: item.icon, "aria-hidden": "true" }), _jsx("strong", { children: item.value }), _jsx("small", { children: item.subtext.startsWith('较上月') ? _jsxs(_Fragment, { children: [_jsx("em", { children: "\u8F83\u4E0A\u6708" }), _jsx("b", { children: item.subtext.replace('较上月 ', '') })] }) : item.subtext })] }, item.label)) }), _jsxs("div", { className: "tcw-analytics-cockpit-layout", children: [_jsx(Panel, { title: "\u5408\u89C4\u5F85\u529E\u961F\u5217", icon: "ri-list-check-3", className: "tcw-analytics-panel--queue", action: _jsx(PanelLink, { label: "\u67E5\u770B\u5168\u90E8", onClick: () => onInfo({ title: '合规待办明细', rows: dashboard.todos.map(todo => [todo.label, `${todo.count} 项 · ${todo.description}`]) }) }), children: _jsx(TodoQueue, { rows: dashboard.todos }) }), _jsxs(Panel, { title: "\u6708\u5EA6\u7ECF\u8425\u8D8B\u52BF", icon: "ri-bar-chart-box-line", className: "tcw-analytics-panel--trend", children: [_jsx(TrendLineChart, { points: dashboard.monthlyTrend }), _jsxs("div", { className: "tcw-analytics-chart-legend", children: [_jsx("b", { children: "\u91D1\u989D\uFF08\u4E07\u5143\uFF09" }), _jsxs("span", { children: [_jsx("i", { className: "is-sales" }), "\u9500\u552E\u989D"] }), _jsxs("span", { children: [_jsx("i", { className: "is-purchase" }), "\u91C7\u8D2D\u989D"] }), _jsxs("span", { children: [_jsx("i", { className: "is-profit" }), "\u9884\u8BA1\u6BDB\u5229"] }), _jsxs("span", { children: [_jsx("i", { className: "is-received" }), "\u56DE\u6B3E\u91D1\u989D"] })] }), _jsxs("div", { className: "tcw-analytics-trend-summary", children: [_jsxs("span", { children: ["\u9500\u552E ", compactMoney(dashboard.kpis.salesTotalCny)] }), _jsxs("span", { children: ["\u91C7\u8D2D ", compactMoney(dashboard.kpis.purchaseTotalCny)] }), _jsxs("span", { children: ["\u6BDB\u5229\u7387 ", percent(dashboard.kpis.estimatedGrossProfitRate)] })] })] }), _jsx(Panel, { title: "\u8D44\u91D1\u98CE\u9669\u7ED3\u6784", icon: "ri-stack-line", className: "tcw-analytics-panel--capital", children: _jsx(MoneyStructure, { kpis: dashboard.kpis }) }), _jsx(Panel, { title: "\u5408\u89C4\u98CE\u9669\u5206\u5E03", icon: "ri-donut-chart-line", className: "tcw-analytics-panel--risk", children: _jsx(RiskDistribution, { items: dashboard.riskDistribution, onOpen: item => onInfo({ title: `${item.label}明细`, rows: [[item.label, `${item.count} 项${item.amountCny ? ` · ${money(item.amountCny)} CNY` : ''}`]] }) }) }), _jsx(Panel, { title: "\u5BA2\u6237\u4EF7\u503C TOP5", icon: "ri-vip-crown-line", children: _jsx(CustomerValue, { rows: customerValueRows }) }), _jsx(Panel, { title: "\u672A\u6536\u98CE\u9669 TOP5", icon: "ri-bank-line", children: _jsx(ReceivableRisk, { rows: receivableRiskRows }) }), _jsx(Panel, { title: "\u4F9B\u5E94\u5546\u98CE\u9669 TOP5", icon: "ri-truck-line", children: _jsx(SupplierRisk, { rows: supplierRiskRows }) }), _jsx(Panel, { title: "\u9500\u552E\u6587\u4EF6\u590D\u6838", icon: "ri-file-search-line", action: _jsx(PanelLink, { label: "\u67E5\u770B\u5168\u90E8", onClick: () => onInfo({ title: '销售文件复核明细', rows: salesFileRows.map(row => [row.fileName, `${row.fileType} · ${row.orderNo} · ${row.status}`]) }) }), children: _jsx(SalesFileReviews, { rows: salesFileRows }) }), _jsx(Panel, { title: "\u98CE\u9669\u8BA2\u5355\u660E\u7EC6", icon: "ri-file-warning-line", className: "tcw-analytics-panel--wide", action: _jsx(PanelLink, { label: "\u67E5\u770B\u5168\u90E8", onClick: () => onInfo({ title: '风险订单明细', rows: riskOrderRows.map(row => [row.orderNo, `${row.partyName} · ${row.riskType} · ${money(row.riskAmountCny)} CNY`]) }) }), children: _jsx(RiskOrders, { rows: riskOrderRows }) }), _jsx(Panel, { title: "\u6307\u6807\u6570\u636E\u6765\u6E90", icon: "ri-database-2-line", action: _jsx(PanelLink, { label: "\u67E5\u770B\u8BE6\u60C5", onClick: () => onInfo({ title: '指标数据来源', rows: dashboard.dataSources.map(source => [source.label, source.description]) }) }), children: _jsx("div", { className: "tcw-analytics-source-list", children: dashboard.dataSources.map(source => _jsxs("button", { type: "button", onClick: () => onInfo({ title: source.label, rows: [[source.label, source.description]] }), children: [_jsx("i", { className: "ri-links-line", "aria-hidden": "true" }), _jsx("strong", { children: source.label }), _jsx("span", { children: source.description })] }, source.label)) }) })] })] });
|
|
86
69
|
}
|
|
87
70
|
function Panel({ title, icon, className = '', action, children }) {
|
|
88
71
|
return _jsxs("section", { className: `tcw-analytics-panel ${className}`.trim(), children: [_jsxs("header", { children: [_jsxs("strong", { children: [_jsx("i", { className: icon, "aria-hidden": "true" }), title] }), action] }), children] });
|
|
89
72
|
}
|
|
90
|
-
function PanelLink({
|
|
91
|
-
return _jsxs("
|
|
73
|
+
function PanelLink({ label, onClick }) {
|
|
74
|
+
return _jsxs("button", { type: "button", className: "tcw-analytics-panel-link", onClick: onClick, children: [label, _jsx("i", { className: "ri-arrow-right-s-line", "aria-hidden": "true" })] });
|
|
92
75
|
}
|
|
93
76
|
function MoneyStructure({ kpis }) {
|
|
94
77
|
const items = [
|
|
@@ -100,7 +83,7 @@ function MoneyStructure({ kpis }) {
|
|
|
100
83
|
const total = Math.max(...items.map(item => Number(item.value) || 0), 1);
|
|
101
84
|
return _jsx("div", { className: "tcw-analytics-money-structure", children: items.map(item => _jsxs("div", { children: [_jsxs("span", { children: [_jsx("i", { style: { background: item.color } }), item.label] }), _jsxs("b", { children: [money(item.value), " CNY"] }), _jsx("em", { children: _jsx("i", { style: { width: `${Math.max(6, (Number(item.value) || 0) / total * 100)}%`, background: item.color } }) })] }, item.label)) });
|
|
102
85
|
}
|
|
103
|
-
function RiskDistribution({ items }) {
|
|
86
|
+
function RiskDistribution({ items, onOpen }) {
|
|
104
87
|
const total = items.reduce((sum, item) => sum + item.count, 0);
|
|
105
88
|
const colors = ['#1769ff', '#26b6c8', '#ff9f1c', '#8b5cf6', '#5ac85a', '#ff4d55'];
|
|
106
89
|
const segments = items.length ? items.map((item, index) => ({ item, color: colors[index % colors.length] })) : [{ item: { key: 'empty', label: '暂无风险', count: 1, amountCny: '0' }, color: '#e7edf5' }];
|
|
@@ -111,13 +94,13 @@ function RiskDistribution({ items }) {
|
|
|
111
94
|
return `${color} ${start.toFixed(2)}% ${cursor.toFixed(2)}%`;
|
|
112
95
|
}).join(', ');
|
|
113
96
|
const style = { '--risk-donut': `conic-gradient(${conic})` };
|
|
114
|
-
return _jsxs("div", { className: "tcw-analytics-risk-distribution", children: [_jsxs("div", { className: "tcw-analytics-donut", style: style, children: [_jsx("strong", { children: "\u5408\u8BA1" }), _jsx("span", { children: total })] }), _jsx("dl", { children: items.map((item, index) => _jsxs("
|
|
97
|
+
return _jsxs("div", { className: "tcw-analytics-risk-distribution", children: [_jsxs("div", { className: "tcw-analytics-donut", style: style, children: [_jsx("strong", { children: "\u5408\u8BA1" }), _jsx("span", { children: total })] }), _jsx("dl", { children: items.map((item, index) => _jsxs("button", { type: "button", onClick: () => onOpen(item), children: [_jsxs("dt", { children: [_jsx("i", { className: "ri-checkbox-blank-circle-fill", style: { color: colors[index % colors.length] }, "aria-hidden": "true" }), item.label] }), _jsxs("dd", { children: [item.count, " (", percentRatio(item.count, total), ")"] })] }, item.key)) })] });
|
|
115
98
|
}
|
|
116
99
|
function CustomerValue({ rows }) {
|
|
117
100
|
return rows.length ? _jsxs("table", { className: "tcw-analytics-dashboard-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "\u5BA2\u6237/\u4F9B\u5E94\u5546" }), _jsx("th", { children: "\u9500\u552E\u989D\uFF08\u4EBA\u6C11\u5E01\uFF09" }), _jsx("th", { children: "\u6BDB\u5229\u7387" }), _jsx("th", { children: "\u98CE\u9669" })] }) }), _jsx("tbody", { children: rows.map(row => _jsxs("tr", { children: [_jsx("td", { title: row.name, children: row.name }), _jsx("td", { children: money(row.salesAmountCny) }), _jsx("td", { children: percent(row.grossProfitRate) }), _jsx("td", { children: _jsx(RiskBadge, { status: row.riskStatus }) })] }, row.key)) })] }) : _jsx(EmptyText, { text: "\u6682\u65E0\u5BA2\u6237\u4EF7\u503C\u6392\u540D" });
|
|
118
101
|
}
|
|
119
102
|
function ReceivableRisk({ rows }) {
|
|
120
|
-
return rows.length ? _jsxs("table", { className: "tcw-analytics-dashboard-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "\u5BA2\u6237
|
|
103
|
+
return rows.length ? _jsxs("table", { className: "tcw-analytics-dashboard-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "\u5BA2\u6237" }), _jsx("th", { children: "\u672A\u6536\u6B3E\u91D1\u989D\uFF08\u4EBA\u6C11\u5E01\uFF09" }), _jsx("th", { children: "\u8BA2\u5355\u6570" }), _jsx("th", { children: "\u6700\u8FD1\u8BA2\u5355" })] }) }), _jsx("tbody", { children: rows.map(row => _jsxs("tr", { children: [_jsx("td", { title: row.name, children: row.name }), _jsx("td", { children: money(row.unreceivedCny) }), _jsx("td", { children: row.orderCount }), _jsx("td", { children: shortDate(row.latestOrderDate) })] }, row.key)) })] }) : _jsx(EmptyText, { text: "\u6682\u65E0\u672A\u6536\u98CE\u9669" });
|
|
121
104
|
}
|
|
122
105
|
function SupplierRisk({ rows }) {
|
|
123
106
|
return rows.length ? _jsxs("table", { className: "tcw-analytics-dashboard-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "\u4F9B\u5E94\u5546" }), _jsx("th", { children: "\u672A\u4ED8\u6B3E\u91D1\u989D\uFF08\u4EBA\u6C11\u5E01\uFF09" }), _jsx("th", { children: "\u5546\u54C1\u547D\u4E2D" }), _jsx("th", { children: "\u5236\u88C1\u547D\u4E2D" })] }) }), _jsx("tbody", { children: rows.map(row => _jsxs("tr", { children: [_jsx("td", { title: row.name, children: row.name }), _jsx("td", { children: money(row.unpaidCny) }), _jsx("td", { children: row.productRiskHitCount }), _jsx("td", { children: row.sanctionHitCount })] }, row.key)) })] }) : _jsx(EmptyText, { text: "\u6682\u65E0\u4F9B\u5E94\u5546\u98CE\u9669" });
|
|
@@ -128,6 +111,9 @@ function SalesFileReviews({ rows }) {
|
|
|
128
111
|
function RiskOrders({ rows }) {
|
|
129
112
|
return rows.length ? _jsxs("table", { className: "tcw-analytics-dashboard-table tcw-analytics-risk-orders", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "\u8BA2\u5355\u53F7" }), _jsx("th", { children: "\u5BA2\u6237/\u4F9B\u5E94\u5546" }), _jsx("th", { children: "\u98CE\u9669\u7C7B\u578B" }), _jsx("th", { children: "\u8BA2\u5355\u91D1\u989D\uFF08\u4EBA\u6C11\u5E01\uFF09" }), _jsx("th", { children: "\u72B6\u6001" })] }) }), _jsx("tbody", { children: rows.map(row => _jsxs("tr", { children: [_jsx("td", { children: row.orderNo }), _jsx("td", { title: row.partyName, children: row.partyName }), _jsx("td", { children: _jsx("em", { children: row.riskType }) }), _jsx("td", { children: money(row.riskAmountCny) }), _jsx("td", { children: _jsx("span", { children: row.status }) })] }, row.key)) })] }) : _jsx(EmptyText, { text: "\u6682\u65E0\u98CE\u9669\u8BA2\u5355" });
|
|
130
113
|
}
|
|
114
|
+
function TodoQueue({ rows }) {
|
|
115
|
+
return rows.length ? _jsxs("table", { className: "tcw-analytics-todo-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "\u5F85\u529E\u4E8B\u9879" }), _jsx("th", { children: "\u6570\u91CF" }), _jsx("th", { children: "\u4F18\u5148\u7EA7" })] }) }), _jsx("tbody", { children: rows.map(row => _jsxs("tr", { children: [_jsx("td", { title: row.description, children: row.label }), _jsx("td", { children: row.count }), _jsx("td", { children: _jsx(RiskBadge, { status: row.priority === 'high' ? 'HIGH' : row.priority === 'medium' ? 'MEDIUM' : 'LOW' }) })] }, row.key)) })] }) : _jsx(EmptyText, { text: "\u6682\u65E0\u5408\u89C4\u5F85\u529E" });
|
|
116
|
+
}
|
|
131
117
|
function RiskBadge({ status }) {
|
|
132
118
|
const label = status === 'HIGH' ? '高' : status === 'MEDIUM' ? '中' : status === 'LOW' ? '低' : status;
|
|
133
119
|
return _jsx("span", { className: `tcw-analytics-risk-badge is-${status.toLocaleLowerCase()}`, children: label });
|
|
@@ -161,131 +147,14 @@ function monthlyDeltaLabels(points) {
|
|
|
161
147
|
profit: `较上月 ${deltaLabel(latest?.estimatedGrossProfitCny, previous?.estimatedGrossProfitCny)}`
|
|
162
148
|
};
|
|
163
149
|
}
|
|
164
|
-
function customerValueRowsFromData(data) {
|
|
165
|
-
if (data.dashboard.customerValueTop5.length)
|
|
166
|
-
return data.dashboard.customerValueTop5.map(item => ({
|
|
167
|
-
key: item.customerId,
|
|
168
|
-
name: item.customerName,
|
|
169
|
-
salesAmountCny: item.salesAmountCny,
|
|
170
|
-
grossProfitRate: item.estimatedGrossProfitRate,
|
|
171
|
-
unreceivedCny: item.unreceivedCny,
|
|
172
|
-
riskStatus: item.riskStatus
|
|
173
|
-
}));
|
|
174
|
-
const source = data.top5.length ? data.top5.map(item => {
|
|
175
|
-
const detail = findDetail(data, item.key, item.label);
|
|
176
|
-
return detail ?? { key: item.key, label: item.label, orderCount: 0, amountCny: item.amountCny };
|
|
177
|
-
}) : data.details.items;
|
|
178
|
-
return source.slice(0, 5).map(row => ({
|
|
179
|
-
key: row.key,
|
|
180
|
-
name: row.label,
|
|
181
|
-
salesAmountCny: row.amountCny,
|
|
182
|
-
grossProfitRate: amountRatio(estimatedGrossProfit(row), row.amountCny, false),
|
|
183
|
-
unreceivedCny: row.unreceivedCny ?? row.unpaidCny ?? '0',
|
|
184
|
-
riskStatus: riskStatusForAmount(row.unreceivedCny ?? row.unpaidCny ?? row.unrefundedCny)
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
function receivableRiskRowsFromData(data) {
|
|
188
|
-
if (data.dashboard.receivableRiskTop5.length)
|
|
189
|
-
return data.dashboard.receivableRiskTop5.map(item => ({
|
|
190
|
-
key: item.customerId,
|
|
191
|
-
name: item.customerName,
|
|
192
|
-
unreceivedCny: item.unreceivedCny,
|
|
193
|
-
orderCount: item.orderCount,
|
|
194
|
-
latestOrderDate: item.latestOrderDate
|
|
195
|
-
}));
|
|
196
|
-
return data.details.items
|
|
197
|
-
.map(row => ({ key: row.key, name: row.label, unreceivedCny: row.unreceivedCny ?? row.unpaidCny ?? '0', orderCount: row.orderCount, latestOrderDate: null }))
|
|
198
|
-
.filter(row => Number(row.unreceivedCny) > 0)
|
|
199
|
-
.sort((a, b) => Number(b.unreceivedCny) - Number(a.unreceivedCny))
|
|
200
|
-
.slice(0, 5);
|
|
201
|
-
}
|
|
202
|
-
function supplierRiskRowsFromData(data) {
|
|
203
|
-
if (data.dashboard.supplierRiskTop5.length)
|
|
204
|
-
return data.dashboard.supplierRiskTop5.map(item => ({
|
|
205
|
-
key: item.supplierId,
|
|
206
|
-
name: item.supplierName,
|
|
207
|
-
unpaidCny: item.unpaidCny,
|
|
208
|
-
sanctionHitCount: item.sanctionHitCount,
|
|
209
|
-
productRiskHitCount: item.productRiskHitCount,
|
|
210
|
-
purchaseOrderCount: item.purchaseOrderCount
|
|
211
|
-
}));
|
|
212
|
-
return data.details.items
|
|
213
|
-
.map(row => ({
|
|
214
|
-
key: row.key,
|
|
215
|
-
name: row.label,
|
|
216
|
-
unpaidCny: row.unpaidCny ?? row.unreceivedCny ?? '0',
|
|
217
|
-
sanctionHitCount: 0,
|
|
218
|
-
productRiskHitCount: Number(row.productQuantity) > 0 ? 1 : 0,
|
|
219
|
-
purchaseOrderCount: row.orderCount
|
|
220
|
-
}))
|
|
221
|
-
.filter(row => Number(row.unpaidCny) > 0)
|
|
222
|
-
.sort((a, b) => Number(b.unpaidCny) - Number(a.unpaidCny))
|
|
223
|
-
.slice(0, 5);
|
|
224
|
-
}
|
|
225
|
-
function salesFileRowsFromData(data) {
|
|
226
|
-
if (data.dashboard.salesFileReviews.length)
|
|
227
|
-
return data.dashboard.salesFileReviews.map(item => ({
|
|
228
|
-
key: item.fileId,
|
|
229
|
-
fileName: item.fileName,
|
|
230
|
-
fileType: item.fileType,
|
|
231
|
-
orderNo: item.salesOrderNo,
|
|
232
|
-
reason: item.reason,
|
|
233
|
-
status: '待复核'
|
|
234
|
-
}));
|
|
235
|
-
return data.details.items
|
|
236
|
-
.filter(row => hasRiskAmount(row))
|
|
237
|
-
.slice(0, 5)
|
|
238
|
-
.map(row => ({ key: `review-${row.key}`, fileName: `${row.label}合规资料`, fileType: '业务单据', orderNo: row.key, reason: riskLabelForRow(row), status: '待复核' }));
|
|
239
|
-
}
|
|
240
|
-
function riskOrderRowsFromData(data) {
|
|
241
|
-
if (data.dashboard.riskOrders.length)
|
|
242
|
-
return data.dashboard.riskOrders.map(item => ({
|
|
243
|
-
key: item.orderKey,
|
|
244
|
-
orderNo: item.orderNo,
|
|
245
|
-
partyName: item.partyName,
|
|
246
|
-
riskType: item.riskType,
|
|
247
|
-
riskAmountCny: item.riskAmountCny,
|
|
248
|
-
status: item.status
|
|
249
|
-
}));
|
|
250
|
-
return data.details.items
|
|
251
|
-
.map(row => ({ key: `risk-${row.key}`, orderNo: row.key, partyName: row.label, riskType: riskLabelForRow(row), riskAmountCny: largestRiskAmount(row), status: '待复核' }))
|
|
252
|
-
.filter(row => Number(row.riskAmountCny) > 0)
|
|
253
|
-
.sort((a, b) => Number(b.riskAmountCny) - Number(a.riskAmountCny))
|
|
254
|
-
.slice(0, 5);
|
|
255
|
-
}
|
|
256
|
-
function findDetail(data, key, label) {
|
|
257
|
-
return data.details.items.find(row => row.key === key || row.label === label);
|
|
258
|
-
}
|
|
259
|
-
function estimatedGrossProfit(row) {
|
|
260
|
-
if (row.receivedCny || row.paidCny)
|
|
261
|
-
return new Decimal(row.receivedCny ?? row.amountCny).minus(row.paidCny ?? 0).toString();
|
|
262
|
-
return '0';
|
|
263
|
-
}
|
|
264
|
-
function riskStatusForAmount(value) {
|
|
265
|
-
const number = Number(value) || 0;
|
|
266
|
-
if (number <= 0)
|
|
267
|
-
return 'LOW';
|
|
268
|
-
return number >= 100_000 ? 'HIGH' : 'MEDIUM';
|
|
269
|
-
}
|
|
270
|
-
function hasRiskAmount(row) {
|
|
271
|
-
return Number(row.unreceivedCny ?? 0) > 0 || Number(row.unpaidCny ?? 0) > 0 || Number(row.unrefundedCny ?? 0) > 0;
|
|
272
|
-
}
|
|
273
|
-
function riskLabelForRow(row) {
|
|
274
|
-
const risks = [
|
|
275
|
-
Number(row.unreceivedCny ?? 0) > 0 ? '未收款' : '',
|
|
276
|
-
Number(row.unpaidCny ?? 0) > 0 ? '未付款' : '',
|
|
277
|
-
Number(row.unrefundedCny ?? 0) > 0 ? '未退税' : ''
|
|
278
|
-
].filter(Boolean);
|
|
279
|
-
return risks.length ? risks.join('/') : '合规待复核';
|
|
280
|
-
}
|
|
281
|
-
function largestRiskAmount(row) {
|
|
282
|
-
return String(Math.max(Number(row.unreceivedCny ?? 0), Number(row.unpaidCny ?? 0), Number(row.unrefundedCny ?? 0)));
|
|
283
|
-
}
|
|
284
150
|
function EmptyText({ text }) {
|
|
285
151
|
return _jsx("small", { className: "tcw-analytics-empty", children: text });
|
|
286
152
|
}
|
|
287
|
-
function AdvancedFilterModal({ active,
|
|
288
|
-
return _jsx("div", { className: "tcw-analytics-modal-deck", hidden: !active, "aria-hidden": !active, children: _jsx(AnalyticsModal, { title: "\u9AD8\u7EA7\u7B5B\u9009", active: active, onClose: onClose, footer: _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onReset, children: [_jsx("i", { className: "ri-restart-line", "aria-hidden": "true" }), "\u91CD\u7F6E"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", onClick: onApply, children: [_jsx("i", { className: "ri-check-line", "aria-hidden": "true" }), "\u786E\u5B9A"] })] }), children: _jsxs("div", { className: "tcw-analytics-modal-grid", children: [_jsx("div", { className: "tcw-analytics-quick-range", "aria-label": "\u7EDF\u8BA1\u65F6\u95F4", children: ['今日', '近7天', '近30天', '本月'].map((label, index) => _jsxs("button", { type: "button", className: index === 2 ? 'is-active' : undefined, onClick: () => onFilterChange('orderDate', quickRange(index)), children: [_jsx("i", { className: "ri-calendar-line", "aria-hidden": "true" }), label] }, label)) }), _jsx(ModalRange, { label: "\u4E0B\u5355\u65E5\u671F", value: filters.orderDate, onChange: value => onFilterChange('orderDate', value) }), _jsx(ModalText, { label:
|
|
153
|
+
function AdvancedFilterModal({ active, filters, onFilterChange, onApply, onReset, onClose }) {
|
|
154
|
+
return _jsx("div", { className: "tcw-analytics-modal-deck", hidden: !active, "aria-hidden": !active, children: _jsx(AnalyticsModal, { title: "\u9AD8\u7EA7\u7B5B\u9009", active: active, onClose: onClose, footer: _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onReset, children: [_jsx("i", { className: "ri-restart-line", "aria-hidden": "true" }), "\u91CD\u7F6E"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", onClick: onApply, children: [_jsx("i", { className: "ri-check-line", "aria-hidden": "true" }), "\u786E\u5B9A"] })] }), children: _jsxs("div", { className: "tcw-analytics-modal-grid", children: [_jsx("div", { className: "tcw-analytics-quick-range", "aria-label": "\u7EDF\u8BA1\u65F6\u95F4", children: ['今日', '近7天', '近30天', '本月'].map((label, index) => _jsxs("button", { type: "button", className: index === 2 ? 'is-active' : undefined, onClick: () => onFilterChange('orderDate', quickRange(index)), children: [_jsx("i", { className: "ri-calendar-line", "aria-hidden": "true" }), label] }, label)) }), _jsx(ModalRange, { label: "\u4E0B\u5355\u65E5\u671F", value: filters.orderDate, onChange: value => onFilterChange('orderDate', value) }), _jsx(ModalText, { label: "\u5546\u54C1\u540D\u79F0", value: String(filters.productName ?? ''), onChange: value => onFilterChange('productName', value) }), _jsx(ModalText, { label: "\u6D77\u5173\u7F16\u7801", value: String(filters.hsCode ?? ''), onChange: value => onFilterChange('hsCode', value) })] }) }) });
|
|
155
|
+
}
|
|
156
|
+
function AnalyticsInfoModal({ info, onClose }) {
|
|
157
|
+
return _jsx("div", { className: "tcw-analytics-modal-deck", "aria-hidden": false, children: _jsx(AnalyticsModal, { title: info.title, active: true, onClose: onClose, footer: _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u5173\u95ED"] }), children: info.rows.length ? _jsx("dl", { className: "tcw-analytics-info-list", children: info.rows.map(([label, value]) => _jsxs("div", { children: [_jsx("dt", { children: label }), _jsx("dd", { children: value })] }, `${label}-${value}`)) }) : _jsx(EmptyText, { text: "\u6682\u65E0\u660E\u7EC6" }) }) });
|
|
289
158
|
}
|
|
290
159
|
function BusinessExportModal({ active, total, onClose, onExport }) {
|
|
291
160
|
return _jsx("div", { className: "tcw-analytics-modal-deck", hidden: !active, "aria-hidden": !active, children: _jsx(AnalyticsModal, { title: "\u4E1A\u52A1\u5BFC\u51FA", active: active, onClose: onClose, footer: _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u53D6\u6D88"] }), children: _jsxs("div", { className: "tcw-analytics-export-panel", children: [_jsxs("button", { type: "button", onClick: () => onExport('summary'), children: [_jsx("i", { className: "ri-dashboard-line", "aria-hidden": "true" }), _jsx("strong", { children: "\u7BA1\u7406\u6C47\u603B\u62A5\u8868" }), _jsx("span", { children: "\u6307\u6807\u6C47\u603B\u3001TOP \u6392\u540D\u548C\u8D8B\u52BF\u6570\u636E\uFF0C\u9002\u5408\u7ECF\u8425\u590D\u76D8\u3002" })] }), _jsxs("button", { type: "button", onClick: () => onExport('details'), children: [_jsx("i", { className: "ri-file-list-3-line", "aria-hidden": "true" }), _jsx("strong", { children: "\u5F53\u524D\u660E\u7EC6\u6E05\u5355" }), _jsxs("span", { children: ["\u5BFC\u51FA\u5F53\u524D\u7B5B\u9009\u540E\u7684 ", total, " \u6761\u660E\u7EC6\u6570\u636E\u3002"] })] }), _jsxs("button", { type: "button", onClick: () => onExport('exceptions'), children: [_jsx("i", { className: "ri-alarm-warning-line", "aria-hidden": "true" }), _jsx("strong", { children: "\u5F02\u5E38/\u98CE\u9669\u6E05\u5355" }), _jsx("span", { children: "\u672A\u6536\u6B3E\u3001\u672A\u4ED8\u6B3E\u3001\u672A\u9000\u7A0E\u548C\u5408\u89C4\u5F85\u5904\u7406\u4E8B\u9879\u3002" })] })] }) }) });
|