fix:根据需求去除.00展示
This commit is contained in:
@@ -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,
|
||||||
};
|
};
|
||||||
|
@@ -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"
|
||||||
|
@@ -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>
|
||||||
|
@@ -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,
|
||||||
|
@@ -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"
|
||||||
|
Reference in New Issue
Block a user