设备状态变化信息修改

This commit is contained in:
zhangjunwen 2024-06-27 13:55:50 +08:00
parent cdfb2935dc
commit 3acf727538
3 changed files with 77 additions and 1 deletions

View File

@ -26,7 +26,7 @@ public class IpcRunningStatusRecord extends BaseEntity
private String runningStatus; private String runningStatus;
/** 开始时间 */ /** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime; private Date startTime;

View File

@ -41,6 +41,7 @@ export function getEquipTreeByDept(query) {
params: query, params: query,
}); });
} }
// 查询设备信息详细 // 查询设备信息详细
export function getInfo(id) { export function getInfo(id) {
return request({ return request({
@ -49,6 +50,15 @@ export function getInfo(id) {
}); });
} }
// 查询设备信息列表
export function listInfoStatus(query) {
return request({
url: "/equip/info/listEquipStatus",
method: "get",
params: query,
});
}
// 新增设备信息 // 新增设备信息
export function addInfo(data) { export function addInfo(data) {
return request({ return request({

View File

@ -314,6 +314,46 @@
icon="el-icon-document" icon="el-icon-document"
@click="handleDetails(scope.row)" @click="handleDetails(scope.row)"
>详情</el-button> >详情</el-button>
<el-popover
:title="statusDataTitle(scope.row)"
placement="right"
width="400"
trigger="click"
>
<div class="block">
<el-timeline>
<el-timeline-item
v-for="(data, index) in timelineData"
:key="index"
:icon="changeIcon(index)"
:type="data.type"
:color="changeColor(index)"
size="large"
:timestamp="data.startTime"
>
<!-- {{data.equipStatus}} -->
<dict-tag
:options="dict.type.equip_status"
:value="data.runningStatus"
/>
</el-timeline-item>
</el-timeline>
<div
v-if="timeLoading"
class="loading-indicator"
>加载中...</div>
</div>
<el-button
size="mini"
type="text"
slot="reference"
icon="el-icon-s-management"
@click="handleStatusChange(scope.row)"
v-hasPermi="['system:info:edit']"
>状态数据
</el-button>
</el-popover>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -1525,6 +1565,7 @@ import {
uploadImg, uploadImg,
uploadFile, uploadFile,
queryInfo, queryInfo,
listInfoStatus,
} from "@/api/equip/equip"; } from "@/api/equip/equip";
import { import {
@ -1863,6 +1904,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
timelineData: [],
timeLoading: false,
}; };
}, },
watch: { watch: {
@ -1878,6 +1921,29 @@ export default {
this.getDeptTree(); this.getDeptTree();
}, },
methods: { methods: {
handleStatusChange(row) {
var query = {
equipId: row.id,
};
this.timeLoading = true;
listInfoStatus(query).then((response) => {
this.timelineData = response.data;
this.timeLoading = false;
});
},
changeIcon(index) {
if (index === 0) {
return "el-icon-check";
}
},
changeColor(index) {
if (index === 0) {
return "green";
}
},
statusDataTitle(row) {
return row.equipName + "的状态数据";
},
// //
cancelDownload() { cancelDownload() {
this.downloadOpen = false; this.downloadOpen = false;