|
@ -16,39 +16,6 @@ const PRESSURE_TYPES = [ |
|
|
{ name: '正压', value: 'positivePressure' }, |
|
|
{ name: '正压', value: 'positivePressure' }, |
|
|
{ name: '负压', value: 'negativePressure' }, |
|
|
{ name: '负压', value: 'negativePressure' }, |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 默认配方函数
|
|
|
|
|
|
// const createDefaultFormulaInfo = (): Formula.FormulaItem => ({
|
|
|
|
|
|
// continued_gs: 200,
|
|
|
|
|
|
// continued_humi: 60,
|
|
|
|
|
|
// continued_satur: 60,
|
|
|
|
|
|
// injection_pump_speed: 10,
|
|
|
|
|
|
// loglevel: 6,
|
|
|
|
|
|
// max_humidity: 90,
|
|
|
|
|
|
// pre_heat_time_s: 120,
|
|
|
|
|
|
// proportional_valve_default_value: 10,
|
|
|
|
|
|
// stoped_gs: 300,
|
|
|
|
|
|
// stoped_humi: 85,
|
|
|
|
|
|
// stoped_satur: 85,
|
|
|
|
|
|
// dvalue_correct_coefficient: 0
|
|
|
|
|
|
// name: '默认配方',
|
|
|
|
|
|
// })
|
|
|
|
|
|
// 清空配方函数
|
|
|
|
|
|
// const createResetFormulaInfo = (): Formula.FormulaItem => ({
|
|
|
|
|
|
// continued_gs: '',
|
|
|
|
|
|
// continued_humi: '',
|
|
|
|
|
|
// continued_satur: '',
|
|
|
|
|
|
// injection_pump_speed: '',
|
|
|
|
|
|
// loglevel: '',
|
|
|
|
|
|
// max_humidity: '',
|
|
|
|
|
|
// pre_heat_time_s: '',
|
|
|
|
|
|
// proportional_valve_default_value: '',
|
|
|
|
|
|
// stoped_gs: '',
|
|
|
|
|
|
// stoped_humi: '',
|
|
|
|
|
|
// stoped_satur: '',
|
|
|
|
|
|
// name: '',
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
export const useFormulaStore = defineStore('formula', () => { |
|
|
export const useFormulaStore = defineStore('formula', () => { |
|
|
// 状态定义
|
|
|
// 状态定义
|
|
|
const logEnums = LOG_ITEMS |
|
|
const logEnums = LOG_ITEMS |
|
@ -58,7 +25,7 @@ export const useFormulaStore = defineStore('formula', () => { |
|
|
// const resetFormulaInfo = ref<Formula.FormulaItem>(createResetFormulaInfo())
|
|
|
// const resetFormulaInfo = ref<Formula.FormulaItem>(createResetFormulaInfo())
|
|
|
const pressurOptionList = ref<string[]>(['10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%']) |
|
|
const pressurOptionList = ref<string[]>(['10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%']) |
|
|
const currentSelectedFormulaInfo = ref<Formula.FormulaItem>(cloneDeep(defaultFormulaInfo.value)) // 当前列表选中的配方信息
|
|
|
const currentSelectedFormulaInfo = ref<Formula.FormulaItem>(cloneDeep(defaultFormulaInfo.value)) // 当前列表选中的配方信息
|
|
|
const selectedFormulaInfo = ref<Formula.FormulaItem | null>(defaultFormulaInfo.value) // 选中执行的配方信息
|
|
|
|
|
|
|
|
|
const selectedFormulaInfo = ref<Formula.FormulaItem | null>() // 选中执行的配方信息
|
|
|
const formulaConfigList = ref<Formula.FormulaConfig[]>([]) |
|
|
const formulaConfigList = ref<Formula.FormulaConfig[]>([]) |
|
|
const formulaList = ref<Formula.FormulaItem[]>([]) |
|
|
const formulaList = ref<Formula.FormulaItem[]>([]) |
|
|
const loglevel = ref<string>('') |
|
|
const loglevel = ref<string>('') |
|
@ -113,7 +80,10 @@ export const useFormulaStore = defineStore('formula', () => { |
|
|
// const visibleConfig = data.filter(item => item.is_visible_in_formula_page)
|
|
|
// const visibleConfig = data.filter(item => item.is_visible_in_formula_page)
|
|
|
formulaConfigList.value = data |
|
|
formulaConfigList.value = data |
|
|
defaultFormulaInfo.value = mapConfigToFormula(data) |
|
|
defaultFormulaInfo.value = mapConfigToFormula(data) |
|
|
if (!selectedFormulaInfo.value?.name) { |
|
|
|
|
|
|
|
|
if (!selectedFormulaInfo.value) { |
|
|
|
|
|
selectedFormulaInfo.value = defaultFormulaInfo.value |
|
|
|
|
|
} |
|
|
|
|
|
else if (!selectedFormulaInfo.value?.name) { |
|
|
selectedFormulaInfo.value = defaultFormulaInfo.value |
|
|
selectedFormulaInfo.value = defaultFormulaInfo.value |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -378,4 +348,4 @@ export const useFormulaStore = defineStore('formula', () => { |
|
|
getRealtimeConfig, |
|
|
getRealtimeConfig, |
|
|
setRealtimeConfig, |
|
|
setRealtimeConfig, |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
|
|
|
}, { persist: true }) |