f459bb774f6650e0ff8ee9a6d563ceca.json 14 KB

1
  1. {"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":["<template>\r\n <div class=\"organ-tree\">\r\n <el-input v-model=\"filterText\" placeholder=\"请输入关键字\" suffix-icon=\"el-icon-search\"></el-input>\r\n <div class=\"tree-style-box no-scrollbar\">\r\n <el-tree\r\n class=\"tree-style\"\r\n :data=\"organList\"\r\n ref=\"tree\"\r\n node-key=\"id\"\r\n :highlight-current=\"true\"\r\n :props=\"defaultProps\"\r\n :expand-on-click-node=\"false\"\r\n @node-click=\"treeClick\"\r\n accordion\r\n :filter-node-method=\"filterNode\"\r\n >\r\n </el-tree>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'organTree',\r\n props: ['buildingType', 'clearRoom'],\r\n data() {\r\n return {\r\n filterText: '',\r\n organList: [],\r\n defaultProps: {\r\n children: 'children',\r\n label: 'name'\r\n }\r\n };\r\n },\r\n watch: {\r\n filterText(val) {\r\n this.$refs.tree.filter(val);\r\n }\r\n },\r\n methods: {\r\n getOrgTreeList() {\r\n this.$http\r\n .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })\r\n .then(({ status, data, msg }) => {\r\n if (status === 0 && data) {\r\n this.dimension(data);\r\n this.organList = data;\r\n // 过滤房间\r\n if (this.clearRoom) {\r\n this.clearRoomToggle(data);\r\n }\r\n this.$nextTick().then(() => {\r\n const firstNode = document.querySelector('.el-tree-node');\r\n firstNode.click();\r\n });\r\n }\r\n });\r\n },\r\n dimension(arr) {\r\n arr.map((item, index) => {\r\n if (!!item.children) {\r\n this.dimension(item.children);\r\n if (item.type == 'unit') {\r\n item.name = this.CheckChinese(item.name, '单元');\r\n } else if (item.type == 'building') {\r\n item.name = this.CheckChinese(item.name, '楼栋');\r\n }\r\n }\r\n });\r\n },\r\n clearRoomToggle(arr) {\r\n arr.map((item, index) => {\r\n if (item.type == 'unit') {\r\n item.children = null;\r\n return;\r\n } else if (item.type !== 'room') {\r\n this.clearRoomToggle(item.children);\r\n } else if (item.type == 'room') {\r\n arr.splice(index, 1);\r\n }\r\n });\r\n },\r\n filterNode(value, data) {\r\n if (!value) return true;\r\n return data.name.indexOf(value) !== -1;\r\n },\r\n treeClick(e) {\r\n let unitPa = {\r\n id: e.id,\r\n communityName: '',\r\n communityId: '',\r\n buildingName: '',\r\n buildingId: '',\r\n unitName: '',\r\n unitId: '',\r\n houseName: '',\r\n houseId: '',\r\n type: e.type\r\n };\r\n let newValueIds = e.id.split('-');\r\n let thisObj = this.$refs.tree.getNode(e);\r\n if (e.type == 'building') {\r\n unitPa.communityName = thisObj.parent.data.name;\r\n unitPa.communityId = thisObj.parent.data.value;\r\n unitPa.buildingName = e.name;\r\n unitPa.buildingId = e.value;\r\n } else if (e.type == 'unit') {\r\n unitPa.communityName = thisObj.parent.parent.data.name;\r\n unitPa.communityId = thisObj.parent.parent.data.value;\r\n unitPa.buildingName = thisObj.parent.data.name;\r\n unitPa.buildingId = thisObj.parent.data.value;\r\n unitPa.unitName = e.name;\r\n unitPa.unitId = e.value;\r\n } else if (e.type == 'room') {\r\n unitPa.communityName = newValueIds.length == 4 ? thisObj.parent.parent.parent.data.name : thisObj.parent.parent.data.name;\r\n unitPa.communityId = newValueIds.length == 4 ? thisObj.parent.parent.parent.data.value : thisObj.parent.parent.data.value;\r\n unitPa.buildingName = newValueIds.length == 4 ? thisObj.parent.parent.data.name : thisObj.parent.data.name;\r\n unitPa.buildingId = newValueIds.length == 4 ? thisObj.parent.parent.data.value : thisObj.parent.data.value;\r\n unitPa.unitName = newValueIds.length == 4 ? thisObj.parent.data.name : '';\r\n unitPa.unitId = newValueIds.length == 4 ? thisObj.parent.data.value : '';\r\n unitPa.houseName = e.name;\r\n unitPa.houseId = e.value;\r\n } else {\r\n unitPa.communityName = e.name;\r\n unitPa.communityId = e.value;\r\n }\r\n\r\n this.$emit('organId', unitPa);\r\n },\r\n CheckChinese(val, name) {\r\n var reg = new RegExp('[\\\\u4E00-\\\\u9FFF]+', 'g');\r\n let newVal = val;\r\n if (!reg.test(val)) {\r\n newVal = val + name;\r\n }\r\n return newVal;\r\n }\r\n },\r\n created() {\r\n this.getOrgTreeList();\r\n }\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n@import '@assets/css/public-style.scss';\r\n.organ-tree {\r\n width: rem(260);\r\n background: #ffffff;\r\n padding: rem(20);\r\n box-sizing: border-box;\r\n float: left;\r\n height: calc(100vh - #{rem(100)});\r\n overflow: auto;\r\n &::before {\r\n clear: both;\r\n }\r\n .tree-style-box {\r\n margin-top: rem(20);\r\n max-height: calc(100vh - #{rem(200)});\r\n overflow: scroll;\r\n }\r\n /deep/ .el-tree-node {\r\n .is-leaf + .el-checkbox .el-checkbox_inner {\r\n display: inline-block;\r\n }\r\n .el-checkbox .el-checkbox_inner {\r\n display: none;\r\n }\r\n }\r\n}\r\n</style>\r\n"]}]}