浏览代码

2023-02-15 update

1. 光伏功率曲线分析  调整默认激活的tree项
moccus 2 年之前
父节点
当前提交
769b31c2d4
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/pages/lightAnalysis/glAnalysis/index.vue

+ 9 - 0
src/pages/lightAnalysis/glAnalysis/index.vue

@@ -25,6 +25,7 @@ const funExcelCheckChange = ({ checkArr, data }) => {   //bug
 }
 /**tree 开始 */
 const treeData = ref([])
+const actTreeNode = ref(null)
 const funRepeatMap = (arr) => {
 	return arr.map(o => {
 		if (o.children) {
@@ -32,6 +33,9 @@ const funRepeatMap = (arr) => {
 			if (findIndex !== -1) {
 				o.childs = o.children
 				o.children = []
+				if(!actTreeNode.value){ //判断当且仅有process获取tree时 赋值
+					actTreeNode.value = o
+				}
 			}
 		}
 		return {
@@ -41,9 +45,14 @@ const funRepeatMap = (arr) => {
 	})
 }
 const funGetTree = async () => {
+	actTreeNode.value = null
+	excelCheckIds.value = []
 	const res = await request.get("/allfilelist")
 	treeData.value = funRepeatMap(res.data)
 	excelList.value = []
+	if(actTreeNode.value){
+		funCurrentChange({current: actTreeNode.value, currentNode: null})
+	}
 }
 const funCurrentChange = ({ current, currentNode }) => {
 	if (current.childs) {