From b11f42efa83ee8ae35aead90facf8898ae7e2098 Mon Sep 17 00:00:00 2001 From: jokerxue <2509699647@qq.com> Date: Mon, 22 Jun 2026 16:03:31 +0800 Subject: [PATCH] 修改 --- 美国版/Food Labeling Management App UniApp/src/utils/labelPreview/normalizePreviewTemplate.ts | 10 ++++++++-- 美国版/Food Labeling Management App UniApp/src/utils/labelPreview/renderLabelPreviewCanvas.ts | 24 ++++++++++++++++-------- 美国版/Food Labeling Management App UniApp/src/utils/print/printOrientation.ts | 25 ------------------------- 美国版/Food Labeling Management App UniApp/src/utils/print/types/printer.ts | 6 +++--- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelTemplatePreviewDto.cs | 4 ---- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateCreateInputVo.cs | 4 ---- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateGetOutputDto.cs | 4 ---- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/ReportsPrintLogDailyLabelIdHelper.cs | 83 ----------------------------------------------------------------------------------- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/FlLabelTemplateDbEntity.cs | 10 +++++++--- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelAppService.cs | 25 ++++--------------------- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelTemplateAppService.cs | 153 +++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------ 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs | 33 ++++----------------------------- 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/scripts/fl_label_template_print_orientation.sql | 12 ------------ 美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx | 20 ++++++++++---------- 美国版/Food Labeling Management Platform/src/components/labels/LabelsList.tsx | 4 ---- 美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx | 22 ++++------------------ 美国版/Food Labeling Management Platform/src/types/labelTemplate.ts | 7 ++++++- 17 files changed, 95 insertions(+), 351 deletions(-) delete mode 100644 美国版/Food Labeling Management App UniApp/src/utils/print/printOrientation.ts delete mode 100644 美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/scripts/fl_label_template_print_orientation.sql diff --git a/美国版/Food Labeling Management App UniApp/src/utils/labelPreview/normalizePreviewTemplate.ts b/美国版/Food Labeling Management App UniApp/src/utils/labelPreview/normalizePreviewTemplate.ts index 51f6f45..1040090 100644 --- a/美国版/Food Labeling Management App UniApp/src/utils/labelPreview/normalizePreviewTemplate.ts +++ b/美国版/Food Labeling Management App UniApp/src/utils/labelPreview/normalizePreviewTemplate.ts @@ -1,5 +1,4 @@ import type { SystemLabelTemplate, SystemTemplateElementBase } from '../print/types/printer' -import { normalizePrintOrientation } from '../print/printOrientation' import { applyLiveDateTimeFieldsToTemplate, resolveTemplateDefaultValueForElement, @@ -428,6 +427,11 @@ function pickTemplateRootRecord (payload: Record): Record { const sorted = sortElementsForPreview(template.elements || []) - const printOrientation = normalizePrintOrientation(template.printOrientation) + const rotateContent = normalizeTemplatePrintOrientation(template.printOrientation) === 'horizontal' return new Promise((resolve) => { const ctx = uni.createCanvasContext(canvasId, componentInstance) ctx.setFillStyle('#ffffff') ctx.scale(scale, scale) ctx.fillRect(0, 0, cw, ch) - - const rotated = printOrientation === 'horizontal' - if (rotated) { + if (rotateContent) { ctx.save() - applyPrintOrientationCanvasTransform(ctx, cw, ch, printOrientation) + applyPrintContentRotation(ctx, cw, ch) } const drawRest = (index: number) => { if (index >= sorted.length) { + if (rotateContent) { + ctx.restore() + } strokeTemplatePaperBorder(ctx, template, cw, ch) - if (rotated) ctx.restore() ctx.draw(false, () => resolve()) return } diff --git a/美国版/Food Labeling Management App UniApp/src/utils/print/printOrientation.ts b/美国版/Food Labeling Management App UniApp/src/utils/print/printOrientation.ts deleted file mode 100644 index efadee0..0000000 --- a/美国版/Food Labeling Management App UniApp/src/utils/print/printOrientation.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type PrintOrientation = 'horizontal' | 'vertical' - -/** 与 Web normalizePrintOrientation 一致:默认竖打 */ -export function normalizePrintOrientation(raw: unknown): PrintOrientation { - const v = String(raw ?? '').trim().toLowerCase() - return v === 'horizontal' ? 'horizontal' : 'vertical' -} - -/** 横打时内容相对纸张旋转 90°(纸张 W×H 不变) */ -export function shouldRotatePrintContent(orientation: PrintOrientation): boolean { - return orientation === 'horizontal' -} - -/** 在 canvas 上应用模板级打印方向(与 Web printContentLayerStyle 一致) */ -export function applyPrintOrientationCanvasTransform( - ctx: UniApp.CanvasContext, - cw: number, - ch: number, - orientation: PrintOrientation, -): void { - if (!shouldRotatePrintContent(orientation)) return - ctx.translate(cw / 2, ch / 2) - ctx.rotate(Math.PI / 2) - ctx.translate(-cw / 2, -ch / 2) -} diff --git a/美国版/Food Labeling Management App UniApp/src/utils/print/types/printer.ts b/美国版/Food Labeling Management App UniApp/src/utils/print/types/printer.ts index c57559b..8b73cb2 100644 --- a/美国版/Food Labeling Management App UniApp/src/utils/print/types/printer.ts +++ b/美国版/Food Labeling Management App UniApp/src/utils/print/types/printer.ts @@ -63,8 +63,8 @@ export type LabelTemplateValue = string | number export type LabelTemplateData = Record export type PrinterTemplateUnit = 'inch' | 'mm' | 'cm' | 'px' export type SystemTemplateRotation = 'horizontal' | 'vertical' +export type SystemTemplatePrintOrientation = 'horizontal' | 'vertical' export type SystemTemplateTextAlign = 'left' | 'center' | 'right' -export type PrintOrientation = 'horizontal' | 'vertical' export interface SystemTemplateElementBase { id: string @@ -94,8 +94,8 @@ export interface SystemLabelTemplate { showGrid?: boolean /** 整标签外框:none / line / dotted */ border?: string - /** 模板打印方向:horizontal=横打(内容旋转90°),vertical=竖打(默认) */ - printOrientation?: PrintOrientation + /** vertical=竖打(默认);horizontal=横打(内容整体旋转 90°,纸张 W×H 不变) */ + printOrientation?: SystemTemplatePrintOrientation elements: SystemTemplateElementBase[] } diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelTemplatePreviewDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelTemplatePreviewDto.cs index cb69198..d9f9b10 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelTemplatePreviewDto.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelTemplatePreviewDto.cs @@ -40,10 +40,6 @@ public class LabelTemplatePreviewDto [JsonPropertyName("border")] public string Border { get; set; } = "none"; - /// 打印方向:vertical / horizontal - [JsonPropertyName("printOrientation")] - public string PrintOrientation { get; set; } = "vertical"; - [JsonPropertyName("elements")] public List Elements { get; set; } = new(); } diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateCreateInputVo.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateCreateInputVo.cs index 7b19f99..007ad91 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateCreateInputVo.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateCreateInputVo.cs @@ -60,10 +60,6 @@ public class LabelTemplateCreateInputVo [JsonPropertyName("border")] public string BorderType { get; set; } = "none"; - /// 打印方向:vertical / horizontal - [JsonPropertyName("printOrientation")] - public string PrintOrientationType { get; set; } = "vertical"; - /// /// 预留:前端可能不传;如果不传则默认 true /// diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateGetOutputDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateGetOutputDto.cs index 8b43dc4..42a96a9 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateGetOutputDto.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/LabelTemplate/LabelTemplateGetOutputDto.cs @@ -34,10 +34,6 @@ public class LabelTemplateGetOutputDto [JsonPropertyName("border")] public string BorderType { get; set; } = "none"; - /// 打印方向:vertical / horizontal - [JsonPropertyName("printOrientation")] - public string PrintOrientationType { get; set; } = "vertical"; - public int VersionNo { get; set; } public bool State { get; set; } diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/ReportsPrintLogDailyLabelIdHelper.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/ReportsPrintLogDailyLabelIdHelper.cs index 34e7f35..69fd9ce 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/ReportsPrintLogDailyLabelIdHelper.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/ReportsPrintLogDailyLabelIdHelper.cs @@ -1,4 +1,3 @@ -using System.Globalization; using FoodLabeling.Application.Services.DbModels; using SqlSugar; @@ -129,88 +128,6 @@ public static class ReportsPrintLogDailyLabelIdHelper return result; } - /// - /// App Print Log 单日筛选:解析 / 为服务器本地自然日。 - /// 两者均未传时返回 null(不按日过滤,兼容 App 未传 printDate 的历史行为)。 - /// - public static DateTime? ResolvePrintLogFilterCalendarDay(DateTime? printDate, string? printDateDay) - { - var text = printDateDay?.Trim(); - if (!string.IsNullOrWhiteSpace(text)) - { - if (DateTime.TryParseExact( - text, - "yyyy-MM-dd", - CultureInfo.InvariantCulture, - DateTimeStyles.None, - out var parsedExact)) - { - return parsedExact.Date; - } - - if (DateTime.TryParse( - text, - CultureInfo.InvariantCulture, - DateTimeStyles.AllowWhiteSpaces, - out var parsed)) - { - return parsed.Date; - } - - throw new Volo.Abp.UserFriendlyException("printDate 格式不正确,请使用 yyyy-MM-dd"); - } - - if (!printDate.HasValue) - { - return null; - } - - var value = printDate.Value; - return value.Kind == DateTimeKind.Utc ? value.ToLocalTime().Date : value.Date; - } - - /// - /// 按自然日过滤打印任务(MySQL DATE(IFNULL(PrintedAt, CreationTime)),避免 DateTime 区间比较时区偏差)。 - /// - public static ISugarQueryable ApplyPrintTaskCalendarDayFilter( - ISugarQueryable query, - DateTime filterDay) - { - var dayText = filterDay.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); - return query.Where("DATE(IFNULL(PrintedAt, CreationTime)) = @filterDay", new { filterDay = dayText }); - } - - /// - /// 多表 Join 查询按自然日过滤(首表别名 t)。 - /// - public static ISugarQueryable ApplyPrintTaskCalendarDayFilter( - ISugarQueryable query, - DateTime filterDay) - { - var dayText = filterDay.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); - return query.Where("DATE(IFNULL(t.PrintedAt, t.CreationTime)) = @filterDay", new { filterDay = dayText }); - } - - /// - /// 五表 Join(首表别名 t)。 - /// - public static ISugarQueryable ApplyPrintTaskCalendarDayFilter( - ISugarQueryable query, - DateTime filterDay) - { - var dayText = filterDay.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); - return query.Where("DATE(IFNULL(t.PrintedAt, t.CreationTime)) = @filterDay", new { filterDay = dayText }); - } - - /// - /// App Print Log 单日筛选:printDate 的自然日区间;未传则默认服务器当天。 - /// - public static (DateTime dayStart, DateTime dayEndExcl) ResolvePrintLogFilterDayRange(DateTime? printDate) - { - var day = ResolvePrintLogFilterCalendarDay(printDate, null) ?? DateTime.Today; - return (day, day.AddDays(1)); - } - public readonly struct PrintTaskScopeKey { public PrintTaskScopeKey(string taskId, string? locationId, DateTime printedAt) diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/FlLabelTemplateDbEntity.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/FlLabelTemplateDbEntity.cs index 06031ad..a3a1858 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/FlLabelTemplateDbEntity.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/FlLabelTemplateDbEntity.cs @@ -34,6 +34,12 @@ public class FlLabelTemplateDbEntity public string AppliedLocationType { get; set; } = "ALL"; + /// 适用 Company 范围:ALL / SPECIFIED(见 fl_label_template_partner) + public string AppliedPartnerType { get; set; } = "ALL"; + + /// 适用 Region 范围:ALL / SPECIFIED(见 fl_label_template_region) + public string AppliedRegionType { get; set; } = "ALL"; + public bool ShowRuler { get; set; } public bool ShowGrid { get; set; } @@ -41,10 +47,8 @@ public class FlLabelTemplateDbEntity /// 整标签外框:none / line / dotted public string BorderType { get; set; } = "none"; - /// 打印方向:vertical=竖打(默认),horizontal=横打(内容旋转90°,纸张尺寸不变) - public string PrintOrientationType { get; set; } = "vertical"; - public int VersionNo { get; set; } public bool State { get; set; } } + diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelAppService.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelAppService.cs index eddfd88..42f0385 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelAppService.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelAppService.cs @@ -298,8 +298,7 @@ public class LabelAppService : ApplicationService, ILabelAppService throw new UserFriendlyException("标签不存在"); } - var template = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var template = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => x.Id == label.TemplateId); var category = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => x.Id == label.LabelCategoryId); @@ -405,8 +404,7 @@ public class LabelAppService : ApplicationService, ILabelAppService input.LocationId, input.LocationIds); - var template = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var template = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => !x.IsDeleted && x.TemplateCode == input.TemplateCode.Trim()); if (template is null) { @@ -522,8 +520,7 @@ public class LabelAppService : ApplicationService, ILabelAppService input.LocationId, input.LocationIds); - var template = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var template = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => !x.IsDeleted && x.TemplateCode == input.TemplateCode.Trim()); if (template is null) { @@ -674,8 +671,7 @@ public class LabelAppService : ApplicationService, ILabelAppService } // 取模板头 & elements - var template = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var template = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => !x.IsDeleted && x.Id == label.TemplateId); if (template is null) { @@ -898,22 +894,9 @@ public class LabelAppService : ApplicationService, ILabelAppService ShowRuler = template.ShowRuler, ShowGrid = template.ShowGrid, Border = NormalizeTemplateBorderType(template.BorderType), - PrintOrientation = NormalizePrintOrientationType(template.PrintOrientationType), Elements = resolvedElements }; } - private static string NormalizeTemplateBorderType(string? raw) - { - var v = (raw ?? string.Empty).Trim().ToLowerInvariant(); - return v is "line" or "dotted" ? v : "none"; - } - - private static string NormalizePrintOrientationType(string? raw) - { - var v = (raw ?? string.Empty).Trim().ToLowerInvariant(); - return v == "horizontal" ? "horizontal" : "vertical"; - } - } diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelTemplateAppService.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelTemplateAppService.cs index 02534da..9b9baf3 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelTemplateAppService.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/LabelTemplateAppService.cs @@ -29,11 +29,10 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ public async Task> GetListAsync(LabelTemplateGetListInputVo input) { - input ??= new LabelTemplateGetListInputVo(); RefAsync total = 0; var keyword = input.Keyword?.Trim(); - var scopedLocationIds = await LocationScopeBindingHelper.ResolveFilteredLocationIdsForListAsync( - _dbContext.SqlSugarClient, input.PartnerId, input.GroupId, input.LocationId); + var scopedLocationIds = await LocationScopeBindingHelper.ResolveScopedLocationIdsAsync( + _dbContext.SqlSugarClient, input.GroupId, input.LocationId); var query = _dbContext.SqlSugarClient.Queryable() .Where(x => !x.IsDeleted) @@ -45,30 +44,25 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ query = await LabelTemplateScopeHelper.ApplyTemplateScopeFilterAsync( _dbContext.SqlSugarClient, query, scopedLocationIds); - query = ApplyLabelTemplateListSorting(query, input.Sorting); - query = LabelTemplateQueryHelper.ProjectListColumns(query); + query = !string.IsNullOrWhiteSpace(input.Sorting) + ? query.OrderBy(input.Sorting) + : query.OrderByDescending(x => x.LastModificationTime ?? x.CreationTime); - var pageSize = input.MaxResultCount <= 0 ? 10 : input.MaxResultCount; - var pageEntities = await query.ToPageListAsync(input.SkipCount, pageSize, total); + var pageEntities = await query.ToPageListAsync(input.SkipCount, input.MaxResultCount, total); var templateIds = pageEntities.Select(x => x.Id).ToList(); - var elementCountMap = new Dictionary(StringComparer.Ordinal); - if (templateIds.Count > 0) - { - var elementCounts = await _dbContext.SqlSugarClient.Queryable() - .Where(x => templateIds.Contains(x.TemplateId)) - .GroupBy(x => x.TemplateId) - .Select(x => new { TemplateId = x.TemplateId, Count = SqlFunc.AggregateCount(x.Id) }) - .ToListAsync(); - elementCountMap = elementCounts.ToDictionary(x => x.TemplateId, x => (int)x.Count); - } + // element count (Contents) + var elementCounts = await _dbContext.SqlSugarClient.Queryable() + .Where(x => templateIds.Contains(x.TemplateId)) + .GroupBy(x => x.TemplateId) + .Select(x => new { TemplateId = x.TemplateId, Count = SqlFunc.AggregateCount(x.Id) }) + .ToListAsync(); + var elementCountMap = elementCounts.ToDictionary(x => x.TemplateId, x => (int)x.Count); var scopeMap = await LabelTemplateScopeHelper.BuildScopeDisplayMapAsync( _dbContext.SqlSugarClient, pageEntities); - var itemsMap = templateIds.Count > 0 - ? await LabelTemplateListItemsHelper.ResolveTemplateItemsMapAsync( - _dbContext.SqlSugarClient, templateIds) - : new Dictionary(StringComparer.Ordinal); + var itemsMap = await LabelTemplateListItemsHelper.ResolveTemplateItemsMapAsync( + _dbContext.SqlSugarClient, templateIds); var items = pageEntities.Select(x => { @@ -103,69 +97,12 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ }; }).ToList(); - return BuildPagedResult(input.SkipCount, pageSize, total, items); - } - - /// - /// 列表排序:白名单字段 + IFNULL(LastModificationTime, CreationTime),避免 ?? 与原始 Sorting 拼接导致 SQL 异常。 - /// - private static ISugarQueryable ApplyLabelTemplateListSorting( - ISugarQueryable query, - string? sorting) - { - if (!string.IsNullOrWhiteSpace(sorting)) - { - var s = sorting.Trim(); - if (s.Equals("TemplateName asc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderBy(x => x.TemplateName); - } - - if (s.Equals("TemplateName desc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderByDescending(x => x.TemplateName); - } - - if (s.Equals("TemplateCode asc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderBy(x => x.TemplateCode); - } - - if (s.Equals("TemplateCode desc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderByDescending(x => x.TemplateCode); - } - - if (s.Equals("CreationTime asc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderBy(x => x.CreationTime); - } - - if (s.Equals("CreationTime desc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderByDescending(x => x.CreationTime); - } - - if (s.Equals("LastModificationTime asc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderBy(x => x.LastModificationTime); - } - - if (s.Equals("LastModificationTime desc", StringComparison.OrdinalIgnoreCase)) - { - return query.OrderByDescending(x => x.LastModificationTime); - } - } - - return query - .OrderBy(x => SqlFunc.IsNull(x.LastModificationTime, x.CreationTime), OrderByType.Desc) - .OrderBy(x => x.TemplateCode, OrderByType.Asc); + return BuildPagedResult(input.SkipCount, input.MaxResultCount, total, items); } public async Task GetAsync(string id) { - var template = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var template = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => !x.IsDeleted && x.TemplateCode == id); if (template is null) { @@ -243,12 +180,11 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ Width = template.Width, Height = template.Height, AppliedLocationType = template.AppliedLocationType, - AppliedPartnerType = LabelTemplateScopeHelper.ScopeAll, - AppliedRegionType = LabelTemplateScopeHelper.ScopeAll, + AppliedPartnerType = template.AppliedPartnerType, + AppliedRegionType = template.AppliedRegionType, ShowRuler = template.ShowRuler, ShowGrid = template.ShowGrid, BorderType = NormalizeTemplateBorderType(template.BorderType), - PrintOrientationType = NormalizePrintOrientationType(template.PrintOrientationType), VersionNo = template.VersionNo, State = template.State, Elements = MapElements(), @@ -273,8 +209,7 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ throw new UserFriendlyException("模板名称不能为空"); } - var duplicated = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var duplicated = await _dbContext.SqlSugarClient.Queryable() .AnyAsync(x => !x.IsDeleted && x.TemplateCode == code); if (duplicated) { @@ -301,10 +236,11 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ Width = input.Width, Height = input.Height, AppliedLocationType = scope.AppliedLocationType, + AppliedPartnerType = scope.AppliedPartnerType, + AppliedRegionType = scope.AppliedRegionType, ShowRuler = input.ShowRuler, ShowGrid = input.ShowGrid, BorderType = NormalizeTemplateBorderType(input.BorderType), - PrintOrientationType = NormalizePrintOrientationType(input.PrintOrientationType), VersionNo = 1, State = input.State }; @@ -324,20 +260,13 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ CurrentUser?.Id?.ToString(), now); - await LabelTemplateScopeSchemaHelper.SetAppliedScopeTypesAsync( - _dbContext.SqlSugarClient, - entity.Id, - scope.AppliedPartnerType, - scope.AppliedRegionType); - return await GetAsync(code); } [UnitOfWork] public async Task UpdateAsync(string id, LabelTemplateUpdateInputVo input) { - var template = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var template = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => !x.IsDeleted && x.TemplateCode == id); if (template is null) { @@ -348,8 +277,7 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ var name = input.TemplateName?.Trim(); if (!string.IsNullOrWhiteSpace(code) && !string.Equals(code, template.TemplateCode, StringComparison.OrdinalIgnoreCase)) { - var duplicated = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var duplicated = await _dbContext.SqlSugarClient.Queryable() .AnyAsync(x => !x.IsDeleted && x.TemplateCode == code); if (duplicated) { @@ -365,10 +293,11 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ template.Width = input.Width; template.Height = input.Height; template.AppliedLocationType = scope.AppliedLocationType; + template.AppliedPartnerType = scope.AppliedPartnerType; + template.AppliedRegionType = scope.AppliedRegionType; template.ShowRuler = input.ShowRuler; template.ShowGrid = input.ShowGrid; template.BorderType = NormalizeTemplateBorderType(input.BorderType); - template.PrintOrientationType = NormalizePrintOrientationType(input.PrintOrientationType); template.State = input.State; template.VersionNo = template.VersionNo + 1; template.LastModifierId = CurrentUser?.Id?.ToString(); @@ -393,20 +322,13 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ CurrentUser?.Id?.ToString(), template.LastModificationTime ?? DateTime.Now); - await LabelTemplateScopeSchemaHelper.SetAppliedScopeTypesAsync( - _dbContext.SqlSugarClient, - template.Id, - scope.AppliedPartnerType, - scope.AppliedRegionType); - return await GetAsync(template.TemplateCode); } [UnitOfWork] public async Task DeleteAsync(string id) { - var template = await LabelTemplateQueryHelper.ProjectListColumns( - _dbContext.SqlSugarClient.Queryable()) + var template = await _dbContext.SqlSugarClient.Queryable() .FirstAsync(x => !x.IsDeleted && x.TemplateCode == id); if (template is null) { @@ -433,15 +355,12 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ await _dbContext.SqlSugarClient.Deleteable() .Where(x => x.TemplateId == template.Id) .ExecuteCommandAsync(); - if (await LabelTemplateScopeSchemaHelper.HasPartnerRegionScopeTablesAsync(_dbContext.SqlSugarClient)) - { - await _dbContext.SqlSugarClient.Deleteable() - .Where(x => x.TemplateId == template.Id) - .ExecuteCommandAsync(); - await _dbContext.SqlSugarClient.Deleteable() - .Where(x => x.TemplateId == template.Id) - .ExecuteCommandAsync(); - } + await _dbContext.SqlSugarClient.Deleteable() + .Where(x => x.TemplateId == template.Id) + .ExecuteCommandAsync(); + await _dbContext.SqlSugarClient.Deleteable() + .Where(x => x.TemplateId == template.Id) + .ExecuteCommandAsync(); await _dbContext.SqlSugarClient.Deleteable() .Where(x => x.TemplateId == template.Id) .ExecuteCommandAsync(); @@ -617,11 +536,5 @@ public class LabelTemplateAppService : ApplicationService, ILabelTemplateAppServ var v = (raw ?? string.Empty).Trim().ToLowerInvariant(); return v is "line" or "dotted" ? v : "none"; } - - private static string NormalizePrintOrientationType(string? raw) - { - var v = (raw ?? string.Empty).Trim().ToLowerInvariant(); - return v == "horizontal" ? "horizontal" : "vertical"; - } } diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs index 96a7f1e..be42a9e 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs @@ -396,16 +396,12 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ } var previewProductId = await ResolvePreviewProductIdAsync(labelRow.Id, input.ProductId); - var baseTime = input.BaseTime ?? DateTime.Now; - var dailyLabelId = await ReportsPrintLogDailyLabelIdHelper.ResolveNextDailyLabelIdAsync( - _dbContext.SqlSugarClient, locationId, baseTime); var template = await _labelAppService.PreviewAsync(new LabelPreviewResolveInputVo { LabelCode = labelCode, ProductId = previewProductId, BaseTime = input.BaseTime, - LocationId = locationId, PrintInputJson = input.PrintInputJson?.ToDictionary(x => x.Key, x => (object?)x.Value) }); @@ -469,7 +465,7 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ return new UsAppLabelPreviewDto { - LabelId = dailyLabelId, + LabelId = labelRow.Id, PrintLabelDisplayId = printLabelDisplayId, LocationId = locationId, LabelCode = labelCode, @@ -572,7 +568,6 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ LabelCode = labelCode, ProductId = previewProductId, BaseTime = input.BaseTime, - LocationId = locationId, PrintInputJson = normalizedPrintInput }); @@ -861,7 +856,6 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ /// ```json /// { /// "locationId": "11111111-1111-1111-1111-111111111111", - /// "printDate": "2026-06-16T00:00:00", /// "skipCount": 1, /// "maxResultCount": 20 /// } @@ -869,7 +863,6 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ /// /// 参数说明: /// - locationId: 当前门店 Id(必填) - /// - printDate: 打印日期(自然日,可选;未传默认当天;按 PrintedAt ?? CreationTime 筛选) /// - skipCount: 页码(从 1 开始,遵循本项目约定) /// - maxResultCount: 每页条数 /// @@ -925,18 +918,8 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ RefAsync total = 0; - var filterDay = ReportsPrintLogDailyLabelIdHelper.ResolvePrintLogFilterCalendarDay( - input.PrintDate, input.PrintDateDay); - - var baseQuery = UsAppPrintLogScopeHelper.BuildLocationPrintTaskQuery( - _dbContext.SqlSugarClient, locationId, restrictToCreator, currentUserIdStr); - - if (filterDay.HasValue) - { - baseQuery = ReportsPrintLogDailyLabelIdHelper.ApplyPrintTaskCalendarDayFilter(baseQuery, filterDay.Value); - } - - var query = baseQuery + var query = UsAppPrintLogScopeHelper.BuildLocationPrintTaskQuery( + _dbContext.SqlSugarClient, locationId, restrictToCreator, currentUserIdStr) .OrderBy((t, l, p, lt, tpl) => SqlFunc.IsNull(t.PrintedAt, t.CreationTime), OrderByType.Desc) .OrderBy((t, l, p, lt, tpl) => t.CreationTime, OrderByType.Desc) .Select((t, l, p, lt, tpl) => new @@ -960,13 +943,6 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ var pageRows = await query.ToPageListAsync(input.SkipCount, input.MaxResultCount, total); - var dailyLabelIdMap = await ReportsPrintLogDailyLabelIdHelper.ResolveDailyLabelIdsAsync( - _dbContext.SqlSugarClient, - pageRows.Select(x => new ReportsPrintLogDailyLabelIdHelper.PrintTaskScopeKey( - x.Id, - locationId, - x.PrintedAt ?? x.CreationTime)).ToList()); - var operatorMap = await UsAppPrintLogScopeHelper.LoadOperatorNameMapAsync( _dbContext.SqlSugarClient, pageRows.Select(x => x.CreatedBy)); @@ -976,8 +952,7 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ TaskId = x.Id, BatchId = x.BatchId, CopyIndex = x.CopyIndex, - LabelId = dailyLabelIdMap.TryGetValue(x.Id, out var dailyId) ? dailyId : "无", - LabelEntityId = x.LabelId ?? string.Empty, + LabelId = x.LabelId, LabelCode = x.LabelCode ?? string.Empty, ProductId = x.ProductId, ProductName = string.IsNullOrWhiteSpace(x.ProductName) ? "无" : x.ProductName.Trim(), diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/scripts/fl_label_template_print_orientation.sql b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/scripts/fl_label_template_print_orientation.sql deleted file mode 100644 index 75c1c18..0000000 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/scripts/fl_label_template_print_orientation.sql +++ /dev/null @@ -1,12 +0,0 @@ --- fl_label_template 增加打印方向字段(vertical=竖打默认,horizontal=横打内容旋转90°) -SET @db = DATABASE(); - -SET @sql = IF( - (SELECT COUNT(*) FROM information_schema.COLUMNS - WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'fl_label_template' AND COLUMN_NAME = 'PrintOrientationType') = 0, - 'ALTER TABLE `fl_label_template` ADD COLUMN `PrintOrientationType` varchar(20) NOT NULL DEFAULT ''vertical'' COMMENT ''打印方向:vertical/horizontal'' AFTER `BorderType`', - 'SELECT ''PrintOrientationType already exists'' AS msg' -); -PREPARE stmt FROM @sql; -EXECUTE stmt; -DEALLOCATE PREPARE stmt; diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx index a7d3fdc..08754f6 100644 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx @@ -99,7 +99,7 @@ export function mapPointerDeltaToTemplateSpace( return { dx: dy, dy: -dx }; } -/** 根据指针位置与抓取偏移计算模板坐标(横打跟随视觉方向) */ +/** 根据指针位置与抓取偏移计算模板坐标(竖打跟随视觉方向) */ export function templatePositionFromPointerGrab( localX: number, localY: number, @@ -143,7 +143,7 @@ export function elementResizeDeltaFromPointer( return { dw, dh }; } -/** 将画布本地坐标系中的指针位移转为模板坐标系增量(横打已含 rotate 逆变换) */ +/** 将画布本地坐标系中的指针位移转为模板坐标系增量(竖打已含 rotate 逆变换) */ export function templatePointerDeltaFromCanvasLocals( startLocalX: number, startLocalY: number, @@ -316,7 +316,7 @@ function snapToGrid(value: number): number { /** 画布内安全边距(px),与主题色虚线框一致;控件不可移出 */ export const LABEL_CANVAS_SAFE_MARGIN_PX = 16; -/** 蓝色虚线安全区(固定在纸张坐标系,竖打时不随控件旋转) */ +/** 蓝色虚线安全区(固定在纸张坐标系,横打时不随控件旋转) */ function CanvasSafeMarginOverlay({ baseW, baseH }: { baseW: number; baseH: number }) { if (baseW <= LABEL_CANVAS_SAFE_MARGIN_PX * 2 || baseH <= LABEL_CANVAS_SAFE_MARGIN_PX * 2) { return null; @@ -602,9 +602,9 @@ function ElementSelectionFrame({ const heightLineX = heightOnLeft ? x - 12 : x + w + 12; const heightTextX = heightOnLeft ? heightLineX - 8 : heightLineX + 8; // 横打预览旋转后,屏幕上的横/竖跨度与模板宽/高对调,标注跟随视觉 - const isRotatedPrintPreview = printOrientation === 'horizontal'; - const displayWidthLabel = isRotatedPrintPreview ? hValue : wValue; - const displayHeightLabel = isRotatedPrintPreview ? wValue : hValue; + const isRotatedPrint = printOrientation === 'horizontal'; + const displayWidthLabel = isRotatedPrint ? hValue : wValue; + const displayHeightLabel = isRotatedPrint ? wValue : hValue; return ( <> @@ -1812,7 +1812,7 @@ export function LabelCanvas({ const widthPx = baseW * scale; const heightPx = baseH * scale; const showGrid = template.showGrid !== false; - const isRotatedPrintPreview = printOrientation === 'horizontal'; + const isRotatedPrint = printOrientation === 'horizontal'; const effectiveCanvasBorder = canvasBorder ?? template.border ?? 'none'; const canvasBorderClass = effectiveCanvasBorder === 'line' @@ -1990,7 +1990,7 @@ export function LabelCanvas({ baseW, baseH, ); - const resized = computeResizedElementBox(elX, elY, w, h, corner, dtx, dty, 'horizontal'); + const resized = computeResizedElementBox(elX, elY, w, h, corner, dtx, dty, printOrientation); const clamped = clampLabelElementBox( snapToGrid(resized.x), snapToGrid(resized.y), @@ -2183,7 +2183,7 @@ export function LabelCanvas({ baseW, baseH, ); - const resized = computeResizedElementBox(elX, elY, w, h, corner, dtx, dty, 'horizontal'); + const resized = computeResizedElementBox(elX, elY, w, h, corner, dtx, dty, printOrientation); const clamped = clampLabelElementBox( snapToGrid(resized.x), snapToGrid(resized.y), @@ -2688,7 +2688,7 @@ export function LabelCanvas({ tabIndex={0} className={cn( 'absolute left-0 top-0 shadow-lg outline-none', - isRotatedPrintPreview ? 'overflow-visible' : 'overflow-hidden', + isRotatedPrint ? 'overflow-visible' : 'overflow-hidden', canvasBorderClass, isPanning ? 'cursor-grabbing' : 'cursor-grab' )} diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelsList.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelsList.tsx index 653ab36..29f29a6 100755 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelsList.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelsList.tsx @@ -75,7 +75,6 @@ import { isDataEntryTableColumnElement, isDateTimeDataEntryField, labelElementsToApiPayload, - normalizePrintOrientation, normalizeTemplateBorder, sortTemplateElementsForDisplay, } from "../../types/labelTemplate"; @@ -592,9 +591,6 @@ function dtoToEditorTemplate(apiTemplate: LabelTemplateDto): LabelTemplate { showRuler: apiTemplate.showRuler ?? true, showGrid: apiTemplate.showGrid ?? true, border: normalizeTemplateBorder(apiTemplate.border), - printOrientation: normalizePrintOrientation( - apiTemplate.printOrientation ?? (apiTemplate as Record).PrintOrientation, - ), elements: (apiTemplate.elements ?? []).map((raw, idx) => { const el = raw as LabelElement; const en = (el.elementName ?? "").trim(); diff --git a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx index a4b96df..b0e3137 100755 --- a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx @@ -187,19 +187,10 @@ function normLocationId(id: string | null | undefined): string { return String(id ?? "").trim().toLowerCase(); } -function memberMatchesLocationScope( - m: TeamMemberDto, - allowedLocationIds: Set | null, - allowedPartnerId?: string | null, -): boolean { - if (allowedPartnerId) { - const partnerKey = allowedPartnerId.trim().toLowerCase(); - const partnerIds = (m.partnerIds ?? []).map((x) => String(x).trim().toLowerCase()); - if (partnerIds.includes(partnerKey)) return true; - } +function memberMatchesLocationScope(m: TeamMemberDto, allowedLocationIds: Set | null): boolean { if (allowedLocationIds === null) return true; if (allowedLocationIds.size === 0) return false; - const ids = (m.locationIds ?? []).map((x) => normLocationId(x)).filter(Boolean); + const ids = (m.locationIds ?? []).map((x) => String(x).trim()).filter(Boolean); return ids.some((id) => allowedLocationIds.has(id)); } @@ -584,7 +575,7 @@ export function PeopleView({ if (memberLocationFilter !== "all" || !memberUsesClientScopeFilter) return null; const ids = new Set(); for (const loc of memberLocationsForSelect) { - if (loc.id) ids.add(normLocationId(loc.id)); + if (loc.id) ids.add(loc.id); } return ids; }, [memberLocationFilter, memberUsesClientScopeFilter, memberLocationsForSelect]); @@ -781,14 +772,11 @@ export function PeopleView({ skipCount: 1, maxResultCount: 500, keyword: debouncedMemberKeyword || undefined, - partnerId: memberPartnerFilter !== "all" ? memberPartnerFilter : undefined, - groupId: memberGroupFilter !== "all" ? memberGroupFilter : undefined, }, ac.signal, ); - const allowedPartnerId = memberPartnerFilter !== "all" ? memberPartnerFilter : null; const filtered = (res.items ?? []).filter((m) => - memberMatchesLocationScope(m, memberAllowedLocationIds, allowedPartnerId), + memberMatchesLocationScope(m, memberAllowedLocationIds), ); const total = filtered.length; const start = (memberPageIndex - 1) * memberPageSize; @@ -800,8 +788,6 @@ export function PeopleView({ skipCount: Math.max(1, memberPageIndex), maxResultCount: memberPageSize, keyword: debouncedMemberKeyword || undefined, - partnerId: memberPartnerFilter !== "all" ? memberPartnerFilter : undefined, - groupId: memberGroupFilter !== "all" ? memberGroupFilter : undefined, locationId: locationIdParam, }, ac.signal, diff --git a/美国版/Food Labeling Management Platform/src/types/labelTemplate.ts b/美国版/Food Labeling Management Platform/src/types/labelTemplate.ts index 627b2d8..535e953 100644 --- a/美国版/Food Labeling Management Platform/src/types/labelTemplate.ts +++ b/美国版/Food Labeling Management Platform/src/types/labelTemplate.ts @@ -10,7 +10,7 @@ export type Unit = 'cm' | 'inch'; export type AppliedLocation = 'ALL' | 'SPECIFIED'; export type Rotation = 'horizontal' | 'vertical'; -/** 模板打印方向:横打 / 竖打(纸张 W×H 不变,横打时内容整体旋转 90° 打印) */ +/** 模板打印方向:vertical=竖打(默认,内容不旋转);horizontal=横打(纸张 W×H 不变,内容整体旋转 90°) */ export type PrintOrientation = 'horizontal' | 'vertical'; export function normalizePrintOrientation(raw: unknown): PrintOrientation { @@ -18,6 +18,11 @@ export function normalizePrintOrientation(raw: unknown): PrintOrientation { return v === 'horizontal' ? 'horizontal' : 'vertical'; } +/** 横打时内容层需整体旋转 90° */ +export function isRotatedPrintOrientation(orientation: PrintOrientation | string | undefined): boolean { + return normalizePrintOrientation(orientation) === 'horizontal'; +} + export type Border = 'none' | 'line' | 'dotted'; /** 归一化模板级整纸边框(与元素 border 字段语义相同,作用范围不同) */ -- libgit2 0.21.4