Browse Source

fix:使用__DEVICE_TYPE__

master
白凤吉 2 weeks ago
parent
commit
c602552f93
  1. 30
      src/components/home/PressureControl.vue
  2. 2
      src/views/seal/index.vue

30
src/components/home/PressureControl.vue

@ -14,20 +14,22 @@ const deviceStore = useDeviceStore()
// cascaderOptions
const getPressureConfig = async () => {
const res = await syncSendCmd({ className: 'PipelinePressureControl', fnName: 'getConfig' })
if (res.ackcode === 0) {
homeStore.updatePressureConfig(res.rely)
const { typeDisplayNames, types, intensitys } = res.rely
cascaderOptions.value = typeDisplayNames.map((name: string, idx: number) => {
const children = (intensitys[types[idx]] || []).map((val: string) => ({ label: `${val}%`, value: val }))
return { label: name, value: types[idx], children }
})
if (__DEVICE_TYPE__ !== useDeviceStore().deviceTypeMap.LargeSpaceDM_B) {
const res = await syncSendCmd({ className: 'PipelinePressureControl', fnName: 'getConfig' })
if (res.ackcode === 0) {
homeStore.updatePressureConfig(res.rely)
const { typeDisplayNames, types, intensitys } = res.rely
cascaderOptions.value = typeDisplayNames.map((name: string, idx: number) => {
const children = (intensitys[types[idx]] || []).map((val: string) => ({ label: `${val}%`, value: val }))
return { label: name, value: types[idx], children }
})
//
const stateRes = await syncSendCmd({ className: 'PipelinePressureControl', fnName: 'getState' })
if (stateRes.ackcode === 0) {
const { type, intensity } = stateRes.rely
selected.value = intensity ? [type, intensity] : [type]
//
const stateRes = await syncSendCmd({ className: 'PipelinePressureControl', fnName: 'getState' })
if (stateRes.ackcode === 0) {
const { type, intensity } = stateRes.rely
selected.value = intensity ? [type, intensity] : [type]
}
}
}
}
@ -51,7 +53,7 @@ const confirm = (val: string[]) => {
<el-cascader
v-model="selected"
:options="cascaderOptions"
placeholder="请选择压力类型和强度"
placeholder="请选择"
class="pressure-cascader"
input-props="{ style: 'text-align: center;' }"
popper-class="pressure-cascader-popper"

2
src/views/seal/index.vue

@ -46,7 +46,7 @@ watch(
)
onMounted(async () => {
const res = await sendCmd({ className: 'AirLeakDetectTest', fnName: 'getServiceConfig' })
const res = await sendCmd({ className: 'AirLeakDetectTest', fnName: 'getServiceConfig', params: { inflationTimeMs: 0.3 } })
inflationTime.value = res.inflationTimeMs
})

Loading…
Cancel
Save