|
@@ -240,12 +240,16 @@
|
|
|
</span>
|
|
|
<span>{{ $t("device.alarmContent") }} : {{ itemAlarm.alarmContent }}</span>
|
|
|
</div>
|
|
|
- <div class="lineCon"></div>
|
|
|
+ <!-- <div class="lineCon"></div>
|
|
|
<div class="alert-actions">
|
|
|
<van-button type="primary" color="#07c160" style="margin: 0 10px;"
|
|
|
:text="$t('device.eliminateAlarm')"
|
|
|
@click="clearAlarm(itemAlarm, item, item.alarmList)"></van-button>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ <div class="contentWord kBordBott l-flex-center" v-if="item.alarmList">
|
|
|
+ <van-button type="primary" color="#07c160" style="margin: 0 10px;" :text="$t('device.oneClickClear')"
|
|
|
+ @click="clearAllAlarm(item.alarmList, item)"></van-button>
|
|
|
</div>
|
|
|
<div class="editDeviceBtnCon l-flex-center o-mt-10">
|
|
|
<!-- 详细信息 -->
|
|
@@ -510,6 +514,31 @@ export default {
|
|
|
showFailToast(data.message);
|
|
|
}
|
|
|
};
|
|
|
+ // 一键消除报警
|
|
|
+ const clearAllAlarm = (e, e1) => {
|
|
|
+ showConfirmDialog({
|
|
|
+ title: t('device.openRemind'),
|
|
|
+ message: t('device.isClear'),
|
|
|
+ }).then(async () => {
|
|
|
+ const { data } = await eliminate(Object.assign({}, {id: e[0].id}));
|
|
|
+ if (data.code) {
|
|
|
+ showSuccessToast(t("device.successfullyEliminatedTheAlarm"));
|
|
|
+ setTimeout(() => {
|
|
|
+ list.value[list.value.findIndex((item) => item.id === e1.id)].alarmList = null;
|
|
|
+ e1.hasTodayAlarm = false;
|
|
|
+ if (e1.machineType == "0" || e1.machineType == null) {
|
|
|
+ restartHead(e1.id, t("device.clearAfter"));
|
|
|
+ }
|
|
|
+ }, 800);
|
|
|
+ } else {
|
|
|
+ showFailToast(data.message);
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
const showDateTime = (date) => {
|
|
|
if (!date) {
|
|
|
return "";
|
|
@@ -557,19 +586,6 @@ export default {
|
|
|
}).catch(() => {
|
|
|
return;
|
|
|
})
|
|
|
- // Api_getReplenishment({ equipmentId: row.id }).then((res) => {
|
|
|
- // console.log("res >>>", res);
|
|
|
- // // Toast(res.data.message);
|
|
|
- // showDialog({
|
|
|
- // message: t('device.sentSuccessfully'),
|
|
|
- // }).then(() => {
|
|
|
- // //返回上一页
|
|
|
- // router.go(0);
|
|
|
- // });
|
|
|
- // setTimeout(() => {
|
|
|
- // getList();
|
|
|
- // }, 500);
|
|
|
- // });
|
|
|
};
|
|
|
// 操作弹窗完成的回调
|
|
|
const operFinish = () => {
|
|
@@ -671,10 +687,10 @@ export default {
|
|
|
};
|
|
|
|
|
|
// 重启炉头
|
|
|
- const restartHead = (id) => {
|
|
|
+ const restartHead = (id, msg) => {
|
|
|
showConfirmDialog({
|
|
|
title: t('user.tips'),
|
|
|
- message: t('device.restartFurnaceHeadTips'),
|
|
|
+ message: msg ? msg: t('device.restartFurnaceHeadTips'),
|
|
|
}).then(async () => {
|
|
|
const { data } = await setFurnace({
|
|
|
equipmentId: id,
|
|
@@ -731,6 +747,7 @@ export default {
|
|
|
search,
|
|
|
deviceSet,
|
|
|
clearAlarm,
|
|
|
+ clearAllAlarm,
|
|
|
oprRef,
|
|
|
deviceOprShow,
|
|
|
showDateTime,
|