|
|
@ -32,12 +32,12 @@ let viewCreateType = $ref<ViewTypes>() |
|
|
|
|
|
|
|
|
|
|
|
let viewCreateDlg = $ref(false) |
|
|
|
let viewCreateDlg = $ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const openCreateViewDlg = (type: ViewTypes) => { |
|
|
|
function openCreateViewDlg(type: ViewTypes) { |
|
|
|
viewCreateDlg = true |
|
|
|
viewCreateDlg = true |
|
|
|
viewCreateType = type |
|
|
|
viewCreateType = type |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
function onViewCreate(view: GridType | FormType | KanbanType | GalleryType) { |
|
|
|
views.value?.push(view) |
|
|
|
views.value?.push(view) |
|
|
|
activeView.value = view |
|
|
|
activeView.value = view |
|
|
|
viewCreateDlg = false |
|
|
|
viewCreateDlg = false |
|
|
@ -45,35 +45,14 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div |
|
|
|
<a-layout-sider class="views-navigation-drawer bg-white shadow" :width="toggleDrawer ? 0 : 250"> |
|
|
|
class="views-navigation-drawer flex-item-stretch pa-4 elevation-1" |
|
|
|
<div class="flex flex-col h-full"> |
|
|
|
:style="{ |
|
|
|
<div class="flex-1"> |
|
|
|
maxWidth: toggleDrawer ? '0' : '220px', |
|
|
|
|
|
|
|
minWidth: toggleDrawer ? '0' : '220px', |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div class="d-flex flex-column h-100"> |
|
|
|
|
|
|
|
<div class="flex-grow-1"> |
|
|
|
|
|
|
|
<v-list v-if="views && views.length" dense> |
|
|
|
<v-list v-if="views && views.length" dense> |
|
|
|
<v-list-item dense> |
|
|
|
<v-list-item dense> |
|
|
|
<!-- Views --> |
|
|
|
<!-- Views --> |
|
|
|
<span class="body-2 font-weight-medium">{{ $t('objects.views') }}</span> |
|
|
|
<span class="body-2 font-weight-medium">{{ $t('objects.views') }}</span> |
|
|
|
</v-list-item> |
|
|
|
</v-list-item> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <v-list-group v-model="selectedViewIdLocal" mandatory color="primary"> --> |
|
|
|
|
|
|
|
<!-- |
|
|
|
|
|
|
|
todo: add sortable |
|
|
|
|
|
|
|
<draggable |
|
|
|
|
|
|
|
:is="_isUIAllowed('viewlist-drag-n-drop') ? 'draggable' : 'div'" |
|
|
|
|
|
|
|
v-model="viewsList" |
|
|
|
|
|
|
|
draggable="div" |
|
|
|
|
|
|
|
v-bind="dragOptions" |
|
|
|
|
|
|
|
@change="onMove($event)" |
|
|
|
|
|
|
|
> --> |
|
|
|
|
|
|
|
<!-- <transition-group |
|
|
|
|
|
|
|
type="transition" |
|
|
|
|
|
|
|
:name="!drag ? 'flip-list' : null" |
|
|
|
|
|
|
|
> --> |
|
|
|
|
|
|
|
<v-list-item |
|
|
|
<v-list-item |
|
|
|
v-for="view in views" |
|
|
|
v-for="view in views" |
|
|
|
:key="view.id" |
|
|
|
:key="view.id" |
|
|
@ -83,91 +62,10 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
active-class="x-active--text" |
|
|
|
active-class="x-active--text" |
|
|
|
@click="activeView = view" |
|
|
|
@click="activeView = view" |
|
|
|
> |
|
|
|
> |
|
|
|
<!-- :class="`body-2 view nc-view-item nc-draggable-child nc-${ |
|
|
|
|
|
|
|
viewTypeAlias[view.type] |
|
|
|
|
|
|
|
}-view-item`" |
|
|
|
|
|
|
|
@click="$emit('rerender')" --> |
|
|
|
|
|
|
|
<!-- <v-icon |
|
|
|
|
|
|
|
v-if="_isUIAllowed('viewlist-drag-n-drop')" |
|
|
|
|
|
|
|
small |
|
|
|
|
|
|
|
:class="`nc-child-draggable-icon nc-child-draggable-icon-${view.title}`" |
|
|
|
|
|
|
|
@click.stop |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
mdi-drag-vertical |
|
|
|
|
|
|
|
</v-icon> --> |
|
|
|
|
|
|
|
<!-- <v-list-item-icon class="mr-n1"> |
|
|
|
|
|
|
|
<v-icon v-if="viewIcons[view.type]" x-small :color="viewIcons[view.type].color"> |
|
|
|
|
|
|
|
{{ viewIcons[view.type].icon }} |
|
|
|
|
|
|
|
</v-icon> |
|
|
|
|
|
|
|
<v-icon v-else color="primary" small> mdi-table </v-icon> |
|
|
|
|
|
|
|
</v-list-item-icon> --> |
|
|
|
|
|
|
|
<component :is="viewIcons[view.type].icon" :class="`text-${viewIcons[view.type].color} mr-1`" /> |
|
|
|
<component :is="viewIcons[view.type].icon" :class="`text-${viewIcons[view.type].color} mr-1`" /> |
|
|
|
<span>{{ view.alias || view.title }}</span> |
|
|
|
<span>{{ view.alias || view.title }}</span> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <v-list-item-title> |
|
|
|
|
|
|
|
<v-tooltip bottom> |
|
|
|
|
|
|
|
<template #activator="{ on }"> |
|
|
|
|
|
|
|
<div class="font-weight-regular" style="overflow: hidden; text-overflow: ellipsis"> |
|
|
|
|
|
|
|
<input v-if="view.edit" :ref="`input${i}`" v-model="view.title_temp" /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!– @click.stop |
|
|
|
|
|
|
|
@keydown.enter.stop="updateViewName(view, i)" |
|
|
|
|
|
|
|
@blur="updateViewName(view, i)" –> |
|
|
|
|
|
|
|
<template v-else> |
|
|
|
|
|
|
|
<span v-on="on">{{ view.alias || view.title }}</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
{{ view.alias || view.title }} |
|
|
|
|
|
|
|
</v-tooltip> |
|
|
|
|
|
|
|
</v-list-item-title> --> |
|
|
|
|
|
|
|
<v-spacer /> |
|
|
|
<v-spacer /> |
|
|
|
<!-- <template v-if="_isUIAllowed('virtualViewsCreateOrEdit')"> |
|
|
|
|
|
|
|
<!– Copy view –> |
|
|
|
|
|
|
|
<x-icon |
|
|
|
|
|
|
|
v-if="!view.edit" |
|
|
|
|
|
|
|
:tooltip="$t('activity.copyView')" |
|
|
|
|
|
|
|
x-small |
|
|
|
|
|
|
|
color="primary" |
|
|
|
|
|
|
|
icon-class="view-icon nc-view-copy-icon" |
|
|
|
|
|
|
|
@click.stop="copyView(view, i)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
mdi-content-copy |
|
|
|
|
|
|
|
</x-icon> |
|
|
|
|
|
|
|
<!– Rename view –> |
|
|
|
|
|
|
|
<x-icon |
|
|
|
|
|
|
|
v-if="!view.edit" |
|
|
|
|
|
|
|
:tooltip="$t('activity.renameView')" |
|
|
|
|
|
|
|
x-small |
|
|
|
|
|
|
|
color="primary" |
|
|
|
|
|
|
|
icon-class="view-icon nc-view-edit-icon" |
|
|
|
|
|
|
|
@click.stop="showRenameTextBox(view, i)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
mdi-pencil |
|
|
|
|
|
|
|
</x-icon> |
|
|
|
|
|
|
|
<!– Delete view" –> |
|
|
|
|
|
|
|
<x-icon |
|
|
|
|
|
|
|
v-if="!view.is_default" |
|
|
|
|
|
|
|
:tooltip="$t('activity.deleteView')" |
|
|
|
|
|
|
|
small |
|
|
|
|
|
|
|
color="error" |
|
|
|
|
|
|
|
icon-class="view-icon nc-view-delete-icon" |
|
|
|
|
|
|
|
@click.stop="deleteView(view)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
mdi-delete-outline |
|
|
|
|
|
|
|
</x-icon> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<v-icon |
|
|
|
|
|
|
|
v-if="view.id === selectedViewId" |
|
|
|
|
|
|
|
small |
|
|
|
|
|
|
|
class="check-icon" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
mdi-check-bold |
|
|
|
|
|
|
|
</v-icon> --> |
|
|
|
|
|
|
|
</v-list-item> |
|
|
|
</v-list-item> |
|
|
|
<!-- </transition-group> --> |
|
|
|
|
|
|
|
<!-- </draggable> --> |
|
|
|
|
|
|
|
<!-- </v-list-group> --> |
|
|
|
|
|
|
|
</v-list> |
|
|
|
</v-list> |
|
|
|
|
|
|
|
|
|
|
|
<v-divider class="advance-menu-divider" /> |
|
|
|
<v-divider class="advance-menu-divider" /> |
|
|
@ -178,24 +76,6 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
<span class="body-2 font-weight-medium" @dblclick="enableDummyFeat = true"> |
|
|
|
<span class="body-2 font-weight-medium" @dblclick="enableDummyFeat = true"> |
|
|
|
{{ $t('activity.createView') }} |
|
|
|
{{ $t('activity.createView') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<!-- <v-tooltip top> |
|
|
|
|
|
|
|
<template #activator="{ props }"> |
|
|
|
|
|
|
|
<!– <x-icon –> |
|
|
|
|
|
|
|
<!– color="pink textColor" –> |
|
|
|
|
|
|
|
<!– icon-class="ml-2" –> |
|
|
|
|
|
|
|
<!– small –> |
|
|
|
|
|
|
|
<!– v-on="on" –> |
|
|
|
|
|
|
|
<!– @mouseenter="overShieldIcon = true" –> |
|
|
|
|
|
|
|
<!– @mouseleave="overShieldIcon = false" –> |
|
|
|
|
|
|
|
<!– > –> |
|
|
|
|
|
|
|
<!– mdi-shield-lock-outline –> |
|
|
|
|
|
|
|
<!– </x-icon> –> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<!– Only visible to Creator –> |
|
|
|
|
|
|
|
<span class="caption"> |
|
|
|
|
|
|
|
{{ $t('msg.info.onlyCreator') }} |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</v-tooltip> --> |
|
|
|
|
|
|
|
</v-list-item> |
|
|
|
</v-list-item> |
|
|
|
<v-tooltip bottom> |
|
|
|
<v-tooltip bottom> |
|
|
|
<template #activator="{ props }"> |
|
|
|
<template #activator="{ props }"> |
|
|
@ -225,9 +105,8 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
v-bind="props" |
|
|
|
v-bind="props" |
|
|
|
@click="openCreateViewDlg(ViewTypes.GALLERY)" |
|
|
|
@click="openCreateViewDlg(ViewTypes.GALLERY)" |
|
|
|
> |
|
|
|
> |
|
|
|
<!-- <v-list-item-icon class="mr-n1"> --> |
|
|
|
|
|
|
|
<component :is="viewIcons[ViewTypes.GALLERY].icon" :class="`text-${viewIcons[ViewTypes.GALLERY].color} mr-1`" /> |
|
|
|
<component :is="viewIcons[ViewTypes.GALLERY].icon" :class="`text-${viewIcons[ViewTypes.GALLERY].color} mr-1`" /> |
|
|
|
<!-- </v-list-item-icon> --> |
|
|
|
|
|
|
|
<v-list-item-title> |
|
|
|
<v-list-item-title> |
|
|
|
<span class="font-weight-regular"> |
|
|
|
<span class="font-weight-regular"> |
|
|
|
<!-- Gallery --> |
|
|
|
<!-- Gallery --> |
|
|
@ -238,7 +117,6 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
<v-spacer /> |
|
|
|
<v-spacer /> |
|
|
|
|
|
|
|
|
|
|
|
<MdiPlusIcon class="mr-1" /> |
|
|
|
<MdiPlusIcon class="mr-1" /> |
|
|
|
<!-- <v-icon class="mr-1" small> mdi-plus</v-icon> --> |
|
|
|
|
|
|
|
</v-list-item> |
|
|
|
</v-list-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<!-- Add Gallery View --> |
|
|
|
<!-- Add Gallery View --> |
|
|
@ -254,9 +132,8 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
v-bind="props" |
|
|
|
v-bind="props" |
|
|
|
@click="openCreateViewDlg(ViewTypes.FORM)" |
|
|
|
@click="openCreateViewDlg(ViewTypes.FORM)" |
|
|
|
> |
|
|
|
> |
|
|
|
<!-- <v-list-item-icon class="mr-n1"> --> |
|
|
|
|
|
|
|
<component :is="viewIcons[ViewTypes.FORM].icon" :class="`text-${viewIcons[ViewTypes.FORM].color} mr-1`" /> |
|
|
|
<component :is="viewIcons[ViewTypes.FORM].icon" :class="`text-${viewIcons[ViewTypes.FORM].color} mr-1`" /> |
|
|
|
<!-- </v-list-item-icon> --> |
|
|
|
|
|
|
|
<v-list-item-title> |
|
|
|
<v-list-item-title> |
|
|
|
<span class="font-weight-regular"> |
|
|
|
<span class="font-weight-regular"> |
|
|
|
<!-- Form --> |
|
|
|
<!-- Form --> |
|
|
@ -268,7 +145,6 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
<v-spacer /> |
|
|
|
<v-spacer /> |
|
|
|
|
|
|
|
|
|
|
|
<MdiPlusIcon class="mr-1" /> |
|
|
|
<MdiPlusIcon class="mr-1" /> |
|
|
|
<!-- <v-icon class="mr-1" small> mdi-plus</v-icon> --> |
|
|
|
|
|
|
|
</v-list-item> |
|
|
|
</v-list-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<!-- Add Form View --> |
|
|
|
<!-- Add Form View --> |
|
|
@ -279,5 +155,5 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<DlgViewCreate v-if="views" v-model="viewCreateDlg" :type="viewCreateType" @created="onViewCreate" /> |
|
|
|
<DlgViewCreate v-if="views" v-model="viewCreateDlg" :type="viewCreateType" @created="onViewCreate" /> |
|
|
|
</div> |
|
|
|
</a-layout-sider> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|