Merge remote-tracking branch 'origin/master'

dev
Wen JY 1 year ago
commit 656c9b47a3

@ -1,3 +1,70 @@
GET http://localhost:9601/monitorPlatform/monitorPercentage
<> 2023-09-13T042534.200.json
###
GET http://localhost:9601/monitorPlatform/monitorPercentage
<> 2023-09-13T041522.200.json
###
GET http://localhost:9601/monitorPlatform/monitorUnitPercentage
<> 2023-09-13T041504.200.json
###
GET http://localhost:9601/monitorPlatform/monitorUnitPercentage
<> 2023-09-13T035712.200.json
###
POST http://localhost:9601/monitorPlatform/selectDeviceByDeviceModeByMonitorUnitId
{21321321}:
<> 2023-09-13T035612.400.html
###
GET http://localhost:9601/monitorPlatform/monitorUnitPercentage
<> 2023-09-13T035551.200.json
###
GET http://localhost:9601/monitorPlatform/monitorUnitPercentage
<> 2023-09-13T035541.200.json
###
POST http://localhost:9601/monitorPlatform/treeList
<> 2023-09-13T035533.200.json
###
GET http://localhost:9601/tenant/list
<> 2023-09-11T045735.200.json
###
GET http://localhost:9601/monitorUnit/alarmStats
<> 2023-09-11T045659.200.json
###
POST http://localhost:9601/monitorUnit/SelectSecne
<> 2023-09-11T045623.200.json
###
POST http://localhost/monitorUnit/getDeviceOperations
}
@ -994,333 +1061,3 @@ Accept-Encoding: br,deflate,gzip,x-gzip
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_4",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 0
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693589999996
}
]
}
<> 2023-09-05T142413.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_4",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 1
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693589999906
}
]
}
<> 2023-09-05T142405.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_4",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 1
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693389999906
}
]
}
<> 2023-09-05T142353.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_3",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 1
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693579949106
}
]
}
<> 2023-09-05T142336.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_3",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 0
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693379949106
}
]
}
<> 2023-09-05T142320.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_3",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 0
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693279949106
}
]
}
<> 2023-09-05T142305.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_2",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 0
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693376368166
}
]
}
<> 2023-09-05T142258.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_2",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 1
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693276368166
}
]
}
<> 2023-09-05T142242.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_2",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 1
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693176368166
}
]
}
<> 2023-09-05T142237.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_2",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 1
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693176268166
}
]
}
<> 2023-09-05T142233.200.json
###
POST http://localhost:9602/tdengine/insertTable
Content-Type: application/json
Content-Length: 293
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8)
Accept-Encoding: br,deflate,gzip,x-gzip
{
"databaseName": "db_scene_1",
"tableName": "t_ds_2",
"schemaFields": [
{
"fieldName": "onlineStatus",
"fieldValue": 0
},
{
"fieldName": "deviceType",
"fieldValue": 1
},
{
"fieldName": "ts",
"fieldValue": 1693176168166
}
]
}
<> 2023-09-05T142218.200.json
###

@ -1,9 +1,224 @@
package com.ruoyi.business.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.business.domain.HwScene;
import com.ruoyi.business.domain.VO.*;
import com.ruoyi.business.mapper.HwSceneMapper;
import com.ruoyi.business.service.IHwDeviceService;
import com.ruoyi.business.service.IHwElectronicFenceService;
import com.ruoyi.business.service.IHwSceneService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.business.domain.HwMonitorUnit;
import com.ruoyi.business.service.IHwMonitorUnitService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
import static com.ruoyi.common.core.utils.PageUtils.startPage;
@RestController
@RequestMapping("/monitorPlatform")
public class HwMonitorPlatformController {
public class HwMonitorPlatformController extends BaseController {
@Autowired
private IHwMonitorUnitService hwMonitorUnitService;
@Autowired
private IHwDeviceService hwDeviceService;
@Autowired
private IHwSceneService hwSceneService;
@Autowired
private IHwElectronicFenceService hwElectronicFenceService;
/**
*
* @param hwMonitorUnits
* @return list
* @throws
* */
@PostMapping("/treeList")
public TableDataInfo treeList(List<HwMonitorUnit> hwMonitorUnits){
List<HwMonitorUnit> list = hwMonitorUnitService.selectTreeList(hwMonitorUnits);
return getDataTable(list);
}
// /**
// *
// * 选择场景
// * @param sceneModeId 场景id
// * @return
// */
//
// @PostMapping("/selectHwSceneBySceneModeId")
// public TableDataInfo selectHwSceneBySceneModeId(Long sceneModeId){
// List<HwScene> hwScenes = hwSceneService.selectHwSceneBySceneModeId(sceneModeId);
// return getDataTable(hwScenes);
// }
/**
* 3.
* */
@GetMapping("/monitorUnitPercentage")
public TableDataInfo monitorUnitPercentage(){
List<DeviceModeVo> maps = hwDeviceService.selectDeviceModeNameVo();
return getDataTable(maps);
}
//
/**
*
* @param monitorUnitId id
* */
@PostMapping("/selectDeviceByDeviceModeByMonitorUnitId")
public Map<String, Map<String, Object>> selectDeviceByDeviceModeByMonitorUnitId(Long monitorUnitId){
startPage();
Map<String, Map<String, Object>> maps = hwDeviceService.selectDeviceByDeviceModeByMonitorUnitId(monitorUnitId);
return maps;
}
/**
*
* @param monitorUnitId id
*/
@PostMapping("/selectDeviceModeFunctionByFunctionType")
public Map<String, Map<String, Object>> selectDeviceModeFunctionByFunctionType(Long monitorUnitId){
startPage();
Map<String, Map<String, Object>> maps = hwDeviceService.selectDeviceModeFunctionByFunctionType(monitorUnitId);
return maps;
}
//
/**
*
* @param deviceId id
* */
@PostMapping("/getHistoryData")
public TableDataInfo getHistoryData(Long deviceId){
startPage();
List<Map<String, Object>> historyData = hwDeviceService.getHistoryData(deviceId);
return getDataTable(historyData);
}
/**
*
* */
@GetMapping("/monitorPercentage")
public TableDataInfo monitorPercentage(){
List<HwMonitorUnitVo> maps = hwMonitorUnitService.selectMonitorPercentage();
return getDataTable(maps);
}
/**
*
* */
@GetMapping("/allNums")
public AllNumsVo allNums(){
AllNumsVo allNumsVos = hwMonitorUnitService.selectAllNums();
return allNumsVos;
}
/**
*
* */
@GetMapping("/sceneAllNums")
public TableDataInfo sceneAllNums(){
List<AllNumsVo> allNumsVos = hwMonitorUnitService.selectSenceAllNums();
return getDataTable(allNumsVos);
}
/**
*
* */
@PostMapping("/limitSubMonitorUnit")
public TableDataInfo limitSubMonitorUnit(){
startPage();
List<HwMonitorUnit> hwMonitorUnits = hwMonitorUnitService.selectLimitSubMonitorUnit();
return getDataTable(hwMonitorUnits);
}
/**
*
*/
@GetMapping("/alarmStats")
public TableDataInfo alarmStats(){
List<AlarmStatsVo> alarmStatsVos = hwMonitorUnitService.selectAlarmStats();
return getDataTable(alarmStatsVos);
}
/**
* 线
* @param sceneId id
* */
@PostMapping("/SubDevice")
public SubDeviceSumVo subDevice(Long sceneId){
SubDeviceSumVo subDeviceSumVos = hwMonitorUnitService.selectSubDeviceSum(sceneId);
return subDeviceSumVos;
}
/**
*
* @param sceneId
* */
@PostMapping("/ElectronicNumVo")
public TableDataInfo ElectronicNumVo(Long sceneId){
List<EleMonitorDeviceSumVo> eleMonitorDeviceSumVos = hwElectronicFenceService.selectEleTypeNums(sceneId);
return getDataTable(eleMonitorDeviceSumVos);
}
/**
*
* @param monitorUnitId
* */
@PostMapping("/selectMonitorUnitSub")
//ok
public HwMonitorUnit selectMonitorUnitSub(Long monitorUnitId){
HwMonitorUnit hwMonitorUnits = hwMonitorUnitService.selectHwMonitorUnitByMonitorUnitId(monitorUnitId);
return hwMonitorUnits;
}
/**
* 2. 线
* @param beginTime
* @param endTime
* @param sceneId id
* */
@PostMapping("/getDeviceOperations")
public Integer selectTdengine(String beginTime,String endTime,Long sceneId){
int ints = hwMonitorUnitService.selectTdengine(beginTime,endTime,sceneId);
return ints;
}
/**
*
* */
@PostMapping("/selectLatestDataByTags")
public TableDataInfo selectLatestDataByTags(Long monitorUnitId){
List<Map<String, Object>> list= hwMonitorUnitService.selectLatestDataByTags(monitorUnitId);
return getDataTable(list);
}
/**
*
* id=0 id
*
* */
@PostMapping("/SelectSecne")
public TableDataInfo SelectSecneByUser(){
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getSysUser();
Long tenantId = sysUser.getTenantId();
List<HwScene> hwScenes = hwSceneService.selectHwSceneByTenantId(tenantId);
hwScenes.get(0).setDefaultFlag("1");
return getDataTable(hwScenes);
}
}

@ -13,6 +13,9 @@ import com.ruoyi.business.service.IHwDeviceService;
import com.ruoyi.business.service.IHwElectronicFenceService;
import com.ruoyi.business.service.IHwSceneService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -64,163 +67,8 @@ public class HwMonitorUnitController extends BaseController
List<HwMonitorUnit> list = hwMonitorUnitService.selectHwMonitorUnitList(hwMonitorUnit);
return getDataTable(list);
}
/**
*
* @param hwMonitorUnits
* @return list
* @throws
* */
@PostMapping("/treeList")
public TableDataInfo treeList(List<HwMonitorUnit> hwMonitorUnits){
List<HwMonitorUnit> list = hwMonitorUnitService.selectTreeList(hwMonitorUnits);
return getDataTable(list);
}
// /**
// *
// * 选择场景
// * @param sceneModeId 场景id
// * @return
// */
//
// @PostMapping("/selectHwSceneBySceneModeId")
// public TableDataInfo selectHwSceneBySceneModeId(Long sceneModeId){
// List<HwScene> hwScenes = hwSceneService.selectHwSceneBySceneModeId(sceneModeId);
// return getDataTable(hwScenes);
// }
/**
* 3.
* */
@GetMapping("/monitorUnitPercentage")
public TableDataInfo monitorUnitPercentage(){
List<DeviceModeVo> maps = hwDeviceService.selectDeviceModeNameVo();
return getDataTable(maps);
}
//
/**
*
* @param monitorUnitId id
* */
@PostMapping("/selectDeviceByDeviceModeByMonitorUnitId")
public Map<String, Map<String, Object>> selectDeviceByDeviceModeByMonitorUnitId(Long monitorUnitId){
startPage();
Map<String, Map<String, Object>> maps = hwDeviceService.selectDeviceByDeviceModeByMonitorUnitId(monitorUnitId);
return maps;
}
/**
*
* @param monitorUnitId id
*/
@PostMapping("/selectDeviceModeFunctionByFunctionType")
public Map<String, Map<String, Object>> selectDeviceModeFunctionByFunctionType(Long monitorUnitId){
startPage();
Map<String, Map<String, Object>> maps = hwDeviceService.selectDeviceModeFunctionByFunctionType(monitorUnitId);
return maps;
}
//
/**
*
* @param deviceId id
* */
@PostMapping("/getHistoryData")
public TableDataInfo getHistoryData(Long deviceId){
startPage();
List<Map<String, Object>> historyData = hwDeviceService.getHistoryData(deviceId);
return getDataTable(historyData);
}
/**
*
* */
@GetMapping("/monitorPercentage")
public TableDataInfo monitorPercentage(){
List<HwMonitorUnitVo> maps = hwMonitorUnitService.selectMonitorPercentage();
return getDataTable(maps);
}
/**
*
* */
@GetMapping("/allNums")
public AllNumsVo allNums(){
AllNumsVo allNumsVos = hwMonitorUnitService.selectAllNums();
return allNumsVos;
}
/**
*
* */
@GetMapping("/sceneAllNums")
public TableDataInfo sceneAllNums(){
List<AllNumsVo> allNumsVos = hwMonitorUnitService.selectSenceAllNums();
return getDataTable(allNumsVos);
}
/**
*
* */
@PostMapping("/limitSubMonitorUnit")
public TableDataInfo limitSubMonitorUnit(){
startPage();
List<HwMonitorUnit> hwMonitorUnits = hwMonitorUnitService.selectLimitSubMonitorUnit();
return getDataTable(hwMonitorUnits);
}
/**
*
*/
@GetMapping("/alarmStats")
public TableDataInfo alarmStats(){
List<AlarmStatsVo> alarmStatsVos = hwMonitorUnitService.selectAlarmStats();
return getDataTable(alarmStatsVos);
}
/**
* 线
* @param sceneId id
* */
@PostMapping("/SubDevice")
public SubDeviceSumVo subDevice(Long sceneId){
SubDeviceSumVo subDeviceSumVos = hwMonitorUnitService.selectSubDeviceSum(sceneId);
return subDeviceSumVos;
}
/**
*
* @param sceneId
* */
@PostMapping("/ElectronicNumVo")
public TableDataInfo ElectronicNumVo(Long sceneId){
List<EleMonitorDeviceSumVo> eleMonitorDeviceSumVos = hwElectronicFenceService.selectEleTypeNums(sceneId);
return getDataTable(eleMonitorDeviceSumVos);
}
/**
*
* @param monitorUnitId
* */
@PostMapping("/selectMonitorUnitSub")
//ok
public HwMonitorUnit selectMonitorUnitSub(Long monitorUnitId){
HwMonitorUnit hwMonitorUnits = hwMonitorUnitService.selectHwMonitorUnitByMonitorUnitId(monitorUnitId);
return hwMonitorUnits;
}
/**
* 2. 线
* @param beginTime
* @param endTime
* @param sceneId id
* */
@PostMapping("/getDeviceOperations")
public Integer selectTdengine(String beginTime,String endTime,Long sceneId){
int ints = hwMonitorUnitService.selectTdengine(beginTime,endTime,sceneId);
return ints;
}
/**
* tde
* */
// @PostMapping("/selectLatestDataByTags")
// public TableDataInfo selectLatestDataByTags(Long monitorUnitId){
// List<Map<String, Object>> list= hwMonitorUnitService.selectLatestDataByTags(monitorUnitId);
// return getDataTable(list);
// }
/**
*
*/

