Skip to content

Commit 5e9ceaa

Browse files
committed
fix: update joinpop component to use v-model:show and improve error handling for role fetching
1 parent f8d387d commit 5e9ceaa

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

src/assets/css/team/member/joinpop.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,23 @@
5454
}
5555
.u-item-avatar{
5656
.size(32px);
57+
.x;
58+
.dbi;
5759
// .y;
5860
// .pa;.lt(50%,10px);
5961
// transform:translateX(-50%);
6062
}
6163
.u-item-name{
6264
// .bold;
63-
.fz(12px);
65+
.fz(13px);
6466
.db;
6567
.nobreak;
6668
}
6769
.u-item-server{
6870
.db;
6971
.fz(12px);
7072
color:#999;
73+
margin-top: 4px;
7174
}
7275
}
7376
.m-team-joinpop-null{

src/components/team/member/joinpop.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
>全选</el-checkbox
1616
>
1717
<el-checkbox-group class="u-list" v-model="roles" @change="checkIsAll">
18-
<el-checkbox v-for="item in data" :label="item.ID" :key="item.ID" class="u-item" border>
18+
<el-checkbox v-for="item in data" :value="item.ID" :key="item.ID" class="u-item" border>
1919
<el-tooltip class="item" effect="dark" :content="item.note || item.name" placement="bottom">
2020
<div>
2121
<img class="u-item-avatar" :src="showAvatar(item.mount)" />
@@ -55,20 +55,22 @@ export default {
5555
isIndeterminate: false,
5656
};
5757
},
58-
model: {
59-
prop: "show",
60-
event: "switchJoinPop",
61-
},
6258
watch: {
6359
show: function (newval) {
6460
this.visible = newval;
6561
},
6662
visible: function (newval) {
67-
this.$emit("switchJoinPop", newval);
68-
if (newval) {
63+
this.$emit("update:show", newval);
64+
if (newval && this.team_id) {
6965
getMyPureRoles(this.team_id).then((res) => {
7066
this.data = res.data.data || [];
67+
}).catch((err) => {
68+
console.error("获取角色列表失败:", err);
69+
this.$message.error("获取角色列表失败,请稍后重试");
7170
});
71+
} else if (newval && !this.team_id) {
72+
console.error("team_id 未传入");
73+
this.$message.error("团队ID缺失");
7274
}
7375
},
7476
},

src/components/team/org/team_panel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</div>
4040

4141
<!-- 加入弹层 -->
42-
<joinpop title="加入团队" v-model="join_pop_visible" :team_id="team_id" />
42+
<joinpop title="加入团队" v-model:show="join_pop_visible" :team_id="team_id" />
4343
</div>
4444
</template>
4545

0 commit comments

Comments
 (0)