|
@@ -109,7 +109,8 @@
|
|
|
<div class="contentWord kBordBott">
|
|
|
<span class="word o-mr-10">{{ $t("device.sleepState") }}:{{ item.isSleep ? $t("device.sleeping") :
|
|
|
$t("device.notSleeping") }}</span>
|
|
|
- <van-switch active-color="#2d87c8" :model-value="item.isSleep" size="18px" @click="changeSleep(item)" />
|
|
|
+ <van-switch active-color="#2d87c8" :model-value="item.isSleep" size="18px"
|
|
|
+ @click="changeSleep(item)" />
|
|
|
</div>
|
|
|
<!-- 睡眠描述 -->
|
|
|
<div v-if="item.isSleep" class="contentWord kBordBott">
|
|
@@ -124,7 +125,8 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<div class="l-flex-RC" v-else>
|
|
|
- <span class="word o-mr-10">{{ item.sleepDesc == null ? $t("device.SuspendBusiness") : item.sleepDesc
|
|
|
+ <span class="word o-mr-10">{{ item.sleepDesc == null ? $t("device.SuspendBusiness") :
|
|
|
+ item.sleepDesc
|
|
|
}}</span>
|
|
|
<van-button type="primary" @click="editSleepDesc()">{{ $t("device.modify") }}</van-button>
|
|
|
</div>
|
|
@@ -207,12 +209,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">
|
|
|
<div class="l-flex-RC" @click="deviceSet(item)">
|
|
@@ -223,7 +229,7 @@
|
|
|
</div>
|
|
|
<div class="l-flex-RC o-ml-30" @click="deviceOprShow(item)">
|
|
|
<span class="c-text-14">{{
|
|
|
- $t("device.commonOperations")
|
|
|
+ $t("device.commonOperations")
|
|
|
}}</span>
|
|
|
<div class="box2 flex-col"></div>
|
|
|
</div>
|
|
@@ -468,6 +474,29 @@ 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 "";
|
|
@@ -612,10 +641,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,
|
|
@@ -669,6 +698,7 @@ export default {
|
|
|
search,
|
|
|
deviceSet,
|
|
|
clearAlarm,
|
|
|
+ clearAllAlarm,
|
|
|
oprRef,
|
|
|
deviceOprShow,
|
|
|
showDateTime,
|