From 7d83090e94bf286173a79eba398ce29ec009b2c2 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Thu, 9 Nov 2023 17:57:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=AF=E8=A1=A8=E5=B9=B2=E5=91=98=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/PlanEditor.vue | 2 +- ui/src/pages/Plan.vue | 87 +++++++++++++++++++- ui/src/stores/plan.js | 131 ++++++++++++++++++++++--------- 3 files changed, 180 insertions(+), 40 deletions(-) diff --git a/ui/src/components/PlanEditor.vue b/ui/src/components/PlanEditor.vue index 637b080ab..e97e138d8 100644 --- a/ui/src/components/PlanEditor.vue +++ b/ui/src/components/PlanEditor.vue @@ -7,7 +7,7 @@ import pinyinMatch from 'pinyin-match/es/traditional' import { NAvatar, NTag } from 'naive-ui' const config_store = useConfigStore() const plan_store = usePlanStore() -const { operators, plan, groups } = storeToRefs(plan_store) +const { operators, groups, current_plan: plan } = storeToRefs(plan_store) const { facility_operator_limit } = plan_store const { theme } = storeToRefs(config_store) diff --git a/ui/src/pages/Plan.vue b/ui/src/pages/Plan.vue index c9ee5fa44..f339bc8a2 100644 --- a/ui/src/pages/Plan.vue +++ b/ui/src/pages/Plan.vue @@ -17,7 +17,8 @@ const { operators, workaholic, backup_plans, - plan + plan, + sub_plan } = storeToRefs(plan_store) const { load_plan } = plan_store @@ -66,8 +67,6 @@ async function save() { const mobile = inject('mobile') -const sub_plan = ref('main') - const sub_plan_options = computed(() => { const result = [ { @@ -110,6 +109,13 @@ function delete_sub_plan() { backup_plans.value.splice(sub_plan.value, 1) sub_plan.value = 'main' } + +const current_conf = computed(() => { + if (sub_plan.value == 'main') { + return {} + } + return backup_plans.value[sub_plan.value].conf +})