Добавление системы приоритетов

This commit is contained in:
2024-06-15 15:34:07 +07:00
parent 9939364128
commit f4fc01c56d
5 changed files with 170 additions and 33 deletions
+17 -6
View File
@@ -4,17 +4,20 @@ import {invoke} from "@tauri-apps/api";
const props = defineProps({
task_id: String,
task_name: String,
task_description: String
task_description: String,
task_priority: String
})
let name = props.task_name
let description = props.task_description
let name = props.task_name;
let description = props.task_description;
let priority = parseInt(props.task_priority);
async function send_edited_task(){
await invoke('edit_task', {
idTask: props.task_id,
name: name,
description: description
description: description,
priority: priority.toString()
}).then(() => location.reload());
}
</script>
@@ -27,7 +30,7 @@ async function send_edited_task(){
<!-- Modal header -->
<div class="flex items-center justify-between px-5 py-2 md:py-3 border-b rounded-t">
<h3 class="text-xl font-semibold text-gray-700 dark:text-gray-100">
Новая задача
Изменить задачу
</h3>
<button type="button" @click="$emit('close')" class="transition-colors text-gray-400 dark:text-gray-300 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center" data-modal-hide="default-modal">
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
@@ -53,11 +56,19 @@ async function send_edited_task(){
<textarea v-model="description" id="description" name="description" class="px-2 py-1.5 block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-inset sm:text-sm sm:leading-6" />
</div>
</div>
<div>
<div class="flex items-center justify-between">
<label for="priority" class="block text-sm font-medium leading-6 text-gray-900 dark:text-gray-200">Приоритет</label>
</div>
<div class="mt-2">
<input v-model="priority" type="number" required min="0" max="10" step="1" id="priority" name="priority" class="px-2 py-1.5 block w-48 rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-inset sm:text-sm sm:leading-6" />
</div>
</div>
</div>
</div>
<!-- Modal footer -->
<div class="flex items-center py-3 px-5 md:p-3 border-t border-gray-200 rounded-b">
<input type="submit" class="text-white bg-green-500 hover:bg-green-600 transition-colors font-medium rounded-lg text-sm px-5 py-2.5 text-center" value="Создать">
<input type="submit" class="text-white bg-green-500 hover:bg-green-600 transition-colors font-medium rounded-lg text-sm px-5 py-2.5 text-center" value="Изменить">
</div>
</form>
</div>