From 783a8b2425ee8b3838dcb25ca30855a322e0f858 Mon Sep 17 00:00:00 2001
From: songwenxuan <1924103812@qq.com>
Date: Sun, 21 Sep 2025 10:04:55 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=93=E4=B8=8D=E4=BA=86?=
=?UTF-8?q?=E5=8C=85=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 6 +--
.env.production | 2 +-
.eslintrc.cjs | 2 +-
package.json | 3 +-
src/components/monitoring_data/index.vue | 18 +++++----
src/request/tb_iron.js | 2 +
.../blind_plate_plugging/invalid/index.vue | 2 +-
.../blind_plate_plugging/job_data/index.vue | 2 +-
src/views/confined_space/invalid/index.vue | 2 +-
src/views/confined_space/job_data/index.vue | 2 +-
src/views/groundbreaking/invalid/index.vue | 2 +-
src/views/groundbreaking/job_data/index.vue | 2 +-
src/views/high/invalid/index.vue | 2 +-
src/views/high/job_data/index.vue | 2 +-
src/views/hoisting/invalid/index.vue | 2 +-
src/views/hoisting/job_data/index.vue | 2 +-
src/views/hot_work/invalid/index.vue | 2 +-
src/views/hot_work/job_data/index.vue | 2 +-
src/views/open_circuit/invalid/index.vue | 2 +-
src/views/open_circuit/job_data/index.vue | 2 +-
.../components/edit_sensor.vue | 38 +++++++++++--------
.../components/plc_sensor_dia.vue | 25 +++++++++---
.../blastfurnace/components/edit_sensor.vue | 38 +++++++++++--------
.../components/plc_sensor_dia.vue | 25 +++++++++---
.../components/edit_sensor.vue | 22 +++++++----
.../components/plc_sensor_dia.vue | 19 ++++++++--
.../invalid/index.vue | 2 +-
.../job_data/index.vue | 2 +-
28 files changed, 150 insertions(+), 82 deletions(-)
diff --git a/.env.development b/.env.development
index a63bf94..b677c6e 100644
--- a/.env.development
+++ b/.env.development
@@ -1,9 +1,9 @@
VITE_BASE=/
# VITE_BASE_URL=http://192.168.0.25:8095/
-VITE_BASE_URL=http://192.168.0.37:8095/
+VITE_BASE_URL=http://192.168.4.226:8095/
#websocket t掉线
-VITE_ON_LINE_WEB_SOCKET_URL=ws://192.168.0.37:8869
+VITE_ON_LINE_WEB_SOCKET_URL=ws://192.168.4.226:8869
#websocket 在线学习
-VITE_LEARNING_WEB_SOCKET_URL=ws://192.168.0.37:8899
+VITE_LEARNING_WEB_SOCKET_URL=ws://192.168.4.226:8899
diff --git a/.env.production b/.env.production
index 073ffb7..87264d1 100644
--- a/.env.production
+++ b/.env.production
@@ -1,6 +1,6 @@
VITE_BASE=/dist
#VITE_BASE_URL=http://10.199.64.27:8520/integrated_yjb/
-VITE_BASE_URL=http://192.168.20.240:8542/integrated_yjb/
+VITE_BASE_URL=http://172.16.112.251:80/api/
#VITE_BASE_URL=https://qaaqwh.qhdsafety.com/integrated_whb/
#websocket t掉线
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 80f4b0a..05ad77a 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -23,7 +23,7 @@ module.exports = {
"camelcase": "off",
"eqeqeq": "error",
"vue/no-template-shadow": "error",
- "vue/attribute-hyphenation": "error",
+ "vue/attribute-hyphenation": "off",
"vue/html-end-tags": "error",
"vue/eqeqeq": "error",
"vue/component-name-in-template-casing": ["error", "kebab-case"],
diff --git a/package.json b/package.json
index 333645f..dc0ab70 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"@icon-park/vue-next": "^1.4.2",
"@vueuse/core": "^9.13.0",
"@vueuse/integrations": "^10.7.1",
+ "@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"animate.css": "^4.1.1",
"autofit.js": "^3.0.7",
@@ -21,11 +22,11 @@
"dayjs": "^1.11.10",
"echarts": "^5.4.3",
"element-plus": "^2.6.1",
- "mp4box": "^0.5.2",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"lodash-es": "^4.17.21",
"mitt": "^3.0.1",
+ "mp4box": "^0.5.2",
"nanoid": "^5.0.4",
"normalize.css": "^8.0.1",
"pako": "^2.1.0",
diff --git a/src/components/monitoring_data/index.vue b/src/components/monitoring_data/index.vue
index 792ccdf..e49504e 100644
--- a/src/components/monitoring_data/index.vue
+++ b/src/components/monitoring_data/index.vue
@@ -12,10 +12,12 @@
:show-pagination="false"
:data="data.realTimeMonitoringDataList"
>
-
+
+
- {{ formatValue(row.SIGNAL_TYPE, row.CURRENT_VALUE) }}
+
+ {{ row.CURRENT_VALUE }}
@@ -75,12 +77,12 @@ const { pause } = useIntervalFn(
{ immediate: true, immediateCallback: true }
);
/* ----------------- 工具:把原始值转换成最终显示文本 ----------------- */
-function formatValue(type, val) {
- // 需要原样返回的 ID
- if (type==='1') return val
- // 其余设备:0.0 -> 关,其余 -> 开
- return val === '0.0' ? '关' : '开'
-}
+// function formatValue(type, val) {
+// // 需要原样返回的 ID
+// if (type==='1') return val
+// // 其余设备:0.0 -> 关,其余 -> 开
+// return val === '0.0' ? '关' : '开'
+// }
diff --git a/src/request/tb_iron.js b/src/request/tb_iron.js
index f664f83..208c5b3 100644
--- a/src/request/tb_iron.js
+++ b/src/request/tb_iron.js
@@ -50,6 +50,8 @@ export const setIronIronPlcSensorRemove = (params) =>
post("/tbIronIronPlc/removeSensor", params);
export const setIronIronPlcSensorEdit = (params) =>
post("/tbIronIronPlc/editSensor", params);
+export const setIronIronPlcSensorAdd = (params) =>
+ post("/tbIronIronPlc/addSensor", params);
export const setIronPlcImport = (params) =>
upload("/tbIronIronPlc/readExcel", params);
diff --git a/src/views/blind_plate_plugging/invalid/index.vue b/src/views/blind_plate_plugging/invalid/index.vue
index d37f8bd..3a3929d 100644
--- a/src/views/blind_plate_plugging/invalid/index.vue
+++ b/src/views/blind_plate_plugging/invalid/index.vue
@@ -133,7 +133,7 @@
diff --git a/src/views/blind_plate_plugging/job_data/index.vue b/src/views/blind_plate_plugging/job_data/index.vue
index a048b4b..7949a8a 100644
--- a/src/views/blind_plate_plugging/job_data/index.vue
+++ b/src/views/blind_plate_plugging/job_data/index.vue
@@ -240,7 +240,7 @@
diff --git a/src/views/confined_space/job_data/index.vue b/src/views/confined_space/job_data/index.vue
index ada63fc..24988d7 100644
--- a/src/views/confined_space/job_data/index.vue
+++ b/src/views/confined_space/job_data/index.vue
@@ -246,7 +246,7 @@
diff --git a/src/views/groundbreaking/job_data/index.vue b/src/views/groundbreaking/job_data/index.vue
index 3ea334e..cf12309 100644
--- a/src/views/groundbreaking/job_data/index.vue
+++ b/src/views/groundbreaking/job_data/index.vue
@@ -223,7 +223,7 @@
diff --git a/src/views/high/job_data/index.vue b/src/views/high/job_data/index.vue
index 642d6fa..9107aa9 100644
--- a/src/views/high/job_data/index.vue
+++ b/src/views/high/job_data/index.vue
@@ -230,7 +230,7 @@
diff --git a/src/views/hoisting/job_data/index.vue b/src/views/hoisting/job_data/index.vue
index fbd2ddd..784f12e 100644
--- a/src/views/hoisting/job_data/index.vue
+++ b/src/views/hoisting/job_data/index.vue
@@ -229,7 +229,7 @@
diff --git a/src/views/hot_work/job_data/index.vue b/src/views/hot_work/job_data/index.vue
index b5ed772..25effeb 100644
--- a/src/views/hot_work/job_data/index.vue
+++ b/src/views/hot_work/job_data/index.vue
@@ -244,7 +244,7 @@
diff --git a/src/views/open_circuit/job_data/index.vue b/src/views/open_circuit/job_data/index.vue
index d568dbc..02c2828 100644
--- a/src/views/open_circuit/job_data/index.vue
+++ b/src/views/open_circuit/job_data/index.vue
@@ -231,7 +231,7 @@
-
+
-
+
-
+
@@ -188,7 +188,7 @@ import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
-import { setIronIronPlcSensorEdit } from "@/request/tb_iron.js";
+import {setIronIronPlcSensorAdd, setIronIronPlcSensorEdit} from "@/request/tb_iron.js";
const props = defineProps({
visible: {
@@ -201,9 +201,13 @@ const props = defineProps({
required: true,
default: () => ({}),
},
+ type: {
+ type: String,
+ default: "操作",
+ },
});
-const emits = defineEmits(["update:visible", "update:form", "get-data"]);
-const { visible, form } = useVModels(props, emits);
+const emits = defineEmits(["update:visible", "update:form", "update:type", "get-data"]);
+const { visible, form, type } = useVModels(props, emits);
const rules = {
BIT_NO: [{ required: true, message: "位号不能为空", trigger: "blur" }],
TARGET_UNIT: [
@@ -235,15 +239,19 @@ const fnClose = () => {
visible.value = false;
};
const fnSubmit = debounce(
- 1000,
- async () => {
- await useFormValidate(formRef);
- await setIronIronPlcSensorEdit({ ...form.value });
- ElMessage.success("操作成功");
- fnClose();
- emits("get-data");
- },
- { atBegin: true }
+ 1000,
+ async () => {
+ await useFormValidate(formRef);
+ if (type.value === 'add') {
+ await setIronIronPlcSensorAdd({ ...form.value });
+ } else {
+ await setIronIronPlcSensorEdit({ ...form.value });
+ }
+ ElMessage.success("操作成功");
+ fnClose();
+ emits("get-data");
+ },
+ { atBegin: true }
);
diff --git a/src/views/tbiron/basicoxygenfurnace/components/plc_sensor_dia.vue b/src/views/tbiron/basicoxygenfurnace/components/plc_sensor_dia.vue
index aa0d076..865e0d8 100644
--- a/src/views/tbiron/basicoxygenfurnace/components/plc_sensor_dia.vue
+++ b/src/views/tbiron/basicoxygenfurnace/components/plc_sensor_dia.vue
@@ -27,6 +27,7 @@ const data = reactive({
addOrEditDialog: {
visible: false,
form: {},
+ type: "",
},
qrCodeDialog: {
visible: false,
@@ -35,9 +36,14 @@ const data = reactive({
});
const emits = defineEmits(["update:visible", "get-data"]);
-const fnEdit = (form) => {
+const fnEdit = (form, edit) => {
data.addOrEditDialog.visible = true;
- data.addOrEditDialog.form = form;
+ if (edit === 'add') {
+ data.addOrEditDialog.form = { PLC_ID: props.plcId, SIGNAL_TYPE: '', TARGET_STATUS: '' };
+ } else {
+ data.addOrEditDialog.form = form;
+ }
+ data.addOrEditDialog.type = edit;
};
const { visible } = useVModels(props, emits);
const fnClose = () => {
@@ -118,11 +124,17 @@ const fnClose = () => {
-
+
{{ row.TARGET_STATUS === 2 ? "完善" : "修改" }}
+
+
+ 新增
+
+
+
@@ -131,9 +143,10 @@ const fnClose = () => {
diff --git a/src/views/tbiron/blastfurnace/components/edit_sensor.vue b/src/views/tbiron/blastfurnace/components/edit_sensor.vue
index e081a17..1530044 100644
--- a/src/views/tbiron/blastfurnace/components/edit_sensor.vue
+++ b/src/views/tbiron/blastfurnace/components/edit_sensor.vue
@@ -1,11 +1,11 @@
-
+
-
+
-
+
@@ -188,7 +188,7 @@ import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
-import { setIronIronPlcSensorEdit } from "@/request/tb_iron.js";
+import {setIronIronPlcSensorAdd, setIronIronPlcSensorEdit} from "@/request/tb_iron.js";
const props = defineProps({
visible: {
@@ -201,9 +201,13 @@ const props = defineProps({
required: true,
default: () => ({}),
},
+ type: {
+ type: String,
+ default: "操作",
+ },
});
-const emits = defineEmits(["update:visible", "update:form", "get-data"]);
-const { visible, form } = useVModels(props, emits);
+const emits = defineEmits(["update:visible", "update:form", "update:type", "get-data"]);
+const { visible, form, type } = useVModels(props, emits);
const rules = {
BIT_NO: [{ required: true, message: "位号不能为空", trigger: "blur" }],
TARGET_UNIT: [
@@ -235,15 +239,19 @@ const fnClose = () => {
visible.value = false;
};
const fnSubmit = debounce(
- 1000,
- async () => {
- await useFormValidate(formRef);
- await setIronIronPlcSensorEdit({ ...form.value });
- ElMessage.success("操作成功");
- fnClose();
- emits("get-data");
- },
- { atBegin: true }
+ 1000,
+ async () => {
+ await useFormValidate(formRef);
+ if (type.value === 'add') {
+ await setIronIronPlcSensorAdd({ ...form.value });
+ } else {
+ await setIronIronPlcSensorEdit({ ...form.value });
+ }
+ ElMessage.success("操作成功");
+ fnClose();
+ emits("get-data");
+ },
+ { atBegin: true }
);
diff --git a/src/views/tbiron/blastfurnace/components/plc_sensor_dia.vue b/src/views/tbiron/blastfurnace/components/plc_sensor_dia.vue
index aa0d076..865e0d8 100644
--- a/src/views/tbiron/blastfurnace/components/plc_sensor_dia.vue
+++ b/src/views/tbiron/blastfurnace/components/plc_sensor_dia.vue
@@ -27,6 +27,7 @@ const data = reactive({
addOrEditDialog: {
visible: false,
form: {},
+ type: "",
},
qrCodeDialog: {
visible: false,
@@ -35,9 +36,14 @@ const data = reactive({
});
const emits = defineEmits(["update:visible", "get-data"]);
-const fnEdit = (form) => {
+const fnEdit = (form, edit) => {
data.addOrEditDialog.visible = true;
- data.addOrEditDialog.form = form;
+ if (edit === 'add') {
+ data.addOrEditDialog.form = { PLC_ID: props.plcId, SIGNAL_TYPE: '', TARGET_STATUS: '' };
+ } else {
+ data.addOrEditDialog.form = form;
+ }
+ data.addOrEditDialog.type = edit;
};
const { visible } = useVModels(props, emits);
const fnClose = () => {
@@ -118,11 +124,17 @@ const fnClose = () => {
-
+
{{ row.TARGET_STATUS === 2 ? "完善" : "修改" }}
+
+
+ 新增
+
+
+
@@ -131,9 +143,10 @@ const fnClose = () => {
diff --git a/src/views/tbiron/refiningfurnace/components/edit_sensor.vue b/src/views/tbiron/refiningfurnace/components/edit_sensor.vue
index e081a17..bbe7749 100644
--- a/src/views/tbiron/refiningfurnace/components/edit_sensor.vue
+++ b/src/views/tbiron/refiningfurnace/components/edit_sensor.vue
@@ -1,11 +1,11 @@
-
+
-
+
-
+
@@ -188,7 +188,7 @@ import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
-import { setIronIronPlcSensorEdit } from "@/request/tb_iron.js";
+import {setIronIronPlcSensorAdd, setIronIronPlcSensorEdit} from "@/request/tb_iron.js";
const props = defineProps({
visible: {
@@ -201,9 +201,13 @@ const props = defineProps({
required: true,
default: () => ({}),
},
+ type: {
+ type: String,
+ default: "操作",
+ },
});
-const emits = defineEmits(["update:visible", "update:form", "get-data"]);
-const { visible, form } = useVModels(props, emits);
+const emits = defineEmits(["update:visible", "update:form", "update:type", "get-data"]);
+const { visible, form, type } = useVModels(props, emits);
const rules = {
BIT_NO: [{ required: true, message: "位号不能为空", trigger: "blur" }],
TARGET_UNIT: [
@@ -238,7 +242,11 @@ const fnSubmit = debounce(
1000,
async () => {
await useFormValidate(formRef);
- await setIronIronPlcSensorEdit({ ...form.value });
+ if (type.value === 'add') {
+ await setIronIronPlcSensorAdd({ ...form.value });
+ } else {
+ await setIronIronPlcSensorEdit({ ...form.value });
+ }
ElMessage.success("操作成功");
fnClose();
emits("get-data");
diff --git a/src/views/tbiron/refiningfurnace/components/plc_sensor_dia.vue b/src/views/tbiron/refiningfurnace/components/plc_sensor_dia.vue
index aa0d076..ac693e7 100644
--- a/src/views/tbiron/refiningfurnace/components/plc_sensor_dia.vue
+++ b/src/views/tbiron/refiningfurnace/components/plc_sensor_dia.vue
@@ -27,6 +27,7 @@ const data = reactive({
addOrEditDialog: {
visible: false,
form: {},
+ type: "",
},
qrCodeDialog: {
visible: false,
@@ -35,9 +36,14 @@ const data = reactive({
});
const emits = defineEmits(["update:visible", "get-data"]);
-const fnEdit = (form) => {
+const fnEdit = (form, edit) => {
data.addOrEditDialog.visible = true;
- data.addOrEditDialog.form = form;
+ if (edit === 'add') {
+ data.addOrEditDialog.form = { PLC_ID: props.plcId, SIGNAL_TYPE: '', TARGET_STATUS: '' };
+ } else {
+ data.addOrEditDialog.form = form;
+ }
+ data.addOrEditDialog.type = edit;
};
const { visible } = useVModels(props, emits);
const fnClose = () => {
@@ -118,11 +124,17 @@ const fnClose = () => {
-
+
{{ row.TARGET_STATUS === 2 ? "完善" : "修改" }}
+
+
+ 新增
+
+
+
@@ -133,6 +145,7 @@ const fnClose = () => {
diff --git a/src/views/temporary_electricity_usage/invalid/index.vue b/src/views/temporary_electricity_usage/invalid/index.vue
index a13a28d..893063f 100644
--- a/src/views/temporary_electricity_usage/invalid/index.vue
+++ b/src/views/temporary_electricity_usage/invalid/index.vue
@@ -109,7 +109,7 @@
diff --git a/src/views/temporary_electricity_usage/job_data/index.vue b/src/views/temporary_electricity_usage/job_data/index.vue
index dfbb316..b32dfdf 100644
--- a/src/views/temporary_electricity_usage/job_data/index.vue
+++ b/src/views/temporary_electricity_usage/job_data/index.vue
@@ -212,7 +212,7 @@