|
@ -1,5 +1,4 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import SoftKeyboard from 'components/common/SoftKeyboard/index.vue' |
|
|
|
|
|
import { ElMessage } from 'element-plus' |
|
|
import { ElMessage } from 'element-plus' |
|
|
import { formulaNameMap } from 'libs/constant' |
|
|
import { formulaNameMap } from 'libs/constant' |
|
|
import { cloneDeep } from 'lodash' |
|
|
import { cloneDeep } from 'lodash' |
|
@ -14,8 +13,6 @@ const homeStore = useHomeStore() |
|
|
|
|
|
|
|
|
const formulaStore = useFormulaStore() |
|
|
const formulaStore = useFormulaStore() |
|
|
|
|
|
|
|
|
const targetInputRef = ref<HTMLInputElement | null>(null) |
|
|
|
|
|
|
|
|
|
|
|
const isFlip = ref(true) |
|
|
const isFlip = ref(true) |
|
|
/** |
|
|
/** |
|
|
* 当前表单数据 |
|
|
* 当前表单数据 |
|
@ -28,21 +25,6 @@ const formData = ref<Record<string, any>>({}) |
|
|
const inputValue = ref<string>('') |
|
|
const inputValue = ref<string>('') |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 软键盘是否可见 |
|
|
|
|
|
*/ |
|
|
|
|
|
const keyboardVisible = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 软键盘类型:'text' 或 'number' |
|
|
|
|
|
*/ |
|
|
|
|
|
const keyboardType = ref<'text' | 'number'>('number') |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 软键盘组件引用 |
|
|
|
|
|
*/ |
|
|
|
|
|
const softKeyboardRef = ref() |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 当前聚焦的输入字段名称 |
|
|
* 当前聚焦的输入字段名称 |
|
|
*/ |
|
|
*/ |
|
|
const focusedInput = ref<string | null>(null) |
|
|
const focusedInput = ref<string | null>(null) |
|
@ -178,14 +160,6 @@ const deviceState = computed(() => { |
|
|
return disinfectionState.value.state === 'idle' || disinfectionState.value.state === 'finished' |
|
|
return disinfectionState.value.state === 'idle' || disinfectionState.value.state === 'finished' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 确认输入值 |
|
|
|
|
|
* @param {string} value - 输入值 |
|
|
|
|
|
*/ |
|
|
|
|
|
const handleConfirm = (value: string) => { |
|
|
|
|
|
console.log('确认输入:', value) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const size = 'default' |
|
|
const size = 'default' |
|
|
// 新增配方方法 |
|
|
// 新增配方方法 |
|
|
const addFormula = async () => { |
|
|
const addFormula = async () => { |
|
@ -229,7 +203,15 @@ const validateName = (rule: any, value: any, callback: any) => { |
|
|
<template> |
|
|
<template> |
|
|
<transition name="slide-right"> |
|
|
<transition name="slide-right"> |
|
|
<div v-if="isFlip" class="formula-form"> |
|
|
<div v-if="isFlip" class="formula-form"> |
|
|
<el-form ref="formRef" :model="formData" label-width="auto" label-position="right" :size="size" inline> |
|
|
|
|
|
|
|
|
<el-form |
|
|
|
|
|
ref="formRef" |
|
|
|
|
|
:model="formData" |
|
|
|
|
|
class="form-box" |
|
|
|
|
|
label-width="auto" |
|
|
|
|
|
label-position="right" |
|
|
|
|
|
:size="size" |
|
|
|
|
|
inline |
|
|
|
|
|
> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="配方名称" |
|
|
label="配方名称" |
|
|
style="width: 93%" |
|
|
style="width: 93%" |
|
@ -289,27 +271,11 @@ const validateName = (rule: any, value: any, callback: any) => { |
|
|
</template> |
|
|
</template> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div> |
|
|
|
|
|
<slot name="formulaBtn"> |
|
|
|
|
|
<div class="default-btn"> |
|
|
<div class="default-btn"> |
|
|
<el-button type="primary" class="config-btn" @click="handleSubmit"> |
|
|
<el-button type="primary" class="config-btn" @click="handleSubmit"> |
|
|
确定 |
|
|
确定 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</slot> |
|
|
|
|
|
</div> |
|
|
|
|
|
<Teleport to="body"> |
|
|
|
|
|
<SoftKeyboard |
|
|
|
|
|
ref="softKeyboardRef" |
|
|
|
|
|
v-model="inputValue" |
|
|
|
|
|
:is-visible="keyboardVisible" |
|
|
|
|
|
:keyboard-type="keyboardType" |
|
|
|
|
|
:target-input="targetInputRef" |
|
|
|
|
|
@confirm="handleConfirm" |
|
|
|
|
|
@update-keyboard-visible="visible => (keyboardVisible = visible)" |
|
|
|
|
|
@close="keyboardVisible = false" |
|
|
|
|
|
/> |
|
|
|
|
|
</Teleport> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</transition> |
|
|
</transition> |
|
|
</template> |
|
|
</template> |
|
@ -317,16 +283,20 @@ const validateName = (rule: any, value: any, callback: any) => { |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.formula-form { |
|
|
.formula-form { |
|
|
font-size: 20px !important; |
|
|
font-size: 20px !important; |
|
|
padding: 5px 5px 5px 15px; |
|
|
|
|
|
align-items: center; |
|
|
align-items: center; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
.form-box { |
|
|
|
|
|
height: calc(100% - 50px); |
|
|
|
|
|
overflow: auto; |
|
|
|
|
|
} |
|
|
.default-btn { |
|
|
.default-btn { |
|
|
margin-top: 1rem; |
|
|
|
|
|
|
|
|
height: 50px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
.el-button { |
|
|
|
|
|
width: 100px; |
|
|
} |
|
|
} |
|
|
.config-btn { |
|
|
|
|
|
//height: 3rem; |
|
|
|
|
|
//width: 8rem; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|