change user to uuid
This commit is contained in:
parent
50cbf94ee5
commit
4c5d132de8
17 changed files with 86 additions and 93 deletions
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="grow flex flex-col gap-2 overflow-hidden">
|
||||
<div v-if="useSearch" class="relative self-end flex flex-row items-center gap-2">
|
||||
<Spinner v-if="deferingSearch" />
|
||||
<Spinner v-if="deferingSearch" />
|
||||
<input
|
||||
type="text"
|
||||
class="!max-w-64 !w-64 rounded-md shadow-sm relative block px-3 py-2 pr-5 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
||||
|
@ -82,27 +82,30 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
const slots = defineSlots<{
|
||||
pageRow(props: { row: T }): void;
|
||||
pageRow(props: { row: T; key: number }): void;
|
||||
}>();
|
||||
|
||||
const timer = ref(undefined) as undefined | any;
|
||||
const currentPage = ref(0);
|
||||
const searchString = ref("");
|
||||
const deferingSearch = ref(false)
|
||||
const deferingSearch = ref(false);
|
||||
|
||||
watch(searchString, async () => {
|
||||
deferingSearch.value = true
|
||||
deferingSearch.value = true;
|
||||
clearTimeout(timer.value);
|
||||
timer.value = setTimeout(() => {
|
||||
currentPage.value = 0;
|
||||
deferingSearch.value = false
|
||||
deferingSearch.value = false;
|
||||
emit("search", searchString.value);
|
||||
}, 600);
|
||||
});
|
||||
|
||||
watch(() => props.totalCount, async () => {
|
||||
currentPage.value = 0;
|
||||
});
|
||||
watch(
|
||||
() => props.totalCount,
|
||||
async () => {
|
||||
currentPage.value = 0;
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits({
|
||||
submit(id: number) {
|
||||
|
@ -159,7 +162,7 @@ const loadPage = (newPage: number | ".") => {
|
|||
if (pageEnd > entryCount.value) pageEnd = entryCount.value;
|
||||
|
||||
let loadedElementCount = filterData(props.items, searchString.value, pageStart, pageEnd).length;
|
||||
|
||||
|
||||
if (loadedElementCount < props.maxEntriesPerPage && (pageEnd != props.totalCount || loadedElementCount == 0))
|
||||
emit("loadData", pageStart, props.maxEntriesPerPage, searchString.value);
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ import Spinner from "../Spinner.vue";
|
|||
export default defineComponent({
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Array as PropType<Array<number>>,
|
||||
type: Array as PropType<Array<string>>,
|
||||
default: [],
|
||||
},
|
||||
title: String,
|
||||
|
@ -133,7 +133,7 @@ export default defineComponent({
|
|||
get() {
|
||||
return this.modelValue;
|
||||
},
|
||||
set(val: Array<number>) {
|
||||
set(val: Array<string>) {
|
||||
this.$emit("update:model-value", val);
|
||||
if (this.modelValue.length < val.length) {
|
||||
let diff = difference(val, this.modelValue);
|
||||
|
@ -166,7 +166,7 @@ export default defineComponent({
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getMemberFromSearch(id: number) {
|
||||
getMemberFromSearch(id: string) {
|
||||
return this.filtered.find((f) => f.id == id);
|
||||
},
|
||||
loadMembersInitial() {
|
||||
|
|
|
@ -178,12 +178,12 @@ export default defineComponent({
|
|||
if (!this.permissionUpdate[section]) {
|
||||
this.permissionUpdate[section] = {};
|
||||
}
|
||||
this.permissionUpdate[section].all = permissions;
|
||||
this.permissionUpdate[section]!.all = permissions;
|
||||
} else {
|
||||
if (!this.permissionUpdate[section]) {
|
||||
this.permissionUpdate[section] = {};
|
||||
}
|
||||
this.permissionUpdate[section][modul] = permissions;
|
||||
this.permissionUpdate[section]![modul] = permissions;
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue