Browse Source

fix:根据需求去除.00展示

temp
zhaohy 3 months ago
parent
commit
6c3dd401ad
  1. 10
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue
  2. 1
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue
  3. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  4. 10
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  5. 1
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

10
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue

@ -11,6 +11,9 @@
}" }"
@click="clickSwitch({ enableRules: record.enableRules, record: record })" /> @click="clickSwitch({ enableRules: record.enableRules, record: record })" />
</template> </template>
<template v-if="column.dataIndex === 'conditionalJudgment'">
{{ getConditionalJudgment(record) }}
</template>
<template v-if="column.dataIndex === 'comparisonType'"> <template v-if="column.dataIndex === 'comparisonType'">
{{ getcomparisonType(record) }} {{ getcomparisonType(record) }}
</template> </template>
@ -69,6 +72,12 @@
} }
} }
}; };
const getConditionalJudgment = (data: any) => {
const formattedValue = data.conditionalJudgment.replace(/(\d+)\.00/g, '$1');
//
console.log(formattedValue, 'value');
return formattedValue;
};
const clickSwitch = (data: any) => { const clickSwitch = (data: any) => {
NsModal.confirm({ NsModal.confirm({
title: '启用状态', title: '启用状态',
@ -315,6 +324,7 @@
getcomparisonType, getcomparisonType,
orgId, orgId,
tableConfig, tableConfig,
getConditionalJudgment,
editConfigureEnergyAlarms, editConfigureEnergyAlarms,
setconfigureDeviceAlarmsData, setconfigureDeviceAlarmsData,
}; };

1
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue

@ -111,6 +111,7 @@
:min="-9999999999.99" :min="-9999999999.99"
:max="9999999999.99" :max="9999999999.99"
:precision="2" :precision="2"
:formatter="(value) => `${value}`.replace(/\.00$/, '')"
v-model:value="infoObject.alarmList[index - 1].num" /> v-model:value="infoObject.alarmList[index - 1].num" />
<div <div
v-if="index > 1 && index === infoObject.alarmList?.length" v-if="index > 1 && index === infoObject.alarmList?.length"

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue

@ -32,7 +32,7 @@
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数"> <a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
<ns-input-number <ns-input-number
v-model:value="infoObject.repetitions" v-model:value="infoObject.repetitions"
:min="0" :min="1"
:max="99" :max="99"
placeholder="请输入重复次数" /> placeholder="请输入重复次数" />
</a-form-item> </a-form-item>

10
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue

@ -14,6 +14,9 @@
<template v-if="column.dataIndex === 'valueType'"> <template v-if="column.dataIndex === 'valueType'">
{{ record.valueType.label }} {{ record.valueType.label }}
</template> </template>
<template v-if="column.dataIndex === 'conditionalJudgment'">
{{ getConditionalJudgment(record) }}
</template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<!-- 新增or编辑界面 --> <!-- 新增or编辑界面 -->
@ -296,6 +299,12 @@
rowKey: 'id', rowKey: 'id',
}; };
}; };
const getConditionalJudgment = (data: any) => {
const formattedValue = data.conditionalJudgment.replace(/(\d+)\.00/g, '$1');
//
console.log(formattedValue, 'value');
return formattedValue;
};
return { return {
configureDeviceAlarmsData, configureDeviceAlarmsData,
show, show,
@ -303,6 +312,7 @@
doWnload, doWnload,
tableConfig, tableConfig,
orgId, orgId,
getConditionalJudgment,
mainRef, mainRef,
editObject, editObject,
editConfigureDeviceAlarms, editConfigureDeviceAlarms,

1
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

@ -122,6 +122,7 @@
:min="-9999999999.99" :min="-9999999999.99"
:max="9999999999.99" :max="9999999999.99"
:precision="2" :precision="2"
:formatter="(value) => `${value}`.replace(/\.00$/, '')"
v-model:value="infoObject.alarmList[index - 1].num" /> v-model:value="infoObject.alarmList[index - 1].num" />
<div <div
v-if="index > 1 && index === infoObject.alarmList?.length" v-if="index > 1 && index === infoObject.alarmList?.length"

Loading…
Cancel
Save