Skip to content

Commit 3a1942c

Browse files
committed
feat(scrm): tag user list
1 parent 89be273 commit 3a1942c

File tree

3 files changed

+51
-11
lines changed

3 files changed

+51
-11
lines changed

src/views/scrm/wecom/organization/user/components/tag-list/index.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@
66
listWeComUsersPage,
77
listWeComUsersPageRequest,
88
} from '@/api/scrm/wecom/user';
9+
import { consola } from 'consola';
910
import styles from './index.module.less';
1011
1112
const useWeComUser = useWeComUserStore();
1213
1314
const handleSelectTag = async (tagId: number) => {
15+
if (tagId == null || tagId <= 0 || tagId === useWeComUser.selectedTag) {
16+
return;
17+
}
18+
// consola.log(tagId);
1419
// 这里可以添加其他业务逻辑
1520
const res = await listWeComUsersPage({
1621
weComTagId: tagId,
1722
} as listWeComUsersPageRequest);
1823
if (res) {
1924
useWeComUser.tagUserList = res.data.list || [];
25+
useWeComUser.selectedTag = tagId;
2026
}
2127
};
2228
@@ -36,7 +42,7 @@
3642
:key="item.tagId"
3743
:class="[
3844
styles.row,
39-
{ [styles.selected]: useWeComUser.selectedTag === item.tagId },
45+
{ [styles.selected]: useWeComUser.selectedTag === item.id },
4046
]"
4147
@click="handleSelectTag(item.id!)"
4248
>

src/views/scrm/wecom/organization/user/components/tag-user-list/index.module.less

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,27 @@
1414
}
1515

1616
.action {
17-
@apply flex flex-row w-full items-center justify-start w-full;
17+
display: flex;
18+
flex-direction: row;
19+
justify-content: space-between;
20+
align-items: center;
21+
width: 100%;
1822
background-color: #E0E9F5;
1923
gap: 10px;
2024
padding: 10px 20px;
25+
//border:1px solid red;
26+
27+
.left {
28+
@apply flex flex-row w-full items-center justify-start w-full;
29+
//border:1px solid yellow;
30+
width: 100%;
31+
}
32+
33+
.right {
34+
@apply flex flex-row w-full items-center justify-end w-full;
35+
//border:1px solid yellow;
36+
width: 100%;
37+
}
2138

2239
.actionBtn {
2340
font-size: 12px !important;
@@ -30,4 +47,4 @@
3047
border-left: 1px solid #d9d9d9;
3148
}
3249
}
33-
}
50+
}

src/views/scrm/wecom/organization/user/components/tag-user-list/index.vue

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
const onRemoveUser = () => {
5656
consola.log('remove');
5757
};
58+
const onTagDetail = () => {
59+
consola.log('tag detail');
60+
};
5861
5962
onMounted(() => {
6063
queryChange();
@@ -67,14 +70,24 @@
6770
<span>Tag名称(0人)</span>
6871
</div>
6972
<div :class="styles.action">
70-
<a-button :class="styles.actionBtn" @click="onAddUser"
71-
>添加部门/成员</a-button
72-
>
73-
<a-button :class="styles.actionBtn" @click="onBatchExportOrImport"
74-
>批量导入/导出</a-button
75-
>
76-
<a-button :class="styles.actionBtn" @click="onRemoveUser">移除</a-button>
73+
<div :class="styles.left">
74+
<a-button :class="styles.actionBtn" @click="onAddUser"
75+
>添加部门/成员</a-button
76+
>
77+
<a-button :class="styles.actionBtn" @click="onBatchExportOrImport"
78+
>批量导入/导出</a-button
79+
>
80+
<a-button :class="styles.actionBtn" @click="onRemoveUser"
81+
>移除</a-button
82+
>
83+
</div>
84+
<div :class="styles.right">
85+
<a-button :class="styles.actionBtn" @click="onTagDetail"
86+
>标签详情</a-button
87+
>
88+
</div>
7789
</div>
90+
7891
<a-table
7992
:data="useWeComUser.tagUserList"
8093
:loading="state.tableLoading"
@@ -89,7 +102,11 @@
89102
{{ record.name }}
90103
</template>
91104
</a-table-column>
92-
<a-table-column title="部门" data-index="department" ellipsis />
105+
<a-table-column title="部门" data-index="department" ellipsis>
106+
<template #cell="{ record }">
107+
{{ record.departments }}
108+
</template>
109+
</a-table-column>
93110
</template>
94111
</a-table>
95112
</div>

0 commit comments

Comments
 (0)