This commit is contained in:
wangyan21 2023-12-04 17:20:29 +08:00
commit 6deffbbcba
38 changed files with 7036 additions and 12 deletions

View File

@ -0,0 +1,155 @@
package com.god.web.controller.constructionMachinery;
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 com.god.common.annotation.Log;
import com.god.common.core.controller.BaseController;
import com.god.common.core.domain.AjaxResult;
import com.god.common.enums.BusinessType;
import com.god.constructionMachinery.domain.GcjxDeviceReport;
import com.god.constructionMachinery.service.IGcjxDeviceReportService;
import com.god.common.utils.poi.ExcelUtil;
import com.god.common.core.page.TableDataInfo;
/**
* 工程机械-报表中心Controller
*
* @author god
* @date 2023-12-04
*/
@RestController
@RequestMapping("/constructionMachinery/devicereport")
public class GcjxDeviceReportController extends BaseController
{
@Autowired
private IGcjxDeviceReportService gcjxDeviceReportService;
/**
* 查询工程机械-报表中心列表
*/
// @PreAuthorize("@ss.hasPermi('constructionMachinery:devicereport:list')")
@GetMapping("/list")
public TableDataInfo list(GcjxDeviceReport gcjxDeviceReport)
{
startPage();
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportList(gcjxDeviceReport);
return getDataTable(list);
}
@GetMapping("/listWeek")
public TableDataInfo listWeek(GcjxDeviceReport gcjxDeviceReport)
{
startPage();
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportListByWeek(gcjxDeviceReport);
return getDataTable(list);
}
@GetMapping("/listMonth")
public TableDataInfo listMonth(GcjxDeviceReport gcjxDeviceReport)
{
startPage();
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportListByMonth(gcjxDeviceReport);
return getDataTable(list);
}
@GetMapping("/listYear")
public TableDataInfo listYear(GcjxDeviceReport gcjxDeviceReport)
{
startPage();
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportListByYear(gcjxDeviceReport);
return getDataTable(list);
}
/**
* 导出工程机械-报表中心列表
*/
// @PreAuthorize("@ss.hasPermi('constructionMachinery:devicereport:export')")
@Log(title = "工程机械-报表中心", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, GcjxDeviceReport gcjxDeviceReport)
{
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportList(gcjxDeviceReport);
ExcelUtil<GcjxDeviceReport> util = new ExcelUtil<GcjxDeviceReport>(GcjxDeviceReport.class);
util.exportExcel(response, list, "工程机械-报表中心数据");
}
@Log(title = "工程机械-报表中心", businessType = BusinessType.EXPORT)
@PostMapping("/exportWeek")
public void exportWeek(HttpServletResponse response, GcjxDeviceReport gcjxDeviceReport)
{
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportListByWeek(gcjxDeviceReport);
ExcelUtil<GcjxDeviceReport> util = new ExcelUtil<GcjxDeviceReport>(GcjxDeviceReport.class);
util.exportExcel(response, list, "工程机械-报表中心数据");
}
@Log(title = "工程机械-报表中心", businessType = BusinessType.EXPORT)
@PostMapping("/exportMonth")
public void exportMonth(HttpServletResponse response, GcjxDeviceReport gcjxDeviceReport)
{
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportListByMonth(gcjxDeviceReport);
ExcelUtil<GcjxDeviceReport> util = new ExcelUtil<GcjxDeviceReport>(GcjxDeviceReport.class);
util.exportExcel(response, list, "工程机械-报表中心数据");
}
@Log(title = "工程机械-报表中心", businessType = BusinessType.EXPORT)
@PostMapping("/exportYear")
public void exportYear(HttpServletResponse response, GcjxDeviceReport gcjxDeviceReport)
{
List<GcjxDeviceReport> list = gcjxDeviceReportService.selectGcjxDeviceReportListByYear(gcjxDeviceReport);
ExcelUtil<GcjxDeviceReport> util = new ExcelUtil<GcjxDeviceReport>(GcjxDeviceReport.class);
util.exportExcel(response, list, "工程机械-报表中心数据");
}
/**
* 获取工程机械-报表中心详细信息
*/
// @PreAuthorize("@ss.hasPermi('constructionMachinery:devicereport:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(gcjxDeviceReportService.selectGcjxDeviceReportById(id));
}
/**
* 新增工程机械-报表中心
*/
// @PreAuthorize("@ss.hasPermi('constructionMachinery:devicereport:add')")
@Log(title = "工程机械-报表中心", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody GcjxDeviceReport gcjxDeviceReport)
{
return toAjax(gcjxDeviceReportService.insertGcjxDeviceReport(gcjxDeviceReport));
}
/**
* 修改工程机械-报表中心
*/
// @PreAuthorize("@ss.hasPermi('constructionMachinery:devicereport:edit')")
@Log(title = "工程机械-报表中心", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody GcjxDeviceReport gcjxDeviceReport)
{
return toAjax(gcjxDeviceReportService.updateGcjxDeviceReport(gcjxDeviceReport));
}
/**
* 删除工程机械-报表中心
*/
//@PreAuthorize("@ss.hasPermi('constructionMachinery:devicereport:remove')")
@Log(title = "工程机械-报表中心", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(gcjxDeviceReportService.deleteGcjxDeviceReportByIds(ids));
}
}

View File

@ -0,0 +1,92 @@
package com.god.web.controller.deviceInfo;
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 com.god.common.annotation.Log;
import com.god.common.core.controller.BaseController;
import com.god.common.core.domain.AjaxResult;
import com.god.common.enums.BusinessType;
import com.god.deviceInfo.domain.GcjxDeviceManage;
import com.god.deviceInfo.service.IGcjxDeviceManageService;
import com.god.common.utils.poi.ExcelUtil;
import com.god.common.core.page.TableDataInfo;
/**
* 设备管理Controller
*
* @author limuyang
* @date 2023-12-04
*/
@RestController
@RequestMapping("/deviceInfo/deviceManage")
public class GcjxDeviceManageController extends BaseController {
@Autowired
private IGcjxDeviceManageService gcjxDeviceManageService;
/**
* 查询设备管理列表
*/
@GetMapping("/list")
public TableDataInfo list(GcjxDeviceManage gcjxDeviceManage) {
startPage();
List<GcjxDeviceManage> list = gcjxDeviceManageService.selectGcjxDeviceManageList(gcjxDeviceManage);
return getDataTable(list);
}
/**
* 导出设备管理列表
*/
@Log(title = "设备管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, GcjxDeviceManage gcjxDeviceManage) {
List<GcjxDeviceManage> list = gcjxDeviceManageService.selectGcjxDeviceManageList(gcjxDeviceManage);
ExcelUtil<GcjxDeviceManage> util = new ExcelUtil<GcjxDeviceManage>(GcjxDeviceManage.class);
util.exportExcel(response, list, "设备管理数据");
}
/**
* 获取设备管理详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(gcjxDeviceManageService.selectGcjxDeviceManageById(id));
}
/**
* 新增设备管理
*/
@Log(title = "设备管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody GcjxDeviceManage gcjxDeviceManage) {
return toAjax(gcjxDeviceManageService.insertGcjxDeviceManage(gcjxDeviceManage));
}
/**
* 修改设备管理
*/
@Log(title = "设备管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody GcjxDeviceManage gcjxDeviceManage) {
return toAjax(gcjxDeviceManageService.updateGcjxDeviceManage(gcjxDeviceManage));
}
/**
* 删除设备管理
*/
@Log(title = "设备管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(gcjxDeviceManageService.deleteGcjxDeviceManageByIds(ids));
}
}

View File

@ -0,0 +1,98 @@
package com.god.web.controller.dimension;
import com.god.common.annotation.Log;
import com.god.common.core.controller.BaseController;
import com.god.common.core.domain.AjaxResult;
import com.god.common.core.page.TableDataInfo;
import com.god.common.enums.BusinessType;
import com.god.common.utils.poi.ExcelUtil;
import com.god.dimension.domain.GcjxEqLook;
import com.god.dimension.service.IGcjxEqLookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备对象分析Controller
*
* @author Lxz
* @date 2023-12-04
*/
@RestController
@RequestMapping("/dimension/gcjxEqLook")
public class GcjxEqLookController extends BaseController
{
@Autowired
private IGcjxEqLookService gcjxEqLookService;
/**
* 查询设备对象分析列表
*/
@PreAuthorize("@ss.hasPermi('dimension:gcjxEqLook:list')")
@GetMapping("/list")
public TableDataInfo list(GcjxEqLook gcjxEqLook)
{
startPage();
List<GcjxEqLook> list = gcjxEqLookService.selectGcjxEqLookList(gcjxEqLook);
return getDataTable(list);
}
/**
* 导出设备对象分析列表
*/
@PreAuthorize("@ss.hasPermi('dimension:gcjxEqLook:export')")
@Log(title = "设备对象分析", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, GcjxEqLook gcjxEqLook)
{
List<GcjxEqLook> list = gcjxEqLookService.selectGcjxEqLookList(gcjxEqLook);
ExcelUtil<GcjxEqLook> util = new ExcelUtil<GcjxEqLook>(GcjxEqLook.class);
util.exportExcel(response, list, "设备对象分析数据");
}
/**
* 获取设备对象分析详细信息
*/
@PreAuthorize("@ss.hasPermi('dimension:gcjxEqLook:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(gcjxEqLookService.selectGcjxEqLookById(id));
}
/**
* 新增设备对象分析
*/
@PreAuthorize("@ss.hasPermi('dimension:gcjxEqLook:add')")
@Log(title = "设备对象分析", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody GcjxEqLook gcjxEqLook)
{
return toAjax(gcjxEqLookService.insertGcjxEqLook(gcjxEqLook));
}
/**
* 修改设备对象分析
*/
@PreAuthorize("@ss.hasPermi('dimension:gcjxEqLook:edit')")
@Log(title = "设备对象分析", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody GcjxEqLook gcjxEqLook)
{
return toAjax(gcjxEqLookService.updateGcjxEqLook(gcjxEqLook));
}
/**
* 删除设备对象分析
*/
@PreAuthorize("@ss.hasPermi('dimension:gcjxEqLook:remove')")
@Log(title = "设备对象分析", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(gcjxEqLookService.deleteGcjxEqLookByIds(ids));
}
}

View File

@ -0,0 +1,182 @@
package com.god.constructionMachinery.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.god.common.annotation.Excel;
import com.god.common.core.domain.BaseEntity;
/**
* 工程机械-报表中心对象 gcjx_device_report
*
* @author god
* @date 2023-12-04
*/
public class GcjxDeviceReport extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 设备编号 */
@Excel(name = "设备编号")
private String deviceCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 日期 */
@Excel(name = "日期")
private String deviceDate;
/** 周 */
@Excel(name = "")
private String deviceWeek;
/** 月 */
@Excel(name = "")
private String deviceMonth;
/** 年 */
@Excel(name = "")
private String deviceYear;
/** 运行时长 */
@Excel(name = "运行时长")
private String runningTime;
/** 油耗 */
@Excel(name = "油耗")
private String deviceFuel;
/** 维修次数 */
@Excel(name = "维修次数")
private String repairNumber;
private String startDate;
private String endDate;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setDeviceCode(String deviceCode)
{
this.deviceCode = deviceCode;
}
public String getDeviceCode()
{
return deviceCode;
}
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
}
public String getDeviceName()
{
return deviceName;
}
public void setDeviceDate(String deviceDate)
{
this.deviceDate = deviceDate;
}
public String getDeviceDate()
{
return deviceDate;
}
public void setDeviceWeek(String deviceWeek)
{
this.deviceWeek = deviceWeek;
}
public String getDeviceWeek()
{
return deviceWeek;
}
public void setDeviceMonth(String deviceMonth)
{
this.deviceMonth = deviceMonth;
}
public String getDeviceMonth()
{
return deviceMonth;
}
public void setDeviceYear(String deviceYear)
{
this.deviceYear = deviceYear;
}
public String getDeviceYear()
{
return deviceYear;
}
public void setRunningTime(String runningTime)
{
this.runningTime = runningTime;
}
public String getRunningTime()
{
return runningTime;
}
public void setDeviceFuel(String deviceFuel)
{
this.deviceFuel = deviceFuel;
}
public String getDeviceFuel()
{
return deviceFuel;
}
public void setRepairNumber(String repairNumber)
{
this.repairNumber = repairNumber;
}
public String getRepairNumber()
{
return repairNumber;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deviceCode", getDeviceCode())
.append("deviceName", getDeviceName())
.append("deviceDate", getDeviceDate())
.append("deviceWeek", getDeviceWeek())
.append("deviceMonth", getDeviceMonth())
.append("deviceYear", getDeviceYear())
.append("runningTime", getRunningTime())
.append("deviceFuel", getDeviceFuel())
.append("repairNumber", getRepairNumber())
.toString();
}
}

View File

