Skip to content

Commit 1b36e43

Browse files
feat: user manage
1 parent 165efaa commit 1b36e43

File tree

21 files changed

+813
-83
lines changed

21 files changed

+813
-83
lines changed

ui/src/api/user/user-manage.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { Result } from '@/request/Result'
2+
import { get, put, post, del } from '@/request/index'
3+
import type { pageRequest } from '@/api/type/common'
4+
import type { Ref } from 'vue'
5+
6+
const prefix = '/user_manage'
7+
/**
8+
* 用户分页列表
9+
* @query 参数
10+
email_or_username: string
11+
*/
12+
const getUserManage: (
13+
page: pageRequest,
14+
email_or_username: string,
15+
loading?: Ref<boolean>,
16+
) => Promise<Result<any>> = (page, email_or_username, loading) => {
17+
return get(
18+
`${prefix}/${page.current_page}/${page.page_size}`,
19+
email_or_username ? { email_or_username } : undefined,
20+
loading,
21+
)
22+
}
23+
24+
/**
25+
* 删除用户
26+
* @param 参数 user_id,
27+
*/
28+
const delUserManage: (user_id: string, loading?: Ref<boolean>) => Promise<Result<boolean>> = (
29+
user_id,
30+
loading,
31+
) => {
32+
return del(`${prefix}/${user_id}`, undefined, {}, loading)
33+
}
34+
35+
/**
36+
* 创建用户
37+
*/
38+
const postUserManage: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
39+
data,
40+
loading,
41+
) => {
42+
return post(`${prefix}`, data, undefined, loading)
43+
}
44+
45+
/**
46+
* 编辑用户
47+
*/
48+
const putUserManage: (
49+
user_id: string,
50+
data: any,
51+
loading?: Ref<boolean>,
52+
) => Promise<Result<any>> = (user_id, data, loading) => {
53+
return put(`${prefix}/${user_id}`, data, undefined, loading)
54+
}
55+
56+
/**
57+
* 修改用户密码
58+
*/
59+
const putUserManagePassword: (
60+
user_id: string,
61+
data: any,
62+
loading?: Ref<boolean>
63+
) => Promise<Result<any>> = (user_id, data, loading) => {
64+
return put(`${prefix}/${user_id}/re_password`, data, undefined, loading)
65+
}
66+
67+
68+
export default {
69+
getUserManage,
70+
putUserManage,
71+
delUserManage,
72+
postUserManage,
73+
putUserManagePassword
74+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { h } from 'vue'
2+
export default {}

ui/src/components/app-icon/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,31 @@ export const iconMap: any = {
138138
])
139139
},
140140
},
141+
'app-wordspace': {
142+
iconReader: () => {
143+
return h('i', [
144+
h(
145+
'svg',
146+
{
147+
style: { height: '100%', width: '100%' },
148+
viewBox: '0 0 1024 1024',
149+
version: '1.1',
150+
xmlns: 'http://www.w3.org/2000/svg',
151+
},
152+
[
153+
h('path', {
154+
d: 'M523.477333 113.92l429.568 273.408a21.333333 21.333333 0 0 1 0 36.010667L523.52 696.704a21.333333 21.333333 0 0 1-22.912 0L70.954667 423.338667a21.333333 21.333333 0 0 1 0-36.010667l429.610666-273.365333a21.333333 21.333333 0 0 1 22.912 0zM201.6 405.333333L512 602.88l310.4-197.546667L512 207.786667 201.6 405.333333z',
155+
fill: 'currentColor',
156+
}),
157+
h('path', {
158+
d: 'M110.805333 592.469333a21.333333 21.333333 0 0 0-29.354666 7.04l-22.314667 36.394667a21.333333 21.333333 0 0 0 7.04 29.312l390.613333 239.530667a84.992 84.992 0 0 0 89.088 0l390.613334-239.530667a21.333333 21.333333 0 0 0 7.04-29.312l-22.314667-36.394667a21.333333 21.333333 0 0 0-29.312-7.04L506.88 828.586667a10.666667 10.666667 0 0 1-11.136 0l-384.981333-236.074667z',
159+
fill: 'currentColor',
160+
}),
161+
],
162+
),
163+
])
164+
},
165+
},
141166
// 动态加载的图标
142167
...dynamicIcons,
143168
}

