add:添加开发日志0309

This commit is contained in:
zhangzq
2026-03-09 20:07:06 +08:00
parent 8eb4c5889f
commit 8c56f26ff2
21 changed files with 378 additions and 107 deletions

Binary file not shown.

View File

@@ -1,15 +0,0 @@
package org.nl.wms.biBoard;
import org.nl.wms.biBoard.screen.service.dto.AgvStatus;
import java.util.HashMap;
import java.util.Map;
public class StaticData {
public static Map<String,AgvStatus> agv_status= new HashMap<>();
public void sync(String carId,AgvStatus agvStatus){
agv_status.put(carId,agvStatus);
}
}

View File

@@ -0,0 +1,69 @@
package org.nl.wms.biBoard.run;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.biBoard.screen.service.dto.AgvStatus;
import org.nl.wms.biBoard.temp.service.IBiTempRecordService;
import org.nl.wms.biBoard.temp.service.dao.BiTempRecord;
import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.util.AcsResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 任务自动下发
* </p>
*
* @author Liuxy
* @since 2025-06-09
*/
@Slf4j
@Component
@Order(value = 1)
public class AutoSyncAgvStatus {
public static Map<String, AgvStatus> AGV_STATUS= new HashMap<>();
@Autowired
private WmsToAcsService wmsToAcsService;
@SneakyThrows
public void run() {
System.out.println("------AutoSyncAgvStatus-------");
this.doExecute();
}
/**
* 需要按照任务配置类型并行执行
*/
private void doExecute() {
try {
AcsResponse agvStatus = wmsToAcsService.getAgvStatus();
if (agvStatus.getStatus() == HttpStatus.HTTP_OK){
final JSONObject resultData = agvStatus.getResultData();
if (!CollectionUtils.isEmpty(resultData)){
for (String carId : resultData.keySet()) {
JSONObject object = resultData.getJSONObject(carId);
if (object!=null){
AgvStatus agvStatusDto = object.toJavaObject(AgvStatus.class);
AGV_STATUS.put(carId,agvStatusDto);
}
}
}
}
}catch (Exception ex){
log.error(ex.getMessage());
}
}
}

View File

@@ -0,0 +1,77 @@
package org.nl.wms.biBoard.run;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.biBoard.screen.service.dto.AgvStatus;
import org.nl.wms.biBoard.temp.service.IBiTempRecordService;
import org.nl.wms.biBoard.temp.service.dao.BiTempRecord;
import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.util.AcsResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 任务自动下发
* </p>
*
* @author Liuxy
* @since 2025-06-09
*/
@Slf4j
@Component
@Order(value = 1)
public class AutoSyncTemp {
public static Map<String, AgvStatus> agv_status= new HashMap<>();
@Autowired
private WmsToAcsService wmsToAcsService;
@Autowired
private IBiTempRecordService iBiTempRecordService;
@SneakyThrows
public void run() {
System.out.println("------AutoSyncTemp-------");
this.doExecute();
}
/**
* 需要按照任务配置类型并行执行
*/
private void doExecute() {
try {
AcsResponse tempHumAcs = wmsToAcsService.getTempHumAcs();
if (tempHumAcs.getStatus() == HttpStatus.HTTP_OK){
//{
// "status": "200",
// "message": "success",
// "resultData": {
// "temp": 25.6, 温度
// "hum": 60.2 适度
// }
//}
JSONObject data = tempHumAcs.getResultData();
final BigDecimal temp = data.getBigDecimal("temp");
final BigDecimal hum = data.getBigDecimal("hum");
final BiTempRecord record = new BiTempRecord();
record.setTemp(temp);
record.setHumidity(hum);
record.setRecord_datee(LocalDate.now());
record.setRecord_timee(LocalDateTime.now());
iBiTempRecordService.save(record);
}
}catch (Exception ex){
log.error(ex.getMessage());
}
}
}

View File

