From 4c081adacb5088011148773cf72e9ae01fa3e1d2 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期三, 27 十一月 2024 11:13:40 +0800 Subject: [PATCH] 解决双重遍历index定义重复bug --- src/views/system/tenantPackage/TenantPackageForm.vue | 3 + src/views/system/tenantPackage/index.vue | 80 +++++++++++++++++++-------------------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/src/views/system/tenantPackage/TenantPackageForm.vue b/src/views/system/tenantPackage/TenantPackageForm.vue index c8bec1f..476a1df 100644 --- a/src/views/system/tenantPackage/TenantPackageForm.vue +++ b/src/views/system/tenantPackage/TenantPackageForm.vue @@ -182,6 +182,9 @@ formData.value = { id: null, name: null, + icon: undefined, + labels: [], + description: null, remark: null, menuIds: [], status: CommonStatusEnum.ENABLE diff --git a/src/views/system/tenantPackage/index.vue b/src/views/system/tenantPackage/index.vue index e135ec5..254105b 100644 --- a/src/views/system/tenantPackage/index.vue +++ b/src/views/system/tenantPackage/index.vue @@ -55,51 +55,49 @@ <!-- 列表 --> <ContentWrap> - <el-row :gutter="20"> <div v-loading="loading" class="package-card" v-for="(item, index) in packages" :key="`dynamics-${index}`"> <el-col :span="6"> - <img class="card-icon" :src="item.icon" /> - <div class="card-middle"> - <div class="tenant-title">{{item.name}}</div> - <div class="tenant-operation"> - <el-dropdown @command="(command) => handleCommand(command, item)"> - <el-button type="primary" link><Icon icon="ep:more-filled" /> </el-button> - <template #dropdown> - <el-dropdown-menu> - <el-dropdown-item - command="handleUpdate" - v-if="checkPermi(['system:tenant-package:update'])" - > - <Icon icon="ep:edit" />修改 - </el-dropdown-item> - </el-dropdown-menu> - <el-dropdown-menu> - <el-dropdown-item - command="handleDelete" - v-if="checkPermi(['system:tenant-package:delete'])" - > - <Icon icon="ep:delete" />删除 - </el-dropdown-item> - </el-dropdown-menu> - </template> - </el-dropdown> + <img class="card-icon" :src="item.icon" /> + <div class="card-middle"> + <div class="tenant-title">{{item.name}}</div> + <div class="tenant-operation"> + <el-dropdown @command="(command) => handleCommand(command, item)"> + <el-button type="primary" link><Icon icon="ep:more-filled" /> </el-button> + <template #dropdown> + <el-dropdown-menu> + <el-dropdown-item + command="handleUpdate" + v-if="checkPermi(['system:tenant-package:update'])" + > + <Icon icon="ep:edit" />修改 + </el-dropdown-item> + </el-dropdown-menu> + <el-dropdown-menu> + <el-dropdown-item + command="handleDelete" + v-if="checkPermi(['system:tenant-package:delete'])" + > + <Icon icon="ep:delete" />删除 + </el-dropdown-item> + </el-dropdown-menu> + </template> + </el-dropdown> + </div> </div> - </div> - <div class="description">{{item.description}}</div> - <div class="label-areas"> - <el-tag - :disable-transitions="true" - :key="index" - v-for="(label, index) in item.labels" - :index="index" - class="label" - > - {{ label }} - </el-tag> - </div> - </el-col> + <div class="description">{{item.description}}</div> + <div class="label-areas"> + <el-tag + :disable-transitions="true" + :key="i" + v-for="(label, i) in item.labels" + :index="i" + class="label" + > + {{ label }} + </el-tag> + </div> + </el-col> </div> - </el-row> <!-- 分页 --> <Pagination :total="total" -- Gitblit v1.9.3