Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 47 additions & 9 deletions src/modules/MemberTeam/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
flex-height
striped
class="h-full"
:scroll-x="1800"
/>
</n-card>
</LayoutPage>
Expand All @@ -20,7 +21,11 @@
<script lang="ts" setup>
import { NTag, NSpace, NButton, NPopconfirm } from 'naive-ui'

import { memberTeamList, findUserRankMapByRankName } from '@/modules/MemberTeam/data'
import {
memberTeamList,
findUserRankMapByRankName,
findUserRoleMapByRankName
} from '@/modules/MemberTeam/data'
import type { TypeMemberPerson } from '@/modules/MemberTeam/data'

/**
Expand Down Expand Up @@ -51,15 +56,41 @@ const pagination = reactive({
const columns: DataTableColumns<TypeMemberPerson> = [
{
title: '姓名',
key: 'username'
key: 'username',
width: 80,
fixed: 'left'
},
{
title: '工号',
key: 'userId',
align: 'center',
width: 60
},
{
title: '角色',
key: 'roleId'
key: 'roleId',
align: 'center',
width: 100,
render(row) {
const roleItem = findUserRoleMapByRankName(row.roleId)
return h(
NTag,
{
bordered: false
},
{
default: () => {
return roleItem.label
}
}
)
}
},
{
title: '职级',
key: 'rank',
align: 'center',
width: 100,
render(row) {
const rankItem = findUserRankMapByRankName(row.rank)
return h(
Expand All @@ -76,23 +107,30 @@ const columns: DataTableColumns<TypeMemberPerson> = [
}
},
{
title: '工号',
key: 'userId'
title: '邮箱',
key: 'email',
align: 'center',
width: 150
},
{
title: '邮箱',
key: 'email'
title: '手机号',
key: 'phone',
align: 'center',
width: 80
},
{
title: '操作列',
key: 'actions',
width: '210px',
align: 'center',
width: 80,
fixed: 'right',
render (row) {
return [
h(
NSpace,
null,
{
justify: 'center'
},
{
default: () => [
h(
Expand Down
7 changes: 7 additions & 0 deletions src/modules/MemberTeam/pages/preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:model="memberFormModel"
label-placement="top"
label-width="auto"
disabled
>
<n-form-item
v-for="(infoItem, index) in memberInfoMap"
Expand All @@ -33,12 +34,14 @@
<n-button
type="primary"
:loading="loadingSubmit"
disabled
@click="handleSubmit()"
>
更新
</n-button>
</n-form-item>
</n-form>

<pre>{{ JSON.stringify(memberFormModel, null, 2) }}</pre>
</n-spin>
</n-card>
Expand Down Expand Up @@ -89,6 +92,10 @@ const memberInfoMap = [
path: 'username',
label: '姓名'
},
{
path: 'userId',
label: '工号'
},
{
path: 'roleId',
label: '角色',
Expand Down