process.ts 573 Bytes
const useProcessStore = defineStore(
    // 唯一ID
    'process',
    () => {
      const processNodes = ref([])
      const staffVOS = computed(() => { // 最后审批node
        return processNodes.value.find((item:any) => item.approvalState)
      })
      const clearStore = () => {
        processNodes.value = []
      }
      return {
        processNodes,
        staffVOS,
        clearStore
      }
    },
    {
      persist:{
        storage: sessionStorage,
        paths: ['processNodes','staffVOS']
      }
    }
  )
  
  export default useProcessStore