From 58ef8a6b1dbcb80bad79faf1dfc859368daa29a0 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Tue, 29 Nov 2022 14:24:33 +0800 Subject: [PATCH] style: crontab --- .../src/components/Crontab/src/Crontab.vue | 72 ++++++++----------- 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue index 8446ed212..a5a9e56a6 100644 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue +++ b/yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue @@ -2,9 +2,6 @@ import { ElInput, ElInputNumber, - ElDropdown, - ElDropdownMenu, - ElDropdownItem, ElDialog, ElTabs, ElTabPane, @@ -352,14 +349,19 @@ onMounted(() => { defaultValue.value = props.modelValue }) const emit = defineEmits(['update:modelValue']) -const handleShortcuts = (command) => { - if (command == 'custom') { - open() - } else { - defaultValue.value = command - emit('update:modelValue', defaultValue.value) +const select = ref() +watch( + () => select.value, + () => { + console.info(select.value) + if (select.value == 'custom') { + open() + } else { + defaultValue.value = select.value + emit('update:modelValue', defaultValue.value) + } } -} +) const open = () => { set() dialogVisible.value = true @@ -510,37 +512,23 @@ const submit = () => { }