|
|
@ -13,7 +13,7 @@ import MdiMenuDown from '~icons/mdi/menu-down' |
|
|
|
import MdiPlus from '~icons/mdi/plus' |
|
|
|
import MdiPlus from '~icons/mdi/plus' |
|
|
|
import MdiDatabaseOutline from '~icons/mdi/database-outline' |
|
|
|
import MdiDatabaseOutline from '~icons/mdi/database-outline' |
|
|
|
|
|
|
|
|
|
|
|
const { $api, $state } = useNuxtApp() |
|
|
|
const { $api, $state, $e } = useNuxtApp() |
|
|
|
const toast = useToast() |
|
|
|
const toast = useToast() |
|
|
|
|
|
|
|
|
|
|
|
const filterQuery = ref('') |
|
|
|
const filterQuery = ref('') |
|
|
@ -34,6 +34,7 @@ const filteredProjects = computed(() => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const deleteProject = (project: ProjectType) => { |
|
|
|
const deleteProject = (project: ProjectType) => { |
|
|
|
|
|
|
|
$e('c:project:delete') |
|
|
|
Modal.confirm({ |
|
|
|
Modal.confirm({ |
|
|
|
title: `Do you want to delete '${project.title}' project?`, |
|
|
|
title: `Do you want to delete '${project.title}' project?`, |
|
|
|
okText: 'Yes', |
|
|
|
okText: 'Yes', |
|
|
@ -41,6 +42,7 @@ const deleteProject = (project: ProjectType) => { |
|
|
|
cancelText: 'No', |
|
|
|
cancelText: 'No', |
|
|
|
async onOk() { |
|
|
|
async onOk() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
$e('c:project:delete') |
|
|
|
await $api.project.delete(project.id as string) |
|
|
|
await $api.project.delete(project.id as string) |
|
|
|
projects.value.splice(projects.value.indexOf(project), 1) |
|
|
|
projects.value.splice(projects.value.indexOf(project), 1) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
@ -65,7 +67,11 @@ $state.sidebarOpen.value = false |
|
|
|
<!-- My Projects --> |
|
|
|
<!-- My Projects --> |
|
|
|
<b>{{ $t('title.myProject') }}</b> |
|
|
|
<b>{{ $t('title.myProject') }}</b> |
|
|
|
|
|
|
|
|
|
|
|
<MdiRefresh class="text-sm text-gray-500 hover:text-primary mt-1 cursor-pointer" @click="loadProjects"></MdiRefresh> |
|
|
|
<MdiRefresh |
|
|
|
|
|
|
|
v-t="['a:project:refresh']" |
|
|
|
|
|
|
|
class="text-sm text-gray-500 hover:text-primary mt-1 cursor-pointer" |
|
|
|
|
|
|
|
@click="loadProjects" |
|
|
|
|
|
|
|
></MdiRefresh> |
|
|
|
</h1> |
|
|
|
</h1> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex mb-6"> |
|
|
|
<div class="flex mb-6"> |
|
|
@ -87,6 +93,7 @@ $state.sidebarOpen.value = false |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<a-menu> |
|
|
|
<a-menu> |
|
|
|
<div |
|
|
|
<div |
|
|
|
|
|
|
|
v-t="['c:project:create:xcdb']" |
|
|
|
class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2" |
|
|
|
class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2" |
|
|
|
@click="navigateTo('/project/create')" |
|
|
|
@click="navigateTo('/project/create')" |
|
|
|
> |
|
|
|
> |
|
|
@ -94,6 +101,7 @@ $state.sidebarOpen.value = false |
|
|
|
<div class="col-span-10 text-sm xl:text-md">{{ $t('activity.createProject') }}</div> |
|
|
|
<div class="col-span-10 text-sm xl:text-md">{{ $t('activity.createProject') }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
|
|
|
|
v-t="['c:project:create:extdb']" |
|
|
|
class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2" |
|
|
|
class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2" |
|
|
|
@click="navigateTo('/project/create-external')" |
|
|
|
@click="navigateTo('/project/create-external')" |
|
|
|
> |
|
|
|
> |
|
|
@ -113,7 +121,10 @@ $state.sidebarOpen.value = false |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
:custom-row=" |
|
|
|
:custom-row=" |
|
|
|
(record) => ({ |
|
|
|
(record) => ({ |
|
|
|
onClick: () => navigateTo(`/nc/${record.id}`), |
|
|
|
onClick: () => { |
|
|
|
|
|
|
|
$e('a:project:open'); |
|
|
|
|
|
|
|
navigateTo(`/nc/${record.id}`), |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
" |
|
|
|
" |
|
|
|
:data-source="filteredProjects" |
|
|
|
:data-source="filteredProjects" |
|
|
@ -129,7 +140,11 @@ $state.sidebarOpen.value = false |
|
|
|
<a-table-column key="id" :title="$t('labels.actions')" data-index="id"> |
|
|
|
<a-table-column key="id" :title="$t('labels.actions')" data-index="id"> |
|
|
|
<template #default="{ text, record }"> |
|
|
|
<template #default="{ text, record }"> |
|
|
|
<div class="flex align-center"> |
|
|
|
<div class="flex align-center"> |
|
|
|
<MdiEditOutline class="nc-action-btn" @click.stop="navigateTo(`/project/${text}`)" /> |
|
|
|
<MdiEditOutline |
|
|
|
|
|
|
|
v-t="['c:project:edit:rename']" |
|
|
|
|
|
|
|
class="nc-action-btn" |
|
|
|
|
|
|
|
@click.stop="navigateTo(`/project/${text}`)" |
|
|
|
|
|
|
|
/> |
|
|
|
<MdiDeleteOutline class="nc-action-btn" @click.stop="deleteProject(record)" /> |
|
|
|
<MdiDeleteOutline class="nc-action-btn" @click.stop="deleteProject(record)" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|