From 96b1ad39846511e4f2a5e05300b93ad0c11c1840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B0=8F=E6=98=8E?= <2966980@qq.com> Date: Thu, 16 Mar 2023 12:43:37 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96editNumber=EF=BC=9A=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=9C=AA=E5=8F=98=E5=8A=A8=E6=97=B6=E4=B8=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=88=B0=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邓小明 <2966980@qq.com> --- src/components/Catch/Table/columns/editNumber.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/Catch/Table/columns/editNumber.vue b/src/components/Catch/Table/columns/editNumber.vue index 74f4a44..3cc9385 100644 --- a/src/components/Catch/Table/columns/editNumber.vue +++ b/src/components/Catch/Table/columns/editNumber.vue @@ -4,7 +4,7 @@ :controls="false" @blur="changeNumber" size="mini" - style="width: 65%" + style="width: 85%" :min="1" :max="10000"/> @@ -26,8 +26,21 @@ export default { } } }, + data() { + return { + oldData: 0 + } + }, + created() { + this.oldData = this.$attrs.row[this.field] + }, methods: { changeNumber(e) { + let newData = this.$attrs.row[this.field] + if (this.oldData == newData) { + return false + } + this.oldData = newData const data = {} data[this.field] = this.$attrs.row[this.field] this.$http.put(this.table.apiRoute + '/' + this.$attrs.row.id, data) -- Gitee