@ -1,13 +1,21 @@
package com.ruoyi.business.controller;
import java.math.BigDecimal;
import java.util.List;
import java.io.IOException;
import java.util.Locale;
import java.util.UUID;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.business.domain.HwSceneMode;
import com.ruoyi.business.domain.VO.HwSceneVo;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.i18n.utils.MessageUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.validation.annotation.Validated;
@ -51,10 +59,10 @@ public class HwSceneController extends BaseController
*/
@RequiresPermissions("business:scene:list")
@GetMapping("/list")
public TableDataInfo list(HwScene hwScene)
public TableDataInfo list(HwSceneVo hwScene)
{
startPage();
List<HwScene> list = hwSceneService.selectHwSceneList(hwScene);
List<HwSceneVo> list = hwSceneService.selectHwSceneList2(hwScene);
return getDataTable(list);
}
@ -88,8 +96,10 @@ public class HwSceneController extends BaseController
@RequiresPermissions("business:scene:add")
@Log(title = "场景信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody @Validated HwScene hwScene)
public AjaxResult add(@RequestBody HwScene hwScene)
{
// System.out.println(hwScene);
return toAjax(hwSceneService.insertHwScene(hwScene));
}
@ -101,6 +111,9 @@ public class HwSceneController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody HwScene hwScene)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getSysUser();
hwScene.setUpdateBy(sysUser.getNickName());
return toAjax(hwSceneService.updateHwScene(hwScene));
}
@ -114,4 +127,20 @@ public class HwSceneController extends BaseController
{
return toAjax(hwSceneService.deleteHwSceneBySceneIds(sceneIds));
}
@GetMapping("/isAdmin")
public Boolean isAdmin(){
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getSysUser();
// System.out.println(sysUser.getUserName());
if (sysUser.getUserName().equals("admin")){
// System.out.println("true");
return true;
}else {
return false;
}
}
}

