mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化代码
This commit is contained in:
parent
13697edbde
commit
432586277d
@ -100,7 +100,7 @@
|
|||||||
let childNodes = node.children;
|
let childNodes = node.children;
|
||||||
//$('#u_' + _unitId)
|
//$('#u_' + _unitId)
|
||||||
if (childNodes && childNodes.length > 0) {
|
if (childNodes && childNodes.length > 0) {
|
||||||
$('#jstree_floorUnitRoom').jstree('open_node', $('#u_' + _unitId));
|
$('#jstree_floorUnitRoom').jstree('open_node', '#u_' + _unitId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let param = {
|
let param = {
|
||||||
@ -138,7 +138,10 @@
|
|||||||
$('#jstree_floorUnitRoom').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() {
|
$('#jstree_floorUnitRoom').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() {
|
||||||
// 这个回调函数要加 不然会报错,即使这个函数里面什么也不做
|
// 这个回调函数要加 不然会报错,即使这个函数里面什么也不做
|
||||||
});
|
});
|
||||||
$('#jstree_floorUnitRoom').jstree('open_node', _datas[0].id);
|
setTimeout(function(){
|
||||||
|
$('#jstree_floorUnitRoom').jstree('open_node', '#u_' + _unitId);
|
||||||
|
},1000);
|
||||||
|
|
||||||
},
|
},
|
||||||
function(errInfo, error) {
|
function(errInfo, error) {
|
||||||
console.log('请求失败处理');
|
console.log('请求失败处理');
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
let childNodes = node.children;
|
let childNodes = node.children;
|
||||||
//$('#u_' + _unitId)
|
//$('#u_' + _unitId)
|
||||||
if (childNodes && childNodes.length > 0) {
|
if (childNodes && childNodes.length > 0) {
|
||||||
$('#jstree_floorUnitRoomDiv').jstree('open_node', childNodes[0].id);
|
$('#jstree_floorUnitRoomDiv').jstree('open_node', '#u_' + _unitId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if (childNodes && childNodes.length > 0) {
|
// if (childNodes && childNodes.length > 0) {
|
||||||
@ -135,7 +135,10 @@
|
|||||||
$('#jstree_floorUnitRoomDiv').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() {
|
$('#jstree_floorUnitRoomDiv').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() {
|
||||||
// 这个回调函数要加 不然会报错,即使这个函数里面什么也不做
|
// 这个回调函数要加 不然会报错,即使这个函数里面什么也不做
|
||||||
});
|
});
|
||||||
$('#jstree_floorUnitRoomDiv').jstree('open_node', _datas[0].id);
|
setTimeout(function(){
|
||||||
|
$('#jstree_floorUnitRoomDiv').jstree('open_node', '#u_' + _unitId);
|
||||||
|
},1000);
|
||||||
|
|
||||||
if (listRoomData.rooms && listRoomData.rooms.length > 0) {
|
if (listRoomData.rooms && listRoomData.rooms.length > 0) {
|
||||||
vc.emit($that.roomTreeDivInfo.callName, 'selectRoom', {
|
vc.emit($that.roomTreeDivInfo.callName, 'selectRoom', {
|
||||||
roomName: listRoomData.rooms[0].floorNum + "-" + listRoomData.rooms[0].unitNum + "-" + listRoomData.rooms[0].roomNum,
|
roomName: listRoomData.rooms[0].floorNum + "-" + listRoomData.rooms[0].unitNum + "-" + listRoomData.rooms[0].roomNum,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user