@@ -23,7 +23,11 @@
|
||||
:loading="!!data?.confirmLoading"
|
||||
custom-class="confirm-modal__btn confirm-modal__btn--confirm"
|
||||
@click="confirm(data)"
|
||||
/>
|
||||
>
|
||||
<template #appendIcon>
|
||||
<SvgIcon name="arrow-left" :size="18" color="#fff" />
|
||||
</template>
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -31,6 +35,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import SvgIcon from './icons/SvgIcon.vue'
|
||||
import { useModalStore } from '@/store/modal'
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import BaseButton from '@/components/BaseButton.vue'
|
||||
@@ -82,10 +87,6 @@ const cancel = (data) => {
|
||||
&__btn {
|
||||
min-width: 100px;
|
||||
padding: 0.5rem 1.5rem;
|
||||
|
||||
&--confirm {
|
||||
padding-inline: 1.5rem 2.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -85,7 +85,7 @@ const props = defineProps({
|
||||
name: { type: String, default: '' },
|
||||
label: { type: String, default: '' },
|
||||
placeholder: { type: String, default: 'انتخاب کنید' },
|
||||
options: { type: Array, required: true },
|
||||
options: { type: Array, default: () => [] },
|
||||
optionLabel: { type: String, default: 'name' },
|
||||
optionValue: { type: String, default: 'id' },
|
||||
multiple: { type: Boolean, default: false },
|
||||
@@ -118,13 +118,14 @@ const isSelected = (opt) => {
|
||||
const selectedLabel = computed(() => {
|
||||
const value = props.modelValue
|
||||
if (value === undefined || value === null || value === '') return props.placeholder
|
||||
const options = props.options ?? []
|
||||
if (props.multiple && Array.isArray(value)) {
|
||||
const selected = props.options.filter((o) => value.includes(o[props.optionValue]))
|
||||
const selected = options.filter((o) => value.includes(o[props.optionValue]))
|
||||
if (selected.length === 0) return props.placeholder
|
||||
if (selected.length <= 2) return selected.map((s) => s[props.optionLabel]).join('، ')
|
||||
return `${selected.length} مورد انتخاب شده`
|
||||
}
|
||||
const found = props.options.find((o) => o[props.optionValue] === value)
|
||||
const found = options.find((o) => o[props.optionValue] === value)
|
||||
return found ? found[props.optionLabel] : props.placeholder
|
||||
})
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@
|
||||
<script setup>
|
||||
import { toast } from 'vue3-toastify'
|
||||
import useModal from '@/composables/useModal'
|
||||
import { PermissionModal } from '@/features/auth'
|
||||
import SvgIcon from '@/components/icons/SvgIcon.vue'
|
||||
import { computed, onBeforeUnmount, ref, watch } from 'vue'
|
||||
import PermissionModal from '@/features/auth/components/studentRegister/PermissionModal.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: [Object, File, String, null], default: null },
|
||||
|
||||
Vendored
-3
@@ -13,9 +13,6 @@ export type IconName =
|
||||
| 'caret-right'
|
||||
| 'chat'
|
||||
| 'chat-centered-dots'
|
||||
| 'chat-slash'
|
||||
| 'chat-text'
|
||||
| 'chats'
|
||||
| 'check'
|
||||
| 'check-square'
|
||||
| 'close'
|
||||
|
||||
Reference in New Issue
Block a user