From ef528a295242f5bad2988742615c8912acab5e4f Mon Sep 17 00:00:00 2001 From: 15386982806 Date: Mon, 27 May 2024 16:41:34 +0800 Subject: [PATCH] =?UTF-8?q?OSS=E8=B5=84=E6=BA=90=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/sys/oss-manage/ossManage.vue | 72 +++++++++++-------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/manager/src/views/sys/oss-manage/ossManage.vue b/manager/src/views/sys/oss-manage/ossManage.vue index f1f1269a..0582d6cc 100644 --- a/manager/src/views/sys/oss-manage/ossManage.vue +++ b/manager/src/views/sys/oss-manage/ossManage.vue @@ -387,7 +387,7 @@ > {}}}), - h("DropdownMenu", {slot: "list" - }, [ - h("DropdownItem", { nativeOn:{click: () => {this.handleContextMenuEdit()}} }, "编辑"), - h("DropdownItem", { nativeOn:{click: () => {this.handleContextMenuDelete()}} }, "删除"), - ]) - ]), - ]) - ]); + if (data.value === '0') { + return h('span', {style: {display: 'inline-block', width: '100%'}}, + [ + h('span', [h("Icon", {type: 'ios-paper-outline', style: {marginRight: '8px'}}), h('span', data.title)]), + h('span', {style: {display: 'inline-block', float: 'right', marginRight: '10px'}}, []) + ] + ); + } else { + return h('span', {style: {display: 'inline-block', width: '100%'}}, + [ + h('span', [h("Icon", {type: 'ios-paper-outline', style: {marginRight: '8px'}}), h('span', data.title)]), + h('span', {style: {display: 'inline-block', float: 'right', marginRight: '10px'}}, + [ + h("Dropdown", {style: {marginLeft: "4px"}}, + [ + h("Icon", {props: {type: 'ios-more', size: "20",}, style: {display: 'inline-block'}, on:{click: () => {}}}), + h("DropdownMenu", {slot: "list" + }, [ + h("DropdownItem", { nativeOn:{click: () => {this.handleContextMenuEdit(root, node, data)}} }, "编辑"), + h("DropdownItem", { nativeOn:{click: () => {this.handleContextMenuDelete()}} }, "删除"), + ]) + ]), + ]) + ] + ); + } + }, @@ -927,17 +944,14 @@ export default { this.selectedGroupData = val; }, // 编辑分组 - handleContextMenuEdit(val) { + handleContextMenuEdit(root, node, data) { this.insertOrUpdate = "update"; - this.enableGroup = true; - // this.groupFormValidate = this.selectedGroupData; - - this.groupFormValidate.directoryName = this.selectedGroupData.title; - this.groupFormValidate.id = [this.selectedGroupData.value]; - this.groupFormValidate.level = this.selectedGroupData.level; - - this.groupFormValidate.parentId = this.selectedGroupData.parentId; + this.groupFormValidate.directoryName = data.label; + this.groupFormValidate.id = [data.value]; + this.groupFormValidate.level = data.level; + this.groupFormValidate.parentId = data.parentId; + this.defaultValue = [data.parentId]; }, // 删除分组 async handleContextMenuDelete(val) { @@ -969,15 +983,13 @@ export default { if (valid) { let res const params = { ...this.groupFormValidate }; - if (this.insertOrUpdate === "insert") { - // params.directoryType = this.selectedGroupData.directoryType params.parentId = params.id[params.id.length - 1]; - // params.type = this.selectedGroupData.type delete params.id; res = await addFileDirectory(params); } else { params.id = params.id[params.id.length - 1]; + params.parentId = params.parentId[params.parentId.length - 1]; res = await updateFileDirectory(params); }