From 2f2e6923f7c422b5bf731966892b7e2c710f3c7d Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Mon, 18 Aug 2025 09:42:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E7=AD=89=E6=95=B0=E6=8D=AE=E8=AE=BE=E7=BD=AE=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../labelSetting/components/PropertyForm.vue | 206 +++++++++++++++++- .../labelSetting/components/PropertyPanel.vue | 6 +- .../labelSetting/components/ZPLPreview.vue | 5 +- 3 files changed, 204 insertions(+), 13 deletions(-) diff --git a/src/views/modules/labelSetting/components/PropertyForm.vue b/src/views/modules/labelSetting/components/PropertyForm.vue index b6c72d1..5c1c7aa 100644 --- a/src/views/modules/labelSetting/components/PropertyForm.vue +++ b/src/views/modules/labelSetting/components/PropertyForm.vue @@ -3,6 +3,14 @@
+ + + + + + + +
@@ -52,13 +60,170 @@
- -
- - 整数显示小数位数 - 千位分隔符 -
-
+ + + + + +
@@ -302,6 +467,12 @@ export default { components: { comShowLabelSerialInfo,/*标签内容流水号信息的組件*/ }, + mounted() { + // 初始化数据类型 + if (this.element.type === 'text' && !this.element.dataType) { + this.$set(this.element, 'dataType', 'text') + } + }, watch: { // 监听元素变化,确保文件输入框状态正确 'element.id'() { @@ -314,6 +485,27 @@ export default { } }, methods: { + onDataTypeChange(newType) { + // 重置相关设置 + if (newType === 'date') { + this.$set(this.element, 'dateExtractType', 'full') + this.$set(this.element, 'dateFormat', 'ymd') + this.$set(this.element, 'dateSeparator', '-') + this.$set(this.element, 'yearDigits', '4') + this.$set(this.element, 'monthDayDigits', '2') + this.$set(this.element, 'firstWeekDate', '') + this.$set(this.element, 'firstDayOfWeek', '1') + } else if (newType === 'string') { + this.$set(this.element, 'stringProcessType', 'none') + this.$set(this.element, 'substringStartLength', '') + this.$set(this.element, 'substringEndLength', '') + this.$set(this.element, 'splitCharacter', '') + this.$set(this.element, 'splitIndex', '0') + this.$set(this.element, 'replaceFrom', '') + this.$set(this.element, 'replaceTo', '') + } + }, + handleSelectImage() { // 确保文件输入框被重置,然后触发点击 if (this.$refs.fileInput) { diff --git a/src/views/modules/labelSetting/components/PropertyPanel.vue b/src/views/modules/labelSetting/components/PropertyPanel.vue index c557099..276f850 100644 --- a/src/views/modules/labelSetting/components/PropertyPanel.vue +++ b/src/views/modules/labelSetting/components/PropertyPanel.vue @@ -85,11 +85,11 @@ export default { this.$set(this.selectedElement, 'previewUrl', imageData.previewUrl) } }, - + handleAutoSave(callback) { // 触发保存事件到最顶层的LabelDesigner组件 this.$emit('save') - + // 模拟保存完成(实际应该等待保存API返回) setTimeout(() => { if (callback && callback.success) { @@ -160,7 +160,7 @@ export default { .property-form { flex: 0 0 auto; - max-height: 250px; + max-height: 380px; overflow-y: auto; } diff --git a/src/views/modules/labelSetting/components/ZPLPreview.vue b/src/views/modules/labelSetting/components/ZPLPreview.vue index 426548f..b2241db 100644 --- a/src/views/modules/labelSetting/components/ZPLPreview.vue +++ b/src/views/modules/labelSetting/components/ZPLPreview.vue @@ -25,7 +25,7 @@