Skip to content

Commit d685280

Browse files
committed
feat(user): user manage
1 parent fbc63e4 commit d685280

File tree

27 files changed

+2221
-83
lines changed

27 files changed

+2221
-83
lines changed

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"vue-dompurify-html": "^5.3.0",
3838
"vue-i18n": "^9.14.4",
3939
"vue-router": "^4.5.0",
40+
"vue-types": "^6.0.0",
4041
"web-storage-cache": "^1.1.1"
4142
},
4243
"devDependencies": {

frontend/src/api/user.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { request } from '@/utils/request'
2+
3+
export const userImportApi = {
4+
downExcelTemplateApi: () => request.post('/user/excelTemplate', {}, { responseType: 'blob' }),
5+
importUserApi: (data: any) =>
6+
request.post('/user/batchImport', data, {
7+
headers: {
8+
'Content-Type': 'multipart/form-data',
9+
},
10+
}),
11+
downErrorRecordApi: (key: string) =>
12+
request.get(`/user/errorRecord/${key}`, { responseType: 'blob' }),
13+
clearErrorApi: (key: string) => {
14+
request.get(`/user/clearErrorRecord/${key}`)
15+
},
16+
}

frontend/src/api/workspace.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { request } from '@/utils/request'
2+
3+
export const workspaceUserList = (params: any, pageNum: number, pageSize: number) =>
4+
request.get(`/system/workspace/uws/pager/${pageNum}/${pageSize}`, { params })
5+
6+
export const workspaceCreate = (data: any) => request.post('/system/workspace/uws', data)
7+
export const workspaceDelete = (data: any) => request.delete('/system/workspace/uws', data)
8+
export const workspaceList = () => request.get('/system/workspace')
9+
export const workspaceDetail = (id: any) => request.get(`/system/workspace/${id}`)
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
1.55 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import DrawerFilter from './src/DrawerFilter.vue'
2+
3+
export { DrawerFilter }
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<script setup lang="ts">
2+
import { propTypes } from '@/utils/propTypes'
3+
import { reactive } from 'vue'
4+
import { useEmitt } from '@/utils/useEmitt'
5+
6+
const props = defineProps({
7+
optionList: propTypes.arrayOf(
8+
propTypes.shape({
9+
id: propTypes.string,
10+
name: propTypes.string,
11+
})
12+
),
13+
index: propTypes.number,
14+
title: propTypes.string,
15+
})
16+
17+
const state = reactive<{ activeStatus: any[]; optionList: any[] }>({
18+
activeStatus: [],
19+
optionList: [],
20+
})
21+
22+
const nodeChange = (id: string | number) => {
23+
const len = state.activeStatus.indexOf(id)
24+
if (len >= 0) {
25+
state.activeStatus.splice(len, 1)
26+
} else {
27+
state.activeStatus.push(id)
28+
}
29+
emits('filter-change', state.activeStatus)
30+
}
31+
32+
const emits = defineEmits(['filter-change'])
33+
const clear = (index: number) => {
34+
if (index !== props.index) return
35+
state.activeStatus = []
36+
}
37+
38+
useEmitt({
39+
name: 'clear-drawer_main',
40+
callback: clear,
41+
})
42+
</script>
43+
44+
<template>
45+
<div class="draw-filter_enum">
46+
<span>{{ title }}</span>
47+
<div class="filter-item">
48+
<span
49+
v-for="ele in props.optionList"
50+
:key="ele.id"
51+
class="item"
52+
:class="[state.activeStatus.includes(ele.id) ? 'active' : '']"
53+
@click="nodeChange(ele.id)"
54+
>{{ ele.name }}</span
55+
>
56+
</div>
57+
</div>
58+
</template>
59+
<style lang="less" scope>
60+
.draw-filter_enum {
61+
margin-bottom: 4px;
62+
63+
> :nth-child(1) {
64+
color: var(--deTextSecondary, #1f2329);
65+
font-family: var(--de-custom_font, 'PingFang');
66+
font-style: normal;
67+
font-weight: 400;
68+
font-size: 14px;
69+
line-height: 22px;
70+
white-space: nowrap;
71+
}
72+
73+
.filter-item {
74+
margin-top: 8px;
75+
.item,
76+
.more {
77+
font-family: var(--de-custom_font, 'PingFang');
78+
white-space: nowrap;
79+
font-size: 14px;
80+
font-weight: 400;
81+
line-height: 24px;
82+
margin-right: 12px;
83+
text-align: center;
84+
padding: 1px 6px;
85+
background: var(--deTextPrimary5, #f5f6f7);
86+
color: var(--deTextPrimary, #1f2329);
87+
border-radius: 2px;
88+
cursor: pointer;
89+
display: inline-block;
90+
margin-bottom: 12px;
91+
}
92+
93+
.active,
94+
.more:hover {
95+
background: var(--primary10, var(--ed-color-primary-1a, #1cba9033));
96+
color: var(--primaryselect, #0c296e);
97+
}
98+
99+
.more {
100+
white-space: nowrap;
101+
display: inline-flex;
102+
align-items: center;
103+
i {
104+
margin-right: 5px;
105+
}
106+
}
107+
}
108+
}
109+
</style>
110+
<style lang="less">
111+
.filter-popper {
112+
padding: 0 !important;
113+
background: #fff !important;
114+
}
115+
</style>

0 commit comments

Comments
 (0)