Merge remote-tracking branch 'origin/upgrade' into upgrade

This commit is contained in:
Renpc-kilig 2023-11-21 12:02:29 +08:00
commit 43f9851186
2 changed files with 40 additions and 21 deletions

View File

@ -1,5 +1,6 @@
package com.cm.population.pojo.vos.house; package com.cm.population.pojo.vos.house;
import com.cm.common.annotation.CheckEmptyAnnotation;
import com.cm.common.annotation.CheckNumberAnnotation; import com.cm.common.annotation.CheckNumberAnnotation;
import com.cm.population.pojo.vos.population.PopulationVO; import com.cm.population.pojo.vos.population.PopulationVO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
@ -37,6 +38,7 @@ public class HouseVO {
@CheckNumberAnnotation(name = "所在层/院") @CheckNumberAnnotation(name = "所在层/院")
private String affiliationFloors; private String affiliationFloors;
@ApiModelProperty(name = "houseNum", value = "门牌号") @ApiModelProperty(name = "houseNum", value = "门牌号")
@CheckEmptyAnnotation(name = "门牌号")
private String houseNum; private String houseNum;
@ApiModelProperty(name = "categoryId", value = "房屋类别") @ApiModelProperty(name = "categoryId", value = "房屋类别")
private String categoryId; private String categoryId;

View File

@ -32,11 +32,14 @@
#contentBody .center .main {} #contentBody .center .main {}
#contentBody .center .main .floor {height: 100px; box-sizing: border-box; white-space: nowrap;} #contentBody .center .main .floor {height: 100px; box-sizing: border-box; white-space: nowrap;}
#contentBody .center .main .floor .unit {display: inline-block; box-sizing: border-box;} #contentBody .center .main .floor .unit {display: inline-block; box-sizing: border-box;}
#contentBody .center .main .floor .unit .house {width: 200px; height: 100px; border: 1px solid #e6e6e6; box-sizing: border-box; display: inline-block; font-size: 14px; cursor: pointer; text-align: center; line-height: 100px; user-select:none; transition: background-color .3s, font-weight .3s;} #contentBody .center .main .floor .unit .house {width: 200px; height: 100px; border: 1px solid #e6e6e6; box-sizing: border-box; display: inline-block; font-size: 14px; cursor: pointer; text-align: center; user-select:none; transition: background-color .3s, font-weight .3s;}
#contentBody .center .main .floor .unit .house:hover {font-weight: bold; background-color: #f2f2f2;} #contentBody .center .main .floor .unit .house:hover {font-weight: bold; background-color: #f2f2f2;}
#contentBody .center .main .floor .unit .house .info {display: flex; justify-content: center; align-items: center;} #contentBody .center .main .floor .unit .house .info {display: flex; flex-direction: column; justify-content: space-between; align-items: center; height: 100%;}
#contentBody .center .main .floor .unit .house .info .name {} #contentBody .center .main .floor .unit .house .info .name .num {margin-top: 15px}
#contentBody .center .main .floor .unit .house .info .option {display: none;} #contentBody .center .main .floor .unit .house .info .name .time {scale: 0.8}
#contentBody .center .main .floor .unit .house .info .option {width: 100%;display: flex;justify-content: space-between;}
#contentBody .center .main .floor .unit .house .info .option .tips {padding: 0 5px; scale: 0.8;}
#contentBody .center .main .floor .unit .house .info .option .btns {padding: 0 5px;}
</style> </style>
</head> </head>
<body> <body>
@ -249,6 +252,7 @@
var initBuilding = function() { var initBuilding = function() {
selectedRelation.buildingId = ''; selectedRelation.buildingId = '';
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/building/listpage', []), { top.restAjax.get(top.restAjax.path('api/building/listpage', []), {
page: buildingPager.currentPage, page: buildingPager.currentPage,
rows: buildingPager.rows, rows: buildingPager.rows,
@ -263,7 +267,11 @@
renderBuilding(); renderBuilding();
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}) }, function() {
loadLayerIndex = top.dialog.msg('正在加载...', {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
} }
var initHouse = function() { var initHouse = function() {
@ -406,15 +414,24 @@
data.units[jndex].maxHouseCount = jtem.houses.length; data.units[jndex].maxHouseCount = jtem.houses.length;
} }
$.each(jtem.houses, function(kndex, ktem) { $.each(jtem.houses, function(kndex, ktem) {
var option = ktem.isCreator === 1 ? `
<div class="option">
<div class="tips">
<span><i class="fa fa-users"></i> ${ktem.populationCount}</span>
</div>
<div class="btns">
<a href="javascript:void(0)" class="house-edit" data-id="${ktem.houseId}" title="编辑"><i class="fa fa-edit"></i></a>
<a href="javascript:void(0)" class="house-remove" data-id="${ktem.houseId}" data-name="${ktem.name}" data-floor="${index + 1}" data-unit="${jndex + 1}" title="删除"><i class="fa fa-trash"></i></a>
</div>
</div>`: '';
houses += ` houses += `
<div class="house" data-id="${ktem.houseId}"> <div class="house" data-id="${ktem.houseId}">
<div class="info"> <div class="info">
<div class="name">${ktem.name}</div> <div class="name">
<div class="option"> <div class="num"><i class="fa fa-home"></i> ${ktem.name}</div>
<a href="javascript:void(0)" class="house-edit" data-id="${ktem.houseId}">编辑</a> <div class="time">${ktem.gmtCreate}</div>
<span>|</span>
<a href="javascript:void(0)" class="house-remove" data-id="${ktem.houseId}" data-name="${ktem.name}" data-floor="${index + 1}" data-unit="${jndex + 1}">删除</a>
</div> </div>
${option}
</div> </div>
</div> </div>
`; `;
@ -444,7 +461,7 @@
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}, function() { }, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); loadLayerIndex = top.dialog.msg('正在加载...', {icon: 16, time: 0, shade: 0.3});
}, function() { }, function() {
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
@ -537,16 +554,16 @@
$left.css('top', `${50 - scroll.top}px`); $left.css('top', `${50 - scroll.top}px`);
$top.css('left', `${100 - scroll.left}px`); $top.css('left', `${100 - scroll.left}px`);
}); });
$(document).on('mouseover', '#contentBody .center .main .floor .unit .house', function() { // $(document).on('mouseover', '#contentBody .center .main .floor .unit .house', function() {
var $this = $(this); // var $this = $(this);
$this.find('.option').show(); // $this.find('.option').show();
$this.find('.name').hide(); // $this.find('.name').hide();
}); // });
$(document).on('mouseout', '#contentBody .center .main .floor .unit .house', function() { // $(document).on('mouseout', '#contentBody .center .main .floor .unit .house', function() {
var $this = $(this); // var $this = $(this);
$this.find('.option').hide(); // $this.find('.option').hide();
$this.find('.name').show(); // $this.find('.name').show();
}); // });
$(document).on('click', '#contentBody .center .main .floor .unit .house .info .option .house-edit', function() { $(document).on('click', '#contentBody .center .main .floor .unit .house .info .option .house-edit', function() {
var houseId = this.dataset.id; var houseId = this.dataset.id;
layer.open({ layer.open({