卷被卷膜卷帘临时提交
parent
9f0318bd9e
commit
a1c08ebcc4
|
|
@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -3,8 +3,12 @@
|
||||||
<qiun-data-charts
|
<qiun-data-charts
|
||||||
type="line"
|
type="line"
|
||||||
:opts="opts"
|
:opts="opts"
|
||||||
|
background="#fff"
|
||||||
:chartData="chartData"
|
:chartData="chartData"
|
||||||
|
:canvas2d="true"
|
||||||
|
canvasId="nMPkeQGNEosMwoWKKNRBZBIEhguMoMWp"
|
||||||
:ontouch="true"
|
:ontouch="true"
|
||||||
|
:onmovetip="true"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -16,66 +20,6 @@ export default {
|
||||||
chartData: {},
|
chartData: {},
|
||||||
//这里的 opts 是图表类型 type="line" 的全部配置参数,您可以将此配置复制到 config-ucharts.js 文件中下标为 ['line'] 的节点中来覆盖全局默认参数。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
//这里的 opts 是图表类型 type="line" 的全部配置参数,您可以将此配置复制到 config-ucharts.js 文件中下标为 ['line'] 的节点中来覆盖全局默认参数。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
||||||
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: {
|
yAxis: {
|
||||||
gridType: "dash",
|
gridType: "dash",
|
||||||
dashLength: 2,
|
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
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '未知' }}</text>
|
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '未知' }}</text>
|
||||||
<text class="limit-time">
|
<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>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -281,14 +281,14 @@
|
||||||
// 优化:抽离魔法值常量
|
// 优化:抽离魔法值常量
|
||||||
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
|
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
|
||||||
import mqttUtil from '@/utils/mqtt';
|
import mqttUtil from '@/utils/mqtt';
|
||||||
import {addLimit, updateLimit} from "../../../api/system/assets/limit";
|
|
||||||
import store from "../../../store";
|
import store from "../../../store";
|
||||||
import {addRemark, updateRemark} from "../../../api/system/assets/remark";
|
|
||||||
import {generateUniqueId} from "../../../utils/agri";
|
import {generateUniqueId} from "../../../utils/agri";
|
||||||
import UniSection from "../../../components/uni-section/uni-section.vue";
|
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 UniFormsItem from "../../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue";
|
||||||
import { checkTimeConflict } from "../../../utils/agri"
|
import { checkTimeConflict } from "../../../utils/agri"
|
||||||
import {getAgriTerm, saveAgriTerm} from "../../../api/control/autoTerm";
|
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 {
|
export default {
|
||||||
options: {
|
options: {
|
||||||
|
|
@ -349,6 +349,18 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
|
quiltNum: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
filmNum: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
blindNum: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
value: {
|
||||||
|
|
@ -605,7 +617,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentCard = card; // 记录当前卡片信息
|
this.currentCard = card; // 记录当前卡片信息
|
||||||
this.currentCardTime = this.limitTimes[`${card.type}Limit`]; // 记录当前时间
|
this.currentCardTime = this.limitTimes[`${card.type}`]; // 记录当前时间
|
||||||
this.newLimitTime = this.currentCardTime; // 默认填充当前时间
|
this.newLimitTime = this.currentCardTime; // 默认填充当前时间
|
||||||
this.remark = this.dtu_remark[card.type] || card.name;
|
this.remark = this.dtu_remark[card.type] || card.name;
|
||||||
this.$refs.inputDialog.open()
|
this.$refs.inputDialog.open()
|
||||||
|
|
@ -739,42 +751,39 @@ export default {
|
||||||
if (!res.confirm) return; // 取消操作则直接返回
|
if (!res.confirm) return; // 取消操作则直接返回
|
||||||
|
|
||||||
let isAllSuccess = false; // 统一判定所有请求是否成功
|
let isAllSuccess = false; // 统一判定所有请求是否成功
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 7. 处理运行时间修改
|
// 7. 处理运行时间修改
|
||||||
if (isLimitTimeModified) {
|
if (isLimitTimeModified) {
|
||||||
this.$set(limitTimes, `${currentCard.type}Limit`, newLimitTime || 0);
|
this.$set(limitTimes, `${currentCard.type}`, newLimitTime || 0);
|
||||||
// 补全必要字段(合并重复逻辑)
|
const agriLimitInfo = {
|
||||||
if (!limitTimes.imei) {
|
agriId:agriId,
|
||||||
this.$set(limitTimes, 'imei', imei);
|
agriName:selectedText,
|
||||||
this.$set(limitTimes, 'agriName', selectedText);
|
imei:imei,
|
||||||
this.$set(limitTimes, 'agriId', agriId);
|
roller:currentCard.type,
|
||||||
|
limit:newLimitTime
|
||||||
}
|
}
|
||||||
// 发起请求并等待结果(async/await确保顺序执行)
|
saveAgriLimit(agriLimitInfo).then(response => {
|
||||||
const limitRes = limitTimes.id
|
if (response.code===200) {
|
||||||
? await updateLimit(limitTimes)
|
|
||||||
: await addLimit(limitTimes);
|
|
||||||
if (limitRes.code === 200) {
|
|
||||||
isAllSuccess = true;
|
isAllSuccess = true;
|
||||||
this.$emit("getAgriLimit")
|
this.$emit("getAgriLimit");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 8. 处理别名修改
|
// 8. 处理别名修改
|
||||||
if (isRemarkModified) {
|
if (isRemarkModified) {
|
||||||
this.$set(dtu_remark, currentCard.type, remark);
|
this.$set(dtu_remark, currentCard.type, remark);
|
||||||
// 补全imei字段
|
const agriRemarkInfo = {
|
||||||
if (!dtu_remark.imei) {
|
imei:imei,
|
||||||
this.$set(dtu_remark, 'imei', imei);
|
roller:currentCard.type,
|
||||||
|
remarkShort:remark
|
||||||
}
|
}
|
||||||
// 发起请求并等待结果
|
saveAgriRemark(agriRemarkInfo).then(response => {
|
||||||
const remarkRes = dtu_remark.id
|
if (response.code===200) {
|
||||||
? await updateRemark(dtu_remark)
|
this.$emit("getAgriRemark")
|
||||||
: await addRemark(dtu_remark);
|
|
||||||
if (remarkRes.code === 200) {
|
|
||||||
this.$emit("getRemark")
|
|
||||||
isAllSuccess = true;
|
isAllSuccess = true;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9. 正确的提示逻辑(修复原本文案反写的问题)
|
// 9. 正确的提示逻辑(修复原本文案反写的问题)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<view class="card shadow shadow-lg bg-white ">
|
<view class="card shadow shadow-lg bg-white ">
|
||||||
<uni-section :title="`当前大棚:【${selectedText}】`" :subTitle="imei" titleFontSize="16px" type="line" >
|
<uni-section :title="`当前大棚:【${selectedText}】`" :subTitle="imei" titleFontSize="16px" type="line" >
|
||||||
<template v-slot:right>
|
<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>
|
<text class="modal-text">手动</text>
|
||||||
<tn-switch
|
<tn-switch
|
||||||
v-model="currentMode"
|
v-model="currentMode"
|
||||||
|
|
@ -34,6 +34,9 @@
|
||||||
:value="value"
|
:value="value"
|
||||||
:ventTotalLen="ventTotalLen"
|
:ventTotalLen="ventTotalLen"
|
||||||
:agriId="agriId"
|
:agriId="agriId"
|
||||||
|
:quiltNum="quiltNum"
|
||||||
|
:filmNum="filmNum"
|
||||||
|
:blindNum="blindNum"
|
||||||
@publicMsg="publishMessage"
|
@publicMsg="publishMessage"
|
||||||
@sendSettingMsg="sendSettingMsg"
|
@sendSettingMsg="sendSettingMsg"
|
||||||
@getAgriRemark="getRemarkByImei"
|
@getAgriRemark="getRemarkByImei"
|
||||||
|
|
@ -51,6 +54,9 @@
|
||||||
:selectedText="selectedText"
|
:selectedText="selectedText"
|
||||||
:value="value"
|
:value="value"
|
||||||
:agriId="agriId"
|
:agriId="agriId"
|
||||||
|
:quiltNum="quiltNum"
|
||||||
|
:filmNum="filmNum"
|
||||||
|
:blindNum="blindNum"
|
||||||
@publicMsg="publishMessage"
|
@publicMsg="publishMessage"
|
||||||
@getAgriRemark="getRemarkByImei"
|
@getAgriRemark="getRemarkByImei"
|
||||||
@getAgriLimit="getAgriByImei"
|
@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 ZPaging from "../../../uni_modules/z-paging/components/z-paging/z-paging.vue";
|
||||||
import {findDtuDataByInfo} from "../../../api/system/data";
|
import {findDtuDataByInfo} from "../../../api/system/data";
|
||||||
import {getAgriByImei} from "../../../api/system/assets/limit";
|
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 {
|
export default {
|
||||||
options: {
|
options: {
|
||||||
|
|
@ -120,46 +128,17 @@ export default {
|
||||||
temp: "正在加载中..."
|
temp: "正在加载中..."
|
||||||
},
|
},
|
||||||
// 卡片状态
|
// 卡片状态
|
||||||
show: {
|
show: {},
|
||||||
jbk: "暂停",
|
|
||||||
jbg: "暂停",
|
|
||||||
jlg: "暂停",
|
|
||||||
jlk: "暂停",
|
|
||||||
jm1k: "暂停",
|
|
||||||
jm1g: "暂停",
|
|
||||||
jm2k: "暂停",
|
|
||||||
jm2g: "暂停",
|
|
||||||
jm3k: "暂停",
|
|
||||||
jm3g: "暂停"
|
|
||||||
},
|
|
||||||
status: {
|
status: {
|
||||||
jbk: 0,
|
|
||||||
jbg: 0,
|
|
||||||
jlk: 0,
|
|
||||||
jlg: 0,
|
|
||||||
jm1k: 0,
|
|
||||||
jm1g: 0,
|
|
||||||
jm2k: 0,
|
|
||||||
jm2g: 0,
|
|
||||||
jm3k: 0,
|
|
||||||
jm3g: 0,
|
|
||||||
deviceTime:"正在加载中..."
|
deviceTime:"正在加载中..."
|
||||||
},
|
},
|
||||||
// 新增:限位时间配置
|
// 新增:限位时间配置
|
||||||
limitTimes: {
|
limitTimes: {},
|
||||||
jbkLimit: 0,
|
|
||||||
jbgLimit: 0,
|
|
||||||
jlkLimit: 0,
|
|
||||||
jlgLimit: 0,
|
|
||||||
jm1kLimit: 0,
|
|
||||||
jm1gLimit: 0,
|
|
||||||
jm2kLimit: 0,
|
|
||||||
jm2gLimit: 0,
|
|
||||||
jm3kLimit: 0,
|
|
||||||
jm3gLimit: 0
|
|
||||||
},
|
|
||||||
testMsg:'由于线上为真实数据。任何操作均可影响线上功能,故仅作演示',
|
testMsg:'由于线上为真实数据。任何操作均可影响线上功能,故仅作演示',
|
||||||
ventTotalLen:0
|
ventTotalLen:0,
|
||||||
|
quiltNum:0,
|
||||||
|
filmNum:0,
|
||||||
|
blindNum:0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
|
@ -169,7 +148,10 @@ export default {
|
||||||
this.value = agriInfo.imei;
|
this.value = agriInfo.imei;
|
||||||
this.selectedText = agriInfo.agriName;
|
this.selectedText = agriInfo.agriName;
|
||||||
this.agriId = agriInfo.agriId;
|
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)
|
this.change(this.value)
|
||||||
}
|
}
|
||||||
// 定义所有互斥的键对:[k键, g键]
|
// 定义所有互斥的键对:[k键, g键]
|
||||||
|
|
@ -243,6 +225,7 @@ export default {
|
||||||
});
|
});
|
||||||
this.liveData.temp = "最后更新时间:"+response.data.time;
|
this.liveData.temp = "最后更新时间:"+response.data.time;
|
||||||
this.fontStyle = 'font-size:16px;'
|
this.fontStyle = 'font-size:16px;'
|
||||||
|
console.info(this.liveData)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.getAgriByImei();
|
this.getAgriByImei();
|
||||||
|
|
@ -258,19 +241,19 @@ export default {
|
||||||
this.style="";
|
this.style="";
|
||||||
},
|
},
|
||||||
getRemarkByImei() {
|
getRemarkByImei() {
|
||||||
getRemarkByImei({imei:this.imei}).then(response => {
|
getDtuRemarkByImei({imei:this.imei}).then(response => {
|
||||||
if (response.code===200 && (response.data)) {
|
if (response.code===200 && (response.data)) {
|
||||||
this.dtu_remark={...response.data}
|
this.dtu_remark={...response.data.remarkMaps}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getAgriByImei() {
|
getAgriByImei() {
|
||||||
getAgriByImei(this.imei).then(response => {
|
getAgriLimitByImei(this.imei).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
if (!response.data) {
|
if (!response.data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.limitTimes = response.data;
|
this.limitTimes = response.data.limitMaps;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '未知' }}</text>
|
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '未知' }}</text>
|
||||||
<text class="limit-time">
|
<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>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -115,9 +115,10 @@
|
||||||
// 优化:抽离魔法值常量
|
// 优化:抽离魔法值常量
|
||||||
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
|
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
|
||||||
import mqttUtil from '@/utils/mqtt';
|
import mqttUtil from '@/utils/mqtt';
|
||||||
import {addLimit, updateLimit} from "../../../api/system/assets/limit";
|
|
||||||
import store from "../../../store";
|
import store from "../../../store";
|
||||||
import {addRemark, updateRemark} from "../../../api/system/assets/remark";
|
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 {
|
export default {
|
||||||
options: {
|
options: {
|
||||||
|
|
@ -178,6 +179,18 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
|
quiltNum: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
filmNum: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
blindNum: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
value: {
|
||||||
|
|
@ -272,7 +285,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentCard = card; // 记录当前卡片信息
|
this.currentCard = card; // 记录当前卡片信息
|
||||||
this.currentCardTime = this.limitTimes[`${card.type}Limit`]; // 记录当前时间
|
this.currentCardTime = this.limitTimes[`${card.type}`]; // 记录当前时间
|
||||||
this.newLimitTime = this.currentCardTime; // 默认填充当前时间
|
this.newLimitTime = this.currentCardTime; // 默认填充当前时间
|
||||||
this.remark = this.dtu_remark[card.type] || card.name;
|
this.remark = this.dtu_remark[card.type] || card.name;
|
||||||
this.$refs.inputDialog.open()
|
this.$refs.inputDialog.open()
|
||||||
|
|
@ -404,38 +417,37 @@ export default {
|
||||||
try {
|
try {
|
||||||
// 7. 处理运行时间修改
|
// 7. 处理运行时间修改
|
||||||
if (isLimitTimeModified) {
|
if (isLimitTimeModified) {
|
||||||
this.$set(limitTimes, `${currentCard.type}Limit`, newLimitTime || 0);
|
this.$set(limitTimes, `${currentCard.type}`, newLimitTime || 0);
|
||||||
// 补全必要字段(合并重复逻辑)
|
// 补全必要字段(合并重复逻辑)
|
||||||
if (!limitTimes.imei) {
|
const agriLimitInfo = {
|
||||||
this.$set(limitTimes, 'imei', imei);
|
agriId:agriId,
|
||||||
this.$set(limitTimes, 'agriName', selectedText);
|
agriName:selectedText,
|
||||||
this.$set(limitTimes, 'agriId', agriId);
|
imei:imei,
|
||||||
|
roller:currentCard.type,
|
||||||
|
limit:newLimitTime
|
||||||
}
|
}
|
||||||
// 发起请求并等待结果(async/await确保顺序执行)
|
saveAgriLimit(agriLimitInfo).then(response => {
|
||||||
const limitRes = limitTimes.id
|
if (response.code===200) {
|
||||||
? await updateLimit(limitTimes)
|
|
||||||
: await addLimit(limitTimes);
|
|
||||||
if (limitRes.code === 200) {
|
|
||||||
isAllSuccess = true;
|
isAllSuccess = true;
|
||||||
this.$emit("getAgriLimit")
|
this.$emit("getAgriLimit");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 8. 处理别名修改
|
// 8. 处理别名修改
|
||||||
if (isRemarkModified) {
|
if (isRemarkModified) {
|
||||||
this.$set(dtu_remark, currentCard.type, remark);
|
this.$set(dtu_remark, currentCard.type, remark);
|
||||||
// 补全imei字段
|
const agriRemarkInfo = {
|
||||||
if (!dtu_remark.imei) {
|
imei:imei,
|
||||||
this.$set(dtu_remark, 'imei', imei);
|
roller:currentCard.type,
|
||||||
|
remarkShort:remark
|
||||||
}
|
}
|
||||||
// 发起请求并等待结果
|
saveAgriRemark(agriRemarkInfo).then(response => {
|
||||||
const remarkRes = dtu_remark.id
|
if (response.code===200) {
|
||||||
? await updateRemark(dtu_remark)
|
|
||||||
: await addRemark(dtu_remark);
|
|
||||||
if (remarkRes.code === 200) {
|
|
||||||
this.$emit("getAgriRemark")
|
this.$emit("getAgriRemark")
|
||||||
isAllSuccess = true;
|
isAllSuccess = true;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9. 正确的提示逻辑(修复原本文案反写的问题)
|
// 9. 正确的提示逻辑(修复原本文案反写的问题)
|
||||||
|
|
@ -495,23 +507,19 @@ export default {
|
||||||
// 5. 更新响应式数据
|
// 5. 更新响应式数据
|
||||||
this.$set(dtu_remark, sensorKey, remark); // sensorKey本身是字符串,无需拼接
|
this.$set(dtu_remark, sensorKey, remark); // sensorKey本身是字符串,无需拼接
|
||||||
// 补全imei字段(确保非空)
|
// 补全imei字段(确保非空)
|
||||||
if (!dtu_remark.imei) {
|
const agriRemarkInfo = {
|
||||||
this.$set(dtu_remark, 'imei', imei);
|
imei:imei,
|
||||||
|
roller:sensorKey,
|
||||||
|
remarkShort:remark
|
||||||
}
|
}
|
||||||
|
saveAgriRemark(agriRemarkInfo).then(response => {
|
||||||
// 6. 异步请求:await等待结果(核心修复)
|
if (response.code===200) {
|
||||||
const remarkRes = dtu_remark.id ? await updateRemark(dtu_remark) : await addRemark(dtu_remark);
|
this.$emit("getAgriRemark")
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
// 7. 根据接口响应提示
|
} else {
|
||||||
const isSuccess = remarkRes.code === 200;
|
this.$modal.msgError('修改失败');
|
||||||
this.$modal[isSuccess ? 'msgSuccess' : 'msgError'](
|
|
||||||
isSuccess ? '修改成功' : '修改失败'
|
|
||||||
);
|
|
||||||
|
|
||||||
// 8. 仅成功时刷新数据(失败时不刷新,避免覆盖现有数据)
|
|
||||||
if (isSuccess) {
|
|
||||||
this.$emit("getRemark")
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 捕获网络异常/接口报错
|
// 捕获网络异常/接口报错
|
||||||
console.error('别名修改失败:', error);
|
console.error('别名修改失败:', error);
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,10 @@ export default {
|
||||||
imei:item.imei,
|
imei:item.imei,
|
||||||
agriName:item.agriName,
|
agriName:item.agriName,
|
||||||
agriId:item.id,
|
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))
|
this.$tab.navigateTo('/pages/home/control/index?agriInfo='+encodeURIComponent(agri))
|
||||||
|
|
|
||||||
|
|
@ -237,23 +237,122 @@ const cfu = {
|
||||||
},
|
},
|
||||||
"line":{
|
"line":{
|
||||||
"type": "line",
|
"type": "line",
|
||||||
"color": color,
|
timing: "easeOut",
|
||||||
"padding": [15,10,0,15],
|
duration: 2000,
|
||||||
"xAxis": {
|
rotate: false,
|
||||||
"disableGrid": true,
|
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": {
|
legend: {
|
||||||
"gridType": "dash",
|
show: true,
|
||||||
"dashLength": 2,
|
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",
|
||||||
|
linearType: "none",
|
||||||
|
onShadow: false,
|
||||||
|
animation: "vertical"
|
||||||
},
|
},
|
||||||
"extra": {
|
tooltip: {
|
||||||
"line": {
|
showBox: true,
|
||||||
"type": "straight",
|
showArrow: true,
|
||||||
"width": 2,
|
showCategory: false,
|
||||||
"activeType": "hollow"
|
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":{
|
"tline":{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue