From decf15307162b1d21eee471aae9ae468feac931c Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Thu, 23 Feb 2023 02:22:32 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=BD=AF=E4=BB=B6=E5=8C=85=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- src/pages/repository/package/index.vue | 34 +++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/pages/repository/package/index.vue b/src/pages/repository/package/index.vue index aaeffa3..d92aa59 100644 --- a/src/pages/repository/package/index.vue +++ b/src/pages/repository/package/index.vue @@ -231,7 +231,39 @@ export default { this.isBatchEdit = true this.editVisible = true }, - + handleEditClass() { + if (this.pkgClass === '') { + this.$notification.error({ message: '请选择软件包类别' }) + return + } + let changePkgIds = [] + if (this.isBatchEdit) { + // 过滤不用改变的软件包类别 + changePkgIds = this.selectedRows.filter(item => item.classification !== this.pkgClass).map(item => item.id) + } else { + changePkgIds.push(this.selectRow.id) + } + if (changePkgIds.length === 0) { + this.selectedRowKeys = [] + this.selectedRows = [] + this.editVisible = false + this.$notification.success({ message: '修改软件包类别成功' }) + return + } + const params = { + pkgClass: this.pkgClass, + pkgIds: JSON.stringify(changePkgIds) + } + insertUserPkgPlan(params).then(res => { + if (res.code === 200) { + this.selectedRowKeys = [] + this.selectedRows = [] + this.changeClassification() + this.$notification.success({ message: '修改软件包类别成功' }) + this.editVisible = false + } + }) + } } } \ No newline at end of file -- Gitee