linwe
2023-11-12 b77cc2d2012ecb4b876538ac7aee3edac7db8a2f
subPackage/user/components/roleList.vue
@@ -1,14 +1,17 @@
<template>
   <view class="role-container">
      <view @click="activeRole(item)" v-for="(item, index) in roleData" :key="index" :class="item.active?'active':''">
      <view @click="enableRole(item)" v-for="(item, index) in roleData" :key="index" :class="item.active?'active':''">
         <view class="l">
            <u-icon :name="item.iconName"></u-icon>
            <u-icon :name="item.icon"   width="80rpx"  height="80rpx"></u-icon>
            <view class="role-name">
               {{item.roleName}}
            </view>
         </view>
         <view v-if="item.active" class="r">
         <!-- <view v-if="item.active" class="r">
            <u-icon name="checkmark" color="#2979ff"></u-icon>
         </view> -->
         <view v-if="item.id == currentId" class="r">
            <u-icon name="checkmark" color="#2979ff"></u-icon>
         </view>
      </view>
@@ -21,8 +24,12 @@
         roleData: {
            type: Array,
            default: () => []
         },
         currentId:{
            type:[Number,String]
         }
      },
      data() {
         return {}
      },
@@ -30,7 +37,7 @@
      methods: {
         //启用角色
         activeRole(item) {
         enableRole(item) {
            this.roleData.forEach(role => {
               if (role.id == item.id) {
                  role.active = true
@@ -52,11 +59,9 @@
         display: flex;
         justify-content: flex-start;
         align-items: center;
         margin-top: 16rpx;
         padding: 0 16rpx;
         background: #fff;
         height: 80rpx;
         margin:0 30rpx;
         padding:30rpx 0;
         border-bottom:1px solid #F5F5F5;
         .l {
            flex: 1;
            display: flex;