Commit 1bb82ffc by 张杰

修复勾选问题

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