Browse Source

fix:低成本input特殊处理

master
guoapeng 4 days ago
parent
commit
dee2e06712
  1. 21
      src/components/formula/FormulaConfig.vue
  2. 18
      src/components/formula/HomeFormulaConfig.vue
  3. 11
      src/components/formula/SettingFormulaConfig.vue

21
src/components/formula/FormulaConfig.vue

@ -1,6 +1,7 @@
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { cloneDeep } from 'lodash'
import { useDeviceStore } from 'stores/deviceStore'
import { useHomeStore } from 'stores/homeStore'
import { computed, inject, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
@ -197,6 +198,12 @@ const validateName = (rule: any, value: any, callback: any) => {
}
callback()
}
const deviceType = computed(() => {
return __DEVICE_TYPE__
})
const deviceStore = useDeviceStore()
</script>
<template>
@ -247,14 +254,24 @@ const validateName = (rule: any, value: any, callback: any) => {
]"
>
<template v-if="item.val_type === 'int'">
<ft-input v-model="formData[item.setting_id]" style="width: 100%" layout-name="number">
<ft-input
v-model="formData[item.setting_id]"
:type="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B ? 'number' : 'default'"
style="width: 100%"
layout-name="number"
>
<template v-if="labelUnitMap[item.setting_id]" #append>
{{ labelUnitMap[item.setting_id] }}
</template>
</ft-input>
</template>
<template v-if="item.val_type === 'float'">
<ft-input v-model="formData[item.setting_id]" layout-name="number" style="width: 100%">
<ft-input
v-model="formData[item.setting_id]"
layout-name="number"
style="width: 100%"
:type="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B ? 'number' : 'default'"
>
<template v-if="labelUnitMap[item.setting_id]" #append>
{{ labelUnitMap[item.setting_id] }}
</template>

18
src/components/formula/HomeFormulaConfig.vue

@ -1,6 +1,7 @@
<script lang="ts" setup>
import { cloneDeep } from 'lodash'
import { inject, onMounted, ref, watchEffect } from 'vue'
import { useDeviceStore } from 'stores/deviceStore'
import { computed, inject, onMounted, ref, watchEffect } from 'vue'
import { convertValuesToString } from '@/libs/utils'
import { useFormulaStore } from '@/stores/formulaStore'
@ -40,6 +41,12 @@ watchEffect(() => {
*/
const formulaConfigList = formulaStore.formulaConfigList
const size = 'default'
const deviceType = computed(() => {
return __DEVICE_TYPE__
})
const deviceStore = useDeviceStore()
</script>
<template>
@ -59,7 +66,8 @@ const size = 'default'
<el-form-item :label="item.name_ch" :prop="item.setting_id">
<template v-if="item.val_type === 'int'">
<ft-input
v-model.number="formData[item.setting_id]"
v-model="formData[item.setting_id]"
:type="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B ? 'number' : 'default'"
style="width: 100%"
:name="item.setting_id"
:controls="false"
@ -71,7 +79,8 @@ const size = 'default'
</template>
<template v-if="item.val_type === 'float'">
<ft-input
v-model.number="formData[item.setting_id]"
v-model="formData[item.setting_id]"
:type="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B ? 'number' : 'default'"
style="width: 100%"
:name="item.setting_id"
:controls="false"
@ -83,7 +92,8 @@ const size = 'default'
</template>
<template v-else-if="item.val_type === 'enum'">
<ft-input
v-model.number="formData[item.setting_id]"
v-model="formData[item.setting_id]"
:type="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B ? 'number' : 'default'"
style="width: 100%"
:name="item.setting_id"
:controls="false"

11
src/components/formula/SettingFormulaConfig.vue

@ -1,6 +1,7 @@
<script lang="ts" setup>
import { cloneDeep } from 'lodash'
import { ref, watchEffect } from 'vue'
import { useDeviceStore } from 'stores/deviceStore'
import { computed, ref, watchEffect } from 'vue'
import { FtMessage } from '@/libs/message'
import { compareJSON, convertValuesToString } from '@/libs/utils'
@ -77,6 +78,12 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form
}
callback()
}
const deviceType = computed(() => {
return __DEVICE_TYPE__
})
const deviceStore = useDeviceStore()
</script>
<template>
@ -113,6 +120,7 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form
<template v-if="item.val_type === 'int'">
<ft-input
v-model="formData[item.setting_id]"
:type="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B ? 'number' : 'default'"
layout-name="number"
style="width: 100%"
:name="item.setting_id"
@ -127,6 +135,7 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form
<template v-if="item.val_type === 'float'">
<ft-input
v-model="formData[item.setting_id]"
:type="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B ? 'number' : 'default'"
layout-name="number"
style="width: 100%"
:name="item.setting_id"

Loading…
Cancel
Save