Skip to content

Commit d7bea04

Browse files
committed
feat: improve UI and functionality across team raid and snapshot components
1 parent 788ba60 commit d7bea04

13 files changed

Lines changed: 124 additions & 46 deletions

File tree

src/assets/css/team/dkp/dkp_list.less

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
--el-table-header-bg-color: @team-surface-muted;
1818
--el-table-row-hover-bg-color: #fafbff;
1919

20-
th.el-table__cell {
20+
:deep(th.el-table__cell) {
2121
height: 44px;
2222
padding: 0;
2323
background: @team-surface-muted;
@@ -27,9 +27,24 @@
2727
text-align: left;
2828
}
2929

30-
td.el-table__cell {
30+
:deep(td.el-table__cell) {
3131
height: 58px;
3232
padding: 6px 0;
33+
vertical-align: middle;
34+
}
35+
36+
:deep(th.el-table__cell > .cell),
37+
:deep(td.el-table__cell > .cell) {
38+
display: flex;
39+
align-items: center;
40+
}
41+
42+
:deep(th.el-table__cell > .cell) {
43+
min-height: 44px;
44+
}
45+
46+
:deep(td.el-table__cell > .cell) {
47+
min-height: 46px;
3348
}
3449

3550
.u-character-logo {

src/assets/css/team/dkp/dkp_logs.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,23 @@
102102
td.el-table__cell {
103103
height: 58px;
104104
padding: 6px 0;
105+
vertical-align: middle;
105106
}
106107

107108
.cell {
109+
display: flex;
110+
align-items: center;
108111
line-height: 28px;
109112
}
110113

114+
th.el-table__cell > .cell {
115+
min-height: 44px;
116+
}
117+
118+
td.el-table__cell > .cell {
119+
min-height: 46px;
120+
}
121+
111122
.u-character-logo {
112123
width: 28px;
113124
height: 28px;

src/assets/css/team/raid/form_dialog.less

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,8 @@
109109
margin-bottom: @team-space-2;
110110
gap: @team-space-2;
111111

112-
h4,
113-
span {
114-
margin: 0;
115-
}
116-
117112
h4 {
113+
margin: 0;
118114
display: inline-flex;
119115
align-items: center;
120116
color: @team-text-primary;
@@ -130,11 +126,6 @@
130126
background: @team-primary;
131127
}
132128
}
133-
134-
span {
135-
color: @team-text-muted;
136-
font-size: 11px;
137-
}
138129
}
139130
}
140131

src/assets/css/team/raid/manage_raid.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
.v-raid-list {
44
min-width: 0;
55

6+
.u-create-button i {
7+
margin-right: 5px;
8+
}
9+
610
.m-raid-embedded-header {
711
display: flex;
812
align-items: flex-start;
@@ -237,6 +241,13 @@
237241
.u-edit {
238242
border-color: fade(@team-primary, 28%);
239243
color: @team-primary;
244+
245+
&:hover,
246+
&:focus {
247+
border-color: @team-primary;
248+
background: @team-primary;
249+
color: #fff;
250+
}
240251
}
241252

242253
.u-more {

src/assets/css/team/snapshot/body.less

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@
6262
.u-col {
6363
min-width: 0;
6464
min-height: @row-height;
65+
border-right: 1px solid fade(@team-primary, 14%);
66+
border-bottom: 1px solid fade(@team-primary, 12%);
67+
68+
&:nth-child(5n) {
69+
border-bottom: 0;
70+
}
71+
72+
&:nth-child(n + 21) {
73+
border-right: 0;
74+
}
6575
}
6676

6777
.u-item {
@@ -72,8 +82,6 @@
7282
min-width: 0;
7383
align-items: center;
7484
padding: 0 @team-space-3;
75-
border-right: 1px solid fade(@team-primary, 14%);
76-
border-bottom: 1px solid fade(@team-primary, 12%);
7785
background: @team-surface;
7886
cursor: pointer;
7987
gap: @team-space-2;
@@ -115,9 +123,20 @@
115123

116124
.u-item {
117125
height: 48px;
126+
border-radius: 0;
127+
}
128+
129+
.u-col {
118130
border-right: 1px solid fade(@team-primary, 14%);
119131
border-bottom: 1px solid fade(@team-primary, 12%);
120-
border-radius: 0;
132+
133+
&:nth-child(5n) {
134+
border-bottom: 1px solid fade(@team-primary, 12%);
135+
}
136+
137+
&:nth-child(n + 21) {
138+
border-right: 1px solid fade(@team-primary, 14%);
139+
}
121140
}
122141
}
123142
}

src/components/team/raid/RaidFormDialog.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<section class="m-raid-form-section">
2323
<header>
2424
<h4>{{ $t("team.raid.form.basic") }}</h4>
25-
<span>{{ $t(isEdit ? "team.raid.form.editHint" : "team.raid.form.createHint") }}</span>
2625
</header>
2726
<div class="m-raid-form-grid">
2827
<el-form-item :label="$t('team.raid.form.team')" prop="team_id">
@@ -126,7 +125,6 @@
126125
<section class="m-raid-form-section">
127126
<header>
128127
<h4>{{ $t("team.raid.form.signup") }}</h4>
129-
<span>{{ $t("team.raid.form.signupHint") }}</span>
130128
</header>
131129
<el-form-item :label="$t('team.raid.form.condition')" prop="auth" class="u-auth-options">
132130
<el-radio-group v-model.number="form.auth">
@@ -164,7 +162,6 @@
164162
<section class="m-raid-form-section">
165163
<header>
166164
<h4>{{ $t("team.raid.form.notes") }}</h4>
167-
<span>{{ $t("team.raid.form.notesHint") }}</span>
168165
</header>
169166
<el-form-item prop="desc" class="u-desc-field">
170167
<el-input

src/components/team/snapshot/EditSnapshotDialog.vue

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,25 @@
3232
<h3>{{ $t("team.snapshotEdit.participants") }}</h3>
3333
<p>{{ $t("team.snapshotEdit.participantHint") }}</p>
3434
</div>
35-
<span>{{ $t("team.snapshotEdit.people", { count: list.length }) }}</span>
35+
<span>{{ $t("team.snapshotEdit.people", { count: memberCount }) }}</span>
3636
</div>
3737
<div class="m-snapshot-edit__group-head" :aria-label="$t('team.snapshotEdit.groupAria')">
3838
<span v-for="group in 5" :key="group">{{ $t("team.snapshotEdit.group", { group }) }}</span>
3939
</div>
40-
<VueDraggable v-model="list" class="m-snapshot-edit__member-list">
41-
<div v-for="(item, index) in list" :key="dragKey(item, 'snapshot-dialog-role')" class="u-member">
42-
<img :src="showMountIcon(item[3])" alt="" />
43-
<span>{{ item[0] }}</span>
44-
<button type="button" :aria-label="$t('team.snapshotEdit.remove')" @click.stop="delRole(index)">
45-
<i class="el-icon-close"></i>
46-
</button>
40+
<VueDraggable v-model="list" class="m-snapshot-edit__member-list" :animation="150">
41+
<div
42+
v-for="(item, index) in list"
43+
:key="dragKey(item, 'snapshot-dialog-role')"
44+
class="u-member"
45+
:class="{ 'is-empty': !item[0] }"
46+
>
47+
<template v-if="item[0]">
48+
<img :src="showMountIcon(item[3])" alt="" />
49+
<span>{{ item[0] }}</span>
50+
<button type="button" :aria-label="$t('team.snapshotEdit.remove')" @click.stop="delRole(index)">
51+
<i class="el-icon-close"></i>
52+
</button>
53+
</template>
4754
</div>
4855
</VueDraggable>
4956
<div class="m-snapshot-edit__role-adder">
@@ -118,6 +125,14 @@ import { ensureDragKey } from "@/utils/draggable";
118125
import { showMountIcon } from "@/utils/filters";
119126
import xfmap from "@jx3box/jx3box-data/data/xf/xf.json";
120127
128+
const SNAPSHOT_SLOT_COUNT = 25;
129+
const createEmptySlot = () => ["", 0, 0, ""];
130+
const fillSnapshotSlots = (members = []) => {
131+
const slots = members.slice(0, SNAPSHOT_SLOT_COUNT);
132+
while (slots.length < SNAPSHOT_SLOT_COUNT) slots.push(createEmptySlot());
133+
return slots;
134+
};
135+
121136
export default {
122137
name: "EditSnapshotDialog",
123138
components: {
@@ -147,7 +162,7 @@ export default {
147162
},
148163
selectedTeamId: "",
149164
teams: [],
150-
list: [],
165+
list: fillSnapshotSlots(),
151166
roleForm: {
152167
name: "",
153168
xf: "",
@@ -184,6 +199,9 @@ export default {
184199
teammate() {
185200
return this.list.map((item) => item.join(",")).join(";");
186201
},
202+
memberCount() {
203+
return this.list.filter((item) => item[0]).length;
204+
},
187205
xflist() {
188206
return Object.values(xfmap).filter((item) => item.id !== 0);
189207
},
@@ -211,6 +229,7 @@ export default {
211229
const targetId = Number(this.targetTeamId);
212230
const targetTeam = this.teams.find((item) => Number(item.ID) === targetId);
213231
this.selectedTeamId = targetTeam ? targetId : this.teams[0]?.ID || "";
232+
this.list = fillSnapshotSlots();
214233
} finally {
215234
if (requestId === this.loadRequestId) this.loading = false;
216235
}
@@ -231,21 +250,24 @@ export default {
231250
};
232251
this.selectedTeamId = data.team_id;
233252
this.teams = teamsRes.data.data.list || [];
234-
this.list = (data.teammate || "")
253+
const members = (data.teammate || "")
235254
.split(";")
236255
.filter(Boolean)
237256
.map((item) => item.split(","));
257+
this.list = fillSnapshotSlots(members);
238258
} finally {
239259
if (requestId === this.loadRequestId) this.loading = false;
240260
}
241261
},
242262
delRole(index) {
243-
this.list.splice(index, 1);
263+
this.list.splice(index, 1, createEmptySlot());
244264
},
245265
addMember() {
246266
this.$refs.roleForm.validate((valid) => {
247267
if (!valid) return;
248-
this.list.push([this.roleForm.name, 0, 0, this.roleForm.xf]);
268+
const emptyIndex = this.list.findIndex((item) => !item[0]);
269+
if (emptyIndex === -1) return;
270+
this.list.splice(emptyIndex, 1, [this.roleForm.name, 0, 0, this.roleForm.xf]);
249271
this.$refs.roleForm.resetFields();
250272
});
251273
},
@@ -283,7 +305,7 @@ export default {
283305
this.form = { title: "", desc: "" };
284306
this.selectedTeamId = "";
285307
this.teams = [];
286-
this.list = [];
308+
this.list = fillSnapshotSlots();
287309
this.roleForm = { name: "", xf: "" };
288310
},
289311
},

src/components/team/snapshot/snapshotBody.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="m-snapshot-body" v-if="data && data.length">
3-
<div class="u-col" v-for="item in data" :key="item.name">
4-
<div class="u-item" @click="onCopy(item.name)">
3+
<div class="u-col" v-for="(item, index) in data" :key="`${item.name}-${index}`">
4+
<div v-if="item.name" class="u-item" @click="onCopy(item.name)">
55
<img class="u-icon" :src="showMountIcon(item.mount)" />
66
<span class="u-name">{{ item.name }}</span>
77
</div>

src/components/team/snapshot/snapshotChart.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export default {
175175
176176
teammate.forEach((mate) => {
177177
const [name, , , mount] = mate.split(",");
178+
if (!name) return;
178179
// 统计心法次数
179180
if (!pieData[mount]) {
180181
pieData[mount] = 1;

src/components/team/snapshot/snapshotDetail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div class="u-record-meta">
2828
<span><Clock />{{ showTime(item.created_at) }}</span>
2929
<span><User />{{ uploaderName(item) }}</span>
30-
<span><UserFilled />{{ $t("team.snapshotEdit.people", { count: formatTeammate(item.teammate).length }) }}</span>
30+
<span><UserFilled />{{ $t("team.snapshotEdit.people", { count: formatTeammate(item.teammate).filter((member) => member.name).length }) }}</span>
3131
</div>
3232
</div>
3333
<el-button class="u-view-team" plain icon="Camera" @click="openRoster(item)">{{ $t("team.snapshotEdit.viewRoster") }}</el-button>

0 commit comments

Comments
 (0)