Commit 1bb82ffc by 张杰

修复勾选问题

1 parent 0d8c37a4
......@@ -316,21 +316,19 @@ export default {
},
handleCheckChange(data, checked, indeterminate) {
//console.log(data, checked, indeterminate);
console.log(checked);
if (checked) {
//console.log(this.$refs.tree.getNode(data))
let node = this.$refs.tree.getNode(data);
//let node = this.$refs.tree.getNode(data);
//this.getAllChild(node)
//this.$refs.tree.store.defaultExpandAll = true
//this.$refs.tree.setCheckedKeys(['u8121'])
}
this.isTreeChecked = checked;
this.expandedKeys = [];
//this.expandedKeys = [];
},
// 勾选树
handleCheck(data, node) {
console.log("node", data);
let list = this.monitorList.itemArr;
// 最多同时监控100台数据
......@@ -390,12 +388,14 @@ export default {
params = { uId: data.id };
}
console.log('勾选树:',data)
params.termType = this.searchType;
params.term = this.searchText;
this.treeLoading = true;
action(params).then((res) => {
this.treeLoading = false;
let list = res.data || [];
let cList = this.monitorList.itemArr || [];
// 最多创建100个设备监听
......@@ -437,7 +437,8 @@ export default {
if (data.children !== undefined) {
data.children.forEach((item, i) => {
this.$refs.tree.setChecked(item, false, true);
//this.$refs.tree.setChecked(item, false, true);
this.checkedKeys.push(item.id)
});
}
}
......@@ -750,7 +751,7 @@ export default {
console.log('keys',keys)
//_this.$refs.tree.setCheckedKeys(keys);
_this.checkedKeys.push(item.id);
console.log(_this.checkedKeys)
console.log('勾选key:',_this.checkedKeys)
this.addMonitor({
sn: item.label,
name: item.label1,
......@@ -761,7 +762,9 @@ export default {
sourceType: item.source,
});
} else {
console.log('展开节点',item)
this.expandedKeys.push(item.id);
console.log(this.expandedKeys)
}
if (item.children && item.children.length) {
this.expandTreeItems(
......@@ -873,7 +876,6 @@ export default {
obj.count++;
obj.itemArr.unshift(item.sn);
}
console.log(obj.itemArr);
this.getPositionData();
},
// standNoMonitor(item){
......@@ -914,14 +916,12 @@ export default {
});
let arr = this.monitorList.itemArr || [];
console.log(arr.length);
filterList.forEach((item) => {
item.eLocateType = "gpsLocation";
this.monitorList[item.sn] = item;
this.monitorList.count++;
arr.unshift(item.sn);
});
console.log(arr);
this.$set(this.monitorList, "itemArr", arr);
this.getPositionData();
}
......@@ -934,24 +934,19 @@ export default {
if (obj[item.sn]) {
delete obj[item.sn];
}
console.log(list);
this.monitorList.itemArr = list.filter((k) => k != item.sn);
//this.monitorList.itemArr.splice(this.monitorList.itemArr.indexOf(item.sn||item), 1)
this.monitorList = Object.assign({}, obj);
if (this.monitorList.count > 0) {
this.monitorList.count--;
}
console.log(item);
EventBus.$emit(
"uiMap.monitor.destroy",
`${item.sn || item}:${item.source || item}`
);
//console.log(this.monitorList);
if (ifUpdateTreeKeys) {
console.log(item);
let checkedKeys = this.$refs.tree.getCheckedKeys();
let arr = checkedKeys.filter((id) => id !== item.id);
//console.log(arr);
this.$refs.tree.setCheckedKeys(arr);
}
},
......@@ -959,12 +954,10 @@ export default {
// 批量删除 监控列表
removeMonitorByGroup(arr) {
let _this = this;
console.log(arr);
let o = this.monitorList;
o.itemArr = [];
arr.forEach((item) => {
let n = o[item.sn || item];
console.log(n);
if (n) {
_this.removeMonitor(n);
}
......@@ -981,7 +974,6 @@ export default {
/* let _this = this;
arr = arr.filter((item)=>this.monitorList[item.sn]); */
let snStr = this.monitorList.itemArr.join(","); //arr.map((item)=>item.sn).join(',');
console.log(snStr)
if (!snStr) return;
if (this.resetRefreshCount || this.remainSearchSnStr != snStr) {
this.refreshCount = 1;
......@@ -1038,7 +1030,6 @@ export default {
},
filterGpsBase(item) {
//item.bsLocation = {}
console.log(item);
let gpsLocation = item.gpsLocation;
let bsLocation = item.bsLocation;
/* 如果基站,gps其中一个没数据,自动切换到另一个,如果都没有eLocateType为null */
......@@ -1136,8 +1127,6 @@ export default {
// 展示更多
showMore(node, data) {
let o = this.treeDataList["u" + data.parentId];
console.log(node);
console.log(o);
// 不存在
if (!o || o.length <= 0) {
return false;
......@@ -1154,8 +1143,6 @@ export default {
// 加载下一页
loadNext(node, data) {
console.log(node);
console.log(data);
let _this = this;
let id = "u" + node.data.parentId;
let pageNumber = this.pageSizeList[id];
......
......@@ -256,8 +256,7 @@ MapService.prototype = {
EventBus.$emit('uiMap.copySuccess');
});
clipboard.on('error', function (e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
if (isInfoOpen) {
......@@ -276,7 +275,6 @@ MapService.prototype = {
// 车辆监控-查看位置点
bindMonitorInfoWindow: function (marker, map, info, isInfoOpen, isInfoAutoMove) {
console.log(info)
var self = this;
var infoDiv = document.createElement('div');
infoDiv.innerHTML = self.createMonitorInfo(info);
......@@ -316,7 +314,6 @@ MapService.prototype = {
}
baseBtn && (baseBtn.onclick = function (e) {
console.log(info)
if (info.eLocateType === 'bsLocation') return;
info.eLocateType = 'bsLocation'
eLocation = info[info.eLocateType];
......@@ -434,7 +431,6 @@ MapService.prototype = {
}
}
console.log(historyBtn)
const snSourceType = `${info.sn}:${info.isSource}`
/* EventBus.$on(`uiMap.monitor.changeStatus.${snSourceType}`, (status)=>{
......@@ -552,7 +548,6 @@ MapService.prototype = {
let queryCode = `sn=${info.sn}&name=${encodeURI(info.name)}&standno=${info.standNo}`;
var _html = `<h3 class="map-infowindow-title">${info.name}/${info.standNo}</h3>`;
_html += `<div class="map-infowindow-ct map_info_window">`;
console.log(zhongliType);
if (zhongliType == 'yes') {
_html += `<div>`;
if (info.shopName) {
......@@ -574,7 +569,6 @@ MapService.prototype = {
let list = vue.prototype.$parentCommon.getAuthData();
let o = list.find(k => k.origin.permissionTag == 'oEshield_monitor_store_name');
let n = list.find(k => k.origin.permissionTag == 'oEshield_monitor_plate_number');
console.log(list)
if (o && info.shopName) {
_html += `<p><i class="icon_info_shop"></i> 店面名称: <span class="des">${info.shopName || '--'}</span></p>`;
}
......@@ -822,7 +816,6 @@ MapService.prototype = {
content: div,
autoMove: !!isInfoAutoMove,
})
console.log(infoWindow)
marker.infoWindow = infoWindow
if (isInfoOpen) {
infoWindow.open(map, marker.getPosition())
......
......@@ -12,7 +12,6 @@ const MAPGEO = {
})
},
transferAddressByGroup(obj, cb){
console.log(this.geocoder)
if(!this.geocoder){
this.getGeocoder().then(()=>{
this.transfer(obj, cb)
......@@ -22,7 +21,6 @@ const MAPGEO = {
}
},
transfer(obj, cb){
console.log(obj.data)
const data = obj.data;
obj.len = data.length;
obj.times = obj.len>20?Math.ceil(obj.len/20):1;
......@@ -49,13 +47,11 @@ const MAPGEO = {
const timeoutId = window.setTimeout(()=>{
MAPGEO.geocoder.getAddress(arr, function(status, result) {
console.log(result)
if (status === 'complete' && result.info === 'OK') {//获取地址成功
result.regeocodes.forEach((item, idx)=>{
data[initIdx+idx].transferAddress = item.formattedAddress;
obj.totalNum++;
});
console.log(obj.totalNum +'----'+ obj.realNum)
if(obj.totalNum === obj.realNum){
cb && cb(data)
//ifPlay && obj.init(data)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!