UPDATE: 1、优化动态加载路由;2、修改模式切换,菜单没刷新等问题
This commit is contained in:
@@ -1,32 +1,37 @@
|
||||
import {defineStore} from "pinia";
|
||||
import {CHECK_STORE_KEY} from "@/stores/constant";
|
||||
import type {CheckData} from "@/api/check/interface";
|
||||
import type {Plan} from '@/api/plan/interface'
|
||||
import {useAppSceneStore} from "@/stores/modules/mode";
|
||||
import { defineStore } from 'pinia'
|
||||
import { CHECK_STORE_KEY } from '@/stores/constant'
|
||||
import type { CheckData } from '@/api/check/interface'
|
||||
import type { Plan } from '@/api/plan/interface'
|
||||
import { useAppSceneStore } from '@/stores/modules/mode'
|
||||
|
||||
export const useCheckStore = defineStore(CHECK_STORE_KEY, {
|
||||
state: () => ({
|
||||
devices: [] as CheckData.Device[],
|
||||
plan: {} as Plan.ResPlan,
|
||||
selectTestItems: {preTest: true, timeTest: false, channelsTest: false, test: true} as CheckData.SelectTestItem,
|
||||
selectTestItems: {
|
||||
preTest: true,
|
||||
timeTest: false,
|
||||
channelsTest: false,
|
||||
test: true
|
||||
} as CheckData.SelectTestItem,
|
||||
checkType: 1, // 0:手动检测 1:自动检测
|
||||
reCheckType: 1, // 0:不合格项复检 1:全部复检
|
||||
showDetailType: 0, // 0:数据查询 1:误差体系跟换 2:正式检测
|
||||
temperature: 0,
|
||||
humidity: 0,
|
||||
chnNumList: [],//连线数据
|
||||
nodesConnectable: true,//设置是能可以连线
|
||||
chnNumList: [] as string[], //连线数据
|
||||
nodesConnectable: true //设置是能可以连线
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
addDevices(device: CheckData.Device[]) {
|
||||
this.devices.push(...device);
|
||||
this.devices.push(...device)
|
||||
},
|
||||
setPlan(plan: Plan.ResPlan) {
|
||||
this.plan = plan
|
||||
},
|
||||
clearDevices() {
|
||||
this.devices = [];
|
||||
this.devices = []
|
||||
},
|
||||
initSelectTestItems() {
|
||||
const appSceneStore = useAppSceneStore()
|
||||
@@ -56,12 +61,11 @@ export const useCheckStore = defineStore(CHECK_STORE_KEY, {
|
||||
setHumidity(humidity: number) {
|
||||
this.humidity = humidity
|
||||
},
|
||||
setChnNum(chnNumList: string[]) {
|
||||
setChnNum(chnNumList: string[]) {
|
||||
this.chnNumList = chnNumList
|
||||
},
|
||||
setNodesConnectable(nodesConnectable: boolean) {
|
||||
setNodesConnectable(nodesConnectable: boolean) {
|
||||
this.nodesConnectable = nodesConnectable
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
Reference in New Issue
Block a user