@ -0,0 +1,64 @@
package com.god.constructionMachinery.mapper;
import java.util.List;
import com.god.constructionMachinery.domain.GcjxDeviceReport;
/**
* 工程机械-报表中心Mapper接口
*
* @author god
* @date 2023-12-04
*/
public interface GcjxDeviceReportMapper
{
/**
* 查询工程机械-报表中心
*
* @param id 工程机械-报表中心主键
* @return 工程机械-报表中心
*/
public GcjxDeviceReport selectGcjxDeviceReportById(String id);
/**
* 查询工程机械-报表中心列表
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 工程机械-报表中心集合
*/
public List<GcjxDeviceReport> selectGcjxDeviceReportList(GcjxDeviceReport gcjxDeviceReport);
public List<GcjxDeviceReport> selectGcjxDeviceReportListByYear(GcjxDeviceReport gcjxDeviceReport);
public List<GcjxDeviceReport> selectGcjxDeviceReportListByMonth(GcjxDeviceReport gcjxDeviceReport);
public List<GcjxDeviceReport> selectGcjxDeviceReportListByWeek(GcjxDeviceReport gcjxDeviceReport);
/**
* 新增工程机械-报表中心
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 结果
*/
public int insertGcjxDeviceReport(GcjxDeviceReport gcjxDeviceReport);
/**
* 修改工程机械-报表中心
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 结果
*/
public int updateGcjxDeviceReport(GcjxDeviceReport gcjxDeviceReport);
/**
* 删除工程机械-报表中心
*
* @param id 工程机械-报表中心主键
* @return 结果
*/
public int deleteGcjxDeviceReportById(String id);
/**
* 批量删除工程机械-报表中心
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteGcjxDeviceReportByIds(String[] ids);
}

View File

@ -0,0 +1,64 @@
package com.god.constructionMachinery.service;
import java.util.List;
import com.god.constructionMachinery.domain.GcjxDeviceReport;
/**
* 工程机械-报表中心Service接口
*
* @author god
* @date 2023-12-04
*/
public interface IGcjxDeviceReportService
{
/**
* 查询工程机械-报表中心
*
* @param id 工程机械-报表中心主键
* @return 工程机械-报表中心
*/
public GcjxDeviceReport selectGcjxDeviceReportById(String id);
/**
* 查询工程机械-报表中心列表
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 工程机械-报表中心集合
*/
public List<GcjxDeviceReport> selectGcjxDeviceReportList(GcjxDeviceReport gcjxDeviceReport);
public List<GcjxDeviceReport> selectGcjxDeviceReportListByYear(GcjxDeviceReport gcjxDeviceReport);
public List<GcjxDeviceReport> selectGcjxDeviceReportListByMonth(GcjxDeviceReport gcjxDeviceReport);
public List<GcjxDeviceReport> selectGcjxDeviceReportListByWeek(GcjxDeviceReport gcjxDeviceReport);
/**
* 新增工程机械-报表中心
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 结果
*/
public int insertGcjxDeviceReport(GcjxDeviceReport gcjxDeviceReport);
/**
* 修改工程机械-报表中心
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 结果
*/
public int updateGcjxDeviceReport(GcjxDeviceReport gcjxDeviceReport);
/**
* 批量删除工程机械-报表中心
*
* @param ids 需要删除的工程机械-报表中心主键集合
* @return 结果
*/
public int deleteGcjxDeviceReportByIds(String[] ids);
/**
* 删除工程机械-报表中心信息
*
* @param id 工程机械-报表中心主键
* @return 结果
*/
public int deleteGcjxDeviceReportById(String id);
}

View File

@ -0,0 +1,111 @@
package com.god.constructionMachinery.service.impl;
import java.util.List;
import com.god.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.god.constructionMachinery.mapper.GcjxDeviceReportMapper;
import com.god.constructionMachinery.domain.GcjxDeviceReport;
import com.god.constructionMachinery.service.IGcjxDeviceReportService;
/**
* 工程机械-报表中心Service业务层处理
*
* @author god
* @date 2023-12-04
*/
@Service
public class GcjxDeviceReportServiceImpl implements IGcjxDeviceReportService
{
@Autowired
private GcjxDeviceReportMapper gcjxDeviceReportMapper;
/**
* 查询工程机械-报表中心
*
* @param id 工程机械-报表中心主键
* @return 工程机械-报表中心
*/
@Override
public GcjxDeviceReport selectGcjxDeviceReportById(String id)
{
return gcjxDeviceReportMapper.selectGcjxDeviceReportById(id);
}
/**
* 查询工程机械-报表中心列表
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 工程机械-报表中心
*/
@Override
public List<GcjxDeviceReport> selectGcjxDeviceReportList(GcjxDeviceReport gcjxDeviceReport)
{
return gcjxDeviceReportMapper.selectGcjxDeviceReportList(gcjxDeviceReport);
}
@Override
public List<GcjxDeviceReport> selectGcjxDeviceReportListByYear(GcjxDeviceReport gcjxDeviceReport) {
return gcjxDeviceReportMapper.selectGcjxDeviceReportListByYear(gcjxDeviceReport);
}
@Override
public List<GcjxDeviceReport> selectGcjxDeviceReportListByMonth(GcjxDeviceReport gcjxDeviceReport) {
return gcjxDeviceReportMapper.selectGcjxDeviceReportListByMonth(gcjxDeviceReport);
}
@Override
public List<GcjxDeviceReport> selectGcjxDeviceReportListByWeek(GcjxDeviceReport gcjxDeviceReport) {
return gcjxDeviceReportMapper.selectGcjxDeviceReportListByWeek(gcjxDeviceReport);
}
/**
* 新增工程机械-报表中心
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 结果
*/
@Override
public int insertGcjxDeviceReport(GcjxDeviceReport gcjxDeviceReport)
{
gcjxDeviceReport.setId(IdUtils.fastUUID());
return gcjxDeviceReportMapper.insertGcjxDeviceReport(gcjxDeviceReport);
}
/**
* 修改工程机械-报表中心
*
* @param gcjxDeviceReport 工程机械-报表中心
* @return 结果
*/
@Override
public int updateGcjxDeviceReport(GcjxDeviceReport gcjxDeviceReport)
{
return gcjxDeviceReportMapper.updateGcjxDeviceReport(gcjxDeviceReport);
}
/**
* 批量删除工程机械-报表中心
*
* @param ids 需要删除的工程机械-报表中心主键
* @return 结果
*/
@Override
public int deleteGcjxDeviceReportByIds(String[] ids)
{
return gcjxDeviceReportMapper.deleteGcjxDeviceReportByIds(ids);
}
/**
* 删除工程机械-报表中心信息
*
* @param id 工程机械-报表中心主键
* @return 结果
*/
@Override
public int deleteGcjxDeviceReportById(String id)
{
return gcjxDeviceReportMapper.deleteGcjxDeviceReportById(id);
}
}

View File

@ -0,0 +1,260 @@
package com.god.deviceInfo.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.god.common.annotation.Excel;
import com.god.common.core.domain.BaseEntity;
/**
* 设备管理对象 gcjx_device_manage
*
* @author limuyang
* @date 2023-12-04
*/
public class GcjxDeviceManage extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private String id;
/**
* 设备编码
*/
@Excel(name = "设备编码")
private String deviceCode;
/**
* 设备名称
*/
@Excel(name = "设备名称")
private String deviceName;
/**
* 设备类型
*/
@Excel(name = "设备类型")
private String deviceType;
/**
* 设备状态
*/
@Excel(name = "设备状态")
private String deviceStatus;
/**
* 设备品牌
*/
@Excel(name = "设备品牌")
private String deviceBrand;
/**
* 是否故障
*/
@Excel(name = "是否故障")
private String isFault;
/**
* 故障类型
*/
@Excel(name = "故障类型")
private String faultType;
/**
* 故障描述
*/
@Excel(name = "故障描述")
private String faultDetail;
/**
* 维保人员
*/
@Excel(name = "维保人员")
private String maintenancePerson;
/**
* 维保时间
*/
@Excel(name = "维保时间")
private String maintenanceTime;
/**
* 维保任务
*/
@Excel(name = "维保任务")
private String maintenanceTask;
/**
* 经度
*/
@Excel(name = "经度")
private String longitude;
/**
* 纬度
*/
@Excel(name = "纬度")
private String latitude;
/**
* 工作时间
*/
@Excel(name = "工作时间")
private String workTime;
/**
* 接口名称
*/
private String interfaceType;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceStatus(String deviceStatus) {
this.deviceStatus = deviceStatus;
}
public String getDeviceStatus() {
return deviceStatus;
}
public void setDeviceBrand(String deviceBrand) {
this.deviceBrand = deviceBrand;
}
public String getDeviceBrand() {
return deviceBrand;
}
public void setIsFault(String isFault) {
this.isFault = isFault;
}
public String getIsFault() {
return isFault;
}
public void setFaultType(String faultType) {
this.faultType = faultType;
}
public String getFaultType() {
return faultType;
}
public void setFaultDetail(String faultDetail) {
this.faultDetail = faultDetail;
}
public String getFaultDetail() {
return faultDetail;
}
public void setMaintenancePerson(String maintenancePerson) {
this.maintenancePerson = maintenancePerson;
}
public String getMaintenancePerson() {
return maintenancePerson;
}
public void setMaintenanceTime(String maintenanceTime) {
this.maintenanceTime = maintenanceTime;
}
public String getMaintenanceTime() {
return maintenanceTime;
}
public void setMaintenanceTask(String maintenanceTask) {
this.maintenanceTask = maintenanceTask;
}
public String getMaintenanceTask() {
return maintenanceTask;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLongitude() {
return longitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLatitude() {
return latitude;
}
public void setWorkTime(String workTime) {
this.workTime = workTime;
}
public String getWorkTime() {
return workTime;
}
public void setInterfaceType(String interfaceType) {
this.interfaceType = interfaceType;
}
public String getInterfaceType() {
return interfaceType;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deviceCode", getDeviceCode())
.append("deviceName", getDeviceName())
.append("deviceType", getDeviceType())
.append("deviceStatus", getDeviceStatus())
.append("deviceBrand", getDeviceBrand())
.append("isFault", getIsFault())
.append("faultType", getFaultType())
.append("faultDetail", getFaultDetail())
.append("maintenancePerson", getMaintenancePerson())
.append("maintenanceTime", getMaintenanceTime())
.append("maintenanceTask", getMaintenanceTask())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("workTime", getWorkTime())
.append("interfaceType", getInterfaceType())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.god.deviceInfo.mapper;
import java.util.List;
import com.god.deviceInfo.domain.GcjxDeviceManage;
/**
* 设备管理Mapper接口
*
* @author limuyang
* @date 2023-12-04
*/
public interface GcjxDeviceManageMapper {
/**
* 查询设备管理
*
* @param id 设备管理主键
* @return 设备管理
*/
public GcjxDeviceManage selectGcjxDeviceManageById(String id);
/**
* 查询设备管理列表
*
* @param gcjxDeviceManage 设备管理
* @return 设备管理集合
*/
public List<GcjxDeviceManage> selectGcjxDeviceManageList(GcjxDeviceManage gcjxDeviceManage);
/**
* 新增设备管理
*
* @param gcjxDeviceManage 设备管理
* @return 结果
*/
public int insertGcjxDeviceManage(GcjxDeviceManage gcjxDeviceManage);
/**
* 修改设备管理
*
* @param gcjxDeviceManage 设备管理
* @return 结果
*/
public int updateGcjxDeviceManage(GcjxDeviceManage gcjxDeviceManage);
/**
* 删除设备管理
*
* @param id 设备管理主键
* @return 结果
*/
public int deleteGcjxDeviceManageById(String id);
/**
* 批量删除设备管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteGcjxDeviceManageByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.god.deviceInfo.service;
import java.util.List;
import com.god.deviceInfo.domain.GcjxDeviceManage;
/**
* 设备管理Service接口
*
* @author limuyang
* @date 2023-12-04
*/
public interface IGcjxDeviceManageService {
/**
* 查询设备管理
*
* @param id 设备管理主键
* @return 设备管理
*/
public GcjxDeviceManage selectGcjxDeviceManageById(String id);
/**
* 查询设备管理列表
*
* @param gcjxDeviceManage 设备管理
* @return 设备管理集合
*/
public List<GcjxDeviceManage> selectGcjxDeviceManageList(GcjxDeviceManage gcjxDeviceManage);
/**
* 新增设备管理
*
* @param gcjxDeviceManage 设备管理
* @return 结果
*/
public int insertGcjxDeviceManage(GcjxDeviceManage gcjxDeviceManage);
/**
* 修改设备管理
*
* @param gcjxDeviceManage 设备管理
* @return 结果
*/
public int updateGcjxDeviceManage(GcjxDeviceManage gcjxDeviceManage);
/**
* 批量删除设备管理
*
* @param ids 需要删除的设备管理主键集合
* @return 结果
*/
public int deleteGcjxDeviceManageByIds(String[] ids);
/**
* 删除设备管理信息
*
* @param id 设备管理主键
* @return 结果
*/
public int deleteGcjxDeviceManageById(String id);
}

View File

@ -0,0 +1,94 @@
package com.god.deviceInfo.service.impl;
import java.util.List;
import com.god.common.utils.DateUtils;
import com.god.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.god.deviceInfo.mapper.GcjxDeviceManageMapper;
import com.god.deviceInfo.domain.GcjxDeviceManage;
import com.god.deviceInfo.service.IGcjxDeviceManageService;
/**
* 设备管理Service业务层处理
*
* @author limuyang
* @date 2023-12-04
*/
@Service
public class GcjxDeviceManageServiceImpl implements IGcjxDeviceManageService {
@Autowired
private GcjxDeviceManageMapper gcjxDeviceManageMapper;
/**
* 查询设备管理
*
* @param id 设备管理主键
* @return 设备管理
*/
@Override
public GcjxDeviceManage selectGcjxDeviceManageById(String id) {
return gcjxDeviceManageMapper.selectGcjxDeviceManageById(id);
}
/**
* 查询设备管理列表
*
* @param gcjxDeviceManage 设备管理
* @return 设备管理
*/
@Override
public List<GcjxDeviceManage> selectGcjxDeviceManageList(GcjxDeviceManage gcjxDeviceManage) {
return gcjxDeviceManageMapper.selectGcjxDeviceManageList(gcjxDeviceManage);
}
/**
* 新增设备管理
*
* @param gcjxDeviceManage 设备管理
* @return 结果
*/
@Override
public int insertGcjxDeviceManage(GcjxDeviceManage gcjxDeviceManage) {
gcjxDeviceManage.setId(IdUtils.fastUUID());
String time = DateUtils.getTime();
gcjxDeviceManage.setWorkTime(time);
return gcjxDeviceManageMapper.insertGcjxDeviceManage(gcjxDeviceManage);
}
/**
* 修改设备管理
*
* @param gcjxDeviceManage 设备管理
* @return 结果
*/
@Override
public int updateGcjxDeviceManage(GcjxDeviceManage gcjxDeviceManage) {
String time = DateUtils.getTime();
gcjxDeviceManage.setWorkTime(time);
return gcjxDeviceManageMapper.updateGcjxDeviceManage(gcjxDeviceManage);
}
/**
* 批量删除设备管理
*
* @param ids 需要删除的设备管理主键
* @return 结果
*/
@Override
public int deleteGcjxDeviceManageByIds(String[] ids) {
return gcjxDeviceManageMapper.deleteGcjxDeviceManageByIds(ids);
}
/**
* 删除设备管理信息
*
* @param id 设备管理主键
* @return 结果
*/
@Override
public int deleteGcjxDeviceManageById(String id) {
return gcjxDeviceManageMapper.deleteGcjxDeviceManageById(id);
}
}

View File

@ -0,0 +1,135 @@
package com.god.dimension.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.god.common.annotation.Excel;
import com.god.common.core.domain.BaseEntity;
/**
* 设备对象分析对象 gcjx_eq_look
*
* @author Lxz
* @date 2023-12-04
*/
public class GcjxEqLook extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 设备编号 */
@Excel(name = "设备编号")
private String eqNum;
/** 设备名称 */
@Excel(name = "设备名称")
private String eqName;
/** 设备类型 */
@Excel(name = "设备类型")
private String eqType;
/** 日期 */
@Excel(name = "日期")
private String dateTime;
/** 工作时长h */
@Excel(name = "工作时长", readConverterExp = "h=")
private String workTime;
/** 油耗L */
@Excel(name = "油耗", readConverterExp = "L=")
private String oilConsumption;
/** 维修次数 */
@Excel(name = "维修次数")
private String maintenance;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setEqNum(String eqNum)
{
this.eqNum = eqNum;
}
public String getEqNum()
{
return eqNum;
}
public void setEqName(String eqName)
{
this.eqName = eqName;
}
public String getEqName()
{
return eqName;
}
public void setEqType(String eqType)
{
this.eqType = eqType;
}
public String getEqType()
{
return eqType;
}
public void setDateTime(String dateTime)
{
this.dateTime = dateTime;
}
public String getDateTime()
{
return dateTime;
}
public void setWorkTime(String workTime)
{
this.workTime = workTime;
}
public String getWorkTime()
{
return workTime;
}
public void setOilConsumption(String oilConsumption)
{
this.oilConsumption = oilConsumption;
}
public String getOilConsumption()
{
return oilConsumption;
}
public void setMaintenance(String maintenance)
{
this.maintenance = maintenance;
}
public String getMaintenance()
{
return maintenance;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("eqNum", getEqNum())
.append("eqName", getEqName())
.append("eqType", getEqType())
.append("dateTime", getDateTime())
.append("workTime", getWorkTime())
.append("oilConsumption", getOilConsumption())
.append("maintenance", getMaintenance())
.toString();
}
}

View File

@ -0,0 +1,64 @@
package com.god.dimension.mapper;
import com.god.dimension.domain.GcjxEqLook;
import java.util.List;
/**
* 设备对象分析Mapper接口
*
* @author Lxz
* @date 2023-12-04
*/
public interface GcjxEqLookMapper
{
/**
* 查询设备对象分析
*
* @param id 设备对象分析主键
* @return 设备对象分析
*/
public GcjxEqLook selectGcjxEqLookById(String id);
/**
* 查询设备对象分析列表
*
* @param gcjxEqLook 设备对象分析
* @return 设备对象分析集合
*/
public List<GcjxEqLook> selectGcjxEqLookList(GcjxEqLook gcjxEqLook);
/**
* 新增设备对象分析
*
* @param gcjxEqLook 设备对象分析
* @return 结果
*/
public int insertGcjxEqLook(GcjxEqLook gcjxEqLook);
/**
* 修改设备对象分析
*
* @param gcjxEqLook 设备对象分析
* @return 结果
*/
public int updateGcjxEqLook(GcjxEqLook gcjxEqLook);
/**
* 删除设备对象分析
*
* @param id 设备对象分析主键
* @return 结果
*/
public int deleteGcjxEqLookById(String id);
/**
* 批量删除设备对象分析
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteGcjxEqLookByIds(String[] ids);
String getMaxSnByPrefix(String yyyyMM);
}

View File

@ -0,0 +1,62 @@
package com.god.dimension.service;
import com.god.dimension.domain.GcjxEqLook;
import java.util.List;
/**
* 设备对象分析Service接口
*
* @author Lxz
* @date 2023-12-04
*/
public interface IGcjxEqLookService
{
/**
* 查询设备对象分析
*
* @param id 设备对象分析主键
* @return 设备对象分析
*/
public GcjxEqLook selectGcjxEqLookById(String id);
/**
* 查询设备对象分析列表
*
* @param gcjxEqLook 设备对象分析
* @return 设备对象分析集合
*/
public List<GcjxEqLook> selectGcjxEqLookList(GcjxEqLook gcjxEqLook);
/**
* 新增设备对象分析
*
* @param gcjxEqLook 设备对象分析
* @return 结果
*/
public int insertGcjxEqLook(GcjxEqLook gcjxEqLook);
/**
* 修改设备对象分析
*
* @param gcjxEqLook 设备对象分析
* @return 结果
*/
public int updateGcjxEqLook(GcjxEqLook gcjxEqLook);
/**
* 批量删除设备对象分析
*
* @param ids 需要删除的设备对象分析主键集合
* @return 结果
*/
public int deleteGcjxEqLookByIds(String[] ids);
/**
* 删除设备对象分析信息
*
* @param id 设备对象分析主键
* @return 结果
*/
public int deleteGcjxEqLookById(String id);
}

View File

@ -0,0 +1,104 @@
package com.god.dimension.service.impl;
import com.god.common.utils.serialNumber.SerialNumberService;
import com.god.common.utils.uuid.IdUtils;
import com.god.dimension.domain.GcjxEqLook;
import com.god.dimension.mapper.GcjxEqLookMapper;
import com.god.dimension.service.IGcjxEqLookService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 设备对象分析Service业务层处理
*
* @author Lxz
* @date 2023-12-04
*/
@Service
public class GcjxEqLookServiceImpl implements IGcjxEqLookService
{
@Resource
private GcjxEqLookMapper gcjxEqLookMapper;
@Resource
private SerialNumberService serialNumberService;
/**
* 查询设备对象分析
*
* @param id 设备对象分析主键
* @return 设备对象分析
*/
@Override
public GcjxEqLook selectGcjxEqLookById(String id)
{
return gcjxEqLookMapper.selectGcjxEqLookById(id);
}
/**
* 查询设备对象分析列表
*
* @param gcjxEqLook 设备对象分析
* @return 设备对象分析
*/
@Override
public List<GcjxEqLook> selectGcjxEqLookList(GcjxEqLook gcjxEqLook)
{
return gcjxEqLookMapper.selectGcjxEqLookList(gcjxEqLook);
}
/**
* 新增设备对象分析
*
* @param gcjxEqLook 设备对象分析
* @return 结果
*/
@Override
public int insertGcjxEqLook(GcjxEqLook gcjxEqLook)
{
gcjxEqLook.setId(IdUtils.fastUUID());
gcjxEqLook.setEqNum(serialNumberService.generateSn("SBBH", 3,
gcjxEqLookMapper.getMaxSnByPrefix("SBBH" + new SimpleDateFormat("yyyyMM")
.format(new Date()))));
return gcjxEqLookMapper.insertGcjxEqLook(gcjxEqLook);
}
/**
* 修改设备对象分析
*
* @param gcjxEqLook 设备对象分析
* @return 结果
*/
@Override
public int updateGcjxEqLook(GcjxEqLook gcjxEqLook)
{
return gcjxEqLookMapper.updateGcjxEqLook(gcjxEqLook);
}
/**
* 批量删除设备对象分析
*
* @param ids 需要删除的设备对象分析主键
* @return 结果
*/
@Override
public int deleteGcjxEqLookByIds(String[] ids)
{
return gcjxEqLookMapper.deleteGcjxEqLookByIds(ids);
}
/**
* 删除设备对象分析信息
*
* @param id 设备对象分析主键
* @return 结果
*/
@Override
public int deleteGcjxEqLookById(String id)
{
return gcjxEqLookMapper.deleteGcjxEqLookById(id);
}
}

View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.god.constructionMachinery.mapper.GcjxDeviceReportMapper">
<resultMap type="GcjxDeviceReport" id="GcjxDeviceReportResult">
<result property="id" column="id" />
<result property="deviceCode" column="device_code" />
<result property="deviceName" column="device_name" />
<result property="deviceDate" column="device_date" />
<result property="deviceWeek" column="device_week" />
<result property="deviceMonth" column="device_month" />
<result property="deviceYear" column="device_year" />
<result property="runningTime" column="running_time" />
<result property="deviceFuel" column="device_fuel" />
<result property="repairNumber" column="repair_number" />
</resultMap>
<sql id="selectGcjxDeviceReportVo">
select id, device_code, device_name, device_date, device_week, device_month, device_year, running_time, device_fuel, repair_number from gcjx_device_report
</sql>
<select id="selectGcjxDeviceReportList" parameterType="GcjxDeviceReport" resultMap="GcjxDeviceReportResult">
<include refid="selectGcjxDeviceReportVo"/>
<where>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="startDate != null and startDate != ''"> and device_date between #{startDate} and #{endDate}</if>
<if test="deviceWeek != null and deviceWeek != ''"> and device_week = #{deviceWeek}</if>
<if test="deviceMonth != null and deviceMonth != ''"> and device_month = #{deviceMonth}</if>
<if test="deviceYear != null and deviceYear != ''"> and device_year = #{deviceYear}</if>
<if test="runningTime != null and runningTime != ''"> and running_time = #{runningTime}</if>
<if test="deviceFuel != null and deviceFuel != ''"> and device_fuel = #{deviceFuel}</if>
<if test="repairNumber != null and repairNumber != ''"> and repair_number = #{repairNumber}</if>
</where>
order by device_date desc
</select>
<select id="selectGcjxDeviceReportListByWeek" parameterType="GcjxDeviceReport" resultMap="GcjxDeviceReportResult">
SELECT device_code, device_name, device_year, device_week, ROUND(sum(running_time),1) as running_time, ROUND(sum(device_fuel),1) as device_fuel, ROUND(sum(repair_number)) as repair_number FROM gcjx_device_report
<where>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="startDate != null and startDate != ''"> and device_date between #{startDate} and #{endDate}</if>
<if test="deviceWeek != null and deviceWeek != ''"> and device_week = #{deviceWeek}</if>
<if test="deviceMonth != null and deviceMonth != ''"> and device_month = #{deviceMonth}</if>
<if test="deviceYear != null and deviceYear != ''"> and device_year = #{deviceYear}</if>
<if test="runningTime != null and runningTime != ''"> and running_time = #{runningTime}</if>
<if test="deviceFuel != null and deviceFuel != ''"> and device_fuel = #{deviceFuel}</if>
<if test="repairNumber != null and repairNumber != ''"> and repair_number = #{repairNumber}</if>
</where>
group by device_code, device_year, device_week
order by device_year desc, device_week desc, device_code
</select>
<select id="selectGcjxDeviceReportListByMonth" parameterType="GcjxDeviceReport" resultMap="GcjxDeviceReportResult">
select device_code, device_name, device_month, ROUND(sum(running_time),1) as running_time, ROUND(sum(device_fuel),1) as device_fuel, ROUND(sum(repair_number)) as repair_number from gcjx_device_report
<where>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="startDate != null and startDate != ''"> and device_date between #{startDate} and #{endDate}</if>
<if test="deviceWeek != null and deviceWeek != ''"> and device_week = #{deviceWeek}</if>
<if test="deviceMonth != null and deviceMonth != ''"> and device_month = #{deviceMonth}</if>
<if test="deviceYear != null and deviceYear != ''"> and device_year = #{deviceYear}</if>
<if test="runningTime != null and runningTime != ''"> and running_time = #{runningTime}</if>
<if test="deviceFuel != null and deviceFuel != ''"> and device_fuel = #{deviceFuel}</if>
<if test="repairNumber != null and repairNumber != ''"> and repair_number = #{repairNumber}</if>
</where>
group by device_code, device_month
order by device_month desc, device_code
</select>
<select id="selectGcjxDeviceReportListByYear" parameterType="GcjxDeviceReport" resultMap="GcjxDeviceReportResult">
select device_code, device_name, device_year, ROUND(sum(running_time),1) as running_time, ROUND(sum(device_fuel),1) as device_fuel, ROUND(sum(repair_number)) as repair_number from gcjx_device_report
<where>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="startDate != null and startDate != ''"> and device_date between #{startDate} and #{endDate}</if>
<if test="deviceWeek != null and deviceWeek != ''"> and device_week = #{deviceWeek}</if>
<if test="deviceMonth != null and deviceMonth != ''"> and device_month = #{deviceMonth}</if>
<if test="deviceYear != null and deviceYear != ''"> and device_year = #{deviceYear}</if>
<if test="runningTime != null and runningTime != ''"> and running_time = #{runningTime}</if>
<if test="deviceFuel != null and deviceFuel != ''"> and device_fuel = #{deviceFuel}</if>
<if test="repairNumber != null and repairNumber != ''"> and repair_number = #{repairNumber}</if>
</where>
group by device_code, device_year
order by device_year desc, device_code
</select>
<select id="selectGcjxDeviceReportById" parameterType="String" resultMap="GcjxDeviceReportResult">
<include refid="selectGcjxDeviceReportVo"/>
where id = #{id}
</select>
<insert id="insertGcjxDeviceReport" parameterType="GcjxDeviceReport">
insert into gcjx_device_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="deviceDate != null">device_date,</if>
<if test="deviceWeek != null">device_week,</if>
<if test="deviceMonth != null">device_month,</if>
<if test="deviceYear != null">device_year,</if>
<if test="runningTime != null">running_time,</if>
<if test="deviceFuel != null">device_fuel,</if>
<if test="repairNumber != null">repair_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceDate != null">#{deviceDate},</if>
<if test="deviceWeek != null">#{deviceWeek},</if>
<if test="deviceMonth != null">#{deviceMonth},</if>
<if test="deviceYear != null">#{deviceYear},</if>
<if test="runningTime != null">#{runningTime},</if>
<if test="deviceFuel != null">#{deviceFuel},</if>
<if test="repairNumber != null">#{repairNumber},</if>
</trim>
</insert>
<update id="updateGcjxDeviceReport" parameterType="GcjxDeviceReport">
update gcjx_device_report
<trim prefix="SET" suffixOverrides=",">
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceDate != null">device_date = #{deviceDate},</if>
<if test="deviceWeek != null">device_week = #{deviceWeek},</if>
<if test="deviceMonth != null">device_month = #{deviceMonth},</if>
<if test="deviceYear != null">device_year = #{deviceYear},</if>
<if test="runningTime != null">running_time = #{runningTime},</if>
<if test="deviceFuel != null">device_fuel = #{deviceFuel},</if>
<if test="repairNumber != null">repair_number = #{repairNumber},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGcjxDeviceReportById" parameterType="String">
delete from gcjx_device_report where id = #{id}
</delete>
<delete id="deleteGcjxDeviceReportByIds" parameterType="String">
delete from gcjx_device_report where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.god.deviceInfo.mapper.GcjxDeviceManageMapper">
<resultMap type="GcjxDeviceManage" id="GcjxDeviceManageResult">
<result property="id" column="id"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
<result property="deviceType" column="device_type"/>
<result property="deviceStatus" column="device_status"/>
<result property="deviceBrand" column="device_brand"/>
<result property="isFault" column="is_fault"/>
<result property="faultType" column="fault_type"/>
<result property="faultDetail" column="fault_detail"/>
<result property="maintenancePerson" column="maintenance_person"/>
<result property="maintenanceTime" column="maintenance_time"/>
<result property="maintenanceTask" column="maintenance_task"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<result property="workTime" column="work_time"/>
<result property="interfaceType" column="interface_type"/>
</resultMap>
<sql id="selectGcjxDeviceManageVo">
select id, device_code, device_name, device_type, device_status, device_brand, is_fault, fault_type, fault_detail, maintenance_person, maintenance_time, maintenance_task, longitude, latitude, work_time, interface_type from gcjx_device_manage
</sql>
<select id="selectGcjxDeviceManageList" parameterType="GcjxDeviceManage" resultMap="GcjxDeviceManageResult">
<include refid="selectGcjxDeviceManageVo"/>
<where>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
</if>
<if test="deviceType != null and deviceType != ''">and device_type = #{deviceType}</if>
<if test="deviceStatus != null and deviceStatus != ''">and device_status = #{deviceStatus}</if>
<if test="deviceBrand != null and deviceBrand != ''">and device_brand = #{deviceBrand}</if>
<if test="isFault != null and isFault != ''">and is_fault = #{isFault}</if>
<if test="faultType != null and faultType != ''">and fault_type = #{faultType}</if>
<if test="faultDetail != null and faultDetail != ''">and fault_detail = #{faultDetail}</if>
<if test="maintenancePerson != null and maintenancePerson != ''">and maintenance_person =
#{maintenancePerson}
</if>
<if test="maintenanceTime != null and maintenanceTime != ''">and maintenance_time = #{maintenanceTime}</if>
<if test="maintenanceTask != null and maintenanceTask != ''">and maintenance_task = #{maintenanceTask}</if>
<if test="longitude != null and longitude != ''">and longitude = #{longitude}</if>
<if test="latitude != null and latitude != ''">and latitude = #{latitude}</if>
<if test="workTime != null and workTime != ''">and work_time = #{workTime}</if>
<if test="interfaceType != null and interfaceType != ''">and interface_type = #{interfaceType}</if>
</where>
</select>
<select id="selectGcjxDeviceManageById" parameterType="String" resultMap="GcjxDeviceManageResult">
<include refid="selectGcjxDeviceManageVo"/>
where id = #{id}
</select>
<insert id="insertGcjxDeviceManage" parameterType="GcjxDeviceManage">
insert into gcjx_device_manage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="deviceType != null">device_type,</if>
<if test="deviceStatus != null">device_status,</if>
<if test="deviceBrand != null">device_brand,</if>
<if test="isFault != null">is_fault,</if>
<if test="faultType != null">fault_type,</if>
<if test="faultDetail != null">fault_detail,</if>
<if test="maintenancePerson != null">maintenance_person,</if>
<if test="maintenanceTime != null">maintenance_time,</if>
<if test="maintenanceTask != null">maintenance_task,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="workTime != null">work_time,</if>
<if test="interfaceType != null">interface_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceType != null">#{deviceType},</if>
<if test="deviceStatus != null">#{deviceStatus},</if>
<if test="deviceBrand != null">#{deviceBrand},</if>
<if test="isFault != null">#{isFault},</if>
<if test="faultType != null">#{faultType},</if>
<if test="faultDetail != null">#{faultDetail},</if>
<if test="maintenancePerson != null">#{maintenancePerson},</if>
<if test="maintenanceTime != null">#{maintenanceTime},</if>
<if test="maintenanceTask != null">#{maintenanceTask},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="workTime != null">#{workTime},</if>
<if test="interfaceType != null">#{interfaceType},</if>
</trim>
</insert>
<update id="updateGcjxDeviceManage" parameterType="GcjxDeviceManage">
update gcjx_device_manage
<trim prefix="SET" suffixOverrides=",">
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceType != null">device_type = #{deviceType},</if>
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
<if test="deviceBrand != null">device_brand = #{deviceBrand},</if>
<if test="isFault != null">is_fault = #{isFault},</if>
<if test="faultType != null">fault_type = #{faultType},</if>
<if test="faultDetail != null">fault_detail = #{faultDetail},</if>
<if test="maintenancePerson != null">maintenance_person = #{maintenancePerson},</if>
<if test="maintenanceTime != null">maintenance_time = #{maintenanceTime},</if>
<if test="maintenanceTask != null">maintenance_task = #{maintenanceTask},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="workTime != null">work_time = #{workTime},</if>
<if test="interfaceType != null">interface_type = #{interfaceType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGcjxDeviceManageById" parameterType="String">
delete from gcjx_device_manage where id = #{id}
</delete>
<delete id="deleteGcjxDeviceManageByIds" parameterType="String">
delete from gcjx_device_manage where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.god.dimension.mapper.GcjxEqLookMapper">
<resultMap type="GcjxEqLook" id="GcjxEqLookResult">
<result property="id" column="id"/>
<result property="eqNum" column="eq_num"/>
<result property="eqName" column="eq_name"/>
<result property="eqType" column="eq_type"/>
<result property="dateTime" column="date_time"/>
<result property="workTime" column="work_time"/>
<result property="oilConsumption" column="oil_consumption"/>
<result property="maintenance" column="maintenance"/>
</resultMap>
<sql id="selectGcjxEqLookVo">
select id,
eq_num,
eq_name,
eq_type,
date_time,
work_time,
oil_consumption,
maintenance
from gcjx_eq_look
</sql>
<select id="selectGcjxEqLookList" parameterType="GcjxEqLook" resultMap="GcjxEqLookResult">
<include refid="selectGcjxEqLookVo"/>
<where>
<if test="eqNum != null and eqNum != ''"> and eq_num =
#{eqNum}</if>
<if test="eqName != null and eqName != ''"> and eq_name like concat('%',
#{eqName},
'%'
)</if>
<if test="eqType != null and eqType != ''"> and eq_type =
#{eqType}</if>
<if test="dateTime != null and dateTime != ''"> and date_time =
#{dateTime}</if>
<if test="workTime != null and workTime != ''"> and work_time =
#{workTime}</if>
<if test="oilConsumption != null and oilConsumption != ''"> and oil_consumption =
#{oilConsumption}</if>
<if test="maintenance != null and maintenance != ''"> and maintenance =
#{maintenance}</if>
</where>
</select>
<select id="selectGcjxEqLookById" parameterType="String" resultMap="GcjxEqLookResult">
<include refid="selectGcjxEqLookVo"/>
where id = #{id}
</select>
<select id="getMaxSnByPrefix" resultType="java.lang.String">
SELECT eq_num
FROM gcjx_eq_look
WHERE eq_num LIKE CONCAT(#{prefix}, '%')
order by eq_num desc limit 1
</select>
<insert id="insertGcjxEqLook" parameterType="GcjxEqLook">
insert into gcjx_eq_look
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id
,</if>
<if test="eqNum != null">eq_num
,</if>
<if test="eqName != null">eq_name
,</if>
<if test="eqType != null">eq_type
,</if>
<if test="dateTime != null">date_time
,</if>
<if test="workTime != null">work_time
,</if>
<if test="oilConsumption != null">oil_consumption
,</if>
<if test="maintenance != null">maintenance
,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id}
,</if>
<if test="eqNum != null">#{eqNum}
,</if>
<if test="eqName != null">#{eqName}
,</if>
<if test="eqType != null">#{eqType}
,</if>
<if test="dateTime != null">#{dateTime}
,</if>
<if test="workTime != null">#{workTime}
,</if>
<if test="oilConsumption != null">#{oilConsumption}
,</if>
<if test="maintenance != null">#{maintenance}
,</if>
</trim>
</insert>
<update id="updateGcjxEqLook" parameterType="GcjxEqLook">
update gcjx_eq_look
<trim prefix="SET" suffixOverrides=",">
<if test="eqNum != null">eq_num
=
#{eqNum},</if>
<if test="eqName != null">eq_name
=
#{eqName},</if>
<if test="eqType != null">eq_type
=
#{eqType},</if>
<if test="dateTime != null">date_time
=
#{dateTime},</if>
<if test="workTime != null">work_time
=
#{workTime},</if>
<if test="oilConsumption != null">oil_consumption
=
#{oilConsumption},</if>
<if test="maintenance != null">maintenance
=
#{maintenance},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGcjxEqLookById" parameterType="String">
delete
from gcjx_eq_look
where id = #{id}
</delete>
<delete id="deleteGcjxEqLookByIds" parameterType="String">
delete from gcjx_eq_look where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

View File

@ -0,0 +1,65 @@
import request from '@/utils/request'
// 查询工程机械-报表中心列表
export function listDevicereport(query) {
return request({
url: '/constructionMachinery/devicereport/list',
method: 'get',
params: query
})
}
export function listDevicereportWeek(query) {
return request({
url: '/constructionMachinery/devicereport/listWeek',
method: 'get',
params: query
})
}
export function listDevicereportMonth(query) {
return request({
url: '/constructionMachinery/devicereport/listMonth',
method: 'get',
params: query
})
}
export function listDevicereportYear(query) {
return request({
url: '/constructionMachinery/devicereport/listYear',
method: 'get',
params: query
})
}
// 查询工程机械-报表中心详细
export function getDevicereport(id) {
return request({
url: '/constructionMachinery/devicereport/' + id,
method: 'get'
})
}
// 新增工程机械-报表中心
export function addDevicereport(data) {
return request({
url: '/constructionMachinery/devicereport',
method: 'post',
data: data
})
}
// 修改工程机械-报表中心
export function updateDevicereport(data) {
return request({
url: '/constructionMachinery/devicereport',
method: 'put',
data: data
})
}
// 删除工程机械-报表中心
export function delDevicereport(id) {
return request({
url: '/constructionMachinery/devicereport/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备管理列表
export function listDeviceManage(query) {
return request({
url: '/deviceInfo/deviceManage/list',
method: 'get',
params: query
})
}
// 查询设备管理详细
export function getDeviceManage(id) {
return request({
url: '/deviceInfo/deviceManage/' + id,
method: 'get'
})
}
// 新增设备管理
export function addDeviceManage(data) {
return request({
url: '/deviceInfo/deviceManage',
method: 'post',
data: data
})
}
// 修改设备管理
export function updateDeviceManage(data) {
return request({
url: '/deviceInfo/deviceManage',
method: 'put',
data: data
})
}
// 删除设备管理
export function delDeviceManage(id) {
return request({
url: '/deviceInfo/deviceManage/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备对象分析列表
export function listGcjxEqLook(query) {
return request({
url: '/dimension/gcjxEqLook/list',
method: 'get',
params: query
})
}
// 查询设备对象分析详细
export function getGcjxEqLook(id) {
return request({
url: '/dimension/gcjxEqLook/' + id,
method: 'get'
})
}
// 新增设备对象分析
export function addGcjxEqLook(data) {
return request({
url: '/dimension/gcjxEqLook',
method: 'post',
data: data
})
}
// 修改设备对象分析
export function updateGcjxEqLook(data) {
return request({
url: '/dimension/gcjxEqLook',
method: 'put',
data: data
})
}
// 删除设备对象分析
export function delGcjxEqLook(id) {
return request({
url: '/dimension/gcjxEqLook/' + id,
method: 'delete'
})
}

View File

@ -7,7 +7,7 @@
<div class="right-menu">
<template v-if="device!=='mobile'">
<div class="el-icon-s-platform bigscreen-frame" @click="handleBigscreen()"></div>
<div v-show="port !== '9210'" class="el-icon-s-platform bigscreen-frame" @click="handleBigscreen()"></div>
<search id="header-search" class="right-menu-item" />
<screenfull id="screenfull" class="right-menu-item hover-effect" />
@ -57,6 +57,12 @@ export default {
SizeSelect,
Search
},
data() {
const port = window.location.port;
return {
port
}
},
computed: {
...mapGetters([
'sidebar',

View File

@ -64,6 +64,10 @@ export default {
this.title = '石坪桥街道老旧小区改造提升平台'
document.title = '石坪桥街道老旧小区改造提升平台'
break;
case '9210':
this.title = '工程机械数字服务平台'
document.title = '工程机械数字服务平台'
break;
default:
this.title = ''
document.title = ''

View File

@ -0,0 +1,349 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-date-picker
v-model="fullDateValue"
type="daterange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:editable="false"
:key="2"
></el-date-picker>
</el-form-item>
<!--<el-form-item label="周" prop="deviceWeek">
<el-input
v-model="queryParams.deviceWeek"
placeholder="请输入周"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input
v-model="queryParams.deviceMonth"
placeholder="请输入月"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input
v-model="queryParams.deviceYear"
placeholder="请输入年"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['constructionMachinery:devicereport:add']"
>新增</el-button>
</el-col>-->
<!--<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['constructionMachinery:devicereport:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="devicereportList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="日期" align="center" prop="deviceDate" />
<!--<el-table-column label="周" align="center" prop="deviceWeek" />
<el-table-column label="月" align="center" prop="deviceMonth" />
<el-table-column label="年" align="center" prop="deviceYear" />-->
<el-table-column label="运行时长h" align="center" prop="runningTime" />
<el-table-column label="油耗L" align="center" prop="deviceFuel"/>
<el-table-column label="维修次数" align="center" prop="repairNumber" />
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改报表中心对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-input v-model="form.deviceDate" placeholder="请输入日期" />
</el-form-item>
<el-form-item label="周" prop="deviceWeek">
<el-input v-model="form.deviceWeek" placeholder="请输入周" />
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input v-model="form.deviceMonth" placeholder="请输入月" />
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input v-model="form.deviceYear" placeholder="请输入年" />
</el-form-item>
<el-form-item label="运行时长" prop="runningTime">
<el-input v-model="form.runningTime" placeholder="请输入运行时长" />
</el-form-item>
<el-form-item label="油耗" prop="deviceFuel">
<el-input v-model="form.deviceFuel" placeholder="请输入油耗" />
</el-form-item>
<el-form-item label="维修次数" prop="repairNumber">
<el-input v-model="form.repairNumber" placeholder="请输入维修次数" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listDevicereport, getDevicereport, delDevicereport, addDevicereport, updateDevicereport } from "@/api/constructionMachinery/devicereport";
export default {
name: "Devicereport",
data() {
return {
fullDateValue: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
devicereportList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceCode: null,
deviceName: null,
deviceDate: null,
deviceWeek: null,
deviceMonth: null,
deviceYear: null,
runningTime: null,
deviceFuel: null,
repairNumber: null,
startDate: null,
endDate: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询报表中心列表 */
getList() {
this.loading = true;
if (this.fullDateValue != null && this.fullDateValue != ""){
this.queryParams.startDate = this.fullDateValue[0]
this.queryParams.endDate = this.fullDateValue[1]
}else {
this.queryParams.startDate = null
this.queryParams.endDate = null
}
listDevicereport(this.queryParams).then(response => {
this.devicereportList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deviceCode: "QZJ007812",
deviceName: "塔式起重机812",
deviceDate: "2023-11-",
deviceWeek: null,
deviceMonth: "2023-11",
deviceYear: "2023",
runningTime: null,
deviceFuel: null,
repairNumber: "0"
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.fullDateValue = null
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报表中心";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDevicereport(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报表中心";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDevicereport(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDevicereport(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报表中心编号为"' + ids + '"的数据项?').then(function() {
return delDevicereport(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('constructionMachinery/devicereport/export', {
...this.queryParams
}, `devicereport_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,353 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-date-picker
v-model="fullDateValue"
type="daterange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:editable="false"
:key="2"
></el-date-picker>
</el-form-item>
<!--<el-form-item label="周" prop="deviceWeek">
<el-input
v-model="queryParams.deviceWeek"
placeholder="请输入周"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input
v-model="queryParams.deviceMonth"
placeholder="请输入月"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input
v-model="queryParams.deviceYear"
placeholder="请输入年"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['constructionMachinery:devicereport:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['constructionMachinery:devicereport:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="devicereportList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<!--<el-table-column label="日期" align="center" prop="deviceDate" />
<el-table-column label="周" align="center" prop="deviceWeek">
<template slot-scope="scope">{{ scope.row.deviceWeek ? scope.row.deviceYear + ' 第' + scope.row.deviceWeek + '周' : '-' }}</template>
</el-table-column>-->
<el-table-column label="月" align="center" prop="deviceMonth" />
<!-- <el-table-column label="年" align="center" prop="deviceYear" />-->
<el-table-column label="运行时长h" align="center" prop="runningTime" />
<el-table-column label="油耗L" align="center" prop="deviceFuel"/>
<el-table-column label="维修次数" align="center" prop="repairNumber">
<template slot-scope="scope">{{ Math.round(scope.row.repairNumber)}}</template>
</el-table-column>
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改报表中心对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-input v-model="form.deviceDate" placeholder="请输入日期" />
</el-form-item>
<el-form-item label="周" prop="deviceWeek">
<el-input v-model="form.deviceWeek" placeholder="请输入周" />
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input v-model="form.deviceMonth" placeholder="请输入月" />
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input v-model="form.deviceYear" placeholder="请输入年" />
</el-form-item>
<el-form-item label="运行时长" prop="runningTime">
<el-input v-model="form.runningTime" placeholder="请输入运行时长" />
</el-form-item>
<el-form-item label="油耗" prop="deviceFuel">
<el-input v-model="form.deviceFuel" placeholder="请输入油耗" />
</el-form-item>
<el-form-item label="维修次数" prop="repairNumber">
<el-input v-model="form.repairNumber" placeholder="请输入维修次数" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listDevicereportMonth, getDevicereport, delDevicereport, addDevicereport, updateDevicereport } from "@/api/constructionMachinery/devicereport";
export default {
name: "Devicereport",
data() {
return {
fullDateValue: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
devicereportList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceCode: null,
deviceName: null,
deviceDate: null,
deviceWeek: null,
deviceMonth: null,
deviceYear: null,
runningTime: null,
deviceFuel: null,
repairNumber: null,
startDate: null,
endDate: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询报表中心列表 */
getList() {
this.loading = true;
if (this.fullDateValue != null && this.fullDateValue != ""){
this.queryParams.startDate = this.fullDateValue[0]
this.queryParams.endDate = this.fullDateValue[1]
}else {
this.queryParams.startDate = null
this.queryParams.endDate = null
}
listDevicereportMonth(this.queryParams).then(response => {
this.devicereportList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deviceCode: null,
deviceName: null,
deviceDate: null,
deviceWeek: null,
deviceMonth: null,
deviceYear: null,
runningTime: null,
deviceFuel: null,
repairNumber: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.fullDateValue = null
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报表中心";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDevicereport(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报表中心";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDevicereport(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDevicereport(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报表中心编号为"' + ids + '"的数据项?').then(function() {
return delDevicereport(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('constructionMachinery/devicereport/exportMonth', {
...this.queryParams
}, `devicereportMonth_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,353 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-date-picker
v-model="fullDateValue"
type="daterange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:editable="false"
:key="2"
></el-date-picker>
</el-form-item>
<!--<el-form-item label="周" prop="deviceWeek">
<el-input
v-model="queryParams.deviceWeek"
placeholder="请输入周"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input
v-model="queryParams.deviceMonth"
placeholder="请输入月"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input
v-model="queryParams.deviceYear"
placeholder="请输入年"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['constructionMachinery:devicereport:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['constructionMachinery:devicereport:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="devicereportList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<!--<el-table-column label="日期" align="center" prop="deviceDate" />-->
<el-table-column label="周" align="center" prop="deviceWeek">
<template slot-scope="scope">{{ scope.row.deviceWeek ? scope.row.deviceYear + ' 第' + scope.row.deviceWeek + '周' : '-' }}</template>
</el-table-column>
<!-- <el-table-column label="月" align="center" prop="deviceMonth" />
<el-table-column label="年" align="center" prop="deviceYear" />-->
<el-table-column label="运行时长h" align="center" prop="runningTime" />
<el-table-column label="油耗L" align="center" prop="deviceFuel"/>
<el-table-column label="维修次数" align="center" prop="repairNumber">
<template slot-scope="scope">{{ Math.round(scope.row.repairNumber)}}</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改报表中心对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-input v-model="form.deviceDate" placeholder="请输入日期" />
</el-form-item>
<el-form-item label="周" prop="deviceWeek">
<el-input v-model="form.deviceWeek" placeholder="请输入周" />
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input v-model="form.deviceMonth" placeholder="请输入月" />
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input v-model="form.deviceYear" placeholder="请输入年" />
</el-form-item>
<el-form-item label="运行时长" prop="runningTime">
<el-input v-model="form.runningTime" placeholder="请输入运行时长" />
</el-form-item>
<el-form-item label="油耗" prop="deviceFuel">
<el-input v-model="form.deviceFuel" placeholder="请输入油耗" />
</el-form-item>
<el-form-item label="维修次数" prop="repairNumber">
<el-input v-model="form.repairNumber" placeholder="请输入维修次数" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listDevicereportWeek, getDevicereport, delDevicereport, addDevicereport, updateDevicereport } from "@/api/constructionMachinery/devicereport";
export default {
name: "Devicereport",
data() {
return {
fullDateValue: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
devicereportList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceCode: null,
deviceName: null,
deviceDate: null,
deviceWeek: null,
deviceMonth: null,
deviceYear: null,
runningTime: null,
deviceFuel: null,
repairNumber: null,
startDate: null,
endDate: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询报表中心列表 */
getList() {
this.loading = true;
if (this.fullDateValue != null && this.fullDateValue != ""){
this.queryParams.startDate = this.fullDateValue[0]
this.queryParams.endDate = this.fullDateValue[1]
}else {
this.queryParams.startDate = null
this.queryParams.endDate = null
}
listDevicereportWeek(this.queryParams).then(response => {
this.devicereportList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deviceCode: null,
deviceName: null,
deviceDate: null,
deviceWeek: null,
deviceMonth: null,
deviceYear: null,
runningTime: null,
deviceFuel: null,
repairNumber: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.fullDateValue = null
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报表中心";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDevicereport(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报表中心";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDevicereport(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDevicereport(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报表中心编号为"' + ids + '"的数据项?').then(function() {
return delDevicereport(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('constructionMachinery/devicereport/exportWeek', {
...this.queryParams
}, `devicereport_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,353 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-date-picker
v-model="fullDateValue"
type="daterange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:editable="false"
:key="2"
></el-date-picker>
</el-form-item>
<!--<el-form-item label="周" prop="deviceWeek">
<el-input
v-model="queryParams.deviceWeek"
placeholder="请输入周"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input
v-model="queryParams.deviceMonth"
placeholder="请输入月"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input
v-model="queryParams.deviceYear"
placeholder="请输入年"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['constructionMachinery:devicereport:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['constructionMachinery:devicereport:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="devicereportList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<!--<el-table-column label="日期" align="center" prop="deviceDate" />
<el-table-column label="周" align="center" prop="deviceWeek">
<template slot-scope="scope">{{ scope.row.deviceWeek ? scope.row.deviceYear + ' 第' + scope.row.deviceWeek + '周' : '-' }}</template>
</el-table-column>
<el-table-column label="月" align="center" prop="deviceMonth" />-->
<el-table-column label="年" align="center" prop="deviceYear" />
<el-table-column label="运行时长h" align="center" prop="runningTime" />
<el-table-column label="油耗L" align="center" prop="deviceFuel"/>
<el-table-column label="维修次数" align="center" prop="repairNumber">
<template slot-scope="scope">{{ Math.round(scope.row.repairNumber)}}</template>
</el-table-column>
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['constructionMachinery:devicereport:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改报表中心对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="日期" prop="deviceDate">
<el-input v-model="form.deviceDate" placeholder="请输入日期" />
</el-form-item>
<el-form-item label="周" prop="deviceWeek">
<el-input v-model="form.deviceWeek" placeholder="请输入周" />
</el-form-item>
<el-form-item label="月" prop="deviceMonth">
<el-input v-model="form.deviceMonth" placeholder="请输入月" />
</el-form-item>
<el-form-item label="年" prop="deviceYear">
<el-input v-model="form.deviceYear" placeholder="请输入年" />
</el-form-item>
<el-form-item label="运行时长" prop="runningTime">
<el-input v-model="form.runningTime" placeholder="请输入运行时长" />
</el-form-item>
<el-form-item label="油耗" prop="deviceFuel">
<el-input v-model="form.deviceFuel" placeholder="请输入油耗" />
</el-form-item>
<el-form-item label="维修次数" prop="repairNumber">
<el-input v-model="form.repairNumber" placeholder="请输入维修次数" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listDevicereportYear, getDevicereport, delDevicereport, addDevicereport, updateDevicereport } from "@/api/constructionMachinery/devicereport";
export default {
name: "Devicereport",
data() {
return {
fullDateValue: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
devicereportList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceCode: null,
deviceName: null,
deviceDate: null,
deviceWeek: null,
deviceMonth: null,
deviceYear: null,
runningTime: null,
deviceFuel: null,
repairNumber: null,
startDate: null,
endDate: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询报表中心列表 */
getList() {
this.loading = true;
if (this.fullDateValue != null && this.fullDateValue != ""){
this.queryParams.startDate = this.fullDateValue[0]
this.queryParams.endDate = this.fullDateValue[1]
}else {
this.queryParams.startDate = null
this.queryParams.endDate = null
}
listDevicereportYear(this.queryParams).then(response => {
this.devicereportList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deviceCode: null,
deviceName: null,
deviceDate: null,
deviceWeek: null,
deviceMonth: null,
deviceYear: null,
runningTime: null,
deviceFuel: null,
repairNumber: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.fullDateValue = null
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报表中心";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDevicereport(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报表中心";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDevicereport(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDevicereport(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报表中心编号为"' + ids + '"的数据项?').then(function() {
return delDevicereport(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('constructionMachinery/devicereport/exportYear', {
...this.queryParams
}, `devicereportYear_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,709 @@
<template>
<div class="app-container main-outer-wrapper">
<div class="grid-main-wrapper">
<div class="grid-item-wrapper">
<div class="grid-item-title">设备类型分布</div>
<div class="grid-item-content" id="chart1"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">设备状态</div>
<div class="grid-item-content" id="chart2"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">设备归属</div>
<div class="grid-item-content" id="chart3"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">设备工作时长(h)</div>
<div class="grid-item-content" id="chart4"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">各区域设备指数</div>
<div class="grid-item-content" id="chart5"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">日均油耗(L)</div>
<div class="grid-item-content" id="chart6"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">日均开工率</div>
<div class="grid-item-content" id="chart7"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">设备平均使用效率</div>
<div class="grid-item-content" id="chart8"></div>
</div>
<div class="grid-item-wrapper">
<div class="grid-item-title">今日工作设备</div>
<div class="grid-item-content">
<el-table :data="todayDevice" height="270px">
<el-table-column label="设备编号" align="center" prop="num" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="设备类型" align="center" prop="type" />
<el-table-column label="设备状态" align="center" prop="status">
<template slot-scope="scope">
<span style="color: #62cfa2;">{{ scope.row.status }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</template>
<script>
import {
generateBaseOptions,
generatePieOptions,
initChartStatic
} from '@/utils/bigscreenTool/index.js'
import { merge } from 'lodash'
export default {
data() {
return {
todayDevice: [
{
num: 'MED09011',
name: '推土机911',
type: '铲土运输',
status: '在线'
},
{
num: 'MED09012',
name: '推土机912',
type: '铲土运输',
status: '在线'
},
{
num: 'YSQ75031',
name: '夯实机031',
type: '压实机器',
status: '在线'
},
{
num: 'WJJ40710',
name: '轮胎式挖掘机710',
type: '挖掘机械',
status: '在线'
},
{
num: 'QZJ007810',
name: '塔式起重机810',
type: '起重机械',
status: '在线'
},
{
num: 'QZJ007945',
name: '塔式起重机945',
type: '起重机械',
status: '在线'
},
]
}
},
mounted() {
this.initChart1();
this.initChart2();
this.initChart3();
this.initChart4();
this.initChart5();
this.initChart6();
this.initChart7();
this.initChart8();
},
methods: {
getxAxisData(length = 7) {
const baseDate = new Date(), series = [];
for (let i = 0; i < length; i++) {
const middleDate = new Date();
middleDate.setTime(baseDate.getTime() - i * 1000 * 60 * 60 * 24)
series.unshift(`${middleDate.getMonth()}-${middleDate.getDate()}`)
}
return series
},
initChart1() {
initChartStatic('chart1', this.currentPieOption({
color: [
'#5b9ad4',
'#ec7d31',
'#a4a4a4',
'#febf00',
'#4472c3',
],
legend: {
//
orient: "vertical",
right: 20,
itemGap: 20,
top: 'center',
textStyle: {
color: '#252525'
},
},
series: [
{
name: "数据详情",
type: "pie",
radius: ["36%", "60%"],
center: ["37%", "50%"],
data: [
{
name: '挖掘机',
value: 15
},
{
name: '铲土机械',
value: 11
},
{
name: '起重机械',
value: 8
},
{
name: '压实机械',
value: 12
},
{
name: '桩工机械',
value: 22
},
{
name: '其他',
value: 3 * 3
},
],
label: {
formatter: "{c|{c}} , {per|{d}%}",
rich: {
c: {
color: "#252525",
fontSize: 12,
lineHeight: 33,
},
per: {
color: "#252525",
fontSize: 12,
lineHeight: 33,
},
},
},
}
]
}));
},
initChart2() {
initChartStatic('chart2', this.currentPieOption({
color: [
'#5b9ad4',
'#ec7d31',
'#a4a4a4',
'#febf00',
'#4472c3',
],
legend: {
//
orient: "vertical",
right: 20,
itemGap: 20,
top: 'center',
textStyle: {
color: '#252525'
},
},
series: [
{
name: "数据详情",
type: "pie",
radius: ["0%", "60%"],
center: ["37%", "50%"],
data: [
{
name: '在线',
value: 96
},
{
name: '离线',
value: 4
},
],
label: {
formatter: "{per|{d}%}",
rich: {
c: {
color: "#252525",
fontSize: 12,
lineHeight: 33,
},
per: {
color: "#252525",
fontSize: 12,
lineHeight: 33,
},
},
},
}
]
}));
},
initChart3() {
initChartStatic('chart3', this.currentBaseOption({
color: ['#1b7080'],
yAxis: {
data: ['九龙坡工地', '渝中区工地', '江北区工地'],
name: "",
nameLocation: "end", // startmiddle
nameTextStyle: {
//
color: "#252525D0",
},
nameGap: 15, // 线
inverse: false, //
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: false,
},
position: "bottom",
offset: 0, //
type: "category", // time value log
},
xAxis: {
name: '',
type: 'value',
nameTextStyle: {
//
color: "#252525D0",
},
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: false,
},
minorTick: {
// 线
show: false,
},
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252525'
}
},
},
series: [
{
data: [21, 18, 29],
type: 'bar',
barWidth: 30,
label: {
normal: {
show: true,
position: 'right',
formatter: '{c}'
}
}
},
],
grid: {
left: '14%',
top: '8%',
right: '8%',
bottom: '13%'
}
}))
},
initChart4() {
initChartStatic('chart4', this.currentBaseOption({
xAxis: {
data: this.getxAxisData(7),
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
legend: {
itemHeight: 10,
itemGap: 4,
},
yAxis: {
name: '',
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252545'
}
},
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
series: [
{
name: '推土机901',
data: [8, 6, 9, 11, 5, 6, 9]
},
{
name: '推土机902',
data: [4, 5, 8, 6, 2, 11, 5]
},
{
name: '塔式起重机910',
data: [6, 7, 4, 9, 11, 7, 10]
},
{
name: '塔式起重机911',
data: [2, 8, 10, 4, 6, 7, 5]
},
{
name: '夯实机031',
data: [1, 5, 4, 8, 6, 7, 9]
},
{
name: '轮胎式挖掘机710',
data: [3, 8, 9, 6, 7, 4, 2]
},
].map(item => ({
...item,
type: 'line',
smooth: true
})),
grid: {
bottom: '23%'
}
}));
},
initChart5() {
initChartStatic('chart5', this.currentBaseOption({
xAxis: {
data: ['挖掘机', '铲土机械', '起重机械', '压实机械', '桩工机械'],
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
yAxis: {
name: '',
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252545'
}
},
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
series: [
{
name: '九龙坡工地',
data: [7, 3, 2, 5, 8],
type: 'bar',
barWidth: 30,
stack: 'all'
},
{
name: '渝中区工地',
data: [3, 4, 3, 4, 9],
type: 'bar',
barWidth: 30,
stack: 'all'
},
{
name: '江北区工地',
data: [5, 4, 3, 3, 5],
type: 'bar',
barWidth: 30,
stack: 'all'
},
].map(item =>({
...item,
label: {
show: true,
align: 'center',
verticalAlign: 'middle',
position: ['50%', '50%'],
}
})),
grid: {
bottom: '20%'
}
}));
},
initChart6() {
initChartStatic('chart6', this.currentBaseOption({
color: ['#4472c3',],
xAxis: {
data: this.getxAxisData(6),
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
yAxis: {
name: 'L',
max: 300,
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252545'
}
},
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
series: [
{
name: '挖掘机',
data: [23.3, 22.7, 23.6, 24.1, 22.8, 23.0, 22.4],
type: 'bar',
stack: 'all',
},
{
name: '铲土机械',
data: [55.6, 56.8, 60.0, 61.2, 57.0, 58.4, 59.0],
type: 'bar',
stack: 'all',
},
{
name: '起重机械',
data: [63.0, 60.5, 55.0, 57.0, 58.5, 61.3, 62.0],
type: 'bar',
stack: 'all',
},
{
name: '压实机械',
data: [44.0, 38.0, 41.0, 36.0, 32.0, 37.0, 42.0],
type: 'bar',
stack: 'all',
},
{
name: '桩工机械',
data: [90.0, 88.0, 92.0, 95.0, 89.0, 84.0, 87.0],
type: 'bar',
stack: 'all',
},
].map(item =>({
...item,
label: {
show: true,
align: 'center',
verticalAlign: 'middle',
position: ['50%', '50%'],
}
})),
grid: {
bottom: '20%'
}
}));
},
initChart7() {
initChartStatic('chart7', this.currentBaseOption({
xAxis: {
data: this.getxAxisData(6),
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
yAxis: {
name: '%',
max: 120,
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252545'
}
},
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
series: [
{
name: '九龙坡工地',
data: [97, 82, 77, 69, 66, 71, 73],
type: 'line',
},
{
name: '渝中区工地',
data: [86, 91, 82, 79, 76, 81, 70],
type: 'line',
},
{
name: '江北区工地',
data: [79, 67, 81, 70, 84, 82, 72],
type: 'line',
},
].map(item => ({
...item,
smooth: true
})),
}));
},
initChart8() {
initChartStatic('chart8', this.currentBaseOption({
xAxis: {
data: this.getxAxisData(7),
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
yAxis: {
name: '%',
max: 150,
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252545'
}
},
axisLine: {
show: true,
lineStyle: {
color: '#25252545'
}
},
},
series: [
{
name: '挖掘机',
data: [60, 68, 71, 84, 92, 81, 99],
type: 'line',
smooth: true
},
{
name: '铲土机械',
data: [73, 66, 82, 94, 67, 91, 67],
type: 'line',
smooth: true
},
{
name: '起重机械',
data: [59, 61, 84, 66, 97, 83, 64],
type: 'line',
smooth: true
},
{
name: '压实机械',
data: [92, 57, 84, 67, 84, 69, 88],
type: 'line',
smooth: true
},
{
name: '桩工机械',
data: [86, 67, 97, 73, 80, 90, 74],
type: 'line',
smooth: true
},
],
}));
},
currentBaseOption(Options = {}) {
return merge(merge(
generateBaseOptions(),
{
legend: {
//
orient: "horizontal",
itemGap: 20,
top: 'bottom',
left: 'center',
textStyle: {
color: '#252525'
},
},
grid: {
left: '8%',
top: '11%',
right: '2%',
bottom: '20%'
}
}
), Options)
},
currentPieOption(Options = {}) {
return merge(merge(
generatePieOptions(),
{
legend: {
itemGap: 1,
padding: [0,0,0,0]
}
}
), Options)
}
}
}
</script>
<style scoped lang="scss">
@import url(../../../assets/styles/mainPage.scss);
.grid-main-wrapper {
width: 100%;
height: 100%;
gap: 16px !important;
}
.grid-item-wrapper {
border-radius: 6px;
box-shadow: 2px 2px 3px #25252534;
.grid-item-title {
font-family: 'TitleFont';
font-weight: 500 !important;
color: #252525d2 !important;
}
}
#chart1, #chart2, #chart3 {
height: 250px;
}
#chart4, #chart5, #chart6 {
height: 270px;
}
#chart7, #chart8 {
height: 270px;
}
</style>

View File

@ -0,0 +1,528 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编码" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="故障类型" prop="faultType">
<el-select v-model="queryParams.faultType" placeholder="请选择故障类型" clearable>
<el-option
v-for="dict in dict.type.gcjx_fault_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="设备品牌" prop="deviceBrand">
<el-input
v-model="queryParams.deviceBrand"
placeholder="请输入设备品牌"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="故障描述" prop="faultDetail">
<el-input
v-model="queryParams.faultDetail"
placeholder="请输入故障描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保人员" prop="maintenancePerson">
<el-input
v-model="queryParams.maintenancePerson"
placeholder="请输入维保人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保时间" prop="maintenanceTime">
<el-input
v-model="queryParams.maintenanceTime"
placeholder="请输入维保时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保任务" prop="maintenanceTask">
<el-input
v-model="queryParams.maintenanceTask"
placeholder="请输入维保任务"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input
v-model="queryParams.longitude"
placeholder="请输入经度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input
v-model="queryParams.latitude"
placeholder="请输入纬度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工作时间" prop="workTime">
<el-input
v-model="queryParams.workTime"
placeholder="请输入工作时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceManageList" @selection-change="handleSelectionChange" height="calc(100vh - 270px)" :default-sort="defaultSort">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="设备编码" align="center" prop="deviceCode" width="140"/>
<el-table-column label="设备名称" align="center" prop="deviceName" width="200"/>
<el-table-column label="设备类型" align="center" prop="deviceType" width="140">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="设备品牌" align="center" prop="deviceBrand" width="200"/>
<el-table-column label="设备状态" align="center" prop="deviceStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_status" :value="scope.row.deviceStatus"/>
</template>
</el-table-column>
<el-table-column label="故障时间" align="center" prop="workTime" width="150"/>
<el-table-column label="故障类型" align="center" prop="faultType" width="130">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_fault_type" :value="scope.row.faultType"/>
</template>
</el-table-column>
<el-table-column label="故障描述" align="center" prop="faultDetail" width="300"/>
<el-table-column label="维保人员" align="center" prop="maintenancePerson"/>
<el-table-column label="维保时间" align="center" prop="maintenanceTime" width="150"/>
<el-table-column label="维保任务" align="center" prop="maintenanceTask" width="300"/>
<!--<el-table-column label="经度" align="center" prop="longitude"/>
<el-table-column label="纬度" align="center" prop="latitude"/>
<el-table-column label="工作时间" align="center" prop="workTime"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="170">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
>查看
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="设备编码" prop="deviceCode">
<el-input :disabled="disabled" v-model="form.deviceCode" maxlength="14" placeholder="请输入设备编码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="deviceName">
<el-input :disabled="disabled" v-model="form.deviceName" placeholder="请输入设备名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备类型" prop="deviceType">
<el-select :disabled="disabled" v-model="form.deviceType" placeholder="请选择设备类型" style="width: 100%">
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备品牌" prop="deviceBrand">
<el-input :disabled="disabled" v-model="form.deviceBrand" placeholder="请输入设备品牌"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="故障描述" prop="faultDetail">
<el-input :disabled="disabled" v-model="form.faultDetail" type="textarea" placeholder="请输入故障描述"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维保任务" prop="maintenanceTask">
<el-input :disabled="disabled" v-model="form.maintenanceTask" type="textarea" placeholder="请输入维保任务"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="故障类型" prop="faultType">
<el-select :disabled="disabled" v-model="form.faultType" placeholder="请选择故障类型" style="width: 100%">
<el-option
v-for="dict in dict.type.gcjx_fault_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="故障时间" prop="workTime">
<el-date-picker
clearable
:disabled="disabled"
style="width: 100%"
v-model="form.workTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择故障时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="维保人员" prop="maintenancePerson">
<el-input :disabled="disabled" v-model="form.maintenancePerson" placeholder="请输入维保人员"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维保时间" prop="maintenanceTime">
<el-date-picker
clearable
:disabled="disabled"
style="width: 100%"
v-model="form.maintenanceTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择维保时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!--<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度"/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-form-item>
<el-form-item label="工作时间" prop="workTime">
<el-input v-model="form.workTime" placeholder="请输入工作时间"/>
</el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer" v-show="!disabled">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDeviceManage,
getDeviceManage,
delDeviceManage,
addDeviceManage,
updateDeviceManage
} from "@/api/deviceInfo/deviceManage";
const interfaceType = 'gcjxDeviceManage'
export default {
name: "DeviceManage",
dicts: ['gcjx_device_type', 'gcjx_device_status', 'gcjx_fault_type'],
data() {
return {
disabled: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
deviceManageList: [],
//
title: "",
defaultSort: { prop: "maintenanceTime", order: "descending" },
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceCode: null,
deviceName: null,
deviceType: null,
deviceStatus: '30',
deviceBrand: null,
isFault: null,
faultType: null,
faultDetail: null,
maintenancePerson: null,
maintenanceTime: null,
maintenanceTask: null,
longitude: null,
latitude: null,
workTime: null,
interfaceType: interfaceType,
},
//
form: {},
//
rules: {}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备管理列表 */
getList() {
this.loading = true;
listDeviceManage(this.queryParams).then(response => {
this.deviceManageList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deviceCode: null,
deviceName: null,
deviceType: null,
deviceStatus: '30',
deviceBrand: null,
isFault: null,
faultType: null,
faultDetail: null,
maintenancePerson: null,
maintenanceTime: null,
maintenanceTask: null,
longitude: null,
latitude: null,
workTime: null,
interfaceType: interfaceType
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加维修保养记录";
},
/** 查看按钮操作 */
handleView(row) {
this.reset();
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.open = true;
this.disabled = true;
this.title = "查看维修保养记录";
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.disabled = false;
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改维修保养记录";
});
},
/** 设备退场按钮操作 */
handleBack(row) {
this.reset();
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.form.deviceStatus = '40';
updateDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("设备确认退场");
this.getList();
});
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除所选中的维修保养记录?').then(function () {
return delDeviceManage(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('deviceInfo/deviceManage/export', {
...this.queryParams
}, `deviceManage_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,486 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编码" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="设备品牌" prop="deviceBrand">
<el-input
v-model="queryParams.deviceBrand"
placeholder="请输入设备品牌"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="故障描述" prop="faultDetail">
<el-input
v-model="queryParams.faultDetail"
placeholder="请输入故障描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保人员" prop="maintenancePerson">
<el-input
v-model="queryParams.maintenancePerson"
placeholder="请输入维保人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保时间" prop="maintenanceTime">
<el-input
v-model="queryParams.maintenanceTime"
placeholder="请输入维保时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保任务" prop="maintenanceTask">
<el-input
v-model="queryParams.maintenanceTask"
placeholder="请输入维保任务"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input
v-model="queryParams.longitude"
placeholder="请输入经度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input
v-model="queryParams.latitude"
placeholder="请输入纬度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工作时间" prop="workTime">
<el-input
v-model="queryParams.workTime"
placeholder="请输入工作时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-sort"
size="mini"
:disabled="single"
@click="handleBack"
>设备退场
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceManageList" @selection-change="handleSelectionChange" height="calc(100vh - 270px)" :default-sort="defaultSort">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="设备编码" align="center" prop="deviceCode"/>
<el-table-column label="设备名称" align="center" prop="deviceName"/>
<el-table-column label="设备类型" align="center" prop="deviceType">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="设备状态" align="center" prop="deviceStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_status" :value="scope.row.deviceStatus"/>
</template>
</el-table-column>
<el-table-column label="设备品牌" align="center" prop="deviceBrand"/>
<!--<el-table-column label="是否故障" align="center" prop="isFault"/>
<el-table-column label="故障类型" align="center" prop="faultType"/>
<el-table-column label="故障描述" align="center" prop="faultDetail"/>
<el-table-column label="维保人员" align="center" prop="maintenancePerson"/>
<el-table-column label="维保时间" align="center" prop="maintenanceTime"/>
<el-table-column label="维保任务" align="center" prop="maintenanceTask"/>
<el-table-column label="经度" align="center" prop="longitude"/>
<el-table-column label="纬度" align="center" prop="latitude"/>
<el-table-column label="工作时间" align="center" prop="workTime"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-sort"
@click="handleBack(scope.row)"
v-if="scope.row.deviceStatus !== '40'"
>设备退场
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="30%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="设备编码" prop="deviceCode">
<el-input :disabled="disabled" v-model="form.deviceCode" maxlength="14" placeholder="请输入设备编码"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="设备名称" prop="deviceName">
<el-input :disabled="disabled" v-model="form.deviceName" placeholder="请输入设备名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="设备类型" prop="deviceType">
<el-select :disabled="disabled" v-model="form.deviceType" placeholder="请选择设备类型" style="width: 100%">
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="设备状态" prop="deviceStatus">
<el-select :disabled="disabled" v-model="form.deviceStatus" placeholder="请选择设备状态" style="width: 100%">
<el-option
v-for="dict in dict.type.gcjx_device_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="设备品牌" prop="deviceBrand">
<el-input :disabled="disabled" v-model="form.deviceBrand" placeholder="请输入设备品牌"/>
</el-form-item>
</el-col>
</el-row>
<!--<el-form-item label="故障描述" prop="faultDetail">
<el-input v-model="form.faultDetail" placeholder="请输入故障描述"/>
</el-form-item>
<el-form-item label="维保人员" prop="maintenancePerson">
<el-input v-model="form.maintenancePerson" placeholder="请输入维保人员"/>
</el-form-item>
<el-form-item label="维保时间" prop="maintenanceTime">
<el-input v-model="form.maintenanceTime" placeholder="请输入维保时间"/>
</el-form-item>
<el-form-item label="维保任务" prop="maintenanceTask">
<el-input v-model="form.maintenanceTask" placeholder="请输入维保任务"/>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度"/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-form-item>
<el-form-item label="工作时间" prop="workTime">
<el-input v-model="form.workTime" placeholder="请输入工作时间"/>
</el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDeviceManage,
getDeviceManage,
delDeviceManage,
addDeviceManage,
updateDeviceManage
} from "@/api/deviceInfo/deviceManage";
const interfaceType = 'gcjxDeviceManage'
export default {
name: "DeviceManage",
dicts: ['gcjx_device_type', 'gcjx_device_status'],
data() {
return {
disabled: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
deviceManageList: [],
//
title: "",
defaultSort: { prop: "deviceCode", order: "ascending" },
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceCode: null,
deviceName: null,
deviceType: null,
deviceStatus: null,
deviceBrand: null,
isFault: null,
faultType: null,
faultDetail: null,
maintenancePerson: null,
maintenanceTime: null,
maintenanceTask: null,
longitude: null,
latitude: null,
workTime: null,
interfaceType: interfaceType,
},
//
form: {},
//
rules: {}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备管理列表 */
getList() {
this.loading = true;
listDeviceManage(this.queryParams).then(response => {
this.deviceManageList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deviceCode: null,
deviceName: null,
deviceType: null,
deviceStatus: null,
deviceBrand: null,
isFault: null,
faultType: null,
faultDetail: null,
maintenancePerson: null,
maintenanceTime: null,
maintenanceTask: null,
longitude: null,
latitude: null,
workTime: null,
interfaceType: interfaceType
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备管理";
});
},
/** 设备退场按钮操作 */
handleBack(row) {
this.reset();
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.form.deviceStatus = '40';
updateDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("设备确认退场");
this.getList();
});
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除所选中的设备信息?').then(function () {
return delDeviceManage(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('deviceInfo/deviceManage/export', {
...this.queryParams
}, `deviceManage_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,483 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编码" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="故障类型" prop="faultType">
<el-select v-model="queryParams.faultType" placeholder="请选择故障类型" clearable>
<el-option
v-for="dict in dict.type.gcjx_fault_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>-->
<!--<el-form-item label="设备品牌" prop="deviceBrand">
<el-input
v-model="queryParams.deviceBrand"
placeholder="请输入设备品牌"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="故障描述" prop="faultDetail">
<el-input
v-model="queryParams.faultDetail"
placeholder="请输入故障描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保人员" prop="maintenancePerson">
<el-input
v-model="queryParams.maintenancePerson"
placeholder="请输入维保人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保时间" prop="maintenanceTime">
<el-input
v-model="queryParams.maintenanceTime"
placeholder="请输入维保时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维保任务" prop="maintenanceTask">
<el-input
v-model="queryParams.maintenanceTask"
placeholder="请输入维保任务"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input
v-model="queryParams.longitude"
placeholder="请输入经度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input
v-model="queryParams.latitude"
placeholder="请输入纬度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工作时间" prop="workTime">
<el-input
v-model="queryParams.workTime"
placeholder="请输入工作时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceManageList" @selection-change="handleSelectionChange" height="calc(100vh - 270px)" :default-sort="defaultSort">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="设备编码" align="center" prop="deviceCode" width="140"/>
<el-table-column label="设备名称" align="center" prop="deviceName" width="200"/>
<el-table-column label="设备类型" align="center" prop="deviceType" width="140">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="设备品牌" align="center" prop="deviceBrand" width="200"/>
<el-table-column label="设备状态" align="center" prop="deviceStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_status" :value="scope.row.deviceStatus"/>
</template>
</el-table-column>
<!--<el-table-column label="故障类型" align="center" prop="faultType" width="130">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_fault_type" :value="scope.row.faultType"/>
</template>
</el-table-column>
<el-table-column label="故障描述" align="center" prop="faultDetail" width="300"/>
<el-table-column label="维保人员" align="center" prop="maintenancePerson"/>
<el-table-column label="维保时间" align="center" prop="maintenanceTime" width="150"/>
<el-table-column label="维保任务" align="center" prop="maintenanceTask" width="300"/>-->
<el-table-column label="经度" align="center" prop="longitude"/>
<el-table-column label="纬度" align="center" prop="latitude"/>
<el-table-column label="工作时间" align="center" prop="workTime"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="170">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
>查看
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="设备编码" prop="deviceCode">
<el-input :disabled="disabled" v-model="form.deviceCode" maxlength="14" placeholder="请输入设备编码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="deviceName">
<el-input :disabled="disabled" v-model="form.deviceName" placeholder="请输入设备名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备类型" prop="deviceType">
<el-select :disabled="disabled" v-model="form.deviceType" placeholder="请选择设备类型" style="width: 100%">
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备品牌" prop="deviceBrand">
<el-input :disabled="disabled" v-model="form.deviceBrand" placeholder="请输入设备品牌"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工作时间" prop="workTime">
<el-date-picker
clearable
:disabled="disabled"
style="width: 100%"
v-model="form.workTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择工作时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" v-show="!disabled">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDeviceManage,
getDeviceManage,
delDeviceManage,
addDeviceManage,
updateDeviceManage
} from "@/api/deviceInfo/deviceManage";
const interfaceType = 'gcjxDeviceTrack'
export default {
name: "DeviceManage",
dicts: ['gcjx_device_type', 'gcjx_device_status', 'gcjx_fault_type'],
data() {
return {
disabled: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
deviceManageList: [],
//
title: "",
defaultSort: { prop: "workTime", order: "descending" },
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceCode: null,
deviceName: null,
deviceType: null,
deviceStatus: null,
deviceBrand: null,
isFault: null,
faultType: null,
faultDetail: null,
maintenancePerson: null,
maintenanceTime: null,
maintenanceTask: null,
longitude: null,
latitude: null,
workTime: null,
interfaceType: interfaceType,
},
//
form: {},
//
rules: {}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备管理列表 */
getList() {
this.loading = true;
listDeviceManage(this.queryParams).then(response => {
this.deviceManageList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deviceCode: null,
deviceName: null,
deviceType: null,
deviceStatus: null,
deviceBrand: null,
isFault: null,
faultType: null,
faultDetail: null,
maintenancePerson: null,
maintenanceTime: null,
maintenanceTask: null,
longitude: null,
latitude: null,
workTime: null,
interfaceType: interfaceType
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备运动轨迹";
},
/** 查看按钮操作 */
handleView(row) {
this.reset();
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.open = true;
this.disabled = true;
this.title = "查看设备运动轨迹";
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.disabled = false;
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备运动轨迹";
});
},
/** 设备退场按钮操作 */
handleBack(row) {
this.reset();
const id = row.id || this.ids
getDeviceManage(id).then(response => {
this.form = response.data;
this.form.deviceStatus = '40';
updateDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("设备确认退场");
this.getList();
});
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeviceManage(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除所选中的设备运动轨迹?').then(function () {
return delDeviceManage(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('deviceInfo/deviceManage/export', {
...this.queryParams
}, `deviceManage_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -23,12 +23,11 @@
<el-table-column label="设备编号" align="center" prop="num" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="设备类型" align="center" prop="type" />
<el-table-column
label="设备状态"
align="center"
class="zzz"
prop="status"
/>
<el-table-column label="设备状态" align="center" prop="status">
<template slot-scope="scope">
<span :style="`color: ${scope.row.status === '离线' ? 'red' : '#62cfa2'};`">{{ scope.row.status }}</span>
</template>
</el-table-column>
<el-table-column label="品牌" align="center" prop="brand" />
</el-table>
</div>
@ -153,9 +152,6 @@ export default {
</script>
<style scoped lang="scss">
@import url(../../../styles/mainPage.scss);
.zzz {
color: red;
}
.top-card-inner {
flex-direction: row !important;
box-shadow: 2px 2px 2px #25252525;

View File

@ -0,0 +1,457 @@
<template>
<div class="home-page-wrapper">
<div class="card-item-wrapper">
<div class="card-item-content">
<div class="card-item-main" id="chart1"></div>
</div>
<div class="card-item-content">
<div class="card-item-main" id="chart2"></div>
</div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import {merge} from 'lodash';
export default {
//
data() {
return {}
},
mounted() {
this.initChart1();
this.initChart2();
},
methods: {
//
initChart1() {
if (this.chartInstance) this.chartInstance.clear()
const warnCountChart = document.getElementById("chart1")
this.chartInstance = echarts.init(warnCountChart, 'default');
this.chartInstance.setOption({
title: {
text: '设备类型分布',
textStyle: {
fontSize: 16
},
},
color: [
'#37A2DA',
'#9FE6B8',
'#FFDB5C',
'#ff9f7f',
'#fb7293',
'#E062AE',
'#32C5E9',
'#67E0E3',
'#E690D1',
'#e7bcf3',
'#9d96f5',
'#8378EA',
'#96BFFF'
],
legend: {
//
orient: "vertical",
right: 30,
itemGap: 20,
top: 'center',
textStyle: {
color: '#252525'
},
},
series: [
{
name: "数据详情",
type: "pie",
radius: ["40%", '70%'],
center: ["40%", "50%"],
data: [{
value: 15,
name: '挖掘机'
}, {
value: 11,
name: '铲土机械'
}, {
value: 8,
name: '起重机械'
}, {
value: 12,
name: '压实机械'
}, {
value: 22,
name: '桩机机械'
}],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
label: {
formatter: "{c},{per|{d}%}",
borderWidth: 20,
borderRadius: 4,
rich: {
b: {
color: "#252525",
fontSize: 12,
lineHeight: 33,
},
per: {
fontSize: 12,
padding: [2, 4],
borderRadius: 2,
},
},
},
},
],
grid: {
x: 20,
x2: 80,
y: 60,
y2: 60,
//
backgroundColor: "rgba(0,0,0,0)",
borderWidth: 2,
borderColor: "#fff232",
},
polor: {
center: ["30%", "50%"],
},
}, true, true);
window.addEventListener("resize", () => {
this.$nextTick(() => {
this.chartInstance && this.chartInstance.resize();
})
})
},
initChart2() {
const chart = document.getElementById("chart2");
const chartInstance = echarts.init(chart, 'default');
chartInstance.setOption(this.generateOptions({
title: {
text: '各区域设备类型分布',
textStyle: {
fontSize: 16
},
},
color: [
'#37A2DA',
'#9FE6B8',
'#FFDB5C',
'#ff9f7f',
'#fb7293',
'#E062AE',
'#32C5E9',
'#67E0E3',
'#E690D1',
'#e7bcf3',
'#9d96f5',
'#8378EA',
'#96BFFF'
],
xAxis: {
data: ['挖掘机', '铲土机械', '起重机械', '压实机械', '桩工机械']
},
yAxis: [
{
name: "L",
// max: 100.0,
nameTextStyle: {
//
color: "#9b9ba4",
},
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
minorTick: {
// 线
show: false,
},
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252520'
}
},
},
{
name: "%",
max: 40,
nameTextStyle: {
//
color: "#9b9ba4",
},
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
minorTick: {
// 线
show: false,
},
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252520'
}
},
},
],
series: [
{
name: '九龙坡工地',
data: [7,3,2,5,8],
type: 'bar',
barWidth: 30,
yAxisIndex: 0,
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: '#252525'
}
}
}
}
},
{
name: '渝中区工地',
data: [3,4,3,4,9],
type: 'bar',
barWidth: 30,
yAxisIndex: 0,
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: '#252525'
}
}
}
}
},
{
name: '江北区工地',
data: [5,4,3,3,5],
type: 'bar',
barWidth: 30,
yAxisIndex: 0,
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: '#252525'
}
}
}
}
}
],
}), true, true);
window.addEventListener("resize", () => {
this.$nextTick(() => {
chartInstance && chartInstance.resize();
})
})
},
/**
* 调用方法
* @param Options
* @returns {*}
*/
generateOptions(Options = {}) {
return merge({
title: {
text: "",
textStyle: {
fontSize: 16
},
},
textStyle: {
color: '#fff'
},
color: [
'#306fff',
'#30c9c9',
'#f7ad08',
'#93beff'
],
tooltip: {
show: true,
trigger: 'axis'
},
xAxis: {
show: true,
name: "",
nameLocation: "end", // startmiddle
nameTextStyle: {
//
color: "#252525D0",
},
nameGap: 15, // 线
inverse: false, //
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
position: "bottom",
offset: 0, //
type: "category", // time value log
data: [],
},
yAxis: {
name: "",
nameTextStyle: {
//
color: "#9b9ba4",
},
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
minorTick: {
// 线
show: false,
},
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252520'
}
},
},
series: [
{
name: '',
data: [],
type: 'line',
smooth: true,
}
],
//
legend: {
show: true,
//
orient: "horizontal", // horizontal vertical
x: "center", //
bottom: 7, //
// backgroundColor: "#000000",
// borderColor: "#ccc",
// borderWidth: 0,
padding: 5,
itemGap: 10, // item
itemWidth: 10, //
itemHeight: 10, //
borderRadius: 10,
textStyle: {
color: "#252525",
fontSize: 9,
},
lineStyle: {
type: 'dotted',
opacity: 0
}
},
//
grid: {
left: '8%',
top: '10%',
right: '8%',
bottom: '19%'
}
}, Options);
}
}
}
</script>
<style scoped lang="scss">
.home-page-wrapper {
width: 100%;
padding: 10px;
background-color: #25252510;
.card-item-wrapper {
display: grid;
grid-template-columns:3fr 5fr;
gap: 14px;
padding: 10px;
padding-top: 0px;
.card-item-content {
background-color: #fff;
border-radius: 6px;
padding: 4px 0;
.card-item-title {
font-size: 1.2rem;
height: 2rem;
line-height: 2rem;
padding-left: 1rem;
font-family: "TitleFont";
color: #252525D0;
}
.card-item-main {
min-height: 385px;
}
}
}
}
</style>

View File

@ -0,0 +1,311 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备名称" prop="eqName">
<el-input
v-model="queryParams.eqName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型" prop="eqType">
<el-select v-model="queryParams.eqType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['dimension:gcjxEqLook:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['dimension:gcjxEqLook:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dimension:gcjxEqLook:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['dimension:gcjxEqLook:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="gcjxEqLookList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备编号" align="center" prop="eqNum" />
<el-table-column label="设备名称" align="center" prop="eqName" />
<el-table-column label="设备类型" align="center" prop="eqType">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_type" :value="scope.row.eqType"/>
</template>
</el-table-column>
<el-table-column label="日期" align="center" prop="dateTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.dateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="工作时长(h)" align="center" prop="workTime" />
<el-table-column label="油耗(L)" align="center" prop="oilConsumption" />
<el-table-column label="维修次数" align="center" prop="maintenance" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dimension:gcjxEqLook:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dimension:gcjxEqLook:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备对象分析对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="设备编号" prop="eqNum">-->
<!-- <el-input v-model="form.eqNum" placeholder="请输入设备编号" />-->
<!-- </el-form-item>-->
<el-form-item label="设备名称" prop="eqName">
<el-input v-model="form.eqName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备类型" prop="eqType">
<el-select v-model="queryParams.eqType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dict.type.gcjx_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="日期" prop="dateTime">
<el-date-picker clearable
v-model="form.dateTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="工作时长(h)" prop="workTime">
<el-input v-model="form.workTime" placeholder="请输入工作时长" />
</el-form-item>
<el-form-item label="油耗(L)" prop="oilConsumption">
<el-input v-model="form.oilConsumption" placeholder="请输入油耗" />
</el-form-item>
<el-form-item label="维修次数" prop="maintenance">
<el-input v-model="form.maintenance" placeholder="请输入维修次数" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listGcjxEqLook, getGcjxEqLook, delGcjxEqLook, addGcjxEqLook, updateGcjxEqLook } from "@/api/dimension/gcjxEqLook";
export default {
name: "GcjxEqLook",
dicts:['gcjx_device_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
gcjxEqLookList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
eqNum: null,
eqName: null,
eqType: null,
dateTime: null,
workTime: null,
oilConsumption: null,
maintenance: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备对象分析列表 */
getList() {
this.loading = true;
listGcjxEqLook(this.queryParams).then(response => {
this.gcjxEqLookList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
eqNum: null,
eqName: null,
eqType: null,
dateTime: null,
workTime: null,
oilConsumption: null,
maintenance: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备对象分析";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getGcjxEqLook(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备对象分析";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateGcjxEqLook(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addGcjxEqLook(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除设备对象分析编号为"' + ids + '"的数据项?').then(function() {
return delGcjxEqLook(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('dimension/gcjxEqLook/export', {
...this.queryParams
}, `gcjxEqLook_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,443 @@
<template>
<div class="home-page-wrapper">
<div class="card-item-wrapper">
<div class="card-item-content">
<div class="card-item-main" id="chart2"></div>
</div>
<div class="card-item-content">
<div class="card-item-main" id="chart1"></div>
</div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import {merge} from 'lodash';
export default {
//
data() {
return {}
},
mounted() {
this.initChart1();
this.initChart2();
},
methods: {
//
initChart1() {
if (this.chartInstance) this.chartInstance.clear()
const warnCountChart = document.getElementById("chart1")
this.chartInstance = echarts.init(warnCountChart, 'default');
this.chartInstance.setOption({
title: {
text: '故障类型占比',
textStyle: {
fontSize: 16
},
},
color: [
'#37A2DA',
'#05407f',
'#cb7923',
'#6c7179',
'#9a3f05'
],
legend: {
//
orient: "vertical",
right: 30,
itemGap: 20,
top: 'center',
textStyle: {
color: '#252525'
},
},
series: [
{
name: "数据详情",
type: "pie",
radius: ["40%", '70%'],
center: ["40%", "50%"],
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2
},
data: [{
value: 15,
name: '轴承磨损'
}, {
value: 11,
name: '链条松驰'
}, {
value: 8,
name: '齿轮损坏'
}, {
value: 12,
name: '油缸卡滞'
}, {
value: 22,
name: '堵塞与渗漏'
}],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
label: {
formatter: "{c},{per|{d}%}",
borderWidth: 20,
borderRadius: 4,
rich: {
b: {
color: "#252525",
fontSize: 12,
lineHeight: 33,
},
per: {
fontSize: 12,
padding: [2, 4],
borderRadius: 2,
},
},
},
},
],
grid: {
x: 20,
x2: 80,
y: 60,
y2: 60,
//
backgroundColor: "rgba(0,0,0,0)",
borderWidth: 2,
borderColor: "#fff232",
},
polor: {
center: ["30%", "50%"],
},
}, true, true);
window.addEventListener("resize", () => {
this.$nextTick(() => {
this.chartInstance && this.chartInstance.resize();
})
})
},
initChart2() {
const chart = document.getElementById("chart2");
const chartInstance = echarts.init(chart, 'default');
chartInstance.setOption(this.generateOptions({
title: {
text: '设备故障率',
textStyle: {
fontSize: 16
},
},
color: [
'#0869e0',
'#ee8641',
'#b0b4b4'
],
xAxis: {
data: ['挖掘机', '铲土机械', '起重机械', '压实机械', '桩工机械']
},
yAxis: [
{
name: "%",
// max: 100.0,
nameTextStyle: {
//
color: "#9b9ba4",
},
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
minorTick: {
// 线
show: false,
},
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252520'
}
},
},
{
name: "%",
max: 40,
nameTextStyle: {
//
color: "#9b9ba4",
},
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
minorTick: {
// 线
show: false,
},
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252520'
}
},
},
],
series: [
{
name: '九龙坡工地',
data: [18, 27, 8, 13, 5],
type: 'bar',
barWidth: 30,
yAxisIndex: 0,
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: '#252525'
}
}
}
}
},
{
name: '渝中区工地',
data: [21, 35, 17, 21, 18],
type: 'bar',
barWidth: 30,
yAxisIndex: 0,
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: '#252525'
}
}
}
}
},
{
name: '江北区工地',
data: [32, 17, 11, 7, 11],
type: 'bar',
barWidth: 30,
yAxisIndex: 0,
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: '#252525'
}
}
}
}
}
],
}), true, true);
window.addEventListener("resize", () => {
this.$nextTick(() => {
chartInstance && chartInstance.resize();
})
})
},
/**
* 调用方法
* @param Options
* @returns {*}
*/
generateOptions(Options = {}) {
return merge({
title: {
text: "",
textStyle: {
fontSize: 16
},
},
textStyle: {
color: '#fff'
},
color: [
'#306fff',
'#30c9c9',
'#f7ad08',
'#93beff'
],
tooltip: {
show: true,
trigger: 'axis'
},
xAxis: {
show: true,
name: "",
nameLocation: "end", // startmiddle
nameTextStyle: {
//
color: "#252525D0",
},
nameGap: 15, // 线
inverse: false, //
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
position: "bottom",
offset: 0, //
type: "category", // time value log
data: [],
},
yAxis: {
name: "",
nameTextStyle: {
//
color: "#9b9ba4",
},
axisLabel: {
//
hideOverlap: true, //
color: "#252525D0",
},
axisLine: {
show: true,
lineStyle: {
color: '#25252550'
}
},
minorTick: {
// 线
show: false,
},
splitLine: {
// grid线
show: true,
lineStyle: {
type: 'dashed',
color: '#25252520'
}
},
},
series: [
{
name: '',
data: [],
type: 'line',
smooth: true,
}
],
//
legend: {
show: true,
//
orient: "horizontal", // horizontal vertical
x: "center", //
bottom: 7, //
// backgroundColor: "#000000",
// borderColor: "#ccc",
// borderWidth: 0,
padding: 5,
itemGap: 10, // item
itemWidth: 10, //
itemHeight: 10, //
borderRadius: 10,
textStyle: {
color: "#252525",
fontSize: 9,
},
lineStyle: {
type: 'dotted',
opacity: 0
}
},
//
grid: {
left: '8%',
top: '10%',
right: '8%',
bottom: '19%'
}
}, Options);
}
}
}
</script>
<style scoped lang="scss">
.home-page-wrapper {
width: 100%;
padding: 10px;
background-color: #25252510;
.card-item-wrapper {
display: grid;
grid-template-columns:5fr 3fr;
gap: 14px;
padding: 10px;
padding-top: 0px;
.card-item-content {
background-color: #fff;
border-radius: 6px;
padding: 4px 0;
.card-item-title {
font-size: 1.2rem;
height: 2rem;
line-height: 2rem;
padding-left: 1rem;
font-family: "TitleFont";
color: #252525D0;
}
.card-item-main {
min-height: 450px;
}
}
}
}
</style>

View File

@ -4,6 +4,7 @@
<energy-home v-else-if="port === '9160'"></energy-home>
<machinery-home v-else-if="port === '9170'"></machinery-home>
<deviceMap v-else-if="port === '9190'"></deviceMap>
<device-info v-else-if="port === '9210'"></device-info>
<cityManageMap v-else-if="port === '9180'" />
<operate-home v-else-if="port === '80' || port === ''"></operate-home>
<home-page v-else></home-page>
@ -16,6 +17,8 @@ import EnergyHome from './energy/home/index.vue'
import MachineryHome from './machinery/home/index.vue'
import deviceMap from './monitorMap/deviceMap/index.vue'
import cityManageMap from './cityManage/map/index.vue'
import deviceInfo from './deviceInfo/home/index.vue'
export default {
components: {
HomePage,
@ -23,7 +26,8 @@ export default {
EnergyHome,
MachineryHome,
deviceMap,
cityManageMap
cityManageMap,
deviceInfo
},
data() {
return {

View File

@ -152,7 +152,12 @@ export default {
document.title = '石坪桥街道老旧小区改造提升平台'
loginDom.style.backgroundImage = 'url(/images/spq.png)'
this.redirect = '/index'
break
break;
case '9210':
document.title = '工程机械数字服务平台'
loginDom.style.backgroundImage = 'url(/images/gongcheng-bg.png)'
this.redirect = '/index'
break;
default:
document.title = ''
loginDom.style.backgroundImage = 'url(/images/gangyin-bg.png)'