From 66a31c8d63f40da3abc1230a5dba2470c3fb9982 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 2 Jan 2024 12:19:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A5=E6=9C=9F=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8=E8=AE=BE=E7=BD=AE=E5=BF=85=E5=A1=AB=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BD=AE=E7=A9=BA=E5=90=8E=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeDate.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/frontend/src/components/widget/deWidget/DeDate.vue b/core/frontend/src/components/widget/deWidget/DeDate.vue index 86cc6fd680..ecac34c02d 100644 --- a/core/frontend/src/components/widget/deWidget/DeDate.vue +++ b/core/frontend/src/components/widget/deWidget/DeDate.vue @@ -422,10 +422,19 @@ export default { this.$refs.dateRef.hidePicker() } }, + textSame(str1, str2) { + if (str1 === null && str2 === null) { + return true + } + if (str1 !== null && str2 !== null && typeof str1 !== 'undefined' && typeof str2 !== 'undefined') { + return str1.toString() === str2.toString() + } + return false + }, resetDefaultValue(ele) { const id = ele.id const eleVal = ele.options.value.toString() - if (this.inDraw && this.manualModify && this.element.id === id && this.values.toString() !== eleVal && this.defaultValueStr === eleVal) { + if (this.inDraw && this.manualModify && this.element.id === id && !this.textSame(this.values, eleVal) && this.textSame(this.defaultValueStr, eleVal)) { if (!this.element.options.attrs.default.isDynamic) { this.values = this.fillValueDerfault() this.dateChange(this.values)