fix channel price bug 3

This commit is contained in:
2026-07-07 21:10:23 +03:30
parent b58620f062
commit 16397800bb
4 changed files with 121 additions and 14 deletions
@@ -38,6 +38,21 @@
</a-select-option>
</a-select>
<a-select
v-else-if="fieldType === 'multiselect'"
:value="multiSelectValue"
:disabled="disabled"
mode="multiple"
allow-clear
placeholder="انتخاب کنید"
class="w-full"
@update:value="onMultiSelectChange"
>
<a-select-option v-for="opt in selectItems" :key="opt.key" :value="opt.key">
{{ opt.value }}
</a-select-option>
</a-select>
<a-time-picker
v-else-if="fieldType === 'time'"
:value="modelValue || undefined"
@@ -151,6 +166,18 @@ function onSelectChange(val: string | undefined) {
emit('update:value', val ?? '')
}
const multiSelectValue = computed<string[]>(() =>
String(props.modelValue || '')
.split(',')
.map((s) => s.trim())
.filter((s) => s !== '')
)
function onMultiSelectChange(val: string[] | undefined) {
const list = Array.isArray(val) ? val.map((s) => s.trim()).filter((s) => s !== '') : []
emit('update:value', list.join(','))
}
function onTimeChange(val: string | string[] | undefined) {
const v = Array.isArray(val) ? val[0] : val
emit('update:value', v ?? '')