.
This commit is contained in:
parent
0dc701a196
commit
549b7bf511
@ -70,4 +70,12 @@ export function upgradeValve4G(code, dvId) {
|
||||
url: `/system/dev-ops/upgradeValve4G/${code}/${dvId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 基站升级
|
||||
export function resetStationDevice(code, dvId) {
|
||||
return request({
|
||||
url: `/system/dev-ops/resetStationDevice/${code}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
@ -131,7 +131,7 @@
|
||||
},
|
||||
// 删除
|
||||
removeItem(item) {
|
||||
this.$showConfirm(`删除"${item.groupName}"?`).then(res => {
|
||||
plugins.modal.confirm(`删除"${item.groupName}"?`).then(() => {
|
||||
isApi.removeBatchControl(item.id).then(res => {
|
||||
this.queryList();
|
||||
plugins.modal.msg("删除成功")
|
||||
@ -140,7 +140,7 @@
|
||||
},
|
||||
// 开阀
|
||||
batchControlExec(isMemory, item) {
|
||||
this.$showConfirm("执行批量开阀?").then(res => {
|
||||
plugins.modal.confirm(`执行批量开阀?`).then(() => {
|
||||
this.disabled = true;
|
||||
isApi.batchControlExec(isMemory, item.id).then(res => {
|
||||
this.disabled = false;
|
||||
@ -160,7 +160,7 @@
|
||||
},
|
||||
// 关阀
|
||||
batchControlClose(item) {
|
||||
this.$showConfirm("执行批量关阀?").then(res => {
|
||||
plugins.modal.confirm(`执行批量关阀?`).then(() => {
|
||||
this.disabled = true;
|
||||
isApi.batchControlClose(item.id).then(res => {
|
||||
this.disabled = false;
|
||||
@ -180,7 +180,7 @@
|
||||
},
|
||||
// 角度记忆
|
||||
saveBatchControlAngle(item) {
|
||||
this.$showConfirm("执行角度记忆?").then(res => {
|
||||
plugins.modal.confirm(`执行角度记忆?`).then(() => {
|
||||
this.disabled = true;
|
||||
isApi.saveBatchControlAngle(item.id).then(res => {
|
||||
this.disabled = false;
|
||||
|
@ -662,7 +662,7 @@
|
||||
},
|
||||
// 下发列表
|
||||
sendTopoList(item) {
|
||||
this.$showConfirm("下发列表").then(res => {
|
||||
plugins.modal.confirm(`下发列表`).then(() => {
|
||||
DevOpsApi.gvl(item.deviceCode).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -677,7 +677,7 @@
|
||||
},
|
||||
// 获取配置
|
||||
getStationConfig(item) {
|
||||
this.$showConfirm("获取配置").then(res => {
|
||||
plugins.modal.confirm(`获取配置`).then(() => {
|
||||
DevOpsApi.gsc(item.deviceCode).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -690,6 +690,8 @@
|
||||
// 重启
|
||||
restartStation(item) {
|
||||
console.error("重启:", item);
|
||||
|
||||
|
||||
},
|
||||
// 子设备
|
||||
topoDevice(item) {
|
||||
@ -699,7 +701,7 @@
|
||||
},
|
||||
// 升级
|
||||
upgradeStation(item) {
|
||||
this.$showConfirm(`升级"${item.deviceCode}"到"${item.newVersionName}"版本?`).then(res => {
|
||||
plugins.modal.confirm(`升级"${item.deviceCode}"到"${item.newVersionName}"版本?`).then(() => {
|
||||
DevOpsApi.upgradeStation(item.deviceCode, item.newDeviceVersionId).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -721,7 +723,7 @@
|
||||
// return;
|
||||
// }
|
||||
let msg = `您确定要修改【${this.rolaFrequency.item.deviceCode }】的频段为【${this.rolaFrequency.new}】?`;
|
||||
this.$showConfirm(msg).then(res => {
|
||||
plugins.modal.confirm(msg).then(() => {
|
||||
DevOpsApi.slf({
|
||||
deviceCode: this.rolaFrequency.item.deviceCode,
|
||||
oldFrequency: this.rolaFrequency.old,
|
||||
@ -745,7 +747,7 @@
|
||||
},
|
||||
// 设备升级
|
||||
upgradeValve4(item) {
|
||||
this.$showConfirm(`升级"${item.deviceCode}"到"${item.newVersionName}"版本?`).then(res => {
|
||||
plugins.modal.confirm(`升级"${item.deviceCode}"到"${item.newVersionName}"版本?`).then(() => {
|
||||
DevOpsApi.upgradeValve4G(item.deviceCode, item.newDeviceVersionId).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -805,9 +807,11 @@
|
||||
deviceCode: item.deviceCode,
|
||||
controlValve: item.data.items.m.value == 1 ? 0 : 1
|
||||
};
|
||||
this.$showConfirm(`切换运行模式为"${(m == 1 ? "自动" : "手动" )}"?`).then(res => {
|
||||
plugins.modal.confirm(`切换运行模式为"${(m == 1 ? "自动" : "手动" )}"?`).then(() => {
|
||||
controlHeadSwitch(par).then(res => {
|
||||
item.data.items.m.value = m;
|
||||
}) controlHeadSwitch(par).then(res => {
|
||||
item.data.items.m.value = m;
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
@ -189,7 +189,7 @@
|
||||
},
|
||||
// 下发列表
|
||||
sendList(item) {
|
||||
this.$showConfirm("下发列表").then(res => {
|
||||
plugins.modal.confirm("下发列表").then(() => {
|
||||
DevOpsApi.gvl(item.deviceCode).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -204,7 +204,7 @@
|
||||
},
|
||||
// 获取配置
|
||||
getConfig(item) {
|
||||
this.$showConfirm("获取配置").then(res => {
|
||||
plugins.modal.confirm("获取配置").then(() => {
|
||||
DevOpsApi.gsc(item.deviceCode).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -226,7 +226,7 @@
|
||||
},
|
||||
// 升级
|
||||
upgrade(item) {
|
||||
this.$showConfirm("基站升级").then(res => {
|
||||
plugins.modal.confirm("基站升级").then(() => {
|
||||
DevOpsApi.stationUpgrade(item.deviceCode, item.newDeviceVersionId).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -251,7 +251,7 @@
|
||||
// return;
|
||||
// }
|
||||
let msg = `您确定要修改【${this.rolaFrequency.item.deviceCode }】的频段为【${this.rolaFrequency.new}】?`;
|
||||
this.$showConfirm(msg).then(res => {
|
||||
plugins.modal.confirm(msg).then(() => {
|
||||
DevOpsApi.slf({
|
||||
deviceCode: this.rolaFrequency.item.deviceCode,
|
||||
oldFrequency: this.rolaFrequency.old,
|
||||
|
@ -202,7 +202,7 @@
|
||||
},
|
||||
// 获取配置
|
||||
getConfig(item) {
|
||||
this.$showConfirm("获取配置").then(res => {
|
||||
plugins.modal.confirm("获取配置").then(() => {
|
||||
DevOpsApi.gvc(item.device.deviceCode).then(res => {
|
||||
plugins.modal.msg(res.msg)
|
||||
})
|
||||
@ -224,7 +224,7 @@
|
||||
// return;
|
||||
// }
|
||||
let msg = `您确定要修改【${this.rolaFrequency.item.deviceCode}】的频段为【${this.rolaFrequency.new}】?`;
|
||||
this.$showConfirm(msg).then(res => {
|
||||
plugins.modal.confirm(msg).then(() => {
|
||||
DevOpsApi.vlf({
|
||||
stationCode: this.station.deviceCode,
|
||||
deviceCode: this.rolaFrequency.item.deviceCode,
|
||||
|
@ -699,7 +699,7 @@
|
||||
},
|
||||
//导航
|
||||
mapNavigation() {
|
||||
this.$showConfirm(`导航至"${this.title}"?`).then(res => {
|
||||
plugins.modal.confirm(`导航至"${this.title}"?`).then(() => {
|
||||
const centerPoint = JSON.parse(this.mapObj.landMap.centerPoint);
|
||||
const lat = centerPoint[1]
|
||||
const lng = centerPoint[0]
|
||||
@ -732,7 +732,7 @@
|
||||
plugins.modal.msg("测距已关闭")
|
||||
return;
|
||||
}
|
||||
this.$showConfirm(`开启测距,开启后再次点击关闭。`).then(res => {
|
||||
plugins.modal.confirm(`开启测距,开启后再次点击关闭。`).then(() => {
|
||||
this.mapObj.ranging = true;
|
||||
}).catch(() => {});
|
||||
},
|
||||
@ -772,7 +772,7 @@
|
||||
break;
|
||||
case 'sfj':
|
||||
case 'sb':
|
||||
this.$showConfirm("确定打开首部设备?").then(res => {
|
||||
plugins.modal.confirm("确定打开首部设备?").then(() => {
|
||||
uni.showLoading()
|
||||
getHeadDevice(e.device.deviceId).then((res) => {
|
||||
uni.hideLoading()
|
||||
@ -800,7 +800,7 @@
|
||||
case 'bz':
|
||||
case 'sxt':
|
||||
case 'scd':
|
||||
this.$showConfirm("确定打开农情设备?").then(res => {
|
||||
plugins.modal.confirm("确定打开农情设备?").then(() => {
|
||||
uni.showLoading()
|
||||
getOtherDevice(e.device.deviceId).then((res) => {
|
||||
uni.hideLoading()
|
||||
|
@ -196,14 +196,14 @@
|
||||
},
|
||||
//删除任务
|
||||
delTask(item) {
|
||||
this.$showConfirm(`删除"${item.taskName}"?`).then(() => {
|
||||
plugins.modal.confirm(`删除"${item.taskName}"?`).then(() => {
|
||||
taskApi.delTask(item.id).then(res => {
|
||||
plugins.modal.msg("删除成功")
|
||||
this.reload();
|
||||
}).catch(err => {
|
||||
this.$showConfirm(err, false).then(() => {
|
||||
plugins.modal.confirm(err, false).then(() => {
|
||||
this.reload();
|
||||
})
|
||||
}).catch(() => {});
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
@ -236,14 +236,14 @@
|
||||
//方案删除
|
||||
updateScenario(item, disabled) {
|
||||
if (disabled) {
|
||||
this.$showConfirm(`禁用"${item.scenarioName}"?`).then(() => {
|
||||
plugins.modal.confirm(`禁用"${item.scenarioName}"?`).then(() => {
|
||||
isApi.disabled(item.id).then(res => {
|
||||
plugins.modal.msg("禁用成功")
|
||||
this.reload();
|
||||
})
|
||||
}).catch(() => {});
|
||||
} else {
|
||||
this.$showConfirm(`启用"${item.scenarioName}"?`).then(() => {
|
||||
plugins.modal.confirm(`启用"${item.scenarioName}"?`).then(() => {
|
||||
isApi.enable(item.id).then(res => {
|
||||
plugins.modal.msg("启用成功")
|
||||
this.reload();
|
||||
|
@ -342,7 +342,7 @@
|
||||
// 选中数据
|
||||
itemChange(wo, vItem) {
|
||||
if (this.selected[`${wo.id}_${vItem.valveNo}`]) {
|
||||
this.$showConfirm("更换到当前轮灌组?").then(res => {
|
||||
plugins.modal.confirm("更换到当前轮灌组?").then(() => {
|
||||
//删除之前存储的组中的数据
|
||||
this.removeWo(this.selected[`${wo.id}_${vItem.valveNo}`].gIndex, wo.id, vItem.valveNo);
|
||||
delete this.selected[`${wo.id}_${vItem.valveNo}`];
|
||||
@ -488,7 +488,7 @@
|
||||
removeGroup(index) {
|
||||
this.groupPop = false;
|
||||
const groupName = this.formData.groups[index].groupName;
|
||||
this.$showConfirm(`删除"${groupName}"?`).then(res => {
|
||||
plugins.modal.confirm(`删除"${groupName}"?`).then(() => {
|
||||
//删除轮灌组
|
||||
this.formData.groups[index]._isHide = true;
|
||||
let i = 0;
|
||||
@ -558,7 +558,7 @@
|
||||
_item.sort = (_index + 1)
|
||||
})
|
||||
})
|
||||
this.$showConfirm("保存轮灌方案?").then(res => {
|
||||
plugins.modal.confirm("保存轮灌方案?").then(() => {
|
||||
uni.showLoading();
|
||||
isApi.saveIrrigateScenario(formData).then(res => {
|
||||
uni.hideLoading();
|
||||
|
@ -106,7 +106,7 @@
|
||||
title = "暂停执行?"
|
||||
break;
|
||||
}
|
||||
this.$showConfirm(title).then(() => {
|
||||
plugins.modal.confirm(title).then(() => {
|
||||
taskApi.updateTask({
|
||||
id: this.task.id,
|
||||
status: status
|
||||
@ -114,9 +114,9 @@
|
||||
plugins.modal.msg("删除成功")
|
||||
this.loadData();
|
||||
}).catch(err => {
|
||||
this.$showConfirm(err, false).then(() => {
|
||||
plugins.modal.confirm(err, false).then(() => {
|
||||
this.loadData();
|
||||
})
|
||||
}).catch(() => {});
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
@ -268,7 +268,7 @@
|
||||
confirm() {
|
||||
this.$refs.formRef.validate().then(valid => {
|
||||
if (valid) {
|
||||
this.$showConfirm("立即执行?").then(() => {
|
||||
plugins.modal.confirm("立即执行?").then(() => {
|
||||
taskApi.addTask(this.formData).then(res => {
|
||||
uni.navigateBack();
|
||||
});
|
||||
|
@ -41,13 +41,14 @@ export default {
|
||||
})
|
||||
},
|
||||
// 确认窗体
|
||||
confirm(text) {
|
||||
confirm(text, showCancel = true) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showModal({
|
||||
title: '系统提示',
|
||||
content: text,
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
showCancel: showCancel,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
resolve(res.confirm)
|
||||
|
Loading…
Reference in New Issue
Block a user