add owner column
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
:rules="[val => val && val.length > 0 || 'kintoneの環境名を入力してください。']" />
|
||||
|
||||
<q-input filled type="url" v-model.trim="url" label="Kintone url" hint="KintoneのURLを入力してください" lazy-rules
|
||||
:rules="[val => val && val.length > 0, isDomain || 'KintoneのURLを入力してください']" />
|
||||
:rules="[val => val && val.length > 0 || 'KintoneのURLを入力してください']" />
|
||||
|
||||
<q-input filled v-model="kintoneuser" label="ログイン名 *" hint="Kintoneのログイン名を入力してください" lazy-rules
|
||||
:rules="[val => val && val.length > 0 || 'Kintoneのログイン名を入力してください']" autocomplete="new-password" />
|
||||
@@ -145,11 +145,11 @@ 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';
|
||||
import { IDomain, IDomainOwnerDisplay, IDomainSubmit } from '../types/DomainTypes';
|
||||
|
||||
const authStore = useAuthStore();
|
||||
const domainStore = useDomainStore();
|
||||
const inactiveRowClass = (row: IDomainDisplay) => row.domainActive ? '' : 'inactive-row';
|
||||
const inactiveRowClass = (row: IDomainOwnerDisplay) => row.domainActive ? '' : 'inactive-row';
|
||||
|
||||
const columns = [
|
||||
{ name: 'id', label: 'ID', field: 'id', align: 'left', sortable: true, classes: inactiveRowClass },
|
||||
@@ -164,8 +164,8 @@ const columns = [
|
||||
// },
|
||||
{ name: 'name', label: '環境名', field: 'name', align: 'left', sortable: true, classes: inactiveRowClass },
|
||||
{ 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: 'owner', label: '所有者', field: row => row.owner.fullName, align: 'left', classes: inactiveRowClass },
|
||||
{ name: 'actions', label: '操作', field: 'actions', classes: inactiveRowClass }
|
||||
];
|
||||
|
||||
@@ -175,7 +175,7 @@ const addEditLoading = ref(false);
|
||||
const deleteLoadingState = ref<number>(-1); // -1: loading, 0: allow, > 0: user count
|
||||
|
||||
const filter = ref('');
|
||||
const rows = ref<IDomainDisplay[]>([]);
|
||||
const rows = ref<IDomainOwnerDisplay[]>([]);
|
||||
const show = ref(false);
|
||||
const confirm = ref(false);
|
||||
const resetPsw = ref(false);
|
||||
@@ -191,9 +191,8 @@ const kintonepwdBK = ref('');
|
||||
const domainActive = ref(true);
|
||||
const isCreate = ref(true);
|
||||
let editId = ref(0);
|
||||
let ownerid = ref('');
|
||||
const shareDg = ref(false);
|
||||
const shareDomain = ref<IDomainDisplay|object>({});
|
||||
const shareDomain = ref<IDomainOwnerDisplay>();
|
||||
|
||||
const getDomain = async () => {
|
||||
loading.value = true;
|
||||
@@ -207,6 +206,16 @@ const getDomain = async () => {
|
||||
url: item.url,
|
||||
user: item.kintoneuser,
|
||||
password: item.kintonepwd,
|
||||
owner: {
|
||||
id: item.owner.id,
|
||||
firstName: item.owner.first_name,
|
||||
lastName: item.owner.last_name,
|
||||
fullNameSearch: (item.owner.last_name + item.owner.first_name).toLowerCase(),
|
||||
fullName: item.owner.last_name + ' ' + item.owner.first_name,
|
||||
email: item.owner.email,
|
||||
isActive: item.owner.is_active,
|
||||
isSuperuser: item.owner.is_superuser,
|
||||
}
|
||||
}
|
||||
});
|
||||
loading.value = false;
|
||||
@@ -223,7 +232,7 @@ const addRow = () => {
|
||||
show.value = true;
|
||||
}
|
||||
|
||||
const removeRow = async (row: IDomainDisplay) => {
|
||||
const removeRow = async (row: IDomainOwnerDisplay) => {
|
||||
confirm.value = true;
|
||||
deleteLoadingState.value = -1;
|
||||
editId.value = row.id;
|
||||
@@ -294,9 +303,9 @@ const onSubmit = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const openShareDg = (row: IDomainDisplay|number) => {
|
||||
const openShareDg = (row: IDomainOwnerDisplay|number) => {
|
||||
if (typeof row === 'number') {
|
||||
row = rows.value.find(item => item.id === row) as IDomainDisplay;
|
||||
row = rows.value.find(item => item.id === row) as IDomainOwnerDisplay;
|
||||
}
|
||||
shareDomain.value = row ;
|
||||
shareDg.value = true;
|
||||
@@ -313,7 +322,6 @@ const onReset = () => {
|
||||
kintonepwd.value = '';
|
||||
isPwd.value = true;
|
||||
editId.value = 0;
|
||||
ownerid.value = '';
|
||||
isCreate.value = true;
|
||||
domainActive.value = true;
|
||||
resetPsw.value = false
|
||||
|
||||
Reference in New Issue
Block a user