From 0234cbca725a95567b123dab0e72c86ee9f2d5e0 Mon Sep 17 00:00:00 2001 From: jokerxue <2509699647@qq.com> Date: Mon, 13 Jul 2026 10:49:41 +0800 Subject: [PATCH] 同步优化 --- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/en-US/foodLabeling.json | 31 +++++++++++++++++++++---------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/zh-CN/foodLabeling.json | 31 +++++++++++++++++++++---------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/data-entry/index.vue | 2 +- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/element-content.vue | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/elements-panel.vue | 71 ++++++++++++++++++++--------------------------------------------------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/index.vue | 296 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/label-canvas.vue | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/properties-panel.vue | 482 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/labels/data.ts | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/labels/label-modal.vue | 273 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/labels/label-template-input-panel.vue | 12 ++++++------ 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/labels/use-label-lookups.ts | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------- 泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/shared/invert-colors.ts | 12 +++++++++++- 美国版/Food Labeling Management App UniApp/src/utils/apiBase.ts | 4 ++-- 美国版/Food Labeling Management Platform/.env.local | 4 ++-- 美国版/Food Labeling Management Platform/build/assets/index-BGlBsk9e.js | 526 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 美国版/Food Labeling Management Platform/build/index.html | 2 +- 17 files changed, 1801 insertions(+), 329 deletions(-) create mode 100644 美国版/Food Labeling Management Platform/build/assets/index-BGlBsk9e.js diff --git a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/en-US/foodLabeling.json b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/en-US/foodLabeling.json index c221a5f..8cb5158 100644 --- a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/en-US/foodLabeling.json +++ b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/en-US/foodLabeling.json @@ -40,16 +40,27 @@ "productCategory": "Product Category", "labelType": "Label Type", "template": "Template", - "status": "Status", - "lastEdited": "Last Edited", - "keyword": "Keyword", - "selectProduct": "Select product", - "selectLocation": "Select location", - "selectCategory": "Select label category", - "selectType": "Select label type", - "selectTypeOptional": "Optional — select label type", - "selectTemplate": "Select template", - "action": "Actions", + "status": "Status", + "lastEdited": "Last Edited", + "keyword": "Keyword", + "company": "Company", + "applicableRegion": "Applicable Region", + "selectProduct": "Select product", + "selectLocation": "Select location", + "selectCategory": "Select label category", + "selectType": "Select label type", + "selectTypeOptional": "Optional — select label type", + "selectTemplate": "Select template", + "selectCompany": "Select company", + "selectCompanyFirst": "Select company first", + "selectRegion": "Select region", + "selectCompanyRegionFirst": "Select company and region first", + "selectProductCategory": "Select product category", + "companyRequired": "Please select a company.", + "regionRequired": "Please select an applicable region.", + "productCategoryRequired": "Please select a product category.", + "productRequired": "Please select a product.", + "action": "Actions", "labelCodeOptional": "Leave empty to auto-generate", "deleteConfirm": "Delete this label?", "bulkAdd": "Bulk Add", diff --git a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/zh-CN/foodLabeling.json b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/zh-CN/foodLabeling.json index 1d62726..f1c5d58 100644 --- a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/zh-CN/foodLabeling.json +++ b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/locales/langs/zh-CN/foodLabeling.json @@ -40,16 +40,27 @@ "productCategory": "产品分类", "labelType": "标签类型", "template": "模板", - "status": "状态", - "lastEdited": "最后编辑", - "keyword": "关键字", - "selectProduct": "选择产品", - "selectLocation": "选择门店", - "selectCategory": "选择标签分类", - "selectType": "选择标签类型", - "selectTypeOptional": "可选,选择标签类型", - "selectTemplate": "选择模板", - "action": "操作", + "status": "状态", + "lastEdited": "最后编辑", + "keyword": "关键字", + "company": "公司", + "applicableRegion": "适用区域", + "selectProduct": "选择产品", + "selectLocation": "选择门店", + "selectCategory": "选择标签分类", + "selectType": "选择标签类型", + "selectTypeOptional": "可选,选择标签类型", + "selectTemplate": "选择模板", + "selectCompany": "选择公司", + "selectCompanyFirst": "请先选择公司", + "selectRegion": "选择区域", + "selectCompanyRegionFirst": "请先选择公司和区域", + "selectProductCategory": "选择产品分类", + "companyRequired": "请选择公司。", + "regionRequired": "请选择适用区域。", + "productCategoryRequired": "请选择产品分类。", + "productRequired": "请选择产品。", + "action": "操作", "labelCodeOptional": "留空则由后端生成", "deleteConfirm": "确认删除该标签吗?", "bulkAdd": "批量新增", diff --git a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/data-entry/index.vue b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/data-entry/index.vue index 4c2c2a7..d82f355 100644 --- a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/data-entry/index.vue +++ b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/data-entry/index.vue @@ -309,7 +309,7 @@ async function loadData() { labelTypeList({ SkipCount: 1, MaxResultCount: 500 }), ]); templateTitle.value = - (tpl.templateName ?? tpl.name ?? tpl.templateCode ?? tpl.id ?? '').trim() || templateCode.value; + (tpl.name ?? tpl.templateName ?? tpl.templateCode ?? tpl.id ?? '').trim() || templateCode.value; partners.value = partnerRes?.items ?? []; groups.value = groupRes?.items ?? []; locations.value = locRes?.items ?? []; diff --git a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/element-content.vue b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/element-content.vue index 0c932f0..039ec33 100644 --- a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/element-content.vue +++ b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/element-content.vue @@ -13,7 +13,18 @@ import { isPrintInputElement, readLabelEditorFontFamilyChoice, } from '../../../shared/label-template/label-template-model'; -import { elementRotationDegrees } from '../../../shared/text-element-layout'; +import { + elementRotationDegrees, + readFontStyle, + readFontWeight, + readTextDecoration, + readVerticalAlign, +} from '../../../shared/text-element-layout'; +import { + INVERT_COLORS_BG, + INVERT_COLORS_FG, + readInvertColors, +} from '../../../shared/invert-colors'; import NutritionFactsPanel from './nutrition-facts-panel.vue'; import { normalizeBarcodeType, @@ -38,15 +49,34 @@ const cfg = computed(() => (props.element.config ?? {}) as Record canonicalElementType(props.element.type)); const rotationDegrees = computed(() => elementRotationDegrees(props.element)); const isVertical = computed(() => rotationDegrees.value === -90 || rotationDegrees.value === 90); +const inverted = computed(() => readInvertColors(cfg.value)); + +function verticalJustify(align: string): CSSProperties['justifyContent'] { + if (align === 'center') return 'center'; + if (align === 'bottom') return 'flex-end'; + return 'flex-start'; +} const commonStyle = computed((): CSSProperties => ({ fontSize: `${(cfg.value.fontSize as number) ?? 14}px`, - fontFamily: (cfg.value.fontFamily as string) ?? 'Arial', - fontWeight: (cfg.value.fontWeight as string) ?? 'normal', + fontFamily: readLabelEditorFontFamilyChoice(cfg.value), + fontWeight: readFontWeight(cfg.value), + fontStyle: readFontStyle(cfg.value), + textDecoration: readTextDecoration(cfg.value), textAlign: (cfg.value.textAlign as CSSProperties['textAlign']) ?? 'left', - color: (cfg.value.color as string) ?? '#000', + color: inverted.value ? INVERT_COLORS_FG : ((cfg.value.color as string) ?? '#000'), + backgroundColor: inverted.value ? INVERT_COLORS_BG : undefined, +})); + +const textBoxStyle = computed((): CSSProperties => ({ + ...commonStyle.value, + justifyContent: verticalJustify(readVerticalAlign(cfg.value)), })); +const invertedInputClass = computed(() => + inverted.value ? 'border-black bg-black text-white placeholder:text-gray-300' : '', +); + const textRotationStyle = computed((): CSSProperties => { const textLike = type.value === 'TEXT_STATIC' || @@ -298,7 +328,7 @@ const nutritionFontFamily = computed(() => readLabelEditorFontFamilyChoice(cfg.v
{{ textStaticDisplay }}
@@ -307,7 +337,7 @@ const nutritionFontFamily = computed(() => readLabelEditorFontFamilyChoice(cfg.v type="number" readonly class="pointer-events-none h-full w-full min-w-0 rounded border px-1" - :class="inputSurfaceClass" + :class="[inputSurfaceClass, invertedInputClass]" :value="String(cfg.text ?? '0')" :style="{ ...commonStyle, ...textRotationStyle, textAlign: 'right' }" /> @@ -316,15 +346,15 @@ const nutritionFontFamily = computed(() => readLabelEditorFontFamilyChoice(cfg.v type="text" readonly class="pointer-events-none h-full w-full min-w-0 rounded border px-1" - :class="inputSurfaceClass" + :class="[inputSurfaceClass, invertedInputClass]" :value="String(cfg.text ?? 'Text')" :style="{ ...commonStyle, ...textRotationStyle }" />
{{ textStaticDisplay }}
@@ -333,8 +363,8 @@ const nutritionFontFamily = computed(() => readLabelEditorFontFamilyChoice(cfg.v
{{ String(cfg.text ?? (type === 'TEXT_PRODUCT' ? 'Product name' : '0.00')) }}
@@ -403,7 +433,7 @@ const nutritionFontFamily = computed(() => readLabelEditorFontFamilyChoice(cfg.v readonly value="2025-02-01" class="pointer-events-none h-full w-full min-w-0 rounded border px-1 text-[10px]" - :class="inputSurfaceClass" + :class="[inputSurfaceClass, invertedInputClass]" :style="{ ...commonStyle, ...rotateBoxStyle }" />
diff --git a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/elements-panel.vue b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/elements-panel.vue index 9f09128..afaf128 100644 --- a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/elements-panel.vue +++ b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/elements-panel.vue @@ -108,43 +108,10 @@ const emit = defineEmits<{ openInstruction: []; }>(); -function sectionStyle(title: string): Record { - const t = title.trim().toLowerCase(); - if (t === 'template') { - return { - backgroundColor: '#dbeafe', - border: '1px solid #93c5fd', - borderRadius: '8px', - padding: '8px', - }; - } - if (t === 'label') { - return { - backgroundColor: '#e0f2fe', - border: '1px solid #7dd3fc', - borderRadius: '8px', - padding: '8px', - }; - } - if (t === 'auto-generated') { - return { - backgroundColor: '#ede9fe', - border: '1px solid #c4b5fd', - borderRadius: '8px', - padding: '8px', - }; - } - if (t === 'print input') { - return { - backgroundColor: '#ffedd5', - border: '1px solid #fdba74', - borderRadius: '8px', - padding: '8px', - }; - } +function sectionStyle(): Record { return { - backgroundColor: '#f1f5f9', - border: '1px solid #cbd5e1', + backgroundColor: 'transparent', + border: '1px solid #93c5fd', borderRadius: '8px', padding: '8px', }; @@ -154,28 +121,18 @@ function sectionStyle(title: string): Record { diff --git a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/index.vue b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/index.vue index 14d8e49..dfbdd55 100644 --- a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/index.vue +++ b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/index.vue @@ -109,6 +109,16 @@ const printOrientation = computed( () => normalizePrintOrientation(template.value.printOrientation), ); const templateBorder = computed(() => template.value.border ?? 'none'); +const configRowClass = 'flex min-w-0 flex-wrap items-center gap-2'; +const templateFieldClass = + 'flex h-8 min-w-0 items-stretch overflow-hidden rounded-md border border-gray-300 bg-white'; +const templateFieldLabelClass = + 'flex shrink-0 items-center border-r border-gray-300 bg-gray-100 px-2 text-xs font-medium text-gray-700 whitespace-nowrap'; +const templateFieldControlClass = 'flex min-h-0 min-w-0 flex-1 items-center'; +const templateFieldInputClass = + 'h-full min-h-0 w-full min-w-0 border-0 bg-transparent px-2 text-xs shadow-none'; +const templateFieldSuffixClass = + 'flex shrink-0 items-center border-l border-gray-300 bg-gray-50 px-2 text-xs text-gray-500'; const selectedElement = computed(() => { const el = template.value.elements.find((item) => item.id === selectedId.value) ?? null; @@ -453,7 +463,8 @@ function updateElement(id: string, patch: Partial) { patch.height !== undefined || patch.rotation !== undefined; if (!geomTouched) return merged; - if (readElementRotation(merged) === 'vertical' && merged.width > merged.height) { + const mergedRotation = readElementRotation(merged); + if ((mergedRotation === 'vertical' || mergedRotation === 'right') && merged.width > merged.height) { merged = canonicalElementGeometry(merged); } const c = clampLabelElementBox( @@ -664,138 +675,177 @@ function goBack() {
-
-
- - -
+
+
+
+ Name: +
+ +
+
-
- -
- - W - - H - - +
+ Unit: +
+ +
-
-
- - - -
+
+ W: +
+ +
+ {{ template.unit === 'inch' ? 'in' : 'cm' }} +
-
- - -
+
+ H: +
+ +
+ {{ template.unit === 'inch' ? 'in' : 'cm' }} +
-
- - +
+ Size Preset: +
+ +
+
+ +
+ Starter Template: +
+ + +
+
+ +
+ Border: +
+ +
+
-
- - +
+ Rotation: +
+ +
+
+ +
+ Template Code: +
+ +
+
+ + + Loading company, region and location... + +
- -
- - Loading company, region and location… - - -
diff --git a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/label-canvas.vue b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/label-canvas.vue index f6e1567..06d7ab5 100644 --- a/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/label-canvas.vue +++ b/泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/apps/web-antd/src/views/food-labeling/labeling/label-templates/editor/label-canvas.vue @@ -1,4 +1,4 @@ - + -- libgit2 0.21.4