| | |
| | | if (und == '控制端') {//控制端弹窗关闭 |
| | | parent[0].layer.close(indexControl); |
| | | parent[0].layer.close(+indexControl + 1); |
| | | // console.log('控制:', indexControl) |
| | | } |
| | | // console.log('tucen:', mySelf.indexs) |
| | | |
| | | if (eour == undefined) { |
| | | var dataO = evt; |
| | |
| | | nams: evt.graphic.attributes.deviceName, |
| | | type: evt.graphic.attributes.jtype, |
| | | } |
| | | // console.log(dataO); |
| | | // console.log(aa - bb); |
| | | var cache = []; |
| | | //解决重复JSON.stringify将循环结构转换为JSON。有几率出错,err:TypeError: Converting circular structure to JSON |
| | | |
| | | |
| | | // var setdata = JSON.stringify(evt.graphic.attributes |
| | | |
| | | // , function (key, value) { |
| | | // if (typeof value === 'object' && value !== null) { |
| | | // if (cache.indexOf(value) !== -1) { |
| | | // // 移除 |
| | | // return; |
| | | // } |
| | | // // 收集所有的值 |
| | | // cache.push(value); |
| | | // } |
| | | // return value; |
| | | // } |
| | | // ); |
| | | |
| | | //舍弃上面方法,原因是对象里面嵌入对象,造成不能转换成JSON,吧对象去掉就好, |
| | | var as = evt.graphic.attributes; |
| | | for (let key in as) { |
| | | if (typeof as[key] == 'object') { |
| | |
| | | } |
| | | } |
| | | var setdata = JSON.stringify(as); |
| | | // console.log(setdata); |
| | | // var newkeys = Object.keys(evt.graphic.attributes); |
| | | // var newvalues = Object.values(evt.graphic.attributes); |
| | | // var str = ""; |
| | | // newkeys.forEach(function (item,index) { |
| | | // str += item |
| | | // }) |
| | | |
| | | |
| | | // console.log(cache); |
| | | cache = null; |
| | | var fCard = (posi, setdata, winSize) => { // 弹窗函数 |
| | | var that = this, |
| | |
| | | extend: 'myskin/FlareClusterLayer.css' |
| | | }); |
| | | that.layuiLayer.close(that.layuiLayer.index); |
| | | //两个弹窗 |
| | | // layer.alert('layer 新皮肤'); |
| | | // that.layuiLayer.open({ |
| | | // title: '', |
| | |
| | | // $("#layui-layer-iframe" + index).contents().find("#sidIput").val(setdata); |
| | | // }, |
| | | // }) |
| | | //一个弹窗 |
| | | that.layuiLayer.open({ //第二个iframe |
| | | title: '', |
| | | type: 2, |
| | |
| | | // tipsMore: true, //允许多个tipe |
| | | // content: num, |
| | | success: function (layero, index) { //成功后添加全局点击关闭 |
| | | // var z = document.onclick = ()=>{ |
| | | // parent[0].layer.close(index); |
| | | // // // parent[0].layer.close(+index + 1); |
| | | // z = null; |
| | | // } |
| | | //尝试传值 |
| | | //js对象转json对象 |
| | | // $("#layui-layer-iframe" + index).contents().find("input").val(JSON.stringify(evt.graphic.attributes)); |
| | | $("#layui-layer-iframe" + index).contents().find("#sidIput").val(setdata); |
| | | |
| | | }, |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | }, |
| | | |
| | | //Add a data point to be clustered. |