|
@@ -40,6 +40,16 @@
|
|
|
><i-ep-edit />模型
|
|
|
</el-button>
|
|
|
</template>-->
|
|
|
+ <template #menu="{ size, row, index }">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ size="small"
|
|
|
+ v-if="row.deviceName == '电烙铁' || row.deviceType == 'HJ'"
|
|
|
+ @click="showWarning(row)"
|
|
|
+ ><i-ep-warning />报警设置
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
<template #menu-left="{ size }">
|
|
|
<el-button
|
|
|
:disabled="toDeleteIds.length < 1"
|
|
@@ -127,6 +137,26 @@
|
|
|
<el-button @click="dialog.visible = false">取消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog2.visible"
|
|
|
+ :title="dialog2.title"
|
|
|
+ width="30%"
|
|
|
+ @close="dialog2.visible = false"
|
|
|
+ >
|
|
|
+ <el-timeline style="max-width: 500px; margin-left: 100px">
|
|
|
+ <el-form-item label="温度下限(℃)">
|
|
|
+ <el-input v-model="electric.lowerLimit" style="width: 200px" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="温度上限(℃)">
|
|
|
+ <el-input v-model="electric.upperLimit" style="width: 200px" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-timeline>
|
|
|
+ <div class="dialog-footer" style="margin-top: 20px" align="center">
|
|
|
+ <el-button type="primary" @click="ironAdd">保 存</el-button>
|
|
|
+ <el-button @click="dialog2.visible = false">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<ExcelUpload ref="uploadRef" @finished="uploadFinished" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -134,7 +164,13 @@
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import { checkPerm } from "@/directive/permission";
|
|
|
-import { configSave, configList, deviceUpdateCollect } from "@/api/device";
|
|
|
+import {
|
|
|
+ configSave,
|
|
|
+ configList,
|
|
|
+ deviceUpdateCollect,
|
|
|
+ electricIronConfigEList,
|
|
|
+ ironConfigAdd,
|
|
|
+} from "@/api/device";
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
@@ -182,10 +218,48 @@ const showParamsPage = (row) => {
|
|
|
dialog.visible = true;
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const electric = ref(null);
|
|
|
+const showWarning = (row) => {
|
|
|
+ electricIronConfigEList({ deviceNo: row.deviceNo }).then((data) => {
|
|
|
+ electric.value = data.data;
|
|
|
+ dialog2.visible = true;
|
|
|
+ });
|
|
|
+};
|
|
|
const dialog = reactive({
|
|
|
title: "模型设置",
|
|
|
visible: false,
|
|
|
});
|
|
|
+
|
|
|
+const dialog2 = reactive({
|
|
|
+ title: "报警设置",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+
|
|
|
+const ironAdd = () => {
|
|
|
+ console.log(electric);
|
|
|
+ let express = /^[+]?\d*(\.\d*)?(e[+-]?\d+)?$/;
|
|
|
+ if (!express.test(electric.value.lowerLimit)) {
|
|
|
+ ElMessage.error("下限值不合法!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!express.test(electric.value.upperLimit)) {
|
|
|
+ ElMessage.error("上限值不合法!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (electric.value.upperLimit <= electric.value.lowerLimit) {
|
|
|
+ ElMessage.error("下限值不能大于等于上限值!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ironConfigAdd(electric.value).then((data) => {
|
|
|
+ if (data.code == "200") {
|
|
|
+ ElMessage.success("保存成功!");
|
|
|
+ dialog2.visible = false;
|
|
|
+ } else {
|
|
|
+ ElMessage.error(data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
const handleSubmit = () => {
|
|
|
//判断参数
|
|
|
let errorData = pageData.value.filter((item) => !item.fieldCode);
|