|
@@ -110,6 +110,7 @@
|
|
</div>
|
|
</div>
|
|
<!-- 目录自定义按钮区域 -->
|
|
<!-- 目录自定义按钮区域 -->
|
|
<div id="custom-button-zone" class="custom-button-zone">
|
|
<div id="custom-button-zone" class="custom-button-zone">
|
|
|
|
+ <img src="~@/assets/img/data_m/move_ico.png" style="pointer-events: none;" v-permission="permissionBtn.sandboxPermission.sandbox_classify_move"/>
|
|
<img src="~@/assets/img/sand_new/add_outline.png" class="add-classify-img" v-permission="permissionBtn.sandboxPermission.sandbox_classify_addEdit"/>
|
|
<img src="~@/assets/img/sand_new/add_outline.png" class="add-classify-img" v-permission="permissionBtn.sandboxPermission.sandbox_classify_addEdit"/>
|
|
<img src="~@/assets/img/sand_new/edit_outline.png" class="edit-classify-img" v-permission="permissionBtn.sandboxPermission.sandbox_classify_addEdit"/>
|
|
<img src="~@/assets/img/sand_new/edit_outline.png" class="edit-classify-img" v-permission="permissionBtn.sandboxPermission.sandbox_classify_addEdit"/>
|
|
<img src="~@/assets/img/sand_new/delete_outline.png" class="delete-classify-img" v-permission="permissionBtn.sandboxPermission.sandbox_classify_del"/>
|
|
<img src="~@/assets/img/sand_new/delete_outline.png" class="delete-classify-img" v-permission="permissionBtn.sandboxPermission.sandbox_classify_del"/>
|
|
@@ -129,15 +130,18 @@
|
|
{{ lastLevelClassifyName }}
|
|
{{ lastLevelClassifyName }}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="目录名称" prop="SandboxClassifyName">
|
|
<el-form-item label="目录名称" prop="SandboxClassifyName">
|
|
- <el-input v-model="classifyForm.SandboxClassifyName" style="width: 317px;" placeholder="请输入目录名称"></el-input>
|
|
|
|
|
|
+ <el-input v-model.trim="classifyForm.SandboxClassifyName" style="width: 317px;" placeholder="请输入目录名称"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="关联品种" prop="ChartPermissionId" v-if="hasVariety && (classifyAddTitle.indexOf('添加')!==-1)">
|
|
|
|
|
|
+ <el-form-item label="关联品种" prop="ChartPermissionId" v-if="hasVariety">
|
|
<el-cascader
|
|
<el-cascader
|
|
|
|
+ @change="chartPermissionIdChange"
|
|
:options="classifyArr"
|
|
:options="classifyArr"
|
|
:props="classifyProps"
|
|
:props="classifyProps"
|
|
v-model="classifyForm.ChartPermissionId"
|
|
v-model="classifyForm.ChartPermissionId"
|
|
placeholder="请选择对应品种"
|
|
placeholder="请选择对应品种"
|
|
id="classifyAddCascader"
|
|
id="classifyAddCascader"
|
|
|
|
+ ref="chartPermissionCascader"
|
|
|
|
+ :disabled="(classifyForm.SandboxClassifyId && classifyForm.Level!=1) || (!classifyForm.SandboxClassifyId && classifyForm.Level!=0)"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -162,24 +166,15 @@
|
|
<el-input v-model="saveOtherForm.chartName" style="width: 317px;" placeholder="请输入逻辑图名称"></el-input>
|
|
<el-input v-model="saveOtherForm.chartName" style="width: 317px;" placeholder="请输入逻辑图名称"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="分类" prop="classifyId" :rules="{required:true,message:'请选择分类',trigger:'change'}" >
|
|
<el-form-item label="分类" prop="classifyId" :rules="{required:true,message:'请选择分类',trigger:'change'}" >
|
|
- <el-popover
|
|
|
|
- placement="bottom"
|
|
|
|
- width="400"
|
|
|
|
- popper-class="classify-popper"
|
|
|
|
- trigger="click"
|
|
|
|
- v-model="selectClassifyShow">
|
|
|
|
- <tree :nodes="onlyClassifyTreeData" :setting="selectSetting" key="saveOther" @onCreated="getSelectZTree" @onClick="selectClassify" />
|
|
|
|
- <el-cascader
|
|
|
|
- slot="reference"
|
|
|
|
- :options="onlyClassifyTreeData"
|
|
|
|
- :props="{children: 'Children',
|
|
|
|
- label: 'SandboxClassifyName',
|
|
|
|
- value: 'SandboxClassifyId',emitPath:false,checkStrictly:true}"
|
|
|
|
- v-model="saveOtherForm.classifyId"
|
|
|
|
- popper-class="classify-cascader-popper"
|
|
|
|
- placeholder="请选择分类">
|
|
|
|
- </el-cascader>
|
|
|
|
- </el-popover>
|
|
|
|
|
|
+ <el-cascader
|
|
|
|
+ :options="onlyClassifyTreeData"
|
|
|
|
+ @change="classifyTreeChange"
|
|
|
|
+ :props="{children: 'Children',
|
|
|
|
+ label: 'SandboxClassifyName',
|
|
|
|
+ value: 'SandboxClassifyId',checkStrictly:true}"
|
|
|
|
+ v-model="saveOtherClassifys"
|
|
|
|
+ placeholder="请选择分类">
|
|
|
|
+ </el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div style="text-align: center;padding:40px 0 ;">
|
|
<div style="text-align: center;padding:40px 0 ;">
|
|
@@ -210,7 +205,6 @@ import { myGraph } from './common/gragh';
|
|
mixins:[mindmap],
|
|
mixins:[mindmap],
|
|
watch: {
|
|
watch: {
|
|
initData(newval) {
|
|
initData(newval) {
|
|
- console.log(newval);
|
|
|
|
if(!this.graph){
|
|
if(!this.graph){
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
this.init()
|
|
this.init()
|
|
@@ -261,9 +255,7 @@ import { myGraph } from './common/gragh';
|
|
showLine:false,
|
|
showLine:false,
|
|
showIcon:false,
|
|
showIcon:false,
|
|
selectedMulti:false,
|
|
selectedMulti:false,
|
|
- addDiyDom: this.addDiyDom,
|
|
|
|
- // addHoverDom: this.addHoverDom,
|
|
|
|
- // removeHoverDom: this.removeHoverDom
|
|
|
|
|
|
+ addHoverDom: this.addHoverDom,
|
|
},
|
|
},
|
|
edit:{
|
|
edit:{
|
|
enable:true,
|
|
enable:true,
|
|
@@ -283,25 +275,11 @@ import { myGraph } from './common/gragh';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
zTreeObj:{},
|
|
zTreeObj:{},
|
|
- selectSetting:{
|
|
|
|
- data:{
|
|
|
|
- key:{
|
|
|
|
- name:"SandboxClassifyName",
|
|
|
|
- children:"Children"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- view:{
|
|
|
|
- showLine:false,
|
|
|
|
- showIcon:false,
|
|
|
|
- selectedMulti:false
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- selectClassifyShow:false,
|
|
|
|
- selectZTreeObj:{},
|
|
|
|
lockLoding:null,
|
|
lockLoding:null,
|
|
viewSandbox:{},
|
|
viewSandbox:{},
|
|
activeNode:{},
|
|
activeNode:{},
|
|
addClassifyNodeTid:'',
|
|
addClassifyNodeTid:'',
|
|
|
|
+ locationNode:'',
|
|
movingRecoveData:{
|
|
movingRecoveData:{
|
|
targetNode:null,
|
|
targetNode:null,
|
|
treeNode:null,
|
|
treeNode:null,
|
|
@@ -309,6 +287,7 @@ import { myGraph } from './common/gragh';
|
|
},
|
|
},
|
|
graph:null,
|
|
graph:null,
|
|
initData:{},
|
|
initData:{},
|
|
|
|
+ customButtonDom:'',
|
|
// ------- 添加分类弹窗
|
|
// ------- 添加分类弹窗
|
|
classifyAddTitle:"添加分类",
|
|
classifyAddTitle:"添加分类",
|
|
classifyAddShow:false,
|
|
classifyAddShow:false,
|
|
@@ -316,7 +295,8 @@ import { myGraph } from './common/gragh';
|
|
classifyForm:{
|
|
classifyForm:{
|
|
SandboxClassifyId:0,
|
|
SandboxClassifyId:0,
|
|
SandboxClassifyName:'',
|
|
SandboxClassifyName:'',
|
|
- ChartPermissionId:null,
|
|
|
|
|
|
+ ChartPermissionId:0,
|
|
|
|
+ ChartPermissionName:'',
|
|
ParentId:0,
|
|
ParentId:0,
|
|
Level:0
|
|
Level:0
|
|
},
|
|
},
|
|
@@ -337,8 +317,7 @@ import { myGraph } from './common/gragh';
|
|
chartName:"",
|
|
chartName:"",
|
|
classifyId:""
|
|
classifyId:""
|
|
},
|
|
},
|
|
- saveOtherClassifys:'',
|
|
|
|
- locationActiveNode:'',
|
|
|
|
|
|
+ saveOtherClassifys:[],
|
|
operationType:'view',
|
|
operationType:'view',
|
|
popoverVisible:false,
|
|
popoverVisible:false,
|
|
popoverFlod:true,
|
|
popoverFlod:true,
|
|
@@ -347,48 +326,27 @@ import { myGraph } from './common/gragh';
|
|
checkedLinkList:[],
|
|
checkedLinkList:[],
|
|
linkNode:null,
|
|
linkNode:null,
|
|
popoverTimeout:null,
|
|
popoverTimeout:null,
|
|
- isSlideLeft:false
|
|
|
|
|
|
+ isSlideLeft:false,
|
|
|
|
+ locationParentIds:''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
this.getClassify()
|
|
this.getClassify()
|
|
|
|
+ if(sessionStorage.getItem("sandboxEditBack")){
|
|
|
|
+ this.locationParentIds=sessionStorage.getItem("sandboxEditBack").split(',')
|
|
|
|
+ this.getSandboxDetailFun(this.locationParentIds[this.locationParentIds.length-1])
|
|
|
|
+ }else{
|
|
|
|
+ this.getSandboxList()
|
|
|
|
+ }
|
|
this.getSandboxClassify()
|
|
this.getSandboxClassify()
|
|
- this.getSandboxClassifyOnly()
|
|
|
|
- this.getSandboxList()
|
|
|
|
- // this.setting.async={
|
|
|
|
- // enable:false,
|
|
|
|
- // type:'head'
|
|
|
|
- // url:(()=>{
|
|
|
|
- // console.log(process.env);
|
|
|
|
- // // console.log(process.env.VUE_APP_API_ROOT,'process.env.VUE_APP_API_ROOT');
|
|
|
|
- // // if(process.env.NODE_ENV === "development"){
|
|
|
|
- // // return "http://8.136.199.33:7777/adminapi/sandbox/classify/list"
|
|
|
|
- // // }else{
|
|
|
|
- // return process.env.VUE_APP_API_ROOT+'/sandbox/classify/list'
|
|
|
|
- // // }
|
|
|
|
- // })(),
|
|
|
|
- // type:'get',
|
|
|
|
- // autoParam: ["SandboxClassifyId"],
|
|
|
|
- // otherParam:{ "IsShowMe":this.isOnlyMe},
|
|
|
|
- // dataFilter: (treeId,parentNode,responseData)=>{
|
|
|
|
- // console.log(treeId,parentNode,responseData,'responseData');
|
|
|
|
- // return responseData.Data.AllNodes
|
|
|
|
- // },
|
|
|
|
- // headers:{
|
|
|
|
- // Authorization:localStorage.getItem("auth"),
|
|
|
|
- // Uuid:localStorage.getItem("uuid") || "",
|
|
|
|
- // AccessToken:localStorage.getItem("uuid")+"--zheshiyigename",
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
- // this.init()
|
|
|
|
this.popoverDom = $('#link-popover')[0];
|
|
this.popoverDom = $('#link-popover')[0];
|
|
this.popoverTriggerDom = $('#link-reference')[0];
|
|
this.popoverTriggerDom = $('#link-reference')[0];
|
|
|
|
|
|
this.popoverDom.addEventListener('mouseenter',this.clearPopoverTimeout)
|
|
this.popoverDom.addEventListener('mouseenter',this.clearPopoverTimeout)
|
|
this.popoverDom.addEventListener('mouseleave',this.closePopover)
|
|
this.popoverDom.addEventListener('mouseleave',this.closePopover)
|
|
-
|
|
|
|
|
|
+ this.customButtonDom = $('#custom-button-zone')[0]
|
|
},
|
|
},
|
|
beforeDestroy(){
|
|
beforeDestroy(){
|
|
this.popoverDom.removeEventListener('mouseenter',this.clearPopoverTimeout)
|
|
this.popoverDom.removeEventListener('mouseenter',this.clearPopoverTimeout)
|
|
@@ -401,20 +359,20 @@ import { myGraph } from './common/gragh';
|
|
customInterence.getvariety({
|
|
customInterence.getvariety({
|
|
CompanyType: 'ficc'
|
|
CompanyType: 'ficc'
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- console.log(res);
|
|
|
|
if(res.Ret !== 200) return
|
|
if(res.Ret !== 200) return
|
|
this.classifyArr = res.Data.List||[ ]
|
|
this.classifyArr = res.Data.List||[ ]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取沙盘图分类
|
|
// 获取沙盘图分类
|
|
getSandboxClassify(parentNode,locationNode) {
|
|
getSandboxClassify(parentNode,locationNode) {
|
|
- console.log(parentNode,locationNode,'parentNode,locationNode');
|
|
|
|
|
|
+ // parentNode--父节点
|
|
|
|
+ // locationNode--展开父节点后需要定位的子节点,拖拽后
|
|
const sandboxClassifyId = parentNode ? parentNode.SandboxClassifyId:0
|
|
const sandboxClassifyId = parentNode ? parentNode.SandboxClassifyId:0
|
|
sandInterface.getSandboxClassify({SandboxClassifyId:sandboxClassifyId,IsShowMe:this.searchParams.IsShowMe}).then(res=>{
|
|
sandInterface.getSandboxClassify({SandboxClassifyId:sandboxClassifyId,IsShowMe:this.searchParams.IsShowMe}).then(res=>{
|
|
- console.log(res);
|
|
|
|
if (res.Ret === 200) {
|
|
if (res.Ret === 200) {
|
|
let nodesData=res.Data.AllNodes || []
|
|
let nodesData=res.Data.AllNodes || []
|
|
nodesData.map(item =>{
|
|
nodesData.map(item =>{
|
|
|
|
+ // 添加是否是目录的字段
|
|
item.isCatalogue = item.SandboxId?false:true
|
|
item.isCatalogue = item.SandboxId?false:true
|
|
})
|
|
})
|
|
if(parentNode){
|
|
if(parentNode){
|
|
@@ -422,46 +380,45 @@ import { myGraph } from './common/gragh';
|
|
}else{
|
|
}else{
|
|
this.treeData = nodesData
|
|
this.treeData = nodesData
|
|
}
|
|
}
|
|
- if(locationNode){
|
|
|
|
|
|
+ let location = locationNode || this.locationNode
|
|
|
|
+ if(location){
|
|
let searchNode
|
|
let searchNode
|
|
- let locationId = locationNode.isCatalogue?locationNode.SandboxClassifyId:locationNode.SandboxId
|
|
|
|
|
|
+ let locationId = location.isCatalogue?location.SandboxClassifyId:location.SandboxId
|
|
if(parentNode){
|
|
if(parentNode){
|
|
- if(locationNode.isCatalogue){
|
|
|
|
|
|
+ if(location.isCatalogue){
|
|
searchNode=this.zTreeObj.getNodesByParam('SandboxClassifyId',+locationId,parentNode)
|
|
searchNode=this.zTreeObj.getNodesByParam('SandboxClassifyId',+locationId,parentNode)
|
|
}else{
|
|
}else{
|
|
searchNode=this.zTreeObj.getNodesByParam('SandboxId',+locationId,parentNode)
|
|
searchNode=this.zTreeObj.getNodesByParam('SandboxId',+locationId,parentNode)
|
|
}
|
|
}
|
|
- console.log(searchNode,'searchNode');
|
|
|
|
if(!(searchNode && searchNode.length>0)) return
|
|
if(!(searchNode && searchNode.length>0)) return
|
|
this.zTreeClick(null,'',searchNode[0],1)
|
|
this.zTreeClick(null,'',searchNode[0],1)
|
|
this.zTreeObj.selectNode(searchNode[0])
|
|
this.zTreeObj.selectNode(searchNode[0])
|
|
}else{
|
|
}else{
|
|
requestAnimationFrame(()=>{
|
|
requestAnimationFrame(()=>{
|
|
searchNode=this.zTreeObj.getNodesByParam('SandboxClassifyId',+locationId)
|
|
searchNode=this.zTreeObj.getNodesByParam('SandboxClassifyId',+locationId)
|
|
- console.log(searchNode,'searchNode');
|
|
|
|
if(!(searchNode && searchNode.length>0)) return
|
|
if(!(searchNode && searchNode.length>0)) return
|
|
this.zTreeClick(null,'',searchNode[0],1)
|
|
this.zTreeClick(null,'',searchNode[0],1)
|
|
this.zTreeObj.selectNode(searchNode[0])
|
|
this.zTreeObj.selectNode(searchNode[0])
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ this.locationNode=''
|
|
|
|
+ }else if(this.locationParentIds && this.locationParentIds.length>0){
|
|
|
|
+ // 获取分类列表后需要定位
|
|
|
|
+ requestAnimationFrame(()=>{
|
|
|
|
+ this.sandboxLocation(this.locationParentIds)
|
|
|
|
+ this.locationParentIds=[]
|
|
|
|
+ sessionStorage.removeItem('sandboxEditBack')
|
|
|
|
+ })
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getSandboxClassifyOnly(){
|
|
|
|
- sandInterface.getSandboxClassifyOnly().then(res=>{
|
|
|
|
- if (res.Ret === 200) {
|
|
|
|
- this.onlyClassifyTreeData=res.Data.AllNodes || []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
getSandboxList(type){
|
|
getSandboxList(type){
|
|
if(type == 'setCurrentIndex'){
|
|
if(type == 'setCurrentIndex'){
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.CurrentIndex=1
|
|
}
|
|
}
|
|
sandInterface.getSandboxListV2(this.searchParams).then(res=>{
|
|
sandInterface.getSandboxListV2(this.searchParams).then(res=>{
|
|
- console.log(res,'res');
|
|
|
|
if(res.Ret == 200){
|
|
if(res.Ret == 200){
|
|
if(!res.Data){
|
|
if(!res.Data){
|
|
this.pictureList=[]
|
|
this.pictureList=[]
|
|
@@ -477,45 +434,43 @@ import { myGraph } from './common/gragh';
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getSandboxDetailFun(SandboxId){
|
|
|
|
+ sandInterface.getSandboxDetail({SandboxId:SandboxId || this.activeNode.SandboxId}).then(res=>{
|
|
|
|
+ if(res.Ret == 200){
|
|
|
|
+ this.viewSandbox=res.Data
|
|
|
|
+ this.rightType='chart'
|
|
|
|
+ this.initData = JSON.parse(this.viewSandbox.Content)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getZTree(zTree){
|
|
getZTree(zTree){
|
|
this.zTreeObj=zTree
|
|
this.zTreeObj=zTree
|
|
},
|
|
},
|
|
- getSelectZTree(zTree){
|
|
|
|
- this.selectZTreeObj=zTree
|
|
|
|
- },
|
|
|
|
- selectClassify(event,treeId,treeNode,clickFlag){
|
|
|
|
- this.sandSaveParams.SandboxClassifyId = treeNode.SandboxClassifyId
|
|
|
|
- this.selectClassifyShow = false
|
|
|
|
- },
|
|
|
|
zTreeDragBefore(treeId,treeNodes){
|
|
zTreeDragBefore(treeId,treeNodes){
|
|
return this.permissionBtn.isShowBtn('sandboxPermission','sandbox_classify_move')
|
|
return this.permissionBtn.isShowBtn('sandboxPermission','sandbox_classify_move')
|
|
},
|
|
},
|
|
zTreeDropBefore(treeId,treeNodes,targetNode,moveType,isCopy){
|
|
zTreeDropBefore(treeId,treeNodes,targetNode,moveType,isCopy){
|
|
- console.log(treeId,treeNodes,targetNode,moveType,isCopy,'zTreeDropBefore');
|
|
|
|
if((!targetNode) && (!moveType)) return false
|
|
if((!targetNode) && (!moveType)) return false
|
|
if(((!treeNodes[0].isCatalogue) && targetNode.Level==1 && moveType!='inner')||
|
|
if(((!treeNodes[0].isCatalogue) && targetNode.Level==1 && moveType!='inner')||
|
|
((!targetNode.isCatalogue) && moveType=='inner')||
|
|
((!targetNode.isCatalogue) && moveType=='inner')||
|
|
(treeNodes[0].isCatalogue && targetNode.Level==5 && moveType=='inner')){
|
|
(treeNodes[0].isCatalogue && targetNode.Level==5 && moveType=='inner')){
|
|
return false
|
|
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"
|
|
|
|
- // }
|
|
|
|
|
|
+ // 用于接口失败后的还原位置
|
|
|
|
+ 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"
|
|
|
|
+ }
|
|
},
|
|
},
|
|
zTreeDrop(e,treeId,treeNodes,targetNode,moveType,isCopy){
|
|
zTreeDrop(e,treeId,treeNodes,targetNode,moveType,isCopy){
|
|
- console.log(treeId,treeNodes[0],targetNode,moveType,isCopy,'zTreeDrop');
|
|
|
|
if((!targetNode) && (!moveType)) return
|
|
if((!targetNode) && (!moveType)) return
|
|
- console.log(treeNodes[0].getParentNode(),targetNode.getParentNode());
|
|
|
|
let parentNode = treeNodes[0].getParentNode()
|
|
let parentNode = treeNodes[0].getParentNode()
|
|
let prevNode = treeNodes[0].getPreNode()
|
|
let prevNode = treeNodes[0].getPreNode()
|
|
let nextNode = treeNodes[0].getNextNode()
|
|
let nextNode = treeNodes[0].getNextNode()
|
|
@@ -536,48 +491,26 @@ import { myGraph } from './common/gragh';
|
|
this.zTreeObj.removeChildNodes(parentNode)
|
|
this.zTreeObj.removeChildNodes(parentNode)
|
|
}
|
|
}
|
|
this.getSandboxClassify(parentNode,treeNodes[0])
|
|
this.getSandboxClassify(parentNode,treeNodes[0])
|
|
|
|
+ }else{
|
|
|
|
+ // 接口失败后的还原位置
|
|
|
|
+ let result=this.zTreeObj.moveNode(this.movingRecoveData.targetNode,this.movingRecoveData.treeNode,this.movingRecoveData.moveType)
|
|
|
|
+ if(!result){
|
|
|
|
+ this.$message.error('目录位置还原失败,刷新目录')
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.getSandboxClassify()
|
|
|
|
+ },1000)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- // if((!targetNode) && (!moveType)) return
|
|
|
|
- // let parentNode = treeNodes[0].getParentNode()
|
|
|
|
- // let prevNode = treeNodes[0].getPreNode()
|
|
|
|
- // let nextNode = treeNodes[0].getNextNode()
|
|
|
|
- // //移动分类
|
|
|
|
- // let params={
|
|
|
|
- // ClassifyId:treeNodes[0].SandboxClassifyId,
|
|
|
|
- // SandboxId:treeNodes[0].isCatalogue?0:treeNodes[0].SandboxId,
|
|
|
|
- // ParentClassifyId:parentNode?parentNode.SandboxClassifyId:0,
|
|
|
|
- // PrevId:prevNode? (prevNode.isCatalogue?prevNode.SandboxClassifyId:prevNode.SandboxId) :0,
|
|
|
|
- // NextId:nextNode? (nextNode.isCatalogue?nextNode.SandboxClassifyId:nextNode.SandboxId) :0,
|
|
|
|
- // PrevType:prevNode?(prevNode.isCatalogue?1:2):0,
|
|
|
|
- // NextType:nextNode?(nextNode.isCatalogue?1:2):0
|
|
|
|
- // }
|
|
|
|
- // console.log(params);
|
|
|
|
- // sandInterface.sandboxClassifyMove(params).then(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){
|
|
|
|
- // // window.location.reload()
|
|
|
|
- // // }
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
},
|
|
},
|
|
zTreeExpandBefore(treeId, treeNode){
|
|
zTreeExpandBefore(treeId, treeNode){
|
|
- // console.log( treeId, treeNode);
|
|
|
|
if(treeNode.Children && treeNode.Children.length>0){
|
|
if(treeNode.Children && treeNode.Children.length>0){
|
|
return true
|
|
return true
|
|
}else{
|
|
}else{
|
|
this.getSandboxClassify(treeNode)
|
|
this.getSandboxClassify(treeNode)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- zTreeExpand(event, treeId, treeNode){
|
|
|
|
- // console.log(event, treeId, treeNode);
|
|
|
|
- },
|
|
|
|
zTreeClick(event, treeId, treeNode,clickFlag){
|
|
zTreeClick(event, treeId, treeNode,clickFlag){
|
|
- console.log(event, treeId, treeNode,clickFlag);
|
|
|
|
-
|
|
|
|
if(clickFlag==1){
|
|
if(clickFlag==1){
|
|
if(this.activeNode.SandboxClassifyId == treeNode.SandboxClassifyId &&
|
|
if(this.activeNode.SandboxClassifyId == treeNode.SandboxClassifyId &&
|
|
this.activeNode.SandboxId == treeNode.SandboxId){
|
|
this.activeNode.SandboxId == treeNode.SandboxId){
|
|
@@ -589,26 +522,18 @@ import { myGraph } from './common/gragh';
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.SandboxClassifyId = treeNode.SandboxClassifyId
|
|
this.searchParams.SandboxClassifyId = treeNode.SandboxClassifyId
|
|
this.getSandboxList('setCurrentIndex')
|
|
this.getSandboxList('setCurrentIndex')
|
|
- // this.rightType='list'
|
|
|
|
}else{
|
|
}else{
|
|
// 沙盘图
|
|
// 沙盘图
|
|
- sandInterface.getSandboxDetail({SandboxId:this.activeNode.SandboxId}).then(res=>{
|
|
|
|
- console.log(res);
|
|
|
|
- if(res.Ret == 200){
|
|
|
|
- this.viewSandbox=res.Data
|
|
|
|
- this.rightType='chart'
|
|
|
|
- this.initData = JSON.parse(this.viewSandbox.Content)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ this.getSandboxDetailFun()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(clickFlag==0 && treeNode.isCatalogue){
|
|
if(clickFlag==0 && treeNode.isCatalogue){
|
|
|
|
+ // 取消选中
|
|
this.activeNode={}
|
|
this.activeNode={}
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.CurrentIndex=1
|
|
this.searchParams.SandboxClassifyId = ''
|
|
this.searchParams.SandboxClassifyId = ''
|
|
this.getSandboxList('setCurrentIndex')
|
|
this.getSandboxList('setCurrentIndex')
|
|
- // this.rightType='list'
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onlyMeHandler(){
|
|
onlyMeHandler(){
|
|
@@ -618,7 +543,6 @@ import { myGraph } from './common/gragh';
|
|
this.getSandboxList('setCurrentIndex')
|
|
this.getSandboxList('setCurrentIndex')
|
|
},
|
|
},
|
|
searchHandle(query) {
|
|
searchHandle(query) {
|
|
- // console.log(query,"搜索");
|
|
|
|
this.searchCurrentIndex = 1;
|
|
this.searchCurrentIndex = 1;
|
|
this.KeyWord = query;
|
|
this.KeyWord = query;
|
|
this.searchSandbox()
|
|
this.searchSandbox()
|
|
@@ -641,7 +565,6 @@ import { myGraph } from './common/gragh';
|
|
},
|
|
},
|
|
searchLoad() {
|
|
searchLoad() {
|
|
// 加载更多
|
|
// 加载更多
|
|
- console.log("加载更多");
|
|
|
|
if(!this.searchHaveMore) return;
|
|
if(!this.searchHaveMore) return;
|
|
this.searchCurrentIndex++
|
|
this.searchCurrentIndex++
|
|
this.searchSandbox()
|
|
this.searchSandbox()
|
|
@@ -649,7 +572,6 @@ import { myGraph } from './common/gragh';
|
|
/* 聚焦获取当前检索 */
|
|
/* 聚焦获取当前检索 */
|
|
inputFocusHandle(e) {
|
|
inputFocusHandle(e) {
|
|
// 选取
|
|
// 选取
|
|
- console.log('选取',e.target.value);
|
|
|
|
this.searchCurrentIndex = 1;
|
|
this.searchCurrentIndex = 1;
|
|
this.KeyWord = e.target.value;
|
|
this.KeyWord = e.target.value;
|
|
if(this.KeyWord) {
|
|
if(this.KeyWord) {
|
|
@@ -678,12 +600,13 @@ import { myGraph } from './common/gragh';
|
|
},
|
|
},
|
|
addClassify(e,node){
|
|
addClassify(e,node){
|
|
e.stopPropagation()
|
|
e.stopPropagation()
|
|
- console.log(node);
|
|
|
|
this.addClassifyNodeTid = node.tId
|
|
this.addClassifyNodeTid = node.tId
|
|
this.lastLevelClassifyName = this.getParentNodeName(node)
|
|
this.lastLevelClassifyName = this.getParentNodeName(node)
|
|
this.classifyAddTitle="添加分类"
|
|
this.classifyAddTitle="添加分类"
|
|
this.classifyForm.Level = node.Level
|
|
this.classifyForm.Level = node.Level
|
|
this.classifyForm.ParentId = node.SandboxClassifyId
|
|
this.classifyForm.ParentId = node.SandboxClassifyId
|
|
|
|
+ this.classifyForm.ChartPermissionId = node.ChartPermissionId
|
|
|
|
+ this.classifyForm.ChartPermissionName = node.ChartPermissionName
|
|
this.classifyAddShow=true
|
|
this.classifyAddShow=true
|
|
},
|
|
},
|
|
getParentNodeName(node){
|
|
getParentNodeName(node){
|
|
@@ -695,13 +618,16 @@ import { myGraph } from './common/gragh';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
editClassify(e,node){
|
|
editClassify(e,node){
|
|
- console.log(node);
|
|
|
|
e.stopPropagation()
|
|
e.stopPropagation()
|
|
|
|
+ this.locationNode = node
|
|
let pNode = node.getParentNode()
|
|
let pNode = node.getParentNode()
|
|
this.lastLevelClassifyName = pNode ? pNode.SandboxClassifyName:''
|
|
this.lastLevelClassifyName = pNode ? pNode.SandboxClassifyName:''
|
|
this.classifyForm.SandboxClassifyId = node.SandboxClassifyId
|
|
this.classifyForm.SandboxClassifyId = node.SandboxClassifyId
|
|
|
|
+ this.classifyForm.Level = node.Level
|
|
this.classifyForm.SandboxClassifyName = node.SandboxClassifyName
|
|
this.classifyForm.SandboxClassifyName = node.SandboxClassifyName
|
|
- this.classifyAddTitle="重命名"
|
|
|
|
|
|
+ this.classifyForm.ChartPermissionId = node.ChartPermissionId
|
|
|
|
+ this.classifyForm.ChartPermissionName = node.ChartPermissionName
|
|
|
|
+ this.classifyAddTitle="编辑分类"
|
|
this.classifyAddShow=true
|
|
this.classifyAddShow=true
|
|
},
|
|
},
|
|
deleteClassify(e,node){
|
|
deleteClassify(e,node){
|
|
@@ -740,8 +666,7 @@ import { myGraph } from './common/gragh';
|
|
res.Data.DeleteStatus === 0 && node.SandboxId
|
|
res.Data.DeleteStatus === 0 && node.SandboxId
|
|
? this.delHandle(node.SandboxClassifyId, node.SandboxId, 1)
|
|
? this.delHandle(node.SandboxClassifyId, node.SandboxId, 1)
|
|
: this.delHandle(node.SandboxClassifyId, node.SandboxId);
|
|
: this.delHandle(node.SandboxClassifyId, node.SandboxId);
|
|
- }).catch(() => {
|
|
|
|
- });
|
|
|
|
|
|
+ }).catch(() => {});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -754,16 +679,15 @@ import { myGraph } from './common/gragh';
|
|
if (res.Ret === 200) {
|
|
if (res.Ret === 200) {
|
|
this.zTreeObj.removeNode(currentNode)
|
|
this.zTreeObj.removeNode(currentNode)
|
|
this.$message.success(res.Msg);
|
|
this.$message.success(res.Msg);
|
|
- // if(type && res.Data.SandboxId){
|
|
|
|
-
|
|
|
|
- // }else{
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ chartPermissionIdChange(value){
|
|
|
|
+ this.classifyForm.ChartPermissionName=
|
|
|
|
+ this.$refs.chartPermissionCascader.getCheckedNodes()[0] ?
|
|
|
|
+ this.$refs.chartPermissionCascader.getCheckedNodes()[0].label+'' || '':''
|
|
|
|
+ },
|
|
classifyAddSubmit(){
|
|
classifyAddSubmit(){
|
|
- console.log(this.classifyForm);
|
|
|
|
//提交
|
|
//提交
|
|
this.$refs.classifyFormRef.validate(valid=>{
|
|
this.$refs.classifyFormRef.validate(valid=>{
|
|
if(valid){
|
|
if(valid){
|
|
@@ -771,17 +695,23 @@ import { myGraph } from './common/gragh';
|
|
//编辑
|
|
//编辑
|
|
let params={
|
|
let params={
|
|
SandboxClassifyId:this.classifyForm.SandboxClassifyId,
|
|
SandboxClassifyId:this.classifyForm.SandboxClassifyId,
|
|
- SandboxClassifyName:this.classifyForm.SandboxClassifyName
|
|
|
|
|
|
+ SandboxClassifyName:this.classifyForm.SandboxClassifyName,
|
|
|
|
+ ChartPermissionId:this.classifyForm.ChartPermissionId,
|
|
|
|
+ ChartPermissionName:this.classifyForm.ChartPermissionName,
|
|
}
|
|
}
|
|
sandInterface.editSandboxClassify(params).then(res=>{
|
|
sandInterface.editSandboxClassify(params).then(res=>{
|
|
if(res.Ret == 200){
|
|
if(res.Ret == 200){
|
|
this.classifyAddShow=false
|
|
this.classifyAddShow=false
|
|
this.$message.success(this.classifyAddTitle+"成功")
|
|
this.$message.success(this.classifyAddTitle+"成功")
|
|
- let currentNode = this.zTreeObj.getSelectedNodes()[0]
|
|
|
|
|
|
+ let parentNode = this.locationNode.getParentNode()
|
|
|
|
|
|
- currentNode.SandboxClassifyName = this.classifyForm.SandboxClassifyName
|
|
|
|
- this.zTreeObj.updateNode(currentNode)
|
|
|
|
- // this.getSandboxClassify()
|
|
|
|
|
|
+ if(!parentNode){
|
|
|
|
+ this.getSandboxClassify(null,this.locationNode)
|
|
|
|
+ }else{
|
|
|
|
+ this.zTreeObj.removeChildNodes(parentNode)
|
|
|
|
+ this.zTreeObj.expandNode(parentNode,true,false,false,true)
|
|
|
|
+ this.zTreeClick(null,'',this.locationNode,1)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
@@ -790,7 +720,8 @@ import { myGraph } from './common/gragh';
|
|
SandboxClassifyName:this.classifyForm.SandboxClassifyName,
|
|
SandboxClassifyName:this.classifyForm.SandboxClassifyName,
|
|
ParentId:this.classifyForm.ParentId,
|
|
ParentId:this.classifyForm.ParentId,
|
|
Level:this.classifyForm.Level,
|
|
Level:this.classifyForm.Level,
|
|
- ChartPermissionId:this.classifyForm.ChartPermissionId
|
|
|
|
|
|
+ ChartPermissionId:this.classifyForm.ChartPermissionId,
|
|
|
|
+ ChartPermissionName:this.classifyForm.ChartPermissionName,
|
|
}
|
|
}
|
|
sandInterface.addSandboxClassify(params).then(res=>{
|
|
sandInterface.addSandboxClassify(params).then(res=>{
|
|
if(res.Ret == 200){
|
|
if(res.Ret == 200){
|
|
@@ -800,11 +731,8 @@ import { myGraph } from './common/gragh';
|
|
this.getSandboxClassify()
|
|
this.getSandboxClassify()
|
|
}else{
|
|
}else{
|
|
let curNode = this.zTreeObj.getNodeByTId(this.addClassifyNodeTid)
|
|
let curNode = this.zTreeObj.getNodeByTId(this.addClassifyNodeTid)
|
|
- // console.log(curNode,'');
|
|
|
|
this.zTreeObj.removeChildNodes(curNode)
|
|
this.zTreeObj.removeChildNodes(curNode)
|
|
- // this.$nextTick(()=>{
|
|
|
|
- this.zTreeObj.expandNode(curNode,true,false,false,true)
|
|
|
|
- // })
|
|
|
|
|
|
+ this.zTreeObj.expandNode(curNode,true,false,false,true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -817,7 +745,8 @@ import { myGraph } from './common/gragh';
|
|
this.classifyForm={
|
|
this.classifyForm={
|
|
SandboxClassifyId:0,
|
|
SandboxClassifyId:0,
|
|
SandboxClassifyName:'',
|
|
SandboxClassifyName:'',
|
|
- ChartPermissionId:null,
|
|
|
|
|
|
+ ChartPermissionId:0,
|
|
|
|
+ ChartPermissionName:'',
|
|
ParentId:0,
|
|
ParentId:0,
|
|
Level:0
|
|
Level:0
|
|
}
|
|
}
|
|
@@ -829,13 +758,9 @@ import { myGraph } from './common/gragh';
|
|
let scrollTop = this.$refs.pictureListRef.scrollTop;
|
|
let scrollTop = this.$refs.pictureListRef.scrollTop;
|
|
let clientHeight = this.$refs.pictureListRef.clientHeight;
|
|
let clientHeight = this.$refs.pictureListRef.clientHeight;
|
|
let scrollHeight = this.$refs.pictureListRef.scrollHeight;
|
|
let scrollHeight = this.$refs.pictureListRef.scrollHeight;
|
|
- // console.log('scrollTop:',scrollTop)
|
|
|
|
- // console.log('clientHeight:',clientHeight)
|
|
|
|
- // console.log('scrollHeight:',scrollHeight)
|
|
|
|
if(scrollTop + clientHeight >= scrollHeight-10 && this.pictureHaveMore){
|
|
if(scrollTop + clientHeight >= scrollHeight-10 && this.pictureHaveMore){
|
|
this.searchParams.CurrentIndex++
|
|
this.searchParams.CurrentIndex++
|
|
this.getSandboxList();
|
|
this.getSandboxList();
|
|
- console.log("加载更多");
|
|
|
|
}
|
|
}
|
|
},300),
|
|
},300),
|
|
/* 展示详情 */
|
|
/* 展示详情 */
|
|
@@ -849,19 +774,10 @@ import { myGraph } from './common/gragh';
|
|
this.sandboxLocation(ParentClassifys)
|
|
this.sandboxLocation(ParentClassifys)
|
|
},
|
|
},
|
|
async sandboxLocation(ParentClassifys){
|
|
async sandboxLocation(ParentClassifys){
|
|
- console.log(ParentClassifys,'ParentClassifys');
|
|
|
|
let beActiveNode=''
|
|
let beActiveNode=''
|
|
for (let i = 0; i < ParentClassifys.length; i++) {
|
|
for (let i = 0; i < ParentClassifys.length; i++) {
|
|
const element = ParentClassifys[i];
|
|
const element = ParentClassifys[i];
|
|
- // if(i == (ParentClassifys.length-1)){
|
|
|
|
- // console.log(+element,beActiveNode,'element');
|
|
|
|
- // let searchNode=this.zTreeObj.getNodesByParam('SandboxId',+element,beActiveNode)
|
|
|
|
- // console.log(searchNode[0]);
|
|
|
|
- // this.zTreeObj.selectNode(searchNode[0],false,false)
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
let searchNode=this.zTreeObj.getNodesByParam('SandboxClassifyId',+element,beActiveNode)
|
|
let searchNode=this.zTreeObj.getNodesByParam('SandboxClassifyId',+element,beActiveNode)
|
|
- console.log(searchNode,'searchNode',i);
|
|
|
|
if(!(searchNode&&searchNode.length>0)){
|
|
if(!(searchNode&&searchNode.length>0)){
|
|
if(!beActiveNode){
|
|
if(!beActiveNode){
|
|
break
|
|
break
|
|
@@ -883,12 +799,11 @@ import { myGraph } from './common/gragh';
|
|
beActiveNode = searchNode[0]
|
|
beActiveNode = searchNode[0]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.locationActiveNode=beActiveNode
|
|
|
|
// 选中
|
|
// 选中
|
|
- requestAnimationFrame(()=>{
|
|
|
|
|
|
+ this.activeNode = beActiveNode
|
|
|
|
+ setTimeout(()=>{
|
|
this.zTreeObj.selectNode(beActiveNode)
|
|
this.zTreeObj.selectNode(beActiveNode)
|
|
- this.activeNode = beActiveNode
|
|
|
|
- })
|
|
|
|
|
|
+ },300)
|
|
},
|
|
},
|
|
expandNodeAsync(parentNode,activeId,isLast=false){
|
|
expandNodeAsync(parentNode,activeId,isLast=false){
|
|
return new Promise((resolve,reject)=>{
|
|
return new Promise((resolve,reject)=>{
|
|
@@ -898,7 +813,6 @@ import { myGraph } from './common/gragh';
|
|
}else{
|
|
}else{
|
|
resultNode = this.zTreeObj.getNodesByParam('SandboxClassifyId',activeId,parentNode)
|
|
resultNode = this.zTreeObj.getNodesByParam('SandboxClassifyId',activeId,parentNode)
|
|
}
|
|
}
|
|
- console.log(resultNode,'resolve(resultNode)');
|
|
|
|
if(resultNode.length>0){
|
|
if(resultNode.length>0){
|
|
resolve(resultNode)
|
|
resolve(resultNode)
|
|
return
|
|
return
|
|
@@ -924,7 +838,6 @@ import { myGraph } from './common/gragh';
|
|
},
|
|
},
|
|
copyHandle:_.debounce(function ({ PicUrl }){
|
|
copyHandle:_.debounce(function ({ PicUrl }){
|
|
if(!PicUrl) return this.$message('暂无内容可复制')
|
|
if(!PicUrl) return this.$message('暂无内容可复制')
|
|
- console.log("复制");
|
|
|
|
this.lockLoding = this.$loading({
|
|
this.lockLoding = this.$loading({
|
|
lock: true,
|
|
lock: true,
|
|
text: '复制图片中...',
|
|
text: '复制图片中...',
|
|
@@ -965,7 +878,6 @@ import { myGraph } from './common/gragh';
|
|
}
|
|
}
|
|
},500),
|
|
},500),
|
|
deleteHandle(item,type){
|
|
deleteHandle(item,type){
|
|
- console.log(item,type);
|
|
|
|
this.$confirm("确定删除该沙盘图吗?", "提示", {
|
|
this.$confirm("确定删除该沙盘图吗?", "提示", {
|
|
type: "warning",
|
|
type: "warning",
|
|
})
|
|
})
|
|
@@ -977,7 +889,6 @@ import { myGraph } from './common/gragh';
|
|
if (res.Ret === 200) {
|
|
if (res.Ret === 200) {
|
|
this.$message.success(res.Msg);
|
|
this.$message.success(res.Msg);
|
|
let result = this.zTreeObj.getNodesByParam('SandboxId',item.SandboxId)[0]
|
|
let result = this.zTreeObj.getNodesByParam('SandboxId',item.SandboxId)[0]
|
|
- console.log(result);
|
|
|
|
if(type=='inList'){
|
|
if(type=='inList'){
|
|
// 在沙盘图列表中删除
|
|
// 在沙盘图列表中删除
|
|
if(result){
|
|
if(result){
|
|
@@ -985,8 +896,10 @@ import { myGraph } from './common/gragh';
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
// 在沙盘图详情删除
|
|
// 在沙盘图详情删除
|
|
- this.sandboxLocation([result.SandboxClassifyId])
|
|
|
|
this.zTreeObj.removeNode(result)
|
|
this.zTreeObj.removeNode(result)
|
|
|
|
+ let parentNode = result.getParentNode()
|
|
|
|
+ this.zTreeObj.selectNode(parentNode)
|
|
|
|
+ this.zTreeClick(null,'',parentNode,1)
|
|
}
|
|
}
|
|
this.getSandboxList('setCurrentIndex')
|
|
this.getSandboxList('setCurrentIndex')
|
|
|
|
|
|
@@ -995,16 +908,15 @@ import { myGraph } from './common/gragh';
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
- addDiyDom(treeId, treeNode) {
|
|
|
|
- // console.log(treeNode,'treeId, treeNode');
|
|
|
|
|
|
+ addHoverDom(treeId, treeNode){
|
|
var aObj = $("#" + treeNode.tId + "_a");
|
|
var aObj = $("#" + treeNode.tId + "_a");
|
|
- if ($("#diyBtn_"+treeNode.SandboxClassifyId).length>0) return;
|
|
|
|
|
|
+ if (aObj.find('#custom-button-zone').length>0) return;
|
|
|
|
+ let dom = this.customButtonDom.cloneNode(true)
|
|
|
|
+ let addClassifyDom = $(dom).find('.add-classify-img')[0]
|
|
|
|
+ let editClassifyDom = $(dom).find('.edit-classify-img')[0]
|
|
|
|
+ let delClassifyDom = $(dom).find('.delete-classify-img')[0]
|
|
if(treeNode.isCatalogue){
|
|
if(treeNode.isCatalogue){
|
|
//目录添加自定义按钮
|
|
//目录添加自定义按钮
|
|
- let dom = $('#custom-button-zone')[0].cloneNode(true)
|
|
|
|
- let addClassifyDom = $(dom).find('.add-classify-img')[0]
|
|
|
|
- let editClassifyDom = $(dom).find('.edit-classify-img')[0]
|
|
|
|
- let delClassifyDom = $(dom).find('.delete-classify-img')[0]
|
|
|
|
if(treeNode.Level>4){
|
|
if(treeNode.Level>4){
|
|
addClassifyDom && (addClassifyDom.style.display='none')
|
|
addClassifyDom && (addClassifyDom.style.display='none')
|
|
}else{
|
|
}else{
|
|
@@ -1013,15 +925,13 @@ import { myGraph } from './common/gragh';
|
|
editClassifyDom && editClassifyDom.addEventListener("click",(e)=>this.editClassify(e,treeNode))
|
|
editClassifyDom && editClassifyDom.addEventListener("click",(e)=>this.editClassify(e,treeNode))
|
|
delClassifyDom && delClassifyDom.addEventListener("click",(e)=>this.deleteClassify(e,treeNode))
|
|
delClassifyDom && delClassifyDom.addEventListener("click",(e)=>this.deleteClassify(e,treeNode))
|
|
|
|
|
|
- aObj.append(dom);
|
|
|
|
|
|
+ }else{
|
|
|
|
+ addClassifyDom && (addClassifyDom.style.display='none')
|
|
|
|
+ editClassifyDom && (editClassifyDom.style.display='none')
|
|
|
|
+ delClassifyDom && (delClassifyDom.style.display='none')
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ aObj.append(dom);
|
|
},
|
|
},
|
|
- // removeHoverDom(treeId, treeNode) {
|
|
|
|
- // console.log(treeId, treeNode,'treeId, treeNode');
|
|
|
|
- // $("#diyBtn_"+treeNode.SandboxClassifyId).unbind().remove();
|
|
|
|
- // $("#diyBtn_space_" +treeNode.SandboxClassifyId).unbind().remove();
|
|
|
|
- // }
|
|
|
|
addSand(){
|
|
addSand(){
|
|
const { href } = this.$router.resolve({ path: '/sandflow' });
|
|
const { href } = this.$router.resolve({ path: '/sandflow' });
|
|
window.open(href, '_blank');
|
|
window.open(href, '_blank');
|
|
@@ -1031,12 +941,21 @@ import { myGraph } from './common/gragh';
|
|
window.open(href, '_blank');
|
|
window.open(href, '_blank');
|
|
},
|
|
},
|
|
saveOther(){
|
|
saveOther(){
|
|
|
|
+ sandInterface.getSandboxClassifyOnly().then(res=>{
|
|
|
|
+ if (res.Ret === 200) {
|
|
|
|
+ this.onlyClassifyTreeData=res.Data.AllNodes || []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
this.saveOtherForm.chartName = this.viewSandbox.Name+"(1)"
|
|
this.saveOtherForm.chartName = this.viewSandbox.Name+"(1)"
|
|
this.saveOtherShow=true
|
|
this.saveOtherShow=true
|
|
},
|
|
},
|
|
|
|
+ classifyTreeChange(value){
|
|
|
|
+ if(!value){
|
|
|
|
+ this.saveOtherForm.classifyId=''
|
|
|
|
+ }
|
|
|
|
+ this.saveOtherForm.classifyId=value[value.length-1]
|
|
|
|
+ },
|
|
saveOtherSubmit: _.debounce( function() {
|
|
saveOtherSubmit: _.debounce( function() {
|
|
- // console.log(this.viewSandbox);
|
|
|
|
- // return
|
|
|
|
if(!this.graph.toJSON().cells.length) return this.$message.warning('画布无内容');
|
|
if(!this.graph.toJSON().cells.length) return this.$message.warning('画布无内容');
|
|
this.$refs.saveOtherFormRef.validate(valid=>{
|
|
this.$refs.saveOtherFormRef.validate(valid=>{
|
|
if(valid){
|
|
if(valid){
|
|
@@ -1068,12 +987,13 @@ import { myGraph } from './common/gragh';
|
|
this.lockLoding.close();
|
|
this.lockLoding.close();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- console.log(sandData,'sandData');
|
|
|
|
this.lockLoding.close();
|
|
this.lockLoding.close();
|
|
this.$message.success("另存为成功")
|
|
this.$message.success("另存为成功")
|
|
- let saveOtherIds = this.saveOtherClassifys.split(',')
|
|
|
|
- saveOtherIds.push(sandData.SandboxId)
|
|
|
|
- this.sandboxLocation(saveOtherIds)
|
|
|
|
|
|
+ //沙盘图详情
|
|
|
|
+ this.getSandboxDetailFun(sandData.SandboxId)
|
|
|
|
+
|
|
|
|
+ this.saveOtherClassifys.push(sandData.SandboxId)
|
|
|
|
+ this.sandboxLocation(this.saveOtherClassifys)
|
|
this.saveOtherShow=false
|
|
this.saveOtherShow=false
|
|
},{
|
|
},{
|
|
preserveDimensions:true,//让svg为实际图片大小
|
|
preserveDimensions:true,//让svg为实际图片大小
|
|
@@ -1088,19 +1008,6 @@ import { myGraph } from './common/gragh';
|
|
svg.setAttribute('viewBox',`${x-30} ${y-30} ${width+60} ${height+60}`)
|
|
svg.setAttribute('viewBox',`${x-30} ${y-30} ${width+60} ${height+60}`)
|
|
// // 在图表右下方 加上"来源:弘则研究"字样
|
|
// // 在图表右下方 加上"来源:弘则研究"字样
|
|
// let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
// let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
- // 去掉不该截图的添加图标
|
|
|
|
- let leftImg = svg.getElementsByClassName('left-topic-image')
|
|
|
|
- for (let i = 0; i < leftImg.length; i++) {
|
|
|
|
- const element = leftImg[i];
|
|
|
|
- element.parentElement.removeChild(element)
|
|
|
|
- i--
|
|
|
|
- }
|
|
|
|
- let rightImg = svg.getElementsByClassName('right-topic-image')
|
|
|
|
- for (let i = 0; i < rightImg.length; i++) {
|
|
|
|
- const element = rightImg[i];
|
|
|
|
- element.parentElement.removeChild(element)
|
|
|
|
- i--
|
|
|
|
- }
|
|
|
|
// let textNode = document.createElement('text')
|
|
// let textNode = document.createElement('text')
|
|
// textNode.setAttribute('x',(x-tx+width)/zoom-85)
|
|
// textNode.setAttribute('x',(x-tx+width)/zoom-85)
|
|
// textNode.setAttribute('y',(y-ty+height)/zoom+27)
|
|
// textNode.setAttribute('y',(y-ty+height)/zoom+27)
|
|
@@ -1117,6 +1024,12 @@ import { myGraph } from './common/gragh';
|
|
.x6-port {
|
|
.x6-port {
|
|
visibility: hidden;
|
|
visibility: hidden;
|
|
}
|
|
}
|
|
|
|
+ .left-topic-image{
|
|
|
|
+ visibility:hidden;
|
|
|
|
+ }
|
|
|
|
+ .right-topic-image{
|
|
|
|
+ visibility: hidden;
|
|
|
|
+ }
|
|
`
|
|
`
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -1126,10 +1039,11 @@ import { myGraph } from './common/gragh';
|
|
},500),
|
|
},500),
|
|
saveOtherClosed(){
|
|
saveOtherClosed(){
|
|
this.saveOtherForm={
|
|
this.saveOtherForm={
|
|
- chartName:"逻辑图名称",
|
|
|
|
|
|
+ chartName:"",
|
|
classifyId:""
|
|
classifyId:""
|
|
}
|
|
}
|
|
- this.selectZTreeObj.cancelSelectedNode()
|
|
|
|
|
|
+ this.saveOtherClassifys=[]
|
|
|
|
+ // this.selectZTreeObj.cancelSelectedNode()
|
|
this.$refs.saveOtherFormRef.clearValidate()
|
|
this.$refs.saveOtherFormRef.clearValidate()
|
|
},
|
|
},
|
|
copySandHandle: _.debounce(function() {
|
|
copySandHandle: _.debounce(function() {
|
|
@@ -1153,8 +1067,6 @@ import { myGraph } from './common/gragh';
|
|
img.onload = ()=>{
|
|
img.onload = ()=>{
|
|
canvas.width = img.width;
|
|
canvas.width = img.width;
|
|
canvas.height = img.height;
|
|
canvas.height = img.height;
|
|
- // console.log('width',img.width)
|
|
|
|
- // console.log('height',img.height)
|
|
|
|
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
ctx.fillStyle="#fff";
|
|
ctx.fillStyle="#fff";
|
|
ctx.fillRect(0, 0, img.width, img.height);
|
|
ctx.fillRect(0, 0, img.width, img.height);
|
|
@@ -1182,26 +1094,13 @@ import { myGraph } from './common/gragh';
|
|
preserveDimensions:true,//让svg为实际图片大小
|
|
preserveDimensions:true,//让svg为实际图片大小
|
|
beforeSerialize:(svg)=>{
|
|
beforeSerialize:(svg)=>{
|
|
const {x,y,width,height} = this.graph.getContentBBox(cells)
|
|
const {x,y,width,height} = this.graph.getContentBBox(cells)
|
|
- let {tx,ty} = this.graph.translate()
|
|
|
|
|
|
+ // let {tx,ty} = this.graph.translate()
|
|
//给导出的svg增加一点宽高
|
|
//给导出的svg增加一点宽高
|
|
svg.setAttribute('width',width+60)
|
|
svg.setAttribute('width',width+60)
|
|
svg.setAttribute('height',height+60)
|
|
svg.setAttribute('height',height+60)
|
|
//设置viewBox使图像居中
|
|
//设置viewBox使图像居中
|
|
svg.setAttribute('viewBox',`${x-30} ${y-30} ${width+60} ${height+60}`)
|
|
svg.setAttribute('viewBox',`${x-30} ${y-30} ${width+60} ${height+60}`)
|
|
// let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
// let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
- // 去掉不该截图的添加图标
|
|
|
|
- let leftImg = svg.getElementsByClassName('left-topic-image')
|
|
|
|
- for (let i = 0; i < leftImg.length; i++) {
|
|
|
|
- const element = leftImg[i];
|
|
|
|
- element.parentElement.removeChild(element)
|
|
|
|
- i--
|
|
|
|
- }
|
|
|
|
- let rightImg = svg.getElementsByClassName('right-topic-image')
|
|
|
|
- for (let i = 0; i < rightImg.length; i++) {
|
|
|
|
- const element = rightImg[i];
|
|
|
|
- element.parentElement.removeChild(element)
|
|
|
|
- i--
|
|
|
|
- }
|
|
|
|
// let textNode = document.createElement('text')
|
|
// let textNode = document.createElement('text')
|
|
// textNode.setAttribute('x',x-tx+width-90)
|
|
// textNode.setAttribute('x',x-tx+width-90)
|
|
// textNode.setAttribute('y',y-ty+height+22)
|
|
// textNode.setAttribute('y',y-ty+height+22)
|
|
@@ -1210,38 +1109,28 @@ import { myGraph } from './common/gragh';
|
|
// textNode.innerText = '来源:弘则研究'
|
|
// textNode.innerText = '来源:弘则研究'
|
|
// gNode.appendChild(textNode)
|
|
// gNode.appendChild(textNode)
|
|
},
|
|
},
|
|
- copyStyles:false,
|
|
|
|
- stylesheet: `
|
|
|
|
|
|
+ copyStyles:false,
|
|
|
|
+ stylesheet: `
|
|
svg{
|
|
svg{
|
|
background-color:white;
|
|
background-color:white;
|
|
}
|
|
}
|
|
.x6-port {
|
|
.x6-port {
|
|
visibility: hidden;
|
|
visibility: hidden;
|
|
|
|
+ }
|
|
|
|
+ .left-topic-image{
|
|
|
|
+ visibility:hidden;
|
|
|
|
+ }
|
|
|
|
+ .right-topic-image{
|
|
|
|
+ visibility: hidden;
|
|
}`
|
|
}`
|
|
})
|
|
})
|
|
},500),
|
|
},500),
|
|
- selectClassify(event,treeId,treeNode,clickFlag){
|
|
|
|
- // console.log(treeNode);
|
|
|
|
- this.saveOtherForm.classifyId = treeNode.SandboxClassifyId
|
|
|
|
- this.saveOtherClassifys=this.getParentClassifyIds(treeNode)
|
|
|
|
- this.selectClassifyShow = false
|
|
|
|
- },
|
|
|
|
- getParentClassifyIds(treeNode){
|
|
|
|
- let parentNode = treeNode.getParentNode()
|
|
|
|
- if(parentNode){
|
|
|
|
- return this.getParentClassifyIds(parentNode)+','+treeNode.SandboxClassifyId
|
|
|
|
- }else{
|
|
|
|
- return treeNode.SandboxClassifyId+''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
//==============================画布
|
|
//==============================画布
|
|
// 初始化画布
|
|
// 初始化画布
|
|
init() {
|
|
init() {
|
|
- const graph = new myGraph('sand-chart-body',null,'','view');
|
|
|
|
- console.log(graph,'graph');
|
|
|
|
|
|
+ const graph = new myGraph('sand-chart-body',null,'view');
|
|
this.graph = graph;
|
|
this.graph = graph;
|
|
graph.on('node:mouseenter', ({ node, e }) => {
|
|
graph.on('node:mouseenter', ({ node, e }) => {
|
|
- console.log(node);
|
|
|
|
let data = node.data
|
|
let data = node.data
|
|
this.linkNode = node
|
|
this.linkNode = node
|
|
if(data && data.linkData && data.linkData.length>0){
|
|
if(data && data.linkData && data.linkData.length>0){
|
|
@@ -1266,10 +1155,6 @@ import { myGraph } from './common/gragh';
|
|
})
|
|
})
|
|
let clinetPositon=graph.localToClient(node.position())
|
|
let clinetPositon=graph.localToClient(node.position())
|
|
let size=node.size()
|
|
let size=node.size()
|
|
- console.log(clinetPositon,'clinetPositon',node.position());
|
|
|
|
- // const dom = $('#link-reference')[0];
|
|
|
|
- // console.log(this.popoverTriggerDom,'domdomdom');
|
|
|
|
- console.log(clinetPositon.x+size.width/2,clinetPositon.y);
|
|
|
|
this.popoverTriggerDom.style.left = clinetPositon.x+size.width/2 + 'px';
|
|
this.popoverTriggerDom.style.left = clinetPositon.x+size.width/2 + 'px';
|
|
this.popoverTriggerDom.style.top = clinetPositon.y + 'px';
|
|
this.popoverTriggerDom.style.top = clinetPositon.y + 'px';
|
|
this.popoverVisible=true
|
|
this.popoverVisible=true
|
|
@@ -1300,7 +1185,6 @@ import { myGraph } from './common/gragh';
|
|
})
|
|
})
|
|
},
|
|
},
|
|
navigateTo(item){
|
|
navigateTo(item){
|
|
- console.log(item,'item');
|
|
|
|
if(item.Type == 1){
|
|
if(item.Type == 1){
|
|
if(item.databaseType==0){
|
|
if(item.databaseType==0){
|
|
// 普通指标
|
|
// 普通指标
|