diff --git a/frontend/src/components/Domain/ShareDomainDialog.vue b/frontend/src/components/Domain/ShareDomainDialog.vue new file mode 100644 index 0000000..0b3aa49 --- /dev/null +++ b/frontend/src/components/Domain/ShareDomainDialog.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/frontend/src/components/ShareDomain/ShareDomainDialog.vue b/frontend/src/components/ShareDomain/ShareDomainDialog.vue new file mode 100644 index 0000000..8d2738c --- /dev/null +++ b/frontend/src/components/ShareDomain/ShareDomainDialog.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/frontend/src/components/ShareDomain/SharingUserList.vue b/frontend/src/components/ShareDomain/SharingUserList.vue new file mode 100644 index 0000000..ed85c32 --- /dev/null +++ b/frontend/src/components/ShareDomain/SharingUserList.vue @@ -0,0 +1,41 @@ + + \ No newline at end of file diff --git a/frontend/src/components/UserDomain/DomainCard.vue b/frontend/src/components/UserDomain/DomainCard.vue new file mode 100644 index 0000000..144d7ff --- /dev/null +++ b/frontend/src/components/UserDomain/DomainCard.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/frontend/src/pages/TenantDomain.vue b/frontend/src/pages/TenantDomain.vue index 3564ff5..8e041a0 100644 --- a/frontend/src/pages/TenantDomain.vue +++ b/frontend/src/pages/TenantDomain.vue @@ -19,7 +19,10 @@ @@ -129,6 +135,7 @@ import { ref, onMounted, computed } from 'vue'; import { api } from 'boot/axios'; import { useAuthStore } from 'stores/useAuthStore'; import { useDomainStore } from 'stores/useDomainStore'; +import ShareDomainDialog from 'components/ShareDomain/ShareDomainDialog.vue'; import { IDomain, IDomainDisplay, IDomainSubmit } from '../types/DomainTypes'; const authStore = useAuthStore(); @@ -150,7 +157,7 @@ const columns = [ { name: 'url', label: 'URL', field: 'url', align: 'left', sortable: true, classes: inactiveRowClass }, // { name: 'owner', label: '所有者', field: 'owner', align: 'left', classes: inactiveRowClass }, { name: 'user', label: 'ログイン名', field: 'user', align: 'left', classes: inactiveRowClass }, - { name: 'actions', label: '操作', field: 'actions' } + { name: 'actions', label: '操作', field: 'actions', classes: inactiveRowClass } ]; const pagination = ref({ sortBy: 'id', descending: true, rowsPerPage: 20 }); @@ -174,6 +181,8 @@ const domainActive = ref(true); const isCreate = ref(true); let editId = ref(0); let ownerid = ref(''); +const shareDg = ref(false); +const shareDomain = ref({}); const getDomain = async () => { loading.value = true; @@ -209,7 +218,10 @@ const removeRow = (row: IDomainDisplay) => { } const deleteDomain = () => { - api.delete(`api/domain/${editId.value}`).then(() => { + api.delete(`api/domain/${editId.value}`).then(({ data }) => { + if (!data.data) { + // TODO dialog + } getDomain(); // authStore.setCurrentDomain(); }) @@ -266,6 +278,15 @@ const onSubmit = () => { }) } +const openShareDg = (row: IDomainDisplay) => { + shareDomain.value = row; + shareDg.value = true; +}; + +const closeShareDg = () => { + shareDg.value = false; +} + const onReset = () => { name.value = ''; url.value = ''; @@ -283,5 +304,6 @@ const onReset = () => { \ No newline at end of file diff --git a/frontend/src/pages/UserDomain.vue b/frontend/src/pages/UserDomain.vue index e4ba99c..4d0edb5 100644 --- a/frontend/src/pages/UserDomain.vue +++ b/frontend/src/pages/UserDomain.vue @@ -28,32 +28,8 @@ @@ -94,6 +70,7 @@ import { api } from 'boot/axios'; import { useAuthStore } from 'stores/useAuthStore'; import ShowDialog from 'components/ShowDialog.vue'; +import DomainCard from 'components/UserDomain/DomainCard.vue'; import DomainSelect from 'components/DomainSelect.vue'; const authStore = useAuthStore(); @@ -129,9 +106,9 @@ const clickAddDomain = () => { const addUserDomainFinished = async (val: string) => { showAddDomainDg.value = true; - addUserDomainLoading.value = true; const selected = addDomainRef.value.selected; if (val == 'OK' && selected.length > 0) { + addUserDomainLoading.value = true; const { data } = await api.post(`api/domain/${authStore.userId}?domainid=${selected[0].id}`) if (rows.value.length === 0 && data.data) { const domain = data.data; @@ -142,9 +119,9 @@ const addUserDomainFinished = async (val: string) => { }); } await getDomain(); - addUserDomainLoading.value = false; - showAddDomainDg.value = false; } + addUserDomainLoading.value = false; + showAddDomainDg.value = false; }; const showDeleteConfirm = ref(false); diff --git a/frontend/src/types/UserTypes.ts b/frontend/src/types/UserTypes.ts index 54250b2..cf7b275 100644 --- a/frontend/src/types/UserTypes.ts +++ b/frontend/src/types/UserTypes.ts @@ -1,8 +1,21 @@ export interface IUser { + id: number; first_name: string; last_name: string; email: string; is_active: boolean, is_superuser: boolean, - roles: string[] + roles: object[] } + +export interface IUserDisplay { + id: number; + firstName: string; + lastName: string; + fullName: string; + fullNameSearch: string; + email: string; + isActive: boolean, + isSuperuser: boolean, + roles: object[] +} \ No newline at end of file