123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import type { ProjectType } from '@/types/global'
- import { defineStore } from 'pinia'
- export const useGlobalStore = defineStore(
- 'global',
- () => {
- const projectList = ref<ProjectType[]>([
- {
- name: '工程1',
- id: Date.now() + '',
- time: new Date().toLocaleString(),
- commandList: [
- {
- name: '任务1',
- id: '11',
- time: new Date().toLocaleString(),
- parentId: '1',
- stepList: [
- {
- type: 'condition',
- list: [
- {
- id: '111',
- type: 'input',
- label: 'DI1',
- value: '闭合'
- },
- {
- id: '112',
- type: 'input',
- label: 'AI1',
- operation: '=',
- value: '0'
- },
- {
- id: '113',
- type: 'time',
- label: '每天',
- value: '08:00',
- operation: '等于'
- }
- ]
- },
- {
- id: '12',
- type: 'delay',
- value: '5',
- unit: 's'
- },
- {
- type: 'exec',
- list: [
- {
- id: '131',
- type: 'output',
- label: 'DO1',
- value: '断开'
- },
- {
- id: '132',
- type: 'output',
- label: 'AO1',
- value: '0'
- }
- ]
- }
- ]
- }
- ],
- isCompiled: false,
- CompileTime: '',
- msgList: []
- }
- ])
- return { projectList }
- },
- {
- persist: true
- }
- )
|