mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
refactor: filter functions as composable
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
class="cell-content"
|
||||
:class="`${isNull(col)} type-${typeof col === 'number' ? 'int' : 'varchar'}`"
|
||||
@dblclick="dblClick(cKey)"
|
||||
>{{ cutText(col) }}</span>
|
||||
>{{ cutText(col, 250) }}</span>
|
||||
</div>
|
||||
<ConfirmModal
|
||||
v-if="isInfoModal"
|
||||
@ -48,6 +48,9 @@
|
||||
import { Ref, ref } from 'vue';
|
||||
import ConfirmModal from '@/components/BaseConfirmModal.vue';
|
||||
import TextEditor from '@/components/BaseTextEditor.vue';
|
||||
import { useFilters } from '@/composables/useFilters';
|
||||
|
||||
const { cutText } = useFilters();
|
||||
|
||||
const props = defineProps({
|
||||
row: Object
|
||||
@ -79,11 +82,6 @@ const dblClick = (col: string) => {
|
||||
isInfoModal.value = true;
|
||||
};
|
||||
|
||||
const cutText = (val: string | number) => {
|
||||
if (typeof val !== 'string') return val;
|
||||
return val.length > 250 ? `${val.substring(0, 250)}[...]` : val;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
Reference in New Issue
Block a user