diff --git a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipDrawingsController.java b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipDrawingsController.java index a331fcf..f97d8a1 100644 --- a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipDrawingsController.java +++ b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipDrawingsController.java @@ -4,14 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; 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; -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 org.springframework.web.bind.annotation.*; import com.inspur.common.annotation.Log; import com.inspur.common.core.controller.BaseController; import com.inspur.common.core.domain.AjaxResult; @@ -46,6 +39,12 @@ public class IpcEquipDrawingsController extends BaseController return getDataTable(list); } + @GetMapping("/listByEquipId") + public AjaxResult listByEquipId(@RequestParam String equipId) + { + return AjaxResult.success(ipcEquipDrawingsService.selectIpcEquipDrawingsListByEquipId(equipId)); + } + /** * 导出图纸信息列表 */ diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipDrawingsService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipDrawingsService.java index ec78742..a8c4da3 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipDrawingsService.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipDrawingsService.java @@ -27,6 +27,11 @@ public interface IIpcEquipDrawingsService */ public List selectIpcEquipDrawingsList(IpcEquipDrawings ipcEquipDrawings); + /** + * 通过设备id查询图纸信息列表 + */ + public List selectIpcEquipDrawingsListByEquipId(String equipId); + /** * 新增图纸信息 * diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipDrawingsServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipDrawingsServiceImpl.java index 318d671..cde3100 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipDrawingsServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipDrawingsServiceImpl.java @@ -45,6 +45,16 @@ public class IpcEquipDrawingsServiceImpl implements IIpcEquipDrawingsService return ipcEquipDrawingsMapper.selectIpcEquipDrawingsList(ipcEquipDrawings); } + /** + * 通过设备id查询图纸信息列表 + */ + @Override + public List selectIpcEquipDrawingsListByEquipId(String equipId){ + IpcEquipDrawings query = new IpcEquipDrawings(); + query.setEquipId(equipId); + return ipcEquipDrawingsMapper.selectIpcEquipDrawingsList(query); + } + /** * 新增图纸信息 * diff --git a/zfipc-ui/src/api/equip/equip.js b/zfipc-ui/src/api/equip/equip.js index 265a302..afcd0c1 100644 --- a/zfipc-ui/src/api/equip/equip.js +++ b/zfipc-ui/src/api/equip/equip.js @@ -33,6 +33,14 @@ export function getInfoByParentId(query) { }); } +//通过部门获取设备树 +export function getEquipTreeByDept(query) { + return request({ + url: "/equip/info/getEquipTreeByDept", + method: "get", + params: query, + }); +} // 查询设备信息详细 export function getInfo(id) { return request({ diff --git a/zfipc-ui/src/views/eqmanagement/drawings/index.vue b/zfipc-ui/src/views/eqmanagement/drawings/index.vue index c518c58..57709d9 100644 --- a/zfipc-ui/src/views/eqmanagement/drawings/index.vue +++ b/zfipc-ui/src/views/eqmanagement/drawings/index.vue @@ -9,6 +9,25 @@ label-width="68px" style="text-align:right" > + + + + + + - - - @@ -250,7 +259,10 @@ - + { + this.equipOptions = response.data; + this.equipDisabled = false; + }); + }, + /** 查询部门下拉树结构 */ + getDeptTree() { + deptTreeSelect().then((response) => { + this.deptOptions = response.data; + }); + }, /** 查询图纸信息列表 */ getList() { this.loading = true; @@ -515,6 +559,8 @@ export default { /** 重置按钮操作 */ resetQuery() { this.queryParams.equipIds = null; + this.queryParams.deptIds = null; + this.equipDisabled = true; this.resetForm("queryForm"); this.handleQuery(); }, diff --git a/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue b/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue index 31f3da1..ae7fb72 100644 --- a/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue +++ b/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue @@ -314,6 +314,18 @@ icon="el-icon-document" @click="handleDetails(scope.row)" >详情 + 巡检记录 + 报警记录 @@ -807,7 +826,7 @@ :title="fileDownloadTitle" :visible.sync="downloadOpen" width="800px" - :fullscreen="true" + :before-close="cancelDownload" append-to-body > - + 取 消 + @@ -1311,6 +1325,191 @@ 取 消 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1342,6 +1541,9 @@ import { deptTreeSelect } from "@/api/system/user"; import _ from "lodash"; import { listUpkeepRecord } from "@/api/upkeep/record"; import { listMaintRecord } from "@/api/maintenance/record"; +import { listTask } from "@/api/patrol/task"; +import { listRecord } from "@/api/industrial/record"; +import { listDrawings, listDrawingsByEquipId } from "@/api/equip/drawings"; export default { name: "Info", components: { @@ -1355,6 +1557,8 @@ export default { "upkeep_priority", "upkeep_plan_complete_status", "maintenance_status", + "patrol_task_status", + "patrol_type", ], data() { return { @@ -1639,6 +1843,26 @@ export default { children: "children", label: "label", }, + //巡检记录 + patrolTitle: "巡检记录", + patrolOpen: false, + patrolLoading: false, + patrolList: [], + patrolTotal: 0, + queryParamsPatrol: { + pageNum: 1, + pageSize: 10, + }, + //报警记录 + alarmTitle: "报警记录", + alarmOpen: false, + alarmLoading: false, + alarmList: [], + alarmTotal: 0, + queryParamsAlarm: { + pageNum: 1, + pageSize: 10, + }, }; }, watch: { @@ -1654,6 +1878,95 @@ export default { this.getDeptTree(); }, methods: { + //图纸下载 + cancelDownload() { + this.downloadOpen = false; + this.fileList = []; + this.fileDataList = []; + }, + handleDrawingDownload(row) { + this.fileDownloadTitle = "图纸下载"; + this.downloadOpen = true; + this.form = row; + const query = {}; + query.equipId = row.id; + listDrawingsByEquipId(query).then((response) => { + const list = response.data; + if (list.length == 0) { + return; + } + this.fileList = []; + this.fileDataList = []; + list.forEach((drawData) => { + const data = drawData.equipDrawingPath; + if (data != null && data.length != 0) { + console.log("图纸数据:", data); + var paths = data.split(","); + paths.forEach((f) => { + var fileInfo = f.split("/"); + this.fileList.push({ + name: fileInfo.slice(-1)[0], + path: f, + }); + var fileDetail = fileInfo.slice(-1)[0]; + this.fileDataList.push({ + name: fileDetail, + type: fileDetail.split(".").slice(-1)[0], + url: process.env.VUE_APP_BASE_API + f, + }); + }); + } + }); + }); + }, + //报警对话框方法 + getAlarmList() { + this.alarmLoading = true; + this.queryParamsAlarm.equipId = this.selectedEquipId; + listRecord(this.queryParamsAlarm).then((response) => { + this.alarmList = response.rows; + this.alarmTotal = response.total; + this.alarmLoading = false; + }); + }, + handleAlarm(row) { + this.selectedEquipId = row.id; + this.getAlarmList(); + this.alarmOpen = true; + }, + alarmCancel() { + this.alarmOpen = false; + this.alarmList = []; + this.alarmTotal = 0; + this.queryParamsAlarm = { + pageNum: 1, + pageSize: 10, + }; + }, + //巡检对话框方法 + getPatrolList() { + this.patrolLoading = true; + this.queryParamsPatrol.equipId = this.selectedEquipId; + listTask(this.queryParamsPatrol).then((response) => { + this.patrolList = response.rows; + this.patrolTotal = response.total; + this.patrolLoading = false; + }); + }, + handlePatrol(row) { + this.selectedEquipId = row.id; + this.patrolOpen = true; + this.getPatrolList(); + }, + patrolCancel() { + this.patrolOpen = false; + this.patrolList = []; + this.patrolTotal = 0; + this.queryParamsPatrol = { + pageNum: 1, + pageSize: 10, + }; + }, // 筛选节点 filterNode(value, data) { if (!value) return true; @@ -1670,6 +1983,10 @@ export default { this.maintTotal = 0; this.upkeepList = []; this.upkeepTotal = 0; + this.queryParamsMaint = this.queryParamsUpkeep = { + pageNum: 1, + pageSize: 10, + }; }, //维修信息 getUpkeepList() { @@ -1733,7 +2050,6 @@ export default { submitUploadFiles(row) { // this.fileLoading = true; - console.log("row:", row); //文件上传 this.fileData = new FormData(); this.$refs.upload.submit(); @@ -1741,12 +2057,10 @@ export default { Authorization: "Bearer " + getToken(), }); this.fileData.append("withCredentials", false); - console.log("fileData:", this.fileData.get("files")); //更新表单文件列表数据 uploadFile(this.fileData).then((res) => { this.uploadFileForm.equipFilesPath = row.equipFilesPath + "," + res.fileNames; - console.log("拼接设备文件:", this.uploadFileForm.equipFilesPath); updateInfo(this.uploadFileForm).then((response) => { if (response.code == 200) { this.$modal.msgSuccess("文件上传成功!"); @@ -1808,6 +2122,7 @@ export default { handleFileDownload(row) { // var filePaths = row.equipFilesPath; // var suffix = url.substring(url.lastIndexOf("."), url.length); + this.fileDownloadTitle = "文件下载"; this.downloadOpen = true; this.fileList = []; this.fileDataList = []; @@ -1819,10 +2134,10 @@ export default { name: fileInfo.slice(-1)[0], path: f, }); - var fileDetail = fileInfo.slice(-1)[0].split("."); + var fileDetail = fileInfo.slice(-1)[0]; this.fileDataList.push({ - name: fileDetail.slice(0)[0], - type: fileDetail.slice(-1)[0], + name: fileDetail, + type: fileDetail.split(".").slice(-1)[0], url: process.env.VUE_APP_BASE_API + f, }); });