.
This commit is contained in:
parent
d4ec07e7fc
commit
4b654899d1
18
api/dev-ops/deviceConfig.js
Normal file
18
api/dev-ops/deviceConfig.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取配置信息
|
||||||
|
export function getConfig(deviceCode) {
|
||||||
|
return request({
|
||||||
|
url: `/system/dev-ops/getConfig/${deviceCode}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置配置信息
|
||||||
|
export function setConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dev-ops/setConfig',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
@ -513,6 +513,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import plugins from "@/plugins";
|
import plugins from "@/plugins";
|
||||||
import * as DevOpsApi from "@/api/dev-ops/index.js"
|
import * as DevOpsApi from "@/api/dev-ops/index.js"
|
||||||
|
import * as deviceConfig from "@/api/dev-ops/deviceConfig.js"
|
||||||
import {
|
import {
|
||||||
controlHeadSwitch
|
controlHeadSwitch
|
||||||
} from "@/api/controlHeadInterface.js"
|
} from "@/api/controlHeadInterface.js"
|
||||||
@ -766,19 +767,33 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/************************************************** 墒情 **************************************************/
|
/************************************************** 气象站 **************************************************/
|
||||||
qxzSetConfig(item) {
|
qxzSetConfig(item) {
|
||||||
|
console.error("item:", item);
|
||||||
this.$refs.qxzRef.show();
|
this.$refs.qxzRef.show();
|
||||||
this.qxz.item = item;
|
deviceConfig.getConfig(item.deviceCode).then(res => {
|
||||||
this.qxz.intervalTime = item?.intervalTime || 10;
|
console.error("res:", res);
|
||||||
|
if (res.data) {
|
||||||
|
this.qxz = res.data.data;
|
||||||
|
this.qxz.item = item;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
qxzConfigHandler(e) {
|
qxzConfigHandler(e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
this.qxz.item.intervalTime = this.qxz.intervalTime;
|
const data = {
|
||||||
|
key: this.qxz.item.deviceCode,
|
||||||
|
data: {
|
||||||
|
intervalTime: this.qxz.intervalTime
|
||||||
|
},
|
||||||
|
};
|
||||||
|
deviceConfig.setConfig(data).then(res => {
|
||||||
|
plugins.modal.msg("配置成功")
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/************************************************** 墒情 **************************************************/
|
/************************************************** 虫情 **************************************************/
|
||||||
cqRunModel(item) {
|
cqRunModel(item) {
|
||||||
if (!item.data || !item.data.items.m || item.data.items.m.value == "offline") {
|
if (!item.data || !item.data.items.m || item.data.items.m.value == "offline") {
|
||||||
plugins.modal.msg("设备离线,不能操作!")
|
plugins.modal.msg("设备离线,不能操作!")
|
||||||
|
Loading…
Reference in New Issue
Block a user