From a1c08ebcc4798bd7e9aea66920b85100d02d7f12 Mon Sep 17 00:00:00 2001
From: lld <15027638633@163.com>
Date: Wed, 18 Mar 2026 19:10:23 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8D=B7=E8=A2=AB=E5=8D=B7=E8=86=9C=E5=8D=B7?=
=?UTF-8?q?=E5=B8=98=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/system/assets/limit_bak.js | 58 ++++++++
api/system/assets/remark_bak.js | 60 +++++++++
pages/data/index.vue | 122 +----------------
pages/home/control/automatic.vue | 69 +++++-----
pages/home/control/index.vue | 65 ++++-----
pages/home/control/manual.vue | 94 +++++++------
pages/index.vue | 5 +-
.../js_sdk/u-charts/config-ucharts.js | 127 ++++++++++++++++--
8 files changed, 354 insertions(+), 246 deletions(-)
create mode 100644 api/system/assets/limit_bak.js
create mode 100644 api/system/assets/remark_bak.js
diff --git a/api/system/assets/limit_bak.js b/api/system/assets/limit_bak.js
new file mode 100644
index 0000000..fcf37f0
--- /dev/null
+++ b/api/system/assets/limit_bak.js
@@ -0,0 +1,58 @@
+import request from '@/utils/request'
+
+// 查询大棚功能执行时间限位列表
+export function listLimit_bak(query) {
+ return request({
+ url: '/assets/limit_bak/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询大棚功能执行时间限位详细
+export function getLimit_bak(id) {
+ return request({
+ url: '/assets/limit_bak/' + id,
+ method: 'get'
+ })
+}
+
+// 新增大棚功能执行时间限位
+export function addLimit_bak(data) {
+ return request({
+ url: '/assets/limit_bak',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改大棚功能执行时间限位
+export function updateLimit_bak(data) {
+ return request({
+ url: '/assets/limit_bak',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除大棚功能执行时间限位
+export function delLimit_bak(id) {
+ return request({
+ url: '/assets/limit_bak/' + id,
+ method: 'delete'
+ })
+}
+export function getAgriLimitByImei(id) {
+ return request({
+ url: '/assets/limit_bak/getAgriLimitByImei/' + id,
+ method: 'get'
+ })
+}
+
+export function saveAgriLimit(data) {
+ return request({
+ url: '/assets/limit_bak/saveAgriLimit',
+ method: 'post',
+ data: data
+ })
+}
\ No newline at end of file
diff --git a/api/system/assets/remark_bak.js b/api/system/assets/remark_bak.js
new file mode 100644
index 0000000..5c8970f
--- /dev/null
+++ b/api/system/assets/remark_bak.js
@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询dtu设备备注列表
+export function listRemark_bak(query) {
+ return request({
+ url: '/assets/remark_bak/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询dtu设备备注详细
+export function getRemark_bak(id) {
+ return request({
+ url: '/assets/remark_bak/' + id,
+ method: 'get'
+ })
+}
+
+// 新增dtu设备备注
+export function addRemark_bak(data) {
+ return request({
+ url: '/assets/remark_bak',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改dtu设备备注
+export function updateRemark_bak(data) {
+ return request({
+ url: '/assets/remark_bak',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除dtu设备备注
+export function delRemark_bak(id) {
+ return request({
+ url: '/assets/remark_bak/' + id,
+ method: 'delete'
+ })
+}
+
+export function getDtuRemarkByImei(imei) {
+ return request({
+ url: '/assets/remark_bak/getDtuRemarkByImei',
+ method: 'get',
+ params: imei
+ })
+}
+
+export function saveAgriRemark(data) {
+ return request({
+ url: '/assets/limit_bak/saveAgriRemark',
+ method: 'post',
+ data: data
+ })
+}
\ No newline at end of file
diff --git a/pages/data/index.vue b/pages/data/index.vue
index a11121e..76ef1e6 100644
--- a/pages/data/index.vue
+++ b/pages/data/index.vue
@@ -3,8 +3,12 @@
@@ -16,66 +20,6 @@ export default {
chartData: {},
//这里的 opts 是图表类型 type="line" 的全部配置参数,您可以将此配置复制到 config-ucharts.js 文件中下标为 ['line'] 的节点中来覆盖全局默认参数。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
- timing: "easeOut",
- duration: 2000,
- rotate: false,
- rotateLock: false,
- color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
- padding: [15,10,0,15],
- fontSize: 13,
- fontColor: "#666666",
- dataLabel: false,
- dataPointShape: false,
- dataPointShapeType: "solid",
- touchMoveLimit: 60,
- enableScroll: true,
- enableMarkLine: false,
- legend: {
- show: true,
- position: "top",
- float: "center",
- padding: 5,
- margin: 5,
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "rgba(0,0,0,0)",
- borderWidth: 0,
- fontSize: 13,
- fontColor: "#666666",
- lineHeight: 11,
- hiddenColor: "#CECECE",
- itemGap: 10
- },
- xAxis: {
- disableGrid: true,
- disabled: false,
- axisLine: true,
- axisLineColor: "#CCCCCC",
- calibration: true,
- fontColor: "#666666",
- fontSize: 13,
- lineHeight: 20,
- marginTop: 5,
- rotateLabel: true,
- rotateAngle: 45,
- labelCount: 20,
- itemCount: 300,
- boundaryGap: "center",
- splitNumber: 5,
- gridColor: "#CCCCCC",
- gridType: "solid",
- dashLength: 4,
- gridEval: 1,
- scrollShow: true,
- scrollAlign: "left",
- scrollColor: "#A6A6A6",
- scrollBackgroundColor: "#EFEBEF",
- title: "时间",
- titleFontSize: 13,
- titleOffsetY: 0,
- titleOffsetX: 10,
- titleFontColor: "#666666",
- format: ""
- },
yAxis: {
gridType: "dash",
dashLength: 2,
@@ -130,63 +74,7 @@ export default {
}
]
},
- extra: {
- line: {
- type: "straight",
- width: 2,
- activeType: "hollow",
- linearType: "none",
- onShadow: false,
- animation: "vertical"
- },
- tooltip: {
- showBox: true,
- showArrow: true,
- showCategory: false,
- borderWidth: 0,
- borderRadius: 0,
- borderColor: "#000000",
- borderOpacity: 0.7,
- bgColor: "#000000",
- bgOpacity: 0.7,
- gridType: "solid",
- dashLength: 4,
- gridColor: "#CCCCCC",
- boxPadding: 3,
- fontSize: 13,
- lineHeight: 20,
- fontColor: "#FFFFFF",
- legendShow: true,
- legendShape: "auto",
- splitLine: true,
- horizentalLine: false,
- xAxisLabel: false,
- yAxisLabel: false,
- labelBgColor: "#FFFFFF",
- labelBgOpacity: 0.7,
- labelFontColor: "#666666"
- },
- markLine: {
- type: "solid",
- dashLength: 4,
- data: [
- {
- value: 0,
- lineColor: "#DE4A42",
- showLabel: false,
- labelAlign: "left",
- labelOffsetX: 0,
- labelOffsetY: 0,
- labelPadding: 6,
- labelText: "",
- labelFontSize: 13,
- labelFontColor: "#666666",
- labelBgColor: "#DFE8FF",
- labelBgOpacity: 0.8
- }
- ]
- }
- }
+
}
};
},
diff --git a/pages/home/control/automatic.vue b/pages/home/control/automatic.vue
index 99aa235..17bbd1b 100644
--- a/pages/home/control/automatic.vue
+++ b/pages/home/control/automatic.vue
@@ -20,7 +20,7 @@
{{ show[card.type] || '未知' }}
运行时间:{{
- limitTimes[`${card.type}Limit`] && limitTimes[`${card.type}Limit`] !== '0' ? `${limitTimes[`${card.type}Limit`]} s` : '- -'
+ limitTimes[`${card.type}`] && limitTimes[`${card.type}`] !== '0' ? `${limitTimes[`${card.type}`]} s` : '- -'
}}
@@ -281,14 +281,14 @@
// 优化:抽离魔法值常量
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
import mqttUtil from '@/utils/mqtt';
-import {addLimit, updateLimit} from "../../../api/system/assets/limit";
import store from "../../../store";
-import {addRemark, updateRemark} from "../../../api/system/assets/remark";
import {generateUniqueId} from "../../../utils/agri";
import UniSection from "../../../components/uni-section/uni-section.vue";
import UniFormsItem from "../../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue";
import { checkTimeConflict } from "../../../utils/agri"
import {getAgriTerm, saveAgriTerm} from "../../../api/control/autoTerm";
+import {saveAgriLimit} from "../../../api/system/assets/limit_bak";
+import {saveAgriRemark} from "../../../api/system/assets/remark_bak";
export default {
options: {
@@ -349,6 +349,18 @@ export default {
type: String,
default: null
},
+ quiltNum: {
+ type: Number,
+ default: 0
+ },
+ filmNum: {
+ type: Number,
+ default: 0
+ },
+ blindNum: {
+ type: Number,
+ default: 0
+ },
},
watch: {
value: {
@@ -605,7 +617,7 @@ export default {
return;
}
this.currentCard = card; // 记录当前卡片信息
- this.currentCardTime = this.limitTimes[`${card.type}Limit`]; // 记录当前时间
+ this.currentCardTime = this.limitTimes[`${card.type}`]; // 记录当前时间
this.newLimitTime = this.currentCardTime; // 默认填充当前时间
this.remark = this.dtu_remark[card.type] || card.name;
this.$refs.inputDialog.open()
@@ -739,42 +751,39 @@ export default {
if (!res.confirm) return; // 取消操作则直接返回
let isAllSuccess = false; // 统一判定所有请求是否成功
-
try {
// 7. 处理运行时间修改
if (isLimitTimeModified) {
- this.$set(limitTimes, `${currentCard.type}Limit`, newLimitTime || 0);
- // 补全必要字段(合并重复逻辑)
- if (!limitTimes.imei) {
- this.$set(limitTimes, 'imei', imei);
- this.$set(limitTimes, 'agriName', selectedText);
- this.$set(limitTimes, 'agriId', agriId);
- }
- // 发起请求并等待结果(async/await确保顺序执行)
- const limitRes = limitTimes.id
- ? await updateLimit(limitTimes)
- : await addLimit(limitTimes);
- if (limitRes.code === 200) {
- isAllSuccess = true;
- this.$emit("getAgriLimit")
+ this.$set(limitTimes, `${currentCard.type}`, newLimitTime || 0);
+ const agriLimitInfo = {
+ agriId:agriId,
+ agriName:selectedText,
+ imei:imei,
+ roller:currentCard.type,
+ limit:newLimitTime
}
+ saveAgriLimit(agriLimitInfo).then(response => {
+ if (response.code===200) {
+ isAllSuccess = true;
+ this.$emit("getAgriLimit");
+ }
+ });
}
// 8. 处理别名修改
if (isRemarkModified) {
this.$set(dtu_remark, currentCard.type, remark);
- // 补全imei字段
- if (!dtu_remark.imei) {
- this.$set(dtu_remark, 'imei', imei);
- }
- // 发起请求并等待结果
- const remarkRes = dtu_remark.id
- ? await updateRemark(dtu_remark)
- : await addRemark(dtu_remark);
- if (remarkRes.code === 200) {
- this.$emit("getRemark")
- isAllSuccess = true;
+ const agriRemarkInfo = {
+ imei:imei,
+ roller:currentCard.type,
+ remarkShort:remark
}
+ saveAgriRemark(agriRemarkInfo).then(response => {
+ if (response.code===200) {
+ this.$emit("getAgriRemark")
+ isAllSuccess = true;
+ }
+ });
}
// 9. 正确的提示逻辑(修复原本文案反写的问题)
diff --git a/pages/home/control/index.vue b/pages/home/control/index.vue
index bcbe945..95ab11e 100644
--- a/pages/home/control/index.vue
+++ b/pages/home/control/index.vue
@@ -9,7 +9,7 @@
-
+
手动
{
+ getDtuRemarkByImei({imei:this.imei}).then(response => {
if (response.code===200 && (response.data)) {
- this.dtu_remark={...response.data}
+ this.dtu_remark={...response.data.remarkMaps}
}
});
},
getAgriByImei() {
- getAgriByImei(this.imei).then(response => {
+ getAgriLimitByImei(this.imei).then(response => {
if (response.code === 200) {
if (!response.data) {
return;
}
- this.limitTimes = response.data;
+ this.limitTimes = response.data.limitMaps;
}
})
},
diff --git a/pages/home/control/manual.vue b/pages/home/control/manual.vue
index 31aff34..078e599 100644
--- a/pages/home/control/manual.vue
+++ b/pages/home/control/manual.vue
@@ -46,7 +46,7 @@
{{ show[card.type] || '未知' }}
运行时间:{{
- limitTimes[`${card.type}Limit`] && limitTimes[`${card.type}Limit`] !== '0' ? `${limitTimes[`${card.type}Limit`]} s` : '- -'
+ limitTimes[`${card.type}`] && limitTimes[`${card.type}`] !== '0' ? `${limitTimes[`${card.type}`]} s` : '- -'
}}
@@ -115,9 +115,10 @@
// 优化:抽离魔法值常量
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
import mqttUtil from '@/utils/mqtt';
-import {addLimit, updateLimit} from "../../../api/system/assets/limit";
import store from "../../../store";
import {addRemark, updateRemark} from "../../../api/system/assets/remark";
+import {saveAgriLimit} from "../../../api/system/assets/limit_bak";
+import {saveAgriRemark} from "../../../api/system/assets/remark_bak";
export default {
options: {
@@ -178,6 +179,18 @@ export default {
type: String,
default: ''
},
+ quiltNum: {
+ type: Number,
+ default: 0
+ },
+ filmNum: {
+ type: Number,
+ default: 0
+ },
+ blindNum: {
+ type: Number,
+ default: 0
+ },
},
watch: {
value: {
@@ -272,7 +285,7 @@ export default {
return;
}
this.currentCard = card; // 记录当前卡片信息
- this.currentCardTime = this.limitTimes[`${card.type}Limit`]; // 记录当前时间
+ this.currentCardTime = this.limitTimes[`${card.type}`]; // 记录当前时间
this.newLimitTime = this.currentCardTime; // 默认填充当前时间
this.remark = this.dtu_remark[card.type] || card.name;
this.$refs.inputDialog.open()
@@ -404,38 +417,37 @@ export default {
try {
// 7. 处理运行时间修改
if (isLimitTimeModified) {
- this.$set(limitTimes, `${currentCard.type}Limit`, newLimitTime || 0);
+ this.$set(limitTimes, `${currentCard.type}`, newLimitTime || 0);
// 补全必要字段(合并重复逻辑)
- if (!limitTimes.imei) {
- this.$set(limitTimes, 'imei', imei);
- this.$set(limitTimes, 'agriName', selectedText);
- this.$set(limitTimes, 'agriId', agriId);
- }
- // 发起请求并等待结果(async/await确保顺序执行)
- const limitRes = limitTimes.id
- ? await updateLimit(limitTimes)
- : await addLimit(limitTimes);
- if (limitRes.code === 200) {
- isAllSuccess = true;
- this.$emit("getAgriLimit")
+ const agriLimitInfo = {
+ agriId:agriId,
+ agriName:selectedText,
+ imei:imei,
+ roller:currentCard.type,
+ limit:newLimitTime
}
+ saveAgriLimit(agriLimitInfo).then(response => {
+ if (response.code===200) {
+ isAllSuccess = true;
+ this.$emit("getAgriLimit");
+ }
+ });
}
// 8. 处理别名修改
if (isRemarkModified) {
this.$set(dtu_remark, currentCard.type, remark);
- // 补全imei字段
- if (!dtu_remark.imei) {
- this.$set(dtu_remark, 'imei', imei);
- }
- // 发起请求并等待结果
- const remarkRes = dtu_remark.id
- ? await updateRemark(dtu_remark)
- : await addRemark(dtu_remark);
- if (remarkRes.code === 200) {
- this.$emit("getAgriRemark")
- isAllSuccess = true;
+ const agriRemarkInfo = {
+ imei:imei,
+ roller:currentCard.type,
+ remarkShort:remark
}
+ saveAgriRemark(agriRemarkInfo).then(response => {
+ if (response.code===200) {
+ this.$emit("getAgriRemark")
+ isAllSuccess = true;
+ }
+ });
}
// 9. 正确的提示逻辑(修复原本文案反写的问题)
@@ -495,23 +507,19 @@ export default {
// 5. 更新响应式数据
this.$set(dtu_remark, sensorKey, remark); // sensorKey本身是字符串,无需拼接
// 补全imei字段(确保非空)
- if (!dtu_remark.imei) {
- this.$set(dtu_remark, 'imei', imei);
- }
-
- // 6. 异步请求:await等待结果(核心修复)
- const remarkRes = dtu_remark.id ? await updateRemark(dtu_remark) : await addRemark(dtu_remark);
-
- // 7. 根据接口响应提示
- const isSuccess = remarkRes.code === 200;
- this.$modal[isSuccess ? 'msgSuccess' : 'msgError'](
- isSuccess ? '修改成功' : '修改失败'
- );
-
- // 8. 仅成功时刷新数据(失败时不刷新,避免覆盖现有数据)
- if (isSuccess) {
- this.$emit("getRemark")
+ const agriRemarkInfo = {
+ imei:imei,
+ roller:sensorKey,
+ remarkShort:remark
}
+ saveAgriRemark(agriRemarkInfo).then(response => {
+ if (response.code===200) {
+ this.$emit("getAgriRemark")
+ this.$modal.msgSuccess('修改成功');
+ } else {
+ this.$modal.msgError('修改失败');
+ }
+ });
} catch (error) {
// 捕获网络异常/接口报错
console.error('别名修改失败:', error);
diff --git a/pages/index.vue b/pages/index.vue
index 2bfae15..8eedf43 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -339,7 +339,10 @@ export default {
imei:item.imei,
agriName:item.agriName,
agriId:item.id,
- workMode: item.workMode
+ workMode: item.workMode,
+ quiltNum:item.quiltNum,
+ filmNum:item.filmNum,
+ blindNum:item.blindNum
}
);
this.$tab.navigateTo('/pages/home/control/index?agriInfo='+encodeURIComponent(agri))
diff --git a/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js b/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js
index 17b28b3..54520a2 100644
--- a/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js
+++ b/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js
@@ -237,23 +237,122 @@ const cfu = {
},
"line":{
"type": "line",
- "color": color,
- "padding": [15,10,0,15],
- "xAxis": {
- "disableGrid": true,
+ timing: "easeOut",
+ duration: 2000,
+ rotate: false,
+ rotateLock: false,
+ color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
+ padding: [15,10,0,15],
+ fontSize: 13,
+ fontColor: "#666666",
+ dataLabel: false,
+ dataPointShape: false,
+ dataPointShapeType: "solid",
+ touchMoveLimit: 60,
+ enableScroll: false,
+ enableMarkLine: false,
+ xAxis: {
+ disableGrid: true,
+ disabled: false,
+ axisLine: true,
+ axisLineColor: "#CCCCCC",
+ calibration: true,
+ fontColor: "#666666",
+ fontSize: 13,
+ lineHeight: 20,
+ marginTop: 10,
+ rotateLabel: true,
+ rotateAngle: 45,
+ labelCount: 15,
+ itemCount: 300,
+ boundaryGap: "center",
+ splitNumber: 5,
+ gridColor: "#CCCCCC",
+ gridType: "solid",
+ dashLength: 4,
+ gridEval: 1,
+ scrollShow: true,
+ scrollAlign: "left",
+ scrollColor: "#A6A6A6",
+ scrollBackgroundColor: "#EFEBEF",
+ title: "时间",
+ titleFontSize: 13,
+ titleOffsetY: 0,
+ titleOffsetX: 10,
+ titleFontColor: "#666666",
+ format: ""
},
- "yAxis": {
- "gridType": "dash",
- "dashLength": 2,
+ legend: {
+ show: true,
+ position: "top",
+ float: "center",
+ padding: 5,
+ margin: 5,
+ backgroundColor: "rgba(0,0,0,0)",
+ borderColor: "rgba(0,0,0,0)",
+ borderWidth: 0,
+ fontSize: 13,
+ fontColor: "#666666",
+ lineHeight: 11,
+ hiddenColor: "#CECECE",
+ itemGap: 10
},
- "legend": {
- },
- "extra": {
- "line": {
- "type": "straight",
- "width": 2,
- "activeType": "hollow"
+ extra: {
+ line: {
+ type: "straight",
+ width: 2,
+ activeType: "hollow",
+ linearType: "none",
+ onShadow: false,
+ animation: "vertical"
},
+ tooltip: {
+ showBox: true,
+ showArrow: true,
+ showCategory: false,
+ borderWidth: 0,
+ borderRadius: 0,
+ borderColor: "#000000",
+ borderOpacity: 0.7,
+ bgColor: "#000000",
+ bgOpacity: 0.7,
+ gridType: "solid",
+ dashLength: 4,
+ gridColor: "#CCCCCC",
+ boxPadding: 3,
+ fontSize: 13,
+ lineHeight: 20,
+ fontColor: "#FFFFFF",
+ legendShow: true,
+ legendShape: "auto",
+ splitLine: true,
+ horizentalLine: false,
+ xAxisLabel: false,
+ yAxisLabel: false,
+ labelBgColor: "#FFFFFF",
+ labelBgOpacity: 0.7,
+ labelFontColor: "#666666"
+ },
+ markLine: {
+ type: "solid",
+ dashLength: 4,
+ data: [
+ {
+ value: 0,
+ lineColor: "#DE4A42",
+ showLabel: false,
+ labelAlign: "left",
+ labelOffsetX: 0,
+ labelOffsetY: 0,
+ labelPadding: 6,
+ labelText: "",
+ labelFontSize: 13,
+ labelFontColor: "#666666",
+ labelBgColor: "#DFE8FF",
+ labelBgOpacity: 0.8
+ }
+ ]
+ }
}
},
"tline":{