From 5dd1cfd250e0ea5a06bf73ef2f31398d2ce539dc Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 1 Aug 2022 18:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=B0=8F=E5=8C=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/deleteCommunity/deleteCommunity.js | 50 +++++++++---------- .../property/floorUnitTree/floorUnitTree.js | 6 +-- .../components/property/roomTree/roomTree.js | 16 +++--- .../property/roomTreeDiv/roomTreeDiv.js | 12 ++--- .../communityManage/communityManage.html | 4 +- 5 files changed, 43 insertions(+), 45 deletions(-) diff --git a/public/components/common/deleteCommunity/deleteCommunity.js b/public/components/common/deleteCommunity/deleteCommunity.js index 9e87801ab..0b8f2aa11 100755 --- a/public/components/common/deleteCommunity/deleteCommunity.js +++ b/public/components/common/deleteCommunity/deleteCommunity.js @@ -1,53 +1,51 @@ -(function(vc,vm){ +(function(vc, vm) { vc.extends({ - data:{ - deleteCommunityInfo:{ + data: { + deleteCommunityInfo: { } }, - _initMethod:function(){ + _initMethod: function() { - }, - _initEvent:function(){ - vc.on('deleteCommunity','openDeleteCommunityModal',function(_params){ + }, + _initEvent: function() { + vc.on('deleteCommunity', 'openDeleteCommunityModal', function(_params) { vc.component.deleteCommunityInfo = _params; $('#deleteCommunityModel').modal('show'); }); }, - methods:{ - deleteCommunity:function(){ + methods: { + deleteCommunity: function() { //vc.component.deleteCommunityInfo.communityId=vc.getCurrentCommunity().communityId; - vc.http.post( - 'deleteCommunity', - 'delete', - JSON.stringify(vc.component.deleteCommunityInfo), - { - emulateJSON:true - }, - function(json,res){ + vc.http.apiPost( + '/community.deleteCommunity', + JSON.stringify(vc.component.deleteCommunityInfo), { + emulateJSON: true + }, + function(json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); - if(res.status == 200){ + if (res.status == 200) { //关闭model $('#deleteCommunityModel').modal('hide'); - vc.emit('communityManage','listCommunity',{}); - vc.emit('auditCommunityManage','listCommunity',{}); - return ; + vc.emit('communityManage', 'listCommunity', {}); + vc.emit('auditCommunityManage', 'listCommunity', {}); + return; } vc.toast(json); - }, - function(errInfo,error){ + }, + function(errInfo, error) { console.log('请求失败处理'); vc.toast(json); - }); + }); }, - closeDeleteCommunityModel:function(){ + closeDeleteCommunityModel: function() { $('#deleteCommunityModel').modal('hide'); } } }); -})(window.vc,window.vc.component); +})(window.vc, window.vc.component); \ No newline at end of file diff --git a/public/components/property/floorUnitTree/floorUnitTree.js b/public/components/property/floorUnitTree/floorUnitTree.js index b808ff68e..e217a9207 100644 --- a/public/components/property/floorUnitTree/floorUnitTree.js +++ b/public/components/property/floorUnitTree/floorUnitTree.js @@ -57,9 +57,9 @@ } }) - _data = _data.sort(function(a, b) { - return a.floorNum - b.floorNum - }); + // _data = _data.sort(function(a, b) { + // return a.seq - b.seq + // }); $.jstree.destroy() $("#jstree_floorUnit").jstree({ diff --git a/public/components/property/roomTree/roomTree.js b/public/components/property/roomTree/roomTree.js index 8912461b6..66b5a0339 100755 --- a/public/components/property/roomTree/roomTree.js +++ b/public/components/property/roomTree/roomTree.js @@ -39,9 +39,9 @@ let _data = $that._doJsTreeRoomTreeData(); - _data = _data.sort(function(a, b) { - return a.floorNum - b.floorNum - }) + // _data = _data.sort(function(a, b) { + // return a.floorNum - b.floorNum + // }) $.jstree.destroy() $("#jstree_floorUnitRoom").jstree({ "checkbox": { @@ -100,7 +100,7 @@ let childNodes = node.children; //$('#u_' + _unitId) if (childNodes && childNodes.length > 0) { - $('#jstree_floorUnitRoom').jstree('open_node', '#u_' + _unitId); + $('#jstree_floorUnitRoom').jstree('open_node', '#u_' + _unitId); return; } let param = { @@ -138,10 +138,10 @@ $('#jstree_floorUnitRoom').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() { // 这个回调函数要加 不然会报错,即使这个函数里面什么也不做 }); - setTimeout(function(){ - $('#jstree_floorUnitRoom').jstree('open_node', '#u_' + _unitId); - },1000); - + setTimeout(function() { + $('#jstree_floorUnitRoom').jstree('open_node', '#u_' + _unitId); + }, 1000); + }, function(errInfo, error) { console.log('请求失败处理'); diff --git a/public/components/property/roomTreeDiv/roomTreeDiv.js b/public/components/property/roomTreeDiv/roomTreeDiv.js index 1aab0a1c5..099c4fffe 100644 --- a/public/components/property/roomTreeDiv/roomTreeDiv.js +++ b/public/components/property/roomTreeDiv/roomTreeDiv.js @@ -36,9 +36,9 @@ }, _initJsTreeRoomTreeDivFloorUnit: function() { let _data = $that._doJsTreeRoomTreeDivData(); - _data = _data.sort(function(a, b) { - return a.floorNum - b.floorNum - }) + // _data = _data.sort(function(a, b) { + // return a.floorNum - b.floorNum + // }) $.jstree.destroy() $("#jstree_floorUnitRoomDiv").jstree({ "checkbox": { @@ -135,10 +135,10 @@ $('#jstree_floorUnitRoomDiv').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() { // 这个回调函数要加 不然会报错,即使这个函数里面什么也不做 }); - setTimeout(function(){ + setTimeout(function() { $('#jstree_floorUnitRoomDiv').jstree('open_node', '#u_' + _unitId); - },1000); - + }, 1000); + if (listRoomData.rooms && listRoomData.rooms.length > 0) { vc.emit($that.roomTreeDivInfo.callName, 'selectRoom', { roomName: listRoomData.rooms[0].floorNum + "-" + listRoomData.rooms[0].unitNum + "-" + listRoomData.rooms[0].roomNum, diff --git a/public/pages/common/communityManage/communityManage.html b/public/pages/common/communityManage/communityManage.html index 781cea9d6..cabb325bd 100755 --- a/public/pages/common/communityManage/communityManage.html +++ b/public/pages/common/communityManage/communityManage.html @@ -86,7 +86,7 @@