Skip to content

Commit 6e97f7b

Browse files
committed
fix(user): user manage
1 parent 5865b5d commit 6e97f7b

File tree

12 files changed

+221
-110
lines changed

12 files changed

+221
-110
lines changed

frontend/src/api/user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const userApi = {
2222
edit: (data: any) => request.put('/user', data),
2323
clearErrorApi: (key: string) => request.get(`/user/clearErrorRecord/${key}`),
2424
delete: (key: string) => request.delete(`/user/${key}`),
25+
deleteBatch: (data: any) => request.delete(`/user`, { data }),
2526
get: (key: string) => request.get(`/user/${key}`),
2627
pwd: (data: any) => request.put('/user/pwd', data),
2728
}

frontend/src/api/workspace.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ import { request } from '@/utils/request'
33
export const workspaceUserList = (params: any, pageNum: number, pageSize: number) =>
44
request.get(`/system/workspace/uws/pager/${pageNum}/${pageSize}`, { params })
55

6-
export const workspaceCreate = (data: any) => request.post('/system/workspace/uws', data)
7-
export const workspaceDelete = (data: any) => request.delete('/system/workspace/uws', data)
6+
export const workspaceOptionUserList = (params: any, pageNum: number, pageSize: number) =>
7+
request.get(`/system/workspace/uws/option/pager/${pageNum}/${pageSize}`, { params })
8+
9+
export const workspaceUwsCreate = (data: any) => request.post('/system/workspace/uws', data)
10+
export const workspaceUwsUpdate = (data: any) => request.put('/system/workspace/uws', data)
11+
export const workspaceCreate = (data: any) => request.post('/system/workspace', data)
12+
export const workspaceUpdate = (data: any) => request.put('/system/workspace', data)
13+
export const workspaceUwsDelete = (data: any) => request.delete('/system/workspace/uws', { data })
14+
export const workspaceDelete = (data: any) => request.delete('/system/workspace', { data })
815
export const workspaceList = () => request.get('/system/workspace')
916
export const workspaceDetail = (id: any) => request.get(`/system/workspace/${id}`)
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

frontend/src/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"type": "Data Source Type",
8181
"status": "Status",
8282
"actions": "Actions",
83-
"pieces_in_total": "Showing {ms} records out of {msg}",
83+
"pieces_in_total": "Showing {ms} records",
8484
"test_connection": "Test Connection",
8585
"check": "check",
8686
"connection_success": "Connection Successful",

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"name": "数据源名称",
8888
"type": "数据源类型",
8989
"status": "状态",
90-
"pieces_in_total": "显示 {ms} 条数据,共 {msg} 条",
90+
"pieces_in_total": "显示 {ms} 条数据",
9191
"actions": "操作",
9292
"test_connection": "测试连接",
9393
"check": "校验",

frontend/src/views/system/model/Card.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import { computed } from 'vue'
66
const props = withDefaults(
77
defineProps<{
88
name: string
9-
modleType: string
10-
baseModle: string
9+
modelType: string
10+
baseModel: string
1111
id?: string
1212
isDefault?: boolean
1313
supplier?: number
1414
}>(),
1515
{
1616
name: '-',
17-
modleType: '-',
18-
baseModle: '-',
17+
modelType: '-',
18+
baseModel: '-',
1919
id: '-',
2020
isDefault: false,
2121
supplier: 0,
@@ -47,11 +47,11 @@ const handleDel = () => {
4747
</div>
4848
<div class="type-value">
4949
<span class="type">{{ $t('model.model_type') }}</span>
50-
<span class="value"> {{ modleType }}</span>
50+
<span class="value"> {{ modelType }}</span>
5151
</div>
5252
<div class="type-value">
5353
<span class="type">{{ $t('model.basic_model') }}</span>
54-
<span class="value"> {{ baseModle }}</span>
54+
<span class="value"> {{ baseModel }}</span>
5555
</div>
5656
<div class="methods">
5757
<el-tooltip :offset="14" effect="dark" :content="$t('datasource.edit')" placement="top">

frontend/src/views/system/model/Model.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const preStep = () => {
172172
}
173173
174174
const saveModel = () => {
175-
modelFormRef.value.submitModle()
175+
modelFormRef.value.submitModel()
176176
}
177177
178178
const search = () => {
@@ -287,8 +287,8 @@ const submit = (item: any) => {
287287
:key="ele.id"
288288
:name="ele.name"
289289
:supplier="ele.supplier"
290-
:modle-type="getModelTypeName(ele['model_type'])"
291-
:base-modle="ele['base_model']"
290+
:model-type="getModelTypeName(ele['model_type'])"
291+
:base-model="ele['base_model']"
292292
:is-default="ele['default_model']"
293293
@edit="handleEditModel(ele)"
294294
@del="deleteHandler"

frontend/src/views/system/model/ModelForm.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const initForm = (item?: any) => {
147147
}
148148
const emits = defineEmits(['submit'])
149149
150-
const submitModle = () => {
150+
const submitModel = () => {
151151
modelRef.value.validate((res: any) => {
152152
if (res) {
153153
emits('submit', {
@@ -160,7 +160,7 @@ const submitModle = () => {
160160
161161
defineExpose({
162162
initForm,
163-
submitModle,
163+
submitModel,
164164
supplierChang,
165165
})
166166
</script>

frontend/src/views/system/user/User.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ const statusHandler = (row: any) => {
504504
}
505505
506506
const cancelDelete = () => {
507+
handleToggleRowSelection(false)
507508
multipleSelectionAll.value = []
508509
checkAll.value = false
509510
isIndeterminate.value = false
@@ -515,9 +516,14 @@ const deleteBatchUser = () => {
515516
cancelButtonText: t('common.cancel'),
516517
customClass: 'confirm-no_icon',
517518
autofocus: false,
518-
callback: (val: string) => {
519-
console.log(val)
520-
},
519+
}).then(() => {
520+
userApi.deleteBatch(multipleSelectionAll.value.map((ele) => ele.id)).then(() => {
521+
ElMessage({
522+
type: 'success',
523+
message: t('dashboard.delete_success'),
524+
})
525+
search()
526+
})
521527
})
522528
}
523529
const deleteHandler = (row: any) => {
@@ -532,7 +538,7 @@ const deleteHandler = (row: any) => {
532538
userApi.delete(row.id).then(() => {
533539
ElMessage({
534540
type: 'success',
535-
message: 'Delete completed',
541+
message: t('dashboard.delete_success'),
536542
})
537543
search()
538544
})

0 commit comments

Comments
 (0)