|
@@ -918,9 +918,6 @@ export default {
|
|
|
let [search_obj] = this.searchOptions.filter(
|
|
|
(item) => item.ChartInfoId === newval
|
|
|
);
|
|
|
- // 查找图表的父级id
|
|
|
- let arr = this.findParentNodeHandle(this.treeData,search_obj.ChartClassifyId);
|
|
|
- this.defaultShowNodes = arr;
|
|
|
this.select_node = search_obj.UniqueCode;
|
|
|
|
|
|
this.selected_chartClassify = search_obj.ChartClassifyId; //图表所属分类
|
|
@@ -933,24 +930,6 @@ export default {
|
|
|
this.select_date = [search_obj.StartDate, search_obj.EndDate];
|
|
|
this.selected_chartType = search_obj.ChartType; //图表类型
|
|
|
this.selected_chartid = newval;
|
|
|
-
|
|
|
- //滚动到高亮节点位置
|
|
|
- setTimeout(() => {
|
|
|
- this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
- let node = document.getElementById(`node${this.select_node}`);
|
|
|
- let parent = document.getElementsByClassName('tree-cont')[0];
|
|
|
-
|
|
|
- //parent可视区间:[scrollTop,scrollTop+offsetHeight]
|
|
|
- //node位置:node.offsetTop
|
|
|
- const overTop = node.offsetTop+node.clientHeight+15<parent.scrollTop
|
|
|
- const overBottom = node.offsetTop+node.clientHeight+15>parent.scrollTop+parent.offsetHeight
|
|
|
- if(overTop){
|
|
|
- parent.scrollTop = node.offsetTop-30
|
|
|
- }
|
|
|
- if(overBottom){
|
|
|
- parent.scrollTop = node.offsetTop - parent.offsetHeight/2
|
|
|
- }
|
|
|
- },400)
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -1477,18 +1456,10 @@ export default {
|
|
|
// 树节点展开
|
|
|
handleNodeExpand(data) {
|
|
|
// 保存当前展开的节点
|
|
|
- let flag = false;
|
|
|
- this.defaultShowNodes.some((item) => {
|
|
|
- if (item === data.UniqueCode) {
|
|
|
- // 判断当前节点是否存在, 存在不做处理
|
|
|
- flag = true;
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
- if (!flag) {
|
|
|
- // 不存在则存到数组里
|
|
|
- this.defaultShowNodes.push(data.UniqueCode);
|
|
|
- }
|
|
|
+ let flag = this.defaultShowNodes.some((item) => item === data.UniqueCode);
|
|
|
+ if (!flag) { // 不存在则存到数组里
|
|
|
+ this.defaultShowNodes.push(data.UniqueCode)
|
|
|
+ }
|
|
|
},
|
|
|
// 树节点关闭
|
|
|
handleNodeCollapse(data) {
|
|
@@ -1498,7 +1469,6 @@ export default {
|
|
|
this.defaultShowNodes.length = index;
|
|
|
}
|
|
|
});
|
|
|
- // console.log(this.defaultShowNodes)
|
|
|
},
|
|
|
|
|
|
// 懒加载tree
|
|
@@ -1605,8 +1575,28 @@ export default {
|
|
|
//将指标添加进标签列表中
|
|
|
const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
|
|
|
this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
|
|
|
- this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId)
|
|
|
+ this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId).reverse();
|
|
|
this.changeTreeNode()
|
|
|
+
|
|
|
+
|
|
|
+ //滚动到高亮节点位置
|
|
|
+ this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
+ setTimeout(() => {
|
|
|
+ let node = document.getElementById(`node${this.select_node}`);
|
|
|
+ let parent = document.getElementsByClassName('tree-cont')[0];
|
|
|
+
|
|
|
+ //parent可视区间:[scrollTop,scrollTop+offsetHeight]
|
|
|
+ //node位置:node.offsetTop
|
|
|
+ const overTop = node.offsetTop+node.clientHeight+15<parent.scrollTop
|
|
|
+ const overBottom = node.offsetTop+node.clientHeight+15>parent.scrollTop+parent.offsetHeight
|
|
|
+ console.log(overBottom)
|
|
|
+ if(overTop){
|
|
|
+ parent.scrollTop = node.offsetTop-30
|
|
|
+ }
|
|
|
+ if(overBottom){
|
|
|
+ parent.scrollTop = node.offsetTop - parent.offsetHeight/2
|
|
|
+ }
|
|
|
+ },400)
|
|
|
},
|
|
|
|
|
|
/* 设置默认时间选中项 */
|
|
@@ -2068,8 +2058,6 @@ export default {
|
|
|
// 查找选中的节点信息
|
|
|
let select_obj = chartData?chartData:await this.findNode(deep_arr, id);
|
|
|
// 查找图表的分类父级id
|
|
|
- let arr = this.findParentNodeHandle(this.treeData,select_obj.ChartClassifyId); // 父的父的父-父的父-父
|
|
|
- this.defaultShowNodes = arr;
|
|
|
this.select_node = code;
|
|
|
|
|
|
// 重置筛选状态
|
|
@@ -2080,23 +2068,6 @@ export default {
|
|
|
this.select_date = [select_obj.StartDate, select_obj.EndDate]; //曲线日期选择
|
|
|
this.selected_chartType = select_obj.ChartType;
|
|
|
this.selected_chartid = id;
|
|
|
-
|
|
|
- //滚动到高亮节点位置
|
|
|
- setTimeout(() => {
|
|
|
- this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
- let node = document.getElementById(`node${this.select_node}`);
|
|
|
- let parent = document.getElementsByClassName('tree-cont')[0];
|
|
|
- //parent可视区间:[scrollTop,scrollTop+offsetHeight]
|
|
|
- //node位置:node.offsetTop
|
|
|
- const overTop = node.offsetTop+node.clientHeight+15<parent.scrollTop
|
|
|
- const overBottom = node.offsetTop+node.clientHeight+15>parent.scrollTop+parent.offsetHeight
|
|
|
- if(overTop){
|
|
|
- parent.scrollTop = node.offsetTop-30
|
|
|
- }
|
|
|
- if(overBottom){
|
|
|
- parent.scrollTop = node.offsetTop - parent.offsetHeight/2
|
|
|
- }
|
|
|
- },400)
|
|
|
},
|
|
|
|
|
|
/* 根据图表id 查找对象 */
|
|
@@ -2130,12 +2101,6 @@ export default {
|
|
|
this.expandKey.length && this.expandKey[0] === row.EdbCode
|
|
|
? []
|
|
|
: [row.EdbCode];
|
|
|
- //曲线图点击行 自动置底
|
|
|
- // if (this.selected_chartType === 1) {
|
|
|
- // this.$nextTick(() => {
|
|
|
- // $('.chart-min-cont')[0].scrollTop = 10000;
|
|
|
- // });
|
|
|
- // }
|
|
|
},
|
|
|
|
|
|
/* 设置row-key */
|
|
@@ -2148,12 +2113,6 @@ export default {
|
|
|
this.expandKey.length && this.expandKey[0] === row.EdbCode
|
|
|
? []
|
|
|
: [row.EdbCode];
|
|
|
- //曲线图点击行 自动置底
|
|
|
- // if (this.selected_chartType === 1) {
|
|
|
- // this.$nextTick(() => {
|
|
|
- // $('.chart-min-cont')[0].scrollTop = 10000;
|
|
|
- // });
|
|
|
- // }
|
|
|
this.$refs.tableRef.setCurrentRow(row);
|
|
|
},
|
|
|
// 查找树节点所有父节点
|