@@ -1,5 +1,9 @@
package org.nl.wms.biBoard.screen.service;
import org.nl.wms.biBoard.screen.service.dto.AgvStatus;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
@@ -20,9 +24,10 @@ public interface IScreenService {
/**
* 获取AGV状态
*
* @return Map
*/
Map<String, Object> getAgvStatus();
Collection<AgvStatus> getAgvStatus();
/**
* 获取当天温度走势

View File

@@ -43,7 +43,8 @@
<select id="getTempTrend" resultType="java.util.HashMap">
SELECT
DATE_FORMAT(record_timee, '%H:%i') as time,
temp as temperature
temp as temperature,
humidity as humidity
FROM bi_temp_record
<where>
<if test="param.startDate != null and param.startDate != ''">

View File

@@ -16,9 +16,9 @@ public class AgvStatus {
*/
private String carType;
/**
* 车辆图标:对应在resources/static
* 车辆图标:对应前端images中在料箱式AGV.png/潜伏式AGV.png
*/
private String icon = "resources/static/icon/料箱式AGV.png";
private String icon = "料箱式AGV.png";
/**
* 当前执行任务号
*/

View File

@@ -1,11 +1,11 @@
package org.nl.wms.biBoard.screen.service.impl;
import cn.hutool.core.date.DateUtil;
import org.nl.wms.biBoard.StaticData;
import org.nl.wms.biBoard.screen.service.dto.AgvStatus;
import org.nl.wms.biBoard.screen.service.IScreenService;
import org.nl.wms.biBoard.screen.service.dao.mapper.ScreenMapper;
import org.nl.wms.biBoard.temp.service.dao.mapper.BiTempRecordMapper;
import org.nl.wms.biBoard.run.AutoSyncAgvStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -50,77 +50,8 @@ public class ScreenServiceImpl implements IScreenService {
}
@Override
public Map<String, Object> getAgvStatus() {
Map<String, Object> result = new HashMap<>();
// 从StaticData获取AGV状态
Map<String, AgvStatus> agvStatusMap = StaticData.agv_status;
agvStatusMap.put("1",AgvStatus.builder()
.status("1")
.carId("2")
.icon("潜伏式AGV.png")
.carType("潜伏式AGV").power("66").taskCode("123123").build());
agvStatusMap.put("1",AgvStatus.builder()
.status("1")
.carId("1")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("2",AgvStatus.builder()
.status("1")
.carId("2")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("3",AgvStatus.builder()
.status("1")
.carId("3")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("5",AgvStatus.builder()
.status("1")
.carId("5")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("4",AgvStatus.builder()
.status("1")
.carId("4")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("6",AgvStatus.builder()
.status("1")
.carId("6")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("7",AgvStatus.builder()
.status("1")
.carId("7")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
Object[] objects = agvStatusMap.values().toArray();
result.put("agvList", objects);
result.put("total", objects.length);
return result;
public Collection<AgvStatus> getAgvStatus() {
return AutoSyncAgvStatus.AGV_STATUS.values();
}
@Override

View File

@@ -37,13 +37,15 @@ public class BiTempRecord implements Serializable {
*/
private BigDecimal temp;
private BigDecimal humidity;
/**
* 记录时间
*/
private LocalDateTime recordTimee;
private LocalDateTime record_timee;
/**
* 记录日期
*/
private LocalDate recordDatee;
private LocalDate record_datee;
}

View File

@@ -6,8 +6,9 @@
<resultMap id="BaseResultMap" type="org.nl.wms.biBoard.temp.service.dao.BiTempRecord">
<id column="id" property="id" />
<result column="temp" property="temp" />
<result column="record_timee" property="recordTimee" />
<result column="record_datee" property="recordDatee" />
<result column="humidity" property="humidity" />
<result column="record_timee" property="record_timee" />
<result column="record_datee" property="record_datee" />
</resultMap>
<!-- 温度记录分页查询 -->
@@ -15,6 +16,7 @@
SELECT
id,
temp,
humidity,
DATE_FORMAT(record_timee, '%Y-%m-%d %H:%i:%s') as recordTimee,
DATE_FORMAT(record_datee, '%Y-%m-%d') as recordDatee,
'自动记录' as recorder

View File

@@ -27,6 +27,12 @@ public class BiTempRecordDto implements Serializable {
* 温度
*/
private BigDecimal temp;
/**
* 湿度
*/
private BigDecimal humidity;
/**
* 记录时间

View File

@@ -31,4 +31,12 @@ public class EXTConstant {
* ACS下发 获取称重信息
*/
public final static String GET_WEIGH_ACS_API = "api/wms/getWeigh";
/**
* 温湿度接口
*/
public final static String GET_TEMPHUM_ACS_API = "api/wms/getTempHum";
/**
* 所有AGV状态接口
*/
public final static String GET_AGVSTATUS_ACS_API = "api/wms/getAgvStatus";
}

View File

@@ -30,6 +30,8 @@ public interface WmsToAcsService {
* @return AcsResponse
*/
AcsResponse getWeighAcs(JSONObject whereJson);
AcsResponse getTempHumAcs();
AcsResponse getAgvStatus();
/**
* 确认取放货

View File

@@ -2,6 +2,7 @@ package org.nl.wms.ext.service.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.biBoard.screen.service.dto.AgvStatus;
import org.nl.wms.ext.enums.EXTConstant;
import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.util.AcsResponse;
@@ -9,7 +10,9 @@ import org.nl.wms.ext.util.AcsUtil;
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -38,4 +41,86 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
return AcsUtil.notifyAcs(EXTConstant.CONFIRM_AGV_ACS_API, whereJson);
}
@Override
public AcsResponse getTempHumAcs() {
JSONObject object = new JSONObject();
//"temp": 25.6, 温度
// "hum": 60.2 适度
object.put("temp","25.6");
object.put("hum","60.2");
return AcsResponse.requestOk(object);
// JSONObject whereJson = object;
// whereJson.put("device_code","WSD1");
// return AcsUtil.notifyAcs(EXTConstant.GET_TEMPHUM_ACS_API, whereJson);
}
@Override
public AcsResponse getAgvStatus() {
Map<String, Object> agvStatusMap = new HashMap<>();
agvStatusMap.put("1",AgvStatus.builder()
.status("1")
.carId("2")
.icon("潜伏式AGV.png")
.carType("潜伏式AGV").power("66").taskCode("123123").build());
agvStatusMap.put("1",AgvStatus.builder()
.status("1")
.carId("1")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("2",AgvStatus.builder()
.status("1")
.carId("2")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("3",AgvStatus.builder()
.status("1")
.carId("3")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("5",AgvStatus.builder()
.status("1")
.carId("5")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("4",AgvStatus.builder()
.status("1")
.carId("4")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("6",AgvStatus.builder()
.status("1")
.carId("6")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
agvStatusMap.put("7",AgvStatus.builder()
.status("1")
.carId("7")
.carType("CTU料箱AGV")
.icon("料箱式AGV.png")
.power("77")
.taskCode("33322")
.build());
return AcsResponse.requestOk(new JSONObject(agvStatusMap));
// return AcsUtil.notifyAcs(EXTConstant.GET_AGVSTATUS_ACS_API,new JSONObject());
}
}

View File

@@ -55,5 +55,13 @@ public class AcsResponse extends BaseResponse {
result.setResponseDate(DateUtil.now());
return result;
}
public static AcsResponse requestOk(JSONObject resultData) {
AcsResponse result = new AcsResponse();
result.setStatus(HttpStatus.HTTP_OK);
result.setMessage("请求成功");
result.setResultData(resultData);
result.setResponseDate(DateUtil.now());
return result;
}
}

View File

@@ -0,0 +1,18 @@
-- 温湿度记录表
CREATE TABLE `bi_temp_record` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键子增',
`temp` decimal(6,1) DEFAULT '0.0' COMMENT '温度:acs定时获取',
`record_timee` datetime DEFAULT NULL COMMENT '记录时间',
`record_datee` date DEFAULT NULL COMMENT '记录日期',
`humidity` decimal(6,1) DEFAULT '0.0' COMMENT '湿度',
PRIMARY KEY (`id`),
KEY `date_idx` (`record_datee`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- 看板菜单,还需要配置角色
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `system_type`, `category`, `title`, `en_title`, `in_title`, `zh_title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_pc`) VALUES ('2030193473382125568', '1929832819341791232', 0, '3', '1', NULL, '智慧看板', '智慧看板', '智慧看板', '智慧看板', 'screen', 'wms/biBoard/screen/index', 1, 'education', 'bi/screen', 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1');
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `system_type`, `category`, `title`, `en_title`, `in_title`, `zh_title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_pc`) VALUES ('2030169068350345216', '1929832819341791232', 0, '3', '1', NULL, '班组领退料明细报表', '班组领退料明细报表', '班组领退料明细报表', '班组领退料明细报表', 'iosReport', 'wms/biBoard/iosReport/index', 5, 'chart', 'bi/iosReport', 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1');
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `system_type`, `category`, `title`, `en_title`, `in_title`, `zh_title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_pc`) VALUES ('2030163275467067392', '1929832819341791232', 0, '3', '1', NULL, '班组焊材消耗报表', '班组焊材消耗报表', '班组焊材消耗报表', '班组焊材消耗报表', 'consumeReport', 'wms/biBoard/consumeReport', 4, 'chart', 'bi/consumeReport', 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1');
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `system_type`, `category`, `title`, `en_title`, `in_title`, `zh_title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_pc`) VALUES ('2030110749459877888', '1929832819341791232', 0, '3', '1', NULL, '温度记录', '温度记录', '温度记录', '温度记录', 'tempRecord', 'wms/biBoard/temp/index', 3, 'color', 'bi/tempRecord', 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1');
-- 温湿度同步
INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `job_ip`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('2030967753933983744', 'autoSyncAgvStatus', '0/20 * * * * ?', b'1', 'agv状态同步', NULL, 'run', NULL, 'agv状态同步', '1', NULL, NULL, b'1', '1', '管理员', '2026-03-09 19:23:40', '1', '管理员', '2026-03-09 19:23:40');
INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `job_ip`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('2030966262800191488', 'autoSyncTemp', '* * 0/1 * * ?', b'1', '同步温湿度', NULL, 'run', NULL, '定时同步温湿度', 'admin', NULL, NULL, b'1', '1', '管理员', '2026-03-09 19:17:45', '1', '管理员', '2026-03-09 20:02:07');

View File

@@ -0,0 +1,38 @@
报表及智慧看板开发
后端代码全部在wms.biBoard目录下,前端全部在views.biBoard目录下
看板访问地址http://localhost:8013/screen/fullscreen/
前端静态资源在assets/images下boardImg.png位看板中间图片logo.png为客户logo图片(需要获取)
料箱式AGV.png前锋式AGV.png为看板AGV图标后端传的icon需要跟他保持一只没有的话取默认agv.png图
代码说明
1.报表
1.1温湿度报表
数据来源通过AutoSyncTemp定时器同步ACS数据存储至数据库bi_temp_record中
代码路径org.nl.wms.biBoard.temp.controller
1.2班组焊接消耗报表
数据来源通过查询pdm_bom_callmaterial工单主表获取消耗跟领料数据
退库数量:(IFNULL(bom.return_one_qty, 0) + IFNULL(bom.return_two_qty, 0)) AS returnQty,
消耗数量:(bom.real_qty - IFNULL(bom.return_one_qty, 0) - IFNULL(bom.return_two_qty, 0)) AS consumeQty,
bom.qty_unit_name AS qtyUnitName
代码路径org.nl.wms.biBoard.consumptionReport
1.3班组退料明细报表
数据来源查询完成的出入库单st_ivt_iostorinv单据类型为领料出库退料入库的数据合
代码路径org.nl.wms.biBoard.materialRequisition
2.智慧看板
2.1获取库存统计数据
数据来源:
// 库位分类统计 getInventoryCategory
// 库存前5数量及物料占比 getInventoryTop5
// 库位统计:有货、空料箱、无货 getStructStatistics
2.2 agv状态
数据来源通过定时器AutoSyncAgvStatus定时从ACS获取AGV状态并保存至内存中
说明其中AgvStatus对象中icon图标需要指定是"料箱式AGV.png","潜伏式AGV.png"看板会从前端assets/images中读取对应图标
实际项目中 车辆ID需要跟图标icon有个对应关系可以在代码中用map存储未做
2.3 温湿度走势图
数据来源读取表bi_temp_record数据
2.4 焊材获取焊材使用Top5
数据来源获取出入库单中bill_type = '1001'领料出库单real_qty的合
3.说明:
1.日数据与周数据切换只是开始结束时间不同
2.当天数据中getTodayReport的开始时间结束时间临时注释方便查看看板信息上线时需打开时间参数
3.同步温度及AGV状态的调用ACS方法AcsResponse getTempHumAcs();AcsResponse getAgvStatus();
临时改成测试参数,方便查看看板信息,上线时需切换注释

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

View File

@@ -68,7 +68,7 @@
{{ getAgvStatusText(agv.status) }}
</div>
<div class="agv-task">当前任务{{ agv.taskCode || '无' }}</div>
<div class="agv-battery">电量{{ agv.battery || 0 }}%</div>
<div class="agv-battery">电量{{ agv.power || 0 }}%</div>
</div>
</div>
</div>
@@ -95,7 +95,9 @@
<el-radio-button label="week">本周</el-radio-button>
</el-radio-group>
</div>
<div class="detail-list scroll-list">
<div class="detail-list scroll-list" style="
width: 370px;
height: 250px;">
<div v-for="(item, index) in displayIosReportData" :key="index" class="detail-item">
<div class="detail-time">{{ item.confirmTime }}</div>
<div class="detail-type" :class="item.iosType === '领料' ? 'type-out' : 'type-in'">
@@ -113,7 +115,9 @@
</div>
<div class="panel-title">当日领退明细</div>
<div class="detail-list scroll-list">
<div class="detail-list scroll-list" style="
width: 370px;
height: 250px;">
<div v-for="(item, index) in displayTodayDetailList" :key="index" class="detail-item">
<div class="detail-time">{{ item.confirmTime }}</div>
<div class="detail-type" :class="item.iosType === '领料' ? 'type-out' : 'type-in'">
@@ -266,7 +270,7 @@ export default {
url: '/api/screen/agvStatus',
method: 'get'
})
this.agvList = res.agvList || []
this.agvList = res || []
} catch (error) {
console.error('加载AGV状态失败', error)
}
@@ -362,13 +366,15 @@ export default {
getAgvStatusClass(status) {
if (!status) return 'status-idle'
if (status.status === '正常') return 'status-normal'
if (status.status === '故障') return 'status-error'
if (status.status === '1') return 'status-normal'
if (status.status === '2') return 'status-error'
return 'status-idle'
},
getAgvStatusText(status) {
return status ? status.status || '空闲' : '空闲'
if (status === '1') return '运行中'
if (status === '2') return '故障'
return '空闲'
},
initStructChart() {
@@ -386,6 +392,10 @@ export default {
top: 'center',
textStyle: {
color: '#fff'
},
formatter: function(name) {
const item = option.series[0].data.find(d => d.name === name)
return name + ': ' + (item ? item.value : 0)
}
},
series: [
@@ -399,7 +409,8 @@ export default {
{ value: data.noGoods || 0, name: '无货', itemStyle: { color: '#fac858' }}
],
label: {
color: '#fff'
color: '#fff',
formatter: '{b}: {c}\n({d}%)'
}
}
]
@@ -413,16 +424,24 @@ export default {
const times = this.tempData.map(item => item.time)
const temps = this.tempData.map(item => item.temperature)
const humidities = this.tempData.map(item => item.humidity)
const option = {
tooltip: {
trigger: 'axis'
},
legend: {
data: ['温度', '湿度'],
textStyle: {
color: '#fff'
},
top: 0
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
top: '10%',
top: '15%',
containLabel: true
},
xAxis: {
@@ -439,6 +458,7 @@ export default {
},
series: [
{
name: '温度',
data: temps,
type: 'line',
smooth: true,
@@ -449,6 +469,19 @@ export default {
{ offset: 1, color: 'rgba(238, 102, 102, 0.1)' }
])
}
},
{
name: '湿度',
data: humidities,
type: 'line',
smooth: true,
itemStyle: { color: '#5470c6' },
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(84, 112, 198, 0.5)' },
{ offset: 1, color: 'rgba(84, 112, 198, 0.1)' }
])
}
}
]
}
@@ -687,7 +720,7 @@ export default {
}
.chart-container {
margin-bottom: 30px;
margin-bottom: 20px;
}
.warehouse-3d {
@@ -833,8 +866,8 @@ export default {
.detail-item {
display: flex;
align-items: center;
padding: 10px;
margin-bottom: 10px;
padding: 6px;
margin-bottom: 6px;
background: rgba(0, 50, 100, 0.4);
border: 1px solid rgba(30, 144, 255, 0.2);
border-radius: 4px;

View File

@@ -40,6 +40,7 @@
<el-table-column prop="recordDatee" label="日期" />
<el-table-column prop="recordTimee" label="记录时间" />
<el-table-column prop="temp" label="温度℃" />
<el-table-column prop="humidity" label="湿度%" />
<el-table-column prop="recorder" label="记录人" />
</el-table>
<!--分页组件-->