Skip to content

Commit 3143e8b

Browse files
committed
fix(Permission Configuration): Configure restricted users, search for non-existent users, and cannot clear or delete a single user.
1 parent c825a37 commit 3143e8b

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

frontend/src/views/system/permission/SelectPermission.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ const workspaceWithKeywords = computed(() => {
111111
112112
watch(search, () => {
113113
const tableNameArr = workspaceWithKeywords.value.map((ele: any) => ele.name)
114-
checkedWorkspace.value = checkTableList.value.filter((ele) => tableNameArr.includes(ele.name))
114+
checkedWorkspace.value = checkTableList.value.filter((ele: any) =>
115+
tableNameArr.includes(ele.name)
116+
)
115117
const checkedCount = checkedWorkspace.value.length
116118
checkAll.value = checkedCount === workspaceWithKeywords.value.length
117119
isIndeterminate.value = checkedCount > 0 && checkedCount < workspaceWithKeywords.value.length
@@ -122,7 +124,7 @@ const handleCheckAllChange = (val: CheckboxValueType) => {
122124
? [
123125
...new Set([
124126
...workspaceWithKeywords.value,
125-
...checkedWorkspace.value.filter((ele) => !tableNameArr.includes(ele.name)),
127+
...checkedWorkspace.value.filter((ele: any) => !tableNameArr.includes(ele.name)),
126128
]),
127129
]
128130
: []
@@ -131,10 +133,10 @@ const handleCheckAllChange = (val: CheckboxValueType) => {
131133
? [
132134
...new Set([
133135
...workspaceWithKeywords.value,
134-
...checkTableList.value.filter((ele) => !tableNameArr.includes(ele.name)),
136+
...checkTableList.value.filter((ele: any) => !tableNameArr.includes(ele.name)),
135137
]),
136138
]
137-
: checkTableList.value.filter((ele) => !tableNameArr.includes(ele.name))
139+
: checkTableList.value.filter((ele: any) => !tableNameArr.includes(ele.name))
138140
}
139141
const handleCheckedWorkspaceChange = (value: CheckboxValueType[]) => {
140142
const checkedCount = value.length
@@ -143,7 +145,7 @@ const handleCheckedWorkspaceChange = (value: CheckboxValueType[]) => {
143145
const tableNameArr = workspaceWithKeywords.value.map((ele: any) => ele.name)
144146
checkTableList.value = [
145147
...new Set([
146-
...checkTableList.value.filter((ele) => !tableNameArr.includes(ele.name)),
148+
...checkTableList.value.filter((ele: any) => !tableNameArr.includes(ele.name)),
147149
...value,
148150
]),
149151
]
@@ -159,7 +161,7 @@ const open = async (user: any) => {
159161
const systemWorkspaceList = await workspaceUserList({}, 1, 1000)
160162
workspace.value = systemWorkspaceList.items as any
161163
if (user?.length) {
162-
checkedWorkspace.value = workspace.value.filter((ele) => user.includes(ele.id))
164+
checkedWorkspace.value = workspace.value.filter((ele: any) => user.includes(ele.id))
163165
checkTableList.value = [...checkedWorkspace.value]
164166
handleCheckedWorkspaceChange(checkedWorkspace.value)
165167
}
@@ -169,6 +171,7 @@ const open = async (user: any) => {
169171
170172
const clearWorkspace = (val: any) => {
171173
checkedWorkspace.value = checkedWorkspace.value.filter((ele: any) => ele.id !== val.id)
174+
checkTableList.value = checkTableList.value.filter((ele: any) => ele.id !== val.id)
172175
handleCheckedWorkspaceChange(checkedWorkspace.value)
173176
}
174177
@@ -179,7 +182,7 @@ const clearWorkspaceAll = () => {
179182
180183
defineExpose({
181184
open,
182-
checkedWorkspace,
185+
checkTableList,
183186
})
184187
</script>
185188
<style lang="less">

frontend/src/views/system/permission/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ const saveHandler = () => {
438438
})
439439
}
440440
const preview = () => {
441-
currentPermission.user = selectPermissionRef.value.checkedWorkspace.map((ele: any) => ele.id)
441+
currentPermission.user = selectPermissionRef.value.checkTableList.map((ele: any) => ele.id)
442442
activeStep.value = 0
443443
}
444444
const next = () => {
@@ -479,7 +479,7 @@ const save = () => {
479479
permissions: permissionsObj,
480480
users:
481481
isCreate.value || activeStep.value === 1
482-
? selectPermissionRef.value.checkedWorkspace.map((ele: any) => ele.id)
482+
? selectPermissionRef.value.checkTableList.map((ele: any) => ele.id)
483483
: users,
484484
}
485485
if (!id) {

frontend/src/views/system/workspace/AuthorizedWorkspaceDialog.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ const workspaceWithKeywords = computed(() => {
137137
})
138138
watch(search, () => {
139139
const tableNameArr = workspaceWithKeywords.value.map((ele: any) => ele.name)
140-
checkedWorkspace.value = checkTableList.value.filter((ele) => tableNameArr.includes(ele.name))
140+
checkedWorkspace.value = checkTableList.value.filter((ele: any) =>
141+
tableNameArr.includes(ele.name)
142+
)
141143
const checkedCount = checkedWorkspace.value.length
142144
checkAll.value = checkedCount === workspaceWithKeywords.value.length
143145
isIndeterminate.value = checkedCount > 0 && checkedCount < workspaceWithKeywords.value.length
@@ -148,7 +150,7 @@ const handleCheckAllChange = (val: CheckboxValueType) => {
148150
? [
149151
...new Set([
150152
...workspaceWithKeywords.value,
151-
...checkedWorkspace.value.filter((ele) => !tableNameArr.includes(ele.name)),
153+
...checkedWorkspace.value.filter((ele: any) => !tableNameArr.includes(ele.name)),
152154
]),
153155
]
154156
: []
@@ -157,10 +159,10 @@ const handleCheckAllChange = (val: CheckboxValueType) => {
157159
? [
158160
...new Set([
159161
...workspaceWithKeywords.value,
160-
...checkTableList.value.filter((ele) => !tableNameArr.includes(ele.name)),
162+
...checkTableList.value.filter((ele: any) => !tableNameArr.includes(ele.name)),
161163
]),
162164
]
163-
: checkTableList.value.filter((ele) => !tableNameArr.includes(ele.name))
165+
: checkTableList.value.filter((ele: any) => !tableNameArr.includes(ele.name))
164166
}
165167
const handleCheckedWorkspaceChange = (value: CheckboxValueType[]) => {
166168
const checkedCount = value.length
@@ -169,7 +171,7 @@ const handleCheckedWorkspaceChange = (value: CheckboxValueType[]) => {
169171
const tableNameArr = workspaceWithKeywords.value.map((ele: any) => ele.name)
170172
checkTableList.value = [
171173
...new Set([
172-
...checkTableList.value.filter((ele) => !tableNameArr.includes(ele.name)),
174+
...checkTableList.value.filter((ele: any) => !tableNameArr.includes(ele.name)),
173175
...value,
174176
]),
175177
]
@@ -192,7 +194,7 @@ const open = async (id: any) => {
192194
const emits = defineEmits(['refresh'])
193195
const handleConfirm = () => {
194196
workspaceUwsCreate({
195-
uid_list: checkedWorkspace.value.map((ele: any) => ele.id),
197+
uid_list: checkTableList.value.map((ele: any) => ele.id),
196198
oid,
197199
weight: listType.value,
198200
}).then(() => {
@@ -203,6 +205,7 @@ const handleConfirm = () => {
203205
204206
const clearWorkspace = (val: any) => {
205207
checkedWorkspace.value = checkedWorkspace.value.filter((ele: any) => ele.id !== val.id)
208+
checkTableList.value = checkTableList.value.filter((ele: any) => ele.id !== val.id)
206209
handleCheckedWorkspaceChange(checkedWorkspace.value)
207210
}
208211

0 commit comments

Comments
 (0)