feat(label-designer): 面单设计新增国内/国外快递模板,按三组归类(共20个)
This commit is contained in:
1 parent
311ab1b139
commit
c5dc3c6312
4 files changed
+396
-8
No files matched your search
@@ -8,7 +8,7 @@ import bwipjs from 'bwip-js';
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import { getDocument, GlobalWorkerOptions, OPS } from 'pdfjs-dist';
|
||||
import pdfWorkerUrl from 'pdfjs-dist/build/pdf.worker.min.js?url';
|
||||
import { defaultDoc, newId, templates } from './templates';
|
||||
import { defaultDoc, newId, templates, templatesByGroup } from './templates';
|
||||
import { prepareZXingModule, readBarcodes } from 'zxing-wasm/reader';
|
||||
import wasmUrl from 'zxing-wasm/reader/zxing_reader.wasm?url';
|
||||
|
||||
@@ -60,6 +60,11 @@ const pxPerMM = computed(() => {
|
||||
const selected = computed(() => doc.value.elements.find(e => e.id === selectedId.value) ?? null);
|
||||
|
||||
const tplOptions = templates;
|
||||
// 模板按分组展示:国内快递 / 国外快递 / 通用面单
|
||||
const tplGroups = templatesByGroup();
|
||||
const openGroup = ref<string>('');
|
||||
const currentGroupItems = computed(() => tplGroups.find(g => g.group === openGroup.value)?.items ?? []);
|
||||
const activeTplKey = ref<string>('');
|
||||
|
||||
// ---------- persistence ----------
|
||||
const STORAGE_KEY = 'it-tools-label-designer';
|
||||
@@ -313,6 +318,8 @@ function applyTemplate(tpl: typeof templates[number]) {
|
||||
doc.value = tpl.make();
|
||||
selectedId.value = null;
|
||||
zoom.value = 1;
|
||||
activeTplKey.value = tpl.key;
|
||||
openGroup.value = ''; // 选完收起下拉,把画布让出来
|
||||
}
|
||||
|
||||
const showCustom = ref(false);
|
||||
@@ -1012,13 +1019,15 @@ onUnmounted(() => {
|
||||
</div>
|
||||
|
||||
<button
|
||||
v-for="t in tplOptions"
|
||||
:key="t.key"
|
||||
class="tpl-pill"
|
||||
:title="t.name"
|
||||
@click="applyTemplate(t)"
|
||||
v-for="g in tplGroups"
|
||||
:key="g.group"
|
||||
class="tpl-pill tpl-group"
|
||||
:class="{ active: openGroup === g.group }"
|
||||
:title="`${g.group}(${g.items.length} 个模板)`"
|
||||
@click="openGroup = openGroup === g.group ? '' : g.group"
|
||||
>
|
||||
{{ t.name }}
|
||||
{{ g.group }}
|
||||
<span class="tpl-caret">{{ openGroup === g.group ? '▴' : '▾' }}</span>
|
||||
</button>
|
||||
|
||||
<button class="tpl-pill custom" :class="{ active: showCustom }" @click="showCustom = !showCustom">
|
||||
@@ -1052,6 +1061,27 @@ onUnmounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 模板分组下拉:点上方分组按钮展开该组的模板列表 -->
|
||||
<div v-if="openGroup" class="tpl-drawer">
|
||||
<div class="tpl-drawer-head">
|
||||
<span class="tpl-drawer-title">{{ openGroup }}</span>
|
||||
<span class="tpl-drawer-count">{{ currentGroupItems.length }} 个模板</span>
|
||||
<button class="tpl-drawer-close" title="收起" @click="openGroup = ''">✕</button>
|
||||
</div>
|
||||
<div class="tpl-drawer-list">
|
||||
<button
|
||||
v-for="t in currentGroupItems"
|
||||
:key="t.key"
|
||||
class="tpl-card"
|
||||
:class="{ active: activeTplKey === t.key }"
|
||||
:title="t.name"
|
||||
@click="applyTemplate(t)"
|
||||
>
|
||||
{{ t.name }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="body">
|
||||
<div ref="stagePane" class="stage-pane" @mousedown.self="selectedId = null">
|
||||
<div
|
||||
@@ -1362,6 +1392,82 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
/* 模板分组下拉:展开在工具栏下方,不遮挡画布(占自身高度) */
|
||||
.tpl-drawer {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 10px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid rgba(24, 160, 88, 0.35);
|
||||
border-radius: 10px;
|
||||
background: rgba(24, 160, 88, 0.05);
|
||||
|
||||
.tpl-drawer-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.tpl-drawer-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #18a058;
|
||||
}
|
||||
|
||||
.tpl-drawer-count {
|
||||
font-size: 12px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.tpl-drawer-close {
|
||||
margin-left: auto;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: rgba(128, 128, 128, 0.14);
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: rgba(208, 48, 80, 0.16);
|
||||
color: #d03050;
|
||||
}
|
||||
}
|
||||
|
||||
.tpl-drawer-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.tpl-card {
|
||||
padding: 6px 16px;
|
||||
border: 1px solid rgba(128, 128, 128, 0.32);
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
color: #444;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
|
||||
&:hover {
|
||||
border-color: #18a058;
|
||||
color: #18a058;
|
||||
background: rgba(24, 160, 88, 0.08);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #18a058;
|
||||
color: #fff;
|
||||
background: #18a058;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1370,6 +1476,21 @@ onUnmounted(() => {
|
||||
padding-bottom: 10px;
|
||||
flex-shrink: 0;
|
||||
|
||||
.tpl-group {
|
||||
font-weight: 600;
|
||||
|
||||
.tpl-caret {
|
||||
margin-left: 3px;
|
||||
font-size: 10px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #18a058;
|
||||
color: #fff;
|
||||
background: #18a058;
|
||||
}
|
||||
}
|
||||
.stats {
|
||||
margin-right: 4px;
|
||||
font-size: 13px;
|
||||
|
||||
@@ -37,6 +37,8 @@ export interface LabelDoc {
|
||||
export interface LabelTemplate {
|
||||
key: string;
|
||||
name: string;
|
||||
/** 分组名,见 TEMPLATE_GROUPS */
|
||||
group: string;
|
||||
make: () => LabelDoc;
|
||||
}
|
||||
|
||||
@@ -72,10 +74,240 @@ function build(width: number, height: number, parts: Part[]): LabelDoc {
|
||||
return { widthMM: width, heightMM: height, bg: null, elements };
|
||||
}
|
||||
|
||||
/** 横向分隔线(实线) */
|
||||
const HR = (x: number, y: number, w: number): Part => ['r', x, y, w, 0.3, '#000000', '#000000', 0];
|
||||
|
||||
// 100×180 标准电子面单的公共版式(各快递只换品牌名/运单号/客服电话)
|
||||
function express100x180(opts: { brand: string; sub: string; noLabel: string; no: string; hotline: string; track: string }): LabelDoc {
|
||||
return build(100, 180, [
|
||||
['t', 5, 3, 90, 9, opts.brand, 15, true, 'center'],
|
||||
['t', 5, 12, 90, 4, opts.sub, 7, false, 'center'],
|
||||
HR(5, 17, 90),
|
||||
['t', 6, 20, 88, 5, '收件人', 7, false, 'left', '#666666'],
|
||||
['t', 6, 25, 88, 20, '张三\n138 0013 8000\n浙江省杭州市余杭区文一西路 969 号 5 幢 301 室', 11, true],
|
||||
HR(5, 46, 90),
|
||||
['t', 6, 49, 88, 5, '寄件人', 7, false, 'left', '#666666'],
|
||||
['t', 6, 54, 88, 16, '李四\n139 0013 9000\n广东省深圳市南山区科技园示例电商仓库', 8],
|
||||
HR(5, 71, 90),
|
||||
['t', 6, 74, 55, 5, opts.noLabel, 6.5, false, 'left', '#666666'],
|
||||
['t', 6, 79, 55, 7, opts.no, 12, true],
|
||||
['t', 6, 87, 55, 5, '订单号:DD20261010001', 7.5],
|
||||
['t', 6, 92, 55, 5, '件数:1 重量:1.2kg', 7.5],
|
||||
['t', 6, 97, 55, 5, '代收货款:¥0.00', 7.5],
|
||||
['t', 6, 102, 55, 5, '签收人:____________', 7.5],
|
||||
['q', 68, 74, 27, opts.track],
|
||||
HR(5, 148, 90),
|
||||
['b', 5, 152, 90, 20, opts.no, true],
|
||||
HR(5, 173, 90),
|
||||
['t', 5, 175, 90, 4, opts.hotline, 7, false, 'center'],
|
||||
]);
|
||||
}
|
||||
|
||||
// 100×150 国际面单公共版式
|
||||
function intl100x150(opts: { brand: string; sub: string; noLabel: string; no: string; service: string; customs: string; track: string }): LabelDoc {
|
||||
return build(100, 150, [
|
||||
['t', 5, 3, 90, 9, opts.brand, 16, true, 'center'],
|
||||
['t', 5, 12, 90, 4, opts.sub, 7, false, 'center'],
|
||||
HR(5, 17, 90),
|
||||
['t', 6, 20, 44, 5, 'SHIP FROM / 寄件人', 6.5, false, 'left', '#666666'],
|
||||
['t', 6, 25, 44, 18, 'Li Si\nSample Trading Co., Ltd.\nShenzhen, Guangdong, CN\n+86 139 0013 9000', 7.5],
|
||||
['t', 52, 20, 44, 5, 'SHIP TO / 收件人', 6.5, false, 'left', '#666666'],
|
||||
['t', 52, 25, 44, 18, 'John Smith\nSample Inc.\n350 Fifth Ave, New York\nNY 10118, United States\n+1 212 555 0100', 7.5, true],
|
||||
HR(5, 44, 90),
|
||||
['t', 6, 47, 55, 5, opts.noLabel, 6.5, false, 'left', '#666666'],
|
||||
['t', 6, 52, 55, 7, opts.no, 11, true],
|
||||
['t', 6, 60, 55, 5, 'Ship Date: 2026-10-15', 7.5],
|
||||
['t', 6, 65, 55, 5, 'Weight: 1.2 kg Pieces: 1', 7.5],
|
||||
['t', 6, 70, 55, 5, `Service: ${opts.service}`, 7.5],
|
||||
['t', 6, 75, 55, 5, `Customs: ${opts.customs}`, 7.5],
|
||||
['q', 68, 47, 27, opts.track],
|
||||
HR(5, 90, 90),
|
||||
['t', 6, 93, 88, 5, 'CONTENTS / 内件申报', 6.5, false, 'left', '#666666'],
|
||||
['t', 6, 98, 88, 14, '1. Sample goods × 1 HS Code: 8471.30 Qty: 1 Value: USD 50.00', 7.5],
|
||||
['t', 6, 113, 88, 5, 'Declared Value: USD 50.00 Country of Origin: CN', 7.5],
|
||||
HR(5, 128, 90),
|
||||
['b', 5, 131, 90, 15, opts.no, true],
|
||||
]);
|
||||
}
|
||||
|
||||
export const templates: LabelTemplate[] = [
|
||||
// ==================== 国内快递 ====================
|
||||
{
|
||||
key: 'dom-sf',
|
||||
name: '顺丰速运',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '顺丰速运 SF EXPRESS', sub: '标准快递 SF Standard Express',
|
||||
noLabel: '运单号 / Waybill No.', no: 'SF1234567890123',
|
||||
hotline: '上门取件 95338 签收人:____________ 日期:____',
|
||||
track: 'https://example.com/track/SF1234567890123',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'dom-zto',
|
||||
name: '中通快递',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '中通快递 ZTO EXPRESS', sub: '标准快递',
|
||||
noLabel: '运单号 / Waybill No.', no: '78123456789012',
|
||||
hotline: '客服热线 95311 签收人:____________ 日期:____',
|
||||
track: 'https://example.com/track/78123456789012',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'dom-yto',
|
||||
name: '圆通速递',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '圆通速递 YTO EXPRESS', sub: '标准快递',
|
||||
noLabel: '运单号 / Waybill No.', no: 'YT1234567890123',
|
||||
hotline: '客服热线 95554 签收人:____________ 日期:____',
|
||||
track: 'https://example.com/track/YT1234567890123',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'dom-yunda',
|
||||
name: '韵达快递',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '韵达快递 YUNDA EXPRESS', sub: '标准快递',
|
||||
noLabel: '运单号 / Waybill No.', no: '3123456789012',
|
||||
hotline: '客服热线 95546 签收人:____________ 日期:____',
|
||||
track: 'https://example.com/track/3123456789012',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'dom-sto',
|
||||
name: '申通快递',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '申通快递 STO EXPRESS', sub: '标准快递',
|
||||
noLabel: '运单号 / Waybill No.', no: '773123456789012',
|
||||
hotline: '客服热线 95543 签收人:____________ 日期:____',
|
||||
track: 'https://example.com/track/773123456789012',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'dom-jd',
|
||||
name: '京东物流',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '京东物流 JD LOGISTICS', sub: '京东快递 · 特快送',
|
||||
noLabel: '运单号 / Waybill No.', no: 'JD1234567890123',
|
||||
hotline: '客服热线 950616 签收人:____________ 日期:____',
|
||||
track: 'https://example.com/track/JD1234567890123',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'dom-jt',
|
||||
name: '极兔速递',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '极兔速递 J&T EXPRESS', sub: '标准快递',
|
||||
noLabel: '运单号 / Waybill No.', no: 'JT1234567890123',
|
||||
hotline: '客服热线 400-820-0888 签收人:______ 日期:____',
|
||||
track: 'https://example.com/track/JT1234567890123',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'dom-ems',
|
||||
name: '邮政 EMS',
|
||||
group: '国内快递',
|
||||
make: () => express100x180({
|
||||
brand: '中国邮政 EMS', sub: '国内特快专递',
|
||||
noLabel: '邮件号 / Track No.', no: 'EA123456789CN',
|
||||
hotline: '客服热线 11183 签收人:____________ 日期:____',
|
||||
track: 'https://example.com/track/EA123456789CN',
|
||||
}),
|
||||
},
|
||||
|
||||
// ==================== 国外快递 ====================
|
||||
{
|
||||
key: 'intl-dhl',
|
||||
name: 'DHL',
|
||||
group: '国外快递',
|
||||
make: () => intl100x150({
|
||||
brand: 'DHL EXPRESS', sub: 'Express Worldwide',
|
||||
noLabel: 'TRACKING NUMBER', no: 'JJD0099999999',
|
||||
service: 'Express Worldwide', customs: 'Bill to Sender',
|
||||
track: 'https://example.com/track/JJD0099999999',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'intl-fedex',
|
||||
name: 'FedEx',
|
||||
group: '国外快递',
|
||||
make: () => intl100x150({
|
||||
brand: 'FedEx Express', sub: 'International Priority',
|
||||
noLabel: 'TRACKING NUMBER', no: '9612345678901234',
|
||||
service: 'Intl Priority', customs: 'Bill to Sender',
|
||||
track: 'https://example.com/track/9612345678901234',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'intl-ups',
|
||||
name: 'UPS',
|
||||
group: '国外快递',
|
||||
make: () => intl100x150({
|
||||
brand: 'UPS', sub: 'Worldwide Express Saver',
|
||||
noLabel: 'TRACKING NUMBER', no: '1Z999AA10123456784',
|
||||
service: 'WW Express Saver', customs: 'Bill to Sender',
|
||||
track: 'https://example.com/track/1Z999AA10123456784',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'intl-usps',
|
||||
name: 'USPS',
|
||||
group: '国外快递',
|
||||
make: () => intl100x150({
|
||||
brand: 'UNITED STATES POSTAL SERVICE', sub: 'Priority Mail International',
|
||||
noLabel: 'TRACKING NUMBER', no: '9400100000000000000000',
|
||||
service: 'Priority Mail Intl', customs: 'CN 22 / PS 2976',
|
||||
track: 'https://example.com/track/9400100000000000000000',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'intl-tnt',
|
||||
name: 'TNT',
|
||||
group: '国外快递',
|
||||
make: () => intl100x150({
|
||||
brand: 'TNT', sub: 'Global Express',
|
||||
noLabel: 'CONSIGNMENT NUMBER', no: 'GE123456789WW',
|
||||
service: 'Global Express', customs: 'Bill to Sender',
|
||||
track: 'https://example.com/track/GE123456789WW',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'intl-fba',
|
||||
name: '亚马逊 FBA',
|
||||
group: '国外快递',
|
||||
make: () => build(100, 150, [
|
||||
['t', 5, 3, 90, 9, 'FBA SHIPMENT / 亚马逊入仓', 13, true, 'center'],
|
||||
['t', 5, 12, 90, 4, 'Fulfillment Center Label', 7, false, 'center'],
|
||||
HR(5, 17, 90),
|
||||
['t', 6, 20, 88, 5, 'SHIP TO / 送至亚马逊仓库', 6.5, false, 'left', '#666666'],
|
||||
['t', 6, 25, 88, 16, 'Amazon.com Services LLC\nFBA: ONT8\n1910 E Central Ave, San Bernardino, CA 92408\nUnited States', 8, true],
|
||||
HR(5, 44, 90),
|
||||
['t', 6, 47, 55, 5, 'FBA SHIPMENT ID / 货件编号', 6.5, false, 'left', '#666666'],
|
||||
['t', 6, 52, 55, 7, 'FBA15ABCDEFGH', 12, true],
|
||||
['t', 6, 60, 55, 5, 'Box: 1 of 3 Weight: 12.5 kg', 7.5],
|
||||
['t', 6, 65, 55, 5, 'Dimensions: 60×40×40 cm', 7.5],
|
||||
['t', 6, 70, 55, 5, 'Carrier: DHL / UPS / FedEx', 7.5],
|
||||
['t', 6, 75, 55, 5, 'Ship Date: 2026-10-15', 7.5],
|
||||
['q', 68, 47, 27, 'https://example.com/fba/FBA15ABCDEFGH'],
|
||||
HR(5, 90, 90),
|
||||
['t', 6, 93, 88, 5, '箱内明细 / Box Contents', 6.5, false, 'left', '#666666'],
|
||||
['t', 6, 98, 88, 14, 'SKU: SAMPLE-001 ASIN: B00EXAMPLE Qty: 20\nSKU: SAMPLE-002 ASIN: B00EXAMPLE2 Qty: 10', 7.5],
|
||||
HR(5, 128, 90),
|
||||
['b', 5, 131, 90, 15, 'FBA15ABCDEFGH', true],
|
||||
]),
|
||||
},
|
||||
|
||||
// ==================== 通用面单 ====================
|
||||
{
|
||||
key: 'tpl-express-100x180',
|
||||
name: '快递面单 100×180mm',
|
||||
group: '通用面单',
|
||||
make: () => build(100, 180, [
|
||||
['t', 5, 4, 90, 9, '示例快递 · 电子面单', 15, true, 'center'],
|
||||
['r', 5, 15, 90, 0.4, '#000000', '#000000', 0],
|
||||
@@ -93,6 +325,7 @@ export const templates: LabelTemplate[] = [
|
||||
{
|
||||
key: 'tpl-express-100x150',
|
||||
name: '快递面单 100×150mm',
|
||||
group: '通用面单',
|
||||
make: () => build(100, 150, [
|
||||
['t', 5, 4, 90, 8, '示例快递 · 电子面单', 13, true, 'center'],
|
||||
['r', 5, 13, 90, 0.4, '#000000', '#000000', 0],
|
||||
@@ -109,6 +342,7 @@ export const templates: LabelTemplate[] = [
|
||||
{
|
||||
key: 'tpl-small-76x130',
|
||||
name: '标准小面单 76×130mm',
|
||||
group: '通用面单',
|
||||
make: () => build(76, 130, [
|
||||
['t', 4, 3, 68, 7, '示例快递 · 电子面单', 11, true, 'center'],
|
||||
['r', 4, 11, 68, 0.4, '#000000', '#000000', 0],
|
||||
@@ -123,6 +357,7 @@ export const templates: LabelTemplate[] = [
|
||||
{
|
||||
key: 'tpl-logistics-100x60',
|
||||
name: '物流标签 100×60mm',
|
||||
group: '通用面单',
|
||||
make: () => build(100, 60, [
|
||||
['t', 4, 4, 66, 9, '货物名称:示例商品 × 2', 13, true],
|
||||
['t', 4, 15, 66, 8, '目的地:浙江省杭州市余杭区', 11],
|
||||
@@ -134,6 +369,7 @@ export const templates: LabelTemplate[] = [
|
||||
{
|
||||
key: 'tpl-price-60x40',
|
||||
name: '价格标签 60×40mm',
|
||||
group: '通用面单',
|
||||
make: () => build(60, 40, [
|
||||
['t', 3, 3, 54, 9, '商品名称(点击修改)', 12, true, 'center'],
|
||||
['t', 3, 12, 54, 13, '¥ 19.90', 19, true, 'center'],
|
||||
@@ -143,10 +379,27 @@ export const templates: LabelTemplate[] = [
|
||||
{
|
||||
key: 'tpl-blank-100x150',
|
||||
name: '空白画布 100×150mm',
|
||||
group: '通用面单',
|
||||
make: () => build(100, 150, []),
|
||||
},
|
||||
];
|
||||
|
||||
/** 模板栏的分组顺序 */
|
||||
export const TEMPLATE_GROUPS = ['国内快递', '国外快递', '通用面单'];
|
||||
|
||||
/** 按分组切分模板(保持 TEMPLATE_GROUPS 顺序,未知分组追加在后) */
|
||||
export function templatesByGroup(): { group: string; items: LabelTemplate[] }[] {
|
||||
const groups = [...TEMPLATE_GROUPS];
|
||||
for (const t of templates) {
|
||||
if (!groups.includes(t.group)) {
|
||||
groups.push(t.group);
|
||||
}
|
||||
}
|
||||
return groups
|
||||
.map(group => ({ group, items: templates.filter(t => t.group === group) }))
|
||||
.filter(g => g.items.length > 0);
|
||||
}
|
||||
|
||||
export function defaultDoc(): LabelDoc {
|
||||
return templates[0].make();
|
||||
}
|
||||
Reference in new issue
Block a user