|
@@ -54,8 +54,8 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="database_main box" id="box" v-if="showData">
|
|
|
- <target-tree />
|
|
|
- <!-- <div class="main-left left" id="left">
|
|
|
+ <!-- <target-tree /> -->
|
|
|
+ <div class="main-left left" id="left">
|
|
|
<div class="tree-cont">
|
|
|
<el-tree
|
|
|
ref="menuTree"
|
|
@@ -113,7 +113,7 @@
|
|
|
style="width: 14px; height: 14px; margin-right: 8px"
|
|
|
v-if="data.Button.MoveButton"
|
|
|
/>
|
|
|
- 添加子项
|
|
|
+ <!-- 添加子项 -->
|
|
|
<img
|
|
|
src="~@/assets/img/set_m/add.png"
|
|
|
alt=""
|
|
@@ -121,7 +121,7 @@
|
|
|
@click.stop="addNode(node,data)"
|
|
|
v-if="data.Button.AddButton&&isEdbBtnShow('editCatalog')"
|
|
|
/>
|
|
|
- 编辑节点 如果是分类,判断data.Button.OpButton不变;如果是指标,不显示(ETA1.0.3)
|
|
|
+ <!-- 编辑节点 如果是分类,判断data.Button.OpButton不变;如果是指标,不显示(ETA1.0.3) -->
|
|
|
<img
|
|
|
src="~@/assets/img/set_m/edit.png"
|
|
|
alt=""
|
|
@@ -129,7 +129,7 @@
|
|
|
@click.stop="editNode(node,data)"
|
|
|
v-if="!data.EdbCode&&(data.Button.OpButton)&&isEdbBtnShow('editCatalog')"
|
|
|
/>
|
|
|
- 删除节点 如果是分类,判断data.Button.DeleteButton不变;如果是指标,不显示(ETA1.0.3)
|
|
|
+ <!-- 删除节点 如果是分类,判断data.Button.DeleteButton不变;如果是指标,不显示(ETA1.0.3) -->
|
|
|
<img
|
|
|
slot="reference"
|
|
|
src="~@/assets/img/set_m/del.png"
|
|
@@ -138,11 +138,11 @@
|
|
|
@click.stop="removeNode(node,data)"
|
|
|
v-if="!data.EdbCode&&(data.Button.DeleteButton)&&isEdbBtnShow('deleteCatalog')"
|
|
|
/>
|
|
|
- 查看计算指标
|
|
|
+ <!-- 查看计算指标 -->
|
|
|
<i class="el-icon-view"
|
|
|
v-if="data.EdbType===2&&![58,59,67,68].includes(data.Source)&&isEdbBtnShow('checkCalcChart')"
|
|
|
@click.stop="viewNode(node,data)"></i>
|
|
|
- 查看关联图表
|
|
|
+ <!-- 查看关联图表 -->
|
|
|
<img
|
|
|
v-if="data.Button.ShowChartRelation&&isEdbBtnShow('checkRelatedChart')"
|
|
|
@click.stop="showAssociateChart=true,showAssociateComputeData=false"
|
|
@@ -150,7 +150,7 @@
|
|
|
style="width: 14px; height: 14px;margin-left: 8px"
|
|
|
alt=""
|
|
|
/>
|
|
|
- 查看关联指标
|
|
|
+ <!-- 查看关联指标 -->
|
|
|
<img
|
|
|
v-if="data.Button.ShowEdbRelation&&isEdbBtnShow('checkRelatedEdb')"
|
|
|
@click.stop="showAssociateComputeData=true,showAssociateChart=false"
|
|
@@ -172,7 +172,7 @@
|
|
|
</div>
|
|
|
<span class="move-btn resize" v-drag id="resize" @mousemove="dynamicNode&&resetNodeStyle(dynamicNode)">
|
|
|
</span>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
<!-- 指标关联图模块 -->
|
|
|
<div class="main-right right" id="right" style="background:transparent;border:none;box-shadow:none" v-if="showAssociateChart">
|
|
|
<dataAssociateChart :edbInfoId="selected_edbid"></dataAssociateChart>
|
|
@@ -811,13 +811,13 @@ export default {
|
|
|
/* 获取树分类数据 */
|
|
|
getTreeData(params) {
|
|
|
|
|
|
- dataBaseInterface.menuListV3().then(res=>{
|
|
|
+ dataBaseInterface.targetCatalog({ParentId:0}).then(res=>{
|
|
|
if(res.Ret===200){
|
|
|
const arr=res.Data.AllNodes || []
|
|
|
this.treeData=arr.map(item=>{
|
|
|
return {
|
|
|
...item,
|
|
|
- isLeaf:item.Children.length?false:true
|
|
|
+ // isLeaf:item.Children.length?false:true
|
|
|
}
|
|
|
})
|
|
|
this.CanOpClassify = res.Data.CanOpClassify;
|
|
@@ -866,8 +866,9 @@ export default {
|
|
|
//将指标添加进标签列表中
|
|
|
const {EdbNameEn,EdbName,EdbInfoId,UniqueCode,ClassifyId}=res.Data.Item
|
|
|
this.addLabel({code:UniqueCode,id:EdbInfoId,classifyId:ClassifyId,EdbName,EdbNameEn})
|
|
|
- let deep_arr = _.cloneDeep(this.treeData);
|
|
|
- this.defaultShowNodes=this.findParentNodeHandle(deep_arr,ClassifyId).reverse()||[]
|
|
|
+ this.defaultShowNodes=["82b85be0c8273579d9f3fb7f6e49335f","bda0a4909f21a54c418a9e5b541a0c16","f373231b9ac9fc5b077acabdd7bce2ea"]
|
|
|
+ // let deep_arr = _.cloneDeep(this.treeData);
|
|
|
+ // this.defaultShowNodes=this.findParentNodeHandle(deep_arr,ClassifyId).reverse()||[]
|
|
|
//设置tree高亮
|
|
|
this.$refs.menuTree.setCurrentKey(UniqueCode);
|
|
|
|
|
@@ -1154,27 +1155,26 @@ export default {
|
|
|
}
|
|
|
this.isOpenDialog = true;
|
|
|
},
|
|
|
+ // 递归节点
|
|
|
+ getNodeParentData(data){
|
|
|
+ if(data.level===0) return
|
|
|
+ this.getNodeParentData(data.parent)
|
|
|
+ return {classifyName:data.data.ClassifyName,classifyId:data.data.ClassifyId}
|
|
|
+ },
|
|
|
/* 添加节点 */
|
|
|
addNode(node,data) {
|
|
|
- // console.log(node,data);
|
|
|
+ // console.log(node);
|
|
|
this.dialog_title = '添加';
|
|
|
+ let a=this.getNodeParentData(node)
|
|
|
+ console.log(a);
|
|
|
+
|
|
|
/* 添加目录 */
|
|
|
this.dialogForm = {
|
|
|
- level_1: node.level === 1
|
|
|
- ? data.ClassifyName
|
|
|
- :node.level === 2
|
|
|
- ? node.parent.data.ClassifyName
|
|
|
- : node.parent.parent.data.ClassifyName,
|
|
|
- level_2: node.level === 1
|
|
|
- ? ''
|
|
|
- :node.level === 2
|
|
|
- ? data.ClassifyName
|
|
|
- : node.parent.data.ClassifyName,
|
|
|
- // level_3: node.level === 3
|
|
|
- // ? data.ClassifyName
|
|
|
- // : '',
|
|
|
+ parentArr:[],
|
|
|
parent_id: data.ClassifyId,
|
|
|
- level: node.level
|
|
|
+ level: node.level,
|
|
|
+ levelVal:'',
|
|
|
+ isEDB:false
|
|
|
}
|
|
|
//存储当前要新增子级的目录code
|
|
|
sessionStorage.setItem('expandCode', data.UniqueCode);
|
|
@@ -1589,41 +1589,6 @@ export default {
|
|
|
})
|
|
|
return [...arr,code]
|
|
|
},
|
|
|
- // 懒加载tree
|
|
|
- handleTreeLoad(node,resolve){
|
|
|
- if(node.level===0){
|
|
|
- resolve(this.treeData)
|
|
|
- }
|
|
|
- if(node.level===1){
|
|
|
- let arr=[]
|
|
|
- this.treeData.forEach(item=>{
|
|
|
- if(item.UniqueCode===node.data.UniqueCode){
|
|
|
- arr=item.Children
|
|
|
- }
|
|
|
- })
|
|
|
- resolve(arr)
|
|
|
- }
|
|
|
- if(node.level===2){
|
|
|
- dataBaseInterface.getEdbListForClassify({ClassifyId:node.data.ClassifyId}).then(res=>{
|
|
|
- if(res.Ret===200){
|
|
|
- let arr=res.Data.EdbInfoList||[]
|
|
|
- arr=arr.map(item=>{
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- isLeaf:true
|
|
|
- }
|
|
|
- })
|
|
|
- resolve(arr)
|
|
|
- }else{
|
|
|
- resolve([])
|
|
|
- }
|
|
|
- this.changeTreeNode()
|
|
|
- })
|
|
|
- }
|
|
|
- if(node.level>2){
|
|
|
- resolve([])
|
|
|
- }
|
|
|
- },
|
|
|
/* 添加计算指标 */
|
|
|
addComputedHandler() {
|
|
|
this.computedTit = '计算指标';
|
|
@@ -1919,34 +1884,22 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
//绑定el-tree的load属性
|
|
|
- getLazyTreeData (node,resolve,maxLevel=3){
|
|
|
+ async getLazyTreeData (node,resolve){
|
|
|
if(node.level===0){
|
|
|
resolve(this.treeData)
|
|
|
- }
|
|
|
- if(node.level>0&&node.level<=maxLevel){
|
|
|
- //获取对应层级的Child
|
|
|
- resolve(node.data.Children||[])
|
|
|
- }
|
|
|
- if(node.level===maxLevel){
|
|
|
- //调接口获取该分类下指标的数据
|
|
|
- dataBaseInterface.getEdbListForClassify({ClassifyId:node.data.ClassifyId}).then(res=>{
|
|
|
- if(res.Ret===200){
|
|
|
- let arr=res.Data.EdbInfoList||[]
|
|
|
- arr=arr.map(item=>{
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- isLeaf:true
|
|
|
- }
|
|
|
- })
|
|
|
- resolve(arr)
|
|
|
- }else{
|
|
|
- resolve([])
|
|
|
- }
|
|
|
- this.changeTreeNode()
|
|
|
- })
|
|
|
- }
|
|
|
- if(node.level>maxLevel){
|
|
|
- resolve([])
|
|
|
+ }else{
|
|
|
+ let arr=[]
|
|
|
+ const res=await dataBaseInterface.targetCatalog({ParentId:node.data.ClassifyId})
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ const temarr = res.Data.AllNodes || [];
|
|
|
+ arr=temarr.map(item=>{
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ isLeaf:item.EdbInfoId?true:false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ resolve(arr)
|
|
|
}
|
|
|
},
|
|
|
//保存指标上下限
|