mirror of https://github.com/nocodb/nocodb
42 lines
1.0 KiB
42 lines
1.0 KiB
2 years ago
|
<script setup lang="ts">
|
||
2 years ago
|
import { durationOptions } from '@/utils'
|
||
2 years ago
|
|
||
2 years ago
|
interface Props {
|
||
|
value: Record<string, any>
|
||
|
}
|
||
|
|
||
|
const props = defineProps<Props>()
|
||
|
const emit = defineEmits(['update:value'])
|
||
|
const vModel = useVModel(props, 'value', emit)
|
||
2 years ago
|
|
||
2 years ago
|
const durationOptionList =
|
||
|
durationOptions.map((o) => ({
|
||
2 years ago
|
...o,
|
||
|
// h:mm:ss (e.g. 3:45, 1:23:40)
|
||
|
title: `${o.title} ${o.example}`,
|
||
2 years ago
|
})) || []
|
||
2 years ago
|
|
||
|
// set default value
|
||
2 years ago
|
vModel.value.meta = {
|
||
2 years ago
|
duration: 0,
|
||
2 years ago
|
...vModel.value.meta,
|
||
2 years ago
|
}
|
||
2 years ago
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<a-row>
|
||
|
<a-col :span="24">
|
||
|
<span class="prose-sm mt-2">A duration of time in minutes or seconds (e.g. 1:23).</span>
|
||
|
</a-col>
|
||
|
<a-col :span="24">
|
||
|
<a-form-item label="Duration Format">
|
||
2 years ago
|
<a-select v-model:value="vModel.meta.duration" class="w-52">
|
||
2 years ago
|
<a-select-option v-for="(duration, i) of durationOptionList" :key="i" :value="duration.id">
|
||
2 years ago
|
{{ duration.title }}
|
||
|
</a-select-option>
|
||
|
</a-select>
|
||
|
</a-form-item>
|
||
|
</a-col>
|
||
|
</a-row>
|
||
|
</template>
|