@ -1,8 +1,13 @@
package com.ruoyi.business.controller;
import java.util.ArrayList;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -42,8 +47,11 @@ public class HwTenantController extends BaseController
@GetMapping("/list")
public TableDataInfo list(HwTenant hwTenant)
{
List<HwTenant> list = new ArrayList<HwTenant>();
startPage();
List<HwTenant> list = hwTenantService.selectHwTenantList(hwTenant);
//todo 放到add中
list = hwTenantService.selectHwTenantList(hwTenant);
return getDataTable(list);
}
@ -78,6 +86,10 @@ public class HwTenantController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody HwTenant hwTenant)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getSysUser();
hwTenant.setIsRegister("0");
hwTenant.setCreateBy(sysUser.getNickName());
return toAjax(hwTenantService.insertHwTenant(hwTenant));
}
@ -88,7 +100,10 @@ public class HwTenantController extends BaseController
@Log(title = "租户信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HwTenant hwTenant)
{
{LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getSysUser();
hwTenant.setUpdateBy(sysUser.getNickName());
return toAjax(hwTenantService.updateHwTenant(hwTenant));
}

@ -8,7 +8,8 @@ package com.ruoyi.business.domain.VO;
*/
public class DeviceModeVo {
public String monitorUnitTypeName;
// public String monitorUnitTypeName;
public String deviceModeName;
public Integer sum;
@ -20,16 +21,12 @@ public class DeviceModeVo {
return percentage;
}
public void setPercentage(Double percentage) {
this.percentage = percentage;
}
public String getMonitorUnitTypeName() {
return monitorUnitTypeName;
public String getDeviceModeName() {
return deviceModeName;
}
public void setMonitorUnitTypeName(String monitorUnitTypeName) {
this.monitorUnitTypeName = monitorUnitTypeName;
public void setDeviceModeName(String deviceModeName) {
this.deviceModeName = deviceModeName;
}
public Integer getSum() {
@ -48,12 +45,17 @@ public class DeviceModeVo {
this.err = err;
}
public void setPercentage(Double percentage) {
this.percentage = percentage;
}
@Override
public String toString() {
return "HwMonitorUnitTypeVo{" +
"monitorUnitTypeName='" + monitorUnitTypeName + '\'' +
return "DeviceModeVo{" +
", deviceModeName='" + deviceModeName + '\'' +
", sum=" + sum +
", err=" + err +
", percentage=" + percentage +
'}';
}
}

@ -2,6 +2,7 @@ package com.ruoyi.business.mapper;
import java.util.List;
import com.ruoyi.business.domain.HwScene;
import com.ruoyi.business.domain.VO.HwSceneVo;
/**
* Mapper
@ -19,6 +20,8 @@ public interface HwSceneMapper
*/
public HwScene selectHwSceneBySceneId(Long sceneId);
public List<HwScene> selectHwSceneBySceneModeId(Long sceneModeId);
public List<HwScene> selectHwSceneByTenantId0(Long tenantId);
public List<HwScene> selectHwSceneByTenantIdNot0(Long tenantId);
/**
@ -28,6 +31,9 @@ public interface HwSceneMapper
* @return
*/
public List<HwScene> selectHwSceneList(HwScene hwScene);
List<HwSceneVo> selectHwSceneVoList(HwSceneVo hwScene);
void updateDefaultFlag(Long tenantId);
/**
*

@ -19,6 +19,8 @@ public interface HwTenantMapper
*/
public HwTenant selectHwTenantByTenantId(Long tenantId);
/**
*
*

@ -73,10 +73,10 @@ public interface IHwMonitorUnitService
* @return*/
public int selectTdengine(String beginTime,String endTime,Long sceneId);
/**
* tde
*
*
* @return*/
// public List<Map<String, Object>> selectLatestDataByTags(Long monitorUnitId);
public List<Map<String, Object>> selectLatestDataByTags(Long monitorUnitId);
/**

@ -2,6 +2,7 @@ package com.ruoyi.business.service;
import java.util.List;
import com.ruoyi.business.domain.HwScene;
import com.ruoyi.business.domain.VO.HwSceneVo;
/**
* Service
@ -19,8 +20,11 @@ public interface IHwSceneService
*/
public HwScene selectHwSceneBySceneId(Long sceneId);
//选择场景
public List<HwScene> selectHwSceneBySceneModeId(Long sceneModeId);
//场景选择
List<HwScene> selectHwSceneByTenantId(Long tenantId);
/**
*
*
@ -28,6 +32,8 @@ public interface IHwSceneService
* @return
*/
public List<HwScene> selectHwSceneList(HwScene hwScene);
public List<HwSceneVo> selectHwSceneList2(HwSceneVo hwScene);
/**
*

@ -81,7 +81,7 @@ public class HwDeviceServiceImpl implements IHwDeviceService
}
}
DeviceModeVo hwMonitorUnitTypeVo = new DeviceModeVo();
hwMonitorUnitTypeVo.setMonitorUnitTypeName("其他");
hwMonitorUnitTypeVo.setDeviceModeName("其他");
hwMonitorUnitTypeVo.setSum(value);
Integer sums = 0;
for (int i = 0; i < list.size();i++){

@ -229,20 +229,20 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService
//网关子设备数+非网关设备数getDeviceType()=1
}
// @Override
// public List<Map<String, Object>> selectLatestDataByTags(Long monitorUnitId) {
// List<Map<String, Object>> latestData = new ArrayList<Map<String, Object>>;
// List<HwDevice> hwDevices = hwDeviceMapper.selectDeviceByMonitorId(monitorUnitId);
// TdSelectDto tdSelectDto = new TdSelectDto();
// for (int i = 0; i < hwDevices.size(); i++){
// tdSelectDto.setDatabaseName(TdEngineConstants.PLATFORM_DB_NAME);
// tdSelectDto.settableName(TdEngineConstants.getDeviceDataTableName(hwDevices.get(i).getDeviceId());
// tdSelectDto.settagsName(monitorUnitId);
// tdSelectDto.set
// latestData = (List<Map<String, Object>>) remoteTdEgineService.getLatestData(tdSelectDto);
// }
// return latestData;
// }
@Override
public List<Map<String, Object>> selectLatestDataByTags(Long monitorUnitId) {
List<Map<String, Object>> latestData = new ArrayList<Map<String, Object>>();
List<HwDevice> hwDevices = hwDeviceMapper.selectDeviceByMonitorId(monitorUnitId);
TdSelectDto tdSelectDto = new TdSelectDto();
for (int i = 0; i < hwDevices.size(); i++){
tdSelectDto.setDatabaseName(TdEngineConstants.PLATFORM_DB_NAME);
tdSelectDto.setTableName(TdEngineConstants.getDeviceDataTableName(hwDevices.get(i).getDeviceId()));
tdSelectDto.setTagsName(hwDevices.get(i).getDeviceCode());
latestData = (List<Map<String, Object>>) remoteTdEgineService.getLatestDataByTags(tdSelectDto);
}
return latestData;
}
//todo SysDeptServiceImpl类中的递归方法recursionFn(以实现)
@Override

@ -1,7 +1,18 @@
package com.ruoyi.business.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.ruoyi.business.domain.HwSceneMode;
import com.ruoyi.business.domain.VO.HwSceneVo;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.HwSceneMapper;
@ -19,6 +30,9 @@ public class HwSceneServiceImpl implements IHwSceneService
{
@Autowired
private HwSceneMapper hwSceneMapper;
@Autowired
private RedisService redisService;
/**
*
@ -39,6 +53,15 @@ public class HwSceneServiceImpl implements IHwSceneService
return hwScenes;
}
@Override
public List<HwScene> selectHwSceneByTenantId(Long tenantId) {
if (tenantId == 0){
return hwSceneMapper.selectHwSceneByTenantId0(tenantId);
}
else
return hwSceneMapper.selectHwSceneByTenantIdNot0(tenantId);
}
/**
@ -53,6 +76,12 @@ public class HwSceneServiceImpl implements IHwSceneService
return hwSceneMapper.selectHwSceneList(hwScene);
}
@Override
public List<HwSceneVo> selectHwSceneList2(HwSceneVo hwScene) {
return hwSceneMapper.selectHwSceneVoList(hwScene);
}
/**
*
*
@ -62,7 +91,32 @@ public class HwSceneServiceImpl implements IHwSceneService
@Override
public int insertHwScene(HwScene hwScene)
{
if(hwScene.getDefaultFlag() == "1"){
hwSceneMapper.updateDefaultFlag(hwScene.getTenantId());
}
hwScene.setDefaultFlag("1");
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getSysUser();
hwScene.setSceneStatus("1");
Long lon = new Long(10);
hwScene.setSceneId(lon);
hwScene.setCreateBy(sysUser.getNickName());
if (hwScene.getPreserveTime()==null){
hwScene.setPreserveTime(new BigDecimal(90));
}
if (hwScene.getTestPreserveTime()==null){
hwScene.setTestPreserveTime(new BigDecimal(30));
}
String randomKey = RandomStringUtils.random(12, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789");
String randomSecret = RandomStringUtils.random(16,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789");
hwScene.setModeKey(randomKey);
hwScene.setModeSecret(randomSecret);
hwScene.setCreateTime(DateUtils.getNowDate());
List<HwScene> list = new ArrayList<HwScene>();
list.add(hwScene);
redisService.setCacheList(hwScene.getSceneId()+"",list);
return hwSceneMapper.insertHwScene(hwScene);
}
@ -75,7 +129,14 @@ public class HwSceneServiceImpl implements IHwSceneService
@Override
public int updateHwScene(HwScene hwScene)
{
if(hwScene.getDefaultFlag() == "1"){
hwSceneMapper.updateDefaultFlag(hwScene.getTenantId());
}
hwScene.setDefaultFlag("1");
hwScene.setUpdateTime(DateUtils.getNowDate());
List<HwScene> list = new ArrayList<HwScene>();
list.add(hwScene);
redisService.setCacheList(hwScene.getSceneId()+"",list);
return hwSceneMapper.updateHwScene(hwScene);
}
@ -88,6 +149,11 @@ public class HwSceneServiceImpl implements IHwSceneService
@Override
public int deleteHwSceneBySceneIds(Long[] sceneIds)
{
List<Long> list = new ArrayList<>();
for (int i = 0; i < sceneIds.length;i++){
list.add(sceneIds[i]);
}
redisService.deleteObject(sceneIds+"");
return hwSceneMapper.deleteHwSceneBySceneIds(sceneIds);
}
@ -100,6 +166,7 @@ public class HwSceneServiceImpl implements IHwSceneService
@Override
public int deleteHwSceneBySceneId(Long sceneId)
{
redisService.deleteObject(sceneId+"");
return hwSceneMapper.deleteHwSceneBySceneId(sceneId);
}
}

@ -26,11 +26,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="sceneEnvironment" column="scene_environment" />
<result property="sceneField" column="scene_field" />
</resultMap>
<resultMap type="HwSceneVo" id="HwSceneVoResult">
<result property="sceneId" column="scene_id" />
<result property="sceneName" column="scene_name" />
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
<result property="sceneModeId" column="scene_mode_id" />
<result property="sceneModeName" column="scene_mode_name" />
<result property="scenePic" column="scene_pic" />
<result property="defaultFlag" column="default_flag" />
<result property="sceneStatus" column="scene_status" />
<result property="authMode" column="auth_mode" />
<result property="modeAccount" column="mode_account" />
<result property="modeKey" column="mode_key" />
<result property="modeSecret" column="mode_secret" />
<result property="preserveTime" column="preserve_time" />
<result property="testPreserveTime" column="test_preserve_time" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="sceneEnvironment" column="scene_environment" />
<result property="sceneField" column="scene_field" />
<result property="contactName" column="contact_name" />
<result property="contactPhone" column="contact_phone" />
</resultMap>
<sql id="selectHwSceneVo">
select scene_id, scene_name, tenant_id, scene_mode_id, scene_pic, default_flag, scene_status, auth_mode, mode_account, mode_key, mode_secret, preserve_time, test_preserve_time, remark, create_by, create_time, update_by, update_time, scene_environment, scene_field from hw_scene
</sql>
<select id="selectHwSceneVoList" parameterType="HwSceneVo" resultMap="HwSceneVoResult">
select a.*,b.tenant_name,c.scene_mode_name from hw_scene as a
left join hw_tenant as b on a.tenant_id = b.tenant_id
left join hw_scene_mode as c on a.scene_mode_id = c.scene_mode_id
<where>
<if test="sceneName != null and sceneName != ''"> and a.scene_name like concat('%', #{sceneName}, '%')</if>
<if test="contactName != null and contactName != ''"> and b.contact_name like concat('%', #{contactName}, '%')</if>
<if test="contactPhone != null and contactPhone != ''"> and b.contact_phone like concat('%', #{contactPhone}, '%')</if>
<if test="sceneModeId != null and sceneModeId != ''"> and a.scene_mode_id = #{sceneModeId}</if>
<if test="defaultFlag != null and defaultFlag != ''"> and a.default_flag = #{defaultFlag}</if>
<if test="tenantId != null and tenantId != ''"> and a.tenant_id = #{tenantId}</if>
</where>
</select>
<select id="selectHwSceneList" parameterType="HwScene" resultMap="HwSceneResult">
<include refid="selectHwSceneVo"/>
<where>
@ -50,13 +89,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sceneField != null and sceneField != ''"> and scene_field = #{sceneField}</if>
</where>
</select>
<select id="selectHwSceneByTenantId0" parameterType="Long" resultMap="HwSceneResult">
<include refid="selectHwSceneVo"/>
where order by update_time desc
</select>
<select id="selectHwSceneByTenantIdNot0" parameterType="Long" resultMap="HwSceneResult">
<include refid="selectHwSceneVo"/>
where tenant_id = #{tenantId}
and
order by update_time desc
</select>
<select id="selectHwSceneBySceneId" parameterType="Long" resultMap="HwSceneResult">
<include refid="selectHwSceneVo"/>
where scene_id = #{sceneId}
</select>
<select id="selectHwSceneBySceneModeId" parameterType="Long" resultMap="HwSceneResult">
select * from hw_scene_mode where scene_mode_id = #{SceneModeId}
<include refid="selectHwSceneVo"/>
from hw_scene_mode where scene_mode_id = #{SceneModeId}
</select>
<insert id="insertHwScene" parameterType="HwScene" useGeneratedKeys="true" keyProperty="sceneId">
insert into hw_scene
@ -103,7 +152,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sceneField != null">#{sceneField},</if>
</trim>
</insert>
<update id="updateDefaultFlag" parameterType="Long">
update hw_scene
set default_flag = '0'
where tenant_id = #{tenantId}
</update>
<update id="updateHwScene" parameterType="HwScene">
update hw_scene
<trim prefix="SET" suffixOverrides=",">
@ -131,11 +184,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteHwSceneBySceneId" parameterType="Long">
delete from hw_scene where scene_id = #{sceneId}
update hw_scene set scene_status = '9' where scene_id = #{sceneId}
</delete>
<delete id="deleteHwSceneBySceneIds" parameterType="String">
delete from hw_scene where scene_id in
update hw_scene set scene_status = '9' where scene_id = in
<foreach item="sceneId" collection="array" open="(" separator="," close=")">
#{sceneId}
</foreach>

@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
<if test="tenantIndustry != null "> and tenant_industry = #{tenantIndustry}</if>
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone like concat ('%', #{contactPhone}, '%')</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="areaId != null "> and area_id = #{areaId}</if>
<if test="contactAddress != null and contactAddress != ''"> and contact_address = #{contactAddress}</if>
@ -119,11 +119,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteHwTenantByTenantId" parameterType="Long">
delete from hw_tenant where tenant_id = #{tenantId}
</delete>
UPDATE hw_tenant t1,sys_user t2
set t1.tenant_status = '9', t2.del_flag = '2'
where t1.tenant_id = t2.tenant_id and t1.tenant_id=#{tenantId} </delete>
<delete id="deleteHwTenantByTenantIds" parameterType="String">
delete from hw_tenant where tenant_id in
UPDATE hw_tenant t1,sys_user t2
set t1.tenant_status = '9', t2.del_flag = '2'
where t1.tenant_id = t2.tenant_id and t1.tenant_id in
<foreach item="tenantId" collection="array" open="(" separator="," close=")">
#{tenantId}
</foreach>

@ -129,7 +129,7 @@ public class MqttConfiguration {
if (topic.startsWith(dataTopicFilter.replace("#",""))) {
dataProcessService.processBusinessData(payloadString, imagePath, imagePatterns);
} else if (topic.equals(deviceStatusTopic)) {
deviceStatusService.handleDeviceStatus();
deviceStatusService.handleDeviceStatus(payloadString,clientId);
}
}
});

@ -9,5 +9,5 @@ package com.ruoyi.dataprocess.service;
*/
public interface IDeviceStatusService {
public void handleDeviceStatus();
public void handleDeviceStatus(String payloadString,String clientId);
}

@ -1,10 +1,20 @@
package com.ruoyi.dataprocess.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.constant.TdEngineConstants;
import com.ruoyi.dataprocess.domain.HwDevice;
import com.ruoyi.dataprocess.mapper.HwDeviceMapper;
import com.ruoyi.dataprocess.service.IDeviceStatusService;
import com.ruoyi.tdengine.api.RemoteTdEngineService;
import com.ruoyi.tdengine.api.domain.TdField;
import com.ruoyi.tdengine.api.domain.TdTableVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Description:
@ -16,12 +26,48 @@ import javax.annotation.Resource;
@Service
public class DeviceStatusServiceImpl implements IDeviceStatusService {
@Autowired
private HwDeviceMapper hwDeviceMapper;
@Resource
private RemoteTdEngineService remoteTdEngineService;
@Override
public void handleDeviceStatus(){
public void handleDeviceStatus(String payloadString, String clientId) {
System.out.println("ddd:" + payloadString);
// ddd:{"msg":"设备设备连接状态信息","deviceType":"edge","connectStatus":1,
// "statusTime":1694506127199,"deviceCode":"hw-data-process-1"}
JSONObject json = JSON.parseObject(payloadString);
String deviceCode = json.getString("deviceCode");
if (clientId.equals(deviceCode)) { //校验是不是自己,如果是自己则不记录状态,返回即可。
return;
}
HwDevice hwDevice = hwDeviceMapper.selectHwDeviceByDeviceCode(deviceCode);
if (hwDevice != null) {
Long deviceId = hwDevice.getDeviceId();
TdTableVo tdTableVo = new TdTableVo();
tdTableVo.setDatabaseName(TdEngineConstants.PLATFORM_DB_NAME);
tdTableVo.setTableName(TdEngineConstants.DEFAULT_DEVICE_STATUS_TABLE_NAME_PREFIX + deviceId);
List<TdField> schemaFields = new ArrayList<>();
TdField onlineStatusField = new TdField();
onlineStatusField.setFieldName("onlineStatus");
onlineStatusField.setFieldValue(json.getInteger("connectStatus"));
schemaFields.add(onlineStatusField);
TdField deviceTypeField = new TdField();
deviceTypeField.setFieldName("deviceType");
deviceTypeField.setFieldValue(json.getString("deviceType"));
schemaFields.add(deviceTypeField);
System.out.println("handleDeviceStatus");
TdField tsField = new TdField();
tsField.setFieldName(TdEngineConstants.DEFAULT_FIRST_FIELD_NAME);
tsField.setFieldValue(json.getLong("statusTime"));
schemaFields.add(tsField);
tdTableVo.setSchemaFields(schemaFields);
this.remoteTdEngineService.insertTable(tdTableVo);
}
}
}

@ -36,7 +36,9 @@
"url": "https://gitee.com/y_project/RuoYi-Cloud.git"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@riophae/vue-treeselect": "0.4.0",
"Vue-i18n": "npm:vue-i18n@^8.26.7",
"axios": "0.24.0",
"clipboard": "2.0.8",
"core-js": "3.25.3",
@ -48,6 +50,8 @@
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"less": "^4.2.0",
"less-loader": "5.0.0",
"nprogress": "0.2.0",
"quill": "1.3.7",
"screenfull": "5.0.2",
@ -56,9 +60,9 @@
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-i18n": "8.26.7",
"Vue-i18n": "npm:vue-i18n@^8.26.7",
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vue-seamless-scroll": "^1.1.23",
"vuedraggable": "2.24.3",
"vuex": "3.6.0"
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 KiB

@ -0,0 +1,80 @@
<template>
<div>
<div>
<div :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%">
<span>
监控主页
</span>
</div>
<div :class="`menu ${nowMenu==='2'? 'menuClick' :''}`" style="left: 9%">
<el-dropdown trigger="click">
<span class="el-dropdown-link">
智慧场景 <i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>黄金糕</el-dropdown-item>
<el-dropdown-item>狮子头</el-dropdown-item>
<el-dropdown-item>螺蛳粉</el-dropdown-item>
<el-dropdown-item>双皮奶</el-dropdown-item>
<el-dropdown-item>蚵仔煎</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div :class="`menu ${nowMenu==='3'? 'menuClick' :''}`" style="left: 16%">
<span>
设备监测
</span>
</div>
<div :class="`menu ${nowMenu==='4'? 'menuClick' :''}`" style="left: 23%">
<span>
传感器汇总
</span>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {}
},
props: {
nowMenu: {
type: String,
default: '1'
},
},
mounted() {
},
methods: {}
};
</script>
<style lang="less" scoped>
.menu {
background-image: url("~@/assets/board/common/subheadClick1.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 8vw;
height: 1.66vw;
top: 3.8%;
line-height: 1.66vw;
font-size: 0.8vw;
color: #d4d4d4;
text-align: center;
}
.menu .el-dropdown {
font-size: 0.8vw;
color: #d4d4d4;
}
.menuClick {
background-image: url("~@/assets/board/common/subheadClick.png");
color: #f3f3f3;
}
</style>

@ -0,0 +1,35 @@
<template>
<div />
</template>
<script>
import * as echarts from 'echarts';
export default {
expose: ['setData'],
data() {
return {
chart: null,
}
},
mounted() {
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
setData(option) {
this.initChart(option)
},
initChart(option) {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption(option)
}
}
}
</script>

@ -22,7 +22,7 @@ const messages = {
const i18n = new VueI18n({
// 设置语言 选项 en_US | zh_CN
locale: Cookies.get('language') || 'en_US',
locale: Cookies.get('language') || 'zh_CN',
// 设置文本内容
messages
})

@ -1,4 +1,6 @@
import Vue from 'vue'
import less from 'less'
import AMapLoader from "@amap/amap-jsapi-loader";
import Cookies from 'js-cookie'
@ -61,9 +63,18 @@ Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload)
Vue.component('ImagePreview', ImagePreview)
AMapLoader.load({
'key': '268909dc36fd438908a64ebe057bfb17',
'version': '2.0',
'plugins': ['AMap.Scale','AMap.GeoJSON']
}).then((AMap) => {
Vue.use(AMap)
})
Vue.use(directive)
Vue.use(plugins)
Vue.use(VueMeta)
Vue.use(less)
DictData.install()
/**

@ -87,7 +87,38 @@ export const constantRoutes = [
meta: { title: '个人中心', icon: 'user' }
}
]
}
},
{
path: '/board1',
component: () => import('@/views/board/index'),
name: 'Index',
meta: { title: '1', icon: 'dashboard', affix: true }
},
{
path: '/board2',
component: () => import('@/views/board/equipmentMonitoring'),
name: 'Index',
meta: { title: '2', icon: 'dashboard', affix: true }
},
{
path: '/board3',
component: () => import('@/views/board/GPS'),
name: 'Index',
meta: { title: '3', icon: 'dashboard', affix: true }
},
{
path: '/board4',
component: () => import('@/views/board/senso'),
name: 'Index',
meta: { title: '4', icon: 'dashboard', affix: true }
},
{
path: '/board5',
component: () => import('@/views/board/smartScene'),
name: 'Index',
meta: { title: '5', icon: 'dashboard', affix: true }
},
]
// 动态路由,基于用户权限动态去加载

@ -0,0 +1,385 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="2"></BoardTopNav>
<Chart ref="chart1" class="chart1"></Chart>
<div class="table1">
<div style="background-color: #094170">
<div class="scrollTable" style="font-weight: bold;">
告警编号
</div>
<div class="scrollTable" style="font-weight: bold;">
告警类型
</div>
<div class="scrollTable" style="font-weight: bold;">
告警位置
</div>
<div class="scrollTable" style="font-weight: bold;">
操作
</div>
</div>
<vue-seamless-scroll
:class-option="table1Data"
:data="table1Data"
class="case-item"
style="height: 84%;overflow: hidden;"
>
<div
v-for="(item, index) in table1Data"
:key="index"
>
<div :style='"background-color:" + ((index % 2 === 0)? "#053460":"#032d57") '>
<div
class="scrollTable">
{{ item.value1 }}
</div>
<div
class="scrollTable">
{{ item.value2 }}
</div>
<div
class="scrollTable">
{{ item.value3 }}
</div>
<div class="scrollTable">
<el-button size="mini" type="primary">处理</el-button>
</div>
</div>
</div>
</vue-seamless-scroll>
</div>
<div>
<div class="title1">监控单元报警统计</div>
<div class="title2">告警信息</div>
<div class="info1">监控单元数量</div>
<div class="info2">设备数量</div>
<div class="info3">在线设备数量</div>
<div class="num1">20</div>
<div class="num2">20</div>
<div class="num3">20</div>
</div>
<div class="map" id="map"></div>
</div>
</template>
<script>
import Chart from "@/components/Charts/Chart";
import BoardTopNav from '@/components/BoardTopNav'
import vueSeamlessScroll from "vue-seamless-scroll";
import * as echarts from 'echarts';
let map = null
import red from '@/assets/board/GPS/red.png'
import green from '@/assets/board/GPS/green.png'
export default {
components: {
Chart,
vueSeamlessScroll,
BoardTopNav
},
data() {
return {
chart1Data: [
{
value: 12,
name: '监控单元1',
},
{
value: 23,
name: '监控单元2',
},
{
value: 34,
name: '监控单元3',
},
{
value: 45,
name: '监控单元4',
},
{
value: 55,
name: '监控单元5',
}
],
chart1Option: {
grid: {
left: "0%",
right: "5%",
top: "0%",
bottom: "0%",
containLabel: true,
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
xAxis: {
type: "value",
axisLine: {
show: true,
lineStyle: {
color: "#fffa",
},
},
splitLine: {
show: true,
lineStyle: {
color: "#fff4",
type: 'dashed'
},
},
boundaryGap: [0, 0.01],
},
},
table1Data: [
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
{
value1: '001',
value2: '高温预警',
value3: '车间',
},
]
}
},
mounted() {
let option1 = {
...this.chart1Option,
yAxis: {
axisLine: {
show: true,
lineStyle: {
color: "#fffa",
},
},
splitLine: {
show: true,
lineStyle: {
color: "#fff4",
type: 'dashed'
},
},
type: "category",
data: this.chart1Data.map(e => e.name),
},
series: [
{
name: "数量",
type: "bar",
yAxisIndex: 0,
data: this.chart1Data.map(e => e.value),
barWidth: '60%',
itemStyle: {
normal: {
show: true,
color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
{
offset: 0,
color: "#00faff",
},
{
offset: 1,
color: "#1eadf1",
},
]),
},
},
},
],
}
this.$refs.chart1.setData(option1)
this.createMap()
this.setMarker()
},
methods: {
createMap(){
map = new AMap.Map('map', {
zoom: 11,
zooms: [8, 20],
center: [113.4, 23.35],
});
},
setMarker(){
var marker = new AMap.Marker({
position: [113.2, 23.35],
icon: red,
});
var marker1 = new AMap.Marker({
position: [113.6, 23.35],
icon: green,
});
map.add(marker)
map.add(marker1)
}
}
};
</script>
<style scoped>
.container {
background-image: url("~@/assets/board/GPS/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: calc(100vh);
position: relative;
}
.chart1 {
position: absolute;
width: 25%;
height: 21%;
top: 16%;
left: 3%;
}
.table1 {
position: absolute;
top: 48%;
left: 2.5%;
width: 26%;
height: 48%;
overflow: hidden;
}
.scrollTable {
color: rgb(185, 186, 192);
margin: auto 0px;
padding: 4px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
display: inline-block;
width: 25%;
}
.title1 {
position: absolute;
top: 13%;
left: 15.5%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title2 {
position: absolute;
top: 45.4%;
left: 15.6%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.info1 {
position: absolute;
top: 18%;
left: 39%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #179ce1;
}
.info2 {
position: absolute;
top: 18%;
left: 62%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #179ce1;
}
.info3 {
position: absolute;
top: 18%;
left: 83%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #179ce1;
}
.num1 {
position: absolute;
top: 18%;
left: 47%;
transform: translate(-50%, -50%);
font-size: 1.4vw;
color: #fff;
}
.num2 {
position: absolute;
top: 18%;
left: 69%;
transform: translate(-50%, -50%);
font-size: 1.4vw;
color: #fff;
}
.num3 {
position: absolute;
top: 18%;
left: 91%;
transform: translate(-50%, -50%);
font-size: 1.4vw;
color: #fff;
}
.map{
position: absolute;
top: 28%;
left: 31%;
width: 67%;
height: 69%;
}
</style>

@ -0,0 +1,35 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="3"></BoardTopNav>
</div>
</template>
<script>
import BoardTopNav from '@/components/BoardTopNav'
export default {
components: {
BoardTopNav
},
data() {
return {
}
},
mounted() {
},
methods: {
}
};
</script>
<style scoped>
.container {
background-image: url("~@/assets/board/GPS/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: calc(100vh);
position: relative;
}
</style>

@ -0,0 +1,604 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="1"></BoardTopNav>
<Chart ref="chart1" class="chart1"></Chart>
<div class="chart1Right">
<p style="color: #2ff;">电流互感器</p>
<p style="color: #f22;">电压互感器</p>
<p style="color: #f2f;">变压器</p>
<p style="color: #1f1;">电容电抗器</p>
</div>
<div class="chart1Table">
<div style="background-color: #094170">
<div class="scrollTable" style="font-weight: bold;">
名称
</div>
<div class="scrollTable" style="font-weight: bold;">
监控数量
</div>
<div class="scrollTable" style="font-weight: bold;">
报警数量
</div>
</div>
<vue-seamless-scroll
:class-option="chart1TableOption"
:data="chart1Data"
class="case-item"
style="height: 84%;overflow: hidden;"
>
<div
v-for="(item, index) in chart1Data"
:key="index"
>
<div :style='"background-color:" + ((index % 2 === 0)? "#053460":"#032d57") '>
<div
class="scrollTable">
{{ item.name }}
</div>
<div
class="scrollTable">
{{ item.value2 }}
</div>
<div
class="scrollTable">
{{ item.value }}
</div>
</div>
</div>
</vue-seamless-scroll>
</div>
<Chart ref="chart2" class="chart2"></Chart>
<div class="chart2Table">
<div style="background-color: #094170">
<div class="scrollTable" style="font-weight: bold;width: 50%">
名称
</div>
<div class="scrollTable" style="font-weight: bold;width: 50%">
数量
</div>
</div>
<vue-seamless-scroll
:class-option="chart1TableOption"
:data="chart2Data"
class="case-item"
style="height: 84%;overflow: hidden;"
>
<div
v-for="(item, index) in chart2Data"
:key="index"
>
<div :style='"background-color:" + ((index % 2 === 0)? "#053460":"#032d57") '>
<div class="scrollTable" style="width: 50%">
{{ item.name }}
</div>
<div class="scrollTable" style="width: 50%">
{{ item.value }}
</div>
</div>
</div>
</vue-seamless-scroll>
</div>
<div>
<div class="centerInfo">传感器数量</div>
<div class="centerInfo" style="font-weight:bold;top:19.3%;left: 42.5%;font-size: 2vw;">978</div>
<div class="centerInfo" style="left: 56%">监控单元数量</div>
<div class="centerInfo" style="font-weight:bold;top:19.3%;left: 66%;font-size: 2vw;">978</div>
</div>
<div class="inTransit">在运 <span style="color: #00f6ff">{{ inTransitNum }}</span></div>
<Chart ref="chart3" class="chart3"></Chart>
<div class="table1">
<div style="background-color: #094170">
<div class="scrollTable" style="font-weight: bold;width: 25%">
告警编号
</div>
<div class="scrollTable" style="font-weight: bold;width: 25%">
告警类型
</div>
<div class="scrollTable" style="font-weight: bold;width: 25%">
告警位置
</div>
<div class="scrollTable" style="font-weight: bold;width: 25%">
操作
</div>
</div>
<vue-seamless-scroll
:class-option="chart1TableOption"
:data="table1Data"
class="case-item"
style="height: calc(100% - 33px);overflow: hidden;"
>
<div
v-for="(item, index) in table1Data"
:key="index"
>
<div :style='"background-color:" + ((index % 2 === 0)? "#053460":"#032d57") '>
<div class="scrollTable" style="width: 25%">
{{ item.no }}
</div>
<div class="scrollTable" style="width: 25%">
{{ item.type }}
</div>
<div class="scrollTable" style="width: 25%">
{{ item.location }}
</div>
<div class="scrollTable" style="width: 25%">
<el-button size="mini" type="primary">操作</el-button>
</div>
</div>
</div>
</vue-seamless-scroll>
</div>
</div>
</template>
<script>
import Chart from "@/components/Charts/Chart";
import vueSeamlessScroll from "vue-seamless-scroll";
import BoardTopNav from '@/components/BoardTopNav'
import * as echarts from 'echarts';
export default {
components: {
vueSeamlessScroll,
Chart,
BoardTopNav
},
data() {
return {
chart1Option: {
tooltip: {},
angleAxis: {
max: 100,
clockwise: true,
show: false,
},
radiusAxis: {
type: "category",
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
polar: {
center: ["40%", "50%"],
radius: "100%", //
},
},
chart1Color: ['#2ff', '#f22', '#f2f', '#1f1'],
chart1Data: [
{
value: 12,
value2: 100,
name: '电流互感器',
},
{
value: 23,
value2: 100,
name: '电压互感器',
},
{
value: 34,
value2: 100,
name: '变压器',
},
{
value: 45,
value2: 100,
name: '电容电抗器',
}
],
chart1TableOption: {
step: 0.5, //
limitMoveNum: 3, // this.dataList.length
hoverStop: true, // stop
direction: 1, // 0 1 2 3
openWatch: true, // dom
singleHeight: 0, // (0) direction => 0/1
singleWidth: 0, // (0) direction => 2/3
waitTime: 0,
},
chart2Data: [
{
value: 111,
name: '无源温度传感器',
},
{
value: 111,
name: '有源温度传感器',
},
{
value: 111,
name: '烟雾传感器',
},
{
value: 111,
name: '温湿度传感器',
},
{
value: 111,
name: 'CO传感器',
}
],
chart2Option: {
color: ["#22acfd", "#22fe97", "#f9e728", "#ff922b", "#ed1814"],
legend: {
orient: "vertical",
x: "right",
y: "center",
textStyle: {
color: '#fff'
}
},
tooltip: {
trigger: "item",
formatter: "{b} : ({d}%)",
},
series: [
{
type: "pie",
radius: ["45%", "76%"],
center: ["35%", "50%"],
encode: {
itemName: "group",
value: "占比",
},
labelLine: {
show: false,
},
label: {
show: false,
},
itemStyle: {
opacity: '0.8'
}
},
{
type: "pie",
radius: ["75%", "90%"],
center: ["35%", "50%"],
encode: {
itemName: "group",
value: "占比",
},
labelLine: {
show: false,
},
label: {
show: false,
},
},
],
},
inTransitNum: 1999,
chart3Data: [
{
date: '10-01',
value: '100',
},
{
date: '10-02',
value: '200',
},
{
date: '10-03',
value: '100',
},
{
date: '10-04',
value: '300',
},
{
date: '10-05',
value: '200',
},
],
chart3Option: {
tooltip: {
trigger: "axis",
},
grid: {
top: "middle",
left: "3%",
right: "4%",
bottom: "3%",
height: "80%",
containLabel: true,
},
yAxis: {
type: "value",
splitLine: {
lineStyle: {
type: "dashed",
color: "#ccc3",
},
},
axisLine: {
show: false,
lineStyle: {
color: "#ccc",
},
},
nameTextStyle: {
color: "#999",
},
splitArea: {
show: false,
},
},
},
table1Data: [
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
{
no: '001',
type: '高温警告',
location: '车间',
},
]
}
},
mounted() {
let option1 = {
...this.chart1Option,
series: [
{
type: "bar",
data: this.chart1Data.map((e, i) => {
return {
value: (e.value / e.value2) * 100,
name: e.name,
itemStyle: {
color: this.chart1Color[i]
}
}
}),
showBackground: true,
coordinateSystem: "polar",
roundCap: true,
barWidth: 8,
},
]
}
this.$refs.chart1.setData(option1)
let chart2Num = eval(this.chart2Data.map(e => e.value).join("+"));
let option2 = {
...this.chart2Option,
dataset: {
source: [
["group", "占比"],
...this.chart2Data.map(e => [e.name, (e.value / chart2Num) * 100])
],
}
}
this.$refs.chart2.setData(option2)
let option3 = {
...this.chart3Option,
xAxis: {
boundaryGap: false,
type: "category",
data: this.chart3Data.map(e => e.date),
splitLine: {
show: true,
lineStyle: {
type: "dashed",
color: "#ccc3",
},
},
axisLine: {
lineStyle: {
color: "#999",
},
},
},
series: [
{
name: "",
type: "line",
data: this.chart3Data.map(e => e.value),
color: "#00dae0",
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "#00dae033",
},
{
offset: 1,
color: "rgba(0,202,149,0)",
},
],
false
),
shadowColor: "rgba(0,202,149, 0.9)",
shadowBlur: 20,
},
},
},
],
}
this.$refs.chart3.setData(option3)
},
methods: {}
};
</script>
<style scoped>
.container {
background-image: url("~@/assets/board/index/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: calc(100vh);
position: relative;
}
.centerImg {
background-image: url("~@/assets/board/index/container.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 45vw;
height: 20vw;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
}
.scrollTable {
color: rgb(185, 186, 192);
margin: auto 0px;
padding: 4px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
display: inline-block;
width: 33%;
}
.chart1 {
position: absolute;
width: 20%;
height: 21%;
top: 16%;
left: 3%;
}
.chart1Right {
background-image: url("~@/assets/board/common/bg1.png");
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 12px;
position: absolute;
top: 17%;
left: 18%;
}
.chart1Table {
position: absolute;
top: 38%;
left: 2.8%;
width: 21%;
height: 14%;
overflow: hidden;
}
.chart2 {
position: absolute;
width: 20%;
height: 21%;
top: 58.5%;
left: 3%;
}
.chart2Table {
position: absolute;
top: 81%;
left: 2.8%;
width: 21%;
height: 15%;
overflow: hidden;
}
.centerInfo {
position: absolute;
width: 7%;
top: 17.5%;
left: 32.7%;
font-size: 1.4vw;
text-align: center;
transform: translateX(-50%);
color: #01c7fd;
letter-spacing: 4px;
}
.inTransit {
position: absolute;
top: 16%;
left: 87%;
transform: translateX(-50%);
font-size: 1.2vw;
color: rgb(30, 158, 223);
}
.chart3 {
position: absolute;
width: 21%;
height: 22%;
top: 21.5%;
left: 76.1%;
}
.table1 {
position: absolute;
width: 21%;
height: 50%;
top: 45.5%;
left: 76.3%;
}
</style>

@ -0,0 +1,464 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="4"></BoardTopNav>
<div class="collapse">
<el-collapse v-model="activeName" accordion>
<el-collapse-item name="1">
<template slot="title">
<div class="itemBg">
<div class="icon"></div>
<div class="icon1"></div>
<div class="icon2"></div>
<div class="title"> 大厅-摄像头</div>
<div class="info">
<div class="info1">所属区域</div>
<div class="info2">大厅</div>
</div>
<div class="info" style="left: 70vh;">
<div class="info1">位置:</div>
<div class="info2">深圳</div>
</div>
<div class="info" style="left: 80vh;">
<div class="info1">日期:</div>
<div class="info2">2023-01-01 00:00:00</div>
</div>
</div>
</template>
<div>
<div>
<el-row :gutter="24">
<el-col :span="12">
<el-radio-group v-model="radio">
<el-radio-button label="日统计报表"></el-radio-button>
<el-radio-button label="月统计报表"></el-radio-button>
</el-radio-group>
</el-col>
<el-col :span="12">
<div style="position: absolute; right: 30px;">
<span style="color: #fff;"> 开始时间</span>
<div style="display: inline-block;width: 200px;margin-right: 12px;">
<el-date-picker type="date" placeholder="选择日期" style="width: 100%;"></el-date-picker>
</div>
<el-button type="primary">搜索</el-button>
<el-button>重置</el-button>
<el-button>导出</el-button>
</div>
</el-col>
</el-row>
<el-table :data="tableData" style="width: 100%;margin-top: 12px;"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center',backgroundColor:'#08406f' }">
<el-table-column prop="date1" label="设备ID">
</el-table-column>
<el-table-column prop="date2" label="传感器编号">
</el-table-column>
<el-table-column prop="date3" label="xx">
</el-table-column>
<el-table-column prop="date4" label="编号">
</el-table-column>
<el-table-column prop="date5" label="xx">
</el-table-column>
<el-table-column prop="date6" label="温度">
</el-table-column>
<el-table-column prop="date7" label="湿度">
</el-table-column>
<el-table-column prop="date8" label="时间">
</el-table-column>
</el-table>
<el-pagination background layout="prev, pager, next" :total="1000">
</el-pagination>
</div>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template slot="title">
<div class="itemBg">
<div class="icon"></div>
<div class="icon1"></div>
<div class="icon2"></div>
<div class="title"> 大厅-摄像头</div>
<div class="info">
<div class="info1">所属区域</div>
<div class="info2">大厅</div>
</div>
<div class="info" style="left: 70vh;">
<div class="info1">位置:</div>
<div class="info2">深圳</div>
</div>
<div class="info" style="left: 80vh;">
<div class="info1">日期:</div>
<div class="info2">2023-01-01 00:00:00</div>
</div>
</div>
</template>
<div>
<div>
<el-row :gutter="24">
<el-col :span="12">
<el-radio-group v-model="radio">
<el-radio-button label="日统计报表"></el-radio-button>
<el-radio-button label="月统计报表"></el-radio-button>
</el-radio-group>
</el-col>
<el-col :span="12">
<div style="position: absolute; right: 30px;">
<span style="color: #fff;"> 开始时间</span>
<div style="display: inline-block;width: 200px;margin-right: 12px;">
<el-date-picker type="date" placeholder="选择日期" style="width: 100%;"></el-date-picker>
</div>
<el-button type="primary">搜索</el-button>
<el-button>重置</el-button>
<el-button>导出</el-button>
</div>
</el-col>
</el-row>
<el-table :data="tableData" style="width: 100%;margin-top: 12px;"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center',backgroundColor:'#08406f' }">
<el-table-column prop="date1" label="设备ID">
</el-table-column>
<el-table-column prop="date2" label="传感器编号">
</el-table-column>
<el-table-column prop="date3" label="xx">
</el-table-column>
<el-table-column prop="date4" label="编号">
</el-table-column>
<el-table-column prop="date5" label="xx">
</el-table-column>
<el-table-column prop="date6" label="温度">
</el-table-column>
<el-table-column prop="date7" label="湿度">
</el-table-column>
<el-table-column prop="date8" label="时间">
</el-table-column>
</el-table>
<el-pagination background layout="prev, pager, next" :total="1000">
</el-pagination>
</div>
</div>
</el-collapse-item>
<el-collapse-item name="3">
<template slot="title">
<div class="itemBg">
<div class="icon"></div>
<div class="icon1"></div>
<div class="icon2"></div>
<div class="title"> 大厅-摄像头</div>
<div class="info">
<div class="info1">所属区域</div>
<div class="info2">大厅</div>
</div>
<div class="info" style="left: 70vh;">
<div class="info1">位置:</div>
<div class="info2">深圳</div>
</div>
<div class="info" style="left: 80vh;">
<div class="info1">日期:</div>
<div class="info2">2023-01-01 00:00:00</div>
</div>
</div>
</template>
<div>
<div>
<el-row :gutter="24">
<el-col :span="12">
<el-radio-group v-model="radio">
<el-radio-button label="日统计报表"></el-radio-button>
<el-radio-button label="月统计报表"></el-radio-button>
</el-radio-group>
</el-col>
<el-col :span="12">
<div style="position: absolute; right: 30px;">
<span style="color: #fff;"> 开始时间</span>
<div style="display: inline-block;width: 200px;margin-right: 12px;">
<el-date-picker type="date" placeholder="选择日期" style="width: 100%;"></el-date-picker>
</div>
<el-button type="primary">搜索</el-button>
<el-button>重置</el-button>
<el-button>导出</el-button>
</div>
</el-col>
</el-row>
<el-table :data="tableData" style="width: 100%;margin-top: 12px;"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center',backgroundColor:'#08406f' }">
<el-table-column prop="date1" label="设备ID">
</el-table-column>
<el-table-column prop="date2" label="传感器编号">
</el-table-column>
<el-table-column prop="date3" label="xx">
</el-table-column>
<el-table-column prop="date4" label="编号">
</el-table-column>
<el-table-column prop="date5" label="xx">
</el-table-column>
<el-table-column prop="date6" label="温度">
</el-table-column>
<el-table-column prop="date7" label="湿度">
</el-table-column>
<el-table-column prop="date8" label="时间">
</el-table-column>
</el-table>
<el-pagination background layout="prev, pager, next" :total="1000">
</el-pagination>
</div>
</div>
</el-collapse-item>
<el-collapse-item name="4">
<template slot="title">
<div class="itemBg">
<div class="icon"></div>
<div class="icon1"></div>
<div class="icon2"></div>
<div class="title"> 大厅-摄像头</div>
<div class="info">
<div class="info1">所属区域</div>
<div class="info2">大厅</div>
</div>
<div class="info" style="left: 70vh;">
<div class="info1">位置:</div>
<div class="info2">深圳</div>
</div>
<div class="info" style="left: 80vh;">
<div class="info1">日期:</div>
<div class="info2">2023-01-01 00:00:00</div>
</div>
</div>
</template>
<div>
<div>
<el-row :gutter="24">
<el-col :span="12">
<el-radio-group v-model="radio">
<el-radio-button label="日统计报表"></el-radio-button>
<el-radio-button label="月统计报表"></el-radio-button>
</el-radio-group>
</el-col>
<el-col :span="12">
<div style="position: absolute; right: 30px;">
<span style="color: #fff;"> 开始时间</span>
<div style="display: inline-block;width: 200px;margin-right: 12px;">
<el-date-picker type="date" placeholder="选择日期" style="width: 100%;"></el-date-picker>
</div>
<el-button type="primary">搜索</el-button>
<el-button>重置</el-button>
<el-button>导出</el-button>
</div>
</el-col>
</el-row>
<el-table :data="tableData" style="width: 100%;margin-top: 12px;"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center',backgroundColor:'#08406f' }">
<el-table-column prop="date1" label="设备ID">
</el-table-column>
<el-table-column prop="date2" label="传感器编号">
</el-table-column>
<el-table-column prop="date3" label="xx">
</el-table-column>
<el-table-column prop="date4" label="编号">
</el-table-column>
<el-table-column prop="date5" label="xx">
</el-table-column>
<el-table-column prop="date6" label="温度">
</el-table-column>
<el-table-column prop="date7" label="湿度">
</el-table-column>
<el-table-column prop="date8" label="时间">
</el-table-column>
</el-table>
<el-pagination background layout="prev, pager, next" :total="1000">
</el-pagination>
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
</template>
<script>
import BoardTopNav from '@/components/BoardTopNav'
export default {
components: {
BoardTopNav
},
data() {
return {
radio: '日统计报表',
tableData: [{
date1: '1233454576',
date2: '1233454576',
date3: 'DFHDGHJK',
date4: '12',
date5: 'QSD',
date6: '111',
date7: '222',
date8: new Date().getDate(),
}, {
date1: '1233454576',
date2: '1233454576',
date3: 'DFHDGHJK',
date4: '12',
date5: 'QSD',
date6: '111',
date7: '222',
date8: new Date().getDate(),
}, {
date1: '1233454576',
date2: '1233454576',
date3: 'DFHDGHJK',
date4: '12',
date5: 'QSD',
date6: '111',
date7: '222',
date8: new Date().getDate(),
}, {
date1: '1233454576',
date2: '1233454576',
date3: 'DFHDGHJK',
date4: '12',
date5: 'QSD',
date6: '111',
date7: '222',
date8: new Date().getDate(),
}]
}
},
mounted() {
},
methods: {}
};
</script>
<style lang="less" >
.container {
background-image: url("~@/assets/board/senso/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: calc(100vh);
position: relative;
}
.collapse {
position: absolute;
top: 9%;
left: 2%;
width: 96%;
height: 87%;
.el-collapse-item__wrap {
background-color: #0000;
border-color: #0000;
}
.el-table {
background-color: #FFF0 !important;
color: #fff;
}
.el-table tr {
background-color: #FFF0 !important;
}
.el-table th.el-table__cell.is-leaf, .el-table td.el-table__cell{
border-color: #0000;
}
.el-table::before, .el-table--group::after, .el-table--border::after{
background-color: #0000;
}
.el-table .el-table__header-wrapper th, .el-table .el-table__fixed-header-wrapper th{
background-color: #0000;
}
}
.collapse .el-collapse-item__header {
background-color: #0000;
border-color: #0000;
height: auto;
}
.collapse .el-collapse {
border-color: #0000;
}
.collapse .el-collapse-item {
// margin-bottom: 2vh;
}
.itemBg {
background-image: url("~@/assets/board/senso/itemBg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 17vh;
position: relative;
.icon {
background-image: url("~@/assets/board/senso/iconBg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
top: 2vh;
left: 5vh;
width: 13vh;
height: 13vh;
}
.icon1 {
background-image: url("~@/assets/board/senso/iconBottom.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
top: 2vh;
left: 5vh;
width: 13vh;
height: 13vh;
}
.icon2 {
background-image: url("~@/assets/board/senso/icon.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
top: 50%;
left: 10vh;
width: 2.6vh;
height: 3.3vh;
transform: translateY(-50%);
}
.title {
position: absolute;
left: 25vh;
color: #1fabf3;
line-height: 17vh;
font-size: 2.5vh;
}
.info {
position: absolute;
left: 60vh;
color: #1fabf3;
font-size: 1.5vh;
height: 100%;
white-space: nowrap;
.info1 {
position: absolute;
bottom: 55%;
color: #fffc
}
.info2 {
position: absolute;
top: 55%;
color: #fff
}
}
}
</style>

@ -0,0 +1,509 @@
<template>
<div class="container">
<BoardTopNav nowMenu="2"></BoardTopNav>
<div class="num1">30</div>
<div class="num2">216</div>
<div class="num3">0</div>
<div class="num4">0</div>
<div class="num5">0</div>
<div class="num6">0</div>
<div class="num7">0</div>
<div class="num8">0</div>
<div class="title1">监控单元</div>
<div class="title2">传感器</div>
<div class="title3">设备高温</div>
<div class="title4">设备振动</div>
<div class="title5">烟雾火情</div>
<div class="title6">环境大风</div>
<div class="title7">柜内温度</div>
<div class="title8">柜内冰浸</div>
<div class="title9">告警信息</div>
<div class="title10">监控单元</div>
<div class="table1">
<div style="background-color: #094170">
<div class="scrollTable" style="font-weight: bold;width: 8%">
告警编号
</div>
<div class="scrollTable" style="font-weight: bold;width: 8%">
告警类型
</div>
<div class="scrollTable" style="font-weight: bold;width: 15%">
告警单元
</div>
<div class="scrollTable" style="font-weight: bold;width: 30%">
告警信息
</div>
<div class="scrollTable" style="font-weight: bold;width: 11%">
告警位置
</div>
<div class="scrollTable" style="font-weight: bold;width: 20%">
告警时间
</div>
<div class="scrollTable" style="font-weight: bold;width: 8%">
处理情况
</div>
</div>
<vue-seamless-scroll :class-option="chart1TableOption" :data="table1Data" class="case-item"
style="height: calc(100% - 33px);overflow: hidden;">
<div v-for="(item, index) in table1Data" :key="index">
<div :style='"background-color:" + ((index % 2 === 0) ? "#053460" : "#032d57")'>
<div class="scrollTable" style="width: 8%">
{{ item.data1 }}
</div>
<div class="scrollTable" style="width: 8%">
{{ item.data2 }}
</div>
<div class="scrollTable" style="width: 15%">
{{ item.data3 }}
</div>
<div class="scrollTable" style="width: 30%">
{{ item.data4 }}
</div>
<div class="scrollTable" style="width: 11%">
{{ item.data5 }}
</div>
<div class="scrollTable" style="width: 20%">
{{ item.data6 }}
</div>
<div class="scrollTable" style="width: 8%">
<span style="color: #67C23A;">已处理</span>
</div>
</div>
</div>
</vue-seamless-scroll>
</div>
<div class="right">
<el-row>
<el-col :span="12">
<div class="item">
<div class="titleBg"></div>
<div class="title">
<span style="margin-right: 28px;"> 变压器 </span>
<el-tag type="success">正常</el-tag>
</div>
<div class="img"></div>
</div>
</el-col>
<el-col :span="12">
<div class="item">
<div class="titleBg"></div>
<div class="title">
<span style="margin-right: 28px;"> 变压器 </span>
<el-tag type="success">正常</el-tag>
</div>
<div class="img"></div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<div class="item">
<div class="titleBg"></div>
<div class="title">
<span style="margin-right: 28px;"> 变压器 </span>
<el-tag type="success">正常</el-tag>
</div>
<div class="img"></div>
</div>
</el-col>
<el-col :span="12">
<div class="item">
<div class="titleBg"></div>
<div class="title">
<span style="margin-right: 28px;"> 变压器 </span>
<el-tag type="success">正常</el-tag>
</div>
<div class="img"></div>
</div>
</el-col>
</el-row>
<div class="pagination">
<el-pagination :page-size="20" :pager-count="11" layout="prev, pager, next" :total="1000">
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import vueSeamlessScroll from "vue-seamless-scroll";
import BoardTopNav from '@/components/BoardTopNav'
export default {
components: {
vueSeamlessScroll,
BoardTopNav
},
data() {
return {
table1Data: [
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
{
data1: '001',
data2: '越限',
data3: '123123',
data4: '无线检测 检测值为 21° - 25°',
data5: '设备11233',
data6: '2021.01.01 00:00:00',
},
]
}
},
mounted() {
},
methods: {}
};
</script>
<style lang="less" scoped>
.container {
background-image: url("~@/assets/board/smartScene/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: calc(100vh);
position: relative;
}
.menu {
background-image: url("~@/assets/board/common/subheadClick1.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 8vw;
height: 1.66vw;
top: 3.8%;
line-height: 1.66vw;
font-size: 0.8vw;
color: #d4d4d4;
text-align: center;
}
.menu .el-dropdown {
font-size: 0.8vw;
color: #d4d4d4;
}
.menuClick {
background-image: url("~@/assets/board/common/subheadClick.png");
color: #f3f3f3;
}
.num1 {
position: absolute;
top: 21%;
left: 18%;
transform: translate(-50%, -50%);
font-size: 3vw;
color: #15d654;
}
.num2 {
position: absolute;
top: 21%;
left: 33%;
transform: translate(-50%, -50%);
font-size: 3vw;
color: #00fff0;
}
.num3 {
position: absolute;
top: 52%;
left: 7.5%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #d73827;
}
.num4 {
position: absolute;
top: 52%;
left: 15%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #1ef16d;
}
.num5 {
position: absolute;
top: 52%;
left: 22.5%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #f2711f;
}
.num6 {
position: absolute;
top: 52%;
left: 30%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #2a46f9;
}
.num7 {
position: absolute;
top: 52%;
left: 37.5%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #00a3fd;
}
.num8 {
position: absolute;
top: 52%;
left: 45%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #eff721;
}
.title1 {
position: absolute;
top: 28%;
left: 18%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #62bff2;
}
.title2 {
position: absolute;
top: 28%;
left: 33%;
transform: translate(-50%, -50%);
font-size: 2vw;
color: #62bff2;
}
.title3 {
position: absolute;
top: 48%;
left: 7.5%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title4 {
position: absolute;
top: 48%;
left: 15%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title5 {
position: absolute;
top: 48%;
left: 22.5%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title6 {
position: absolute;
top: 48%;
left: 30%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title7 {
position: absolute;
top: 48%;
left: 37.5%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title8 {
position: absolute;
top: 48%;
left: 45%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title9 {
position: absolute;
top: 61%;
left: 26.1%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title10 {
position: absolute;
top: 13%;
left: 74.3%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.table1 {
position: absolute;
top: 63%;
left: 3.5%;
width: 45.4%;
height: 32%;
}
.scrollTable {
color: rgb(185, 186, 192);
margin: auto 0px;
padding: 4px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
display: inline-block;
}
.right {
position: absolute;
top: 16%;
left: 52%;
width: 44.8%;
height: 80%;
.item {
width: 22vw;
height: 37vh;
position: relative;
border: 1px solid #1ea6ec;
margin-bottom: 12px;
.titleBg {
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 10%;
background-color: #063b5a;
}
.title {
position: absolute;
top: 5%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff9f6;
font-size: 0.9vw;
.el-tag.el-tag--success {
vertical-align: top !important;
}
}
.img {
background-image: url("~@/assets/board/smartScene/device.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 100%;
height: 90%;
top: 10%;
}
}
.pagination{
position: relative;
left: 50%;
transform: translateX(-50%);
display: inline-block;
.el-pagination{
display: inline-block;
}
}
}
</style>
Loading…
Cancel
Save