|
@@ -232,11 +232,13 @@ import { myGraph } from './common/gragh';
|
|
},
|
|
},
|
|
edit:{
|
|
edit:{
|
|
enable:true,
|
|
enable:true,
|
|
|
|
+ isCopy:false,
|
|
showRemoveBtn:false,
|
|
showRemoveBtn:false,
|
|
showRenameBtn:false
|
|
showRenameBtn:false
|
|
},
|
|
},
|
|
callback:{
|
|
callback:{
|
|
beforeDrop:this.zTreeDropBefore,
|
|
beforeDrop:this.zTreeDropBefore,
|
|
|
|
+ onDrop:this.zTreeDrop,
|
|
beforeExpand:this.zTreeExpandBefore,
|
|
beforeExpand:this.zTreeExpandBefore,
|
|
onClick:this.zTreeClick
|
|
onClick:this.zTreeClick
|
|
}
|
|
}
|
|
@@ -259,6 +261,13 @@ import { myGraph } from './common/gragh';
|
|
selectZTreeObj:{},
|
|
selectZTreeObj:{},
|
|
copyImgLoding:null,
|
|
copyImgLoding:null,
|
|
viewSandbox:{},
|
|
viewSandbox:{},
|
|
|
|
+ activeNode:{},
|
|
|
|
+ addClassifyNodeTid:'',
|
|
|
|
+ movingRecoveData:{
|
|
|
|
+ targetNode:null,
|
|
|
|
+ treeNode:null,
|
|
|
|
+ moveType:''
|
|
|
|
+ },
|
|
graph:null,
|
|
graph:null,
|
|
initData:{},
|
|
initData:{},
|
|
// ------- 添加分类弹窗
|
|
// ------- 添加分类弹窗
|
|
@@ -295,8 +304,9 @@ import { myGraph } from './common/gragh';
|
|
this.getClassify()
|
|
this.getClassify()
|
|
this.getSandboxClassify()
|
|
this.getSandboxClassify()
|
|
this.getSandboxList()
|
|
this.getSandboxList()
|
|
- // this.setting.async={
|
|
|
|
- // enable:true,
|
|
|
|
|
|
+ this.setting.async={
|
|
|
|
+ enable:false,
|
|
|
|
+ type:'head'
|
|
// url:(()=>{
|
|
// url:(()=>{
|
|
// console.log(process.env);
|
|
// console.log(process.env);
|
|
// // console.log(process.env.VUE_APP_API_ROOT,'process.env.VUE_APP_API_ROOT');
|
|
// // console.log(process.env.VUE_APP_API_ROOT,'process.env.VUE_APP_API_ROOT');
|
|
@@ -318,7 +328,7 @@ import { myGraph } from './common/gragh';
|
|
// Uuid:localStorage.getItem("uuid") || "",
|
|
// Uuid:localStorage.getItem("uuid") || "",
|
|
// AccessToken:localStorage.getItem("uuid")+"--zheshiyigename",
|
|
// AccessToken:localStorage.getItem("uuid")+"--zheshiyigename",
|
|
// }
|
|
// }
|
|
- // }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
// this.init()
|
|
// this.init()
|
|
@@ -356,8 +366,14 @@ import { myGraph } from './common/gragh';
|
|
sandInterface.getSandboxListV2(this.searchParams).then(res=>{
|
|
sandInterface.getSandboxListV2(this.searchParams).then(res=>{
|
|
console.log(res,'res');
|
|
console.log(res,'res');
|
|
if(res.Ret == 200){
|
|
if(res.Ret == 200){
|
|
- this.pictureList=res.Data.List || []
|
|
|
|
- this.total = res.Data.Paging.Totals || 0
|
|
|
|
|
|
+ if(!res.Data){
|
|
|
|
+ this.pictureList=[]
|
|
|
|
+ this.total = 0
|
|
|
|
+ }else{
|
|
|
|
+ this.pictureList=res.Data.List || []
|
|
|
|
+ this.total = res.Data.Paging.Totals || 0
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -369,10 +385,48 @@ import { myGraph } from './common/gragh';
|
|
},
|
|
},
|
|
zTreeDropBefore(treeId,treeNodes,targetNode,moveType,isCopy){
|
|
zTreeDropBefore(treeId,treeNodes,targetNode,moveType,isCopy){
|
|
console.log(treeId,treeNodes,targetNode,moveType,isCopy,'treeId,treeNodes,targetNode,moveType,isCop');
|
|
console.log(treeId,treeNodes,targetNode,moveType,isCopy,'treeId,treeNodes,targetNode,moveType,isCop');
|
|
- return false
|
|
|
|
|
|
+ if(((!treeNodes[0].isCatalogue) && targetNode.Level==1 && moveType!='inner')||
|
|
|
|
+ ((!targetNode.isCatalogue) && moveType=='inner')||
|
|
|
|
+ (treeNodes[0].isCatalogue && targetNode.Level==5 && moveType=='inner')){
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ this.movingRecoveData.treeNode=treeNodes[0]
|
|
|
|
+ if(treeNodes[0].getPreNode()){
|
|
|
|
+ this.movingRecoveData.targetNode = treeNodes[0].getPreNode()
|
|
|
|
+ this.movingRecoveData.moveType = "next"
|
|
|
|
+ }else if(treeNodes[0].getNextNode()){
|
|
|
|
+ this.movingRecoveData.targetNode = treeNodes[0].getNextNode()
|
|
|
|
+ this.movingRecoveData.moveType = "prev"
|
|
|
|
+ }else if(treeNodes[0].getParentNode()){
|
|
|
|
+ this.movingRecoveData.targetNode = treeNodes[0].getParentNode()
|
|
|
|
+ this.movingRecoveData.moveType = "inner"
|
|
|
|
+ }
|
|
|
|
+ console.log(treeNodes[0].SandboxClassifyId,treeNodes[0].getParentNode()?treeNodes[0].getParentNode().SandboxClassifyId:0,
|
|
|
|
+ treeNodes[0].getPreNode()?treeNodes[0].getPreNode().SandboxClassifyId:0,
|
|
|
|
+ treeNodes[0].getNextNode()?treeNodes[0].getNextNode().SandboxClassifyId:0,'before');
|
|
},
|
|
},
|
|
- zTreeDrop(treeId,treeNodes,targetNode,moveType,isCopy){
|
|
|
|
|
|
+ zTreeDrop(e,treeId,treeNodes,targetNode,moveType,isCopy){
|
|
console.log(treeId,treeNodes,targetNode,moveType,isCopy,'treeId,treeNodes,targetNode,moveType,isCop');
|
|
console.log(treeId,treeNodes,targetNode,moveType,isCopy,'treeId,treeNodes,targetNode,moveType,isCop');
|
|
|
|
+ console.log(treeNodes[0].SandboxClassifyId,treeNodes[0].getParentNode()?treeNodes[0].getParentNode().SandboxClassifyId:0,
|
|
|
|
+ treeNodes[0].getPreNode()?treeNodes[0].getPreNode().SandboxClassifyId:0,
|
|
|
|
+ treeNodes[0].getNextNode()?treeNodes[0].getNextNode().SandboxClassifyId:0);
|
|
|
|
+ let params={
|
|
|
|
+ ClassifyId:treeNodes[0].SandboxClassifyId,
|
|
|
|
+ ParentClassifyId:treeNodes[0].getParentNode()?treeNodes[0].getParentNode().SandboxClassifyId:0,
|
|
|
|
+ PrevClassifyId:treeNodes[0].getPreNode()?treeNodes[0].getPreNode().SandboxClassifyId:0,
|
|
|
|
+ NextClassifyId:treeNodes[0].getNextNode()?treeNodes[0].getNextNode().SandboxClassifyId:0
|
|
|
|
+ }
|
|
|
|
+ sandInterface.sandboxClassifyMove(params).then(res=>{
|
|
|
|
+ console.log(res);
|
|
|
|
+ if(res.Ret == 200){
|
|
|
|
+ this.$message.success('移动分类成功')
|
|
|
|
+ }else{
|
|
|
|
+ let result=this.zTreeObj.moveNode(this.movingRecoveData.targetNode,this.movingRecoveData.treeNode,this.movingRecoveData.moveType)
|
|
|
|
+ if(!result){
|
|
|
|
+ this.$message.error("还原分类位置失败,请刷新页面获取正确分类")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
zTreeExpandBefore(treeId, treeNode){
|
|
zTreeExpandBefore(treeId, treeNode){
|
|
console.log( treeId, treeNode);
|
|
console.log( treeId, treeNode);
|
|
@@ -387,7 +441,13 @@ import { myGraph } from './common/gragh';
|
|
},
|
|
},
|
|
zTreeClick(event, treeId, treeNode,clickFlag){
|
|
zTreeClick(event, treeId, treeNode,clickFlag){
|
|
console.log(event, treeId, treeNode,clickFlag);
|
|
console.log(event, treeId, treeNode,clickFlag);
|
|
|
|
+
|
|
if(clickFlag==1){
|
|
if(clickFlag==1){
|
|
|
|
+ if(this.activeNode.SandboxClassifyId == treeNode.SandboxClassifyId &&
|
|
|
|
+ this.activeNode.SandboxId == treeNode.SandboxId){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.activeNode = treeNode
|
|
if(treeNode.isCatalogue){
|
|
if(treeNode.isCatalogue){
|
|
// 目录
|
|
// 目录
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.CurrentIndex=1
|
|
@@ -396,13 +456,19 @@ import { myGraph } from './common/gragh';
|
|
this.getSandboxList()
|
|
this.getSandboxList()
|
|
}else{
|
|
}else{
|
|
// 沙盘图
|
|
// 沙盘图
|
|
- this.viewSandbox=item
|
|
|
|
- this.initData = JSON.parse(item.Content)
|
|
|
|
- this.rightType='chart'
|
|
|
|
|
|
+ sandInterface.getSandboxDetail({SandboxId:this.activeNode.SandboxId}).then(res=>{
|
|
|
|
+ console.log(res);
|
|
|
|
+ if(res.Ret == 200){
|
|
|
|
+ this.viewSandbox=res.Data
|
|
|
|
+ this.initData = JSON.parse(this.viewSandbox.Content)
|
|
|
|
+ this.rightType='chart'
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(clickFlag==0 && treeNode.isCatalogue){
|
|
if(clickFlag==0 && treeNode.isCatalogue){
|
|
|
|
+ this.activeNode={}
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.SandboxClassifyId = ''
|
|
this.searchParams.SandboxClassifyId = ''
|
|
this.rightType='list'
|
|
this.rightType='list'
|
|
@@ -410,7 +476,11 @@ import { myGraph } from './common/gragh';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onlyMeHandler(){
|
|
onlyMeHandler(){
|
|
|
|
+ // this.activeNode={}
|
|
this.getSandboxClassify()
|
|
this.getSandboxClassify()
|
|
|
|
+ this.searchParams.SandboxClassifyId=''
|
|
|
|
+ this.searchParams.CurrentIndex=1
|
|
|
|
+ this.getSandboxList()
|
|
},
|
|
},
|
|
searchHandle(query) {
|
|
searchHandle(query) {
|
|
console.log(query,"搜索");
|
|
console.log(query,"搜索");
|
|
@@ -440,14 +510,27 @@ import { myGraph } from './common/gragh';
|
|
addLevelOneHandle(){
|
|
addLevelOneHandle(){
|
|
this.classifyAddTitle="添加分类"
|
|
this.classifyAddTitle="添加分类"
|
|
this.classifyAddShow=true
|
|
this.classifyAddShow=true
|
|
|
|
+ this.addClassifyNodeTid=''
|
|
},
|
|
},
|
|
addClassify(e,node){
|
|
addClassify(e,node){
|
|
e.stopPropagation()
|
|
e.stopPropagation()
|
|
console.log(node);
|
|
console.log(node);
|
|
- this.lastLevelClassifyName = node.SandboxClassifyName
|
|
|
|
|
|
+ this.addClassifyNodeTid = node.tId
|
|
|
|
+ this.lastLevelClassifyName = this.getParentNodeName(node)
|
|
this.classifyAddTitle="添加分类"
|
|
this.classifyAddTitle="添加分类"
|
|
|
|
+ this.classifyForm.Level = node.Level
|
|
|
|
+ this.classifyForm.ParentId = node.SandboxClassifyId
|
|
this.classifyAddShow=true
|
|
this.classifyAddShow=true
|
|
},
|
|
},
|
|
|
|
+ getParentNodeName(node){
|
|
|
|
+ let parentNode = node.getParentNode()
|
|
|
|
+ if(parentNode){
|
|
|
|
+ return this.getParentNodeName(parentNode)+'/'+node.SandboxClassifyName
|
|
|
|
+ }else{
|
|
|
|
+ return node.SandboxClassifyName
|
|
|
|
+ }
|
|
|
|
+ // if(node.)
|
|
|
|
+ },
|
|
editClassify(e,node){
|
|
editClassify(e,node){
|
|
console.log(node);
|
|
console.log(node);
|
|
e.stopPropagation()
|
|
e.stopPropagation()
|
|
@@ -550,7 +633,35 @@ import { myGraph } from './common/gragh';
|
|
if(res.Ret == 200){
|
|
if(res.Ret == 200){
|
|
this.classifyAddShow=false
|
|
this.classifyAddShow=false
|
|
this.$message.success(this.classifyAddTitle+"成功")
|
|
this.$message.success(this.classifyAddTitle+"成功")
|
|
- this.getSandboxClassify()
|
|
|
|
|
|
+ if(!this.addClassifyNodeTid){
|
|
|
|
+ this.getSandboxClassify()
|
|
|
|
+ }else{
|
|
|
|
+ let curNode = this.zTreeObj.getNodeByTId(this.addClassifyNodeTid)
|
|
|
|
+ console.log(curNode);
|
|
|
|
+ // sandInterface.getSandboxClassify({SandboxClassifyId:curNode.SandboxClassifyId,IsShowMe:this.searchParams.IsShowMe}).then(res=>{
|
|
|
|
+ // console.log(res);
|
|
|
|
+ // if (res.Ret === 200) {
|
|
|
|
+ // let nodesData=res.Data.AllNodes || []
|
|
|
|
+ // nodesData.map(item =>{
|
|
|
|
+ // item.isCatalogue = item.SandboxId?false:true
|
|
|
|
+ // })
|
|
|
|
+ curNode.Children = []
|
|
|
|
+ console.log(curNode,'');
|
|
|
|
+ this.zTreeObj.reAsyncChildNodes(curNode,'refresh',false)
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
+ // this.zTreeObj.expandNode(curNode,false,false,false,true)
|
|
|
|
+ this.zTreeObj.expandNode(curNode,true,false,false,true)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // if(parentNode){
|
|
|
|
+ // this.zTreeObj.addNodes(parentNode,nodesData)
|
|
|
|
+ // }else{
|
|
|
|
+ // this.treeData = nodesData
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -663,8 +774,11 @@ import { myGraph } from './common/gragh';
|
|
if(treeNode.isCatalogue){
|
|
if(treeNode.isCatalogue){
|
|
//目录添加自定义按钮
|
|
//目录添加自定义按钮
|
|
let dom = $('#custom-button-zone')[0].cloneNode(true)
|
|
let dom = $('#custom-button-zone')[0].cloneNode(true)
|
|
-
|
|
|
|
- $(dom).find('.add-classify-img')[0].addEventListener("click",(e)=>this.addClassify(e,treeNode))
|
|
|
|
|
|
+ if(treeNode.Level>4){
|
|
|
|
+ $(dom).find('.add-classify-img')[0].style.display='none'
|
|
|
|
+ }else{
|
|
|
|
+ $(dom).find('.add-classify-img')[0].addEventListener("click",(e)=>this.addClassify(e,treeNode))
|
|
|
|
+ }
|
|
$(dom).find('.edit-classify-img')[0].addEventListener("click",(e)=>this.editClassify(e,treeNode))
|
|
$(dom).find('.edit-classify-img')[0].addEventListener("click",(e)=>this.editClassify(e,treeNode))
|
|
$(dom).find('.delete-classify-img')[0].addEventListener("click",(e)=>this.deleteClassify(e,treeNode))
|
|
$(dom).find('.delete-classify-img')[0].addEventListener("click",(e)=>this.deleteClassify(e,treeNode))
|
|
|
|
|