{"remainingRequest":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\style-vw-loader\\index.js??ref--0-2!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\components\\common\\organTree.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\components\\common\\organTree.vue","mtime":1663828782926},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\babel.config.js","mtime":1663828782900},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\style-vw-loader\\index.js","mtime":1540864632000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.constructor\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nexport default {\n name: 'organTree',\n props: ['buildingType', 'clearRoom'],\n data: function data() {\n return {\n filterText: '',\n organList: [],\n defaultProps: {\n children: 'children',\n label: 'name'\n }\n };\n },\n watch: {\n filterText: function filterText(val) {\n this.$refs.tree.filter(val);\n }\n },\n methods: {\n getOrgTreeList: function getOrgTreeList() {\n var _this = this;\n\n this.$http.get('/sc-community/assets/tree/community/find', {\n buildingType: this.buildingType\n }).then(function (_ref) {\n var status = _ref.status,\n data = _ref.data,\n msg = _ref.msg;\n\n if (status === 0 && data) {\n _this.dimension(data);\n\n _this.organList = data; // 过滤房间\n\n if (_this.clearRoom) {\n _this.clearRoomToggle(data);\n }\n\n _this.$nextTick().then(function () {\n var firstNode = document.querySelector('.el-tree-node');\n firstNode.click();\n });\n }\n });\n },\n dimension: function dimension(arr) {\n var _this2 = this;\n\n arr.map(function (item, index) {\n if (!!item.children) {\n _this2.dimension(item.children);\n\n if (item.type == 'unit') {\n item.name = _this2.CheckChinese(item.name, '单元');\n } else if (item.type == 'building') {\n item.name = _this2.CheckChinese(item.name, '楼栋');\n }\n }\n });\n },\n clearRoomToggle: function clearRoomToggle(arr) {\n var _this3 = this;\n\n arr.map(function (item, index) {\n if (item.type == 'unit') {\n item.children = null;\n return;\n } else if (item.type !== 'room') {\n _this3.clearRoomToggle(item.children);\n } else if (item.type == 'room') {\n arr.splice(index, 1);\n }\n });\n },\n filterNode: function filterNode(value, data) {\n if (!value) return true;\n return data.name.indexOf(value) !== -1;\n },\n treeClick: function treeClick(e) {\n var unitPa = {\n id: e.id,\n communityName: '',\n communityId: '',\n buildingName: '',\n buildingId: '',\n unitName: '',\n unitId: '',\n houseName: '',\n houseId: '',\n type: e.type\n };\n var newValueIds = e.id.split('-');\n var thisObj = this.$refs.tree.getNode(e);\n\n if (e.type == 'building') {\n unitPa.communityName = thisObj.parent.data.name;\n unitPa.communityId = thisObj.parent.data.value;\n unitPa.buildingName = e.name;\n unitPa.buildingId = e.value;\n } else if (e.type == 'unit') {\n unitPa.communityName = thisObj.parent.parent.data.name;\n unitPa.communityId = thisObj.parent.parent.data.value;\n unitPa.buildingName = thisObj.parent.data.name;\n unitPa.buildingId = thisObj.parent.data.value;\n unitPa.unitName = e.name;\n unitPa.unitId = e.value;\n } else if (e.type == 'room') {\n unitPa.communityName = newValueIds.length == 4 ? thisObj.parent.parent.parent.data.name : thisObj.parent.parent.data.name;\n unitPa.communityId = newValueIds.length == 4 ? thisObj.parent.parent.parent.data.value : thisObj.parent.parent.data.value;\n unitPa.buildingName = newValueIds.length == 4 ? thisObj.parent.parent.data.name : thisObj.parent.data.name;\n unitPa.buildingId = newValueIds.length == 4 ? thisObj.parent.parent.data.value : thisObj.parent.data.value;\n unitPa.unitName = newValueIds.length == 4 ? thisObj.parent.data.name : '';\n unitPa.unitId = newValueIds.length == 4 ? thisObj.parent.data.value : '';\n unitPa.houseName = e.name;\n unitPa.houseId = e.value;\n } else {\n unitPa.communityName = e.name;\n unitPa.communityId = e.value;\n }\n\n this.$emit('organId', unitPa);\n },\n CheckChinese: function CheckChinese(val, name) {\n var reg = new RegExp(\"[\\\\u4E00-\\\\u9FFF]+\", 'g');\n var newVal = val;\n\n if (!reg.test(val)) {\n newVal = val + name;\n }\n\n return newVal;\n }\n },\n created: function created() {\n this.getOrgTreeList();\n }\n};",{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACAA,mBADA;AAEAC,sCAFA;AAGAC,MAHA,kBAGA;AACA;AACAC,oBADA;AAEAC,mBAFA;AAGAC;AACAC,4BADA;AAEAC;AAFA;AAHA;AAQA,GAZA;AAaAC;AACAL,cADA,sBACAM,GADA,EACA;AACA;AACA;AAHA,GAbA;AAkBAC;AACAC,kBADA,4BACA;AAAA;;AACA,iBACAC,GADA,CACA,0CADA,EACA;AAAAC;AAAA,OADA,EAEAC,IAFA,CAEA;AAAA;AAAA;AAAA;;AACA;AACA;;AACA,iCAFA,CAGA;;AACA;AACA;AACA;;AACA;AACA;AACAC;AACA,WAHA;AAIA;AACA,OAfA;AAgBA,KAlBA;AAmBAC,aAnBA,qBAmBAC,GAnBA,EAmBA;AAAA;;AACAA;AACA;AACA;;AACA;AACAC;AACA,WAFA,MAEA;AACAA;AACA;AACA;AACA,OATA;AAUA,KA9BA;AA+BAC,mBA/BA,2BA+BAF,GA/BA,EA+BA;AAAA;;AACAA;AACA;AACAC;AACA;AACA,SAHA,MAGA;AACA;AACA,SAFA,MAEA;AACAD;AACA;AACA,OATA;AAUA,KA1CA;AA2CAG,cA3CA,sBA2CAC,KA3CA,EA2CAnB,IA3CA,EA2CA;AACA;AACA;AACA,KA9CA;AA+CAoB,aA/CA,qBA+CAC,CA/CA,EA+CA;AACA;AACAC,gBADA;AAEAC,yBAFA;AAGAC,uBAHA;AAIAC,wBAJA;AAKAC,sBALA;AAMAC,oBANA;AAOAC,kBAPA;AAQAC,qBARA;AASAC,mBATA;AAUAC;AAVA;AAYA;AACA;;AACA;AACAC;AACAA;AACAA;AACAA;AACA,OALA,MAKA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACA,OAPA,MAOA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACA,OATA,MASA;AACAA;AACAA;AACA;;AAEA;AACA,KAzFA;AA0FAC,gBA1FA,wBA0FA1B,GA1FA,EA0FAT,IA1FA,EA0FA;AACA;AACA;;AACA;AACAoC;AACA;;AACA;AACA;AAjGA,GAlBA;AAqHAC,SArHA,qBAqHA;AACA;AACA;AAvHA","names":["name","props","data","filterText","organList","defaultProps","children","label","watch","val","methods","getOrgTreeList","get","buildingType","then","firstNode","dimension","arr","item","clearRoomToggle","filterNode","value","treeClick","e","id","communityName","communityId","buildingName","buildingId","unitName","unitId","houseName","houseId","type","unitPa","CheckChinese","newVal","created"],"sourceRoot":"src/components/common","sources":["organTree.vue"],"sourcesContent":["\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n"]}]}