Commit ae27b7d3 by chenjunxiong

build(service):

parent 5cc80df6
......@@ -13,7 +13,9 @@ export const JeecgListMixin = {
data(){
return {
/* 查询条件-请不要在queryParam中声明非字符串值的属性 */
queryParam: {},
queryParam: {
deleted: false,
},
/* 数据源 */
dataSource:[],
/* 分页参数 */
......@@ -156,7 +158,7 @@ export const JeecgListMixin = {
this.$refs.superQueryModal.show();
},
searchReset() {
this.queryParam = {}
this.queryParam = {deleted: false}
this.loadData(1);
},
batchDel: function () {
......
......@@ -153,7 +153,6 @@ export default {
},
data() {
return {
queryParam: {deleted: false},
description: 'pm_access_control_device管理页面',
// 表头
columns: [
......
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼栋">
<a-select placeholder="选择楼栋" v-model="queryParam.buildingName" @change="buildingChange">
<a-select-option v-for="buildingInfo in buildingInfos" :key="buildingInfo.name">
{{ buildingInfo.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼层">
<a-select placeholder="选择楼层" v-model="queryParam.floor">
<a-select-option v-for="floor in targetFloorList" :key="floor">
{{ floor }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="设备类型">
<a-select placeholder="设备类型" v-model="queryParam.type">
<a-select-option v-for="type in types" :key="type">
{{ type }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<!--<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('pm_access_control_device')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
&lt;!&ndash; 高级查询区域 &ndash;&gt;
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>-->
<!-- table区域-begin -->
<div>
<a-row>
<a-col :span="24">
<div style="position: relative">
<img ref="floorImg" src="@/assets/floor.png" alt="floor" width="100%" height="100%"
@load="floorImgLoadComplete()"/>
<img v-for="(item, index) in list"
ref="icon"
:src="item.status === 'NORMAL'
? statusList[0].imgPath
: (item.status === 'OFFLINE' ? statusList[1].imgPath : statusList[2].imgPath)"
:alt="item.name + ':' + item.ip"/>
</div>
</a-col>
</a-row>
</div>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {getAction} from '@/api/manage'
export default {
name: 'PmAccessControlDeviceOverview',
components: {},
data() {
return {
queryParam: {deleted: false},
description: 'pm_access_control_device管理页面',
url: {
list: "/pm/pmAccessControlDevice/list",
delete: "/pm/pmAccessControlDevice/delete",
deleteBatch: "/pm/pmAccessControlDevice/deleteBatch",
exportXlsUrl: "/pm/pmAccessControlDevice/exportXls",
importExcelUrl: "pm/pmAccessControlDevice/importExcel",
},
list: [],
dictOptions: {},
superFieldList: [],
buildingInfos: [],
targetFloorList: [],
types: [],
statusList: [
{name: '正常', value: 'NORMAL', imgPath: require('@/assets/door-close.png')},
{name: '离线', value: 'OFFLINE', imgPath: require('@/assets/door-offline.png')},
{name: '损坏', value: 'BREAKDOWN', imgPath: require('@/assets/door-warning.png')}],
}
},
created() {
getAction('/pm/pmBuildingInfo/list')
.then(value => this.buildingInfos = value.result);
getAction('/pm/pmAccessControlDevice/types')
.then(value => this.types = value.result);
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
buildingChange(value) {
let targetList = this.buildingInfos.filter(buildingInfo => buildingInfo.name === value);
if (targetList != null && targetList.length > 0) {
this.targetFloorList = targetList[0].floorList;
} else {
this.targetFloorList = [];
}
},
loadComplete() {
if (this.list.length > 0) {
this.list.forEach((item, index) => {
let fixX = 20;
let fixY = 20;
let offsetWidth = this.$refs.floorImg.offsetWidth;
let offsetHeight = this.$refs.floorImg.offsetHeight;
this.$refs.icon[index].style.position = 'absolute';
this.$refs.icon[index].style.width = '40px';
this.$refs.icon[index].style.top = item.coordinate.y * offsetHeight - fixY + 'px';
this.$refs.icon[index].style.left = item.coordinate.x * offsetWidth - fixX + 'px';
});
}
},
searchQuery() {
getAction(this.url.list, this.queryParam)
.then(value => {
this.list = value.result.records;
this.$nextTick(()=>{
this.loadComplete();
})
});
},
searchReset() {
this.searchQuery();
},
floorImgLoadComplete() {
this.searchQuery();
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼栋">
<a-select placeholder="选择楼栋" v-model="queryParam.buildingName" @change="buildingChange">
<a-select-option v-for="buildingInfo in buildingInfos" :key="buildingInfo.name">
{{ buildingInfo.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼层">
<a-select placeholder="选择楼层" v-model="queryParam.floor">
<a-select-option v-for="floor in targetFloorList" :key="floor">
{{ floor }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<!--<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('pm_access_control_device')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
&lt;!&ndash; 高级查询区域 &ndash;&gt;
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>-->
<!-- table区域-begin -->
<div>
<a-row>
<a-col :span="24">
<div style="position: relative">
<img ref="floorImg" src="@/assets/floor.png" alt="floor" width="100%" height="100%"
@load="floorImgLoadComplete()"/>
<img v-for="(item, index) in list"
ref="icon"
:src="item.status === 'NORMAL'
? statusList[0].imgPath
: (item.status === 'OFFLINE' ? statusList[1].imgPath : statusList[2].imgPath)"
:alt="item.name + ':' + item.ip"/>
</div>
</a-col>
</a-row>
</div>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {getAction} from '@/api/manage'
export default {
name: 'PmMonitoringDeviceOverview',
components: {},
data() {
return {
queryParam: {deleted: false},
description: 'pm_monitoring_device管理页面',
url: {
list: "/pm/pmMonitoringDevice/list",
delete: "/pm/pmMonitoringDevice/delete",
deleteBatch: "/pm/pmMonitoringDevice/deleteBatch",
exportXlsUrl: "/pm/pmMonitoringDevice/exportXls",
importExcelUrl: "pm/pmMonitoringDevice/importExcel",
},
list: [],
dictOptions: {},
superFieldList: [],
buildingInfos: [],
targetFloorList: [],
types: [],
statusList: [
{name: '正常', value: 'NORMAL', imgPath: require('@/assets/door-close.png')},
{name: '离线', value: 'OFFLINE', imgPath: require('@/assets/door-offline.png')},
{name: '损坏', value: 'BREAKDOWN', imgPath: require('@/assets/door-warning.png')}],
}
},
created() {
getAction('/pm/pmBuildingInfo/list')
.then(value => this.buildingInfos = value.result);
getAction('/pm/pmAccessControlDevice/types')
.then(value => this.types = value.result);
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
buildingChange(value) {
let targetList = this.buildingInfos.filter(buildingInfo => buildingInfo.name === value);
if (targetList != null && targetList.length > 0) {
this.targetFloorList = targetList[0].floorList;
} else {
this.targetFloorList = [];
}
},
loadComplete() {
if (this.list.length > 0) {
this.list.forEach((item, index) => {
console.log(item);
let fixX = 20;
let fixY = 20;
let offsetWidth = this.$refs.floorImg.offsetWidth;
let offsetHeight = this.$refs.floorImg.offsetHeight;
this.$refs.icon[index].style.position = 'absolute';
this.$refs.icon[index].style.width = '40px';
this.$refs.icon[index].style.top = item.coordinate.y * offsetHeight - fixY + 'px';
this.$refs.icon[index].style.left = item.coordinate.x * offsetWidth - fixX + 'px';
});
}
},
searchQuery() {
getAction(this.url.list, this.queryParam)
.then(value => {
this.list = value.result.records;
this.$nextTick(()=>{
this.loadComplete();
})
});
},
searchReset() {
this.searchQuery();
},
floorImgLoadComplete() {
this.searchQuery();
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
......@@ -128,7 +128,7 @@ public class PmAccessControlDevice implements Serializable {
*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private String status;
private Status status;
/**
* 创建人Id(sys_user)
*/
......@@ -165,4 +165,10 @@ public class PmAccessControlDevice implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
public enum Status {
NORMAL,
OFFLINE,
BREAKDOWN
}
}
package org.jeecg.pm.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -79,13 +80,13 @@ public class PmMonitoringDevice implements Serializable {
@ApiModelProperty(value = "设备位置")
private String place;
// /**
// * xy值
// */
// @Excel(name = "xy值", width = 15)
// @ApiModelProperty(value = "xy值")
// @TableField(typeHandler = Coordinate.TypeHandler.class)
// private Coordinate coordinate;
/**
* xy值
*/
@Excel(name = "xy值", width = 15)
@ApiModelProperty(value = "xy值")
@TableField(typeHandler = Coordinate.TypeHandler.class)
private Coordinate coordinate;
/**
* 生产日期
*/
......@@ -121,7 +122,7 @@ public class PmMonitoringDevice implements Serializable {
*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private String status;
private Status status;
/**
* 创建人Id(sys_user)
*/
......@@ -152,9 +153,15 @@ public class PmMonitoringDevice implements Serializable {
/**
* 修改时间
*/
@Excel(name = "修改时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@Excel(name = "修改时间", width = 15, format = "yyyy-MM-dd hh:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
public enum Status {
NORMAL,
OFFLINE,
BREAKDOWN
}
}
......@@ -22,6 +22,7 @@ public class PmAccessControlDeviceServiceImpl extends ServiceImpl<PmAccessContro
@Override
public boolean save(PmAccessControlDevice entity) {
entity.setId(IdWorker.getId())
.setDeleted(false)
.setCreateTime(new Date())
.setModifyTime(new Date());
return super.save(entity);
......
......@@ -30,6 +30,7 @@ public class PmMonitoringDeviceServiceImpl extends ServiceImpl<PmMonitoringDevic
@Override
public boolean save(PmMonitoringDevice entity) {
entity.setId(IdWorker.getId())
.setDeleted(false)
.setCreateTime(new Date())
.setModifyTime(new Date());
return super.save(entity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment