@@ -403,7 +427,7 @@
var initData = function() {
if(!selectedRelation.buildingId) {
- $top.append(`
请选择楼宇
`)
+ $top.append(`
请选择楼/排
`)
return;
}
var loadLayerIndex;
@@ -433,8 +457,72 @@
$lis.filter('.active').removeClass('active');
$(this).addClass('active');
selectedRelation.buildingId = this.dataset.id;
+ selectedRelation.buildingFloorsNum = this.dataset.floorsNum;
+ selectedRelation.buildingUnitNum = this.dataset.unitNum;
initHouse();
});
+ $(document).on('click', '#nextBuildingPageBtn', function() {
+ if(buildingPager.currentPage <= 1) {
+ return;
+ }
+ buildingPager.currentPage -= 1;
+ initBuilding();
+ });
+ $(document).on('click', '#prevBuildingPageBtn', function() {
+ if(buildingPager.currentPage >= buildingPager.totalPage) {
+ return;
+ }
+ buildingPager.currentPage += 1;
+ initBuilding();
+ });
+ // 快速创建
+ $(document).on('click', '#saveQuickBtn', function() {
+ layer.open({
+ type: 2,
+ title: false,
+ closeBtn: 0,
+ area: ['40%', '100%'],
+ offset: 'r',
+ shadeClose: true,
+ anim: 2,
+ content: top.restAjax.path('route/house/save-quick?buildingId={buildingId}', [selectedRelation.buildingId]),
+ end: function() {
+ initHouse();
+ }
+ });
+ })
+ // 批量创建
+ $(document).on('click', '#saveBatchBtn', function() {
+ layer.open({
+ type: 2,
+ title: false,
+ closeBtn: 0,
+ area: ['50%', '100%'],
+ offset: 'r',
+ shadeClose: true,
+ anim: 2,
+ content: top.restAjax.path(`route/house/save-batch?buildingId={buildingId}&floorsNum={buildingFloorsNum}&unitNum={buildingUnitNum}`, [selectedRelation.buildingId, selectedRelation.buildingFloorsNum, selectedRelation.buildingUnitNum]),
+ end: function() {
+ initHouse();
+ }
+ });
+ })
+ // 普通创建
+ $(document).on('click', '#saveNormalBtn', function() {
+ layer.open({
+ type: 2,
+ title: false,
+ closeBtn: 0,
+ area: ['40%', '100%'],
+ offset: 'r',
+ shadeClose: true,
+ anim: 2,
+ content: top.restAjax.path('route/house/save-normal?buildingId={buildingId}', [selectedRelation.buildingId]),
+ end: function() {
+ initHouse();
+ }
+ });
+ })
$('#contentBody .center').scroll(function(e) {
var $top = $('#contentBody .top');
var $left = $('#contentBody .left');
@@ -464,7 +552,27 @@
});
$(document).on('click', '#contentBody .center .main .floor .unit .house .info .option .house-remove', function() {
var houseId = this.dataset.id;
- console.log('remove', houseId);
+ var name = this.dataset.name;
+ top.dialog.msg(`确定删除【${name}】这个房间吗?`, {
+ time: 0,
+ btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
+ shade: 0.3,
+ yes: function (index) {
+ top.dialog.close(index);
+ var layIndex;
+ top.restAjax.delete(top.restAjax.path('api/house/remove/{ids}', [houseId]), {}, null, function (code, data) {
+ top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}, function() {
+ initHouse();
+ });
+ }, function (code, data) {
+ top.dialog.msg(data.msg);
+ }, function () {
+ layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
+ }, function () {
+ top.dialog.close(layIndex);
+ });
+ }
+ });
});
}
@@ -488,8 +596,8 @@
var $top = $center.find('.top');
var $left = $center.find('.left');
$center.css({
- width: `${contentBody.width - 80}px`,
- height: `${contentBody.height - 30}px`
+ width: `${contentBody.width - 100}px`,
+ height: `${contentBody.height - 50}px`
})
}
diff --git a/src/main/resources/templates/house/save-batch.html b/src/main/resources/templates/house/save-batch.html
new file mode 100644
index 0000000..daafed9
--- /dev/null
+++ b/src/main/resources/templates/house/save-batch.html
@@ -0,0 +1,337 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/templates/house/save-quick.html b/src/main/resources/templates/house/save-quick.html
new file mode 100644
index 0000000..07aefaa
--- /dev/null
+++ b/src/main/resources/templates/house/save-quick.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file