.
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>
|
||||
import plugins from "@/plugins";
|
||||
import * as DevOpsApi from "@/api/dev-ops/index.js"
|
||||
import * as deviceConfig from "@/api/dev-ops/deviceConfig.js"
|
||||
import {
|
||||
controlHeadSwitch
|
||||
} from "@/api/controlHeadInterface.js"
|
||||
@ -766,19 +767,33 @@
|
||||
});
|
||||
},
|
||||
|
||||
/************************************************** 墒情 **************************************************/
|
||||
/************************************************** 气象站 **************************************************/
|
||||
qxzSetConfig(item) {
|
||||
console.error("item:", item);
|
||||
this.$refs.qxzRef.show();
|
||||
this.qxz.item = item;
|
||||
this.qxz.intervalTime = item?.intervalTime || 10;
|
||||
deviceConfig.getConfig(item.deviceCode).then(res => {
|
||||
console.error("res:", res);
|
||||
if (res.data) {
|
||||
this.qxz = res.data.data;
|
||||
this.qxz.item = item;
|
||||
}
|
||||
});
|
||||
},
|
||||
qxzConfigHandler(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) {
|
||||
if (!item.data || !item.data.items.m || item.data.items.m.value == "offline") {
|
||||
plugins.modal.msg("设备离线,不能操作!")
|
||||
|
Loading…
Reference in New Issue
Block a user