2019-11-24 13:16:24 +00:00
|
|
|
<template>
|
|
|
|
<div class="select">
|
2022-05-14 15:04:04 +00:00
|
|
|
<select
|
|
|
|
v-model="priority"
|
|
|
|
:disabled="disabled || undefined"
|
2024-02-07 11:18:19 +00:00
|
|
|
@change="updateData"
|
2022-05-14 15:04:04 +00:00
|
|
|
>
|
2024-02-07 11:18:19 +00:00
|
|
|
<option :value="PRIORITIES.UNSET">
|
|
|
|
{{ $t('task.priority.unset') }}
|
|
|
|
</option>
|
|
|
|
<option :value="PRIORITIES.LOW">
|
|
|
|
{{ $t('task.priority.low') }}
|
|
|
|
</option>
|
|
|
|
<option :value="PRIORITIES.MEDIUM">
|
|
|
|
{{ $t('task.priority.medium') }}
|
|
|
|
</option>
|
|
|
|
<option :value="PRIORITIES.HIGH">
|
|
|
|
{{ $t('task.priority.high') }}
|
|
|
|
</option>
|
|
|
|
<option :value="PRIORITIES.URGENT">
|
|
|
|
{{ $t('task.priority.urgent') }}
|
|
|
|
</option>
|
|
|
|
<option :value="PRIORITIES.DO_NOW">
|
|
|
|
{{ $t('task.priority.doNow') }}
|
|
|
|
</option>
|
2019-11-24 13:16:24 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-05-14 15:04:04 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
import {ref, watch} from 'vue'
|
2022-08-13 13:26:57 +00:00
|
|
|
import {PRIORITIES} from '@/constants/priorities'
|
2019-11-24 13:16:24 +00:00
|
|
|
|
2022-05-14 15:04:04 +00:00
|
|
|
const props = defineProps({
|
|
|
|
modelValue: {
|
|
|
|
type: Number,
|
2022-09-13 15:30:33 +00:00
|
|
|
default: 0,
|
2020-09-05 20:35:52 +00:00
|
|
|
},
|
2022-05-14 15:04:04 +00:00
|
|
|
disabled: {
|
|
|
|
default: false,
|
2020-09-05 20:35:52 +00:00
|
|
|
},
|
2022-02-15 12:07:59 +00:00
|
|
|
})
|
2022-09-13 15:30:33 +00:00
|
|
|
const emit = defineEmits(['update:modelValue'])
|
|
|
|
|
|
|
|
const priority = ref(0)
|
2022-05-14 15:04:04 +00:00
|
|
|
|
|
|
|
watch(
|
|
|
|
() => props.modelValue,
|
|
|
|
(value) => {
|
|
|
|
priority.value = value
|
|
|
|
},
|
|
|
|
{immediate: true},
|
|
|
|
)
|
|
|
|
|
|
|
|
function updateData() {
|
|
|
|
emit('update:modelValue', priority.value)
|
|
|
|
}
|
2019-11-24 13:16:24 +00:00
|
|
|
</script>
|