fixed ui and some bugs
This commit is contained in:
@@ -31,6 +31,18 @@
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
|
||||
<a-time-picker
|
||||
v-else-if="fieldType === 'time'"
|
||||
:value="modelValue || undefined"
|
||||
:disabled="disabled"
|
||||
class="w-full"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm:ss"
|
||||
:minute-step="5"
|
||||
placeholder="انتخاب ساعت"
|
||||
@update:value="onTimeChange"
|
||||
/>
|
||||
|
||||
<a-input-number
|
||||
v-else-if="fieldType === 'price'"
|
||||
:value="priceValue"
|
||||
@@ -130,6 +142,12 @@ function onSelectChange(val: string | undefined) {
|
||||
emit('update:value', val ?? '')
|
||||
}
|
||||
|
||||
function onTimeChange(val: string | string[] | undefined) {
|
||||
const v = Array.isArray(val) ? val[0] : val
|
||||
emit('update:value', v ?? '')
|
||||
emit('blur')
|
||||
}
|
||||
|
||||
const priceValue = computed(() => {
|
||||
const n = parseFloat(String(props.modelValue || '').replace(/,/g, ''))
|
||||
return Number.isFinite(n) ? n : undefined
|
||||
|
||||
Reference in New Issue
Block a user