{"remainingRequest":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\cqlt-fvue\\src\\views\\BigScrenn\\components\\relationshipDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\src\\views\\BigScrenn\\components\\relationshipDialog.vue","mtime":1693992862176},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.set\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.array.from\";\nimport \"core-js/modules/es6.regexp.replace\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport * as echarts from 'echarts';\nimport { mapState } from 'vuex';\nimport financialTheme from '@/api/bigScrenn/financialTheme.js';\nimport moment from \"moment\";\nexport default {\n name: 'relationshipDialog',\n components: {},\n data: function data() {\n return {\n visible: false,\n parmas: {},\n dataList: [],\n hierarchy: null\n };\n },\n created: function created() {},\n mounted: function mounted() {},\n methods: {\n add: function add(val, index) {\n var _this = this;\n\n console.log(val, index);\n this.hierarchy = null;\n this.visible = true;\n this.parmas = val;\n this.hierarchy = index;\n financialTheme.getTarget(this.parmas.targetId, function (res) {\n if (res) {\n var arr = _this.$i18n.locale === 'zh-CN' ? JSON.stringify(res.value).replace(/targetName/g, 'name') : JSON.stringify(res.value).replace(/targetNameEn/g, 'name');\n console.log(arr);\n _this.dataList = JSON.parse(arr);\n\n _this.$nextTick(function () {\n _this.getRelationship();\n });\n\n var node = _this.findNodeById(_this.dataList, _this.parmas.targetId);\n\n if (node) {\n node.itemStyle = {\n color: '#a53626',\n borderColor: '#a53626'\n };\n }\n }\n });\n },\n findNodeById: function findNodeById(arr, id) {\n for (var i = 0; i < arr.length; i++) {\n var node = arr[i];\n\n if (node.targetId === id) {\n return node;\n }\n\n if (node.children) {\n var result = this.findNodeById(node.children, id);\n\n if (result) {\n return result;\n }\n }\n }\n\n return null;\n },\n handleClose: function handleClose() {\n this.visible = false;\n },\n resize: function resize() {\n var elesArr = Array.from(new Set(this.myChart._chartsViews[0]._data._graphicEls));\n var dep = this.myChart._chartsViews[0]._data.tree.root.height; //获取树高\n\n var layer_height = 100; //层级之间的高度\n\n var currentHeight = layer_height * (dep + 1) || layer_height;\n var newHeight = Math.max(currentHeight, layer_height);\n this.chartHeight = newHeight + 'px';\n var layer_width = 100; // 兄弟节点之间的距离\n\n var currentWidth = layer_width * (elesArr.length - 1) || layer_width;\n var newWidth = Math.max(currentWidth, layer_width);\n this.chartWidth = newWidth + 'px';\n this.myChart.resize();\n },\n clickFun: function clickFun(param) {\n var _this2 = this;\n\n financialTheme.getParentLevel(param.data.targetId, function (res) {\n console.log(param.data.targetId);\n\n if (res.value) {\n if (param.data.level == 1) {\n window.localStorage.setItem(\"indexData\", JSON.stringify(res.value[0]));\n window.localStorage.setItem(\"firstPageName\", JSON.stringify(res.value[0]));\n window.localStorage.setItem(\"targetId\", param.data.targetId);\n\n _this2.$router.push({\n name: 'firstLevelPage'\n });\n } else if (param.data.level == 2) {\n window.localStorage.setItem(\"indexData\", JSON.stringify(res.value[1]));\n window.localStorage.setItem(\"firstPageName\", JSON.stringify(res.value[0]));\n window.localStorage.setItem(\"secondPageName\", JSON.stringify(res.value[1]));\n window.localStorage.setItem(\"targetId\", param.data.targetId);\n\n _this2.$router.push({\n name: 'secondLevelPage'\n });\n } else if (param.data.level == 3) {\n window.localStorage.setItem(\"indexData\", JSON.stringify(res.value[2]));\n window.localStorage.setItem(\"firstPageName\", JSON.stringify(res.value[0]));\n window.localStorage.setItem(\"secondPageName\", JSON.stringify(res.value[1]));\n window.localStorage.setItem(\"thirdPageName\", JSON.stringify(res.value[2]));\n window.localStorage.setItem(\"targetId\", param.data.targetId);\n\n _this2.$router.push({\n name: 'thirdLevelPage'\n });\n } else if (param.data.level == 4) {\n window.localStorage.setItem(\"indexData\", JSON.stringify(res.value[3]));\n window.localStorage.setItem(\"firstPageName\", JSON.stringify(res.value[0]));\n window.localStorage.setItem(\"secondPageName\", JSON.stringify(res.value[1]));\n window.localStorage.setItem(\"thirdPageName\", JSON.stringify(res.value[2]));\n window.localStorage.setItem(\"fourthPageName\", JSON.stringify(res.value[3]));\n window.localStorage.setItem(\"targetId\", param.data.targetId);\n\n _this2.$router.push({\n name: 'fourthLevelPage'\n });\n }\n\n console.log(res.value);\n\n _this2.$emit('callback');\n\n _this2.visible = false;\n }\n });\n },\n getRelationship: function getRelationship() {\n var chartDom = echarts.init(document.getElementById('relationship'));\n chartDom.on(\"click\", this.clickFun);\n var option = {\n tooltip: {\n trigger: 'item',\n triggerOn: 'mousemove',\n backgroundColor: 'skyblue',\n borderColor: 'skyblue'\n },\n series: [{\n type: 'tree',\n orient: 'horizontal',\n symbol: 'rect',\n edgeShape: 'polyline',\n symbolSize: [this.$i18n.locale === 'zh-CN' ? 120 : 210, 30],\n //设置框的大小\n itemStyle: {\n normal: {\n color: '#000',\n borderColor: '#4980BD',\n borderWidth: 1,\n label: {\n show: true,\n position: 'inside',\n textStyle: {\n color: '#fff'\n }\n }\n },\n emphasis: {\n color: '#4980BD',\n label: {\n show: true,\n color: '#fff',\n fontWeight: 'bold'\n }\n }\n },\n // itemStyle: {\n // \tcolor: '#000',\n // \temphasis: {\n // \t\tlabel: {\n // \t\t\tshow: true,\n // \t\t\tposition: 'inside',\n // \t\t\tcolor: '#fff',\n // \t\t}\n // \t}\n // },\n expandAndCollapse: false,\n //线条的颜色\n lineStyle: {\n normal: {\n opacity: 0.9,\n color: '#4980BD',\n type: 'solid',\n width: 2\n }\n },\n data: this.dataList,\n nodeGap: 20 // 设置节点间的间距为 20\n\n }]\n };\n option && chartDom.setOption(option); // var defaultSelectedNode = this.parmas.targetId;\n // chartDom.on('dataZoom', function(params) {\n // \t// 获取树状图实例\n // \tvar tree = chartDom.getModel().getComponent('series', 0);\n // \t// 获取节点对应的索引\n // \tvar nodeIndex = tree.getNodeByDataIndex(defaultSelectedNode).getIndex();\n // \t// 设置节点为选中状态\n // \ttree.setSelected(nodeIndex);\n // });\n }\n }\n};",null]}