Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhmes-agecal
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
zhmes-agecal
Commits
9eb47dd7
Commit
9eb47dd7
authored
Aug 13, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 扫码绑定托盘,上料,机械臂整体测试
parent
3efab788
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
727 additions
and
267 deletions
+727
-267
PalletDeviceBindingController.java
...b/controller/equipment/PalletDeviceBindingController.java
+8
-0
TEquipmentInfoController.java
...ng/web/controller/equipment/TEquipmentInfoController.java
+8
-0
TTrayInfoController.java
.../zehong/web/controller/equipment/TTrayInfoController.java
+0
-13
application.yml
zhmes-agecal-admin/src/main/resources/application.yml
+1
-1
TEquipmentInfo.java
...rc/main/java/com/zehong/system/domain/TEquipmentInfo.java
+13
-0
TTrayInfo.java
...tem/src/main/java/com/zehong/system/domain/TTrayInfo.java
+10
-0
PalletDeviceBindingMapper.java
...a/com/zehong/system/mapper/PalletDeviceBindingMapper.java
+2
-0
TTrayInfoMapper.java
...c/main/java/com/zehong/system/mapper/TTrayInfoMapper.java
+2
-0
Modbus4jUtils.java
...ain/java/com/zehong/system/modbus/util/Modbus4jUtils.java
+33
-12
IPalletDeviceBindingService.java
...om/zehong/system/service/IPalletDeviceBindingService.java
+2
-0
ITEquipmentInfoService.java
...ava/com/zehong/system/service/ITEquipmentInfoService.java
+2
-0
ITTrayInfoService.java
...ain/java/com/zehong/system/service/ITTrayInfoService.java
+1
-0
PalletDeviceBindingServiceImpl.java
...g/system/service/impl/PalletDeviceBindingServiceImpl.java
+12
-0
RobotArmCommandServiceImpl.java
...ehong/system/service/impl/RobotArmCommandServiceImpl.java
+16
-3
SysUserServiceImpl.java
...va/com/zehong/system/service/impl/SysUserServiceImpl.java
+10
-5
TEquipmentInfoServiceImpl.java
...zehong/system/service/impl/TEquipmentInfoServiceImpl.java
+10
-2
TTrayInfoServiceImpl.java
.../com/zehong/system/service/impl/TTrayInfoServiceImpl.java
+14
-2
PalletDeviceBindingMapper.xml
...ain/resources/mapper/system/PalletDeviceBindingMapper.xml
+5
-0
TEquipmentInfoMapper.xml
...src/main/resources/mapper/system/TEquipmentInfoMapper.xml
+6
-1
TTrayInfoMapper.xml
...stem/src/main/resources/mapper/system/TTrayInfoMapper.xml
+28
-2
equipment.js
zhmes-agecal-web/src/api/equipment/equipment.js
+8
-0
binding.js
zhmes-agecal-web/src/api/palletDeviceBinding/binding.js
+8
-0
AgingCabinetBoard.vue
...cal-web/src/views/screen/components/AgingCabinetBoard.vue
+82
-65
AgingLayer.vue
zhmes-agecal-web/src/views/screen/components/AgingLayer.vue
+10
-11
TrayBinding.vue
zhmes-agecal-web/src/views/screen/components/TrayBinding.vue
+57
-13
TrayInformation.vue
...gecal-web/src/views/screen/components/TrayInformation.vue
+377
-135
index.vue
zhmes-agecal-web/src/views/screen/index.vue
+2
-2
No files found.
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/PalletDeviceBindingController.java
View file @
9eb47dd7
...
...
@@ -72,6 +72,14 @@ public class PalletDeviceBindingController extends BaseController
return
AjaxResult
.
success
(
palletDeviceBindingService
.
selectPalletDeviceBindingById
(
palletDeviceBindingId
));
}
/**
* 重置所有托盘绑定的设备列
*/
@GetMapping
(
"/resetAll/{trayId}"
)
public
AjaxResult
resetAll
(
@PathVariable
(
"trayId"
)
Long
trayId
)
{
return
AjaxResult
.
success
(
palletDeviceBindingService
.
resetAll
(
trayId
));
}
/**
* 新增托盘绑定的设备列
*/
...
...
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/TEquipmentInfoController.java
View file @
9eb47dd7
...
...
@@ -43,6 +43,14 @@ public class TEquipmentInfoController extends BaseController
return
getDataTable
(
list
);
}
/**
* 获取生产设备信息列表
*/
@GetMapping
(
"/getAllEquipmentList"
)
public
List
<
TEquipmentInfo
>
getAllEquipmentList
()
{
return
tEquipmentInfoService
.
getAllEquipmentList
();
}
/**
* 导出生产设备信息列表
*/
...
...
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/TTrayInfoController.java
View file @
9eb47dd7
package
com
.
zehong
.
web
.
controller
.
equipment
;
import
java.util.List
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -11,10 +10,8 @@ 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.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.system.domain.TTrayInfo
;
import
com.zehong.system.service.ITTrayInfoService
;
import
com.zehong.common.utils.poi.ExcelUtil
;
...
...
@@ -36,7 +33,6 @@ public class TTrayInfoController extends BaseController
/**
* 查询托盘信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('tray:tray:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TTrayInfo
tTrayInfo
)
{
...
...
@@ -48,8 +44,6 @@ public class TTrayInfoController extends BaseController
/**
* 导出托盘信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('tray:tray:export')"
)
@Log
(
title
=
"托盘信息"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TTrayInfo
tTrayInfo
)
{
...
...
@@ -61,7 +55,6 @@ public class TTrayInfoController extends BaseController
/**
* 获取托盘信息详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('tray:tray:query')"
)
@GetMapping
(
value
=
"/{fTrayId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"fTrayId"
)
Long
fTrayId
)
{
...
...
@@ -71,8 +64,6 @@ public class TTrayInfoController extends BaseController
/**
* 新增托盘信息
*/
@PreAuthorize
(
"@ss.hasPermi('tray:tray:add')"
)
@Log
(
title
=
"托盘信息"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TTrayInfo
tTrayInfo
)
{
...
...
@@ -82,8 +73,6 @@ public class TTrayInfoController extends BaseController
/**
* 修改托盘信息
*/
@PreAuthorize
(
"@ss.hasPermi('tray:tray:edit')"
)
@Log
(
title
=
"托盘信息"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
TTrayInfo
tTrayInfo
)
{
...
...
@@ -93,8 +82,6 @@ public class TTrayInfoController extends BaseController
/**
* 删除托盘信息
*/
@PreAuthorize
(
"@ss.hasPermi('tray:tray:remove')"
)
@Log
(
title
=
"托盘信息"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{fTrayIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
fTrayIds
)
{
...
...
zhmes-agecal-admin/src/main/resources/application.yml
View file @
9eb47dd7
...
...
@@ -26,7 +26,7 @@ spring:
# 国际化资源文件路径
basename
:
i18n/messages
profiles
:
active
:
dev
active
:
test
# 文件上传
servlet
:
multipart
:
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/domain/TEquipmentInfo.java
View file @
9eb47dd7
...
...
@@ -78,6 +78,11 @@ public class TEquipmentInfo extends BaseEntity
@Excel
(
name
=
"状态:0空闲,1运行,2故障"
)
private
String
fStatus
;
/**
* 故障原因
*/
private
String
errorReason
;
/** 报警时间 */
@Excel
(
name
=
"报警时间"
)
private
String
fAlarmTime
;
...
...
@@ -250,6 +255,14 @@ public class TEquipmentInfo extends BaseEntity
this
.
fPowerOutagePort
=
fPowerOutagePort
;
}
public
String
getErrorReason
()
{
return
errorReason
;
}
public
void
setErrorReason
(
String
errorReason
)
{
this
.
errorReason
=
errorReason
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/domain/TTrayInfo.java
View file @
9eb47dd7
...
...
@@ -32,6 +32,8 @@ public class TTrayInfo extends BaseEntity
@Excel
(
name
=
"状态:0.空闲 1.运行"
)
private
String
fStatus
;
/** 绑定设备数 */
private
Long
boardCount
;
/** 绑定时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"绑定时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
...
...
@@ -111,6 +113,14 @@ public class TTrayInfo extends BaseEntity
return
fCreateTime
;
}
public
Long
getBoardCount
()
{
return
boardCount
;
}
public
void
setBoardCount
(
Long
boardCount
)
{
this
.
boardCount
=
boardCount
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/PalletDeviceBindingMapper.java
View file @
9eb47dd7
...
...
@@ -44,6 +44,8 @@ public interface PalletDeviceBindingMapper
*/
public
int
insertPalletDeviceBinding
(
PalletDeviceBinding
palletDeviceBinding
);
public
int
resetAll
(
Long
trayId
);
public
int
batchInsertPalletDeviceBinding
(
@Param
(
"palletDeviceBindingList"
)
List
<
PalletDeviceBinding
>
palletDeviceBindingList
);
/**
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/TTrayInfoMapper.java
View file @
9eb47dd7
...
...
@@ -37,6 +37,8 @@ public interface TTrayInfoMapper
*/
public
int
insertTTrayInfo
(
TTrayInfo
tTrayInfo
);
public
int
batchInsertTTrayInfo
(
List
<
TTrayInfo
>
tTrayInfoList
);
/**
* 修改托盘信息
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/modbus/util/Modbus4jUtils.java
View file @
9eb47dd7
...
...
@@ -175,14 +175,25 @@ public class Modbus4jUtils {
* @throws ModbusTransportException
* @throws ErrorResponseException
*/
public
static
boolean
[]
getRoboticArmEntryConveyorData
()
throws
ModbusTransportException
,
ModbusInitException
{
ModbusMaster
master
=
getMaster
(
"192.168.2.11"
,
502
);
boolean
[]
booleans
=
readDiscreteInputs
(
master
,
1
,
0
,
2
);
public
static
boolean
[]
getRoboticArmEntryConveyorData
(){
if
(
master
!=
null
)
{
master
.
destroy
();
ModbusMaster
master
=
null
;
try
{
master
=
getMaster
(
"192.168.2.11"
,
502
);
boolean
[]
booleans
=
readDiscreteInputs
(
master
,
1
,
0
,
2
);
if
(
master
!=
null
)
{
master
.
destroy
();
}
return
booleans
;
}
catch
(
ModbusTransportException
|
ModbusInitException
e
)
{
return
new
boolean
[]{
false
,
false
};
// 示例数据
}
finally
{
if
(
master
!=
null
)
{
master
.
destroy
();
}
}
return
booleans
;
}
/**
...
...
@@ -193,14 +204,24 @@ public class Modbus4jUtils {
* @throws ModbusTransportException
* @throws ErrorResponseException
*/
public
static
boolean
[]
getRoboticArmExitConveyorData
()
throws
ModbusTransportException
,
ModbusInitException
{
ModbusMaster
master
=
getMaster
(
"192.168.2.12"
,
502
);
boolean
[]
booleans
=
readDiscreteInputs
(
master
,
1
,
0
,
2
);
public
static
boolean
[]
getRoboticArmExitConveyorData
()
{
ModbusMaster
master
=
null
;
try
{
master
=
getMaster
(
"192.168.2.12"
,
502
);
boolean
[]
booleans
=
readDiscreteInputs
(
master
,
1
,
0
,
2
);
if
(
master
!=
null
)
{
master
.
destroy
();
if
(
master
!=
null
)
{
master
.
destroy
();
}
return
booleans
;
}
catch
(
ModbusTransportException
|
ModbusInitException
e
)
{
return
new
boolean
[]{
false
,
false
};
// 示例数据
}
finally
{
if
(
master
!=
null
)
{
master
.
destroy
();
}
}
return
booleans
;
}
/**
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/IPalletDeviceBindingService.java
View file @
9eb47dd7
...
...
@@ -35,6 +35,8 @@ public interface IPalletDeviceBindingService
*/
public
int
insertPalletDeviceBinding
(
PalletDeviceBinding
palletDeviceBinding
);
public
int
resetAll
(
Long
trayId
);
public
int
batchInsertPalletDeviceBinding
(
List
<
PalletDeviceBinding
>
palletDeviceBindingList
);
public
int
batchUpdateDeviceCode
(
List
<
PalletDeviceBinding
>
palletDeviceBindingList
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/ITEquipmentInfoService.java
View file @
9eb47dd7
...
...
@@ -30,6 +30,8 @@ public interface ITEquipmentInfoService
*/
public
List
<
TEquipmentInfo
>
selectTEquipmentInfoList
(
TEquipmentInfo
tEquipmentInfo
);
public
List
<
TEquipmentInfo
>
getAllEquipmentList
();
/**
* 查询老化柜、标定柜信息列表
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/ITTrayInfoService.java
View file @
9eb47dd7
...
...
@@ -35,6 +35,7 @@ public interface ITTrayInfoService
*/
public
int
insertTTrayInfo
(
TTrayInfo
tTrayInfo
);
public
int
batchInsertTTrayInfo
(
List
<
TTrayInfo
>
tTrayInfoList
);
/**
* 修改托盘信息
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/PalletDeviceBindingServiceImpl.java
View file @
9eb47dd7
...
...
@@ -58,6 +58,17 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
return
palletDeviceBindingMapper
.
insertPalletDeviceBinding
(
palletDeviceBinding
);
}
/**
* 重置所有托盘绑定的设备列
*
* @param trayId 托盘ID
* @return 结果
*/
@Override
public
int
resetAll
(
Long
trayId
)
{
return
palletDeviceBindingMapper
.
resetAll
(
trayId
);
}
/**
* 批量添加托盘绑定的设备列
*
...
...
@@ -69,6 +80,7 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
palletDeviceBindingList
.
forEach
(
palletDeviceBinding
->
{
palletDeviceBinding
.
setUpdateTime
(
DateUtils
.
getNowDate
());
palletDeviceBinding
.
setCreateTime
(
DateUtils
.
getNowDate
());
palletDeviceBinding
.
setBindingTime
(
DateUtils
.
getNowDate
());
});
return
palletDeviceBindingMapper
.
batchInsertPalletDeviceBinding
(
palletDeviceBindingList
);
}
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/RobotArmCommandServiceImpl.java
View file @
9eb47dd7
...
...
@@ -12,6 +12,7 @@ import com.zehong.system.domain.TStoreyInfo;
import
com.zehong.system.domain.TTrayInfo
;
import
com.zehong.system.mapper.TStoreyInfoMapper
;
import
com.zehong.system.mapper.TTrayInfoMapper
;
import
com.zehong.system.modbus.util.Modbus4jUtils
;
import
com.zehong.system.netty.handler.NettyUdpServerHandler
;
import
com.zehong.system.service.websocket.RobotArmWebSocketHandler
;
import
com.zehong.system.udp.UdpCommandSender
;
...
...
@@ -76,15 +77,23 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
List
<
RobotArmCommand
>
loadingCommands
=
robotArmCommandMapper
.
selectPendingLoadingCommands
();
if
(!
loadingCommands
.
isEmpty
())
{
sendCommand
(
loadingCommands
.
get
(
0
),
"LOAD"
);
return
;
boolean
[]
roboticArmEntryConveyorData
=
Modbus4jUtils
.
getRoboticArmEntryConveyorData
();
if
(
roboticArmEntryConveyorData
[
1
])
{
sendCommand
(
loadingCommands
.
get
(
0
),
"LOAD"
);
return
;
}
}
// 2. 处理待执行的下料指令
List
<
RobotArmCommand
>
unloadingCommands
=
robotArmCommandMapper
.
selectPendingUnloadingCommands
();
if
(!
unloadingCommands
.
isEmpty
())
{
sendCommand
(
unloadingCommands
.
get
(
0
),
"UNLOAD"
);
boolean
[]
roboticArmExitConveyorData
=
Modbus4jUtils
.
getRoboticArmExitConveyorData
();
if
(
roboticArmExitConveyorData
[
1
])
{
sendCommand
(
unloadingCommands
.
get
(
0
),
"UNLOAD"
);
}
}
}
...
...
@@ -200,6 +209,10 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
TTrayInfo
tTrayInfo
=
tTrayInfoMapper
.
selectTTrayInfoByCode
(
robotArmCommand
.
getTrayCode
());
if
(
tTrayInfo
==
null
)
{
throw
new
RuntimeException
(
"托盘不存在"
);
}
if
(!
"0"
.
equals
(
tTrayInfo
.
getfStatus
()))
{
throw
new
RuntimeException
(
"托盘未解绑,请联系管理员"
);
}
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/SysUserServiceImpl.java
View file @
9eb47dd7
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
com.zehong.system.domain.TTrayInfo
;
import
com.zehong.system.mapper.*
;
import
com.zehong.system.service.ITTrayInfoService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -17,14 +22,11 @@ import com.zehong.common.utils.StringUtils;
import
com.zehong.system.domain.SysPost
;
import
com.zehong.system.domain.SysUserPost
;
import
com.zehong.system.domain.SysUserRole
;
import
com.zehong.system.mapper.SysPostMapper
;
import
com.zehong.system.mapper.SysRoleMapper
;
import
com.zehong.system.mapper.SysUserMapper
;
import
com.zehong.system.mapper.SysUserPostMapper
;
import
com.zehong.system.mapper.SysUserRoleMapper
;
import
com.zehong.system.service.ISysConfigService
;
import
com.zehong.system.service.ISysUserService
;
import
javax.annotation.Resource
;
/**
* 用户 业务层处理
*
...
...
@@ -53,6 +55,9 @@ public class SysUserServiceImpl implements ISysUserService
@Autowired
private
ISysConfigService
configService
;
@Resource
private
ITTrayInfoService
trayInfoService
;
/**
* 根据条件分页查询用户列表
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/TEquipmentInfoServiceImpl.java
View file @
9eb47dd7
...
...
@@ -4,13 +4,15 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.concurrent.CompletableFuture
;
import
com.sun.org.apache.xpath.internal.operations.Mod
;
import
com.zehong.system.domain.modbus.ModbusDeviceData
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TEquipmentInfoMapper
;
import
com.zehong.system.domain.TEquipmentInfo
;
import
com.zehong.system.service.ITEquipmentInfoService
;
import
javax.annotation.Resource
;
/**
* 生产设备信息Service业务层处理
*
...
...
@@ -20,7 +22,7 @@ import com.zehong.system.service.ITEquipmentInfoService;
@Service
public
class
TEquipmentInfoServiceImpl
implements
ITEquipmentInfoService
{
@
Autowired
@
Resource
private
TEquipmentInfoMapper
tEquipmentInfoMapper
;
/**
...
...
@@ -47,6 +49,12 @@ public class TEquipmentInfoServiceImpl implements ITEquipmentInfoService
return
tEquipmentInfoMapper
.
selectTEquipmentInfoList
(
tEquipmentInfo
);
}
@Override
public
List
<
TEquipmentInfo
>
getAllEquipmentList
()
{
return
tEquipmentInfoMapper
.
selectTEquipmentInfoList
(
null
);
}
/**
* 查询老化柜、标定柜信息列表
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/TTrayInfoServiceImpl.java
View file @
9eb47dd7
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TTrayInfoMapper
;
import
com.zehong.system.domain.TTrayInfo
;
import
com.zehong.system.service.ITTrayInfoService
;
import
javax.annotation.Resource
;
/**
* 托盘信息Service业务层处理
*
...
...
@@ -16,7 +17,7 @@ import com.zehong.system.service.ITTrayInfoService;
@Service
public
class
TTrayInfoServiceImpl
implements
ITTrayInfoService
{
@
Autowired
@
Resource
private
TTrayInfoMapper
tTrayInfoMapper
;
/**
...
...
@@ -55,6 +56,17 @@ public class TTrayInfoServiceImpl implements ITTrayInfoService
return
tTrayInfoMapper
.
insertTTrayInfo
(
tTrayInfo
);
}
/**
* 批量新增托盘信息
*
* @param tTrayInfoList 托盘信息
* @return 批量结果
*/
@Override
public
int
batchInsertTTrayInfo
(
List
<
TTrayInfo
>
tTrayInfoList
)
{
return
tTrayInfoMapper
.
batchInsertTTrayInfo
(
tTrayInfoList
);
}
/**
* 修改托盘信息
*
...
...
zhmes-agecal-system/src/main/resources/mapper/system/PalletDeviceBindingMapper.xml
View file @
9eb47dd7
...
...
@@ -83,6 +83,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<update
id=
"resetAll"
parameterType=
"long"
>
update t_pallet_device_binding
set f_device_code = null,f_binding_time = null
where f_tray_id = #{trayId}
</update>
<insert
id=
"insertPalletDeviceBinding"
parameterType=
"PalletDeviceBinding"
useGeneratedKeys=
"true"
keyProperty=
"palletDeviceBindingId"
>
insert into t_pallet_device_binding
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
zhmes-agecal-system/src/main/resources/mapper/system/TEquipmentInfoMapper.xml
View file @
9eb47dd7
...
...
@@ -23,12 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"fAlarmTime"
column=
"f_alarm_time"
/>
<result
property=
"fPowerOutageIp"
column=
"f_power_outage_ip"
/>
<result
property=
"fPowerOutagePort"
column=
"f_power_outage_port"
/>
<result
property=
"errorReason"
column=
"f_error_Reason"
/>
</resultMap>
<sql
id=
"selectTEquipmentInfoVo"
>
select f_equipment_id, f_equipment_code, f_equipment_name, f_equipment_type, f_equipment_factory,
f_beyong_department, f_ip, f_port, f_install_location, f_is_inspect, f_responsible_person,
f_responsible_person_mobile, f_create_time, f_update_time, f_status, f_alarm_time, f_power_outage_ip, f_power_outage_port from t_equipment_info
f_responsible_person_mobile, f_create_time, f_update_time, f_status, f_alarm_time, f_power_outage_ip,
f_power_outage_port,f_error_Reason from t_equipment_info
</sql>
<select
id=
"selectTEquipmentInfoList"
parameterType=
"TEquipmentInfo"
resultMap=
"TEquipmentInfoResult"
>
...
...
@@ -83,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"fUpdateTime != null"
>
f_update_time,
</if>
<if
test=
"fStatus != null"
>
f_status,
</if>
<if
test=
"fAlarmTime != null"
>
f_alarm_time,
</if>
<if
test=
"errorReason != null"
>
f_error_Reason,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"fEquipmentCode != null"
>
#{fEquipmentCode},
</if>
...
...
@@ -100,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"fUpdateTime != null"
>
#{fUpdateTime},
</if>
<if
test=
"fStatus != null"
>
#{fStatus},
</if>
<if
test=
"fAlarmTime != null"
>
#{fAlarmTime},
</if>
<if
test=
"errorReason != null"
>
#{errorReason},
</if>
</trim>
</insert>
...
...
@@ -121,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"fUpdateTime != null"
>
f_update_time = #{fUpdateTime},
</if>
<if
test=
"fStatus != null"
>
f_status = #{fStatus},
</if>
<if
test=
"fAlarmTime != null"
>
f_alarm_time = #{fAlarmTime},
</if>
<if
test=
"errorReason != null"
>
f_error_Reason = #{errorReason},
</if>
</trim>
where f_equipment_id = #{fEquipmentId}
</update>
...
...
zhmes-agecal-system/src/main/resources/mapper/system/TTrayInfoMapper.xml
View file @
9eb47dd7
...
...
@@ -15,13 +15,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectTTrayInfoVo"
>
select f_tray_id, f_tray_code, f_storey_code, f_status, f_binding_time, f_unbinding_time, f_create_time from t_tray_info
SELECT
f_tray_id,
f_tray_code,
f_storey_code,
f_status,
f_binding_time,
f_unbinding_time,
f_create_time,
(
SELECT
count( 1 )
FROM
t_pallet_device_binding
WHERE
f_tray_id = t_tray_info.f_tray_id
AND ( f_device_code
<![CDATA[<>]]>
'' )
AND f_unbinding_time IS NULL
) AS boardCount
FROM
t_tray_info
</sql>
<select
id=
"selectTTrayInfoList"
parameterType=
"TTrayInfo"
resultMap=
"TTrayInfoResult"
>
<include
refid=
"selectTTrayInfoVo"
/>
<where>
<if
test=
"fTrayCode != null and fTrayCode != ''"
>
and f_tray_code
= #{fTrayCode}
</if>
<if
test=
"fTrayCode != null and fTrayCode != ''"
>
and f_tray_code
like concat('%',#{fTrayCode},'%')
</if>
<if
test=
"fStoreyCode != null and fStoreyCode != ''"
>
and f_storey_code = #{fStoreyCode}
</if>
<if
test=
"fStatus != null and fStatus != ''"
>
and f_status = #{fStatus}
</if>
<if
test=
"fBindingTime != null "
>
and f_binding_time = #{fBindingTime}
</if>
...
...
@@ -59,6 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert
id=
"batchInsertTTrayInfo"
parameterType=
"list"
>
insert into t_tray_info (f_tray_code, f_storey_code, f_status, f_binding_time, f_unbinding_time, f_create_time) values
<foreach
item=
"item"
index=
"index"
collection=
"list"
separator=
","
>
(#{item.fTrayCode}, #{item.fStoreyCode}, #{item.fStatus}, #{item.fBindingTime}, #{item.fUnbindingTime}, #{item.fCreateTime})
</foreach>
</insert>
<update
id=
"updateTTrayInfo"
parameterType=
"TTrayInfo"
>
update t_tray_info
<trim
prefix=
"SET"
suffixOverrides=
","
>
...
...
zhmes-agecal-web/src/api/equipment/equipment.js
View file @
9eb47dd7
...
...
@@ -9,6 +9,14 @@ export function listEquipment(query) {
})
}
// 查询生产设备信息列表
export
function
getAllEquipmentList
()
{
return
request
({
url
:
'/equipment/getAllEquipmentList'
,
method
:
'get'
})
}
// 查询生产设备信息详细
export
function
getEquipment
(
fEquipmentId
)
{
return
request
({
...
...
zhmes-agecal-web/src/api/palletDeviceBinding/binding.js
View file @
9eb47dd7
...
...
@@ -70,6 +70,14 @@ export function delBinding(palletDeviceBindingId) {
})
}
// 删除托盘绑定的设备列
export
function
resetAll
(
trayId
)
{
return
request
({
url
:
'/palletDevice/binding/resetAll/'
+
trayId
,
method
:
'get'
})
}
// 导出托盘绑定的设备列
export
function
exportBinding
(
query
)
{
return
request
({
...
...
zhmes-agecal-web/src/views/screen/components/AgingCabinetBoard.vue
View file @
9eb47dd7
...
...
@@ -23,24 +23,29 @@
</div>
</div>
<
div
class=
"cabinet-content"
>
<!-- 渲染每一行 -->
<el-row
:gutter=
"20"
v-for=
"(row, rowIndex) in cabinetRows"
:key=
"rowIndex"
>
<!-- 每行渲染6个卡片 --
>
<el-col
:span=
"4"
v-for=
"item in row"
:key=
"item.id"
style=
"margin-bottom: 20px; text-align: center;"
>
<!-- 使用 el-tooltip 来提供 hover 提示 -->
<el-tooltip
:
content=
"getTooltipContent(item)
"
placement=
"top
"
<
!-- 全局加载动画:覆盖整个内容区域 --
>
<div
v-loading=
"pageLoading"
element-loading-text=
"老化柜巡查中..."
element-loading-spinner=
"el-icon-loading"
element-loading-background=
"rgba(255, 255, 255, 0.1)"
>
<div
class=
"cabinet-content"
>
<!-- 渲染每一行 -->
<el-row
:gutter=
"20"
v-for=
"(row, rowIndex) in cabinetRows"
:key=
"rowIndex"
>
<!-- 每行渲染6个卡片 -->
<el-col
:span=
"4"
v-for=
"item in row"
:
key=
"item.fEquipmentId
"
style=
"margin-bottom: 20px; text-align: center;
"
>
<el-card
:class=
"statusMap[item.deviceStatus]"
style=
"
<!-- 使用 el-tooltip 来提供 hover 提示 -->
<el-tooltip
:content=
"getTooltipContent(item)"
placement=
"top"
>
<el-card
:class=
"statusMap[item.fStatus]"
style=
"
width: 100px;
height: 100px;
margin: 0 auto;
...
...
@@ -49,13 +54,14 @@
justify-content: center;
font-size: 18px;
font-weight: bold;"
@
click
.
native=
"handleCardClick(item)"
>
{{
item
.
id
+
"号柜"
}}
</el-card>
</el-tooltip>
</el-col>
</el-row>
@
click
.
native=
"handleCardClick(item)"
>
{{
item
.
fEquipmentId
+
"号柜"
}}
</el-card>
</el-tooltip>
</el-col>
</el-row>
</div>
</div>
</div>
</div>
...
...
@@ -63,48 +69,49 @@
<
script
>
import
{
getAgingCabinetAndPowerCheck
}
from
"@/api/testScheduledTasks/testTasks"
;
import
{
getAllEquipmentList
}
from
"@/api/equipment/equipment"
export
default
{
name
:
"AgingCabinetBoard"
,
data
()
{
return
{
// 示例数据格式,实际从后端获取
cabinets
:
[
{
id
:
1
,
deviceStatus
:
'1'
},
{
id
:
2
,
deviceStatus
:
'2'
},
{
id
:
3
,
deviceStatus
:
'0'
},
{
id
:
4
,
deviceStatus
:
'0'
},
{
id
:
5
,
deviceStatus
:
'0'
},
{
id
:
6
,
deviceStatus
:
'0'
},
{
id
:
7
,
deviceStatus
:
'0'
},
{
id
:
8
,
deviceStatus
:
'0'
},
{
id
:
9
,
deviceStatus
:
'0'
},
{
id
:
10
,
deviceStatus
:
'0'
},
{
id
:
11
,
deviceStatus
:
'0'
},
{
id
:
12
,
deviceStatus
:
'0'
},
{
id
:
13
,
deviceStatus
:
'0'
},
{
id
:
14
,
deviceStatus
:
'0'
},
{
id
:
15
,
deviceStatus
:
'0'
},
{
id
:
16
,
deviceStatus
:
'0'
},
{
id
:
17
,
deviceStatus
:
'0'
},
{
id
:
18
,
deviceStatus
:
'0'
},
{
id
:
19
,
deviceStatus
:
'0'
},
{
id
:
20
,
deviceStatus
:
'0'
},
{
id
:
21
,
deviceStatus
:
'0'
},
{
id
:
22
,
deviceStatus
:
'0'
},
{
id
:
23
,
deviceStatus
:
'0'
},
{
id
:
24
,
deviceStatus
:
'0'
},
{
id
:
25
,
deviceStatus
:
'0'
},
{
id
:
26
,
deviceStatus
:
'0'
},
{
id
:
27
,
deviceStatus
:
'0'
},
{
id
:
28
,
deviceStatus
:
'0'
},
{
id
:
29
,
deviceStatus
:
'0'
},
{
id
:
30
,
deviceStatus
:
'0'
},
{
id
:
31
,
deviceStatus
:
'0'
},
{
id
:
32
,
deviceStatus
:
'0'
},
{
id
:
33
,
deviceStatus
:
'0'
},
{
id
:
34
,
deviceStatus
:
'0'
},
{
id
:
35
,
deviceStatus
:
'0'
},
{
id
:
36
,
deviceStatus
:
'0'
},
//
{ id: 1, deviceStatus: '1' },
//
{ id: 2, deviceStatus: '2' },
//
{ id: 3, deviceStatus: '0' },
//
{ id: 4, deviceStatus: '0' },
//
{ id: 5, deviceStatus: '0' },
//
{ id: 6, deviceStatus: '0' },
//
{ id: 7, deviceStatus: '0' },
//
{ id: 8, deviceStatus: '0' },
//
{ id: 9, deviceStatus: '0' },
//
{ id: 10, deviceStatus: '0' },
//
{ id: 11, deviceStatus: '0' },
//
{ id: 12, deviceStatus: '0' },
//
{ id: 13, deviceStatus: '0' },
//
{ id: 14, deviceStatus: '0' },
//
{ id: 15, deviceStatus: '0' },
//
{ id: 16, deviceStatus: '0' },
//
{ id: 17, deviceStatus: '0' },
//
{ id: 18, deviceStatus: '0' },
//
{ id: 19, deviceStatus: '0' },
//
{ id: 20, deviceStatus: '0' },
//
{ id: 21, deviceStatus: '0' },
//
{ id: 22, deviceStatus: '0' },
//
{ id: 23, deviceStatus: '0' },
//
{ id: 24, deviceStatus: '0' },
//
{ id: 25, deviceStatus: '0' },
//
{ id: 26, deviceStatus: '0' },
//
{ id: 27, deviceStatus: '0' },
//
{ id: 28, deviceStatus: '0' },
//
{ id: 29, deviceStatus: '0' },
//
{ id: 30, deviceStatus: '0' },
//
{ id: 31, deviceStatus: '0' },
//
{ id: 32, deviceStatus: '0' },
//
{ id: 33, deviceStatus: '0' },
//
{ id: 34, deviceStatus: '0' },
//
{ id: 35, deviceStatus: '0' },
//
{ id: 36, deviceStatus: '0' },
// 共36个
],
// 状态对应的颜色类名
...
...
@@ -113,7 +120,9 @@ export default {
1
:
'available'
,
2
:
'occupied'
},
agingCabinetList
:
null
agingCabinetList
:
null
,
pageLoading
:
true
,
// 新增:页面全局加载状态
};
},
created
()
{
...
...
@@ -128,7 +137,7 @@ export default {
}
},
mounted
()
{
//
this.testAgingCabinetAndPowerCheck();
this
.
testAgingCabinetAndPowerCheck
();
},
methods
:
{
handleCardClick
(
item
)
{
...
...
@@ -137,7 +146,7 @@ export default {
this
.
$emit
(
'cabinet-click'
,
item
,
3
);
},
getTooltipContent
(
item
)
{
switch
(
item
.
device
Status
)
{
switch
(
item
.
f
Status
)
{
case
'2'
:
return
item
.
errorReason
||
'无故障详情'
;
case
'1'
:
...
...
@@ -148,9 +157,17 @@ export default {
}
},
testAgingCabinetAndPowerCheck
()
{
getAgingCabinetAndPowerCheck
().
then
(
response
=>
{
// 开始加载:显示全局loading
this
.
pageLoading
=
true
;
// getAgingCabinetAndPowerCheck().then(response => {
// this.cabinets = response;
// this.pageLoading = false;
// });
getAllEquipmentList
().
then
(
response
=>
{
this
.
cabinets
=
response
;
});
this
.
pageLoading
=
false
;
})
}
}
};
...
...
zhmes-agecal-web/src/views/screen/components/AgingLayer.vue
View file @
9eb47dd7
...
...
@@ -51,7 +51,7 @@
<!-- 托盘信息展示区域 -->
<div
class=
"tray-header-inner"
>
<span
class=
"tray-label"
>
托盘
</span>
<span
class=
"tray-id"
>
TP-
{{
trayInfo
.
id
||
'--'
}}
</span>
<span
class=
"tray-id"
>
{{
modbusDeviceData
.
fTrayCode
}}
</span>
</div>
<div
class=
"tray-info"
>
...
...
@@ -59,10 +59,10 @@
<div
class=
"info-label"
>
所在柜体:
</div>
<div
class=
"info-value"
>
{{
modbusDeviceData
.
id
}}
号柜 -
{{
trayInfo
.
layer
.
split
(
"-"
)[
1
]
||
'--'
}}
层
</div>
</div>
<div
class=
"info-row"
>
<div
class=
"info-label"
>
产品型号:
</div
>
<div
class=
"info-value"
>
{{
trayInfo
.
productModel
||
'--'
}}
</div
>
</div
>
<!--
<div
class=
"info-row"
>
--
>
<!--
<div
class=
"info-label"
>
产品型号:
</div>
--
>
<!--
<div
class=
"info-value"
>
{{
trayInfo
.
productModel
||
'--'
}}
</div>
--
>
<!--
</div>
--
>
<div
class=
"info-row"
>
<div
class=
"info-label"
>
当前状态:
</div>
<div
class=
"info-value"
:class=
"trayInfo.statusClass || 'status-idle'"
>
...
...
@@ -83,10 +83,7 @@
<!-- 操作按钮区域 -->
<div
class=
"tray-actions"
>
<button
class=
"btn-action btn-load"
@
click=
"loadTray"
>
<i
class=
"icon-load"
></i>
上料
</button>
<button
class=
"btn-action btn-power"
@
click=
"powerOn"
>
<i
class=
"icon-power"
></i>
上电
<i
class=
"icon-load"
></i>
下料
</button>
</div>
</div>
...
...
@@ -243,7 +240,7 @@ export default {
// 操作按钮方法
loadTray
()
{
this
.
$message
.
success
(
"
上
料操作已执行"
);
this
.
$message
.
success
(
"
下
料操作已执行"
);
},
powerOn
()
{
...
...
@@ -337,9 +334,11 @@ export default {
/* 状态背景色 */
.status-idle
{
background
:
linear-gradient
(
to
bottom
,
rgba
(
255
,
255
,
255
,
0.15
),
rgba
(
0
,
0
,
0
,
0.2
));
border-color
:
rgba
(
100
,
180
,
255
,
0.6
)
!important
;
border-color
:
rgba
(
240
,
240
,
240
,
1
)
!important
;
}
.status-running
{
background
:
linear-gradient
(
to
bottom
,
rgba
(
100
,
255
,
100
,
0.15
),
rgba
(
0
,
80
,
0
,
0.2
))
!important
;
border-color
:
rgba
(
100
,
255
,
100
,
0.8
)
!important
;
...
...
zhmes-agecal-web/src/views/screen/components/TrayBinding.vue
View file @
9eb47dd7
...
...
@@ -109,7 +109,7 @@
<
script
>
import
{
getAllBinding
,
batchAdd
,
batchUpdateDeviceCode
}
from
"@/api/palletDeviceBinding/binding"
import
{
resetAll
}
from
"@/api/palletDeviceBinding/binding"
export
default
{
name
:
"TrayBinding"
,
props
:
{
...
...
@@ -124,11 +124,31 @@ export default {
handler
(
newVal
)
{
this
.
fTrayId
=
newVal
.
fTrayId
;
this
.
fTrayCode
=
newVal
.
fTrayCode
;
this
.
trayStatus
=
newVal
.
s
tatus
;
// 从父组件获取托盘状态
this
.
trayStatus
=
newVal
.
fS
tatus
;
// 从父组件获取托盘状态
// 查询托盘是否有绑定的设备数据
this
.
getAllBindingData
(
newVal
.
fTrayId
);
}
},
// 监听输入框内容变化,实现手动输入自动触发
deviceInput
(
newVal
)
{
// 清除上一次的计时器
if
(
this
.
inputTimer
)
{
clearTimeout
(
this
.
inputTimer
);
}
// 输入为空时不触发
if
(
!
newVal
.
trim
())
return
;
// 500ms内无输入变化,则视为输入完成,自动触发addDevice
this
.
inputTimer
=
setTimeout
(()
=>
{
this
.
addDevice
();
},
500
);
// 可根据需求调整延迟时间(如300ms-1000ms)
},
},
beforeDestroy
()
{
// 组件销毁时清除计时器,避免内存泄漏
if
(
this
.
inputTimer
)
{
clearTimeout
(
this
.
inputTimer
);
}
},
data
()
{
return
{
...
...
@@ -156,7 +176,9 @@ export default {
activeCell
:
0
,
// 设备输入
deviceInput
:
''
deviceInput
:
''
,
inputTimer
:
null
,
// 用于记录输入计时器
};
},
computed
:
{
...
...
@@ -215,7 +237,7 @@ export default {
// 计算初始异常设备数量(标检完成状态)
if
(
this
.
trayStatus
===
'2'
)
{
this
.
abnormalCount
=
this
.
devices
.
filter
(
d
=>
d
.
deviceCode
&&
d
.
status
===
'0
'
d
=>
d
.
deviceCode
&&
d
.
fstatus
!=
'1
'
).
length
;
this
.
initialAbnormalCount
=
this
.
abnormalCount
;
}
...
...
@@ -264,6 +286,17 @@ export default {
// 添加设备到当前激活单元格
addDevice
()
{
// 清除计时器(避免重复触发)
if
(
this
.
inputTimer
)
{
clearTimeout
(
this
.
inputTimer
);
this
.
inputTimer
=
null
;
}
// 原有逻辑:如果输入为空则不处理
if
(
!
this
.
deviceInput
.
trim
())
return
;
if
(
this
.
deviceInput
)
{
// 标检完成状态下的特殊处理
if
(
this
.
trayStatus
===
'2'
)
{
...
...
@@ -349,17 +382,28 @@ export default {
})
}
},
// 重置所有数据
resetAll
()
{
if
(
confirm
(
'确定要重置所有数据吗?'
))
{
this
.
deviceInput
=
''
;
this
.
devices
=
this
.
devices
.
map
(
d
=>
({
...
d
,
deviceCode
:
''
}));
this
.
activeCell
=
0
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
deviceInput
.
focus
();
});
}
this
.
$confirm
(
'确定要重置所有数据吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
resetAll
(
this
.
fTrayId
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
deviceInput
=
''
;
this
.
devices
=
this
.
devices
.
map
(
d
=>
({
...
d
,
deviceCode
:
''
}));
this
.
activeCell
=
0
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
deviceInput
.
focus
();
});
this
.
msgSuccess
(
"已重置"
);
}
else
{
this
.
msgError
(
"重置失败"
);
}
})
}).
catch
(()
=>
{
});
}
},
mounted
()
{
...
...
zhmes-agecal-web/src/views/screen/components/TrayInformation.vue
View file @
9eb47dd7
<
template
>
<div
class=
"tray-container"
>
<div
class=
"tray-header"
>
<div
class=
"tray-title"
>
<div
class=
"title-text"
>
托盘信息管理
</div>
<div
class=
"title-line"
></div>
<!-- 标题区域 -->
<div
class=
"panel-title"
>
<div
class=
"title-with-status"
>
<div
class=
"title-left"
>
<div
class=
"title-text"
>
托盘信息管理
</div>
<div
class=
"title-line"
></div>
</div>
</div>
<!-- 搜索区域 -->
<div
class=
"search-box"
>
<el-input
class=
"search-input"
v-model=
"
searchKeyword
"
v-model=
"
queryParams.fTrayCode
"
placeholder=
"请输入托盘编号"
clearable
@
keyup
.
enter
.
native=
"searchTray"
>
<i
slot=
"prefix"
class=
"el-icon-search"
></i>
</el-input>
<el-button
type=
"primary"
...
...
@@ -25,51 +28,58 @@
</div>
</div>
<!-- 表格内容区 -->
<div
class=
"tray-table-container"
>
<el-table
:data=
"filteredTrays"
border
style=
"width: 100%"
@
row-click=
"handleRowClick"
:row-class-name=
"tableRowClassName"
class=
"tray-table"
>
<el-table-column
prop=
"trayId"
label=
"托盘编号"
width=
"200"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div
class=
"tray-id"
>
{{
scope
.
row
.
fTrayCode
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
width=
"150"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"statusTagType(scope.row.status)"
class=
"status-tag"
>
{{
scope
.
row
.
statusStr
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
prop=
"boardCount"
label=
"主板数量"
width=
"150"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
class=
"board-count"
>
<span
class=
"count-number"
>
{{
scope
.
row
.
boardCount
}}
</span>
<span
class=
"count-label"
>
块
</span>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"location"
label=
"位置"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
class=
"location-text"
>
{{
scope
.
row
.
location
}}
</div>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
>
<!-- 带滚动条的表格容器 -->
<div
class=
"table-scroll-container"
>
<el-table
:data=
"filteredTrays"
border
style=
"width: 100%"
@
row-click=
"handleRowClick"
:row-class-name=
"tableRowClassName"
class=
"tray-table"
:header-cell-style=
"headerCellStyle"
:cell-style=
"cellStyle"
height=
"100%"
>
<el-table-column
prop=
"trayId"
label=
"托盘编号"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div
class=
"tray-id"
>
{{
scope
.
row
.
fTrayCode
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"statusTagType(scope.row.fStatus)"
v-if=
"scope.row.fStatus === '1'"
class=
"status-tag"
>
运行中
</el-tag>
<el-tag
:type=
"statusTagType(scope.row.fStatus)"
v-else
class=
"status-tag"
>
空闲
</el-tag>
</
template
>
</el-table-column>
<el-table-column
prop=
"boardCount"
label=
"主板数量"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
class=
"board-count"
>
<span
class=
"count-number"
>
{{
(
scope
.
row
.
boardCount
==
null
||
scope
.
row
.
boardCount
==
0
)
?
'0'
:
scope
.
row
.
boardCount
}}
</span>
<span
class=
"count-label"
>
块
</span>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"location"
label=
"位置"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
class=
"location-text"
>
{{
scope
.
row
.
location
}}
</div>
</
template
>
</el-table-column>
</el-table>
</div>
<!-- 分页控件 -->
<div
class=
"pagination-container"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"
currentPage
"
:page-sizes=
"[5, 10, 20
, 50
]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next
, jumper
"
:total=
"total
Trays
"
:current-page=
"
queryParams.pageNum
"
:page-sizes=
"[5, 10, 20]"
:page-size=
"
queryParams.
pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
></el-pagination>
</div>
</div>
...
...
@@ -77,22 +87,53 @@
</template>
<
script
>
import
{
queryByDepartmentId
}
from
"@/api/storey/storey"
;
import
{
listTray
}
from
"@/api/tray/tray"
export
default
{
name
:
"TrayInformation"
,
data
()
{
return
{
searchKeyword
:
''
,
trays
:
[],
currentPage
:
1
,
pageSize
:
10
// 总条数
total
:
0
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
fTrayCode
:
undefined
,
},
};
},
created
()
{
this
.
fetchTrays
();
},
computed
:
{
// 表格头部样式
headerCellStyle
()
{
return
{
'background'
:
'linear-gradient(to bottom, rgba(10, 35, 80, 0.9), rgba(8, 28, 65, 0.9))'
,
'color'
:
'#a0d0ff'
,
'font-size'
:
'16px'
,
'font-weight'
:
'bold'
,
'border-bottom'
:
'1px solid rgba(64, 158, 255, 0.5)'
,
'height'
:
'60px'
,
'padding'
:
'0 15px'
,
// 关键:固定表头的样式设置
'position'
:
'sticky'
,
'top'
:
'0'
,
'z-index'
:
'3'
}
},
// 表格单元格样式
cellStyle
()
{
return
{
'border-bottom'
:
'1px solid rgba(64, 158, 255, 0.2)'
,
'padding'
:
'16px 15px'
,
'font-size'
:
'15px'
,
'transition'
:
'all 0.3s ease'
}
},
// 计算过滤后的托盘数据
filteredTrays
()
{
let
filtered
=
this
.
trays
;
...
...
@@ -101,53 +142,28 @@ export default {
tray
.
trayId
.
includes
(
this
.
searchKeyword
)
);
}
// 分页处理
const
start
=
(
this
.
currentPage
-
1
)
*
this
.
pageSize
;
const
end
=
start
+
this
.
pageSize
;
return
filtered
.
slice
(
start
,
end
);
return
filtered
;
},
totalTrays
()
{
if
(
this
.
searchKeyword
)
{
return
this
.
trays
.
filter
(
tray
=>
tray
.
trayId
.
includes
(
this
.
searchKeyword
)
).
length
;
}
return
this
.
trays
.
length
;
}
},
methods
:
{
//
模拟API请求
//
获取托盘数据
fetchTrays
()
{
// 实际项目中替换为真实的API请求
// 0 空闲
// 1 运行中
// 2 标检完成
setTimeout
(()
=>
{
this
.
trays
=
[
{
fTrayId
:
1
,
fTrayCode
:
'TP20240001'
,
status
:
'2'
,
statusStr
:
"标检完成"
,
boardCount
:
0
,
location
:
'A区-1号架'
},
{
fTrayId
:
2
,
fTrayCode
:
'TP20240002'
,
status
:
'0'
,
statusStr
:
"空闲"
,
boardCount
:
8
,
location
:
'B区-3号架'
},
{
fTrayId
:
3
,
fTrayCode
:
'TP20240003'
,
status
:
'1'
,
statusStr
:
"运行中"
,
boardCount
:
12
,
location
:
'C区-2号架'
},
{
fTrayId
:
4
,
fTrayCode
:
'TP20240004'
,
status
:
'2'
,
statusStr
:
"标检完成"
,
boardCount
:
0
,
location
:
'维修区'
},
{
fTrayId
:
5
,
fTrayCode
:
'TP20240005'
,
status
:
'0'
,
statusStr
:
"空闲"
,
boardCount
:
0
,
location
:
'D区-4号架'
},
{
fTrayId
:
6
,
fTrayCode
:
'TP20240006'
,
status
:
'1'
,
statusStr
:
"运行中"
,
boardCount
:
5
,
location
:
'E区-1号架'
},
{
fTrayId
:
7
,
fTrayCode
:
'TP20240007'
,
status
:
'2'
,
statusStr
:
"标检完成"
,
boardCount
:
12
,
location
:
'F区-2号架'
},
{
fTrayId
:
8
,
fTrayCode
:
'TP20240008'
,
status
:
'0'
,
statusStr
:
"空闲"
,
boardCount
:
0
,
location
:
'G区-5号架'
},
{
fTrayId
:
9
,
fTrayCode
:
'TP20240009'
,
status
:
'1'
,
statusStr
:
"运行中"
,
boardCount
:
10
,
location
:
'H区-3号架'
},
{
fTrayId
:
10
,
fTrayCode
:
'TP20240110'
,
status
:
'2'
,
statusStr
:
"标检完成"
,
boardCount
:
12
,
location
:
'I区-1号架'
}
];
},
500
);
listTray
(
this
.
queryParams
).
then
(
response
=>
{
this
.
trays
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
})
},
// 搜索托盘
searchTray
()
{
this
.
currentPage
=
1
;
this
.
queryParams
.
pageNum
=
1
;
this
.
fetchTrays
();
},
// 处理行点击
handleRowClick
(
row
)
{
// 触发事件传递 cabinetId 给父组件
// 4 是 TrayBinding 的组件
this
.
$emit
(
'cabinet-click'
,
row
,
4
);
this
.
$emit
(
'cabinet-click'
,
row
,
4
);
},
// 设置行样式
...
...
@@ -156,51 +172,65 @@ export default {
},
// 状态标签类型
// 0 空闲
// 1 运行中
// 2 标检完成
statusTagType
(
status
)
{
const
statusMap
=
{
'0'
:
'success'
,
'1'
:
'primary'
,
'2'
:
'danger'
};
return
statusMap
[
status
]
||
'info'
;
},
// 分页处理
handleSizeChange
(
size
)
{
this
.
pageSize
=
size
;
this
.
currentPage
=
1
;
handleSizeChange
(
val
)
{
this
.
queryParams
.
pageSize
=
val
;
this
.
queryParams
.
pageNum
=
1
;
this
.
fetchTrays
();
},
handleCurrentChange
(
page
)
{
this
.
currentPage
=
page
;
}
handleCurrentChange
(
val
)
{
this
.
queryParams
.
pageNum
=
val
;
this
.
fetchTrays
();
},
}
}
</
script
>
<
style
scoped
>
/* 主容器样式 */
.tray-container
{
width
:
100%
;
height
:
100%
;
min-height
:
100%
;
background
:
rgba
(
10
,
20
,
40
,
0.85
);
border-radius
:
12px
;
padding
:
20px
;
font-family
:
"Helvetica Neue"
,
Helvetica
,
"PingFang SC"
,
"Hiragino Sans GB"
,
Arial
,
sans-serif
;
background
:
rgba
(
4
,
18
,
57
,
0.7
);
border-radius
:
8px
;
box-shadow
:
0
0
20px
rgba
(
0
,
153
,
255
,
0.2
);
border
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
box-shadow
:
0
0
20px
rgba
(
0
,
50
,
120
,
0.3
);
box-sizing
:
border-box
;
overflow
:
hidden
;
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
}
.tray-header
{
/* 标题区域样式 */
.panel-title
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
25px
;
padding-bottom
:
15px
;
border-bottom
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
width
:
100%
;
}
.title-with-status
{
display
:
flex
;
align-items
:
center
;
gap
:
15px
;
}
.t
ray-title
{
.t
itle-left
{
display
:
flex
;
flex-direction
:
column
;
}
...
...
@@ -221,14 +251,16 @@ export default {
border-radius
:
2px
;
}
/* 搜索区域样式 */
.search-box
{
display
:
flex
;
max-width
:
500px
;
gap
:
10px
;
width
:
auto
;
}
.search-input
{
flex
:
1
;
margin-right
:
15
px
;
min-width
:
200px
;
width
:
300
px
;
}
.search-input
>>>
.el-input__inner
{
...
...
@@ -245,54 +277,145 @@ export default {
}
.search-button
{
height
:
40px
;
padding
:
0
25px
;
background
:
linear-gradient
(
90deg
,
#409EFF
,
#1a73e8
);
background
:
linear-gradient
(
to
right
,
#409EFF
,
#64c8ff
);
color
:
white
;
border
:
none
;
padding
:
8px
16px
;
border-radius
:
4px
;
cursor
:
pointer
;
font-size
:
14px
;
font-weight
:
bold
;
letter-spacing
:
1px
;
box-shadow
:
0
0
10px
rgba
(
64
,
158
,
255
,
0.5
);
transition
:
all
0.3s
ease
;
display
:
flex
;
align-items
:
center
;
box-shadow
:
0
2px
6px
rgba
(
0
,
0
,
0
,
0.3
);
transition
:
all
0.3s
;
height
:
40px
;
}
.search-button
:hover
{
background
:
linear-gradient
(
to
right
,
#64c8ff
,
#409EFF
);
transform
:
translateY
(
-2px
);
box-shadow
:
0
5px
15px
rgba
(
64
,
158
,
255
,
0.7
);
box-shadow
:
0
4px
8px
rgba
(
0
,
0
,
0
,
0.4
);
}
.search-button
i
{
margin-right
:
5px
;
}
/* 表格容器样式 */
.tray-table-container
{
margin-top
:
15px
;
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
position
:
relative
;
border-radius
:
10px
;
overflow
:
hidden
;
border
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
box-shadow
:
0
0
20px
rgba
(
0
,
153
,
255
,
0.15
);
margin-top
:
10px
;
}
/* 表格滚动容器 */
.table-scroll-container
{
flex
:
1
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
position
:
relative
;
}
/* 自定义滚动条样式,与整体风格统一 */
.table-scroll-container
::-webkit-scrollbar
{
width
:
8px
;
}
.table-scroll-container
::-webkit-scrollbar-track
{
background
:
rgba
(
10
,
35
,
80
,
0.5
);
border-radius
:
4px
;
}
.table-scroll-container
::-webkit-scrollbar-thumb
{
background
:
rgba
(
64
,
158
,
255
,
0.5
);
border-radius
:
4px
;
border
:
1px
solid
rgba
(
64
,
158
,
255
,
0.2
);
}
.table-scroll-container
::-webkit-scrollbar-thumb:hover
{
background
:
rgba
(
64
,
158
,
255
,
0.8
);
box-shadow
:
0
0
10px
rgba
(
64
,
158
,
255
,
0.5
);
}
.table-scroll-container
::-webkit-scrollbar-button
{
display
:
none
;
}
/* 表格样式 */
.tray-table
>>>
.el-table
{
background
:
transparent
;
color
:
#e0f0ff
;
border-radius
:
10px
10px
0
0
;
overflow
:
hidden
;
width
:
100%
;
}
/* 表头样式增强 - 确保固定效果 */
.tray-table
>>>
.el-table__header
{
overflow
:
visible
!important
;
}
.tray-table
>>>
.el-table__header-wrapper
{
overflow
:
visible
!important
;
}
.tray-table
>>>
.el-table
th
{
background
:
rgba
(
10
,
35
,
80
,
0.8
);
background
:
linear-gradient
(
to
bottom
,
rgba
(
10
,
35
,
80
,
0.9
),
rgba
(
8
,
28
,
65
,
0.9
)
);
color
:
#a0d0ff
;
font-size
:
16px
;
font-weight
:
bold
;
border-bottom
:
1px
solid
#409EFF
;
border-bottom
:
1px
solid
rgba
(
64
,
158
,
255
,
0.5
);
height
:
60px
;
/* 关键:表头固定的核心样式 */
position
:
sticky
!important
;
top
:
0
!important
;
z-index
:
3
!important
;
/* 防止表头边框在滚动时被遮挡 */
box-shadow
:
0
1px
0
rgba
(
64
,
158
,
255
,
0.5
);
}
/* 处理表格边框在滚动时的显示问题 */
.tray-table
>>>
.el-table__body-wrapper
{
position
:
relative
;
z-index
:
1
;
}
.tray-table
>>>
.el-table
tr
{
background
:
rgba
(
8
,
28
,
65
,
0.5
);
transition
:
all
0.3s
ease
;
}
.tray-table
>>>
.el-table
tr
:hover
{
background
:
rgba
(
15
,
45
,
90
,
0.7
)
!important
;
transform
:
translateY
(
-2px
);
box-shadow
:
0
4px
12px
rgba
(
0
,
100
,
255
,
0.2
);
}
.tray-table
>>>
.el-table
td
{
border-bottom
:
1px
solid
rgba
(
64
,
158
,
255
,
0.2
);
padding
:
12px
0
;
padding
:
16px
15px
;
font-size
:
15px
;
}
.tray-table
>>>
.el-table--border
{
border
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
border
:
none
;
}
.tray-table
>>>
.el-table--border
th
,
.tray-table
>>>
.el-table--border
td
{
border-right
:
1px
solid
rgba
(
64
,
158
,
255
,
0.2
);
}
.tray-table
>>>
.el-table--border
th
:last-child
,
.tray-table
>>>
.el-table--border
td
:last-child
{
border-right
:
none
;
}
.tray-table
>>>
.el-table--border
::after
,
...
...
@@ -301,6 +424,7 @@ export default {
background-color
:
rgba
(
64
,
158
,
255
,
0.3
);
}
/* 表格内容样式 */
.tray-id
{
font-weight
:
bold
;
color
:
#6dc6ff
;
...
...
@@ -314,6 +438,7 @@ export default {
line-height
:
28px
;
min-width
:
80px
;
text-align
:
center
;
box-shadow
:
0
0
8px
rgba
(
64
,
158
,
255
,
0.3
);
}
.board-count
{
...
...
@@ -327,6 +452,7 @@ export default {
font-weight
:
bold
;
color
:
#ffcf5c
;
margin-right
:
5px
;
text-shadow
:
0
0
8px
rgba
(
255
,
207
,
92
,
0.3
);
}
.count-label
{
...
...
@@ -337,41 +463,157 @@ export default {
color
:
#a0d0ff
;
}
.pagination
{
margin-top
:
25px
;
.clickable-row
{
cursor
:
pointer
;
}
/* 分页样式 */
.pagination-container
{
background
:
rgba
(
10
,
35
,
80
,
0.7
);
padding
:
15px
20px
;
border-top
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
display
:
flex
;
justify-content
:
flex-end
;
align-items
:
center
;
}
.pagination
>>>
.el-pagination
{
.pagination
-container
>>>
.el-pagination
{
color
:
#a0d0ff
;
}
.pagination
>>>
.el-pagination
button
,
.pagination
>>>
.el-pager
li
{
background
:
rgba
(
10
,
35
,
80
,
0.6
);
.pagination-container
>>>
.el-pagination__total
{
color
:
#a0d0ff
;
margin-right
:
15px
;
}
.pagination-container
>>>
.el-pagination
button
{
background
:
transparent
;
color
:
#a0d0ff
;
border
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
border-radius
:
6px
;
min-width
:
32px
;
height
:
32px
;
margin
:
0
3px
;
border-radius
:
4px
;
transition
:
all
0.3s
ease
;
}
.pagination
>>>
.el-pagination
button
:hover
,
.pagination
>>>
.el-pager
li
:hover
{
color
:
#409EFF
;
.pagination-container
>>>
.el-pagination
button
:hover
{
background
:
rgba
(
64
,
158
,
255
,
0.2
);
color
:
#6dc6ff
;
border-color
:
rgba
(
64
,
158
,
255
,
0.5
);
}
.pagination
>>>
.el-pager
li
.active
{
background
:
linear-gradient
(
90deg
,
#409EFF
,
#1a73e8
);
color
:
#fff
;
.pagination-container
>>>
.el-pager
li
{
background
:
transparent
;
color
:
#a0d0ff
;
min-width
:
32px
;
height
:
32px
;
line-height
:
32px
;
margin
:
0
3px
;
border-radius
:
6px
;
border
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
transition
:
all
0.3s
ease
;
}
.pagination-container
>>>
.el-pager
li
:hover
{
color
:
#6dc6ff
;
background
:
rgba
(
64
,
158
,
255
,
0.1
);
border-color
:
rgba
(
64
,
158
,
255
,
0.5
);
}
.pagination-container
>>>
.el-pager
li
.active
{
background
:
linear-gradient
(
135deg
,
#409EFF
0%
,
#1a73e8
100%
);
color
:
white
;
border
:
none
;
box-shadow
:
0
0
10px
rgba
(
64
,
158
,
255
,
0.5
);
}
.clickable-row
{
cursor
:
pointer
;
.pagination-container
>>>
.el-pagination__sizes
{
margin-right
:
15px
;
}
.pagination-container
>>>
.el-pagination__sizes
.el-input
.el-input__inner
{
background
:
rgba
(
10
,
30
,
70
,
0.6
);
border
:
1px
solid
rgba
(
64
,
158
,
255
,
0.3
);
color
:
#e0f0ff
;
border-radius
:
6px
;
}
.clickable-row
:hover
{
background-color
:
rgba
(
64
,
158
,
255
,
0.1
)
!important
;
/* 响应式设计 */
@media
(
max-width
:
1024px
)
{
.search-input
{
width
:
250px
;
}
.table-scroll-container
{
max-height
:
calc
(
100vh
-
300px
);
}
}
@media
(
max-width
:
800px
)
{
.panel-title
{
flex-direction
:
column
;
align-items
:
flex-start
;
gap
:
15px
;
}
.search-box
{
width
:
100%
;
justify-content
:
flex-start
;
}
.search-input
{
width
:
100%
;
min-width
:
auto
;
}
/* 表格列自适应 */
.tray-table
>>>
.el-table
th
,
.tray-table
>>>
.el-table
td
{
padding
:
12px
8px
;
font-size
:
14px
;
}
.table-scroll-container
{
max-height
:
calc
(
100vh
-
340px
);
}
}
@media
(
max-width
:
500px
)
{
.title-text
{
font-size
:
18px
;
}
.title-line
{
width
:
80px
;
}
.pagination-container
{
padding
:
10px
;
}
.pagination-container
>>>
.el-pagination
{
font-size
:
12px
;
}
.pagination-container
>>>
.el-pagination__total
{
display
:
none
;
}
.tray-table
>>>
.el-table
th
,
.tray-table
>>>
.el-table
td
{
padding
:
8px
4px
;
font-size
:
13px
;
}
.status-tag
{
padding
:
0
8px
;
min-width
:
60px
;
font-size
:
12px
;
}
.table-scroll-container
{
max-height
:
calc
(
100vh
-
320px
);
}
}
</
style
>
zhmes-agecal-web/src/views/screen/index.vue
View file @
9eb47dd7
...
...
@@ -292,7 +292,7 @@ export default {
}
}
.content-area
{
padding
:
20px
4
0px
;
padding
:
20px
2
0px
;
flex
:
1
;
min-height
:
calc
(
100vh
-
150px
);
overflow-y
:
auto
;
...
...
@@ -327,7 +327,7 @@ export default {
.scroll-container
{
flex
:
1
;
max-height
:
calc
(
100vh
-
1
5
0px
);
max-height
:
calc
(
100vh
-
1
6
0px
);
overflow-y
:
auto
;
padding
:
0
0px
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment