@antcde/component-library 0.1.0 → 0.1.2
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/README.md +6 -0
- package/dist/component-library.css +1 -1
- package/dist/index.js +16719 -17759
- package/dist/types/components/BaseAppCard.vue.d.ts +18 -4
- package/dist/types/components/BaseAppCardSkeleton.vue.d.ts +2 -0
- package/dist/types/components/BaseDeleteDialog.vue.d.ts +20 -7
- package/dist/types/components/RBAC/Permissions/PermissionCard.vue.d.ts +1 -1
- package/dist/types/components/TasksFlow/useTaskFlow.d.ts +7 -6
- package/dist/types/index.d.ts +3 -1
- package/lib/DocumentManager/DocumentDrop.vue +2 -6
- package/lib/DocumentManager/DocumentManager.vue +48 -41
- package/lib/DocumentManager/hooks/useDms.ts +1 -3
- package/lib/DocumentManager/index.ts +1 -1
- package/lib/DocumentManager/lang/translations/de.json +36 -0
- package/lib/DocumentManager/lang/translations/en.json +38 -0
- package/lib/DocumentManager/lang/translations/nl.json +36 -0
- package/lib/DocumentManager/utils.ts +1 -1
- package/lib/ForgeViewer/ForgeViewer.vue +6 -5
- package/lib/ForgeViewer/lang/translations/de.json +6 -0
- package/lib/ForgeViewer/lang/translations/en.json +6 -0
- package/lib/ForgeViewer/lang/translations/nl.json +6 -0
- package/lib/ForgeViewer/useForgeViewer.ts +0 -1
- package/lib/GisViewer/GisViewer.vue +14 -8
- package/lib/GisViewer/useGisViewer.ts +3 -3
- package/package.json +4 -3
- package/lib/DocumentManager/hooks/useDarkMode.ts +0 -17
- package/lib/TableViewer/TableView.vue +0 -39
- package/lib/TableViewer/TableViewer.vue +0 -205
- package/lib/TableViewer/composables/records.ts +0 -53
- package/lib/TableViewer/composables/useFile.ts +0 -20
- package/lib/TableViewer/core/Columns/ColumnForm.vue +0 -230
- package/lib/TableViewer/core/Columns/ColumnsConfiguration.vue +0 -99
- package/lib/TableViewer/core/Columns/ColumnsConfigurationTable.vue +0 -186
- package/lib/TableViewer/core/Columns/ColumnsTable.vue +0 -165
- package/lib/TableViewer/core/Permissions/PermissionDialog.vue +0 -149
- package/lib/TableViewer/core/Permissions/PermissionForm.vue +0 -117
- package/lib/TableViewer/core/Permissions/PermissionsConfiguration.vue +0 -55
- package/lib/TableViewer/core/Permissions/PermissionsConfigurationTable.vue +0 -185
- package/lib/TableViewer/core/Permissions/PermissionsTable.vue +0 -207
- package/lib/TableViewer/core/Queries/QueriesMenu.vue +0 -75
- package/lib/TableViewer/core/Queries/QueryItem.vue +0 -112
- package/lib/TableViewer/core/Records/RecordCell.vue +0 -118
- package/lib/TableViewer/core/Records/RecordDialog.vue +0 -128
- package/lib/TableViewer/core/Records/RecordHeader.vue +0 -175
- package/lib/TableViewer/core/Records/RecordInput.vue +0 -183
- package/lib/TableViewer/core/Records/RecordValue.vue +0 -123
- package/lib/TableViewer/core/Records/RecordsTable.vue +0 -233
- package/lib/TableViewer/core/Records/RecordsTableToolbar.vue +0 -310
- package/lib/TableViewer/core/Relations/RelationForm.vue +0 -154
- package/lib/TableViewer/core/Relations/RelationsConfiguration.vue +0 -32
- package/lib/TableViewer/core/Relations/RelationsConfigurationTable.vue +0 -146
- package/lib/TableViewer/core/Relations/RelationsTable.vue +0 -129
- package/lib/TableViewer/core/Revisions/RevisionComparisonCell.vue +0 -50
- package/lib/TableViewer/core/Revisions/RevisionComparisonTable.vue +0 -98
- package/lib/TableViewer/core/Revisions/RevisionHistory.vue +0 -138
- package/lib/TableViewer/core/Revisions/RevisionSelector.vue +0 -140
- package/lib/TableViewer/index.ts +0 -4
- package/lib/TableViewer/services/file-handler.ts +0 -84
- package/lib/TableViewer/stores/client.ts +0 -18
- package/lib/TableViewer/stores/columns.ts +0 -152
- package/lib/TableViewer/stores/conditions.ts +0 -88
- package/lib/TableViewer/stores/permissions.ts +0 -102
- package/lib/TableViewer/stores/queries.ts +0 -80
- package/lib/TableViewer/stores/records.ts +0 -256
- package/lib/TableViewer/stores/relations.ts +0 -89
- package/lib/TableViewer/stores/revisions.ts +0 -194
- package/lib/TableViewer/stores/roles.ts +0 -109
- package/lib/TableViewer/stores/table.ts +0 -134
- package/lib/TableViewer/stores/tables.ts +0 -65
- package/lib/TableViewer/types/app.d.ts +0 -5
- package/lib/TableViewer/types/column.d.ts +0 -28
- package/lib/TableViewer/types/permission.d.ts +0 -12
- package/lib/TableViewer/types/project.d.ts +0 -37
- package/lib/TableViewer/types/tables.d.ts +0 -69
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { Column } from '@antcde/connect-ts/services/ColumnService'
|
|
3
|
-
import { storeToRefs } from 'pinia'
|
|
4
|
-
import { ref, watch } from 'vue'
|
|
5
|
-
import { useColumnStore } from '../../stores/columns'
|
|
6
|
-
import ColumnForm from './ColumnForm.vue'
|
|
7
|
-
import ColumnsTable from './ColumnsTable.vue'
|
|
8
|
-
import { useI18n } from 'vue-i18n'
|
|
9
|
-
|
|
10
|
-
const { t } = useI18n()
|
|
11
|
-
|
|
12
|
-
const props = defineProps<{
|
|
13
|
-
displayed: boolean
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
const emit = defineEmits(['close'])
|
|
17
|
-
|
|
18
|
-
const columnStore = useColumnStore()
|
|
19
|
-
const { columns, isFetching, isDeleting } = storeToRefs(columnStore)
|
|
20
|
-
|
|
21
|
-
const isColumnDeleteShown = ref(false)
|
|
22
|
-
const isColumnFormShown = ref(false)
|
|
23
|
-
const selectedColumn = ref<Column | null>(null)
|
|
24
|
-
|
|
25
|
-
function setupColumnDelete(column: Column) {
|
|
26
|
-
selectedColumn.value = column
|
|
27
|
-
isColumnDeleteShown.value = true
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function closeColumnDeleteDialog() {
|
|
31
|
-
selectedColumn.value = null
|
|
32
|
-
isColumnDeleteShown.value = false
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function deleteColumn() {
|
|
36
|
-
if (selectedColumn.value) {
|
|
37
|
-
await columnStore.deleteColumn(selectedColumn.value)
|
|
38
|
-
closeColumnDeleteDialog()
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function setupColumnUpdate(column: Column) {
|
|
43
|
-
selectedColumn.value = column
|
|
44
|
-
isColumnFormShown.value = true
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function setupColumnCreate() {
|
|
48
|
-
selectedColumn.value = null
|
|
49
|
-
isColumnFormShown.value = true
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function hideColumnForm() {
|
|
53
|
-
isColumnFormShown.value = false
|
|
54
|
-
selectedColumn.value = null
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function reset() {
|
|
58
|
-
selectedColumn.value = null
|
|
59
|
-
isColumnDeleteShown.value = false
|
|
60
|
-
isColumnFormShown.value = false
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
watch(() => props.displayed, reset)
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<template>
|
|
67
|
-
<v-dialog
|
|
68
|
-
width="1200"
|
|
69
|
-
height="580"
|
|
70
|
-
:model-value="displayed"
|
|
71
|
-
@update:model-value="emit('close')"
|
|
72
|
-
>
|
|
73
|
-
<v-card class="h-full overflow-auto">
|
|
74
|
-
<column-form v-if="isColumnFormShown" :column="selectedColumn" @close="hideColumnForm" />
|
|
75
|
-
|
|
76
|
-
<columns-table
|
|
77
|
-
v-if="!isColumnFormShown"
|
|
78
|
-
:columns="columns"
|
|
79
|
-
:is-fetching="isFetching"
|
|
80
|
-
@open-column-update="setupColumnUpdate"
|
|
81
|
-
@open-column-delete="setupColumnDelete"
|
|
82
|
-
@open-column-create="setupColumnCreate"
|
|
83
|
-
@close="emit('close')"
|
|
84
|
-
/>
|
|
85
|
-
</v-card>
|
|
86
|
-
</v-dialog>
|
|
87
|
-
|
|
88
|
-
<base-delete-dialog
|
|
89
|
-
:delete-action="deleteColumn"
|
|
90
|
-
:displayed="isColumnDeleteShown"
|
|
91
|
-
:is-loading="isDeleting"
|
|
92
|
-
:title="
|
|
93
|
-
t('project.tableConfig.columns.deleteTitle', {
|
|
94
|
-
column: selectedColumn?.name,
|
|
95
|
-
})
|
|
96
|
-
"
|
|
97
|
-
@close="closeColumnDeleteDialog"
|
|
98
|
-
/>
|
|
99
|
-
</template>
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { Column } from '@antcde/connect-ts/services/ColumnService'
|
|
3
|
-
import BaseClickableIcon from '@/components/BaseClickableIcon.vue'
|
|
4
|
-
import { storeToRefs } from 'pinia'
|
|
5
|
-
import { ref } from 'vue'
|
|
6
|
-
import { useColumnStore } from '../../stores/columns'
|
|
7
|
-
|
|
8
|
-
import ColumnDialog from '../Columns/ColumnDialog.vue'
|
|
9
|
-
|
|
10
|
-
interface ColumnHeader {
|
|
11
|
-
title: string
|
|
12
|
-
key: string
|
|
13
|
-
align?: 'start' | 'center' | 'end'
|
|
14
|
-
sortable?: boolean
|
|
15
|
-
hasSlot?: boolean
|
|
16
|
-
checkbox?: boolean
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const columnStore = useColumnStore()
|
|
20
|
-
const { columns, isFetching, isDeleting } = storeToRefs(columnStore)
|
|
21
|
-
|
|
22
|
-
const columnHeaders: ColumnHeader[] = [
|
|
23
|
-
{
|
|
24
|
-
title: 'order',
|
|
25
|
-
key: 'order',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
title: 'name',
|
|
29
|
-
key: 'name',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
title: 'type',
|
|
33
|
-
key: 'type',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: 'unique',
|
|
37
|
-
key: 'is_unique',
|
|
38
|
-
hasSlot: true,
|
|
39
|
-
sortable: false,
|
|
40
|
-
checkbox: true,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
title: 'has relation',
|
|
44
|
-
key: 'has_relation',
|
|
45
|
-
hasSlot: true,
|
|
46
|
-
sortable: false,
|
|
47
|
-
checkbox: true,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
title: 'default_value',
|
|
51
|
-
key: 'default_value',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
title: 'options_value',
|
|
55
|
-
key: 'options_value',
|
|
56
|
-
hasSlot: true,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
title: 'required',
|
|
60
|
-
key: 'required',
|
|
61
|
-
hasSlot: true,
|
|
62
|
-
sortable: false,
|
|
63
|
-
checkbox: true,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
title: 'Actions',
|
|
67
|
-
key: 'actions',
|
|
68
|
-
align: 'end',
|
|
69
|
-
sortable: false,
|
|
70
|
-
},
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
const selectedColumn = ref<Column | null>(null)
|
|
74
|
-
|
|
75
|
-
const columnDeleteDialog = ref(false)
|
|
76
|
-
const isColumnDialogShown = ref(false)
|
|
77
|
-
|
|
78
|
-
function setupColumnUpdate(column: Column) {
|
|
79
|
-
console.log(column)
|
|
80
|
-
selectedColumn.value = column
|
|
81
|
-
isColumnDialogShown.value = true
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function closeColumnDialog() {
|
|
85
|
-
selectedColumn.value = null
|
|
86
|
-
isColumnDialogShown.value = false
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function setupColumnDelete(column: Column) {
|
|
90
|
-
selectedColumn.value = column
|
|
91
|
-
columnDeleteDialog.value = true
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function closeColumnDeleteDialog() {
|
|
95
|
-
selectedColumn.value = null
|
|
96
|
-
columnDeleteDialog.value = false
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async function deleteColumn() {
|
|
100
|
-
if (selectedColumn.value) {
|
|
101
|
-
await columnStore.deleteColumn(selectedColumn.value)
|
|
102
|
-
closeColumnDeleteDialog()
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
</script>
|
|
106
|
-
|
|
107
|
-
<template>
|
|
108
|
-
<column-dialog
|
|
109
|
-
:column="(selectedColumn as Column)"
|
|
110
|
-
:display-dialog="isColumnDialogShown"
|
|
111
|
-
@close="closeColumnDialog"
|
|
112
|
-
/>
|
|
113
|
-
|
|
114
|
-
<base-delete-dialog
|
|
115
|
-
:delete-action="deleteColumn"
|
|
116
|
-
:displayed="columnDeleteDialog"
|
|
117
|
-
:is-loading="isDeleting"
|
|
118
|
-
:title="
|
|
119
|
-
t('project.tableConfig.columns.deleteTitle', {
|
|
120
|
-
column: selectedColumn?.name,
|
|
121
|
-
})
|
|
122
|
-
"
|
|
123
|
-
@close="closeColumnDeleteDialog"
|
|
124
|
-
/>
|
|
125
|
-
|
|
126
|
-
<v-data-table
|
|
127
|
-
:headers="columnHeaders"
|
|
128
|
-
:items="columns"
|
|
129
|
-
:loading="isFetching"
|
|
130
|
-
:sort-by="[{ key: 'order', order: 'asc' }]"
|
|
131
|
-
color="primary"
|
|
132
|
-
density="compact"
|
|
133
|
-
>
|
|
134
|
-
<!-- Checkbox columns -->
|
|
135
|
-
<template
|
|
136
|
-
v-for="header in columnHeaders.filter(item2 => item2.checkbox)"
|
|
137
|
-
:key="header.key"
|
|
138
|
-
#[`item.${header.key}`]="{ item }"
|
|
139
|
-
>
|
|
140
|
-
<v-icon
|
|
141
|
-
:icon="item[header.key] ? 'mdi-check-bold' : 'mdi-close-thick'"
|
|
142
|
-
:color="item[header.key] ? 'success' : 'error'"
|
|
143
|
-
/>
|
|
144
|
-
</template>
|
|
145
|
-
<!-- Dropdown columns -->
|
|
146
|
-
<template #[`item.options_value`]="{ item }">
|
|
147
|
-
<v-chip-group>
|
|
148
|
-
<v-chip v-for="value in item.options_value" :key="value" size="small" density="comfortable">
|
|
149
|
-
{{ value }}
|
|
150
|
-
</v-chip>
|
|
151
|
-
</v-chip-group>
|
|
152
|
-
</template>
|
|
153
|
-
|
|
154
|
-
<template #top>
|
|
155
|
-
<v-toolbar density="compact">
|
|
156
|
-
<v-toolbar-title>{{ t('project.tableConfig.columns.title') }}</v-toolbar-title>
|
|
157
|
-
<v-spacer />
|
|
158
|
-
|
|
159
|
-
<base-clickable-icon
|
|
160
|
-
id="ant-tour-create-column"
|
|
161
|
-
:tooltip-text="t('project.tableConfig.columns.newColumn')"
|
|
162
|
-
icon="mdi-table-column-plus-after"
|
|
163
|
-
tooltip-location="start"
|
|
164
|
-
@click="() => isColumnDialogShown = true"
|
|
165
|
-
/>
|
|
166
|
-
</v-toolbar>
|
|
167
|
-
</template>
|
|
168
|
-
|
|
169
|
-
<template #[`item.actions`]="{ item }">
|
|
170
|
-
<base-clickable-icon
|
|
171
|
-
:tooltip-text="t('system.buttons.edit')"
|
|
172
|
-
icon="mdi-pencil"
|
|
173
|
-
size="x-small"
|
|
174
|
-
tooltip-location="start"
|
|
175
|
-
@click="setupColumnUpdate(item)"
|
|
176
|
-
/>
|
|
177
|
-
<base-clickable-icon
|
|
178
|
-
:tooltip-text="t('system.buttons.delete')"
|
|
179
|
-
icon="mdi-delete"
|
|
180
|
-
size="x-small"
|
|
181
|
-
tooltip-location="start"
|
|
182
|
-
@click="setupColumnDelete(item)"
|
|
183
|
-
/>
|
|
184
|
-
</template>
|
|
185
|
-
</v-data-table>
|
|
186
|
-
</template>
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Column, ColumnKey } from '@antcde/connect-ts/services/ColumnService'
|
|
3
|
-
import { useI18n } from 'vue-i18n'
|
|
4
|
-
|
|
5
|
-
const props = defineProps<{
|
|
6
|
-
columns: Column[]
|
|
7
|
-
isFetching: boolean
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const emit = defineEmits(['openColumnCreate', 'openColumnUpdate', 'openColumnDelete', 'close'])
|
|
11
|
-
|
|
12
|
-
const { t } = useI18n()
|
|
13
|
-
|
|
14
|
-
interface ColumnHeader {
|
|
15
|
-
title: string
|
|
16
|
-
key: string
|
|
17
|
-
align?: 'start' | 'center' | 'end'
|
|
18
|
-
sortable?: boolean
|
|
19
|
-
hasSlot?: boolean
|
|
20
|
-
checkbox?: boolean
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const columnHeaders: ColumnHeader[] = [
|
|
24
|
-
{
|
|
25
|
-
title: t('project.tableConfig.columns.dialog.order'),
|
|
26
|
-
key: 'order',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
title: t('project.tableConfig.columns.dialog.name'),
|
|
30
|
-
key: 'name',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
title: t('project.tableConfig.columns.dialog.type'),
|
|
34
|
-
key: 'type',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
title: t('project.tableConfig.columns.dialog.unique'),
|
|
38
|
-
key: 'is_unique',
|
|
39
|
-
hasSlot: true,
|
|
40
|
-
sortable: false,
|
|
41
|
-
checkbox: true,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
title: t('project.tableConfig.columns.dialog.has_relation'),
|
|
45
|
-
key: 'has_relation',
|
|
46
|
-
hasSlot: true,
|
|
47
|
-
sortable: false,
|
|
48
|
-
checkbox: true,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
title: t('project.tableConfig.columns.dialog.default_value'),
|
|
52
|
-
key: 'default_value',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
title: t('project.tableConfig.columns.dialog.values'),
|
|
56
|
-
key: 'options_value',
|
|
57
|
-
hasSlot: true,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
title: t('project.tableConfig.columns.dialog.required'),
|
|
61
|
-
key: 'required',
|
|
62
|
-
hasSlot: true,
|
|
63
|
-
sortable: false,
|
|
64
|
-
checkbox: true,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
title: t('system.actions'),
|
|
68
|
-
key: 'actions',
|
|
69
|
-
align: 'end',
|
|
70
|
-
sortable: false,
|
|
71
|
-
},
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
function handleColumnUpdate(item: { id: string }) {
|
|
75
|
-
const column = props.columns.find(c => c.id === item.id) as Column
|
|
76
|
-
if (column) {
|
|
77
|
-
emit('openColumnUpdate', column)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function handleColumnDelete(item: { id: string }) {
|
|
82
|
-
const column = props.columns.find(c => c.id === item.id) as Column
|
|
83
|
-
if (column) {
|
|
84
|
-
emit('openColumnDelete', column)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<template>
|
|
90
|
-
<v-toolbar class="px-0" density="compact" color="primary">
|
|
91
|
-
<v-toolbar-title>{{ t('project.tableConfig.columns.title') }}</v-toolbar-title>
|
|
92
|
-
<v-spacer />
|
|
93
|
-
<v-toolbar-items>
|
|
94
|
-
<v-btn
|
|
95
|
-
v-tooltip="t('project.tableConfig.columns.newColumn')"
|
|
96
|
-
icon="mdi-plus"
|
|
97
|
-
@click="emit('openColumnCreate')"
|
|
98
|
-
/>
|
|
99
|
-
|
|
100
|
-
<v-btn
|
|
101
|
-
v-tooltip="t('system.buttons.close')"
|
|
102
|
-
icon="mdi-close"
|
|
103
|
-
@click="emit('close')"
|
|
104
|
-
/>
|
|
105
|
-
</v-toolbar-items>
|
|
106
|
-
</v-toolbar>
|
|
107
|
-
|
|
108
|
-
<v-data-table
|
|
109
|
-
fixed-header
|
|
110
|
-
class="h-full overflow-auto"
|
|
111
|
-
hide-default-footer
|
|
112
|
-
disable-pagination
|
|
113
|
-
:items-per-page="columns.length"
|
|
114
|
-
:headers="columnHeaders"
|
|
115
|
-
:items="columns"
|
|
116
|
-
:loading="isFetching"
|
|
117
|
-
color="primary"
|
|
118
|
-
density="compact"
|
|
119
|
-
>
|
|
120
|
-
<!-- Checkbox columns -->
|
|
121
|
-
<template
|
|
122
|
-
v-for="header in columnHeaders.filter(headerColumn => headerColumn.checkbox)"
|
|
123
|
-
:key="header.key"
|
|
124
|
-
#[`item.${header.key}`]="{ item }"
|
|
125
|
-
>
|
|
126
|
-
<v-icon
|
|
127
|
-
:icon="item[header.key as ColumnKey] ? 'mdi-check-bold' : 'mdi-close-thick'"
|
|
128
|
-
color="grey-darken-1"
|
|
129
|
-
/>
|
|
130
|
-
</template>
|
|
131
|
-
|
|
132
|
-
<!-- Dropdown columns -->
|
|
133
|
-
<template #[`item.options_value`]="{ item }">
|
|
134
|
-
<v-chip-group>
|
|
135
|
-
<v-chip v-for="value in item.options_value" :key="value" size="small" density="comfortable">
|
|
136
|
-
{{ value }}
|
|
137
|
-
</v-chip>
|
|
138
|
-
</v-chip-group>
|
|
139
|
-
</template>
|
|
140
|
-
|
|
141
|
-
<!-- Actions column -->
|
|
142
|
-
<template #[`item.actions`]="{ item }">
|
|
143
|
-
<v-btn
|
|
144
|
-
v-tooltip="t('system.buttons.edit')"
|
|
145
|
-
variant="text"
|
|
146
|
-
icon="mdi-pencil"
|
|
147
|
-
size="small"
|
|
148
|
-
tooltip-location="start"
|
|
149
|
-
@click="() => handleColumnUpdate(item)"
|
|
150
|
-
/>
|
|
151
|
-
<v-btn
|
|
152
|
-
v-tooltip="t('system.buttons.delete')"
|
|
153
|
-
variant="text"
|
|
154
|
-
icon="mdi-delete"
|
|
155
|
-
size="small"
|
|
156
|
-
tooltip-location="start"
|
|
157
|
-
@click="() => handleColumnDelete(item)"
|
|
158
|
-
/>
|
|
159
|
-
</template>
|
|
160
|
-
</v-data-table>
|
|
161
|
-
</template>
|
|
162
|
-
|
|
163
|
-
<style scoped>
|
|
164
|
-
|
|
165
|
-
</style>
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { BaseAntCard } from '@antcde/component-library'
|
|
3
|
-
import { computed, ref, watch } from 'vue'
|
|
4
|
-
import { useI18n } from 'vue-i18n'
|
|
5
|
-
import { usePermissionStore } from '../../stores/permissions'
|
|
6
|
-
|
|
7
|
-
import { useRoleStore } from '../../stores/roles'
|
|
8
|
-
import { useTableStore } from '../../stores/table'
|
|
9
|
-
|
|
10
|
-
const props = withDefaults(
|
|
11
|
-
defineProps<{
|
|
12
|
-
displayDialog: boolean
|
|
13
|
-
}>(),
|
|
14
|
-
{},
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
const emit = defineEmits(['close'])
|
|
18
|
-
|
|
19
|
-
const { t } = useI18n()
|
|
20
|
-
|
|
21
|
-
const permissionStore = usePermissionStore()
|
|
22
|
-
const tableStore = useTableStore()
|
|
23
|
-
|
|
24
|
-
const dialog = ref(false)
|
|
25
|
-
|
|
26
|
-
const permissionItem = ref({
|
|
27
|
-
role_id: null,
|
|
28
|
-
create: false,
|
|
29
|
-
read: false,
|
|
30
|
-
update: false,
|
|
31
|
-
delete: false,
|
|
32
|
-
configure: false,
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
watch(
|
|
36
|
-
() => props.displayDialog,
|
|
37
|
-
async (newValue) => {
|
|
38
|
-
dialog.value = newValue
|
|
39
|
-
},
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
function closeDialog() {
|
|
43
|
-
permissionItem.value = {
|
|
44
|
-
role_id: null,
|
|
45
|
-
create: false,
|
|
46
|
-
read: false,
|
|
47
|
-
update: false,
|
|
48
|
-
delete: false,
|
|
49
|
-
configure: false,
|
|
50
|
-
}
|
|
51
|
-
dialog.value = false
|
|
52
|
-
emit('close')
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function savePermission() {
|
|
56
|
-
const table = tableStore.table?.id
|
|
57
|
-
if (table) {
|
|
58
|
-
await permissionStore.createPermission(table, permissionItem.value)
|
|
59
|
-
}
|
|
60
|
-
closeDialog()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const roleStore = useRoleStore()
|
|
64
|
-
|
|
65
|
-
const unusedRoles = computed(() => {
|
|
66
|
-
return roleStore.roles.filter(
|
|
67
|
-
role => !permissionStore.permissions.map(permission => permission.role.id).includes(role.id),
|
|
68
|
-
)
|
|
69
|
-
})
|
|
70
|
-
</script>
|
|
71
|
-
|
|
72
|
-
<template>
|
|
73
|
-
<v-dialog v-model="dialog" width="auto" @keydown.esc="closeDialog" @click:outside="closeDialog">
|
|
74
|
-
<base-ant-card>
|
|
75
|
-
<template #title>
|
|
76
|
-
{{ t('project.tableConfig.permissions.newPermission') }}
|
|
77
|
-
</template>
|
|
78
|
-
<template #content>
|
|
79
|
-
<v-select
|
|
80
|
-
v-model="permissionItem.role_id"
|
|
81
|
-
variant="outlined"
|
|
82
|
-
color="primary"
|
|
83
|
-
:items="unusedRoles"
|
|
84
|
-
item-title="name"
|
|
85
|
-
item-value="id"
|
|
86
|
-
density="compact"
|
|
87
|
-
:label="t('project.tableConfig.permissions.role')"
|
|
88
|
-
/>
|
|
89
|
-
<v-checkbox
|
|
90
|
-
v-model="permissionItem.create"
|
|
91
|
-
hide-details
|
|
92
|
-
density="compact"
|
|
93
|
-
:label="t('project.tableConfig.permissions.create')"
|
|
94
|
-
/>
|
|
95
|
-
<v-checkbox
|
|
96
|
-
v-model="permissionItem.read"
|
|
97
|
-
hide-details
|
|
98
|
-
density="compact"
|
|
99
|
-
:label="t('project.tableConfig.permissions.read')"
|
|
100
|
-
/>
|
|
101
|
-
<v-checkbox
|
|
102
|
-
v-model="permissionItem.update"
|
|
103
|
-
hide-details
|
|
104
|
-
density="compact"
|
|
105
|
-
:label="t('project.tableConfig.permissions.update')"
|
|
106
|
-
/>
|
|
107
|
-
<v-checkbox
|
|
108
|
-
v-model="permissionItem.delete"
|
|
109
|
-
hide-details
|
|
110
|
-
density="compact"
|
|
111
|
-
:label="t('project.tableConfig.permissions.delete')"
|
|
112
|
-
/>
|
|
113
|
-
<v-checkbox
|
|
114
|
-
v-model="permissionItem.configure"
|
|
115
|
-
hide-details
|
|
116
|
-
density="compact"
|
|
117
|
-
:label="t('project.tableConfig.permissions.configure')"
|
|
118
|
-
/>
|
|
119
|
-
</template>
|
|
120
|
-
<template #actions>
|
|
121
|
-
<div class="d-flex pa-2">
|
|
122
|
-
<v-spacer />
|
|
123
|
-
<v-btn
|
|
124
|
-
:disabled="permissionStore.isCreating"
|
|
125
|
-
class="mr-2"
|
|
126
|
-
color="primary"
|
|
127
|
-
size="small"
|
|
128
|
-
variant="outlined"
|
|
129
|
-
@click="closeDialog"
|
|
130
|
-
>
|
|
131
|
-
{{ t('system.buttons.cancel') }}
|
|
132
|
-
</v-btn>
|
|
133
|
-
<v-btn
|
|
134
|
-
:disabled="permissionStore.isCreating || !permissionItem.role_id"
|
|
135
|
-
:loading="permissionStore.isCreating"
|
|
136
|
-
color="primary"
|
|
137
|
-
size="small"
|
|
138
|
-
variant="flat"
|
|
139
|
-
@click="savePermission"
|
|
140
|
-
>
|
|
141
|
-
{{ t('system.buttons.save') }}
|
|
142
|
-
</v-btn>
|
|
143
|
-
</div>
|
|
144
|
-
</template>
|
|
145
|
-
</base-ant-card>
|
|
146
|
-
</v-dialog>
|
|
147
|
-
</template>
|
|
148
|
-
|
|
149
|
-
<style lang="scss" scoped></style>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { Permission } from '@antcde/connect-ts/services/PermissionService'
|
|
3
|
-
import { storeToRefs } from 'pinia'
|
|
4
|
-
import { ref } from 'vue'
|
|
5
|
-
import { useI18n } from 'vue-i18n'
|
|
6
|
-
import { usePermissionStore } from '../../stores/permissions'
|
|
7
|
-
import { useTableStore } from '../../stores/table'
|
|
8
|
-
|
|
9
|
-
const { t } = useI18n()
|
|
10
|
-
|
|
11
|
-
defineProps<{
|
|
12
|
-
roles: any[]
|
|
13
|
-
}>()
|
|
14
|
-
|
|
15
|
-
const emit = defineEmits(['close'])
|
|
16
|
-
|
|
17
|
-
const tableStore = useTableStore()
|
|
18
|
-
const permissionStore = usePermissionStore()
|
|
19
|
-
|
|
20
|
-
const { table } = storeToRefs(tableStore)
|
|
21
|
-
const { isCreating } = storeToRefs(permissionStore)
|
|
22
|
-
|
|
23
|
-
const permission = ref<Partial<Permission>>({
|
|
24
|
-
role_id: undefined,
|
|
25
|
-
create: false,
|
|
26
|
-
read: false,
|
|
27
|
-
update: false,
|
|
28
|
-
delete: false,
|
|
29
|
-
configure: false,
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
async function savePermission() {
|
|
33
|
-
await permissionStore.createPermission(permission.value)
|
|
34
|
-
emit('close')
|
|
35
|
-
}
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<v-card class="h-full w-full d-flex flex-col">
|
|
40
|
-
<v-toolbar class="px-0" density="compact" color="primary">
|
|
41
|
-
<v-toolbar-items>
|
|
42
|
-
<v-btn
|
|
43
|
-
icon="mdi-arrow-left"
|
|
44
|
-
@click="emit('close')"
|
|
45
|
-
/>
|
|
46
|
-
</v-toolbar-items>
|
|
47
|
-
|
|
48
|
-
<v-toolbar-title>
|
|
49
|
-
{{ t('project.tableConfig.permissions.newPermission') }}
|
|
50
|
-
</v-toolbar-title>
|
|
51
|
-
</v-toolbar>
|
|
52
|
-
<v-card-text class="flex-1">
|
|
53
|
-
<v-label class="mb-2">
|
|
54
|
-
{{ t('project.tableConfig.permissions.role') }}
|
|
55
|
-
</v-label>
|
|
56
|
-
<v-select
|
|
57
|
-
v-model="permission.role_id"
|
|
58
|
-
variant="outlined"
|
|
59
|
-
color="primary"
|
|
60
|
-
:items="roles"
|
|
61
|
-
item-title="name"
|
|
62
|
-
item-value="id"
|
|
63
|
-
density="compact"
|
|
64
|
-
:label="t('project.tableConfig.permissions.role')"
|
|
65
|
-
/>
|
|
66
|
-
|
|
67
|
-
<v-checkbox
|
|
68
|
-
v-model="permission.create"
|
|
69
|
-
hide-details
|
|
70
|
-
density="compact"
|
|
71
|
-
:label="t('project.tableConfig.permissions.create')"
|
|
72
|
-
/>
|
|
73
|
-
<v-checkbox
|
|
74
|
-
v-model="permission.read"
|
|
75
|
-
hide-details
|
|
76
|
-
density="compact"
|
|
77
|
-
:label="t('project.tableConfig.permissions.read')"
|
|
78
|
-
/>
|
|
79
|
-
<v-checkbox
|
|
80
|
-
v-model="permission.update"
|
|
81
|
-
hide-details
|
|
82
|
-
density="compact"
|
|
83
|
-
:label="t('project.tableConfig.permissions.update')"
|
|
84
|
-
/>
|
|
85
|
-
<v-checkbox
|
|
86
|
-
v-model="permission.delete"
|
|
87
|
-
hide-details
|
|
88
|
-
density="compact"
|
|
89
|
-
:label="t('project.tableConfig.permissions.delete')"
|
|
90
|
-
/>
|
|
91
|
-
<v-checkbox
|
|
92
|
-
v-model="permission.configure"
|
|
93
|
-
hide-details
|
|
94
|
-
density="compact"
|
|
95
|
-
:label="t('project.tableConfig.permissions.configure')"
|
|
96
|
-
/>
|
|
97
|
-
</v-card-text>
|
|
98
|
-
|
|
99
|
-
<v-divider />
|
|
100
|
-
<v-card-actions>
|
|
101
|
-
<v-spacer />
|
|
102
|
-
<v-btn variant="text" color="primary" @click="emit('close')">
|
|
103
|
-
{{ t('system.buttons.cancel') }}
|
|
104
|
-
</v-btn>
|
|
105
|
-
<v-btn
|
|
106
|
-
variant="tonal" color="primary"
|
|
107
|
-
:disabled="isCreating || !permission.role_id || !table?.id"
|
|
108
|
-
:loading="isCreating"
|
|
109
|
-
@click="savePermission"
|
|
110
|
-
>
|
|
111
|
-
{{ t('system.buttons.save') }}
|
|
112
|
-
</v-btn>
|
|
113
|
-
</v-card-actions>
|
|
114
|
-
</v-card>
|
|
115
|
-
</template>
|
|
116
|
-
|
|
117
|
-
<style lang="scss" scoped></style>
|