From fb4da34544f54e89b7fe87540cefa8b7fafb48a7 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Sat, 29 Mar 2025 09:29:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=89=93=E5=8D=B0=E6=9C=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AD=97=E7=AC=A6=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/devices/config/edit.ts | 6 ++++-- src/views/devices/printer.vue | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/devices/config/edit.ts b/src/views/devices/config/edit.ts index 9f23b2d..2f17ebf 100644 --- a/src/views/devices/config/edit.ts +++ b/src/views/devices/config/edit.ts @@ -16,8 +16,10 @@ const modalConfig: IModalConfig = { formAction: function (data) { let obj = { ...data } obj.printType = data.printType.join(',') - obj.categoryIds = JSON.stringify(data.categoryIdsArr) - obj.categoryList = JSON.stringify(data.categoryIdsArr) + if (data.categoryIdsArr) { + obj.categoryIds = JSON.stringify(data.categoryIdsArr) + obj.categoryList = JSON.stringify(data.categoryIdsArr) + } return printerApi.edit(obj); }, beforeSubmit(data) { diff --git a/src/views/devices/printer.vue b/src/views/devices/printer.vue index a0ccb7a..e7b4b1b 100644 --- a/src/views/devices/printer.vue +++ b/src/views/devices/printer.vue @@ -128,6 +128,7 @@ async function handleEditClick(row: IObject) { // 根据id获取数据进行填充 let data = await UserAPI.get(row.id); data.printType = data.printType.split(','); + if (data.categoryIds) { data.categoryIdsArr = JSON.parse(data.categoryIds) } From 849f7a6fbadd8fdd3b90391251da72d3ae655ec5 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Sat, 29 Mar 2025 17:14:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/mycomponents/addImg.vue | 1 + .../addImgconfig/imageComponent.vue | 25 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/mycomponents/addImg.vue b/src/components/mycomponents/addImg.vue index d027f2e..cb405da 100644 --- a/src/components/mycomponents/addImg.vue +++ b/src/components/mycomponents/addImg.vue @@ -113,6 +113,7 @@ export default { }, Confirm() { this.dialogVisible = false + console.log(1111111111111, this.selectImage) this.$emit('successEvent', this.selectImage) }, handleBeforeRemove(file, fileList) { diff --git a/src/components/mycomponents/addImgconfig/imageComponent.vue b/src/components/mycomponents/addImgconfig/imageComponent.vue index f23f8d6..01c3ecd 100644 --- a/src/components/mycomponents/addImgconfig/imageComponent.vue +++ b/src/components/mycomponents/addImgconfig/imageComponent.vue @@ -16,7 +16,7 @@ @@ -35,6 +35,7 @@ export default { showUpload: false, selectList: [], fileList: [], + loadings: false } }, mounted() { @@ -44,14 +45,20 @@ export default { this.showUpload = true; }, async doSubmit() { - let res = await API.add({ - pictureClassifyId: this.activedata, - urls: this.fileList - }) - if (res.code == 200) { - this.showUpload = false; - this.fileList = [] - this.$emit('getList') + if (this.fileList.length) { + this.loadings = true + let res = await API.add({ + pictureClassifyId: this.activedata, + urls: this.fileList + }) + if (res.code == 200) { + this.loadings = false + this.showUpload = false; + this.fileList = [] + this.$emit('getList') + } + } else { + } }, deleteImg(d) {