舞台接口更新
This commit is contained in:
@@ -1,27 +1,38 @@
|
||||
package org.nl.acs.monitor.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.monitor.service.DeviceStageMonitorService;
|
||||
import org.nl.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Description: 设备信息
|
||||
* @Date: 2022-08-17
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "设备信息")
|
||||
@RequestMapping("/api/deviceInfo")
|
||||
public class DeviceStageMonitorController {
|
||||
|
||||
private final DeviceStageMonitorService deviceStageMonitorService;
|
||||
|
||||
|
||||
// @PostMapping("/getDeviceByCodes")
|
||||
// @Log("获取舞台设备信息")
|
||||
// @ApiOperation("获取舞台设备信息")
|
||||
// public ResponseEntity<Object> getDeviceByCodes(@RequestBody String json) throws Exception{
|
||||
// JSONArray jsonArray = JSONArray.parseArray(json);
|
||||
// return new ResponseEntity<>(stageService.getDeviceByCodes(jsonArray), HttpStatus.OK);
|
||||
// }
|
||||
@Log("获取舞台设备信息")
|
||||
@ApiOperation("获取舞台设备信息")
|
||||
@PostMapping("/getDeviceByCodes")
|
||||
public ResponseEntity<Object> getDeviceByCodes(@RequestBody String json) {
|
||||
JSONArray jsonArray = JSONArray.parseArray(json);
|
||||
return new ResponseEntity<>(deviceStageMonitorService.getData(jsonArray), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
9
acs/qd/src/api/acs/monitor/deviceStageMonitor.js
Normal file
9
acs/qd/src/api/acs/monitor/deviceStageMonitor.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getDeviceByCodes(data) { // 获取舞台上设备信息
|
||||
return request({
|
||||
url: 'api/deviceInfo/getDeviceByCodes',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -121,6 +121,7 @@
|
||||
import crudStage from '@/api/logicflow/stage'
|
||||
import paramCrud from '@/api/system/param'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import { getDeviceByCodes } from '@/api/acs/monitor/deviceStageMonitor'
|
||||
import '@logicflow/core/dist/style/index.css'
|
||||
import '@logicflow/extension/lib/style/index.css'
|
||||
|
||||
@@ -469,7 +470,7 @@ export default {
|
||||
initStatus() { // 初始化所有节点的设备信息,通过节点id对应设备编号
|
||||
let resion = {}
|
||||
resion = lf.getGraphData().nodes.map(item => ({ id: item.id, device_code: item.properties.device }))
|
||||
crudStage.getDeviceByCodes(resion).then(res => {
|
||||
getDeviceByCodes(resion).then(res => {
|
||||
this.allDeviceMsg = res // 拿到所有节点的设备数据
|
||||
console.log('initStatus-res', res)
|
||||
for (var item of res) { // 循环并且设置属性值
|
||||
|
||||
Reference in New Issue
Block a user