fix: 数据库编辑导致标签关联删除修复、cron组件调整

This commit is contained in:
meilin.huang
2024-01-17 12:13:18 +08:00
parent 8332d9b354
commit cc3981d99c
10 changed files with 20 additions and 28 deletions

View File

@@ -78,7 +78,7 @@
</template>
<script lang="ts" setup>
import { computed, toRefs, onMounted, reactive, ref, nextTick } from 'vue';
import { computed, toRefs, onMounted, reactive, ref, nextTick, watch } from 'vue';
import CrontabSecond from './CrontabSecond.vue';
import CrontabMin from './CrontabMin.vue';
import CrontabHour from './CrontabHour.vue';
@@ -129,9 +129,15 @@ const { tabTitles, crontabValueObj } = toRefs(state);
onMounted(() => {
resolveExp();
changeTab(state.activeName);
});
watch(
() => props.expression,
() => {
resolveExp();
}
);
function shouldHide(key: string) {
if (props.hideComponent && props.hideComponent.includes(key)) return false;
return true;
@@ -156,6 +162,7 @@ function resolveExp() {
...obj,
};
}
changeTab(state.activeName);
} else {
//没有传入的表达式 则还原
clearCron();