Skip to content

Commit f0ecd3a

Browse files
authored
chore: some agreements update (#249)
1 parent 8bb26be commit f0ecd3a

File tree

3 files changed

+76
-8
lines changed

3 files changed

+76
-8
lines changed

apps/atrium-telegram/app/pages/agreement/[agreementId]/index.vue

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<Section>
7070
<div class="flex flex-row gap-2 items-start">
7171
<UIcon
72-
name="i-lucide-file"
72+
:name="getFileData(file).icon"
7373
class="shrink-0 size-8 text-primary"
7474
/>
7575

@@ -86,6 +86,7 @@
8686
</template>
8787

8888
<script setup lang="ts">
89+
import type { PartnerAgreementFile } from '@roll-stack/database'
8990
import { getPatentStatus } from '#shared/utils/helpers'
9091
import { format } from 'date-fns'
9192
import { ru } from 'date-fns/locale/ru'
@@ -100,4 +101,48 @@ const { params } = useRoute('agreement-agreementId')
100101
const partnerStore = usePartnerStore()
101102
const agreement = computed(() => partnerStore.agreements.find((agreement) => agreement.id === params.agreementId))
102103
const partner = computed(() => partnerStore.partners.find((partner) => partner.id === agreement.value?.legalEntity?.partners[0]?.id))
104+
105+
function getFileData(file: PartnerAgreementFile) {
106+
if (file.name.startsWith('Договор к')) {
107+
return {
108+
type: 'main',
109+
icon: 'i-lucide-book-text',
110+
}
111+
}
112+
if (file.name.startsWith('Акт о приеме')) {
113+
return {
114+
type: 'act',
115+
icon: 'i-lucide-file-text',
116+
}
117+
}
118+
if (file.name.startsWith('Патент')) {
119+
return {
120+
type: 'patent',
121+
icon: 'i-lucide-file-badge',
122+
}
123+
}
124+
if (file.name.startsWith('Заявление о расторжении')) {
125+
return {
126+
type: 'terminate',
127+
icon: 'i-lucide-file-x-2',
128+
}
129+
}
130+
if (file.name.startsWith('Заявление о приостановке')) {
131+
return {
132+
type: 'suspense',
133+
icon: 'i-lucide-file-clock',
134+
}
135+
}
136+
if (file.name.startsWith('График платежей')) {
137+
return {
138+
type: 'payments',
139+
icon: 'i-lucide-file-spreadsheet',
140+
}
141+
}
142+
143+
return {
144+
type: 'unknown',
145+
icon: 'i-lucide-file',
146+
}
147+
}
103148
</script>

apps/web-app/app/components/AgreementFilesBlock.vue

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
>
1818
<UIcon
1919
:name="getFileData(file).icon"
20-
:class="getFileData(file).class"
2120
class="size-5 hover:scale-110 duration-200"
21+
:class="[
22+
(isActive && getFileData(file).type === 'main') && 'text-secondary',
23+
]"
2224
/>
2325
</ULink>
2426

@@ -52,28 +54,49 @@
5254
<script setup lang="ts">
5355
import type { PartnerAgreementFile } from '@roll-stack/database'
5456
55-
defineProps<{ files: PartnerAgreementFile[] }>()
57+
defineProps<{ files: PartnerAgreementFile[], isActive?: boolean }>()
5658
5759
function getFileData(file: PartnerAgreementFile) {
5860
if (file.name.startsWith('Договор к')) {
5961
return {
6062
type: 'main',
6163
icon: 'i-lucide-book-text',
62-
class: 'text-secondary',
6364
}
6465
}
65-
if (file.name.startsWith('Акт о при')) {
66+
if (file.name.startsWith('Акт о приеме')) {
6667
return {
6768
type: 'act',
6869
icon: 'i-lucide-file-text',
69-
class: '',
70+
}
71+
}
72+
if (file.name.startsWith('Патент')) {
73+
return {
74+
type: 'patent',
75+
icon: 'i-lucide-file-badge',
76+
}
77+
}
78+
if (file.name.startsWith('Заявление о расторжении')) {
79+
return {
80+
type: 'terminate',
81+
icon: 'i-lucide-file-x-2',
82+
}
83+
}
84+
if (file.name.startsWith('Заявление о приостановке')) {
85+
return {
86+
type: 'suspense',
87+
icon: 'i-lucide-file-clock',
88+
}
89+
}
90+
if (file.name.startsWith('График платежей')) {
91+
return {
92+
type: 'payments',
93+
icon: 'i-lucide-file-spreadsheet',
7094
}
7195
}
7296
7397
return {
7498
type: 'unknown',
7599
icon: 'i-lucide-file',
76-
class: '',
77100
}
78101
}
79102
</script>

apps/web-app/app/pages/agreement/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
</div>
122122
</template>
123123
<template #files-cell="{ row }">
124-
<AgreementFilesBlock :files="row.original.files" />
124+
<AgreementFilesBlock :files="row.original.files" :is-active="!!row.getValue('isActive')" />
125125
</template>
126126
<template #royalty-cell="{ row }">
127127
<div class="text-center">

0 commit comments

Comments
 (0)