Skip to content

Commit

Permalink
新建副表时从空白开始
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Nov 18, 2023
1 parent e3c1fc5 commit f0f99db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions ui/src/pages/Plan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { storeToRefs } from 'pinia'
import { useConfigStore } from '@/stores/config'
import { usePlanStore } from '@/stores/plan'
import { deepcopy } from '@/utils/deepcopy'
const config_store = useConfigStore()
const { plan_file, free_blacklist } = storeToRefs(config_store)
Expand All @@ -17,10 +18,9 @@ const {
operators,
workaholic,
backup_plans,
plan,
sub_plan
} = storeToRefs(plan_store)
const { load_plan } = plan_store
const { load_plan, fill_empty } = plan_store
import { inject, ref, computed, provide } from 'vue'
const axios = inject('axios')
Expand Down Expand Up @@ -86,15 +86,15 @@ const sub_plan_options = computed(() => {
function create_sub_plan() {
backup_plans.value.push({
conf: {
exhaust_require: JSON.parse(JSON.stringify(exhaust_require.value)),
free_blacklist: JSON.parse(JSON.stringify(free_blacklist.value)),
exhaust_require: deepcopy(exhaust_require.value),
free_blacklist: deepcopy(free_blacklist.value),
ling_xi: ling_xi.value,
max_resting_count: max_resting_count.value,
rest_in_full: JSON.parse(JSON.stringify(rest_in_full.value)),
resting_priority: JSON.parse(JSON.stringify(resting_priority.value)),
workaholic: JSON.parse(JSON.stringify(workaholic.value))
rest_in_full: deepcopy(rest_in_full.value),
resting_priority: deepcopy(resting_priority.value),
workaholic: deepcopy(workaholic.value)
},
plan: JSON.parse(JSON.stringify(plan.value)),
plan: fill_empty({}),
trigger: {
left: '',
operator: '',
Expand Down
6 changes: 4 additions & 2 deletions ui/src/stores/plan.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineStore } from 'pinia'
import { ref, watch, computed } from 'vue'
import axios from 'axios'
import { deepcopy } from '@/utils/deepcopy'

export const usePlanStore = defineStore('plan', () => {
const ling_xi = ref(1)
Expand Down Expand Up @@ -148,7 +149,7 @@ export const usePlanStore = defineStore('plan', () => {
resting_priority: list2str(resting_priority.value),
workaholic: list2str(workaholic.value)
},
backup_plans: JSON.parse(JSON.stringify(backup_plans.value))
backup_plans: deepcopy(backup_plans.value)
}
for (const b of result.backup_plans) {
for (const i of backup_conf_convert_list) {
Expand Down Expand Up @@ -234,6 +235,7 @@ export const usePlanStore = defineStore('plan', () => {
groups,
backup_plans,
sub_plan,
current_plan
current_plan,
fill_empty
}
})

0 comments on commit f0f99db

Please sign in to comment.