mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化代码
This commit is contained in:
parent
664dd3e41d
commit
13697edbde
8
app.js
8
app.js
@ -31,8 +31,8 @@ let opts = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
app.use('/callComponent', proxy('http://192.168.100.108:8008', opts));
|
// app.use('/callComponent', proxy('http://192.168.100.108:8008', opts));
|
||||||
app.use('/app', proxy('http://192.168.100.108:8008', opts));
|
// app.use('/app', proxy('http://192.168.100.108:8008', opts));
|
||||||
|
|
||||||
|
|
||||||
// app.use('/callComponent', proxy('http://127.0.0.1:8008', opts));
|
// app.use('/callComponent', proxy('http://127.0.0.1:8008', opts));
|
||||||
@ -41,8 +41,8 @@ app.use('/app', proxy('http://192.168.100.108:8008', opts));
|
|||||||
// app.use('/callComponent',proxy('http://192.168.1.106:8012',opts));
|
// app.use('/callComponent',proxy('http://192.168.1.106:8012',opts));
|
||||||
// app.use('/app',proxy('http://192.168.1.106:8012',opts));
|
// app.use('/app',proxy('http://192.168.1.106:8012',opts));
|
||||||
|
|
||||||
//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
|
app.use('/callComponent', proxy('http://47.106.15.126:8088', opts));
|
||||||
//app.use('/app',proxy('http://192.168.1.16:8012',opts));
|
app.use('/app', proxy('http://47.106.15.126:8088', opts));
|
||||||
|
|
||||||
// app.use('/callComponent',proxy('http://192.168.100.108:8008',opts));
|
// app.use('/callComponent',proxy('http://192.168.100.108:8008',opts));
|
||||||
// app.use('/app',proxy('http://192.168.100.108:8008',opts));
|
// app.use('/app',proxy('http://192.168.100.108:8008',opts));
|
||||||
|
|||||||
@ -92,14 +92,16 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
_roomTreeLoadRoom: function(_unitId, data) {
|
_roomTreeLoadRoom: function(_unitId, data) {
|
||||||
|
//获取选中的节点
|
||||||
//获取选中的节点
|
//获取选中的节点
|
||||||
let node = data.instance.get_node(data.selected[0]);
|
let node = data.instance.get_node(data.selected[0]);
|
||||||
//遍历选中节点的子节点
|
//遍历选中节点的子节点
|
||||||
let childNodes = data.instance.get_children_dom(node);
|
//let childNodes = data.instance.get_children_dom(node);
|
||||||
|
let childNodes = node.children;
|
||||||
|
//$('#u_' + _unitId)
|
||||||
if (childNodes && childNodes.length > 0) {
|
if (childNodes && childNodes.length > 0) {
|
||||||
for (var childIndex = 0; childIndex < childNodes.length; childIndex++) {
|
$('#jstree_floorUnitRoom').jstree('open_node', $('#u_' + _unitId));
|
||||||
$('#jstree_floorUnitRoom').jstree('delete_node', childNodes[childIndex]);
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
let param = {
|
let param = {
|
||||||
params: {
|
params: {
|
||||||
@ -110,6 +112,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//发送get请求
|
//发送get请求
|
||||||
|
let _datas = [];
|
||||||
vc.http.apiGet('/room.queryRoomsTree',
|
vc.http.apiGet('/room.queryRoomsTree',
|
||||||
param,
|
param,
|
||||||
function(json, res) {
|
function(json, res) {
|
||||||
@ -129,9 +132,13 @@
|
|||||||
text: _text,
|
text: _text,
|
||||||
icon: "/img/room.png",
|
icon: "/img/room.png",
|
||||||
};
|
};
|
||||||
$('#jstree_floorUnitRoom').jstree('create_node', $('#u_' + _unitId), _data, "last", false, false);
|
_datas.push(_data);
|
||||||
|
// $('#jstree_floorUnitRoom').jstree('create_node', $('#u_' + _unitId), _data, "last", false, false);
|
||||||
})
|
})
|
||||||
$('#jstree_floorUnitRoom').jstree('open_node', $('#u_' + _unitId));
|
$('#jstree_floorUnitRoom').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() {
|
||||||
|
// 这个回调函数要加 不然会报错,即使这个函数里面什么也不做
|
||||||
|
});
|
||||||
|
$('#jstree_floorUnitRoom').jstree('open_node', _datas[0].id);
|
||||||
},
|
},
|
||||||
function(errInfo, error) {
|
function(errInfo, error) {
|
||||||
console.log('请求失败处理');
|
console.log('请求失败处理');
|
||||||
|
|||||||
@ -87,12 +87,18 @@
|
|||||||
//获取选中的节点
|
//获取选中的节点
|
||||||
let node = data.instance.get_node(data.selected[0]);
|
let node = data.instance.get_node(data.selected[0]);
|
||||||
//遍历选中节点的子节点
|
//遍历选中节点的子节点
|
||||||
let childNodes = data.instance.get_children_dom(node);
|
//let childNodes = data.instance.get_children_dom(node);
|
||||||
|
let childNodes = node.children;
|
||||||
|
//$('#u_' + _unitId)
|
||||||
if (childNodes && childNodes.length > 0) {
|
if (childNodes && childNodes.length > 0) {
|
||||||
for (var childIndex = 0; childIndex < childNodes.length; childIndex++) {
|
$('#jstree_floorUnitRoomDiv').jstree('open_node', childNodes[0].id);
|
||||||
$('#jstree_floorUnitRoomDiv').jstree('delete_node', childNodes[childIndex]);
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// if (childNodes && childNodes.length > 0) {
|
||||||
|
// for (var childIndex = 0; childIndex < childNodes.length; childIndex++) {
|
||||||
|
// $('#jstree_floorUnitRoomDiv').jstree('delete_node', childNodes[childIndex]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
let param = {
|
let param = {
|
||||||
params: {
|
params: {
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -102,6 +108,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//发送get请求
|
//发送get请求
|
||||||
|
let _datas = [];
|
||||||
vc.http.apiGet('/room.queryRoomsTree',
|
vc.http.apiGet('/room.queryRoomsTree',
|
||||||
param,
|
param,
|
||||||
function(json, res) {
|
function(json, res) {
|
||||||
@ -122,9 +129,13 @@
|
|||||||
text: _text,
|
text: _text,
|
||||||
icon: "/img/room.png",
|
icon: "/img/room.png",
|
||||||
};
|
};
|
||||||
$('#jstree_floorUnitRoomDiv').jstree('create_node', $('#u_' + _unitId), _data, "last", false, false);
|
_datas.push(_data);
|
||||||
|
// $('#jstree_floorUnitRoomDiv').jstree('create_node', $('#u_' + _unitId), _data, "last", false, false);
|
||||||
})
|
})
|
||||||
$('#jstree_floorUnitRoomDiv').jstree('open_node', $('#u_' + _unitId));
|
$('#jstree_floorUnitRoomDiv').jstree('_append_json_data', $('#u_' + _unitId), _datas, function() {
|
||||||
|
// 这个回调函数要加 不然会报错,即使这个函数里面什么也不做
|
||||||
|
});
|
||||||
|
$('#jstree_floorUnitRoomDiv').jstree('open_node', _datas[0].id);
|
||||||
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,
|
||||||
|
|||||||
1723
public/js/plugins/jsTree/jstree.min.js
vendored
1723
public/js/plugins/jsTree/jstree.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user