卷被卷膜卷帘临时提交

feasure
lld 2026-03-18 19:10:23 +08:00
parent 9f0318bd9e
commit a1c08ebcc4
8 changed files with 354 additions and 246 deletions

View File

@ -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
})
}

View File

@ -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
})
}

View File

@ -3,8 +3,12 @@
<qiun-data-charts
type="line"
:opts="opts"
background="#fff"
:chartData="chartData"
:canvas2d="true"
canvasId="nMPkeQGNEosMwoWKKNRBZBIEhguMoMWp"
:ontouch="true"
:onmovetip="true"
/>
</view>
</template>
@ -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
}
]
}
}
}
};
},

View File

@ -20,7 +20,7 @@
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '' }}</text>
<text class="limit-time">
运行时间{{
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` : '- -'
}}
</text>
</view>
@ -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.

View File

@ -9,7 +9,7 @@
<view class="card shadow shadow-lg bg-white ">
<uni-section :title="`当前大棚:【${selectedText}】`" :subTitle="imei" titleFontSize="16px" type="line" >
<template v-slot:right>
<view class="switch-row">
<view class="switch-row" v-if="value!== 1 && !['862538065276939','A','B','C'].includes(value)">
<text class="modal-text">手动</text>
<tn-switch
v-model="currentMode"
@ -34,6 +34,9 @@
:value="value"
:ventTotalLen="ventTotalLen"
:agriId="agriId"
:quiltNum="quiltNum"
:filmNum="filmNum"
:blindNum="blindNum"
@publicMsg="publishMessage"
@sendSettingMsg="sendSettingMsg"
@getAgriRemark="getRemarkByImei"
@ -51,6 +54,9 @@
:selectedText="selectedText"
:value="value"
:agriId="agriId"
:quiltNum="quiltNum"
:filmNum="filmNum"
:blindNum="blindNum"
@publicMsg="publishMessage"
@getAgriRemark="getRemarkByImei"
@getAgriLimit="getAgriByImei"
@ -80,6 +86,8 @@ import CustomRefresher from "../../../components/custom-refresher/custom-refresh
import ZPaging from "../../../uni_modules/z-paging/components/z-paging/z-paging.vue";
import {findDtuDataByInfo} from "../../../api/system/data";
import {getAgriByImei} from "../../../api/system/assets/limit";
import {getDtuRemarkByImei} from "../../../api/system/assets/remark_bak";
import {getAgriLimitByImei} from "../../../api/system/assets/limit_bak";
export default {
options: {
@ -120,46 +128,17 @@ export default {
temp: "正在加载中..."
},
//
show: {
jbk: "暂停",
jbg: "暂停",
jlg: "暂停",
jlk: "暂停",
jm1k: "暂停",
jm1g: "暂停",
jm2k: "暂停",
jm2g: "暂停",
jm3k: "暂停",
jm3g: "暂停"
},
show: {},
status: {
jbk: 0,
jbg: 0,
jlk: 0,
jlg: 0,
jm1k: 0,
jm1g: 0,
jm2k: 0,
jm2g: 0,
jm3k: 0,
jm3g: 0,
deviceTime:"正在加载中..."
},
//
limitTimes: {
jbkLimit: 0,
jbgLimit: 0,
jlkLimit: 0,
jlgLimit: 0,
jm1kLimit: 0,
jm1gLimit: 0,
jm2kLimit: 0,
jm2gLimit: 0,
jm3kLimit: 0,
jm3gLimit: 0
},
limitTimes: {},
testMsg:'由于线上为真实数据。任何操作均可影响线上功能,故仅作演示',
ventTotalLen:0
ventTotalLen:0,
quiltNum:0,
filmNum:0,
blindNum:0
};
},
onLoad(option) {
@ -169,7 +148,10 @@ export default {
this.value = agriInfo.imei;
this.selectedText = agriInfo.agriName;
this.agriId = agriInfo.agriId;
this.currentMode = (agriInfo.workMode === 1)
this.currentMode = (agriInfo.workMode === 1);
this.quiltNum = agriInfo.quiltNum;
this.filmNum = agriInfo.filmNum;
this.blindNum = agriInfo.blindNum;
this.change(this.value)
}
// [k, g]
@ -243,6 +225,7 @@ export default {
});
this.liveData.temp = "最后更新时间:"+response.data.time;
this.fontStyle = 'font-size:16px;'
console.info(this.liveData)
})
}
this.getAgriByImei();
@ -258,19 +241,19 @@ export default {
this.style="";
},
getRemarkByImei() {
getRemarkByImei({imei:this.imei}).then(response => {
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;
}
})
},

View File

@ -46,7 +46,7 @@
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '' }}</text>
<text class="limit-time">
运行时间{{
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` : '- -'
}}
</text>
</view>
@ -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);

View File

@ -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))

View File

@ -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":{