fix:根据需求去除.00展示
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
}"
|
||||
@click="clickSwitch({ enableRules: record.enableRules, record: record })" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'conditionalJudgment'">
|
||||
{{ getConditionalJudgment(record) }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'comparisonType'">
|
||||
{{ getcomparisonType(record) }}
|
||||
</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) => {
|
||||
NsModal.confirm({
|
||||
title: '启用状态',
|
||||
@@ -315,6 +324,7 @@
|
||||
getcomparisonType,
|
||||
orgId,
|
||||
tableConfig,
|
||||
getConditionalJudgment,
|
||||
editConfigureEnergyAlarms,
|
||||
setconfigureDeviceAlarmsData,
|
||||
};
|
||||
|
@@ -111,6 +111,7 @@
|
||||
:min="-9999999999.99"
|
||||
:max="9999999999.99"
|
||||
:precision="2"
|
||||
:formatter="(value) => `${value}`.replace(/\.00$/, '')"
|
||||
v-model:value="infoObject.alarmList[index - 1].num" />
|
||||
<div
|
||||
v-if="index > 1 && index === infoObject.alarmList?.length"
|
||||
|
@@ -32,7 +32,7 @@
|
||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
||||
<ns-input-number
|
||||
v-model:value="infoObject.repetitions"
|
||||
:min="0"
|
||||
:min="1"
|
||||
:max="99"
|
||||
placeholder="请输入重复次数" />
|
||||
</a-form-item>
|
||||
|
@@ -14,6 +14,9 @@
|
||||
<template v-if="column.dataIndex === 'valueType'">
|
||||
{{ record.valueType.label }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'conditionalJudgment'">
|
||||
{{ getConditionalJudgment(record) }}
|
||||
</template>
|
||||
</template>
|
||||
</ns-view-list-table>
|
||||
<!-- 新增or编辑界面 -->
|
||||
@@ -296,6 +299,12 @@
|
||||
rowKey: 'id',
|
||||
};
|
||||
};
|
||||
const getConditionalJudgment = (data: any) => {
|
||||
const formattedValue = data.conditionalJudgment.replace(/(\d+)\.00/g, '$1');
|
||||
// 返回处理后的值
|
||||
console.log(formattedValue, 'value');
|
||||
return formattedValue;
|
||||
};
|
||||
return {
|
||||
configureDeviceAlarmsData,
|
||||
show,
|
||||
@@ -303,6 +312,7 @@
|
||||
doWnload,
|
||||
tableConfig,
|
||||
orgId,
|
||||
getConditionalJudgment,
|
||||
mainRef,
|
||||
editObject,
|
||||
editConfigureDeviceAlarms,
|
||||
|
@@ -122,6 +122,7 @@
|
||||
:min="-9999999999.99"
|
||||
:max="9999999999.99"
|
||||
:precision="2"
|
||||
:formatter="(value) => `${value}`.replace(/\.00$/, '')"
|
||||
v-model:value="infoObject.alarmList[index - 1].num" />
|
||||
<div
|
||||
v-if="index > 1 && index === infoObject.alarmList?.length"
|
||||
|
Reference in New Issue
Block a user