bfg-common 1.5.765 → 1.5.766
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/localization/local_be.json +3 -1
- package/assets/localization/local_en.json +3 -1
- package/assets/localization/local_hy.json +3 -1
- package/assets/localization/local_kk.json +3 -1
- package/assets/localization/local_ru.json +3 -1
- package/assets/localization/local_zh.json +3 -1
- package/components/common/backup/storage/actions/delete/Delete.vue +37 -15
- package/components/common/configure/securityProfile/SecurityProfile.vue +17 -17
- package/components/common/configure/securityProfile/lockdownMode/LockdownMode.vue +109 -109
- package/components/common/configure/securityProfile/lockdownMode/lib/utils/constructData.ts +27 -27
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/LockdownModeEdit.vue +61 -61
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/New.vue +5 -5
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/Old.vue +109 -109
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/ExceptionUsers.vue +28 -28
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/New.vue +5 -5
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/Old.vue +179 -179
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/table.ts +64 -64
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/tableKeys.ts +6 -6
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/models/types.ts +1 -1
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lib/config/tabs.ts +19 -19
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lockdownMode/LockdownMode.vue +22 -22
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lockdownMode/New.vue +5 -5
- package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/lockdownMode/Old.vue +76 -76
- package/components/common/configure/securityProfile/lockdownMode/tools/New.vue +5 -5
- package/components/common/configure/securityProfile/lockdownMode/tools/Old.vue +30 -30
- package/components/common/configure/securityProfile/lockdownMode/tools/Tools.vue +29 -29
- package/package.json +1 -1
- package/store/inventory/modules/configure/securityProfile/lib/models/interfaces.ts +12 -12
package/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/Old.vue
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<atoms-modal
|
|
3
|
-
:title="props.title"
|
|
4
|
-
width="862px"
|
|
5
|
-
class="lockdown-mode-edit"
|
|
6
|
-
test-id="lockdown-mode-edit"
|
|
7
|
-
show
|
|
8
|
-
@hide="emits('hide')"
|
|
9
|
-
@submit="emits('submit')"
|
|
10
|
-
>
|
|
11
|
-
<template #modalBody>
|
|
12
|
-
<div class="flex column-gap-6 lockdown-mode-edit__content">
|
|
13
|
-
<atoms-tabs-vertical-tabs
|
|
14
|
-
v-model="selectedTab"
|
|
15
|
-
:items="props.tabItems"
|
|
16
|
-
test-id="lockdown-mode-edit-tabs"
|
|
17
|
-
class="lockdown-mode-edit__tabs"
|
|
18
|
-
/>
|
|
19
|
-
|
|
20
|
-
<common-configure-security-profile-lockdown-mode-modals-lockdown-mode-edit-lockdown-mode
|
|
21
|
-
v-if="selectedTab === 1"
|
|
22
|
-
v-model:form="localEditData"
|
|
23
|
-
/>
|
|
24
|
-
|
|
25
|
-
<common-configure-security-profile-lockdown-mode-modals-lockdown-mode-edit-exception-users
|
|
26
|
-
v-if="selectedTab === 2"
|
|
27
|
-
v-model:form="localEditData"
|
|
28
|
-
@add="emits('add-new-user', $event)"
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
</atoms-modal>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script lang="ts" setup>
|
|
36
|
-
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
37
|
-
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
38
|
-
|
|
39
|
-
const selectedTab = defineModel<number>('selectedTab', { required: true })
|
|
40
|
-
const localEditData = defineModel<UI_I_LockdownModeData>('localEditData', {
|
|
41
|
-
required: true,
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const props = defineProps<{
|
|
45
|
-
title: string
|
|
46
|
-
tabItems: UI_I_VerticalTabs[]
|
|
47
|
-
}>()
|
|
48
|
-
|
|
49
|
-
const emits = defineEmits<{
|
|
50
|
-
(event: 'add-new-user', value: string): void
|
|
51
|
-
(event: 'hide'): void
|
|
52
|
-
(event: 'submit'): void
|
|
53
|
-
}>()
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<style lang="scss" scoped>
|
|
57
|
-
.lockdown-mode-edit {
|
|
58
|
-
&__content {
|
|
59
|
-
height: inherit;
|
|
60
|
-
}
|
|
61
|
-
&__tabs {
|
|
62
|
-
&.vertical-groups-sidenav {
|
|
63
|
-
background: initial;
|
|
64
|
-
&.sidenav {
|
|
65
|
-
border-right: 0;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
&__alert {
|
|
70
|
-
margin-bottom: 10px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:deep(.modal-body) {
|
|
74
|
-
height: inherit;
|
|
75
|
-
|
|
76
|
-
.custom-radio-label {
|
|
77
|
-
padding-left: 23px;
|
|
78
|
-
}
|
|
79
|
-
.add-new-name-input {
|
|
80
|
-
width: 170px;
|
|
81
|
-
}
|
|
82
|
-
.sub-text-input {
|
|
83
|
-
position: absolute;
|
|
84
|
-
left: 0;
|
|
85
|
-
top: 22px;
|
|
86
|
-
font-size: 11px;
|
|
87
|
-
}
|
|
88
|
-
.add-user-btn {
|
|
89
|
-
margin-left: 20px;
|
|
90
|
-
text-transform: uppercase;
|
|
91
|
-
color: #0079ad;
|
|
92
|
-
font-size: 11px;
|
|
93
|
-
cursor: pointer;
|
|
94
|
-
font-weight: 500;
|
|
95
|
-
|
|
96
|
-
&:hover {
|
|
97
|
-
color: #00608a;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
.ellipsis-vertical-btn {
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
|
|
103
|
-
svg {
|
|
104
|
-
width: 15px;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-modal
|
|
3
|
+
:title="props.title"
|
|
4
|
+
width="862px"
|
|
5
|
+
class="lockdown-mode-edit"
|
|
6
|
+
test-id="lockdown-mode-edit"
|
|
7
|
+
show
|
|
8
|
+
@hide="emits('hide')"
|
|
9
|
+
@submit="emits('submit')"
|
|
10
|
+
>
|
|
11
|
+
<template #modalBody>
|
|
12
|
+
<div class="flex column-gap-6 lockdown-mode-edit__content">
|
|
13
|
+
<atoms-tabs-vertical-tabs
|
|
14
|
+
v-model="selectedTab"
|
|
15
|
+
:items="props.tabItems"
|
|
16
|
+
test-id="lockdown-mode-edit-tabs"
|
|
17
|
+
class="lockdown-mode-edit__tabs"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<common-configure-security-profile-lockdown-mode-modals-lockdown-mode-edit-lockdown-mode
|
|
21
|
+
v-if="selectedTab === 1"
|
|
22
|
+
v-model:form="localEditData"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<common-configure-security-profile-lockdown-mode-modals-lockdown-mode-edit-exception-users
|
|
26
|
+
v-if="selectedTab === 2"
|
|
27
|
+
v-model:form="localEditData"
|
|
28
|
+
@add="emits('add-new-user', $event)"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
</atoms-modal>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script lang="ts" setup>
|
|
36
|
+
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
37
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
38
|
+
|
|
39
|
+
const selectedTab = defineModel<number>('selectedTab', { required: true })
|
|
40
|
+
const localEditData = defineModel<UI_I_LockdownModeData>('localEditData', {
|
|
41
|
+
required: true,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const props = defineProps<{
|
|
45
|
+
title: string
|
|
46
|
+
tabItems: UI_I_VerticalTabs[]
|
|
47
|
+
}>()
|
|
48
|
+
|
|
49
|
+
const emits = defineEmits<{
|
|
50
|
+
(event: 'add-new-user', value: string): void
|
|
51
|
+
(event: 'hide'): void
|
|
52
|
+
(event: 'submit'): void
|
|
53
|
+
}>()
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.lockdown-mode-edit {
|
|
58
|
+
&__content {
|
|
59
|
+
height: inherit;
|
|
60
|
+
}
|
|
61
|
+
&__tabs {
|
|
62
|
+
&.vertical-groups-sidenav {
|
|
63
|
+
background: initial;
|
|
64
|
+
&.sidenav {
|
|
65
|
+
border-right: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
&__alert {
|
|
70
|
+
margin-bottom: 10px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:deep(.modal-body) {
|
|
74
|
+
height: inherit;
|
|
75
|
+
|
|
76
|
+
.custom-radio-label {
|
|
77
|
+
padding-left: 23px;
|
|
78
|
+
}
|
|
79
|
+
.add-new-name-input {
|
|
80
|
+
width: 170px;
|
|
81
|
+
}
|
|
82
|
+
.sub-text-input {
|
|
83
|
+
position: absolute;
|
|
84
|
+
left: 0;
|
|
85
|
+
top: 22px;
|
|
86
|
+
font-size: 11px;
|
|
87
|
+
}
|
|
88
|
+
.add-user-btn {
|
|
89
|
+
margin-left: 20px;
|
|
90
|
+
text-transform: uppercase;
|
|
91
|
+
color: #0079ad;
|
|
92
|
+
font-size: 11px;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
color: #00608a;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.ellipsis-vertical-btn {
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
|
|
103
|
+
svg {
|
|
104
|
+
width: 15px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="currentComponent"
|
|
4
|
-
v-model:local-edit-data="form"
|
|
5
|
-
@add="emits('add', $event)"
|
|
6
|
-
/>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script setup lang="ts">
|
|
10
|
-
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
11
|
-
|
|
12
|
-
const form = defineModel<UI_I_LockdownModeData>('form')
|
|
13
|
-
|
|
14
|
-
const emits = defineEmits<{
|
|
15
|
-
(event: 'add', value: string): void
|
|
16
|
-
}>()
|
|
17
|
-
|
|
18
|
-
const { $store }: any = useNuxtApp()
|
|
19
|
-
|
|
20
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
21
|
-
const currentComponent = computed(() =>
|
|
22
|
-
isNewView.value
|
|
23
|
-
? defineAsyncComponent(() => import('./New.vue'))
|
|
24
|
-
: defineAsyncComponent(() => import('./old/Old.vue'))
|
|
25
|
-
)
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model:local-edit-data="form"
|
|
5
|
+
@add="emits('add', $event)"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
11
|
+
|
|
12
|
+
const form = defineModel<UI_I_LockdownModeData>('form')
|
|
13
|
+
|
|
14
|
+
const emits = defineEmits<{
|
|
15
|
+
(event: 'add', value: string): void
|
|
16
|
+
}>()
|
|
17
|
+
|
|
18
|
+
const { $store }: any = useNuxtApp()
|
|
19
|
+
|
|
20
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
21
|
+
const currentComponent = computed(() =>
|
|
22
|
+
isNewView.value
|
|
23
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
24
|
+
: defineAsyncComponent(() => import('./old/Old.vue'))
|
|
25
|
+
)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<template>New</template>
|
|
2
|
-
|
|
3
|
-
<script setup lang="ts"></script>
|
|
4
|
-
|
|
5
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>New</template>
|
|
2
|
+
|
|
3
|
+
<script setup lang="ts"></script>
|
|
4
|
+
|
|
5
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,179 +1,179 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="exception-users">
|
|
3
|
-
<h5 class="font-bold">
|
|
4
|
-
{{ localization.configureSecurityProfile.exceptionUsers }}
|
|
5
|
-
</h5>
|
|
6
|
-
<label>
|
|
7
|
-
{{ localization.configureSecurityProfile.exceptionUsersDesc }}
|
|
8
|
-
<span class="relative">
|
|
9
|
-
<input v-model="newUserName" type="text" class="add-new-name-input" />
|
|
10
|
-
<span class="sub-text-input">
|
|
11
|
-
{{ localization.configureSecurityProfile.separateUsersWithCommas }}
|
|
12
|
-
</span>
|
|
13
|
-
</span>
|
|
14
|
-
<span class="add-user-btn" @click="emits('add', newUserName)">
|
|
15
|
-
{{ localization.common.addUser }}
|
|
16
|
-
</span>
|
|
17
|
-
</label>
|
|
18
|
-
|
|
19
|
-
<div class="mt-3">
|
|
20
|
-
<atoms-table-data-grid
|
|
21
|
-
v-model:column-keys="columnItems"
|
|
22
|
-
:head-items="headItems"
|
|
23
|
-
:body-items="bodyItems"
|
|
24
|
-
:total-items="bodyItems.length"
|
|
25
|
-
:page-size="100"
|
|
26
|
-
:page="1"
|
|
27
|
-
:total-pages="1"
|
|
28
|
-
test-id="exception-users-table"
|
|
29
|
-
hide-pagination
|
|
30
|
-
hide-page-size
|
|
31
|
-
off-select-by-row
|
|
32
|
-
server-off
|
|
33
|
-
>
|
|
34
|
-
<template #col1="{ item }">
|
|
35
|
-
<div class="data-table__action-icon">
|
|
36
|
-
<atoms-popover
|
|
37
|
-
:test-id="`${item.data.id}-popover`"
|
|
38
|
-
@click="onShowTooltip(item.data.id)"
|
|
39
|
-
>
|
|
40
|
-
<template #elem>
|
|
41
|
-
<span class="ellipsis-vertical-btn">
|
|
42
|
-
<atoms-the-icon name="ellipsis-vertical" />
|
|
43
|
-
</span>
|
|
44
|
-
</template>
|
|
45
|
-
<template #content>
|
|
46
|
-
<div v-if="showTooltip && item.data.id === selectedUserId">
|
|
47
|
-
<div class="action-container">
|
|
48
|
-
<div class="action-wrap relative">
|
|
49
|
-
<button
|
|
50
|
-
:data-id="`${item.data.id}-remove-button`"
|
|
51
|
-
class="action"
|
|
52
|
-
@click="onRemoveUser(item.data.name)"
|
|
53
|
-
>
|
|
54
|
-
{{ localization.common.removeUser }}
|
|
55
|
-
</button>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
|
-
</atoms-popover>
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</atoms-table-data-grid>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
|
-
|
|
68
|
-
<script setup lang="ts">
|
|
69
|
-
import type {
|
|
70
|
-
UI_I_HeadItem,
|
|
71
|
-
UI_I_BodyItem,
|
|
72
|
-
} from '~/components/atoms/table/compact/lib/models/interfaces'
|
|
73
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
74
|
-
import type { UI_I_ColumnKey } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
75
|
-
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
76
|
-
import * as exceptionUsersTable from '~/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/table'
|
|
77
|
-
|
|
78
|
-
const localEditData = defineModel<UI_I_LockdownModeData>('localEditData', {
|
|
79
|
-
required: true,
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
const emits = defineEmits<{
|
|
83
|
-
(event: 'add', value: string): void
|
|
84
|
-
}>()
|
|
85
|
-
|
|
86
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
87
|
-
|
|
88
|
-
const newUserName = ref<string>('')
|
|
89
|
-
|
|
90
|
-
const columnItems = computed<UI_I_ColumnKey[]>(() =>
|
|
91
|
-
exceptionUsersTable.columnKeys(localization.value)
|
|
92
|
-
)
|
|
93
|
-
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
94
|
-
exceptionUsersTable.headItems(localization.value)
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
98
|
-
watch(
|
|
99
|
-
localEditData,
|
|
100
|
-
(newValue) => {
|
|
101
|
-
if (!newValue.exceptionUsers?.length) {
|
|
102
|
-
bodyItems.value = []
|
|
103
|
-
return
|
|
104
|
-
}
|
|
105
|
-
bodyItems.value = exceptionUsersTable.bodyItems(newValue.exceptionUsers)
|
|
106
|
-
},
|
|
107
|
-
{ immediate: true, deep: true }
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
const selectedUserId = ref<number | null>(null)
|
|
111
|
-
const showTooltip = ref<boolean>(false)
|
|
112
|
-
const onShowTooltip = (id: number): void => {
|
|
113
|
-
selectedUserId.value = id
|
|
114
|
-
showTooltip.value = true
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const onRemoveUser = (value: string): void => {
|
|
118
|
-
localEditData.value.exceptionUsers =
|
|
119
|
-
localEditData.value.exceptionUsers.filter((item) => item !== value)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const hideActionsPopover = (): void => {
|
|
123
|
-
showTooltip.value = false
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// TODO удалить потом это
|
|
127
|
-
onMounted(() => {
|
|
128
|
-
setTimeout(() => {
|
|
129
|
-
window.addEventListener('click', hideActionsPopover)
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
onUnmounted(() => {
|
|
133
|
-
window.removeEventListener('click', hideActionsPopover)
|
|
134
|
-
})
|
|
135
|
-
</script>
|
|
136
|
-
|
|
137
|
-
<style scoped lang="scss">
|
|
138
|
-
.action-container {
|
|
139
|
-
position: absolute;
|
|
140
|
-
top: -33px;
|
|
141
|
-
left: 5px;
|
|
142
|
-
background: var(--block-view-bg-color2);
|
|
143
|
-
border: 1px solid var(--block-border-color);
|
|
144
|
-
padding: 5px 6px;
|
|
145
|
-
border-radius: 3px;
|
|
146
|
-
|
|
147
|
-
.action-wrap {
|
|
148
|
-
&::after {
|
|
149
|
-
content: '';
|
|
150
|
-
display: block;
|
|
151
|
-
position: absolute;
|
|
152
|
-
width: 8px;
|
|
153
|
-
height: 8px;
|
|
154
|
-
background: var(--block-view-bg-color2);
|
|
155
|
-
transform: rotate(45deg);
|
|
156
|
-
left: -11px;
|
|
157
|
-
bottom: calc(50% - 4px);
|
|
158
|
-
border-left: 0.5px solid var(--block-border-color);
|
|
159
|
-
border-bottom: 0.5px solid var(--block-border-color);
|
|
160
|
-
z-index: var(--z-dropdown);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
.action {
|
|
164
|
-
border: none;
|
|
165
|
-
padding: 1px 20px;
|
|
166
|
-
width: 100%;
|
|
167
|
-
text-align: left;
|
|
168
|
-
cursor: pointer;
|
|
169
|
-
background: var(--block-view-bg-color2);
|
|
170
|
-
color: var(--global-font-color3);
|
|
171
|
-
white-space: nowrap;
|
|
172
|
-
text-transform: capitalize;
|
|
173
|
-
|
|
174
|
-
&:hover {
|
|
175
|
-
background: var(--vertical-nav-hover-bg-color);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="exception-users">
|
|
3
|
+
<h5 class="font-bold">
|
|
4
|
+
{{ localization.configureSecurityProfile.exceptionUsers }}
|
|
5
|
+
</h5>
|
|
6
|
+
<label>
|
|
7
|
+
{{ localization.configureSecurityProfile.exceptionUsersDesc }}
|
|
8
|
+
<span class="relative">
|
|
9
|
+
<input v-model="newUserName" type="text" class="add-new-name-input" />
|
|
10
|
+
<span class="sub-text-input">
|
|
11
|
+
{{ localization.configureSecurityProfile.separateUsersWithCommas }}
|
|
12
|
+
</span>
|
|
13
|
+
</span>
|
|
14
|
+
<span class="add-user-btn" @click="emits('add', newUserName)">
|
|
15
|
+
{{ localization.common.addUser }}
|
|
16
|
+
</span>
|
|
17
|
+
</label>
|
|
18
|
+
|
|
19
|
+
<div class="mt-3">
|
|
20
|
+
<atoms-table-data-grid
|
|
21
|
+
v-model:column-keys="columnItems"
|
|
22
|
+
:head-items="headItems"
|
|
23
|
+
:body-items="bodyItems"
|
|
24
|
+
:total-items="bodyItems.length"
|
|
25
|
+
:page-size="100"
|
|
26
|
+
:page="1"
|
|
27
|
+
:total-pages="1"
|
|
28
|
+
test-id="exception-users-table"
|
|
29
|
+
hide-pagination
|
|
30
|
+
hide-page-size
|
|
31
|
+
off-select-by-row
|
|
32
|
+
server-off
|
|
33
|
+
>
|
|
34
|
+
<template #col1="{ item }">
|
|
35
|
+
<div class="data-table__action-icon">
|
|
36
|
+
<atoms-popover
|
|
37
|
+
:test-id="`${item.data.id}-popover`"
|
|
38
|
+
@click="onShowTooltip(item.data.id)"
|
|
39
|
+
>
|
|
40
|
+
<template #elem>
|
|
41
|
+
<span class="ellipsis-vertical-btn">
|
|
42
|
+
<atoms-the-icon name="ellipsis-vertical" />
|
|
43
|
+
</span>
|
|
44
|
+
</template>
|
|
45
|
+
<template #content>
|
|
46
|
+
<div v-if="showTooltip && item.data.id === selectedUserId">
|
|
47
|
+
<div class="action-container">
|
|
48
|
+
<div class="action-wrap relative">
|
|
49
|
+
<button
|
|
50
|
+
:data-id="`${item.data.id}-remove-button`"
|
|
51
|
+
class="action"
|
|
52
|
+
@click="onRemoveUser(item.data.name)"
|
|
53
|
+
>
|
|
54
|
+
{{ localization.common.removeUser }}
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
</atoms-popover>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</atoms-table-data-grid>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup lang="ts">
|
|
69
|
+
import type {
|
|
70
|
+
UI_I_HeadItem,
|
|
71
|
+
UI_I_BodyItem,
|
|
72
|
+
} from '~/components/atoms/table/compact/lib/models/interfaces'
|
|
73
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
74
|
+
import type { UI_I_ColumnKey } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
75
|
+
import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
|
|
76
|
+
import * as exceptionUsersTable from '~/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/table'
|
|
77
|
+
|
|
78
|
+
const localEditData = defineModel<UI_I_LockdownModeData>('localEditData', {
|
|
79
|
+
required: true,
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const emits = defineEmits<{
|
|
83
|
+
(event: 'add', value: string): void
|
|
84
|
+
}>()
|
|
85
|
+
|
|
86
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
87
|
+
|
|
88
|
+
const newUserName = ref<string>('')
|
|
89
|
+
|
|
90
|
+
const columnItems = computed<UI_I_ColumnKey[]>(() =>
|
|
91
|
+
exceptionUsersTable.columnKeys(localization.value)
|
|
92
|
+
)
|
|
93
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
94
|
+
exceptionUsersTable.headItems(localization.value)
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
98
|
+
watch(
|
|
99
|
+
localEditData,
|
|
100
|
+
(newValue) => {
|
|
101
|
+
if (!newValue.exceptionUsers?.length) {
|
|
102
|
+
bodyItems.value = []
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
bodyItems.value = exceptionUsersTable.bodyItems(newValue.exceptionUsers)
|
|
106
|
+
},
|
|
107
|
+
{ immediate: true, deep: true }
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
const selectedUserId = ref<number | null>(null)
|
|
111
|
+
const showTooltip = ref<boolean>(false)
|
|
112
|
+
const onShowTooltip = (id: number): void => {
|
|
113
|
+
selectedUserId.value = id
|
|
114
|
+
showTooltip.value = true
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const onRemoveUser = (value: string): void => {
|
|
118
|
+
localEditData.value.exceptionUsers =
|
|
119
|
+
localEditData.value.exceptionUsers.filter((item) => item !== value)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const hideActionsPopover = (): void => {
|
|
123
|
+
showTooltip.value = false
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// TODO удалить потом это
|
|
127
|
+
onMounted(() => {
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
window.addEventListener('click', hideActionsPopover)
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
onUnmounted(() => {
|
|
133
|
+
window.removeEventListener('click', hideActionsPopover)
|
|
134
|
+
})
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<style scoped lang="scss">
|
|
138
|
+
.action-container {
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: -33px;
|
|
141
|
+
left: 5px;
|
|
142
|
+
background: var(--block-view-bg-color2);
|
|
143
|
+
border: 1px solid var(--block-border-color);
|
|
144
|
+
padding: 5px 6px;
|
|
145
|
+
border-radius: 3px;
|
|
146
|
+
|
|
147
|
+
.action-wrap {
|
|
148
|
+
&::after {
|
|
149
|
+
content: '';
|
|
150
|
+
display: block;
|
|
151
|
+
position: absolute;
|
|
152
|
+
width: 8px;
|
|
153
|
+
height: 8px;
|
|
154
|
+
background: var(--block-view-bg-color2);
|
|
155
|
+
transform: rotate(45deg);
|
|
156
|
+
left: -11px;
|
|
157
|
+
bottom: calc(50% - 4px);
|
|
158
|
+
border-left: 0.5px solid var(--block-border-color);
|
|
159
|
+
border-bottom: 0.5px solid var(--block-border-color);
|
|
160
|
+
z-index: var(--z-dropdown);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.action {
|
|
164
|
+
border: none;
|
|
165
|
+
padding: 1px 20px;
|
|
166
|
+
width: 100%;
|
|
167
|
+
text-align: left;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
background: var(--block-view-bg-color2);
|
|
170
|
+
color: var(--global-font-color3);
|
|
171
|
+
white-space: nowrap;
|
|
172
|
+
text-transform: capitalize;
|
|
173
|
+
|
|
174
|
+
&:hover {
|
|
175
|
+
background: var(--vertical-nav-hover-bg-color);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
</style>
|