@chenchaolong/plugin-trade-compliance-workbench 0.1.44 → 0.1.45
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.
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
const [activePage, setActivePage] = React.useState('overview-page')
|
|
71
71
|
const [selectedIds, setSelectedIds] = React.useState([])
|
|
72
72
|
const [statusFilter, setStatusFilter] = React.useState('all')
|
|
73
|
+
const [overviewTab, setOverviewTab] = React.useState('all')
|
|
73
74
|
const [busy, setBusy] = React.useState(false)
|
|
74
75
|
const [query, setQuery] = React.useState('')
|
|
75
76
|
const [pageByList, setPageByList] = React.useState({})
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
}
|
|
104
105
|
}, [])
|
|
105
106
|
|
|
106
|
-
React.useEffect(reportResize, [data, activePage, selectedIds, statusFilter, busy, formDialog, deleteDialog, hsCodeSearch, hsCodeDetailDialog])
|
|
107
|
+
React.useEffect(reportResize, [data, activePage, selectedIds, statusFilter, overviewTab, busy, formDialog, deleteDialog, hsCodeSearch, hsCodeDetailDialog])
|
|
107
108
|
|
|
108
109
|
const reviewItems = data.reviewItems.filter((item) => !isPlaceholderReviewItem(item))
|
|
109
110
|
const pendingItems = reviewItems.filter((item) => (item.reviewStatus || 'pending') === 'pending')
|
|
@@ -646,7 +647,7 @@
|
|
|
646
647
|
)
|
|
647
648
|
),
|
|
648
649
|
h('nav', { className: 'tcw-nav', 'aria-label': '主导航' }, [
|
|
649
|
-
tab('overview-page', '
|
|
650
|
+
tab('overview-page', '总览', '1', pendingItems.length, 'blue'),
|
|
650
651
|
tab('controlled-goods-page', '管控规则库', '2', controlledReviews.length, 'green'),
|
|
651
652
|
tab('products-page', '供应商商品', '3', supplierReviews.length, 'orange'),
|
|
652
653
|
tab('workbooks-page', '销售发票', '4', salesReviews.length + filteredWorkbooks.length, 'violet'),
|
|
@@ -707,21 +708,43 @@
|
|
|
707
708
|
}
|
|
708
709
|
|
|
709
710
|
function renderOverviewPage() {
|
|
711
|
+
const pendingOverviewItems = overviewTab === 'all'
|
|
712
|
+
? pendingItems.slice(0, 12)
|
|
713
|
+
: pendingItems.filter((item) => item.type === overviewTab).slice(0, 12)
|
|
710
714
|
return h('div', { className: 'tcw-page overview-page' },
|
|
711
715
|
h('section', { className: 'tcw-metrics' },
|
|
712
|
-
metric('待审核', pendingItems.length),
|
|
713
|
-
metric('管控识别待审', pendingControlledReviews.length),
|
|
714
|
-
metric('供应商商品待审', pendingSupplierReviews.length),
|
|
715
|
-
metric('销售合同待审', pendingSalesReviews.length),
|
|
716
|
-
metric('已入库管控商品', data.controlledGoods.length),
|
|
717
|
-
metric('已入库供应商商品', data.products.length),
|
|
718
|
-
metric('销售发票历史', data.workbookGenerations.length),
|
|
719
|
-
metric('全部审核记录', reviewItems.length)
|
|
716
|
+
metric('待审核', pendingItems.length, '总', 'blue'),
|
|
717
|
+
metric('管控识别待审', pendingControlledReviews.length, '盾', 'green'),
|
|
718
|
+
metric('供应商商品待审', pendingSupplierReviews.length, '品', 'orange'),
|
|
719
|
+
metric('销售合同待审', pendingSalesReviews.length, '票', 'violet'),
|
|
720
|
+
metric('已入库管控商品', data.controlledGoods.length, '仓', 'slate'),
|
|
721
|
+
metric('已入库供应商商品', data.products.length, '商', 'green'),
|
|
722
|
+
metric('销售发票历史', data.workbookGenerations.length, '文', 'violet'),
|
|
723
|
+
metric('全部审核记录', reviewItems.length, '记', 'blue')
|
|
720
724
|
),
|
|
721
|
-
panel('
|
|
722
|
-
|
|
723
|
-
|
|
725
|
+
panel('待办事项明细',
|
|
726
|
+
h('div', { className: 'tcw-overview-panel' },
|
|
727
|
+
h('div', { className: 'tcw-overview-tabs' }, [
|
|
728
|
+
overviewTabButton('all', '全部', pendingItems.length),
|
|
729
|
+
overviewTabButton('controlled_goods', '规则', pendingItems.filter((item) => item.type === 'controlled_goods').length),
|
|
730
|
+
overviewTabButton('supplier_product', '商品', pendingItems.filter((item) => item.type === 'supplier_product').length),
|
|
731
|
+
overviewTabButton('customs_workbook', '发票', pendingItems.filter((item) => item.type === 'customs_workbook').length)
|
|
732
|
+
]),
|
|
733
|
+
pendingOverviewItems.length
|
|
734
|
+
? compactReviewList(pendingOverviewItems)
|
|
735
|
+
: empty('暂无待审核记录。智能体识别结果会先出现在这里。')
|
|
736
|
+
)
|
|
737
|
+
)
|
|
724
738
|
)
|
|
739
|
+
|
|
740
|
+
function overviewTabButton(key, label, count) {
|
|
741
|
+
return h('button', {
|
|
742
|
+
key,
|
|
743
|
+
type: 'button',
|
|
744
|
+
className: overviewTab === key ? 'tcw-overview-tab active' : 'tcw-overview-tab',
|
|
745
|
+
onClick: () => setOverviewTab(key)
|
|
746
|
+
}, `${label}${typeof count === 'number' ? ` ${count}` : ''}`)
|
|
747
|
+
}
|
|
725
748
|
}
|
|
726
749
|
|
|
727
750
|
function renderControlledGoodsPage() {
|
|
@@ -1282,8 +1305,14 @@
|
|
|
1282
1305
|
|
|
1283
1306
|
}
|
|
1284
1307
|
|
|
1285
|
-
function metric(label, valueText) {
|
|
1286
|
-
return h('div', { className: 'tcw-metric' },
|
|
1308
|
+
function metric(label, valueText, icon, tone) {
|
|
1309
|
+
return h('div', { className: 'tcw-metric' },
|
|
1310
|
+
h('span', { className: 'tcw-metric-icon ' + (tone || 'blue') }, icon || '·'),
|
|
1311
|
+
h('div', { className: 'tcw-metric-body' },
|
|
1312
|
+
h('span', null, label),
|
|
1313
|
+
h('strong', null, valueText)
|
|
1314
|
+
)
|
|
1315
|
+
)
|
|
1287
1316
|
}
|
|
1288
1317
|
|
|
1289
1318
|
function panel(title, content) {
|
|
@@ -1794,7 +1823,7 @@
|
|
|
1794
1823
|
}
|
|
1795
1824
|
|
|
1796
1825
|
function pageTitle(key) {
|
|
1797
|
-
if (key === 'overview-page') return '
|
|
1826
|
+
if (key === 'overview-page') return '总览'
|
|
1798
1827
|
if (key === 'controlled-goods-page') return '管控规则库'
|
|
1799
1828
|
if (key === 'products-page') return '供应商商品'
|
|
1800
1829
|
if (key === 'hs-code-search-page') return '工具'
|
|
@@ -1810,7 +1839,7 @@
|
|
|
1810
1839
|
}
|
|
1811
1840
|
|
|
1812
1841
|
function pageBreadcrumb(key) {
|
|
1813
|
-
if (key === 'overview-page') return 'Workspace /
|
|
1842
|
+
if (key === 'overview-page') return 'Workspace / 总览'
|
|
1814
1843
|
if (key === 'controlled-goods-page') return 'Workspace / 管控规则库'
|
|
1815
1844
|
if (key === 'products-page') return 'Workspace / 供应商商品'
|
|
1816
1845
|
if (key === 'workbooks-page') return 'Workspace / 销售发票'
|
|
@@ -1818,7 +1847,7 @@
|
|
|
1818
1847
|
}
|
|
1819
1848
|
|
|
1820
1849
|
function assistantTip(key) {
|
|
1821
|
-
if (key === 'overview-page') return '
|
|
1850
|
+
if (key === 'overview-page') return '从总览开始,优先确认管控规则和供应商商品,再推进发票生成。'
|
|
1822
1851
|
if (key === 'controlled-goods-page') return '维护管控商品时,建议先核对 HS 编码和关键词,再保存入库。'
|
|
1823
1852
|
if (key === 'products-page') return '供应商商品可先选用候选 HS 编码,再检查英文品名和管控状态。'
|
|
1824
1853
|
if (key === 'workbooks-page') return '购销合同审核完毕后,再生成销售发票,避免后面重改。'
|
|
@@ -1878,9 +1907,33 @@ button, input, textarea, select { font: inherit; letter-spacing: 0; }
|
|
|
1878
1907
|
.tcw-subsection-head h3, .tcw-list-title h3 { margin: 0; font-size: 15px; line-height: 1.3; }
|
|
1879
1908
|
.tcw-subsection-head p, .tcw-list-title span { margin: 0; color: var(--tcw-muted); font-size: 12px; }
|
|
1880
1909
|
.tcw-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
|
|
1881
|
-
.tcw-metric {
|
|
1882
|
-
|
|
1883
|
-
|
|
1910
|
+
.tcw-metric {
|
|
1911
|
+
display: grid;
|
|
1912
|
+
grid-template-columns: 44px minmax(0, 1fr);
|
|
1913
|
+
gap: 10px;
|
|
1914
|
+
align-items: center;
|
|
1915
|
+
border: 1px solid var(--tcw-border);
|
|
1916
|
+
border-radius: 8px;
|
|
1917
|
+
background: var(--tcw-card);
|
|
1918
|
+
padding: 12px;
|
|
1919
|
+
}
|
|
1920
|
+
.tcw-metric-icon {
|
|
1921
|
+
display: grid;
|
|
1922
|
+
place-items: center;
|
|
1923
|
+
width: 44px;
|
|
1924
|
+
height: 44px;
|
|
1925
|
+
border-radius: 10px;
|
|
1926
|
+
font-size: 18px;
|
|
1927
|
+
font-weight: 900;
|
|
1928
|
+
}
|
|
1929
|
+
.tcw-metric-icon.blue { background: #e8f0ff; color: var(--tcw-primary); }
|
|
1930
|
+
.tcw-metric-icon.green { background: #e7f8ef; color: var(--tcw-success); }
|
|
1931
|
+
.tcw-metric-icon.orange { background: #fff2df; color: var(--tcw-warning); }
|
|
1932
|
+
.tcw-metric-icon.violet { background: #f1eaff; color: var(--tcw-violet); }
|
|
1933
|
+
.tcw-metric-icon.slate { background: #eef2f6; color: var(--tcw-slate); }
|
|
1934
|
+
.tcw-metric-body { display: grid; gap: 2px; }
|
|
1935
|
+
.tcw-metric-body span { color: var(--tcw-muted); font-size: 12px; }
|
|
1936
|
+
.tcw-metric-body strong { font-size: 22px; line-height: 1; }
|
|
1884
1937
|
.tcw-field { display: grid; gap: 5px; min-width: 0; }
|
|
1885
1938
|
.tcw-field span { color: var(--tcw-muted); font-size: 12px; font-weight: 800; }
|
|
1886
1939
|
.tcw-field-check { align-content: end; }
|
|
@@ -2044,6 +2097,34 @@ body { background: var(--tcw-bg); letter-spacing: 0; }
|
|
|
2044
2097
|
background: #eff6ff;
|
|
2045
2098
|
color: #174ea6;
|
|
2046
2099
|
}
|
|
2100
|
+
.tcw-overview-panel {
|
|
2101
|
+
display: grid;
|
|
2102
|
+
gap: 12px;
|
|
2103
|
+
}
|
|
2104
|
+
.tcw-overview-tabs {
|
|
2105
|
+
display: inline-flex;
|
|
2106
|
+
align-items: center;
|
|
2107
|
+
gap: 0;
|
|
2108
|
+
width: fit-content;
|
|
2109
|
+
border: 1px solid var(--tcw-border);
|
|
2110
|
+
border-radius: 12px;
|
|
2111
|
+
overflow: hidden;
|
|
2112
|
+
background: #fff;
|
|
2113
|
+
}
|
|
2114
|
+
.tcw-overview-tab {
|
|
2115
|
+
min-height: 38px;
|
|
2116
|
+
border: 0;
|
|
2117
|
+
border-right: 1px solid var(--tcw-border);
|
|
2118
|
+
background: #fff;
|
|
2119
|
+
color: var(--tcw-muted);
|
|
2120
|
+
padding: 8px 16px;
|
|
2121
|
+
font-weight: 800;
|
|
2122
|
+
}
|
|
2123
|
+
.tcw-overview-tab:last-child { border-right: 0; }
|
|
2124
|
+
.tcw-overview-tab.active {
|
|
2125
|
+
background: #eff6ff;
|
|
2126
|
+
color: var(--tcw-primary);
|
|
2127
|
+
}
|
|
2047
2128
|
.tcw-tab em {
|
|
2048
2129
|
min-width: 22px;
|
|
2049
2130
|
border-radius: 999px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chenchaolong/plugin-trade-compliance-workbench",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.45",
|
|
4
4
|
"description": "Trade Compliance Workbench app plugin for controlled goods review, supplier product management, and customs workbook generation.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "XpertAI",
|