@chenchaolong/plugin-trade-compliance-workbench 0.1.45 → 0.1.46
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.
|
@@ -647,27 +647,12 @@
|
|
|
647
647
|
)
|
|
648
648
|
),
|
|
649
649
|
h('nav', { className: 'tcw-nav', 'aria-label': '主导航' }, [
|
|
650
|
-
tab('overview-page', '总览', '
|
|
651
|
-
tab('controlled-goods-page', '
|
|
652
|
-
tab('products-page', '供应商商品', '
|
|
653
|
-
tab('workbooks-page', '销售发票', '
|
|
654
|
-
tab('hs-code-search-page', '工具', '
|
|
655
|
-
])
|
|
656
|
-
h('section', { className: 'tcw-sidebar-section' },
|
|
657
|
-
h('h2', null, '主流程'),
|
|
658
|
-
h('ol', { className: 'tcw-flow-list' }, [
|
|
659
|
-
'维护管控规则',
|
|
660
|
-
'上传供应商合同',
|
|
661
|
-
'确认 HS 编码候选',
|
|
662
|
-
'审核供应商商品',
|
|
663
|
-
'上传购销合同',
|
|
664
|
-
'生成销售发票'
|
|
665
|
-
].map((item) => h('li', { key: item }, h('span', null), item)))
|
|
666
|
-
),
|
|
667
|
-
h('section', { className: 'tcw-sidebar-section compact' },
|
|
668
|
-
h('h2', null, '数据关系'),
|
|
669
|
-
h('p', null, '管控规则用于匹配供应商商品,已确认商品进入销售发票生成流程。')
|
|
670
|
-
)
|
|
650
|
+
tab('overview-page', '总览', 'dashboard', pendingItems.length, 'blue'),
|
|
651
|
+
tab('controlled-goods-page', '管控商品', 'shield', controlledReviews.length, 'green'),
|
|
652
|
+
tab('products-page', '供应商商品', 'box', supplierReviews.length, 'orange'),
|
|
653
|
+
tab('workbooks-page', '销售发票', 'invoice', salesReviews.length + filteredWorkbooks.length, 'violet'),
|
|
654
|
+
tab('hs-code-search-page', '工具', 'search', null, 'slate')
|
|
655
|
+
])
|
|
671
656
|
)
|
|
672
657
|
}
|
|
673
658
|
|
|
@@ -687,7 +672,7 @@
|
|
|
687
672
|
h('section', { className: 'tcw-assistant-card' },
|
|
688
673
|
h('h3', null, '快捷入口'),
|
|
689
674
|
h('div', { className: 'tcw-assistant-actions' }, [
|
|
690
|
-
h('button', { className: 'tcw-mini-btn', onClick: () => setActivePage('controlled-goods-page') }, '
|
|
675
|
+
h('button', { className: 'tcw-mini-btn', onClick: () => setActivePage('controlled-goods-page') }, '管控商品'),
|
|
691
676
|
h('button', { className: 'tcw-mini-btn', onClick: () => setActivePage('products-page') }, '商品审核'),
|
|
692
677
|
h('button', { className: 'tcw-mini-btn', onClick: () => setActivePage('hs-code-search-page') }, '查 HS 编码')
|
|
693
678
|
])
|
|
@@ -701,7 +686,7 @@
|
|
|
701
686
|
|
|
702
687
|
function tab(key, label, icon, count, tone) {
|
|
703
688
|
return h('button', { key, className: key === activePage ? 'tcw-tab active' : 'tcw-tab', onClick: () => setActivePage(key) },
|
|
704
|
-
h('span', { className: 'tcw-nav-icon ' + (tone || 'blue') }, icon),
|
|
689
|
+
h('span', { className: 'tcw-nav-icon ' + (tone || 'blue') }, iconImage(icon, label, tone)),
|
|
705
690
|
h('span', null, label),
|
|
706
691
|
count == null ? null : h('em', null, count)
|
|
707
692
|
)
|
|
@@ -713,22 +698,22 @@
|
|
|
713
698
|
: pendingItems.filter((item) => item.type === overviewTab).slice(0, 12)
|
|
714
699
|
return h('div', { className: 'tcw-page overview-page' },
|
|
715
700
|
h('section', { className: 'tcw-metrics' },
|
|
716
|
-
metric('待审核', pendingItems.length, '
|
|
717
|
-
metric('管控识别待审', pendingControlledReviews.length, '
|
|
718
|
-
metric('供应商商品待审', pendingSupplierReviews.length, '
|
|
719
|
-
metric('销售合同待审', pendingSalesReviews.length, '
|
|
720
|
-
metric('已入库管控商品', data.controlledGoods.length, '
|
|
721
|
-
metric('已入库供应商商品', data.products.length, '
|
|
722
|
-
metric('销售发票历史', data.workbookGenerations.length, '
|
|
723
|
-
metric('全部审核记录', reviewItems.length, '
|
|
701
|
+
metric('待审核', pendingItems.length, 'dashboard', 'blue'),
|
|
702
|
+
metric('管控识别待审', pendingControlledReviews.length, 'shield', 'green'),
|
|
703
|
+
metric('供应商商品待审', pendingSupplierReviews.length, 'box', 'orange'),
|
|
704
|
+
metric('销售合同待审', pendingSalesReviews.length, 'invoice', 'violet'),
|
|
705
|
+
metric('已入库管控商品', data.controlledGoods.length, 'archive', 'slate'),
|
|
706
|
+
metric('已入库供应商商品', data.products.length, 'supplier', 'green'),
|
|
707
|
+
metric('销售发票历史', data.workbookGenerations.length, 'document', 'violet'),
|
|
708
|
+
metric('全部审核记录', reviewItems.length, 'records', 'blue')
|
|
724
709
|
),
|
|
725
710
|
panel('待办事项明细',
|
|
726
711
|
h('div', { className: 'tcw-overview-panel' },
|
|
727
712
|
h('div', { className: 'tcw-overview-tabs' }, [
|
|
728
713
|
overviewTabButton('all', '全部', pendingItems.length),
|
|
729
|
-
overviewTabButton('controlled_goods', '
|
|
730
|
-
overviewTabButton('supplier_product', '
|
|
731
|
-
overviewTabButton('customs_workbook', '
|
|
714
|
+
overviewTabButton('controlled_goods', '管控商品', pendingItems.filter((item) => item.type === 'controlled_goods').length),
|
|
715
|
+
overviewTabButton('supplier_product', '供应商商品', pendingItems.filter((item) => item.type === 'supplier_product').length),
|
|
716
|
+
overviewTabButton('customs_workbook', '销售发票', pendingItems.filter((item) => item.type === 'customs_workbook').length)
|
|
732
717
|
]),
|
|
733
718
|
pendingOverviewItems.length
|
|
734
719
|
? compactReviewList(pendingOverviewItems)
|
|
@@ -1307,7 +1292,7 @@
|
|
|
1307
1292
|
|
|
1308
1293
|
function metric(label, valueText, icon, tone) {
|
|
1309
1294
|
return h('div', { className: 'tcw-metric' },
|
|
1310
|
-
h('span', { className: 'tcw-metric-icon ' + (tone || 'blue') }, icon
|
|
1295
|
+
h('span', { className: 'tcw-metric-icon ' + (tone || 'blue') }, iconImage(icon, label, tone)),
|
|
1311
1296
|
h('div', { className: 'tcw-metric-body' },
|
|
1312
1297
|
h('span', null, label),
|
|
1313
1298
|
h('strong', null, valueText)
|
|
@@ -1315,6 +1300,34 @@
|
|
|
1315
1300
|
)
|
|
1316
1301
|
}
|
|
1317
1302
|
|
|
1303
|
+
function iconImage(name, label, tone) {
|
|
1304
|
+
return h('img', { src: iconDataUri(name, tone), alt: label || '', 'aria-hidden': label ? undefined : true })
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
function iconDataUri(name, tone) {
|
|
1308
|
+
const colors = {
|
|
1309
|
+
blue: '#2563eb',
|
|
1310
|
+
green: '#139160',
|
|
1311
|
+
orange: '#e07818',
|
|
1312
|
+
violet: '#7c3aed',
|
|
1313
|
+
slate: '#526174'
|
|
1314
|
+
}
|
|
1315
|
+
const color = colors[tone] || colors.blue
|
|
1316
|
+
const paths = {
|
|
1317
|
+
dashboard: '<rect x="4" y="4" width="7" height="7" rx="1.5"/><rect x="13" y="4" width="7" height="7" rx="1.5"/><rect x="4" y="13" width="7" height="7" rx="1.5"/><rect x="13" y="13" width="7" height="7" rx="1.5"/>',
|
|
1318
|
+
shield: '<path d="M12 3l7 3v5c0 4.8-2.9 8.2-7 10-4.1-1.8-7-5.2-7-10V6l7-3z"/><path d="M9 12l2 2 4-5"/>',
|
|
1319
|
+
box: '<path d="M4 8l8-4 8 4-8 4-8-4z"/><path d="M4 8v8l8 4 8-4V8"/><path d="M12 12v8"/>',
|
|
1320
|
+
invoice: '<path d="M7 3h8l4 4v14l-3-1.5L13 21l-3-1.5L7 21V3z"/><path d="M15 3v5h4"/><path d="M9 11h6"/><path d="M9 15h6"/>',
|
|
1321
|
+
search: '<circle cx="11" cy="11" r="6"/><path d="M16 16l4 4"/>',
|
|
1322
|
+
archive: '<path d="M4 7h16v13H4V7z"/><path d="M3 4h18v3H3z"/><path d="M9 11h6"/>',
|
|
1323
|
+
supplier: '<path d="M4 20V8l8-4 8 4v12"/><path d="M8 20v-7h8v7"/><path d="M10 9h4"/>',
|
|
1324
|
+
document: '<path d="M7 3h7l5 5v13H7V3z"/><path d="M14 3v6h5"/><path d="M9 13h6"/><path d="M9 17h6"/>',
|
|
1325
|
+
records: '<path d="M6 5h12v16H6V5z"/><path d="M9 3h6v4H9z"/><path d="M9 11h6"/><path d="M9 15h6"/>'
|
|
1326
|
+
}
|
|
1327
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="${color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${paths[name] || paths.dashboard}</svg>`
|
|
1328
|
+
return 'data:image/svg+xml;utf8,' + encodeURIComponent(svg)
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1318
1331
|
function panel(title, content) {
|
|
1319
1332
|
return h('section', { className: 'tcw-panel' }, h('h3', null, title), content)
|
|
1320
1333
|
}
|
|
@@ -1824,7 +1837,7 @@
|
|
|
1824
1837
|
|
|
1825
1838
|
function pageTitle(key) {
|
|
1826
1839
|
if (key === 'overview-page') return '总览'
|
|
1827
|
-
if (key === 'controlled-goods-page') return '
|
|
1840
|
+
if (key === 'controlled-goods-page') return '管控商品'
|
|
1828
1841
|
if (key === 'products-page') return '供应商商品'
|
|
1829
1842
|
if (key === 'hs-code-search-page') return '工具'
|
|
1830
1843
|
return '销售发票'
|
|
@@ -1840,7 +1853,7 @@
|
|
|
1840
1853
|
|
|
1841
1854
|
function pageBreadcrumb(key) {
|
|
1842
1855
|
if (key === 'overview-page') return 'Workspace / 总览'
|
|
1843
|
-
if (key === 'controlled-goods-page') return 'Workspace /
|
|
1856
|
+
if (key === 'controlled-goods-page') return 'Workspace / 管控商品'
|
|
1844
1857
|
if (key === 'products-page') return 'Workspace / 供应商商品'
|
|
1845
1858
|
if (key === 'workbooks-page') return 'Workspace / 销售发票'
|
|
1846
1859
|
return 'Workspace / 工具'
|
|
@@ -1926,6 +1939,11 @@ button, input, textarea, select { font: inherit; letter-spacing: 0; }
|
|
|
1926
1939
|
font-size: 18px;
|
|
1927
1940
|
font-weight: 900;
|
|
1928
1941
|
}
|
|
1942
|
+
.tcw-metric-icon img {
|
|
1943
|
+
width: 22px;
|
|
1944
|
+
height: 22px;
|
|
1945
|
+
color: currentColor;
|
|
1946
|
+
}
|
|
1929
1947
|
.tcw-metric-icon.blue { background: #e8f0ff; color: var(--tcw-primary); }
|
|
1930
1948
|
.tcw-metric-icon.green { background: #e7f8ef; color: var(--tcw-success); }
|
|
1931
1949
|
.tcw-metric-icon.orange { background: #fff2df; color: var(--tcw-warning); }
|
|
@@ -2144,48 +2162,16 @@ body { background: var(--tcw-bg); letter-spacing: 0; }
|
|
|
2144
2162
|
font-size: 11px;
|
|
2145
2163
|
font-weight: 900;
|
|
2146
2164
|
}
|
|
2165
|
+
.tcw-nav-icon img {
|
|
2166
|
+
width: 16px;
|
|
2167
|
+
height: 16px;
|
|
2168
|
+
color: currentColor;
|
|
2169
|
+
}
|
|
2147
2170
|
.tcw-nav-icon.blue { background: #e8f0ff; color: var(--tcw-primary); }
|
|
2148
2171
|
.tcw-nav-icon.green { background: #e7f8ef; color: var(--tcw-success); }
|
|
2149
2172
|
.tcw-nav-icon.orange { background: #fff2df; color: var(--tcw-warning); }
|
|
2150
2173
|
.tcw-nav-icon.violet { background: #f1eaff; color: var(--tcw-violet); }
|
|
2151
2174
|
.tcw-nav-icon.slate { background: #eef2f6; color: var(--tcw-slate); }
|
|
2152
|
-
.tcw-sidebar-section {
|
|
2153
|
-
display: grid;
|
|
2154
|
-
gap: 8px;
|
|
2155
|
-
border-top: 1px solid var(--tcw-border);
|
|
2156
|
-
padding: 14px 6px 0;
|
|
2157
|
-
}
|
|
2158
|
-
.tcw-sidebar-section h2 {
|
|
2159
|
-
margin: 0;
|
|
2160
|
-
color: var(--tcw-muted);
|
|
2161
|
-
font-size: 12px;
|
|
2162
|
-
}
|
|
2163
|
-
.tcw-sidebar-section.compact p {
|
|
2164
|
-
margin: 0;
|
|
2165
|
-
color: var(--tcw-muted);
|
|
2166
|
-
font-size: 12px;
|
|
2167
|
-
line-height: 1.6;
|
|
2168
|
-
}
|
|
2169
|
-
.tcw-flow-list {
|
|
2170
|
-
display: grid;
|
|
2171
|
-
gap: 8px;
|
|
2172
|
-
margin: 0;
|
|
2173
|
-
padding: 0;
|
|
2174
|
-
list-style: none;
|
|
2175
|
-
color: var(--tcw-text);
|
|
2176
|
-
font-size: 12px;
|
|
2177
|
-
}
|
|
2178
|
-
.tcw-flow-list li {
|
|
2179
|
-
display: flex;
|
|
2180
|
-
gap: 8px;
|
|
2181
|
-
align-items: center;
|
|
2182
|
-
}
|
|
2183
|
-
.tcw-flow-list span {
|
|
2184
|
-
width: 7px;
|
|
2185
|
-
height: 7px;
|
|
2186
|
-
border-radius: 999px;
|
|
2187
|
-
background: var(--tcw-primary);
|
|
2188
|
-
}
|
|
2189
2175
|
.tcw-workspace {
|
|
2190
2176
|
display: grid;
|
|
2191
2177
|
grid-template-rows: auto 1fr;
|
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.46",
|
|
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",
|