udpate
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-08-27 09:50:32 +03:00
parent 3b628cbfb3
commit 83d2666f22
55 changed files with 560 additions and 486 deletions

View File

@@ -0,0 +1,25 @@
<template>
<svg
class="q-ma-none q-pa-none"
:style="{
fill: color ?? 'red',
height: size ?? '42px',
width: 'auto'
}"
width="14" height="15" viewBox="0 0 14 15" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.63869 12.1902L3.50621 14.1092C3.18049 14.3087 2.75468 14.2064 2.55515 13.8807C2.45769 13.7216 2.42864 13.5299 2.47457 13.3491L2.95948 11.4405C3.13452 10.7515 3.60599 10.1756 4.24682 9.86791L7.6642 8.22716C7.82352 8.15067 7.89067 7.95951 7.81418 7.80019C7.75223 7.67116 7.61214 7.59896 7.47111 7.62338L3.66713 8.28194C2.89387 8.41581 2.1009 8.20228 1.49941 7.69823L0.297703 6.69116C0.00493565 6.44581 -0.0335059 6.00958 0.211842 5.71682C0.33117 5.57442 0.502766 5.48602 0.687982 5.47153L4.35956 5.18419C4.61895 5.16389 4.845 4.99974 4.94458 4.75937L6.36101 1.3402C6.5072 0.987302 6.91179 0.819734 7.26469 0.965925C7.43413 1.03612 7.56876 1.17075 7.63896 1.3402L9.05539 4.75937C9.15496 4.99974 9.38101 5.16389 9.6404 5.18419L13.3322 5.47311C13.713 5.50291 13.9975 5.83578 13.9677 6.2166C13.9534 6.39979 13.8667 6.56975 13.7269 6.68896L10.9114 9.08928C10.7131 9.25826 10.6267 9.52425 10.6876 9.77748L11.5532 13.3733C11.6426 13.7447 11.414 14.1182 11.0427 14.2076C10.8642 14.2506 10.676 14.2208 10.5195 14.1249L7.36128 12.1902C7.13956 12.0544 6.8604 12.0544 6.63869 12.1902Z"></path></svg>
</template>
<script setup lang="ts">
defineProps({
color: String,
size: String,
})
</script>
<style scoped>
.telegram-star-wrapper :deep(.telegram-star svg) {
fill: red;
}
</style>

View File

@@ -60,7 +60,7 @@
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import type { CompanyParams } from 'types/Company'
import { convertEmptyStringsToNull } from 'helpers/helpers'
import { convertEmptyStringsToNull } from 'src/utils/helpers'
const { t }= useI18n()

View File

@@ -1,13 +1,13 @@
<template>
<pn-page-card>
<template #title>
{{ $t(type + '__title') }}
{{ $t(title) }}
</template>
<pn-scroll-list>
<markdown-viewver
class="q-pa-md"
:locale
:documentName = "getDocumentName()"
:documentName
/>
</pn-scroll-list>
</pn-page-card>
@@ -18,22 +18,15 @@
import { useSettingsStore } from 'stores/settings'
import MarkdownViewver from 'components/MarkdownViewver.vue'
const props = defineProps<{
type: 'terms_of_use' | 'privacy' | 'consent'
defineProps<{
title: string
documentName: string
}>()
const settingsStore = useSettingsStore()
const DEFAULT_LOCALE = 'ru'
const locale = ref('ru')
const getDocumentName = () =>{
switch(props.type) {
case 'terms_of_use': return 'Terms_of_use'
case 'privacy': return 'Privacy-Policy'
case 'consent': return 'Consent_to_Personal_Data_Processing'
}
}
const parseLocale = (locale: string) => locale.split(/[-_]/)[0] || DEFAULT_LOCALE
onMounted(() => {

View File

@@ -61,6 +61,7 @@
<script setup lang="ts">
import { ref, Ref, computed } from 'vue' // eslint-disable-line
import { QFile } from 'quasar'
import imageCompression from 'browser-image-compression'
const modelValue = defineModel<string>()
@@ -70,6 +71,13 @@
avatar?: boolean
}>()
const compressionOptions = {
maxSizeMB: 0.5, // Максимальный размер ~500 КБ
maxWidthOrHeight: 1200, // Максимальное разрешение
useWebWorker: true, // Для производительности
fileType: 'image/jpeg' // Формат вывода
}
const imageFile = ref(null) // file-from selector
const imgFileSelector= ref() as Ref<QFile> // input file DOM
const size = ref<number>(props.size ? props.size : 100)
@@ -85,10 +93,21 @@
return String(size.value) + 'px'
})
async function handleUpload () {
async function handleUpload() {
if (imageFile.value) {
const img = await imgToBase64(imageFile.value)
modelValue.value = typeof img === 'string' ? img : ''
try {
const compressedFile = await imageCompression(
imageFile.value,
compressionOptions
);
const img = await imgToBase64(compressedFile);
modelValue.value = typeof img === 'string' ? img : '';
} catch (error) {
console.error('Image error compression:', error);
const img = await imgToBase64(imageFile.value);
modelValue.value = typeof img === 'string' ? img : '';
}
}
}
@@ -119,7 +138,14 @@
}
function checkImgType(files: File[]): File[] {
return files.filter((file: File) => file.type === 'image/x-png' || file.type === 'image/jpeg' || file.type === 'image/webp' )
const allowedTypes = [
'image/jpeg',
'image/png',
'image/webp',
'image/gif',
'image/bmp'
]
return files.filter((file: File) => allowedTypes.includes(file.type))
}
</script>

View File

@@ -56,7 +56,7 @@
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import type { ProjectParams } from 'types/Project'
import { convertEmptyStringsToNull } from 'helpers/helpers'
import { convertEmptyStringsToNull } from 'src/utils/helpers'
const { t } = useI18n()

View File

@@ -25,7 +25,7 @@
/>
<div
v-if="userStatus"
class="absolute-center text-h4 text-bold q-pa-sm"
class="absolute-center text-h4 text-bold q-pa-sm text-center"
:class ="'status-' + userStatus.status"
>
{{ $t(userStatus.text) }}
@@ -132,8 +132,8 @@
import { computed } from 'vue'
import { useCompaniesStore } from 'stores/companies'
import { useI18n } from 'vue-i18n'
import { convertEmptyStringsToNull } from 'src/helpers/helpers'
import type { User } from 'types/Users'
import { convertEmptyStringsToNull } from 'src/utils/helpers'
import type { User } from 'types/User'
const { t } = useI18n()
@@ -177,8 +177,9 @@
)
const userStatus = computed(() => {
if (modelValue.value.is_blocked) return { status: 'blocked', text: 'user_block__user_blocked'}
if (modelValue.value.is_leave) return { status: 'leave', text: 'user_block__user_leave'}
if (modelValue.value.is_blocked) return { status: 'blocked', text: 'user_block__user_blocked' }
if (modelValue.value.is_leave) return { status: 'leave', text: 'user_block__user_leave' }
if (!modelValue.value.is_terms_accepted) return { status: 'pending', text: 'user_block__user_pending' }
return null
})
@@ -190,12 +191,17 @@
}
.status-blocked {
border: 2px solid red;
color: red;
border: 2px solid var(--q-negative);
color: var(--q-negative);
}
.status-leave {
border: 2px solid var(--q-primary);
color: var(--q-primary);
}
.status-pending{
border: 2px solid var(--q-secondary);
color: var(--q-secondary);
}
</style>