init task record store
This commit is contained in:
14
src/modules/record/components/TaskRecord.vue
Normal file
14
src/modules/record/components/TaskRecord.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
taskId: string
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="task-record"></div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.task-record {
|
||||
}
|
||||
</style>
|
||||
20
src/modules/record/stores/useTaskRecordStore.ts
Normal file
20
src/modules/record/stores/useTaskRecordStore.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import type { Recordable } from '../interfaces/recordable'
|
||||
|
||||
interface StoredTaskRecordable
|
||||
extends Omit<Recordable, 'start' | 'end' | 'stepRecords'> {
|
||||
start: string
|
||||
end?: string
|
||||
stepRecords: Record<string, { start: string; end?: string }>
|
||||
}
|
||||
|
||||
export interface TaskRecordStoreState {
|
||||
records: { [taskId: string]: StoredTaskRecordable[] }
|
||||
}
|
||||
|
||||
export const useTaskRecordStore = defineStore('task-record-store', {
|
||||
persist: true,
|
||||
state: (): TaskRecordStoreState => ({
|
||||
records: {}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user