ui/src/components/app-table/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ defineExpose({
135135
})
136136
137137
onMounted(() => {
138+
138139
tableHeight.value = window.innerHeight - 300
139140
window.onresize = () => {
140141
return (() => {

ui/src/components/card-box/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ function subHoveredEnter() {
8383
position: relative;
8484
min-height: var(--card-min-height);
8585
min-width: var(--card-min-width);
86-
border-radius: 8px;
8786
.card-header {
8887
margin-top: -5px;
8988
}

ui/src/components/layout-container/ContentContainer.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
<slot name="header">
99
<h4>{{ header }}</h4>
1010
</slot>
11-
<slot name="search">
12-
<h4>{{ header }}</h4>
13-
</slot>
11+
<slot name="search"> </slot>
1412
</div>
1513
</div>
1614

ui/src/layout/layout-header/SystemHeader.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
·
22
<template>
33
<div class="app-top-bar-container border-b flex-center">
4-
<div class="logo">
4+
<div class="logo mt-4">
55
<LogoFull />
66
</div>
7+
78
<div class="flex-between w-full">
8-
<div><el-divider direction="vertical" />{{ $t('views.system.title') }}</div>
9-
<TopAbout></TopAbout>
9+
<h4><el-divider class="ml-16 mr-16" direction="vertical" />{{ $t('views.system.title') }}</h4>
10+
<div>
11+
<TopAbout></TopAbout>
12+
<span class="mr-8 lighter flex align-center"
13+
><el-divider class="ml-8 mr-8" direction="vertical" />
14+
<el-button link @click="router.push({ path: '/' })">
15+
<AppIcon class="mr-8" iconName="app-wordspace" style="font-size: 16px"></AppIcon>
16+
{{ '返回工作空间' }}</el-button>
17+
</span>
18+
</div>
1019
</div>
1120
<Avatar></Avatar>
1221
</div>
1322
</template>
1423
<script setup lang="ts">
15-
import TopMenu from './top-menu/index.vue'
1624
import Avatar from './avatar/index.vue'
1725
import TopAbout from './top-about/index.vue'
1826
import { useRouter } from 'vue-router'

ui/src/layout/layout-header/UserHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
·
22
<template>
33
<div class="app-top-bar-container border-b flex-center">
4-
<div class="logo">
4+
<div class="logo mt-4">
55
<LogoFull />
66
</div>
77
<div class="flex-between w-full">

ui/src/locales/lang/en-US/views/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import applicationOverview from './application-overview'
44
import dataset from './dataset'
55
import system from './system'
66
import tool from './tool'
7-
import user from './user'
7+
import userManage from './user-manage'
88
import team from './team'
99
import model from './model'
1010
import document from './document'
@@ -20,7 +20,7 @@ export default {
2020
applicationOverview,
2121
system,
2222
tool,
23-
user,
23+
userManage,
2424
team,
2525
model,
2626
dataset,

ui/src/locales/lang/en-US/views/user.ts renamed to ui/src/locales/lang/en-US/views/user-manage.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export default {
22
title: 'User',
33
createUser: 'Create User',
44
editUser: 'Edit User',
5+
info: 'Base Information',
6+
roleSetting: 'Role Setting',
57
setting: {
68
updatePwd: 'Change Password',
79
},
@@ -50,7 +52,7 @@ export default {
5052
},
5153
},
5254
source: {
53-
label: 'User Type',
55+
label: 'User Source',
5456
local: 'System User',
5557
wecom: 'WeCom',
5658
lark: 'Lark',

0 commit comments

Comments
 (0)