parent
c3468e4287
commit
7d79c6f0dd
4 changed files with 46 additions and 44 deletions
@ -1,16 +1,17 @@ |
|||||||
|
import { tr } from "element-plus/es/locale"; |
||||||
import { setStep, getStepId } from "../api/index"; |
import { setStep, getStepId } from "../api/index"; |
||||||
import settingStore from "../store/modules/setting"; |
import settingStore from "../store/modules/setting"; |
||||||
import pinia from "@/store"; |
import pinia from "@/store"; |
||||||
const useStore = settingStore(pinia); |
const useStore = settingStore(pinia); |
||||||
export const setStepEvent = async (step: number, controlsSt: string) => { |
export const setStepEvent = async (step: number, controlsSt: string,isRedo:boolean = false) => { |
||||||
let id: any = null; |
let id: any = null; |
||||||
if (!useStore.stepIds) { |
if (!useStore.stepIds) { |
||||||
const data: any = await getStepId(); |
const data: any = await getStepId(); |
||||||
useStore.stepIds = data.result.map((item: any) => item.id); |
useStore.stepIds = data.result.map((item: any) => item.id); |
||||||
id = useStore.stepIds[step - 1]; |
id = useStore.stepIds[step - 1]; |
||||||
// return id;
|
// return id;
|
||||||
await setStep({ id, controlsSt }); |
await setStep({ id, controlsSt,isRedo }); |
||||||
} else { |
} else { |
||||||
await setStep({ id: useStore.stepIds[step - 1], controlsSt }); |
await setStep({ id: useStore.stepIds[step - 1], controlsSt,isRedo }); |
||||||
} |
} |
||||||
}; |
}; |
||||||
|
Loading…
Reference in new issue